@white-give/editor-react 1.0.1 → 1.0.3
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 +13 -12
- package/dist/index.d.ts +44 -44
- package/dist/lib/index.cjs +5 -5
- package/package.json +1 -1
package/dist/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react/jsx-runtime"),j=require("react"),kv=require("react-dom");var ST=typeof document<"u"?document.currentScript:null;const zi=[];for(let t=0;t<256;++t)zi.push((t+256).toString(16).slice(1));function wse(t,e=0){return(zi[t[e+0]]+zi[t[e+1]]+zi[t[e+2]]+zi[t[e+3]]+"-"+zi[t[e+4]]+zi[t[e+5]]+"-"+zi[t[e+6]]+zi[t[e+7]]+"-"+zi[t[e+8]]+zi[t[e+9]]+"-"+zi[t[e+10]]+zi[t[e+11]]+zi[t[e+12]]+zi[t[e+13]]+zi[t[e+14]]+zi[t[e+15]]).toLowerCase()}let _T;const Sse=new Uint8Array(16);function _se(){if(!_T){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");_T=crypto.getRandomValues.bind(crypto)}return _T(Sse)}const Tse=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),s5={randomUUID:Tse};function Cse(t,e,r){t=t||{};const n=t.random??t.rng?.()??_se();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,wse(n)}function Nv(t,e,r){return s5.randomUUID&&!t?s5.randomUUID():Cse(t)}const Ese=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Mse=t=>typeof t=="string",Ase=t=>typeof t=="function";var Gq=typeof global=="object"&&global&&global.Object===Object&&global,kse=typeof self=="object"&&self&&self.Object===Object&&self,ps=Gq||kse||Function("return this")(),kc=ps.Symbol,Wq=Object.prototype,Nse=Wq.hasOwnProperty,Dse=Wq.toString,kg=kc?kc.toStringTag:void 0;function Ose(t){var e=Nse.call(t,kg),r=t[kg];try{t[kg]=void 0;var n=!0}catch{}var i=Dse.call(t);return n&&(e?t[kg]=r:delete t[kg]),i}var Rse=Object.prototype,Ise=Rse.toString;function Lse(t){return Ise.call(t)}var Pse="[object Null]",Bse="[object Undefined]",l5=kc?kc.toStringTag:void 0;function Gd(t){return t==null?t===void 0?Bse:Pse:l5&&l5 in Object(t)?Ose(t):Lse(t)}function Nc(t){return t!=null&&typeof t=="object"}var zse="[object Symbol]";function d_(t){return typeof t=="symbol"||Nc(t)&&Gd(t)==zse}function qq(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var eo=Array.isArray,u5=kc?kc.prototype:void 0,c5=u5?u5.toString:void 0;function Kq(t){if(typeof t=="string")return t;if(eo(t))return qq(t,Kq)+"";if(d_(t))return c5?c5.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Fse=/\s/;function Vse(t){for(var e=t.length;e--&&Fse.test(t.charAt(e)););return e}var Hse=/^\s+/;function $se(t){return t&&t.slice(0,Vse(t)+1).replace(Hse,"")}function Io(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var f5=NaN,Use=/^[-+]0x[0-9a-f]+$/i,jse=/^0b[01]+$/i,Gse=/^0o[0-7]+$/i,Wse=parseInt;function d5(t){if(typeof t=="number")return t;if(d_(t))return f5;if(Io(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Io(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=$se(t);var r=jse.test(t);return r||Gse.test(t)?Wse(t.slice(2),r?2:8):Use.test(t)?f5:+t}function h_(t){return t}var qse="[object AsyncFunction]",Kse="[object Function]",Yse="[object GeneratorFunction]",Xse="[object Proxy]";function VI(t){if(!Io(t))return!1;var e=Gd(t);return e==Kse||e==Yse||e==qse||e==Xse}var TT=ps["__core-js_shared__"],h5=(function(){var t=/[^.]+$/.exec(TT&&TT.keys&&TT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Zse(t){return!!h5&&h5 in t}var Jse=Function.prototype,Qse=Jse.toString;function Wd(t){if(t!=null){try{return Qse.call(t)}catch{}try{return t+""}catch{}}return""}var ele=/[\\^$.*+?()[\]{}|]/g,tle=/^\[object .+?Constructor\]$/,rle=Function.prototype,nle=Object.prototype,ile=rle.toString,ale=nle.hasOwnProperty,ole=RegExp("^"+ile.call(ale).replace(ele,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sle(t){if(!Io(t)||Zse(t))return!1;var e=VI(t)?ole:tle;return e.test(Wd(t))}function lle(t,e){return t?.[e]}function qd(t,e){var r=lle(t,e);return sle(r)?r:void 0}var pD=qd(ps,"WeakMap"),p5=Object.create,ule=(function(){function t(){}return function(e){if(!Io(e))return{};if(p5)return p5(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function cle(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function fle(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var dle=800,hle=16,ple=Date.now;function vle(t){var e=0,r=0;return function(){var n=ple(),i=hle-(n-r);if(r=n,i>0){if(++e>=dle)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function gle(t){return function(){return t}}var qx=(function(){try{var t=qd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),mle=qx?function(t,e){return qx(t,"toString",{configurable:!0,enumerable:!1,value:gle(e),writable:!0})}:h_,yle=vle(mle);function ble(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var xle=9007199254740991,wle=/^(?:0|[1-9]\d*)$/;function HI(t,e){var r=typeof t;return e=e??xle,!!e&&(r=="number"||r!="symbol"&&wle.test(t))&&t>-1&&t%1==0&&t<e}function $I(t,e,r){e=="__proto__"&&qx?qx(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function v0(t,e){return t===e||t!==t&&e!==e}var Sle=Object.prototype,_le=Sle.hasOwnProperty;function Tle(t,e,r){var n=t[e];(!(_le.call(t,e)&&v0(n,r))||r===void 0&&!(e in t))&&$I(t,e,r)}function Cle(t,e,r,n){var i=!r;r||(r={});for(var a=-1,o=e.length;++a<o;){var s=e[a],l=void 0;l===void 0&&(l=t[s]),i?$I(r,s,l):Tle(r,s,l)}return r}var v5=Math.max;function Ele(t,e,r){return e=v5(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=v5(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(o),cle(t,this,s)}}function Mle(t,e){return yle(Ele(t,e,h_),t+"")}var Ale=9007199254740991;function UI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ale}function Dv(t){return t!=null&&UI(t.length)&&!VI(t)}function kle(t,e,r){if(!Io(r))return!1;var n=typeof e;return(n=="number"?Dv(r)&&HI(e,r.length):n=="string"&&e in r)?v0(r[e],t):!1}function Nle(t){return Mle(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&kle(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,a)}return e})}var Dle=Object.prototype;function jI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Dle;return t===r}function Ole(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Rle="[object Arguments]";function g5(t){return Nc(t)&&Gd(t)==Rle}var Yq=Object.prototype,Ile=Yq.hasOwnProperty,Lle=Yq.propertyIsEnumerable,Kx=g5((function(){return arguments})())?g5:function(t){return Nc(t)&&Ile.call(t,"callee")&&!Lle.call(t,"callee")};function Ple(){return!1}var Xq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m5=Xq&&typeof module=="object"&&module&&!module.nodeType&&module,Ble=m5&&m5.exports===Xq,y5=Ble?ps.Buffer:void 0,zle=y5?y5.isBuffer:void 0,Yx=zle||Ple,Fle="[object Arguments]",Vle="[object Array]",Hle="[object Boolean]",$le="[object Date]",Ule="[object Error]",jle="[object Function]",Gle="[object Map]",Wle="[object Number]",qle="[object Object]",Kle="[object RegExp]",Yle="[object Set]",Xle="[object String]",Zle="[object WeakMap]",Jle="[object ArrayBuffer]",Qle="[object DataView]",eue="[object Float32Array]",tue="[object Float64Array]",rue="[object Int8Array]",nue="[object Int16Array]",iue="[object Int32Array]",aue="[object Uint8Array]",oue="[object Uint8ClampedArray]",sue="[object Uint16Array]",lue="[object Uint32Array]",On={};On[eue]=On[tue]=On[rue]=On[nue]=On[iue]=On[aue]=On[oue]=On[sue]=On[lue]=!0;On[Fle]=On[Vle]=On[Jle]=On[Hle]=On[Qle]=On[$le]=On[Ule]=On[jle]=On[Gle]=On[Wle]=On[qle]=On[Kle]=On[Yle]=On[Xle]=On[Zle]=!1;function uue(t){return Nc(t)&&UI(t.length)&&!!On[Gd(t)]}function cue(t){return function(e){return t(e)}}var Zq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jm=Zq&&typeof module=="object"&&module&&!module.nodeType&&module,fue=jm&&jm.exports===Zq,CT=fue&&Gq.process,b5=(function(){try{var t=jm&&jm.require&&jm.require("util").types;return t||CT&&CT.binding&&CT.binding("util")}catch{}})(),x5=b5&&b5.isTypedArray,GI=x5?cue(x5):uue,due=Object.prototype,hue=due.hasOwnProperty;function Jq(t,e){var r=eo(t),n=!r&&Kx(t),i=!r&&!n&&Yx(t),a=!r&&!n&&!i&&GI(t),o=r||n||i||a,s=o?Ole(t.length,String):[],l=s.length;for(var u in t)(e||hue.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||HI(u,l)))&&s.push(u);return s}function Qq(t,e){return function(r){return t(e(r))}}var pue=Qq(Object.keys,Object),vue=Object.prototype,gue=vue.hasOwnProperty;function mue(t){if(!jI(t))return pue(t);var e=[];for(var r in Object(t))gue.call(t,r)&&r!="constructor"&&e.push(r);return e}function WI(t){return Dv(t)?Jq(t):mue(t)}function yue(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var bue=Object.prototype,xue=bue.hasOwnProperty;function wue(t){if(!Io(t))return yue(t);var e=jI(t),r=[];for(var n in t)n=="constructor"&&(e||!xue.call(t,n))||r.push(n);return r}function eK(t){return Dv(t)?Jq(t,!0):wue(t)}var Sue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_ue=/^\w*$/;function qI(t,e){if(eo(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||d_(t)?!0:_ue.test(t)||!Sue.test(t)||e!=null&&t in Object(e)}var by=qd(Object,"create");function Tue(){this.__data__=by?by(null):{},this.size=0}function Cue(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Eue="__lodash_hash_undefined__",Mue=Object.prototype,Aue=Mue.hasOwnProperty;function kue(t){var e=this.__data__;if(by){var r=e[t];return r===Eue?void 0:r}return Aue.call(e,t)?e[t]:void 0}var Nue=Object.prototype,Due=Nue.hasOwnProperty;function Oue(t){var e=this.__data__;return by?e[t]!==void 0:Due.call(e,t)}var Rue="__lodash_hash_undefined__";function Iue(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=by&&e===void 0?Rue:e,this}function Cd(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Cd.prototype.clear=Tue;Cd.prototype.delete=Cue;Cd.prototype.get=kue;Cd.prototype.has=Oue;Cd.prototype.set=Iue;function Lue(){this.__data__=[],this.size=0}function p_(t,e){for(var r=t.length;r--;)if(v0(t[r][0],e))return r;return-1}var Pue=Array.prototype,Bue=Pue.splice;function zue(t){var e=this.__data__,r=p_(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Bue.call(e,r,1),--this.size,!0}function Fue(t){var e=this.__data__,r=p_(e,t);return r<0?void 0:e[r][1]}function Vue(t){return p_(this.__data__,t)>-1}function Hue(t,e){var r=this.__data__,n=p_(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function vu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vu.prototype.clear=Lue;vu.prototype.delete=zue;vu.prototype.get=Fue;vu.prototype.has=Vue;vu.prototype.set=Hue;var xy=qd(ps,"Map");function $ue(){this.size=0,this.__data__={hash:new Cd,map:new(xy||vu),string:new Cd}}function Uue(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function v_(t,e){var r=t.__data__;return Uue(e)?r[typeof e=="string"?"string":"hash"]:r.map}function jue(t){var e=v_(this,t).delete(t);return this.size-=e?1:0,e}function Gue(t){return v_(this,t).get(t)}function Wue(t){return v_(this,t).has(t)}function que(t,e){var r=v_(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function gu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}gu.prototype.clear=$ue;gu.prototype.delete=jue;gu.prototype.get=Gue;gu.prototype.has=Wue;gu.prototype.set=que;var Kue="Expected a function";function KI(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Kue);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(KI.Cache||gu),r}KI.Cache=gu;var Yue=500;function Xue(t){var e=KI(t,function(n){return r.size===Yue&&r.clear(),n}),r=e.cache;return e}var Zue=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jue=/\\(\\)?/g,Que=Xue(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Zue,function(r,n,i,a){e.push(i?a.replace(Jue,"$1"):n||r)}),e});function ece(t){return t==null?"":Kq(t)}function tK(t,e){return eo(t)?t:qI(t,e)?[t]:Que(ece(t))}function g_(t){if(typeof t=="string"||d_(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function rK(t,e){e=tK(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[g_(e[r++])];return r&&r==n?t:void 0}function tce(t,e,r){var n=t==null?void 0:rK(t,e);return n===void 0?r:n}function rce(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var nK=Qq(Object.getPrototypeOf,Object),nce="[object Object]",ice=Function.prototype,ace=Object.prototype,iK=ice.toString,oce=ace.hasOwnProperty,sce=iK.call(Object);function lce(t){if(!Nc(t)||Gd(t)!=nce)return!1;var e=nK(t);if(e===null)return!0;var r=oce.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&iK.call(r)==sce}function uce(){this.__data__=new vu,this.size=0}function cce(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function fce(t){return this.__data__.get(t)}function dce(t){return this.__data__.has(t)}var hce=200;function pce(t,e){var r=this.__data__;if(r instanceof vu){var n=r.__data__;if(!xy||n.length<hce-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new gu(n)}return r.set(t,e),this.size=r.size,this}function Xs(t){var e=this.__data__=new vu(t);this.size=e.size}Xs.prototype.clear=uce;Xs.prototype.delete=cce;Xs.prototype.get=fce;Xs.prototype.has=dce;Xs.prototype.set=pce;var aK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,w5=aK&&typeof module=="object"&&module&&!module.nodeType&&module,vce=w5&&w5.exports===aK,S5=vce?ps.Buffer:void 0;S5&&S5.allocUnsafe;function gce(t,e){return t.slice()}function mce(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}function yce(){return[]}var bce=Object.prototype,xce=bce.propertyIsEnumerable,_5=Object.getOwnPropertySymbols,wce=_5?function(t){return t==null?[]:(t=Object(t),mce(_5(t),function(e){return xce.call(t,e)}))}:yce;function Sce(t,e,r){var n=e(t);return eo(t)?n:rce(n,r(t))}function T5(t){return Sce(t,WI,wce)}var vD=qd(ps,"DataView"),gD=qd(ps,"Promise"),mD=qd(ps,"Set"),C5="[object Map]",_ce="[object Object]",E5="[object Promise]",M5="[object Set]",A5="[object WeakMap]",k5="[object DataView]",Tce=Wd(vD),Cce=Wd(xy),Ece=Wd(gD),Mce=Wd(mD),Ace=Wd(pD),Zu=Gd;(vD&&Zu(new vD(new ArrayBuffer(1)))!=k5||xy&&Zu(new xy)!=C5||gD&&Zu(gD.resolve())!=E5||mD&&Zu(new mD)!=M5||pD&&Zu(new pD)!=A5)&&(Zu=function(t){var e=Gd(t),r=e==_ce?t.constructor:void 0,n=r?Wd(r):"";if(n)switch(n){case Tce:return k5;case Cce:return C5;case Ece:return E5;case Mce:return M5;case Ace:return A5}return e});var Xx=ps.Uint8Array;function kce(t){var e=new t.constructor(t.byteLength);return new Xx(e).set(new Xx(t)),e}function Nce(t,e){var r=kce(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function Dce(t){return typeof t.constructor=="function"&&!jI(t)?ule(nK(t)):{}}var Oce="__lodash_hash_undefined__";function Rce(t){return this.__data__.set(t,Oce),this}function Ice(t){return this.__data__.has(t)}function Zx(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new gu;++e<r;)this.add(t[e])}Zx.prototype.add=Zx.prototype.push=Rce;Zx.prototype.has=Ice;function Lce(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Pce(t,e){return t.has(e)}var Bce=1,zce=2;function oK(t,e,r,n,i,a){var o=r&Bce,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,h=r&zce?new Zx:void 0;for(a.set(t,e),a.set(e,t);++f<s;){var p=t[f],v=e[f];if(n)var g=o?n(v,p,f,e,t,a):n(p,v,f,t,e,a);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!Lce(e,function(m,y){if(!Pce(h,y)&&(p===m||i(p,m,r,n,a)))return h.push(y)})){d=!1;break}}else if(!(p===v||i(p,v,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function Fce(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function Vce(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Hce=1,$ce=2,Uce="[object Boolean]",jce="[object Date]",Gce="[object Error]",Wce="[object Map]",qce="[object Number]",Kce="[object RegExp]",Yce="[object Set]",Xce="[object String]",Zce="[object Symbol]",Jce="[object ArrayBuffer]",Qce="[object DataView]",N5=kc?kc.prototype:void 0,ET=N5?N5.valueOf:void 0;function efe(t,e,r,n,i,a,o){switch(r){case Qce:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Jce:return!(t.byteLength!=e.byteLength||!a(new Xx(t),new Xx(e)));case Uce:case jce:case qce:return v0(+t,+e);case Gce:return t.name==e.name&&t.message==e.message;case Kce:case Xce:return t==e+"";case Wce:var s=Fce;case Yce:var l=n&Hce;if(s||(s=Vce),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=$ce,o.set(t,e);var c=oK(s(t),s(e),n,i,a,o);return o.delete(t),c;case Zce:if(ET)return ET.call(t)==ET.call(e)}return!1}var tfe=1,rfe=Object.prototype,nfe=rfe.hasOwnProperty;function ife(t,e,r,n,i,a){var o=r&tfe,s=T5(t),l=s.length,u=T5(e),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var d=s[f];if(!(o?d in e:nfe.call(e,d)))return!1}var h=a.get(t),p=a.get(e);if(h&&p)return h==e&&p==t;var v=!0;a.set(t,e),a.set(e,t);for(var g=o;++f<l;){d=s[f];var m=t[d],y=e[d];if(n)var b=o?n(y,m,d,e,t,a):n(m,y,d,t,e,a);if(!(b===void 0?m===y||i(m,y,r,n,a):b)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(v=!1)}return a.delete(t),a.delete(e),v}var afe=1,D5="[object Arguments]",O5="[object Array]",S1="[object Object]",ofe=Object.prototype,R5=ofe.hasOwnProperty;function sfe(t,e,r,n,i,a){var o=eo(t),s=eo(e),l=o?O5:Zu(t),u=s?O5:Zu(e);l=l==D5?S1:l,u=u==D5?S1:u;var c=l==S1,f=u==S1,d=l==u;if(d&&Yx(t)){if(!Yx(e))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new Xs),o||GI(t)?oK(t,e,r,n,i,a):efe(t,e,l,r,n,i,a);if(!(r&afe)){var h=c&&R5.call(t,"__wrapped__"),p=f&&R5.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return a||(a=new Xs),i(v,g,r,n,a)}}return d?(a||(a=new Xs),ife(t,e,r,n,i,a)):!1}function YI(t,e,r,n,i){return t===e?!0:t==null||e==null||!Nc(t)&&!Nc(e)?t!==t&&e!==e:sfe(t,e,r,n,YI,i)}var lfe=1,ufe=2;function cfe(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var o=r[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){o=r[i];var s=o[0],l=t[s],u=o[1];if(o[2]){if(l===void 0&&!(s in t))return!1}else{var c=new Xs,f;if(!(f===void 0?YI(u,l,lfe|ufe,n,c):f))return!1}}return!0}function sK(t){return t===t&&!Io(t)}function ffe(t){for(var e=WI(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,sK(i)]}return e}function lK(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function dfe(t){var e=ffe(t);return e.length==1&&e[0][2]?lK(e[0][0],e[0][1]):function(r){return r===t||cfe(r,t,e)}}function hfe(t,e){return t!=null&&e in Object(t)}function pfe(t,e,r){e=tK(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var o=g_(e[n]);if(!(a=t!=null&&r(t,o)))break;t=t[o]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&UI(i)&&HI(o,i)&&(eo(t)||Kx(t)))}function vfe(t,e){return t!=null&&pfe(t,e,hfe)}var gfe=1,mfe=2;function yfe(t,e){return qI(t)&&sK(e)?lK(g_(t),e):function(r){var n=tce(r,t);return n===void 0&&n===e?vfe(r,t):YI(e,n,gfe|mfe)}}function bfe(t){return function(e){return e?.[t]}}function xfe(t){return function(e){return rK(e,t)}}function wfe(t){return qI(t)?bfe(g_(t)):xfe(t)}function Sfe(t){return typeof t=="function"?t:t==null?h_:typeof t=="object"?eo(t)?yfe(t[0],t[1]):dfe(t):wfe(t)}function _fe(t){return function(e,r,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var l=o[++i];if(r(a[l],l,a)===!1)break}return e}}var uK=_fe();function Tfe(t,e){return t&&uK(t,e,WI)}function Cfe(t,e){return function(r,n){if(r==null)return r;if(!Dv(r))return t(r,n);for(var i=r.length,a=-1,o=Object(r);++a<i&&n(o[a],a,o)!==!1;);return r}}var cK=Cfe(Tfe),MT=function(){return ps.Date.now()},Efe="Expected a function",Mfe=Math.max,Afe=Math.min;function g0(t,e,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(Efe);e=d5(e)||0,Io(r)&&(c=!!r.leading,f="maxWait"in r,a=f?Mfe(d5(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(_){var C=n,D=i;return n=i=void 0,u=_,o=t.apply(D,C),o}function p(_){return u=_,s=setTimeout(m,e),c?h(_):o}function v(_){var C=_-l,D=_-u,O=e-C;return f?Afe(O,a-D):O}function g(_){var C=_-l,D=_-u;return l===void 0||C>=e||C<0||f&&D>=a}function m(){var _=MT();if(g(_))return y(_);s=setTimeout(m,v(_))}function y(_){return s=void 0,d&&n?h(_):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function x(){return s===void 0?o:y(MT())}function w(){var _=MT(),C=g(_);if(n=arguments,i=this,l=_,C){if(s===void 0)return p(l);if(f)return clearTimeout(s),s=setTimeout(m,e),h(l)}return s===void 0&&(s=setTimeout(m,e)),o}return w.cancel=b,w.flush=x,w}function yD(t,e,r){(r!==void 0&&!v0(t[e],r)||r===void 0&&!(e in t))&&$I(t,e,r)}function kfe(t){return Nc(t)&&Dv(t)}function bD(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Nfe(t){return Cle(t,eK(t))}function Dfe(t,e,r,n,i,a,o){var s=bD(t,r),l=bD(e,r),u=o.get(l);if(u){yD(t,r,u);return}var c=a?a(s,l,r+"",t,e,o):void 0,f=c===void 0;if(f){var d=eo(l),h=!d&&Yx(l),p=!d&&!h&&GI(l);c=l,d||h||p?eo(s)?c=s:kfe(s)?c=fle(s):h?(f=!1,c=gce(l)):p?(f=!1,c=Nce(l)):c=[]:lce(l)||Kx(l)?(c=s,Kx(s)?c=Nfe(s):(!Io(s)||VI(s))&&(c=Dce(l))):f=!1}f&&(o.set(l,c),i(c,l,n,a,o),o.delete(l)),yD(t,r,c)}function fK(t,e,r,n,i){t!==e&&uK(e,function(a,o){if(i||(i=new Xs),Io(a))Dfe(t,e,o,r,fK,n,i);else{var s=n?n(bD(t,o),a,o+"",t,e,i):void 0;s===void 0&&(s=a),yD(t,o,s)}},eK)}function Ofe(t){return typeof t=="function"?t:h_}function Rfe(t,e){var r=eo(t)?ble:cK;return r(t,Ofe(e))}function Ife(t,e){var r=-1,n=Dv(t)?Array(t.length):[];return cK(t,function(i,a,o){n[++r]=e(i,a,o)}),n}function Kd(t,e){var r=eo(t)?qq:Ife;return r(t,Sfe(e))}function I5(t){return t===void 0}var Sa=Nle(function(t,e,r){fK(t,e,r)}),Lfe="Expected a function";function dK(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Lfe);return Io(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),g0(t,e,{leading:n,maxWait:e,trailing:i})}const L5=(t,e)=>{const r=Ese(t)&&Object.keys(t).includes("value")?t.value:t,n=Object.keys(r).reduce((a,o)=>(r[o]!==void 0&&(a[o]=r[o]),a),{});return Sa({},e??{},n)},Pfe={lineHeights:[{label:"单倍行距",value:1},{label:"1.5 倍行距",value:1.5},{label:"1.7 倍行距",value:1.7,default:!0},{label:"2 倍行距",value:2},{label:"2.5 倍行距",value:2.5},{label:"3 倍行距",value:3}],pageSizeOption:[{label:"网页",layout:"web"},{label:"A4",width:21,height:29.7,default:!0,layout:"page"},{label:"A3",width:29.7,height:42,layout:"page"},{label:"A5",width:14.8,height:21,layout:"page"},{label:"B5",width:17.6,height:25,layout:"page"},{label:"5号信纸",width:10.9,height:12.9,layout:"page"},{label:"6号信纸",width:11.9,height:22.9,layout:"page"},{label:"7号信纸",width:16.1,height:22.8,layout:"page"},{label:"9号信纸",width:22.8,height:32.3,layout:"page"},{label:"法律用纸",width:21.5,height:33.5,layout:"page"}]},hK=j.createContext(null),Ot=()=>{const t=j.useContext(hK);if(!t)throw new Error("useEditorContext must be used within an EditorProvider");return t},Bfe={document:{title:"无标题文档",content:"请输入内容"},editor:{readOnly:!1,autofocus:!1,parseOptions:{preserveWhitespace:"full"},editorProps:{},enableMarkdown:!0},layout:{toc:{show:!0},toolbar:{show:!0},foot:{show:!0,pageSize:!0,character:!0,copy:!0,download:!0}},file:{allowedMimeTypes:[],maxSize:1024*1024*100},ai:{enabled:!0,maxlength:100,async sendMessage(t){return new Promise(e=>{setTimeout(()=>{e(`这里是 AI 的回复。你发送了:${t.input}`)},1e3)})}},users:[{id:"Cassielxd",label:"Cassielxd"},{id:"Goldziher",label:"Na'aman Hirschfeld"},{id:"SerRashin",label:"SerRashin"},{id:"ChenErik",label:"ChenErik"},{id:"china-wangxu",label:"china-wangxu"},{id:"Sherman Xu",label:"xuzhenjun130"},{id:"testuser",label:"测试用户"}],echarts:{onSetOptions(t,e){return console.log("onSetOptions",t,e),null}},page:{layout:"page",showToc:!1,toolbar:"double",size:{key:"A4",width:21,height:29.7}},async onFileUpload(t){if(!t)throw new Error("没有找到要上传的文件");return console.log("onUpload",t),await new Promise(e=>setTimeout(e,3e3)),{id:Nv(),url:t.url??URL.createObjectURL(t),name:t.name,type:t.type,size:t.size}},onFileDelete(t,e){console.log(t,e)}},pK=({children:t,options:e={},...r})=>{const[n]=j.useState(`white-editor-${Nv()}`),[i,a]=j.useState(null),o=j.useMemo(()=>L5(e,Bfe),[e]),[s,l]=j.useState(()=>L5(o?.page,{layouts:["page","web"],watermark:{type:"测试",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""},margin:{left:3.18,right:3.18,top:2.54,bottom:2.54}})),[u,c]=j.useState(!1),[f,d]=j.useState(new Map),h=(m,y)=>{d(b=>{const x=new Map(b);return x.set(m,y),x})},p=m=>{d(y=>{const b=new Map(y);return b.delete(m),b})},v=j.useRef(r);j.useEffect(()=>{v.current=r},[r]),j.useEffect(()=>{if(!i)return;const m={create:({editor:y})=>v.current.onCreated?.({editor:y}),update:({editor:y})=>v.current.onChange?.({editor:y}),selectionUpdate:({editor:y})=>v.current.onSelectionUpdate?.({editor:y}),transaction:({editor:y,transaction:b})=>v.current.onTransaction?.({editor:y,transaction:b}),focus:({editor:y,event:b})=>v.current.onFocus?.({editor:y,event:b}),contentError:({editor:y,error:b,disableCollaboration:x})=>v.current.onContentError?.({editor:y,error:b,disableCollaboration:x}),blur:({editor:y,event:b})=>v.current.onBlur?.({editor:y,event:b}),destroy:()=>v.current.onDestroy?.()};return Object.entries(m).forEach(([y,b])=>{i.on(y,b)}),()=>{Object.entries(m).forEach(([y,b])=>{i.off(y,b)})}},[i]);const g={container:n,options:o,editor:i,setEditor:a,page:s,setPage:l,assistant:u,setAssistant:c,uploadFileMap:f,setUploadFile:h,deleteUploadFile:p,dicts:Pfe};return F.jsx(hK.Provider,{value:g,children:t})};var sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function m0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zfe(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _1={exports:{}},AT={};var P5;function Ffe(){if(P5)return AT;P5=1;var t=j;function e(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,a=t.useLayoutEffect,o=t.useDebugValue;function s(f,d){var h=d(),p=n({inst:{value:h,getSnapshot:d}}),v=p[0].inst,g=p[1];return a(function(){v.value=h,v.getSnapshot=d,l(v)&&g({inst:v})},[f,h,d]),i(function(){return l(v)&&g({inst:v}),f(function(){l(v)&&g({inst:v})})},[f]),o(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!r(f,h)}catch{return!0}}function u(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return AT.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:c,AT}var kT={};var B5;function Vfe(){return B5||(B5=1,process.env.NODE_ENV!=="production"&&(function(){function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function e(h,p){c||i.startTransition===void 0||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=p();if(!f){var g=p();a(v,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}g=o({inst:{value:v,getSnapshot:p}});var m=g[0].inst,y=g[1];return l(function(){m.value=v,m.getSnapshot=p,r(m)&&y({inst:m})},[h,v,p]),s(function(){return r(m)&&y({inst:m}),h(function(){r(m)&&y({inst:m})})},[h]),u(v),v}function r(h){var p=h.getSnapshot;h=h.value;try{var v=p();return!a(h,v)}catch{return!0}}function n(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=j,a=typeof Object.is=="function"?Object.is:t,o=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,f=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;kT.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),kT}var z5;function XI(){return z5||(z5=1,process.env.NODE_ENV==="production"?_1.exports=Ffe():_1.exports=Vfe()),_1.exports}var vK=XI();function Vi(t){this.content=t}Vi.prototype={constructor:Vi,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,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Vi(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Vi(r)},addToStart:function(t,e){return new Vi([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Vi(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Vi(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=Vi.from(t),t.size?new Vi(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Vi.from(t),t.size?new Vi(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Vi.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};Vi.from=function(t){if(t instanceof Vi)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Vi(e)};function gK(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=gK(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function mK(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,c=Math.min(o.text.length,s.text.length);for(;u<c&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=mK(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class pt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,r-c),n,i+c)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new pt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new pt(n,i)}cutByIndex(e,r){return e==r?pt.empty:e==0&&r==this.content.length?this:new pt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new pt(i,a)}addToStart(e){return new pt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new pt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))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 r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return gK(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return mK(this,e,r,n)}findIndex(e){if(e==0)return T1(0,e);if(e==this.size)return T1(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?T1(r+1,a):T1(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return pt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new pt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return pt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new pt(r||e,n)}static from(e){if(!e)return pt.empty;if(e instanceof pt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new pt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}pt.empty=new pt([],0);const NT={index:0,offset:0};function T1(t,e){return NT.index=t,NT.offset=e,NT}function Jx(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Jx(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Jx(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let Tn=class xD{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Jx(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return xD.none;if(e instanceof xD)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};Tn.none=[];class Qx extends Error{}class Vt{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=bK(this.content,e+this.openStart,r);return n&&new Vt(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Vt(yK(this.content,e+this.openStart,r+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,r){if(!r)return Vt.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Vt(pt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Vt(e,n,i)}}Vt.empty=new Vt(pt.empty,0,0);function yK(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(yK(a.content,e-i-1,r-i-1)))}function bK(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return n&&!n.canReplace(i,i,r)?null:t.cut(0,e).append(r).append(t.cut(e));let s=bK(o.content,e-a-1,r,o);return s&&t.replaceChild(i,o.copy(s))}function Hfe(t,e,r){if(r.openStart>t.depth)throw new Qx("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new Qx("Inconsistent open depths");return xK(t,e,r,0)}function xK(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=xK(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return fd(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=$fe(r,t);return fd(a,SK(t,o,s,e,n))}else return fd(a,ew(t,e,n))}function wK(t,e){if(!e.type.compatibleContent(t.type))throw new Qx("Cannot join "+e.type.name+" onto "+t.type.name)}function wD(t,e,r){let n=t.node(r);return wK(n,e.node(r)),n}function cd(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Gm(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(cd(t.nodeAfter,n),a++));for(let s=a;s<o;s++)cd(i.child(s),n);e&&e.depth==r&&e.textOffset&&cd(e.nodeBefore,n)}function fd(t,e){return t.type.checkContent(e),t.copy(e)}function SK(t,e,r,n,i){let a=t.depth>i&&wD(t,e,i+1),o=n.depth>i&&wD(r,n,i+1),s=[];return Gm(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(wK(a,o),cd(fd(a,SK(t,e,r,n,i+1)),s)):(a&&cd(fd(a,ew(t,e,i+1)),s),Gm(e,r,i,s),o&&cd(fd(o,ew(r,n,i+1)),s)),Gm(n,null,i,s),new pt(s)}function ew(t,e,r){let n=[];if(Gm(null,t,r,n),t.depth>r){let i=wD(t,e,r+1);cd(fd(i,ew(t,e,r+1)),n)}return Gm(e,null,r,n),new pt(n)}function $fe(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(pt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class wy{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.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[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return Tn.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new tw(this,e,n);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 r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new wy(r,n,a)}static resolveCached(e,r){let n=F5.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else F5.set(e,n=new Ufe);let i=n.elts[n.i]=wy.resolve(e,r);return n.i=(n.i+1)%jfe,i}}class Ufe{constructor(){this.elts=[],this.i=0}}const jfe=12,F5=new WeakMap;class tw{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}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 Gfe=Object.create(null);let Xl=class SD{constructor(e,r,n,i=Tn.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||pt.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,r,n,i=0){this.content.nodesBetween(e,r,n,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,r,n,i){return this.content.textBetween(e,r,n,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,r,n){return this.type==e&&Jx(this.attrs,r||e.defaultAttrs||Gfe)&&Tn.sameSet(this.marks,n||Tn.none)}copy(e=null){return e==this.content?this:new SD(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new SD(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Vt.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new Vt(u,i.depth-o,a.depth-o)}replace(e,r,n){return Hfe(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return wy.resolveCached(this,e)}resolveNoCache(e){return wy.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.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()+")"),_K(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=pt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}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=Tn.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Tn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r 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(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=pt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};Xl.prototype.text=void 0;class rw extends Xl{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):_K(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new rw(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new rw(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function _K(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class Ed{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new Wfe(e,r);if(n.next==null)return Ed.empty;let i=TK(n);n.next&&n.err("Unexpected trailing text");let a=Qfe(Jfe(i));return ede(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).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:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return pt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:f}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=a(f,s.concat(c));if(d)return d}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.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=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react/jsx-runtime"),j=require("react"),kv=require("react-dom");var ST=typeof document<"u"?document.currentScript:null;const zi=[];for(let t=0;t<256;++t)zi.push((t+256).toString(16).slice(1));function wse(t,e=0){return(zi[t[e+0]]+zi[t[e+1]]+zi[t[e+2]]+zi[t[e+3]]+"-"+zi[t[e+4]]+zi[t[e+5]]+"-"+zi[t[e+6]]+zi[t[e+7]]+"-"+zi[t[e+8]]+zi[t[e+9]]+"-"+zi[t[e+10]]+zi[t[e+11]]+zi[t[e+12]]+zi[t[e+13]]+zi[t[e+14]]+zi[t[e+15]]).toLowerCase()}let _T;const Sse=new Uint8Array(16);function _se(){if(!_T){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");_T=crypto.getRandomValues.bind(crypto)}return _T(Sse)}const Tse=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),s5={randomUUID:Tse};function Cse(t,e,r){t=t||{};const n=t.random??t.rng?.()??_se();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,wse(n)}function Nv(t,e,r){return s5.randomUUID&&!t?s5.randomUUID():Cse(t)}const Ese=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Mse=t=>typeof t=="string",Ase=t=>typeof t=="function";var Gq=typeof global=="object"&&global&&global.Object===Object&&global,kse=typeof self=="object"&&self&&self.Object===Object&&self,ps=Gq||kse||Function("return this")(),kc=ps.Symbol,Wq=Object.prototype,Nse=Wq.hasOwnProperty,Dse=Wq.toString,kg=kc?kc.toStringTag:void 0;function Ose(t){var e=Nse.call(t,kg),r=t[kg];try{t[kg]=void 0;var n=!0}catch{}var i=Dse.call(t);return n&&(e?t[kg]=r:delete t[kg]),i}var Rse=Object.prototype,Ise=Rse.toString;function Lse(t){return Ise.call(t)}var Pse="[object Null]",Bse="[object Undefined]",l5=kc?kc.toStringTag:void 0;function Gd(t){return t==null?t===void 0?Bse:Pse:l5&&l5 in Object(t)?Ose(t):Lse(t)}function Nc(t){return t!=null&&typeof t=="object"}var zse="[object Symbol]";function d_(t){return typeof t=="symbol"||Nc(t)&&Gd(t)==zse}function qq(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var eo=Array.isArray,u5=kc?kc.prototype:void 0,c5=u5?u5.toString:void 0;function Kq(t){if(typeof t=="string")return t;if(eo(t))return qq(t,Kq)+"";if(d_(t))return c5?c5.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Fse=/\s/;function Vse(t){for(var e=t.length;e--&&Fse.test(t.charAt(e)););return e}var Hse=/^\s+/;function $se(t){return t&&t.slice(0,Vse(t)+1).replace(Hse,"")}function Io(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var f5=NaN,Use=/^[-+]0x[0-9a-f]+$/i,jse=/^0b[01]+$/i,Gse=/^0o[0-7]+$/i,Wse=parseInt;function d5(t){if(typeof t=="number")return t;if(d_(t))return f5;if(Io(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Io(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=$se(t);var r=jse.test(t);return r||Gse.test(t)?Wse(t.slice(2),r?2:8):Use.test(t)?f5:+t}function h_(t){return t}var qse="[object AsyncFunction]",Kse="[object Function]",Yse="[object GeneratorFunction]",Xse="[object Proxy]";function VI(t){if(!Io(t))return!1;var e=Gd(t);return e==Kse||e==Yse||e==qse||e==Xse}var TT=ps["__core-js_shared__"],h5=(function(){var t=/[^.]+$/.exec(TT&&TT.keys&&TT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Zse(t){return!!h5&&h5 in t}var Jse=Function.prototype,Qse=Jse.toString;function Wd(t){if(t!=null){try{return Qse.call(t)}catch{}try{return t+""}catch{}}return""}var ele=/[\\^$.*+?()[\]{}|]/g,tle=/^\[object .+?Constructor\]$/,rle=Function.prototype,nle=Object.prototype,ile=rle.toString,ale=nle.hasOwnProperty,ole=RegExp("^"+ile.call(ale).replace(ele,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sle(t){if(!Io(t)||Zse(t))return!1;var e=VI(t)?ole:tle;return e.test(Wd(t))}function lle(t,e){return t?.[e]}function qd(t,e){var r=lle(t,e);return sle(r)?r:void 0}var pD=qd(ps,"WeakMap"),p5=Object.create,ule=(function(){function t(){}return function(e){if(!Io(e))return{};if(p5)return p5(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function cle(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function fle(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var dle=800,hle=16,ple=Date.now;function vle(t){var e=0,r=0;return function(){var n=ple(),i=hle-(n-r);if(r=n,i>0){if(++e>=dle)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function gle(t){return function(){return t}}var qx=(function(){try{var t=qd(Object,"defineProperty");return t({},"",{}),t}catch{}})(),mle=qx?function(t,e){return qx(t,"toString",{configurable:!0,enumerable:!1,value:gle(e),writable:!0})}:h_,yle=vle(mle);function ble(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var xle=9007199254740991,wle=/^(?:0|[1-9]\d*)$/;function HI(t,e){var r=typeof t;return e=e??xle,!!e&&(r=="number"||r!="symbol"&&wle.test(t))&&t>-1&&t%1==0&&t<e}function $I(t,e,r){e=="__proto__"&&qx?qx(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function v0(t,e){return t===e||t!==t&&e!==e}var Sle=Object.prototype,_le=Sle.hasOwnProperty;function Tle(t,e,r){var n=t[e];(!(_le.call(t,e)&&v0(n,r))||r===void 0&&!(e in t))&&$I(t,e,r)}function Cle(t,e,r,n){var i=!r;r||(r={});for(var a=-1,o=e.length;++a<o;){var s=e[a],l=void 0;l===void 0&&(l=t[s]),i?$I(r,s,l):Tle(r,s,l)}return r}var v5=Math.max;function Ele(t,e,r){return e=v5(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=v5(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(o),cle(t,this,s)}}function Mle(t,e){return yle(Ele(t,e,h_),t+"")}var Ale=9007199254740991;function UI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ale}function Dv(t){return t!=null&&UI(t.length)&&!VI(t)}function kle(t,e,r){if(!Io(r))return!1;var n=typeof e;return(n=="number"?Dv(r)&&HI(e,r.length):n=="string"&&e in r)?v0(r[e],t):!1}function Nle(t){return Mle(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&kle(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,a)}return e})}var Dle=Object.prototype;function jI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Dle;return t===r}function Ole(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Rle="[object Arguments]";function g5(t){return Nc(t)&&Gd(t)==Rle}var Yq=Object.prototype,Ile=Yq.hasOwnProperty,Lle=Yq.propertyIsEnumerable,Kx=g5((function(){return arguments})())?g5:function(t){return Nc(t)&&Ile.call(t,"callee")&&!Lle.call(t,"callee")};function Ple(){return!1}var Xq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m5=Xq&&typeof module=="object"&&module&&!module.nodeType&&module,Ble=m5&&m5.exports===Xq,y5=Ble?ps.Buffer:void 0,zle=y5?y5.isBuffer:void 0,Yx=zle||Ple,Fle="[object Arguments]",Vle="[object Array]",Hle="[object Boolean]",$le="[object Date]",Ule="[object Error]",jle="[object Function]",Gle="[object Map]",Wle="[object Number]",qle="[object Object]",Kle="[object RegExp]",Yle="[object Set]",Xle="[object String]",Zle="[object WeakMap]",Jle="[object ArrayBuffer]",Qle="[object DataView]",eue="[object Float32Array]",tue="[object Float64Array]",rue="[object Int8Array]",nue="[object Int16Array]",iue="[object Int32Array]",aue="[object Uint8Array]",oue="[object Uint8ClampedArray]",sue="[object Uint16Array]",lue="[object Uint32Array]",On={};On[eue]=On[tue]=On[rue]=On[nue]=On[iue]=On[aue]=On[oue]=On[sue]=On[lue]=!0;On[Fle]=On[Vle]=On[Jle]=On[Hle]=On[Qle]=On[$le]=On[Ule]=On[jle]=On[Gle]=On[Wle]=On[qle]=On[Kle]=On[Yle]=On[Xle]=On[Zle]=!1;function uue(t){return Nc(t)&&UI(t.length)&&!!On[Gd(t)]}function cue(t){return function(e){return t(e)}}var Zq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jm=Zq&&typeof module=="object"&&module&&!module.nodeType&&module,fue=jm&&jm.exports===Zq,CT=fue&&Gq.process,b5=(function(){try{var t=jm&&jm.require&&jm.require("util").types;return t||CT&&CT.binding&&CT.binding("util")}catch{}})(),x5=b5&&b5.isTypedArray,GI=x5?cue(x5):uue,due=Object.prototype,hue=due.hasOwnProperty;function Jq(t,e){var r=eo(t),n=!r&&Kx(t),i=!r&&!n&&Yx(t),a=!r&&!n&&!i&&GI(t),o=r||n||i||a,s=o?Ole(t.length,String):[],l=s.length;for(var u in t)(e||hue.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||HI(u,l)))&&s.push(u);return s}function Qq(t,e){return function(r){return t(e(r))}}var pue=Qq(Object.keys,Object),vue=Object.prototype,gue=vue.hasOwnProperty;function mue(t){if(!jI(t))return pue(t);var e=[];for(var r in Object(t))gue.call(t,r)&&r!="constructor"&&e.push(r);return e}function WI(t){return Dv(t)?Jq(t):mue(t)}function yue(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var bue=Object.prototype,xue=bue.hasOwnProperty;function wue(t){if(!Io(t))return yue(t);var e=jI(t),r=[];for(var n in t)n=="constructor"&&(e||!xue.call(t,n))||r.push(n);return r}function eK(t){return Dv(t)?Jq(t,!0):wue(t)}var Sue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_ue=/^\w*$/;function qI(t,e){if(eo(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||d_(t)?!0:_ue.test(t)||!Sue.test(t)||e!=null&&t in Object(e)}var by=qd(Object,"create");function Tue(){this.__data__=by?by(null):{},this.size=0}function Cue(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Eue="__lodash_hash_undefined__",Mue=Object.prototype,Aue=Mue.hasOwnProperty;function kue(t){var e=this.__data__;if(by){var r=e[t];return r===Eue?void 0:r}return Aue.call(e,t)?e[t]:void 0}var Nue=Object.prototype,Due=Nue.hasOwnProperty;function Oue(t){var e=this.__data__;return by?e[t]!==void 0:Due.call(e,t)}var Rue="__lodash_hash_undefined__";function Iue(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=by&&e===void 0?Rue:e,this}function Cd(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Cd.prototype.clear=Tue;Cd.prototype.delete=Cue;Cd.prototype.get=kue;Cd.prototype.has=Oue;Cd.prototype.set=Iue;function Lue(){this.__data__=[],this.size=0}function p_(t,e){for(var r=t.length;r--;)if(v0(t[r][0],e))return r;return-1}var Pue=Array.prototype,Bue=Pue.splice;function zue(t){var e=this.__data__,r=p_(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Bue.call(e,r,1),--this.size,!0}function Fue(t){var e=this.__data__,r=p_(e,t);return r<0?void 0:e[r][1]}function Vue(t){return p_(this.__data__,t)>-1}function Hue(t,e){var r=this.__data__,n=p_(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function vu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vu.prototype.clear=Lue;vu.prototype.delete=zue;vu.prototype.get=Fue;vu.prototype.has=Vue;vu.prototype.set=Hue;var xy=qd(ps,"Map");function $ue(){this.size=0,this.__data__={hash:new Cd,map:new(xy||vu),string:new Cd}}function Uue(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function v_(t,e){var r=t.__data__;return Uue(e)?r[typeof e=="string"?"string":"hash"]:r.map}function jue(t){var e=v_(this,t).delete(t);return this.size-=e?1:0,e}function Gue(t){return v_(this,t).get(t)}function Wue(t){return v_(this,t).has(t)}function que(t,e){var r=v_(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function gu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}gu.prototype.clear=$ue;gu.prototype.delete=jue;gu.prototype.get=Gue;gu.prototype.has=Wue;gu.prototype.set=que;var Kue="Expected a function";function KI(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Kue);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(KI.Cache||gu),r}KI.Cache=gu;var Yue=500;function Xue(t){var e=KI(t,function(n){return r.size===Yue&&r.clear(),n}),r=e.cache;return e}var Zue=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jue=/\\(\\)?/g,Que=Xue(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Zue,function(r,n,i,a){e.push(i?a.replace(Jue,"$1"):n||r)}),e});function ece(t){return t==null?"":Kq(t)}function tK(t,e){return eo(t)?t:qI(t,e)?[t]:Que(ece(t))}function g_(t){if(typeof t=="string"||d_(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function rK(t,e){e=tK(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[g_(e[r++])];return r&&r==n?t:void 0}function tce(t,e,r){var n=t==null?void 0:rK(t,e);return n===void 0?r:n}function rce(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var nK=Qq(Object.getPrototypeOf,Object),nce="[object Object]",ice=Function.prototype,ace=Object.prototype,iK=ice.toString,oce=ace.hasOwnProperty,sce=iK.call(Object);function lce(t){if(!Nc(t)||Gd(t)!=nce)return!1;var e=nK(t);if(e===null)return!0;var r=oce.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&iK.call(r)==sce}function uce(){this.__data__=new vu,this.size=0}function cce(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function fce(t){return this.__data__.get(t)}function dce(t){return this.__data__.has(t)}var hce=200;function pce(t,e){var r=this.__data__;if(r instanceof vu){var n=r.__data__;if(!xy||n.length<hce-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new gu(n)}return r.set(t,e),this.size=r.size,this}function Xs(t){var e=this.__data__=new vu(t);this.size=e.size}Xs.prototype.clear=uce;Xs.prototype.delete=cce;Xs.prototype.get=fce;Xs.prototype.has=dce;Xs.prototype.set=pce;var aK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,w5=aK&&typeof module=="object"&&module&&!module.nodeType&&module,vce=w5&&w5.exports===aK,S5=vce?ps.Buffer:void 0;S5&&S5.allocUnsafe;function gce(t,e){return t.slice()}function mce(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}function yce(){return[]}var bce=Object.prototype,xce=bce.propertyIsEnumerable,_5=Object.getOwnPropertySymbols,wce=_5?function(t){return t==null?[]:(t=Object(t),mce(_5(t),function(e){return xce.call(t,e)}))}:yce;function Sce(t,e,r){var n=e(t);return eo(t)?n:rce(n,r(t))}function T5(t){return Sce(t,WI,wce)}var vD=qd(ps,"DataView"),gD=qd(ps,"Promise"),mD=qd(ps,"Set"),C5="[object Map]",_ce="[object Object]",E5="[object Promise]",M5="[object Set]",A5="[object WeakMap]",k5="[object DataView]",Tce=Wd(vD),Cce=Wd(xy),Ece=Wd(gD),Mce=Wd(mD),Ace=Wd(pD),Zu=Gd;(vD&&Zu(new vD(new ArrayBuffer(1)))!=k5||xy&&Zu(new xy)!=C5||gD&&Zu(gD.resolve())!=E5||mD&&Zu(new mD)!=M5||pD&&Zu(new pD)!=A5)&&(Zu=function(t){var e=Gd(t),r=e==_ce?t.constructor:void 0,n=r?Wd(r):"";if(n)switch(n){case Tce:return k5;case Cce:return C5;case Ece:return E5;case Mce:return M5;case Ace:return A5}return e});var Xx=ps.Uint8Array;function kce(t){var e=new t.constructor(t.byteLength);return new Xx(e).set(new Xx(t)),e}function Nce(t,e){var r=kce(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function Dce(t){return typeof t.constructor=="function"&&!jI(t)?ule(nK(t)):{}}var Oce="__lodash_hash_undefined__";function Rce(t){return this.__data__.set(t,Oce),this}function Ice(t){return this.__data__.has(t)}function Zx(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new gu;++e<r;)this.add(t[e])}Zx.prototype.add=Zx.prototype.push=Rce;Zx.prototype.has=Ice;function Lce(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Pce(t,e){return t.has(e)}var Bce=1,zce=2;function oK(t,e,r,n,i,a){var o=r&Bce,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,h=r&zce?new Zx:void 0;for(a.set(t,e),a.set(e,t);++f<s;){var p=t[f],v=e[f];if(n)var g=o?n(v,p,f,e,t,a):n(p,v,f,t,e,a);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!Lce(e,function(m,y){if(!Pce(h,y)&&(p===m||i(p,m,r,n,a)))return h.push(y)})){d=!1;break}}else if(!(p===v||i(p,v,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function Fce(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function Vce(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Hce=1,$ce=2,Uce="[object Boolean]",jce="[object Date]",Gce="[object Error]",Wce="[object Map]",qce="[object Number]",Kce="[object RegExp]",Yce="[object Set]",Xce="[object String]",Zce="[object Symbol]",Jce="[object ArrayBuffer]",Qce="[object DataView]",N5=kc?kc.prototype:void 0,ET=N5?N5.valueOf:void 0;function efe(t,e,r,n,i,a,o){switch(r){case Qce:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Jce:return!(t.byteLength!=e.byteLength||!a(new Xx(t),new Xx(e)));case Uce:case jce:case qce:return v0(+t,+e);case Gce:return t.name==e.name&&t.message==e.message;case Kce:case Xce:return t==e+"";case Wce:var s=Fce;case Yce:var l=n&Hce;if(s||(s=Vce),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=$ce,o.set(t,e);var c=oK(s(t),s(e),n,i,a,o);return o.delete(t),c;case Zce:if(ET)return ET.call(t)==ET.call(e)}return!1}var tfe=1,rfe=Object.prototype,nfe=rfe.hasOwnProperty;function ife(t,e,r,n,i,a){var o=r&tfe,s=T5(t),l=s.length,u=T5(e),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var d=s[f];if(!(o?d in e:nfe.call(e,d)))return!1}var h=a.get(t),p=a.get(e);if(h&&p)return h==e&&p==t;var v=!0;a.set(t,e),a.set(e,t);for(var g=o;++f<l;){d=s[f];var m=t[d],y=e[d];if(n)var b=o?n(y,m,d,e,t,a):n(m,y,d,t,e,a);if(!(b===void 0?m===y||i(m,y,r,n,a):b)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(v=!1)}return a.delete(t),a.delete(e),v}var afe=1,D5="[object Arguments]",O5="[object Array]",S1="[object Object]",ofe=Object.prototype,R5=ofe.hasOwnProperty;function sfe(t,e,r,n,i,a){var o=eo(t),s=eo(e),l=o?O5:Zu(t),u=s?O5:Zu(e);l=l==D5?S1:l,u=u==D5?S1:u;var c=l==S1,f=u==S1,d=l==u;if(d&&Yx(t)){if(!Yx(e))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new Xs),o||GI(t)?oK(t,e,r,n,i,a):efe(t,e,l,r,n,i,a);if(!(r&afe)){var h=c&&R5.call(t,"__wrapped__"),p=f&&R5.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return a||(a=new Xs),i(v,g,r,n,a)}}return d?(a||(a=new Xs),ife(t,e,r,n,i,a)):!1}function YI(t,e,r,n,i){return t===e?!0:t==null||e==null||!Nc(t)&&!Nc(e)?t!==t&&e!==e:sfe(t,e,r,n,YI,i)}var lfe=1,ufe=2;function cfe(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var o=r[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){o=r[i];var s=o[0],l=t[s],u=o[1];if(o[2]){if(l===void 0&&!(s in t))return!1}else{var c=new Xs,f;if(!(f===void 0?YI(u,l,lfe|ufe,n,c):f))return!1}}return!0}function sK(t){return t===t&&!Io(t)}function ffe(t){for(var e=WI(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,sK(i)]}return e}function lK(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function dfe(t){var e=ffe(t);return e.length==1&&e[0][2]?lK(e[0][0],e[0][1]):function(r){return r===t||cfe(r,t,e)}}function hfe(t,e){return t!=null&&e in Object(t)}function pfe(t,e,r){e=tK(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var o=g_(e[n]);if(!(a=t!=null&&r(t,o)))break;t=t[o]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&UI(i)&&HI(o,i)&&(eo(t)||Kx(t)))}function vfe(t,e){return t!=null&&pfe(t,e,hfe)}var gfe=1,mfe=2;function yfe(t,e){return qI(t)&&sK(e)?lK(g_(t),e):function(r){var n=tce(r,t);return n===void 0&&n===e?vfe(r,t):YI(e,n,gfe|mfe)}}function bfe(t){return function(e){return e?.[t]}}function xfe(t){return function(e){return rK(e,t)}}function wfe(t){return qI(t)?bfe(g_(t)):xfe(t)}function Sfe(t){return typeof t=="function"?t:t==null?h_:typeof t=="object"?eo(t)?yfe(t[0],t[1]):dfe(t):wfe(t)}function _fe(t){return function(e,r,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var l=o[++i];if(r(a[l],l,a)===!1)break}return e}}var uK=_fe();function Tfe(t,e){return t&&uK(t,e,WI)}function Cfe(t,e){return function(r,n){if(r==null)return r;if(!Dv(r))return t(r,n);for(var i=r.length,a=-1,o=Object(r);++a<i&&n(o[a],a,o)!==!1;);return r}}var cK=Cfe(Tfe),MT=function(){return ps.Date.now()},Efe="Expected a function",Mfe=Math.max,Afe=Math.min;function g0(t,e,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(Efe);e=d5(e)||0,Io(r)&&(c=!!r.leading,f="maxWait"in r,a=f?Mfe(d5(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(_){var C=n,D=i;return n=i=void 0,u=_,o=t.apply(D,C),o}function p(_){return u=_,s=setTimeout(m,e),c?h(_):o}function v(_){var C=_-l,D=_-u,O=e-C;return f?Afe(O,a-D):O}function g(_){var C=_-l,D=_-u;return l===void 0||C>=e||C<0||f&&D>=a}function m(){var _=MT();if(g(_))return y(_);s=setTimeout(m,v(_))}function y(_){return s=void 0,d&&n?h(_):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function x(){return s===void 0?o:y(MT())}function w(){var _=MT(),C=g(_);if(n=arguments,i=this,l=_,C){if(s===void 0)return p(l);if(f)return clearTimeout(s),s=setTimeout(m,e),h(l)}return s===void 0&&(s=setTimeout(m,e)),o}return w.cancel=b,w.flush=x,w}function yD(t,e,r){(r!==void 0&&!v0(t[e],r)||r===void 0&&!(e in t))&&$I(t,e,r)}function kfe(t){return Nc(t)&&Dv(t)}function bD(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Nfe(t){return Cle(t,eK(t))}function Dfe(t,e,r,n,i,a,o){var s=bD(t,r),l=bD(e,r),u=o.get(l);if(u){yD(t,r,u);return}var c=a?a(s,l,r+"",t,e,o):void 0,f=c===void 0;if(f){var d=eo(l),h=!d&&Yx(l),p=!d&&!h&&GI(l);c=l,d||h||p?eo(s)?c=s:kfe(s)?c=fle(s):h?(f=!1,c=gce(l)):p?(f=!1,c=Nce(l)):c=[]:lce(l)||Kx(l)?(c=s,Kx(s)?c=Nfe(s):(!Io(s)||VI(s))&&(c=Dce(l))):f=!1}f&&(o.set(l,c),i(c,l,n,a,o),o.delete(l)),yD(t,r,c)}function fK(t,e,r,n,i){t!==e&&uK(e,function(a,o){if(i||(i=new Xs),Io(a))Dfe(t,e,o,r,fK,n,i);else{var s=n?n(bD(t,o),a,o+"",t,e,i):void 0;s===void 0&&(s=a),yD(t,o,s)}},eK)}function Ofe(t){return typeof t=="function"?t:h_}function Rfe(t,e){var r=eo(t)?ble:cK;return r(t,Ofe(e))}function Ife(t,e){var r=-1,n=Dv(t)?Array(t.length):[];return cK(t,function(i,a,o){n[++r]=e(i,a,o)}),n}function Kd(t,e){var r=eo(t)?qq:Ife;return r(t,Sfe(e))}function I5(t){return t===void 0}var Sa=Nle(function(t,e,r){fK(t,e,r)}),Lfe="Expected a function";function dK(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Lfe);return Io(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),g0(t,e,{leading:n,maxWait:e,trailing:i})}const L5=(t,e)=>{const r=Ese(t)&&Object.keys(t).includes("value")?t.value:t,n=Object.keys(r).reduce((a,o)=>(r[o]!==void 0&&(a[o]=r[o]),a),{});return Sa({},e??{},n)},Pfe={lineHeights:[{label:"单倍行距",value:1},{label:"1.5 倍行距",value:1.5},{label:"1.7 倍行距",value:1.7,default:!0},{label:"2 倍行距",value:2},{label:"2.5 倍行距",value:2.5},{label:"3 倍行距",value:3}],pageSizeOption:[{label:"网页",layout:"web"},{label:"A4",width:21,height:29.7,default:!0,layout:"page"},{label:"A3",width:29.7,height:42,layout:"page"},{label:"A5",width:14.8,height:21,layout:"page"},{label:"B5",width:17.6,height:25,layout:"page"},{label:"5号信纸",width:10.9,height:12.9,layout:"page"},{label:"6号信纸",width:11.9,height:22.9,layout:"page"},{label:"7号信纸",width:16.1,height:22.8,layout:"page"},{label:"9号信纸",width:22.8,height:32.3,layout:"page"},{label:"法律用纸",width:21.5,height:33.5,layout:"page"}]},hK=j.createContext(null),Ot=()=>{const t=j.useContext(hK);if(!t)throw new Error("useEditorContext must be used within an EditorProvider");return t},Bfe={document:{title:"无标题文档",content:"请输入内容"},editor:{readOnly:!1,autofocus:!1,parseOptions:{preserveWhitespace:"full"},editorProps:{},enableMarkdown:!0},layout:{toc:{show:!0},toolbar:{show:!0},foot:{show:!0,pageSize:!0,character:!0,copy:!0,download:!0}},file:{allowedMimeTypes:[],maxSize:1024*1024*100},ai:{enabled:!0,maxlength:100,async sendMessage(t){return new Promise(e=>{setTimeout(()=>{e(`这里是 AI 的回复。你发送了:${t.input}`)},1e3)})}},users:[{id:"Cassielxd",label:"Cassielxd"},{id:"Goldziher",label:"Na'aman Hirschfeld"},{id:"SerRashin",label:"SerRashin"},{id:"ChenErik",label:"ChenErik"},{id:"china-wangxu",label:"china-wangxu"},{id:"Sherman Xu",label:"xuzhenjun130"},{id:"testuser",label:"测试用户"}],echarts:{onSetOptions(t,e){return null}},page:{layout:"page",showToc:!1,toolbar:"double",size:{key:"A4",width:21,height:29.7}},async onFileUpload(t){if(!t)throw new Error("没有找到要上传的文件");return console.log("onFileUpload",t),await new Promise(e=>setTimeout(e,3e3)),{id:Nv(),url:t.url??URL.createObjectURL(t),name:t.name,type:t.type,size:t.size}},onFileDelete(t,e){console.log(t,e)}},pK=({children:t,options:e={},...r})=>{const[n]=j.useState(`white-editor-${Nv()}`),[i,a]=j.useState(null),o=j.useMemo(()=>L5(e,Bfe),[e]),[s,l]=j.useState(()=>L5(o?.page,{layouts:["page","web"],watermark:{type:"测试",alpha:.2,fontColor:"#000",fontSize:16,fontFamily:"SimSun",fontWeight:"normal",text:""},margin:{left:3.18,right:3.18,top:2.54,bottom:2.54}})),[u,c]=j.useState(!1),[f,d]=j.useState(new Map),h=(m,y)=>{d(b=>{const x=new Map(b);return x.set(m,y),x})},p=m=>{d(y=>{const b=new Map(y);return b.delete(m),b})},v=j.useRef(r);j.useEffect(()=>{v.current=r},[r]),j.useEffect(()=>{if(!i)return;const m={create:({editor:y})=>v.current.onCreated?.({editor:y}),update:({editor:y})=>v.current.onChange?.({editor:y}),selectionUpdate:({editor:y})=>v.current.onSelectionUpdate?.({editor:y}),transaction:({editor:y,transaction:b})=>v.current.onTransaction?.({editor:y,transaction:b}),focus:({editor:y,event:b})=>v.current.onFocus?.({editor:y,event:b}),contentError:({editor:y,error:b,disableCollaboration:x})=>v.current.onContentError?.({editor:y,error:b,disableCollaboration:x}),blur:({editor:y,event:b})=>v.current.onBlur?.({editor:y,event:b}),destroy:()=>v.current.onDestroy?.()};return Object.entries(m).forEach(([y,b])=>{i.on(y,b)}),()=>{Object.entries(m).forEach(([y,b])=>{i.off(y,b)})}},[i]);const g={container:n,options:o,editor:i,setEditor:a,page:s,setPage:l,assistant:u,setAssistant:c,uploadFileMap:f,setUploadFile:h,deleteUploadFile:p,dicts:Pfe};return F.jsx(hK.Provider,{value:g,children:t})};var sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function m0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zfe(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _1={exports:{}},AT={};var P5;function Ffe(){if(P5)return AT;P5=1;var t=j;function e(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,a=t.useLayoutEffect,o=t.useDebugValue;function s(f,d){var h=d(),p=n({inst:{value:h,getSnapshot:d}}),v=p[0].inst,g=p[1];return a(function(){v.value=h,v.getSnapshot=d,l(v)&&g({inst:v})},[f,h,d]),i(function(){return l(v)&&g({inst:v}),f(function(){l(v)&&g({inst:v})})},[f]),o(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!r(f,h)}catch{return!0}}function u(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return AT.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:c,AT}var kT={};var B5;function Vfe(){return B5||(B5=1,process.env.NODE_ENV!=="production"&&(function(){function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}function e(h,p){c||i.startTransition===void 0||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=p();if(!f){var g=p();a(v,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}g=o({inst:{value:v,getSnapshot:p}});var m=g[0].inst,y=g[1];return l(function(){m.value=v,m.getSnapshot=p,r(m)&&y({inst:m})},[h,v,p]),s(function(){return r(m)&&y({inst:m}),h(function(){r(m)&&y({inst:m})})},[h]),u(v),v}function r(h){var p=h.getSnapshot;h=h.value;try{var v=p();return!a(h,v)}catch{return!0}}function n(h,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=j,a=typeof Object.is=="function"?Object.is:t,o=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,f=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;kT.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),kT}var z5;function XI(){return z5||(z5=1,process.env.NODE_ENV==="production"?_1.exports=Ffe():_1.exports=Vfe()),_1.exports}var vK=XI();function Vi(t){this.content=t}Vi.prototype={constructor:Vi,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,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Vi(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Vi(r)},addToStart:function(t,e){return new Vi([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Vi(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Vi(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=Vi.from(t),t.size?new Vi(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Vi.from(t),t.size?new Vi(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Vi.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};Vi.from=function(t){if(t instanceof Vi)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Vi(e)};function gK(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=gK(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function mK(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,c=Math.min(o.text.length,s.text.length);for(;u<c&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=mK(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class pt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,r-c),n,i+c)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new pt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new pt(n,i)}cutByIndex(e,r){return e==r?pt.empty:e==0&&r==this.content.length?this:new pt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new pt(i,a)}addToStart(e){return new pt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new pt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))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 r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return gK(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return mK(this,e,r,n)}findIndex(e){if(e==0)return T1(0,e);if(e==this.size)return T1(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?T1(r+1,a):T1(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return pt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new pt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return pt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new pt(r||e,n)}static from(e){if(!e)return pt.empty;if(e instanceof pt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new pt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}pt.empty=new pt([],0);const NT={index:0,offset:0};function T1(t,e){return NT.index=t,NT.offset=e,NT}function Jx(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Jx(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Jx(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let Tn=class xD{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Jx(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return xD.none;if(e instanceof xD)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};Tn.none=[];class Qx extends Error{}class Vt{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=bK(this.content,e+this.openStart,r);return n&&new Vt(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Vt(yK(this.content,e+this.openStart,r+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,r){if(!r)return Vt.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Vt(pt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Vt(e,n,i)}}Vt.empty=new Vt(pt.empty,0,0);function yK(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(yK(a.content,e-i-1,r-i-1)))}function bK(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return n&&!n.canReplace(i,i,r)?null:t.cut(0,e).append(r).append(t.cut(e));let s=bK(o.content,e-a-1,r,o);return s&&t.replaceChild(i,o.copy(s))}function Hfe(t,e,r){if(r.openStart>t.depth)throw new Qx("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new Qx("Inconsistent open depths");return xK(t,e,r,0)}function xK(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=xK(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return fd(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=$fe(r,t);return fd(a,SK(t,o,s,e,n))}else return fd(a,ew(t,e,n))}function wK(t,e){if(!e.type.compatibleContent(t.type))throw new Qx("Cannot join "+e.type.name+" onto "+t.type.name)}function wD(t,e,r){let n=t.node(r);return wK(n,e.node(r)),n}function cd(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Gm(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(cd(t.nodeAfter,n),a++));for(let s=a;s<o;s++)cd(i.child(s),n);e&&e.depth==r&&e.textOffset&&cd(e.nodeBefore,n)}function fd(t,e){return t.type.checkContent(e),t.copy(e)}function SK(t,e,r,n,i){let a=t.depth>i&&wD(t,e,i+1),o=n.depth>i&&wD(r,n,i+1),s=[];return Gm(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(wK(a,o),cd(fd(a,SK(t,e,r,n,i+1)),s)):(a&&cd(fd(a,ew(t,e,i+1)),s),Gm(e,r,i,s),o&&cd(fd(o,ew(r,n,i+1)),s)),Gm(n,null,i,s),new pt(s)}function ew(t,e,r){let n=[];if(Gm(null,t,r,n),t.depth>r){let i=wD(t,e,r+1);cd(fd(i,ew(t,e,r+1)),n)}return Gm(e,null,r,n),new pt(n)}function $fe(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(pt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class wy{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.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[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return Tn.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new tw(this,e,n);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 r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new wy(r,n,a)}static resolveCached(e,r){let n=F5.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else F5.set(e,n=new Ufe);let i=n.elts[n.i]=wy.resolve(e,r);return n.i=(n.i+1)%jfe,i}}class Ufe{constructor(){this.elts=[],this.i=0}}const jfe=12,F5=new WeakMap;class tw{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}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 Gfe=Object.create(null);let Xl=class SD{constructor(e,r,n,i=Tn.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||pt.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,r,n,i=0){this.content.nodesBetween(e,r,n,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,r,n,i){return this.content.textBetween(e,r,n,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,r,n){return this.type==e&&Jx(this.attrs,r||e.defaultAttrs||Gfe)&&Tn.sameSet(this.marks,n||Tn.none)}copy(e=null){return e==this.content?this:new SD(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new SD(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Vt.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new Vt(u,i.depth-o,a.depth-o)}replace(e,r,n){return Hfe(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return wy.resolveCached(this,e)}resolveNoCache(e){return wy.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.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()+")"),_K(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=pt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}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=Tn.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Tn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r 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(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=pt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};Xl.prototype.text=void 0;class rw extends Xl{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):_K(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new rw(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new rw(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function _K(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class Ed{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new Wfe(e,r);if(n.next==null)return Ed.empty;let i=TK(n);n.next&&n.err("Unexpected trailing text");let a=Qfe(Jfe(i));return ede(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).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:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return pt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:f}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=a(f,s.concat(c));if(d)return d}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.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=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
|
|
2
2
|
`)}}Ed.empty=new Ed(!0);class Wfe{constructor(e,r){this.string=e,this.nodeTypes=r,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 TK(t){let e=[];do e.push(qfe(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function qfe(t){let e=[];do e.push(Kfe(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Kfe(t){let e=Zfe(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("{"))e=Yfe(t,e);else break;return e}function V5(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Yfe(t,e){let r=V5(t),n=r;return t.eat(",")&&(t.next!="}"?n=V5(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function Xfe(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let o=r[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Zfe(t){if(t.eat("(")){let e=TK(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Xfe(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Jfe(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(o,s,l){let u={term:l,to:s};return e[o].push(u),u}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(a(u,s)),[]);if(o.type=="seq")for(let l=0;;l++){let u=a(o.exprs[l],s);if(l==o.exprs.length-1)return u;i(u,s=r())}else if(o.type=="star"){let l=r();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=r();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let u=0;u<o.min;u++){let c=r();i(a(o.expr,l),c),l=c}if(o.max==-1)i(a(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let c=r();n(l,c),i(a(o.expr,l),c),l=c}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function CK(t,e){return e-t}function H5(t,e){let r=[];return n(e),r.sort(CK);function n(i){let a=t[i];if(a.length==1&&!a[0].term)return n(a[0].to);r.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&r.indexOf(l)==-1&&n(l)}}}function Qfe(t){let e=Object.create(null);return r(H5(t,0));function r(n){let i=[];n.forEach(o=>{t[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let c=0;c<i.length;c++)i[c][0]==s&&(u=i[c][1]);H5(t,l).forEach(c=>{u||i.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=e[n.join(",")]=new Ed(n.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(CK);a.next.push({type:i[o][0],next:e[s.join(",")]||r(s)})}return a}}function ede(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:u}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(u)==-1&&n.push(u)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function EK(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function MK(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let a=t[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function AK(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let a=t[i];a.validate&&a.validate(e[i])}}function kK(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new rde(t,n,e[n]);return r}let $5=class NK{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=kK(e,n.attrs),this.defaultAttrs=EK(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ed.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:MK(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xl(this,this.computeAttrs(e),pt.from(r),Tn.setFrom(n))}createChecked(e=null,r,n){return r=pt.from(r),this.checkContent(r),new Xl(this,this.computeAttrs(e),r,Tn.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=pt.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(pt.empty,!0);return a?new Xl(this,e,r.append(a),Tn.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).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){AK(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 r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:Tn.none:e}static compile(e,r){let n=Object.create(null);e.forEach((a,o)=>n[a]=new NK(a,r,o));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function tde(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class rde{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?tde(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class m_{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=kK(e,i.attrs),this.excluded=null;let a=EK(this.attrs);this.instance=a?new Tn(this,a):null}create(e=null){return!e&&this.instance?this.instance:new Tn(this,MK(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new m_(a,i++,r,o)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){AK(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class DK{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Vi.from(e.nodes),r.marks=Vi.from(e.marks||{}),this.nodes=$5.compile(this.spec.nodes,this),this.marks=m_.compile(this.spec.marks,this);let n=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 a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=Ed.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?U5(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:U5(this,o.split(" "))}this.nodeFromJSON=i=>Xl.fromJSON(this,i),this.markFromJSON=i=>Tn.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof $5){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new rw(n,n.defaultAttrs,e,Tn.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function U5(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t.marks[i],o=a;if(a)r.push(a);else for(let s in t.marks){let l=t.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function nde(t){return t.tag!=null}function ide(t){return t.style!=null}let $p=class _D{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(nde(i))this.tags.push(i);else if(ide(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new G5(this,r,!1);return n.addAll(e,Tn.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new G5(this,r,!0);return n.addAll(e,Tn.none,r.from,r.to),Vt.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(sde(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||r.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,r,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=r))){if(o.getAttrs){let l=o.getAttrs(r);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<r.length;o++){let s=r[o];if((s.priority==null?50:s.priority)<a)break}r.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=W5(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=W5(o)),o.node||o.ignore||o.mark||(o.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _D(e,_D.schemaRules(e)))}};const OK={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},ade={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},RK={ol:!0,ul:!0},Sy=1,TD=2,Wm=4;function j5(t,e,r){return e!=null?(e?Sy:0)|(e==="full"?TD:0):t&&t.whitespace=="pre"?Sy|TD:r&~Wm}class C1{constructor(e,r,n,i,a,o){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Tn.none,this.match=a||(o&Wm?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(pt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Sy)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=pt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(pt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!OK.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class G5{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,o=j5(null,r.preserveWhitespace,0)|(n?Wm:0);i?a=new C1(i.type,i.attrs,Tn.none,!0,r.topMatch||i.type.contentMatch,o):n?a=new C1(null,null,Tn.none,!0,null,o):a=new C1(e.schema.topNodeType,null,Tn.none,!0,null,o),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&TD?"full":this.localPreserveWS||(i.options&Sy)>0,{schema:o}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)if(a==="full")n=n.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let s=n.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),r,!0),s[l]&&this.insertNode(o.text(s[l]),r,!/\S/.test(s[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;RK.hasOwnProperty(o)&&this.parser.normalizeLists&&ode(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:ade.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(OK.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let f=l&&l.skip?r:this.readStyles(e,r);f&&this.addAll(e,f),u&&this.sync(a),this.needsBlock=c}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(u=>!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return r}addElementByRule(e,r,n,i){let a,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+s)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)r=this.enterInner(i[o],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(r=this.enterInner(a,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=Tn.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):q5(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,r,n,i){let a=this.findPlace(e.create(r),n,!1);return a&&(a=this.enterInner(e,r,n,!0,i)),a}enterInner(e,r,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=j5(e,a,o.options);o.options&Wm&&o.content.length==0&&(s|=Wm);let l=Tn.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):q5(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new C1(e,r,l,i,null,s)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].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 r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=Sy)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&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)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let u=r[s];if(u==""){if(s==r.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function ode(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&RK.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function sde(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function W5(t){let e={};for(let r in t)e[r]=t[r];return e}function q5(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:u,next:c}=s.edge(l);if(u==e||a.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class Yd{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=DT(r).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],c=this.serializeMark(u,o.isInline,r);c&&(a.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=gx(DT(r),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,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&gx(DT(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return gx(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Yd(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=K5(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return K5(e.marks)}}function K5(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function DT(t){return t.document||window.document}const Y5=new WeakMap;function lde(t){let e=Y5.get(t);return e===void 0&&Y5.set(t,e=ude(t)),e}function ude(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function gx(t,e,r,n){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=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=lde(n))&&a.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 o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;f<e.length;f++){let d=e[f];if(d===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=gx(t,d,r,n);if(l.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}const IK=65535,LK=Math.pow(2,16);function cde(t,e){return t+e*LK}function X5(t){return t&IK}function fde(t){return(t-(t&IK))/LK}const PK=1,BK=2,mx=4,zK=8;class CD{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&zK)>0}get deletedBefore(){return(this.delInfo&(PK|mx))>0}get deletedAfter(){return(this.delInfo&(BK|mx))>0}get deletedAcross(){return(this.delInfo&mx)>0}}class Wa{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&Wa.empty)return Wa.empty}recover(e){let r=0,n=X5(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+fde(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[s+a],c=this.ranges[s+o],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:r:r,h=l+i+(d<0?0:c);if(n)return h;let p=e==(r<0?l:f)?null:cde(s/3,e-l),v=e==l?BK:e==f?PK:mx;return(r<0?e!=l:e!=f)&&(v|=zK),new CD(h,v,p)}i+=c-u}return n?e+i:new CD(e+i,0,null)}touches(e,r){let n=0,i=X5(r),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[s+a],c=l+u;if(e<=c&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),u=this.ranges[i+r],c=this.ranges[i+n];e(s,s+u,l,l+c),a+=c-u}}invert(){return new Wa(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Wa.empty:new Wa(e<0?[0,-e,0]:[0,0,e])}}Wa.empty=new Wa([]);class _y{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new _y(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new _y;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,r);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new CD(e,i,null)}}const OT=Object.create(null);class ia{getMap(){return Wa.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=OT[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in OT)throw new RangeError("Duplicate use of step JSON ID "+e);return OT[e]=r,r.prototype.jsonID=e,r}}class ui{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new ui(e,null)}static fail(e){return new ui(null,e)}static fromReplace(e,r,n,i){try{return ui.ok(e.replace(r,n,i))}catch(a){if(a instanceof Qx)return ui.fail(a.message);throw a}}}function ZI(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(ZI(a.content,e,a))),a.isInline&&(a=e(a,r,i)),n.push(a)}return pt.fromArray(n)}class lc extends ia{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new Vt(ZI(r.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),r.openStart,r.openEnd);return ui.fromReplace(e,this.from,this.to,a)}invert(){return new Jo(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new lc(r.pos,n.pos,this.mark)}merge(e){return e instanceof lc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new lc(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,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new lc(r.from,r.to,e.markFromJSON(r.mark))}}ia.jsonID("addMark",lc);class Jo extends ia{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new Vt(ZI(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return ui.fromReplace(e,this.from,this.to,n)}invert(){return new lc(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Jo(r.pos,n.pos,this.mark)}merge(e){return e instanceof Jo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Jo(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,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jo(r.from,r.to,e.markFromJSON(r.mark))}}ia.jsonID("removeMark",Jo);class uc extends ia{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return ui.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return ui.fromReplace(e,this.pos,this.pos+1,new Vt(pt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new uc(this.pos,r.marks[i]);return new uc(this.pos,this.mark)}}return new Md(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new uc(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new uc(r.pos,e.markFromJSON(r.mark))}}ia.jsonID("addNodeMark",uc);class Md extends ia{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return ui.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return ui.fromReplace(e,this.pos,this.pos+1,new Vt(pt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new uc(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Md(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Md(r.pos,e.markFromJSON(r.mark))}}ia.jsonID("removeNodeMark",Md);class Ai extends ia{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&ED(e,this.from,this.to)?ui.fail("Structure replace would overwrite content"):ui.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Wa([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ai(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new Ai(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ai)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?Vt.empty:new Vt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ai(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?Vt.empty:new Vt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ai(e.from,this.to,r,this.structure)}else return null}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,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ai(r.from,r.to,Vt.fromJSON(e,r.slice),!!r.structure)}}ia.jsonID("replace",Ai);class Ni extends ia{constructor(e,r,n,i,a,o,s=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(ED(e,this.from,this.gapFrom)||ED(e,this.gapTo,this.to)))return ui.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return ui.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?ui.fromReplace(e,this.from,this.to,n):ui.fail("Content does not fit in gap")}getMap(){return new Wa([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Ni(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||a>n.pos?null:new Ni(r.pos,n.pos,i,a,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,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ni(r.from,r.to,r.gapFrom,r.gapTo,Vt.fromJSON(e,r.slice),r.insert,!!r.structure)}}ia.jsonID("replaceAround",Ni);function ED(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function dde(t,e,r,n){let i=[],a=[],o,s;t.doc.nodesBetween(e,r,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&c.type.allowsMarkType(n.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,r),p=n.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(p)||(o&&o.to==d&&o.mark.eq(f[v])?o.to=h:i.push(o=new Jo(d,h,f[v])));s&&s.to==d?s.to=h:a.push(s=new lc(d,h,n))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function hde(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof m_){let u=o.marks,c;for(;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,r);for(let c=0;c<l.length;c++){let f=l[c],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==a-1&&f.eq(i[h].style)&&(d=p)}d?(d.to=u,d.step=a):i.push({style:f,from:Math.max(s,e),to:u,step:a})}}}),i.forEach(o=>t.step(new Jo(o.from,o.to,o.style)))}function JI(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),c=s+u.nodeSize,f=n.matchType(u.type);if(!f)o.push(new Ai(s,c,Vt.empty));else{n=f;for(let d=0;d<u.marks.length;d++)r.allowsMarkType(u.marks[d].type)||t.step(new Jo(s,c,u.marks[d]));if(i&&u.isText&&r.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(u.text);)p||(p=new Vt(pt.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),o.push(new Ai(s+d.index,s+d.index+d[0].length,p))}}s=c}if(!n.validEnd){let l=n.fillBefore(pt.empty,!0);t.replace(s,s,new Vt(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function pde(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Ov(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,i=0,a=0;;--n){let o=t.$from.node(n),s=t.$from.index(n)+i,l=t.$to.indexAfter(n)-a;if(n<t.depth&&o.canReplace(s,l,r))return n;if(n==0||o.type.spec.isolating||!pde(o,s,l))break;s&&(i=1),l<o.childCount&&(a=1)}return null}function vde(t,e,r){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,u=s,c=pt.empty,f=0;for(let p=a,v=!1;p>r;p--)v||n.index(p)>0?(v=!0,c=pt.from(n.node(p).copy(c)),f++):l--;let d=pt.empty,h=0;for(let p=a,v=!1;p>r;p--)v||i.after(p+1)<i.end(p)?(v=!0,d=pt.from(i.node(p).copy(d)),h++):u++;t.step(new Ni(l,u,o,s,new Vt(c.append(d),f,h),c.size-f,!0))}function QI(t,e,r=null,n=t){let i=gde(t,e),a=i&&mde(n,e);return a?i.map(Z5).concat({type:e,attrs:r}).concat(a.map(Z5)):null}function Z5(t){return{type:t,attrs:null}}function gde(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return r.canReplaceWith(n,i,o)?a:null}function mde(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(r.child(u).type);return!l||!l.validEnd?null:o}function yde(t,e,r){let n=pt.empty;for(let o=r.length-1;o>=0;o--){if(n.size){let s=r[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=pt.from(r[o].type.create(r[o].attrs,n))}let i=e.start,a=e.end;t.step(new Ni(i,a,i,a,new Vt(n,0,0),r.length,!0))}function bde(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&xde(t.doc,t.mapping.slice(a).map(s),n)){let u=null;if(n.schema.linebreakReplacement){let h=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);h&&!p?u=!1:!h&&p&&(u=!0)}u===!1&&VK(t,o,s,a),JI(t,t.mapping.slice(a).map(s,1),n,void 0,u===null);let c=t.mapping.slice(a),f=c.map(s,1),d=c.map(s+o.nodeSize,1);return t.step(new Ni(f,d,f+1,d-1,new Vt(pt.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&FK(t,o,s,a),!1}})}function FK(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function VK(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(r+1+a);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -328,8 +328,8 @@ echarts.use([`+V+"]);":"Unknown series "+L))}return}if(f==="tooltip"){if(b){proc
|
|
|
328
328
|
`,"Illegal config:",c,`.
|
|
329
329
|
`)),Gr(n));var y=h?dte(h):null;h&&!y&&(process.env.NODE_ENV!=="production"&&(n=xa("Invalid parser name "+h+`.
|
|
330
330
|
`,"Illegal config:",c,`.
|
|
331
|
-
`)),Gr(n)),a.push({dimIdx:m.index,parser:y,comparator:new pte(d,p)})});var o=e.sourceFormat;o!==Ii&&o!==no&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),Gr(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(c,f){for(var d=0;d<a.length;d++){var h=a[d],p=e.retrieveValueFromItem(c,h.dimIdx),v=e.retrieveValueFromItem(f,h.dimIdx);h.parser&&(p=h.parser(p),v=h.parser(v));var g=h.comparator.evaluate(p,v);if(g!==0)return g}return 0}),{data:s}}};function y9e(t){t.registerTransform(g9e),t.registerTransform(m9e)}var b9e=(function(t){je(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new yte(this),RF(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),RF(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:as},e})(xr),x9e=(function(t){je(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e})(_n);function w9e(t){t.registerComponentModel(b9e),t.registerComponentView(x9e)}var Ds=fl.CMD;function Hp(t,e){return Math.abs(t-e)<1e-5}function EI(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(H,Y){i&&i.length>2&&n.push(i),i=[H,Y]}function c(H,Y,te,Q){Hp(H,te)&&Hp(Y,Q)||i.push(H,Y,te,Q,te,Q)}function f(H,Y,te,Q,ue,ie){var Se=Math.abs(Y-H),me=Math.tan(Se/4)*4/3,ae=Y<H?-1:1,Te=Math.cos(H),Be=Math.sin(H),He=Math.cos(Y),qe=Math.sin(Y),ot=Te*ue+te,st=Be*ie+Q,he=He*ue+te,Ce=qe*ie+Q,ve=ue*me*ae,xe=ie*me*ae;i.push(ot-ve*Be,st+xe*Te,he+ve*qe,Ce-xe*He,he,Ce)}for(var d,h,p,v,g=0;g<r;){var m=e[g++],y=g===1;switch(y&&(a=e[g],o=e[g+1],s=a,l=o,(m===Ds.L||m===Ds.C||m===Ds.Q)&&(i=[s,l])),m){case Ds.M:a=s=e[g++],o=l=e[g++],u(s,l);break;case Ds.L:d=e[g++],h=e[g++],c(a,o,d,h),a=d,o=h;break;case Ds.C:i.push(e[g++],e[g++],e[g++],e[g++],a=e[g++],o=e[g++]);break;case Ds.Q:d=e[g++],h=e[g++],p=e[g++],v=e[g++],i.push(a+2/3*(d-a),o+2/3*(h-o),p+2/3*(d-p),v+2/3*(h-v),p,v),a=p,o=v;break;case Ds.A:var b=e[g++],x=e[g++],w=e[g++],_=e[g++],C=e[g++],D=e[g++]+C;g+=1;var O=!e[g++];d=Math.cos(C)*w+b,h=Math.sin(C)*_+x,y?(s=d,l=h,u(s,l)):c(a,o,d,h),a=Math.cos(D)*w+b,o=Math.sin(D)*_+x;for(var I=(O?-1:1)*Math.PI/2,L=C;O?L>D:L<D;L+=I){var V=O?Math.max(L+I,D):Math.min(L+I,D);f(L,V,b,x,w,_)}break;case Ds.R:s=a=e[g++],l=o=e[g++],d=s+e[g++],h=l+e[g++],u(d,l),c(d,l,d,h),c(d,h,s,h),c(s,h,s,l),c(s,l,d,l);break;case Ds.Z:i&&c(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function MI(t,e,r,n,i,a,o,s,l,u){if(Hp(t,r)&&Hp(e,n)&&Hp(i,o)&&Hp(a,s)){l.push(o,s);return}var c=2/u,f=c*c,d=o-t,h=s-e,p=Math.sqrt(d*d+h*h);d/=p,h/=p;var v=r-t,g=n-e,m=i-o,y=a-s,b=v*v+g*g,x=m*m+y*y;if(b<f&&x<f){l.push(o,s);return}var w=d*v+h*g,_=-d*m-h*y,C=b-w*w,D=x-_*_;if(C<f&&w>=0&&D<f&&_>=0){l.push(o,s);return}var O=[],I=[];Ic(t,r,i,o,.5,O),Ic(e,n,a,s,.5,I),MI(O[0],I[0],O[1],I[1],O[2],I[2],O[3],I[3],l,u),MI(O[4],I[4],O[5],I[5],O[6],I[6],O[7],I[7],l,u)}function S9e(t,e){var r=EI(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var c=a[u++],f=a[u++],d=a[u++],h=a[u++],p=a[u++],v=a[u++];MI(s,l,c,f,d,h,p,v,o,e),s=p,l=v}n.push(o)}return n}function Qae(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var c=o*s,f=r-c;if(f>0)for(var u=0;u<f;u++)l[u%o]+=1;return l}function oU(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,c=l>Math.abs(u),f=Qae([l,u],c?0:1,e),d=(c?s:u)/f.length,h=0;h<f.length;h++)for(var p=(c?u:s)/f[h],v=0;v<f[h];v++){var g={};c?(g.startAngle=a+d*h,g.endAngle=a+d*(h+1),g.r0=n+p*v,g.r=n+p*(v+1)):(g.startAngle=a+p*v,g.endAngle=a+p*(v+1),g.r0=n+d*h,g.r=n+d*(h+1)),g.clockwise=t.clockwise,g.cx=t.cx,g.cy=t.cy,r.push(g)}}function _9e(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=Qae([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=t[s]/o.length,d=0;d<o.length;d++)for(var h=t[l]/o[d],p=0;p<o[d];p++){var v={};v[u]=d*f,v[c]=p*h,v[s]=f,v[l]=h,v.x+=t.x,v.y+=t.y,r.push(v)}}function sU(t,e,r,n){return t*n-r*e}function T9e(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,c=o-i,f=s-a,d=sU(c,f,l,u);if(Math.abs(d)<1e-6)return null;var h=t-i,p=e-a,v=sU(h,p,c,f)/d;return v<0||v>1?null:new Wt(v*l+t,v*u+e)}function C9e(t,e,r){var n=new Wt;Wt.sub(n,r,e),n.normalize();var i=new Wt;Wt.sub(i,t,e);var a=i.dot(n);return a}function Jh(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function E9e(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=T9e(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:C9e(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(g,m){return g.projPt-m.projPt});var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var f=u;u=c,c=f}for(var d=[u.pt.x,u.pt.y],h=[c.pt.x,c.pt.y],p=[d],v=[h],a=u.idx+1;a<=c.idx;a++)Jh(p,t[a].slice());Jh(p,h),Jh(p,d);for(var a=c.idx+1;a<=u.idx+n;a++)Jh(v,t[a%n].slice());return Jh(v,d),Jh(v,h),[{points:p},{points:v}]}function lU(t){var e=t.points,r=[],n=[];Z_(e,r,n);var i=new Kt(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Wt,c=new Wt;return a>o?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),E9e(e,u,c)}function n_(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);n_(t,a[0],i,n),n_(t,a[1],r-i,n)}return n}function M9e(t,e){for(var r=[],n=0;n<e;n++)r.push(EP(t));return r}function A9e(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function k9e(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function N9e(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":_9e(n,e,r),i=mr;break;case"sector":oU(n,e,r),i=ra;break;case"circle":oU({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=ra;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=at(S9e(t.getUpdatedPathProxy(),o),function(m){return k9e(m)}),l=s.length;if(l===0)n_(lU,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,f=at(s,function(m){var y=[],b=[];Z_(m,y,b);var x=(b[1]-y[1])*(b[0]-y[0]);return c+=x,{poly:m,area:x}});f.sort(function(m,y){return y.area-m.area});for(var d=e,u=0;u<l;u++){var h=f[u];if(d<=0)break;var p=u===l-1?d:Math.ceil(h.area/c*e);p<0||(n_(lU,{points:h.poly},p,r),d-=p)}}i=na;break}if(!i)return M9e(t,e);for(var v=[],u=0;u<r.length;u++){var g=new i;g.setShape(r[u]),A9e(t,g),v.push(g)}return v}function D9e(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,f=[o[0],o[1]],d=l,h=2;h<s;){var p=o[h-2],v=o[h-1],g=o[h++],m=o[h++],y=o[h++],b=o[h++],x=o[h++],w=o[h++];if(d<=0){f.push(g,m,y,b,x,w);continue}for(var _=Math.min(d,c-1)+1,C=1;C<=_;C++){var D=C/_;Ic(p,g,y,x,D,i),Ic(v,m,b,w,D,a),p=i[3],v=a[3],f.push(i[1],a[1],i[2],a[2],p,v),g=i[5],m=a[5],y=i[6],b=a[6]}d-=_-1}return o===t?[f,e]:[t,f]}function uU(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function O9e(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],c=void 0,f=void 0;l?u?(r=D9e(l,u),c=r[0],f=r[1],n=c,i=f):(f=uU(i||l,l),c=l):(c=uU(n||u,u),f=u),a.push(c),o.push(f)}return[a,o]}function cU(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],c=t[a+1],f=s*c-u*l;e+=f,r+=(s+u)*f,n+=(l+c)*f}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function R9e(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var c=u*6,f=0,d=0;d<s;d+=2){var h=d===0?c:(c+d-2)%l+2,p=t[h]-r[0],v=t[h+1]-r[1],g=e[d]-n[0],m=e[d+1]-n[1],y=g-p,b=m-v;f+=y*y+b*b}f<a&&(a=f,o=u)}return o}function I9e(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function L9e(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=cU(s),c=cU(l);a==null&&(a=u[2]<0!=c[2]<0);var f=[],d=[],h=0,p=1/0,v=[],g=s.length;a&&(s=I9e(s));for(var m=R9e(s,l,u,c)*6,y=g-2,b=0;b<y;b+=2){var x=(m+b)%y+2;f[b+2]=s[x]-u[0],f[b+3]=s[x+1]-u[1]}f[0]=s[m]-u[0],f[1]=s[m+1]-u[1];for(var w=n/r,_=-n/2;_<=n/2;_+=w){for(var C=Math.sin(_),D=Math.cos(_),O=0,b=0;b<s.length;b+=2){var I=f[b],L=f[b+1],V=l[b]-c[0],H=l[b+1]-c[1],Y=V*D-H*C,te=V*C+H*D;v[b]=Y,v[b+1]=te;var Q=Y-I,ue=te-L;O+=Q*Q+ue*ue}if(O<p){p=O,h=_;for(var ie=0;ie<v.length;ie++)d[ie]=v[ie]}}i.push({from:f,to:d,fromCp:u,toCp:c,rotation:-h})}return i}function i_(t){return t.__isCombineMorphing}var eoe="__mOriginal_";function a_(t,e,r){var n=eoe+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function yy(t,e){var r=eoe+e;t[r]&&(t[e]=t[r],t[r]=null)}function fU(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function toe(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=O9e(EI(r),EI(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&fU(a,s),l&&fU(o,l),a_(e,"updateTransform",{replace:u}),e.transform=null;var c=L9e(a,o,10,Math.PI),f=[];a_(e,"buildPath",{replace:function(d){for(var h=e.__morphT,p=1-h,v=[],g=0;g<c.length;g++){var m=c[g],y=m.from,b=m.to,x=m.rotation*h,w=m.fromCp,_=m.toCp,C=Math.sin(x),D=Math.cos(x);Mx(v,w,_,h);for(var O=0;O<y.length;O+=2){var I=y[O],L=y[O+1],V=b[O],H=b[O+1],Y=I*p+V*h,te=L*p+H*h;f[O]=Y*D-te*C+v[0],f[O+1]=Y*C+te*D+v[1]}var Q=f[0],ue=f[1];d.moveTo(Q,ue);for(var O=2;O<y.length;){var V=f[O++],H=f[O++],ie=f[O++],Se=f[O++],me=f[O++],ae=f[O++];Q===V&&ue===H&&ie===me&&Se===ae?d.lineTo(me,ae):d.bezierCurveTo(V,H,ie,Se,me,ae),Q=me,ue=ae}}}})}function y4(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;toe(t,e),e.__morphT=0;function a(){yy(e,"buildPath"),yy(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},qt({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function P9e(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var c=0,f=0;(t&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function o_(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=at(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=at(a,function(s,l){return{cp:s,z:P9e(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function roe(t){return N9e(t.path,t.count)}function AI(){return{fromIndividuals:[],toIndividuals:[],count:0}}function B9e(t,e,r){var n=[];function i(w){for(var _=0;_<w.length;_++){var C=w[_];i_(C)?i(C.childrenRef()):C instanceof Sr&&n.push(C)}}i(t);var a=n.length;if(!a)return AI();var o=r.dividePath||roe,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),AI();n=o_(n),s=o_(s);for(var l=r.done,u=r.during,c=r.individualDelay,f=new Kl,d=0;d<a;d++){var h=n[d],p=s[d];p.parent=e,p.copyTransform(f),c||toe(h,p)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function v(w){for(var _=0;_<s.length;_++)s[_].addSelfToZr(w)}a_(e,"addSelfToZr",{after:function(w){v(w)}}),a_(e,"removeSelfFromZr",{after:function(w){for(var _=0;_<s.length;_++)s[_].removeSelfFromZr(w)}});function g(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,yy(e,"addSelfToZr"),yy(e,"removeSelfFromZr")}var m=s.length;if(c)for(var y=m,b=function(){y--,y===0&&(g(),l&&l())},d=0;d<m;d++){var x=c?qt({delay:(r.delay||0)+c(d,m,n[d],s[d]),done:b},r):r;y4(n[d],s[d],x)}else e.__morphT=0,e.animateTo({__morphT:1},qt({during:function(w){for(var _=0;_<m;_++){var C=s[_];C.__morphT=e.__morphT,C.dirtyShape()}u&&u(w)},done:function(){g();for(var w=0;w<t.length;w++)yy(t[w],"updateTransform");l&&l()}},r));return e.__zr&&v(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function z9e(t,e,r){var n=e.length,i=[],a=r.dividePath||roe;function o(h){for(var p=0;p<h.length;p++){var v=h[p];i_(v)?o(v.childrenRef()):v instanceof Sr&&i.push(v)}}if(i_(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(EP(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var c=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(c);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),AI()}i=o_(i),e=o_(e);for(var f=r.individualDelay,u=0;u<n;u++){var d=f?qt({delay:(r.delay||0)+f(u,n,i[u],e[u])},r):r;y4(i[u],e[u],d)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function dU(t){return rt(t[0])}function hU(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var F9e={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=EP(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function lA(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=Hv("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;dU(t)&&(u=t,c=e),dU(e)&&(u=e,c=t);function f(m,y,b,x,w){var _=m.many,C=m.one;if(_.length===1&&!w){var D=y?_[0]:C,O=y?C:_[0];if(i_(D))f({many:[D],one:O},!0,b,x,!0);else{var I=s?qt({delay:s(b,x)},l):l;y4(D,O,I),a(D,O,D,O,I)}}else for(var L=qt({dividePath:F9e[r],individualDelay:s&&function(ue,ie,Se,me){return s(ue+b,x)}},l),V=y?B9e(_,C,L):z9e(C,_,L),H=V.fromIndividuals,Y=V.toIndividuals,te=H.length,Q=0;Q<te;Q++){var I=s?qt({delay:s(Q,te)},l):l;a(H[Q],Y[Q],y?_[Q]:m.one,y?m.one:_[Q],I)}}for(var d=u?u===t:t.length>e.length,h=u?hU(c,u):hU(d?e:t,[d?t:e]),p=0,v=0;v<h.length;v++)p+=h[v].many.length;for(var g=0,v=0;v<h.length;v++)f(h[v],d,g,p),g+=h[v].many.length}function Kf(t){if(!t)return[];if(rt(t)){for(var e=[],r=0;r<t.length;r++)e.push(Kf(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof Sr&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var noe=1e4,V9e=0,pU=1,vU=2,H9e=br();function $9e(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function U9e(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function gU(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=$9e(t,i);if(a){var o=U9e(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function mU(t){var e=[];return W(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>noe){process.env.NODE_ENV!=="production"&&kn("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:gU(n,o,i,!1),childGroupId:gU(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function uA(t,e,r){t.traverse(function(n){n instanceof Sr&&wn(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function cA(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Qh(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function j9e(t,e,r){var n=Hv("update",r,e);n&&t.traverse(function(i){if(i instanceof Bo){var a=wEe(i);a&&i.animateFrom({style:a},n)}})}function G9e(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function ioe(t,e,r){var n=mU(t),i=mU(e);function a(b,x,w,_,C){(w||b)&&x.animateFrom({style:w&&w!==b?Je(Je({},w.style),b.style):b.style},C)}var o=!1,s=V9e,l=Dt(),u=Dt();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var c=0;c<i.length;c++){var f=i[c].groupId;if(u.get(f)){s=pU;break}var d=i[c].childGroupId;if(d&&l.get(d)){s=vU;break}}function h(b,x){return function(w){var _=w.data,C=w.dataIndex;return x?_.getId(C):b?s===pU?w.childGroupId:w.groupId:s===vU?w.childGroupId:w.groupId}}var p=G9e(n,i),v={};if(!p)for(var c=0;c<i.length;c++){var g=i[c],m=g.data.getItemGraphicEl(g.dataIndex);m&&(v[m.id]=!0)}function y(b,x){var w=n[x],_=i[b],C=_.data.hostModel,D=w.data.getItemGraphicEl(w.dataIndex),O=_.data.getItemGraphicEl(_.dataIndex);if(D===O){O&&j9e(O,_.dataIndex,C);return}D&&v[D.id]||O&&(Qh(O),D?(Qh(D),cA(D),o=!0,lA(Kf(D),Kf(O),_.divide,C,b,a)):uA(O,C,b))}new du(n,i,h(!0,p),h(!1,p),null,"multiple").update(y).updateManyToOne(function(b,x){var w=i[b],_=w.data,C=_.hostModel,D=_.getItemGraphicEl(w.dataIndex),O=Yr(at(x,function(I){return n[I].data.getItemGraphicEl(n[I].dataIndex)}),function(I){return I&&I!==D&&!v[I.id]});D&&(Qh(D),O.length?(W(O,function(I){Qh(I),cA(I)}),o=!0,lA(Kf(O),Kf(D),w.divide,C,b,a)):uA(D,C,w.dataIndex))}).updateOneToMany(function(b,x){var w=n[x],_=w.data.getItemGraphicEl(w.dataIndex);if(!(_&&v[_.id])){var C=Yr(at(b,function(O){return i[O].data.getItemGraphicEl(i[O].dataIndex)}),function(O){return O&&O!==_}),D=i[b[0]].data.hostModel;C.length&&(W(C,function(O){return Qh(O)}),_?(Qh(_),cA(_),o=!0,lA(Kf(_),Kf(C),w.divide,D,b[0],a)):W(C,function(O){return uA(O,D,b[0])}))}}).updateManyToMany(function(b,x){new du(x,b,function(w){return n[w].data.getId(n[w].dataIndex)},function(w){return i[w].data.getId(i[w].dataIndex)}).update(function(w,_){y(b[w],x[_])}).execute()}).execute(),o&&W(e,function(b){var x=b.data,w=x.hostModel,_=w&&r.getViewOfSeriesModel(w),C=Hv("update",w,0);_&&w.isAnimationEnabled()&&C&&C.duration>0&&_.group.traverse(function(D){D instanceof Sr&&!D.animators.length&&D.animateFrom({style:{opacity:0}},C)})})}function yU(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function bU(t){return rt(t)?t.sort().join(","):t}function nc(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function W9e(t,e){var r=Dt(),n=Dt(),i=Dt();W(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],c=yU(o),f=bU(c);n.set(f,{dataGroupId:l,data:u}),rt(c)&&W(c,function(d){i.set(d,{key:f,dataGroupId:l,data:u})})});function a(o){r.get(o)&&kn("Duplicated seriesKey in universalTransition "+o)}return W(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=yU(o),c=bU(u),f=n.get(c);if(f)process.env.NODE_ENV!=="production"&&a(c),r.set(c,{oldSeries:[{dataGroupId:f.dataGroupId,divide:nc(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:nc(l),data:l}]});else if(rt(u)){process.env.NODE_ENV!=="production"&&a(c);var d=[];W(u,function(v){var g=n.get(v);g.data&&d.push({dataGroupId:g.dataGroupId,divide:nc(g.data),data:g.data})}),d.length&&r.set(c,{oldSeries:d,newSeries:[{dataGroupId:s,data:l,divide:nc(l)}]})}else{var h=i.get(u);if(h){var p=r.get(h.key);p||(p={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:nc(h.data)}],newSeries:[]},r.set(h.key,p)),p.newSeries.push({dataGroupId:s,data:l,divide:nc(l)})}}}}),r}function xU(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function q9e(t,e,r,n){var i=[],a=[];W(fn(t.from),function(o){var s=xU(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:nc(e.oldData[s]),groupIdDim:o.dimension})}),W(fn(t.to),function(o){var s=xU(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:nc(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&ioe(i,a,n)}function K9e(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){W(fn(n.seriesTransition),function(i){W(fn(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][zx]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=H9e(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)W(fn(a),function(h){q9e(h,i,n,r)});else{var o=W9e(i,n);W(o.keys(),function(h){var p=o.get(h);ioe(p.oldSeries,p.newSeries,r)})}W(n.updatedSeries,function(h){h[zx]&&(h[zx]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],c=i.oldData=[],f=0;f<s.length;f++){var d=s[f].getData();d.count()<noe&&(l.push(s[f]),u.push(s[f].get("dataGroupId")),c.push(d))}})}var Y9e=(function(){function t(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return t.prototype.setBreaks=function(e){this.breaks=e.breaks},t.prototype.update=function(e){Z9e(this,e);var r=this._elapsedExtent;r[0]=this.elapse(e[0]),r[1]=this.elapse(e[1])},t.prototype.hasBreaks=function(){return!!this.breaks.length},t.prototype.calcNiceTickMultiple=function(e,r){for(var n=0;n<this.breaks.length;n++){var i=this.breaks[n];if(i.vmin<e&&e<i.vmax){var a=r(e,i.vmax);return process.env.NODE_ENV!=="production"&&Mt(a>=0&&Math.round(a)===a),a}}return 0},t.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},t.prototype.normalize=function(e){var r=this._elapsedExtent[1]-this._elapsedExtent[0];return r===0?.5:(this.elapse(e)-this._elapsedExtent[0])/r},t.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},t.prototype.elapse=function(e){for(var r=wU,n=SU,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?r+=o.vmin-n+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=e-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=e-n),r},t.prototype.unelapse=function(e){for(var r=wU,n=SU,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],l=r+s.vmin-n,u=l+s.gapReal;if(e<=u){e>l?a=s.vmin+(e-l)/(u-l)*(s.vmax-s.vmin):a=n+e-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+e-r),a},t})();function X9e(){return new Y9e}var wU=0,SU=0;function Z9e(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};W(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=b4(s,e);if(u){var c=u.vmin!==s.vmin,f=u.vmax!==s.vmax,d=u.vmax-u.vmin;if(!(c&&f))if(c||f){var h=c?"S":"E";a[h][l.type].has=!0,a[h][l.type].span=d,a[h][l.type].inExtFrac=d/(s.vmax-s.vmin),a[h][l.type].val=l.val}else n[l.type].span+=d,n[l.type].val+=l.val}});var o=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));W(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function J9e(t,e,r,n,i,a){t!=="no"&&W(r,function(o){var s=b4(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],c=n(u),f=i*3/4;c>s.vmin-f&&c<s.vmax+f&&(t!=="preserve_extent_bound"||c!==a[0]&&c!==a[1])&&e.splice(l,1)}})}function Q9e(t,e,r,n){W(e,function(i){var a=b4(i,r);a&&(t.push({value:a.vmin,break:{type:"vmin",parsedBreak:a},time:n?n(a):void 0}),t.push({value:a.vmax,break:{type:"vmax",parsedBreak:a},time:n?n(a):void 0}))}),e.length&&t.sort(function(i,a){return i.value-a.value})}function b4(t,e){var r=Math.max(t.vmin,e[0]),n=Math.min(t.vmax,e[1]);return r<n||r===n&&r>e[0]&&r<e[1]?{vmin:r,vmax:n,breakOption:t.breakOption,gapParsed:t.gapParsed,gapReal:t.gapReal}:null}function kI(t,e,r){var n=[];if(!t)return{breaks:n};function i(o,s){return o>=0&&o<1-1e-5?!0:(process.env.NODE_ENV!=="production"&&Rr(s+" must be >= 0 and < 1, rather than "+o+" ."),!1)}W(t,function(o){if(!o||o.start==null||o.end==null){process.env.NODE_ENV!=="production"&&Rr("The input axis breaks start/end should not be empty.");return}if(!o.isExpanded){var s={breakOption:Ut(o),vmin:e(o.start),vmax:e(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(yt(o.gap)){var u=Ao(o.gap);if(u.match(/%$/)){var c=parseFloat(u)/100;i(c,"Percent gap")||(c=0),s.gapParsed.type="tpPrct",s.gapParsed.val=c,l=!0}}if(!l){var f=e(o.gap);(!isFinite(f)||f<0)&&(process.env.NODE_ENV!=="production"&&Rr("Axis breaks gap must positive finite rather than ("+o.gap+")."),f=0),s.gapParsed.type="tpAbs",s.gapParsed.val=f}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&W(["vmin","vmax"],function(h){s[h]<0&&(process.env.NODE_ENV!=="production"&&Rr("Axis break."+h+" must not be negative."),s[h]=0)}),s.vmin>s.vmax){var d=s.vmax;s.vmax=s.vmin,s.vmin=d}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return W(n,function(o,s){a>o.vmin&&(process.env.NODE_ENV!=="production"&&Rr("Axis breaks must not overlap."),n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function x4(t,e){return NI(e)===NI(t)}function NI(t){return t.start+"_\0_"+t.end}function e7e(t,e,r){var n=[];W(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),W(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=Jd(n,function(u){return x4(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return W(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function t7e(t,e,r,n){var i,a;if(t.break){var o=t.break.parsedBreak,s=Jd(r,function(f){return x4(f.breakOption,t.break.parsedBreak.breakOption)}),l=n(Math.pow(e,o.vmin),s.vmin),u=n(Math.pow(e,o.vmax),s.vmax),c={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?Jn(Math.pow(e,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:t.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:c,gapReal:o.gapReal}},a=s[t.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function r7e(t,e,r){var n={noNegative:!0},i=kI(t,r,n),a=kI(t,r,n),o=Math.log(e);return a.breaks=at(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,c={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:c,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var n7e={vmin:"start",vmax:"end"};function i7e(t,e){return e&&(t=t||{},t.break={type:n7e[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function a7e(){jEe({createScaleBreakContext:X9e,pruneTicksByBreak:J9e,addBreaksToTicks:Q9e,parseAxisBreakOption:kI,identifyAxisBreak:x4,serializeAxisBreakIdentifier:NI,retrieveAxisBreakPairs:e7e,getTicksLogTransformBreak:t7e,logarithmicParseBreaksFromOption:r7e,makeAxisLabelFormatterParamBreak:i7e})}var _U=br();function o7e(t,e){var r=Jd(t,function(n){return ei().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function s7e(t){W(t,function(e){return e.shouldRemove=!0})}function l7e(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function u7e(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!ei())return;var o=ei().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(O){return O.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var f=s.get("expandOnClick"),d=s.get("zigzagZ"),h=s.getModel("itemStyle"),p=h.getItemStyle(),v=p.stroke,g=p.lineWidth,m=p.lineDash,y=p.fill,b=new $t({ignoreModelZ:!0}),x=a.isHorizontal(),w=_U(e).visualList||(_U(e).visualList=[]);s7e(w);for(var _=function(O){var I=o[O][0].break.parsedBreak,L=[];L[0]=a.toGlobalCoord(a.dataToCoord(I.vmin,!0)),L[1]=a.toGlobalCoord(a.dataToCoord(I.vmax,!0)),L[1]<L[0]&&L.reverse();var V=o7e(w,I);V.shouldRemove=!1;var H=new $t;D(V.zigzagRandomList,H,L[0],L[1],x,I),f&&H.on("click",function(){var Y={type:m2,breaks:[{start:I.breakOption.start,end:I.breakOption.end}]};Y[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(Y)}),H.silent=!f,b.add(H)},C=0;C<o.length;C++)_(C);t.add(b),l7e(w);function D(O,I,L,V,H,Y){var te={stroke:v,lineWidth:g,lineDash:m,fill:"none"},Q=H?0:1,ue=1-Q,ie=n[Qt[ue]]+n[ti[ue]];function Se(Ee){var fe=[],Me=[];fe[Q]=Me[Q]=Ee,fe[ue]=n[Qt[ue]],Me[ue]=ie;var Ne={x1:fe[0],y1:fe[1],x2:Me[0],y2:Me[1]};return Q_(Ne,Ne,{lineWidth:1}),fe[0]=Ne.x1,fe[1]=Ne.y1,fe[Q]}L=Se(L),V=Se(V);for(var me=[],ae=[],Te=!0,Be=n[Qt[ue]],He=0;;He++){var qe=Be===n[Qt[ue]],ot=Be>=ie;ot&&(Be=ie);var st=[],he=[];st[Q]=L,he[Q]=V,!qe&&!ot&&(st[Q]+=Te?-l:l,he[Q]-=Te?l:-l),st[ue]=Be,he[ue]=Be,me.push(st),ae.push(he);var Ce=void 0;if(He<O.length?Ce=O[He]:(Ce=Math.random(),O.push(Ce)),Be+=Ce*(c-u)+u,Te=!Te,ot)break}var ve=ei().serializeAxisBreakIdentifier(Y.breakOption);if(I.add(new Wi({anid:"break_a_"+ve,shape:{points:me},style:te,z:d})),Y.gapReal!==0){I.add(new Wi({anid:"break_b_"+ve,shape:{points:ae},style:te,z:d}));var xe=ae.slice();xe.reverse();var le=me.concat(xe);I.add(new na({anid:"break_c_"+ve,shape:{points:le},style:{fill:y,opacity:p.opacity},z:d}))}}}function c7e(t,e,r,n){var i=t.axis,a=r.transform;Mt(n.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=ei().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(g){return g.break},!1),l=at(s,function(g){var m=g[0].break.parsedBreak,y=[i.dataToCoord(m.vmin,!0),i.dataToCoord(m.vmax,!0)];return y[0]>y[1]&&y.reverse(),{coordPair:y,brkId:ei().serializeAxisBreakIdentifier(m.breakOption)}});l.sort(function(g,m){return g.coordPair[0]-m.coordPair[0]});for(var u=o[0],c=null,f=0;f<l.length;f++){var d=l[f],h=Math.max(d.coordPair[0],o[0]),p=Math.min(d.coordPair[1],o[1]);u<=h&&v(u,h,c,d),u=p,c=d}u<=o[1]&&v(u,o[1],c,null);function v(g,m,y,b){function x(L,V){a&&(Kn(L,L,a),Kn(V,V,a))}function w(L,V){var H={x1:L[0],y1:L[1],x2:V[0],y2:V[1]};Q_(H,H,n.style),L[0]=H.x1,L[1]=H.y1,V[0]=H.x2,V[1]=H.y2}var _=[g,0],C=[m,0],D=[g,5],O=[m,5];x(_,D),w(_,D),x(C,O),w(C,O),w(_,C);var I=new Qn(Je({shape:{x1:_[0],y1:_[1],x2:C[0],y2:C[1]}},n));e.add(I),I.anid="breakLine_"+(y?y.brkId:"\0")+"_\0_"+(b?b.brkId:"\0")}}function f7e(t,e,r){if(Jd(r,function(y){return!y}))return;var n=new Wt;if(!v2(r[0],r[1],n,{direction:-(t?e+Math.PI:e),touchThreshold:0,bidirectional:!1}))return;var i=Ri();qc(i,i,-e);var a=at(r,function(y){return y.transform?Js(Ri(),i,y.transform):i});function o(y){var b=r[0].localRect,x=new Wt(b[ti[y]]*a[0][0],b[ti[y]]*a[0][1]);return Math.abs(x.y)<1e-5}var s=.5;if(o(0)||o(1)){var l=at(r,function(y,b){var x=y.localRect.clone();return x.applyTransform(a[b]),x}),u=new Wt;u.copy(r[0].label).add(r[1].label).scale(.5),u.transform(i);var c=n.clone().transform(i),f=l[0].x+l[1].x+(c.x>=0?l[0].width:l[1].width),d=(f+c.x)/2-u.x,h=Math.min(d,d-c.x),p=Math.max(d,d-c.x),v=p<0?p:h>0?h:0;s=(d-v)/c.x}var g=new Wt,m=new Wt;Wt.scale(g,n,-s),Wt.scale(m,n,1-s),DR(r[0],g),DR(r[1],m)}function d7e(t,e){var r={breaks:[]};return W(e.breaks,function(n){if(n){var i=Jd(t.get("breaks",!0),function(s){return ei().identifyAxisBreak(s,n)});if(!i){process.env.NODE_ENV!=="production"&&kn("Can not find axis break by start: "+n.start+", end: "+n.end);return}var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===m2?!0:a===Tne?!1:a===Cne?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}),r}function h7e(){uRe({adjustBreakLabelPair:f7e,buildAxisBreakLine:c7e,rectCoordBuildBreakAxis:u7e,updateModelAxisBreak:d7e})}function p7e(t){vRe(t),a7e(),h7e()}function v7e(){PRe(g7e)}function g7e(t,e){W(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=m7e(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function m7e(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof mv?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=Kv(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c<i;c+=u){var f=n?n[c]:{value:a[0]+c},d=s(f,c),h=o.getTextRect(d),p=v(h,o.get("rotate")||0);l?l.union(p):l=p}return l;function v(g,m){var y=m*Math.PI/180,b=g.width,x=g.height,w=b*Math.abs(Math.cos(y))+Math.abs(x*Math.sin(y)),_=b*Math.abs(Math.sin(y))+Math.abs(x*Math.cos(y)),C=new Kt(g.x,g.y,w,_);return C}}fr([sOe]);fr([rOe]);fr([MOe,$Oe,JOe,tIe,dIe,tLe,ALe,fPe,OPe,FPe,GPe,QPe,W3e,g4e,M4e,U4e,q4e,n5e,c5e,w5e,M5e,B5e,x6e]);fr(F6e);fr(cBe);fr(Zne);fr(SBe);fr(Bie);fr(EBe);fr(WBe);fr(t8e);fr(H8e);fr(oze);fr($0);fr(Sze);fr(Cze);fr(Lze);fr(Uze);fr(Yze);fr(tFe);fr(fFe);fr(NFe);fr(jae);fr(Gae);fr(XFe);fr(Xae);fr(Zae);fr(e9e);fr(a9e);fr(y9e);fr(w9e);fr(K9e);fr(SDe);fr(p7e);fr(v7e);fr(rIe);function aoe(t,e,r){let n={};if(!t||!e)return n;const i=["pie","ring","radar"];e.titleText&&e.titleText!==""&&(n.title={},n.title.text=e.titleText,n.title.left=e.titleleft??"left");let a=[];function o(){n.legend={},n.legend.show=!!e.legend,n.legend[e.legendlocation]=10,n.legend.left=e.legendleft,n.legend.orient=e.legendorient,n.legend.data=[],a=t.legends,console.log(t,"colNameList"),n.legend.data=t.legends}o();function s(){if(i.includes(e.seriesType)||(n.yAxis={type:"value"},n.xAxis={},n.xAxis.type="category",n.xAxis.data=t.labels),n.series=[],i.includes(e.seriesType))e.seriesType==="pie"&&n.series.push({name:"饼图",type:e.seriesType,data:t.labels.map((u,c)=>({value:t.series[0][c],name:u}))}),e.seriesType==="ring"&&n.series.push({name:"环形图",type:"pie",radius:["40%","70%"],itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},data:t.labels.map((u,c)=>({value:t.series[0][c],name:u}))}),e.seriesType==="radar"&&(n.series.push({name:"雷达图",type:e.seriesType,data:t.legends.map((u,c)=>({value:t.series[c],name:u}))}),n.radar={indicator:t.labels.map(u=>({name:u}))});else for(let u=0;u<a.length;u++)n.series.push({name:n.legend.data[u],type:e.seriesType,data:t.series[u]}),e.seriesType==="smooth"&&(n.series[u].type="line",n.series[u].smooth=!0),e.seriesType==="area"&&(n.series[u].type="line",n.series[u].areaStyle={});i.includes(e.seriesType)&&n.legend.data!==null&&delete n.legend.data}s(),n.grid={left:"3%",right:"4%",top:30,bottom:30,containLabel:!0},n?.legend?.show&&(n?.legend?.bottom?n.grid.bottom=60:n.grid.top=60);const l=r.echarts?.onSetOptions?.(t,e);return l!==null&&typeof l=="object"&&(n=l),JSON.parse(JSON.stringify(n))}function E2(t,e){j.useEffect(()=>{const r=n=>{const i=t?.current;!i||i.contains(n.target)||e(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,e])}const y7e=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a}=Ot(),o=j.useRef(null),s=j.useRef(null),[l,u]=j.useState(!1),[c,f]=j.useState(0),d=j.useRef(null),[h,p]=j.useState(null),v=j.useMemo(()=>{const w=Number(e.attrs.width),_=Number(e.attrs.height);if(!(!w||!_))return{width:w,height:_,left:0,top:0,angle:0}},[e.attrs.width,e.attrs.height]),g=j.useMemo(()=>{const{nodeAlign:w,margin:_}=e.attrs,C=_?.top&&_?.top!==""?`${_.top}px`:void 0,D=_?.bottom&&_?.bottom!==""?`${_.bottom}px`:void 0;return{justifyContent:w,marginTop:C,marginBottom:D}},[e.attrs.nodeAlign,e.attrs.margin]),m=j.useRef(()=>{}),y=async()=>{const{chartOptions:w,chartConfig:_,mode:C}=e.attrs,D=s.current;if(D){if(D.clientWidth===0||D.clientHeight===0){d.current&&(d.current.dispose(),d.current=null,p(null));return}if(d.current&&(d.current.dispose(),d.current=null,p(null)),C===1){if(_!==null){const O=aoe(_.data,_.config,i);O!==null&&(d.current=CR(D),d.current.setOption(O),p(O))}}else w!==null&&(d.current=CR(D),d.current.setOption(w),p(w))}};m.current=y,j.useEffect(()=>{y(),o.current&&(f(o.current.offsetWidth),e.attrs.width===null&&setTimeout(()=>{r({width:300,height:210})}));let w=null;return s.current&&(w=new ResizeObserver(()=>{d.current?d.current.resize():m.current()}),w.observe(s.current)),()=>{w?.disconnect(),d.current&&(d.current.dispose(),d.current=null)}},[]),j.useEffect(()=>{y()},[e.attrs.chartOptions,e.attrs.chartConfig,e.attrs.mode,e.attrs.id]),j.useEffect(()=>{d.current&&d.current.resize()},[e.attrs.width,e.attrs.height]);const b=({width:w,height:_})=>{r({width:Number(w.toFixed(2)),height:Number(_.toFixed(2))})},x=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),u(!0))};return E2(o,()=>{u(!1)}),F.jsx(yu,{id:e.attrs.id,ref:o,className:"flex max-h-full relative",style:g,children:F.jsx("div",{className:"max-h-full max-w-full w-auto relative z-20 white-view-node","data-options":i.document?.readOnly?JSON.stringify(h):null,children:F.jsx(P_,{selected:l,rotatable:!1,boundary:!1,disabled:i.document?.readOnly,size:v,maxWidth:c,minWidth:200,minHeight:200,zIndex:10,onResize:b,onFocus:x,children:F.jsx("div",{id:`chart-${e.attrs.id}`,ref:s,className:"min-h-[200px] w-full h-full bg-[#fff] white-chart-node"})})})})},b7e=Nn.create({name:"echarts",inline:!1,group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},id:{default:null},name:{default:null},width:{default:null},height:{default:300},draggable:{default:!1},mode:{default:1},chartOptions:{default:null,parseHTML:t=>{const e=t.hasAttribute("chart-options")?t.getAttribute("chart-options"):null;return e?JSON.parse(e):null},renderHTML:t=>({"chart-options":t.chartOptions?JSON.stringify(t.chartOptions):null})},chartConfig:{default:null,parseHTML:t=>{const e=t.hasAttribute("chart-config")?t.getAttribute("chart-config"):null;return e?JSON.parse(e):null},renderHTML:t=>({"chart-config":t.chartConfig?JSON.stringify(t.chartConfig):null})}}},parseHTML(){return[{tag:"echarts"}]},renderHTML({HTMLAttributes:t}){return["echarts",zr(t)]},addNodeView(){return ml(y7e)},addCommands(){return{setEcharts:t=>({commands:e,editor:r})=>e.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:t}),updateEcharts:t=>({commands:e,editor:r,tr:n})=>{r.commands.selectParentNode();const{selection:i}=r.state;n.setSelection(i);const{doc:a}=n,{from:o,to:s}=i;return a.nodesBetween(o,s,l=>l.type.name===this.name?(e.updateAttributes(this.name,t),!1):!0),!0}}}}),x7e=t=>{const{key:e,editor:r,onPaste:n,onDrop:i,allowedMimeTypes:a}=t;return new en({key:e||new on("fileHandler"),props:{handleDrop(o,s){const{dataTransfer:l}=s;if(!i||!l?.files.length)return;const u=o.posAtCoords({left:s.clientX,top:s.clientY});let c=Array.from(l.files);a.length>0&&(c=c.filter(f=>a.includes(f.type)?!0:a.includes(`${f.type.split("/")[0]}/*`))),c.length!==0&&i(r,c,(u===null?void 0:u.pos)??0),s.preventDefault(),s.stopPropagation()},handlePaste(o,s){const{clipboardData:l}=s;if(!n||!l?.files.length)return;let u=Array.from(l.files);const c=l.getData("text/html");a.length>0&&(u=u.filter(f=>a.includes(f.type)?!0:a.includes(`${f.type.split("/")[0]}/*`))),u.length!==0&&n(r,u,c),s.preventDefault(),s.stopPropagation()}}})},w7e=Vr.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:[]}),addProseMirrorPlugins(){return[x7e({key:new on(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),S7e=Vr.create({name:"fontSize",addOptions(){return{types:["textStyle"],defaultFontSize:"14px"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:this.options.defaultFontSize,parseHTML:t=>t.style.fontSize||this.options.defaultFontSize,renderHTML:t=>t.fontSize===this.options.defaultFontSize?{}:{style:`font-size: ${t.fontSize}`}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),_7e=Vr.create({name:"painter",addCommands(){return{setFormatPainter:t=>({editor:e,view:r})=>{const{tr:n}=r.state,i=e.state.selection.$head.marks();return r.painter={enabled:!0,once:t,marks:i},r.dispatch(n.setMeta("painterAction",{type:"start",marks:i})),!0},unsetFormatPainter:()=>({view:t})=>{const{tr:e}=t.state;return t.painter={enabled:!1,once:!0,marks:[]},t.dispatch(e.setMeta("painterAction",{type:"end"})),!0}}},addProseMirrorPlugins(){return[new en({key:new on("format-painter"),state:{init:()=>[],apply(t,e){const r=t.getMeta("painterAction");return r?.type==="start"?r.marks:r?.type==="end"?[]:e}},props:{handleDOMEvents:{mousedown(t){const e=this.getState(t.state),{painter:r}=t;if(!e||e.length===0)return!1;const n=()=>{if(document.removeEventListener("mouseup",n),!r.enabled)return;const{dispatch:i}=t;let{tr:a}=t.state;const{selection:o}=t.state;a=a.removeMark(o.from,o.to);for(const s of e)s.type.name!=="link"&&(a=a.addMark(o.from,o.to,s));r.once?(r.enabled=!1,r.marks=[],i(a.setMeta("painterAction",{type:"end"}))):i(a.setMeta("painterAction",{type:"start",marks:r.marks}))};return document.addEventListener("mouseup",n),!0}}}})]}}),T7e=hZ.extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{"data-line-number":!1}}},parseHTML(){return[{tag:"hr"}]},addAttributes(){return{"data-type":{parseHTML:t=>t.getAttribute("data-type")??"signle"},color:{parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color,style:`color: ${t.color??"inherit"}`})}}},addCommands(){return{setHr:({type:t,color:e})=>({chain:r,state:n})=>{const{$to:i}=n.selection,a=r();return i.parentOffset===0?a.insertContentAt(Math.max(i.pos-2,0),{type:this.name,attrs:{"data-type":t,color:e}}):a.insertContent({type:this.name,attrs:{"data-type":t,color:e}}),a.command(({tr:o,dispatch:s})=>{if(s){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(ir.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(ar.create(o.doc,l.pos)):o.setSelection(ir.create(o.doc,l.pos));else{const c=l.parent.type.contentMatch.defaultType?.create()??0;c&&(o.insert(u,c),o.setSelection(ir.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[N_({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),C7e=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a}=Ot(),o=j.useRef(null),[s,l]=j.useState(!1),[u,c]=j.useState(0),f=j.useMemo(()=>{const{nodeAlign:p,margin:v}=e.attrs,g=v?.top&&v?.top!==""?`${v.top}px`:void 0,m=v?.bottom&&v?.bottom!==""?`${v.bottom}px`:void 0;return{justifyContent:p,marginTop:g,marginBottom:m}},[e.attrs.nodeAlign,e.attrs.margin]);j.useEffect(()=>{if(o.current){const{offsetWidth:p}=o.current;c(p),e.attrs.width===null&&setTimeout(()=>{r({width:p})})}},[]);const d=({width:p,height:v})=>{r({width:p,height:v})},h=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),l(!0))};return E2(o,()=>{l(!1)}),F.jsx(yu,{id:e.attrs.id,ref:o,className:"flex max-h-full relative white-iframe-node",style:f,children:e.attrs.src!==""?F.jsx("div",{className:"max-w-full white-view-node white-iframe-wrapper relative flex rounded-[4px]",children:F.jsx(P_,{selected:s,rotatable:!1,boundary:!1,width:Number(e.attrs.width),height:Number(e.attrs.height),minWidth:400,minHeight:200,maxWidth:u,equalProportion:!0,disabled:i.editor?.readOnly,onResize:d,onFocus:h,children:F.jsx("iframe",{src:e.attrs.src,style:{pointerEvents:e.attrs.clickable?"auto":"none"},className:"w-full h-full"})})}):F.jsxs("div",{className:"flex items-center gap-3 w-full h-[60px] px-4 bg-[#f8f9fb] rounded-[4px] hover:bg-[#6b729414] cursor-pointer",children:[F.jsx("div",{className:"w-[40px] h-[40px] flex items-center justify-center rounded-[4px] bg-[#7e868e1f]",children:F.jsx("i",{className:"w-iconfont icon-web-page"})}),F.jsx("span",{className:"text-[14px] text-[#333] select-none",children:"插入网址"})]})})},E7e=Nn.create({name:"iframe",inline:!1,group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},type:{default:0},src:{default:null},width:{default:null},height:{default:200},clickable:{default:!1}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",zr(t)]},addNodeView(){return ml(C7e)},addCommands(){return{setIframe:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}}});var M7e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,A7e=Nn.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{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",zr(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,r,n,i,a,o;const s=(r=(e=t.attrs)==null?void 0:e.src)!=null?r:"",l=(i=(n=t.attrs)==null?void 0:n.alt)!=null?i:"",u=(o=(a=t.attrs)==null?void 0:a.title)!=null?o:"";return u?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{const l=document.createElement("img");Object.entries(o).forEach(([f,d])=>{if(d!=null)switch(f){case"width":case"height":break;default:l.setAttribute(f,d);break}}),l.src=o.src;const u=new Ige({element:l,editor:s,node:i,getPos:a,onResize:(f,d)=>{l.style.width=`${f}px`,l.style.height=`${d}px`},onCommit:(f,d)=>{const h=a();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:f,height:d}).run()},onUpdate:(f,d,h)=>f.type===i.type,options:{directions:t,min:{width:e,height:r},preserveAspectRatio:n===!0}}),c=u.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",l.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},u}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[N_({find:M7e,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),Hf={},Gu={},TU;function k7e(){if(TU)return Gu;TU=1;var t=Gu&&Gu.__awaiter||function(a,o,s,l){function u(c){return c instanceof s?c:new s(function(f){f(c)})}return new(s||(s=Promise))(function(c,f){function d(v){try{p(l.next(v))}catch(g){f(g)}}function h(v){try{p(l.throw(v))}catch(g){f(g)}}function p(v){v.done?c(v.value):u(v.value).then(d,h)}p((l=l.apply(a,o||[])).next())})},e=Gu&&Gu.__generator||function(a,o){var s={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},l,u,c,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=d(0),f.throw=d(1),f.return=d(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(p){return function(v){return h([p,v])}}function h(p){if(l)throw new TypeError("Generator is already executing.");for(;f&&(f=0,p[0]&&(s=0)),s;)try{if(l=1,u&&(c=p[0]&2?u.return:p[0]?u.throw||((c=u.return)&&c.call(u),0):u.next)&&!(c=c.call(u,p[1])).done)return c;switch(u=0,c&&(p=[p[0]&2,c.value]),p[0]){case 0:case 1:c=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,u=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(c=s.trys,!(c=c.length>0&&c[c.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]<c[3])){s.label=p[1];break}if(p[0]===6&&s.label<c[1]){s.label=c[1],c=p;break}if(c&&s.label<c[2]){s.label=c[2],s.ops.push(p);break}c[2]&&s.ops.pop(),s.trys.pop();continue}p=o.call(a,s)}catch(v){p=[6,v],u=0}finally{l=c=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.base64ToBlob=r;function r(a){return t(this,void 0,void 0,function(){var o,s,l;return e(this,function(u){switch(u.label){case 0:return[4,fetch(a)];case 1:return o=u.sent(),[4,o.blob()];case 2:return s=u.sent(),l=i(a),l&&(s=s.slice(0,s.size,l)),[2,s]}})})}var n=/^data:(.+);base64,/;function i(a){var o;return(o=a.match(n))===null||o===void 0?void 0:o.slice(1,2).pop()}return Gu}var Wu={},CU;function N7e(){if(CU)return Wu;CU=1;var t=Wu&&Wu.__awaiter||function(n,i,a,o){function s(l){return l instanceof a?l:new a(function(u){u(l)})}return new(a||(a=Promise))(function(l,u){function c(h){try{d(o.next(h))}catch(p){u(p)}}function f(h){try{d(o.throw(h))}catch(p){u(p)}}function d(h){h.done?l(h.value):s(h.value).then(c,f)}d((o=o.apply(n,i||[])).next())})},e=Wu&&Wu.__generator||function(n,i){var a={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},o,s,l,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(d){return function(h){return f([d,h])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;u&&(u=0,d[0]&&(a=0)),a;)try{if(o=1,s&&(l=d[0]&2?s.return:d[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,d[1])).done)return l;switch(s=0,l&&(d=[d[0]&2,l.value]),d[0]){case 0:case 1:l=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,s=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(l=a.trys,!(l=l.length>0&&l[l.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!l||d[1]>l[0]&&d[1]<l[3])){a.label=d[1];break}if(d[0]===6&&a.label<l[1]){a.label=l[1],l=d;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(d);break}l[2]&&a.ops.pop(),a.trys.pop();continue}d=i.call(n,a)}catch(h){d=[6,h],s=0}finally{o=l=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}};Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.base64ToFile=r;function r(n,i,a){return t(this,void 0,void 0,function(){var o,s;return e(this,function(l){switch(l.label){case 0:return[4,fetch(n)];case 1:return o=l.sent(),[4,o.blob()];case 2:return s=l.sent(),[2,new File([s],i,a)]}})})}return Wu}var qu={},EU;function ooe(){if(EU)return qu;EU=1;var t=qu&&qu.__awaiter||function(s,l,u,c){function f(d){return d instanceof u?d:new u(function(h){h(d)})}return new(u||(u=Promise))(function(d,h){function p(m){try{g(c.next(m))}catch(y){h(y)}}function v(m){try{g(c.throw(m))}catch(y){h(y)}}function g(m){m.done?d(m.value):f(m.value).then(p,v)}g((c=c.apply(s,l||[])).next())})},e=qu&&qu.__generator||function(s,l){var u={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},c,f,d,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=p(0),h.throw=p(1),h.return=p(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function p(g){return function(m){return v([g,m])}}function v(g){if(c)throw new TypeError("Generator is already executing.");for(;h&&(h=0,g[0]&&(u=0)),u;)try{if(c=1,f&&(d=g[0]&2?f.return:g[0]?f.throw||((d=f.return)&&d.call(f),0):f.next)&&!(d=d.call(f,g[1])).done)return d;switch(f=0,d&&(g=[g[0]&2,d.value]),g[0]){case 0:case 1:d=g;break;case 4:return u.label++,{value:g[1],done:!1};case 5:u.label++,f=g[1],g=[0];continue;case 7:g=u.ops.pop(),u.trys.pop();continue;default:if(d=u.trys,!(d=d.length>0&&d[d.length-1])&&(g[0]===6||g[0]===2)){u=0;continue}if(g[0]===3&&(!d||g[1]>d[0]&&g[1]<d[3])){u.label=g[1];break}if(g[0]===6&&u.label<d[1]){u.label=d[1],d=g;break}if(d&&u.label<d[2]){u.label=d[2],u.ops.push(g);break}d[2]&&u.ops.pop(),u.trys.pop();continue}g=l.call(s,u)}catch(m){g=[6,m],f=0}finally{c=d=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}};Object.defineProperty(qu,"__esModule",{value:!0}),qu.blobToBase64=r;function r(s){return t(this,void 0,void 0,function(){return e(this,function(l){return[2,typeof FileReader=="function"?i(s):o(s)]})})}var n;(function(s){s.error="error",s.loadend="loadend"})(n||(n={}));function i(s){return t(this,void 0,void 0,function(){return e(this,function(l){return[2,new Promise(function(u,c){try{var f=new FileReader,d=function(){u(f.result),f.removeEventListener(n.loadend,d)};f.addEventListener(n.loadend,d);var h=function(){c(f.error),f.removeEventListener(n.error,h)};f.addEventListener(n.error,h),f.readAsDataURL(s)}catch(p){c(p)}})]})})}var a="application/octet-stream";function o(s){return t(this,void 0,void 0,function(){var l,u,c,f;return e(this,function(d){switch(d.label){case 0:return c=(u=Buffer).from,[4,s.text()];case 1:return l=c.apply(u,[d.sent()]),f=s.type||a,[2,"data:".concat(f,";base64,").concat(l.toString("base64"))]}})})}return qu}var fA={},MU;function D7e(){return MU||(MU=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.fileToBase64=void 0;var e=ooe();Object.defineProperty(t,"fileToBase64",{enumerable:!0,get:function(){return e.blobToBase64}})})(fA)),fA}var AU;function O7e(){return AU||(AU=1,(function(t){var e=Hf&&Hf.__createBinding||(Object.create?(function(n,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,o,s)}):(function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]})),r=Hf&&Hf.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(k7e(),t),r(N7e(),t),r(ooe(),t),r(D7e(),t)})(Hf)),Hf}var R7e=O7e();const soe=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a,uploadFileMap:o,deleteUploadFile:s}=Ot(),l=j.useRef(null),u=j.useRef(null),[c,f]=j.useState(!1),[d,h]=j.useState(0),[p,v]=j.useState(0),[g,m]=j.useState(!1),[y,b]=j.useState(!1),x=j.useMemo(()=>{const H=Number(e.attrs.width),Y=Number(e.attrs.height);if(!(!H||!Y))return{width:H,height:Y,left:0,top:0,angle:0}},[e.attrs.width,e.attrs.height]),w=j.useMemo(()=>{const{nodeAlign:H,margin:Y}=e.attrs,te=Y?.top&&Y?.top!==""?`${Y.top}px`:void 0,Q=Y?.bottom&&Y?.bottom!==""?`${Y.bottom}px`:void 0;return{justifyContent:H,marginTop:te,marginBottom:Q,zIndex:c?100:0}},[e.attrs.nodeAlign,e.attrs.margin,c]),_=e.attrs.src,C=()=>{if(m(!1),e.attrs.width===null){const{naturalWidth:H=0,naturalHeight:Y=0}=u.current??{},te=l.current?.offsetWidth??0;h(te);const Q=Y>0?H/Y:16/9;v(te/Q),r({width:200,height:(200/Q).toFixed(2)})}},D=()=>{m(!1),b(!0)};j.useEffect(()=>{typeof n=="function"&&a&&Gp(a,{error:y},n())},[y]);const O=async()=>{if(e.attrs.uploaded||!e.attrs.id||!o.has(e.attrs.id)){typeof n=="function"&&a&&Gp(a,{uploaded:!0},n());return}try{const H=o.get(e.attrs.id),{id:Y,url:te}=await i?.onFileUpload?.(H)??{};l.current&&typeof n=="function"&&a&&Gp(a,{id:Y,src:te,uploaded:!0},n()),s(e.attrs.id)}catch(H){console.error(H)}};j.useEffect(()=>{(async()=>{if(e.attrs.uploaded===!1&&!y){if(_?.startsWith("data:image")){const[Y]=_.split(","),te=Y.match(/:(.*?);/)?.[1];let Q=te?.split("/")[1];Q==="jpeg"&&(Q="jpg"),Q==="svg+xml"&&(Q="svg");const ue=Nv(),ie=await R7e.base64ToFile(_,`${ue}.${Q}`,{type:te});o.set(e.attrs.id,ie)}O()}})()},[_]);const I=({angle:H})=>{r({angle:H})},L=({width:H,height:Y})=>{r({width:H.toFixed(2),height:Y.toFixed(2)})},V=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),f(!0))};return E2(l,()=>{f(!1)}),j.useEffect(()=>{l.current&&h(l.current.offsetWidth)},[]),F.jsx(yu,{ref:l,className:`white-image-wrapper flex max-h-full relative ${e.attrs.inline?"is-inline-image":""}`,style:w,children:F.jsxs("div",{className:`max-h-full max-w-full w-auto relative z-20 node-view-image white-view-node ${_&&g?"is-loading":""} ${_&&y?"is-error":""}`,children:[_&&g&&F.jsxs("div",{className:"flex items-center justify-center text-[14px] gap-[10px] text-[#00000080]",style:{height:`${e.attrs.height}px`},children:[F.jsx("i",{className:"white-loading-icon w-iconfont icon-loading !text-[14px]"}),"图片加载中..."]}),_&&y&&F.jsxs("div",{className:"w-full h-[200px] flex items-center justify-center flex-col text-[14px] gap-[10px] text-[#00000080]",style:{height:`${e.attrs.height}px`},children:[F.jsxs("svg",{viewBox:"0 0 1316 1024",xmlns:"http://www.w3.org/2000/svg",width:"70",height:"70",children:[F.jsx("path",{d:"M690.943634 717.513143l-412.708571-391.222857a83.876571 83.876571 0 0 0-23.168 17.536l-171.922286 180.388571-9.088-336.091428c-1.152-40.411429 31.451429-74.587429 71.899429-75.593143l304.347428-8.192 71.387429-75.483429-377.782857 10.24C62.280777 41.398857-2.066651 108.946286 0.109349 190.171429l11.008 409.380571 6.893714 251.52c2.194286 81.243429 70.107429 145.188571 151.734857 143.030857l265.453714-7.168 18.048-0.512 71.387429-75.483429 175.268571-184.978286-8.96-8.448zM933.357349 437.979429c61.257143 0 110.902857-49.371429 110.902857-110.262858 0-60.909714-49.755429-110.299429-110.902857-110.299428-61.165714 0-110.921143 49.389714-110.921143 110.281143 0 60.891429 49.627429 110.281143 110.921143 110.281143z",fill:"#515151",opacity:".25"}),F.jsx("path",{d:"M1182.591634 60.196571L816.328777 9.033143l-83.163428 62.537143L1172.351634 132.882286a74.057143 74.057143 0 0 1 63.067429 83.163428l-82.011429 587.574857-182.162285-239.872a90.331429 90.331429 0 0 0-126.025143-17.645714l-66.377143 49.883429 98.230857 129.993143-83.401143 63.067428-120.009143 90.697143-82.889143 62.427429 51.565715 7.168 408.338285 56.923428a147.181714 147.181714 0 0 0 165.796572-120.118857c0.512-1.664 0.768-3.456 1.024-5.248l91.355428-654.884571c11.117714-80.201143-45.293714-154.532571-126.281142-165.796572z",fill:"#515151",opacity:".25"})]}),"图片加载失败"]}),!g&&!y&&F.jsxs(P_,{selected:c,rotatable:!1,boundary:!1,disabled:i.editor?.readOnly,angle:e.attrs.angle,size:x,minWidth:50,minHeight:50,maxWidth:d,maxHeight:p||1/0,zIndex:10,equalProportion:!0,onRotate:I,onResize:L,onFocus:V,children:[F.jsx("img",{ref:u,src:_,style:{transform:e.attrs.flipX||e.attrs.flipY?`rotateX(${e.attrs.flipX?"180":"0"}deg) rotateY(${e.attrs.flipY?"180":"0"}deg)`:"none"},"data-id":e.attrs.id,loading:"lazy",onLoad:C,onError:D}),!e.attrs.uploaded&&e.attrs.file!==null&&F.jsxs("div",{className:"absolute left-0 top-0 w-full h-full flex items-center justify-center bg-[#00000040] text-[#fff] gap-[10px]",children:[F.jsx("i",{className:"white-loading-icon w-iconfont icon-loading"}),"图片上传中..."]})]})]})})},s_=A7e.extend({atom:!0,addAttributes(){return{vnode:{default:!0},type:{default:"image"},name:{default:null},size:{default:null},id:{default:null},src:{default:null},content:{default:null},width:{default:null},height:{default:null},left:{default:0},top:{default:0},angle:{default:null},draggable:{default:!1},rotatable:{default:!1},flipX:{default:!1},flipY:{default:!1},uploaded:{default:!1},error:{default:!1},previewType:{default:"image"},inline:{default:!1}}},parseHTML(){return[{tag:"img"}]},addPasteRules(){return[...this.parent?.()??[],jge({find:/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"([^"]+)"?)?\)/g,type:this.type,getAttributes:t=>{const[,e,r,n]=t;return{src:r,alt:e,title:n}}})]},addInputRules(){return[...this.parent?.()??[],N_({find:/!\[([\S]+)\]\(([^)\s]+)(?:\s+"([\S]+)"?)?\)/g,type:this.type,getAttributes:t=>{const[,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),loe=s_.extend({...s_,addNodeView(){return ml(soe)},addCommands(){return{setImage:(t,e)=>({commands:r,editor:n})=>e?r.insertContent({type:this.name,attrs:{...t,inline:!1}}):r.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:{...t,inline:!1}})}}}),I7e=s_.extend({...s_,name:"inlineImage",inline:!0,group:"inline",addAttributes(){return{...this.parent?.()??{},inline:{default:!0},width:{default:150},height:{default:80}}},parseHTML(){return[{tag:"inline-img"}]},renderHTML({HTMLAttributes:t}){return["inline-img",zr(t)]},addNodeView(){return ml(soe)},addCommands(){return{setInlineImage:t=>({commands:e,editor:r})=>e.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:{...t,inline:!0}})}}}),dA="indent-",L7e=Vr.create({name:"indent",addOptions(){return{types:["heading","listItem","taskItem","paragraph"],minLevel:0,maxLevel:5}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:null,renderHTML:t=>t.indent?t.indent>this.options.minLevel?{class:`${dA}${t.indent}`}:{}:{},parseHTML:t=>{let e="";for(const r of t.classList)if(r.startsWith(dA)){e=r;break}if(e){const r=Number.parseInt(e.slice(dA.length),10);return r&&r>this.options.minLevel?r:null}return null}}}}]},addCommands(){const t=(n,i,a)=>{const o=n.doc.nodeAt(i)??null;if(o){const s=(o.attrs.indent??0)+a,{minLevel:l,maxLevel:u}=this.options;let c=s;if(s<l?c=l:s>u&&(c=u),c!==o.attrs.indent){const f={...o.attrs};delete f.indent;const d=c>l?{...f,indent:c}:f;return n.setNodeMarkup(i,o.type,d,o.marks)}}return n},e=(n,i)=>{const{doc:a,selection:o}=n;if(a&&o&&(o instanceof ir||o instanceof Oa)){const{from:s,to:l}=o;a.nodesBetween(s,l,(u,c)=>this.options.types.includes(u.type.name)?(n=t(n,c,i),!1):!0)}return n},r=n=>()=>({tr:i,state:a,dispatch:o})=>{const{selection:s}=a;return i.setSelection(s),i=e(i,n),i.docChanged?(Ase(o)&&o(i),!0):!1};return{indent:r(1),outdent:r(-1)}},addKeyboardShortcuts(){return{Tab:()=>this.editor.isActive("bulletList")||this.editor.isActive("orderedList")?this.editor.commands.sinkListItem("listItem"):this.editor.isActive("taskList")?this.editor.commands.sinkListItem("taskItem"):this.editor.commands.indent(),"Shift-Tab":()=>this.editor.isActive("bulletList")||this.editor.isActive("orderedList")?this.editor.commands.liftListItem("listItem"):this.editor.isActive("taskList")?this.editor.commands.liftListItem("taskItem"):this.editor.commands.outdent()}}}),P7e=Vr.create({name:"lineHeight",addOptions(){return{types:[],defaultLineHeight:1.5}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:t=>t.style.lineHeight||this.options.defaultLineHeight,renderHTML:t=>t.lineHeight===this.options.defaultLineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>({commands:e})=>this.options.types.map(r=>e.updateAttributes(r,{lineHeight:t})).some(r=>r),unsetLineHeight:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"lineHeight")).some(e=>e)}}}),uoe=_Z.extend({addStorage(){return{edit:!1,meta:{}}},addProseMirrorPlugins(){return[new en({props:{handleClick(t,e,r){const n=r.target;if(n.tagName==="A"){const i=n.getAttribute("href");return t.dispatch(t.state.tr.setMeta("link-click",{target:n,href:i,pos:e})),!0}return!1}}})]},onTransaction({transaction:t}){const e=t.getMeta("link-click");e&&(this.storage.edit=!0,this.storage.meta=e)}});uoe.configure({openOnClick:t=>!t.editor.isEditable});const B7e=Vr.create({name:"margin",addOptions(){return{types:["heading","paragraph","audio","codeBlock","file","iframe","image","toc","video","horizontalRule","table","bulletList","orderedList","taskList","echarts"],margin:{top:0,bottom:0}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{margin:{default:{},parseHTML:t=>{const{marginTop:e,marginBottom:r}=t.style;if(e===""&&r===""||e==="0px"&&r==="0px")return{};const n={top:"0px",bottom:"0px"};return e&&e!=="0px"&&(n.top=e.replace(/px/g,"")),r&&r!=="0px"&&(n.bottom=r.replace(/px/g,"")),n},renderHTML:({margin:t})=>{if(!Object.keys(t).length)return{};const{top:e,bottom:r}=t;let n="";return e&&e!==""&&(n+=`margin-top: ${e}px;`),r&&r!==""&&(n+=`margin-bottom: ${r}px;`),{style:n}}}}}]},addCommands(){return{setMargin:t=>({editor:e,commands:r})=>this.options.types.every(n=>{const{margin:i}=e.getAttributes(n);return r.updateAttributes(n,{margin:Object.assign({},i,t)})}),unsetMargin:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"margin"))}}});function z7e(t){var e;const{char:r,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:s}=t,l=n&&!i,u=Pge(r),c=new RegExp(`\\s${u}$`),f=o?"^":"",d=i?"":u,h=l?new RegExp(`${f}${u}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${d}]*`,"gm"),p=((e=s.nodeBefore)==null?void 0:e.isText)&&s.nodeBefore.text;if(!p)return null;const v=s.pos-p.length,g=Array.from(p.matchAll(h)).pop();if(!g||g.input===void 0||g.index===void 0)return null;const m=g.input.slice(Math.max(0,g.index-1),g.index),y=new RegExp(`^[${a?.join("")}\0]?$`).test(m);if(a!==null&&!y)return null;const b=v+g.index;let x=b+g[0].length;return l&&c.test(p.slice(x-1,x+1))&&(g[0]+=" ",x+=1),b<s.pos&&x>=s.pos?{range:{from:b,to:x},query:g[0].slice(r.length),text:g[0]}:null}var F7e=new on("suggestion");function V7e({pluginKey:t=F7e,editor:e,char:r="@",allowSpaces:n=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:c="is-empty",command:f=()=>null,items:d=()=>[],render:h=()=>({}),allow:p=()=>!0,findSuggestionMatch:v=z7e,shouldShow:g}){let m;const y=h?.(),b=()=>{const C=e.state.selection.$anchor.pos,D=e.view.coordsAtPos(C),{top:O,right:I,bottom:L,left:V}=D;try{return new DOMRect(V,O,I-V,L-O)}catch{return null}},x=(C,D)=>D?()=>{const O=t.getState(e.state),I=O?.decorationId,L=C.dom.querySelector(`[data-decoration-id="${I}"]`);return L?.getBoundingClientRect()||null}:b;function w(C,D){var O;try{const L=t.getState(C.state),V=L?.decorationId?C.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`):null,H={editor:e,range:L?.range||{from:0,to:0},query:L?.query||null,text:L?.text||null,items:[],command:Y=>f({editor:e,range:L?.range||{from:0,to:0},props:Y}),decorationNode:V,clientRect:x(C,V)};(O=y?.onExit)==null||O.call(y,H)}catch{}const I=C.state.tr.setMeta(D,{exit:!0});C.dispatch(I)}const _=new en({key:t,view(){return{update:async(C,D)=>{var O,I,L,V,H,Y,te;const Q=(O=this.key)==null?void 0:O.getState(D),ue=(I=this.key)==null?void 0:I.getState(C.state),ie=Q.active&&ue.active&&Q.range.from!==ue.range.from,Se=!Q.active&&ue.active,me=Q.active&&!ue.active,ae=!Se&&!me&&Q.query!==ue.query,Te=Se||ie&&ae,Be=ae||ie,He=me||ie&&ae;if(!Te&&!Be&&!He)return;const qe=He&&!Te?Q:ue,ot=C.dom.querySelector(`[data-decoration-id="${qe.decorationId}"]`);m={editor:e,range:qe.range,query:qe.query,text:qe.text,items:[],command:st=>f({editor:e,range:qe.range,props:st}),decorationNode:ot,clientRect:x(C,ot)},Te&&((L=y?.onBeforeStart)==null||L.call(y,m)),Be&&((V=y?.onBeforeUpdate)==null||V.call(y,m)),(Be||Te)&&(m.items=await d({editor:e,query:qe.query})),He&&((H=y?.onExit)==null||H.call(y,m)),Be&&((Y=y?.onUpdate)==null||Y.call(y,m)),Te&&((te=y?.onStart)==null||te.call(y,m))},destroy:()=>{var C;m&&((C=y?.onExit)==null||C.call(y,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,D,O,I){const{isEditable:L}=e,{composing:V}=e.view,{selection:H}=C,{empty:Y,from:te}=H,Q={...D},ue=C.getMeta(t);if(ue&&ue.exit)return Q.active=!1,Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null,Q;if(Q.composing=V,L&&(Y||e.view.composing)){(te<D.range.from||te>D.range.to)&&!V&&!D.composing&&(Q.active=!1);const ie=v({char:r,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:H.$from}),Se=`id_${Math.floor(Math.random()*4294967295)}`;ie&&p({editor:e,state:I,range:ie.range,isActive:D.active})&&(!g||g({editor:e,range:ie.range,query:ie.query,text:ie.text,transaction:C}))?(Q.active=!0,Q.decorationId=D.decorationId?D.decorationId:Se,Q.range=ie.range,Q.query=ie.query,Q.text=ie.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(C,D){var O,I,L,V;const{active:H,range:Y}=_.getState(C.state);if(!H)return!1;if(D.key==="Escape"||D.key==="Esc"){const Q=_.getState(C.state),ue=(O=m?.decorationNode)!=null?O:null,ie=ue??(Q?.decorationId?C.dom.querySelector(`[data-decoration-id="${Q.decorationId}"]`):null);if(((I=y?.onKeyDown)==null?void 0:I.call(y,{view:C,event:D,range:Q.range}))||!1)return!0;const me={editor:e,range:Q.range,query:Q.query,text:Q.text,items:[],command:ae=>f({editor:e,range:Q.range,props:ae}),decorationNode:ie,clientRect:ie?()=>ie.getBoundingClientRect()||null:null};return(L=y?.onExit)==null||L.call(y,me),w(C,t),!0}return((V=y?.onKeyDown)==null?void 0:V.call(y,{view:C,event:D,range:Y}))||!1},decorations(C){const{active:D,range:O,decorationId:I,query:L}=_.getState(C);if(!D)return null;const V=!L?.length,H=[l];return V&&H.push(c),bn.create(C.doc,[Qi.inline(O.from,O.to,{nodeName:s,class:H.join(" "),"data-decoration-id":I,"data-decoration-content":u})])}}});return _}function H7e({editor:t,overrideSuggestionOptions:e,extensionName:r,char:n="@"}){const i=new on;return{editor:t,char:n,pluginKey:i,command:({editor:a,range:o,props:s})=>{var l,u,c;const f=a.view.state.selection.$to.nodeAfter;(l=f?.text)!=null&&l.startsWith(" ")&&(o.to+=1),a.chain().focus().insertContentAt(o,[{type:r,attrs:{...s,mentionSuggestionChar:n}},{type:"text",text:" "}]).run(),(c=(u=a.view.dom.ownerDocument.defaultView)==null?void 0:u.getSelection())==null||c.collapseToEnd()},allow:({state:a,range:o})=>{const s=a.doc.resolve(o.from),l=a.schema.nodes[r];return!!s.parent.type.contentMatch.matchType(l)},...e}}function coe(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>H7e({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function kU(t,e){const r=coe(t),n=r.find(i=>i.char===e);return n||(r.length?r[0]:null)}var $7e=Nn.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var r,n;return`${(r=e?.char)!=null?r:"@"}${(n=t.attrs.label)!=null?n:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:r}){var n,i;return["span",zr(this.HTMLAttributes,t.HTMLAttributes),`${(n=r?.char)!=null?n:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const r=kU(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",zr({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:r})];const n={...this.options};n.HTMLAttributes=zr({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t,suggestion:r});return typeof i=="string"?["span",zr({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},..._X({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(t);for(;n!==null;){const[,i,a,o]=n,s=a??o;e[i==="char"?"mentionSuggestionChar":i]=s,n=r.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,r])=>`${e==="mentionSuggestionChar"?"char":e}="${r}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:kU(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let r=!1;const{selection:n}=e,{empty:i,anchor:a}=n;if(!i)return!1;let o=new Xl,s=0;return e.doc.nodesBetween(a-1,a,(l,u)=>{if(l.type.name===this.name)return r=!0,o=l,s=u,!1}),r&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,s,s+o.nodeSize),r})}},addProseMirrorPlugins(){return coe(this).map(V7e)}});const U7e=$7e.extend({addAttributes(){return{id:{default:null},label:{default:null}}},addCommands(){return{insertMention:()=>({commands:t})=>t.insertContent(` ${this.options?.suggestion?.char??"@"}`)}}}),j7e=U7e.configure({HTMLAttributes:{class:"white-node-mention"}}),G7e=j.forwardRef((t,e)=>{const[r,n]=j.useState(0),i=l=>{const u=t.items[l];u&&t.command(u)},a=()=>{n((r+t.items.length-1)%t.items.length)},o=()=>{n((r+1)%t.items.length)},s=()=>{i(r)};return j.useEffect(()=>{n(0)},[t.items]),j.useImperativeHandle(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(a(),!0):l.key==="ArrowDown"?(o(),!0):l.key==="Enter"?(s(),!0):!1})),t.items.length===0?null:F.jsx("div",{className:"list-none text-[#333] text-[14px]",children:F.jsx("ul",{className:"bg-white border rounded-md shadow-md p-2 max-h-[300px] overflow-y-auto",children:t.items.map((l,u)=>F.jsx("li",{className:`!px-2 cursor-pointer h-[30px] flex items-center rounded-md hover:bg-[#f5f5f5] ${u===r?"bg-[#007bff] text-white hover:!bg-[#007bff] hover:text-white":""}`,onClick:()=>i(u),children:l.label},u))})})}),W7e=(t,e)=>({items:({query:r})=>t.filter(n=>n.label.includes(r)).slice(0,10),command:({editor:r,range:n,props:i})=>{console.log(i),r.chain().focus().deleteRange(n).insertContent({type:"mention",attrs:{id:i.id,label:i.label}}).run()},render:()=>{let r,n;return{onStart:i=>{r=new DX(G7e,{props:i,editor:i.editor}),i.clientRect&&(n=Iv("body",{getReferenceClientRect:i.clientRect,appendTo:document.querySelector(`#${e}`),content:r.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(i){r.updateProps(i),i.clientRect&&n[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown(i){return i.event.key==="Escape"?(n[0].hide(),!0):r.ref?.onKeyDown(i)},onExit(){n[0].destroy(),r.destroy()}}}}),q7e=Vr.create({name:"nodeAlign",addOptions(){return{defaultAlignment:"center",alignments:["flex-start","center","flex-end"],types:["image","video","audio","iframe","file","echarts"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{nodeAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.justifyContent||this.options.defaultAlignment,renderHTML:t=>t.nodeAlign===this.options.defaultAlignment?{}:{style:`justify-content: ${t.nodeAlign}`}}}}]},addCommands(){return{setNodeAlign:t=>({state:e,dispatch:r,tr:n})=>{if(!this.options.alignments.includes(t))return!1;const{selection:i}=e;let a=!1;return e.doc.nodesBetween(i.from,i.to,(o,s)=>{if(this.options.types.includes(o.type.name))return n.setNodeMarkup(s,void 0,{...o.attrs,nodeAlign:t}),a=!0,!1}),a&&r&&r(n),a},unsetNodeAlign:()=>({state:t,dispatch:e,tr:r})=>{const{selection:n}=t;let i=!1;return t.doc.nodesBetween(n.from,n.to,(a,o)=>{if(this.options.types.includes(a.type.name))return r.setNodeMarkup(o,void 0,{...a.attrs,nodeAlign:this.options.defaultAlignment}),i=!0,!1}),i&&e&&e(r),i}}}});var K7e=RL;const Y7e=K7e.extend({content:"listItem*",addAttributes(){return{...this.parent?.(),listType:{default:"decimal",parseHTML:t=>t.style.getPropertyValue("list-style-type")||"decimal",renderHTML:({listType:t})=>({style:`list-style-type: ${t}`,type:t})}}}}),X7e=Vr.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new en({key:new on("selection"),props:{decorations(e){return e.selection.empty||t.isFocused?null:bn.create(e.doc,[Qi.inline(e.selection.from,e.selection.to,{class:"white-selection"})])}}})]},addCommands(){return{setCurrentNodeSelection:()=>({editor:t,chain:e})=>{t.commands.selectParentNode();const{$anchor:r}=t.state.selection;return e().setNodeSelection(r.pos-r.depth).run()},deleteSelectionNode:()=>({editor:t,commands:e})=>{const r=au(t);return r?e.deleteSelection()?!0:e.deleteNode(r.type.name):!1}}}});function au(t){const{$anchor:e,node:r}=t.state.selection;return r?.type?.isAtom?r:(t.commands.selectParentNode(),e.node(1)||r)}function Z7e(t){const{from:e,to:r,empty:n}=t.state.selection;return n?"":t.state.doc.textBetween(e,r,"")}const J7e=t=>{const e={};return t.split(";").map(n=>n.trim()).filter(Boolean).forEach(n=>{const[i,a]=n.split(":").map(o=>o.trim());i&&a&&(e[i]=a)}),e},Q7e=t=>{const e=/\.(\w+)\s*\{([^}]+)\}/g;let r;const n={};for(;(r=e.exec(t))!==null;){const[,i,a]=r,o=J7e(a);n[i]=o}return n},eVe=eZ.extend({addProseMirrorPlugins(){return[...this.parent?.()??[],new en({key:new on("handleExcelPaste"),props:{handlePaste(t,e){const{clipboardData:r}=e;if(!r)return!1;const n=r.getData("text/html");if(!n)return!1;const a=new DOMParser().parseFromString(n,"text/html");if(!a?.querySelector("html")?.getAttribute("xmlns:x")?.includes("office:excel"))return!1;const s=a.querySelector("table");if(!s)return!1;const l=Array.from(a.head.querySelectorAll("style")).map(h=>h.textContent).join(`
|
|
332
|
-
`),u=Q7e(l);s.querySelectorAll("td, th").forEach(h=>{const p=u[h.getAttribute("class")];p?.background&&(h.style.background=p.background),p?.color&&(h.style.color=p.color),p?.["text-align"]&&h.setAttribute("align",p["text-align"])});const{schema:c}=t.state,f=$p.fromSchema(c).parse(s),d=t.state.tr.replaceSelectionWith(f);return t.dispatch(d),!0}}})]}}),tVe=eVe.configure({allowTableNodeSelection:!0,resizable:!0}),foe={addAttributes(){return{...this.parent?.(),align:{default:null,parseHTML:t=>t.getAttribute("align")??null,renderHTML:({align:t})=>({align:t})},background:{default:null,parseHTML:t=>{const r=(t.getAttribute("style")??"").match(/background(?:-color)?:\s*([^;]+)/i);return r?r[1].trim():null},renderHTML:({background:t})=>t?{style:`background-color: ${t}`}:{}},color:{default:null,parseHTML:t=>{const e=t.getAttribute("style")??"",r=e.match(new RegExp("(?<!background-)color:\\s*([^;]+)","i"));return e.includes("background-color")?null:r?r[1].trim():null},renderHTML:({color:t})=>t?{style:`color: ${t}`}:{}}}}},rVe=ZX.extend(foe),nVe=JX.extend(foe),iVe=t=>{const{node:e}=t,{options:r,editor:n}=Ot(),i=j.useMemo(()=>({color:e.attrs.color,backgroundColor:e.attrs.backgroundColor,cursor:!r.document?.readOnly||n?.isEditable?"pointer":"default"}),[e.attrs.color,e.attrs.backgroundColor,r.document?.readOnly,n?.isEditable]);return F.jsx(yu,{as:"span",className:"inline-block mx-[0.3rem] !bg-transparent",children:F.jsx("span",{className:"rounded-[0.2em] px-[0.4em] py-[0.15em] inline-block mx-[0.2em] text-sm font-[500] border-[#0000000d] box-border",style:i,children:e.attrs.text})})},aVe=Nn.create({name:"tag",group:"inline",inline:!0,atom:!0,addAttributes(){return{type:{default:"default"},text:{default:"默认标签"},color:{default:"#999"},backgroundColor:{default:"rgba(0, 0, 0, 0.05)"}}},parseHTML(){return[{tag:'span[data-type="tag"]'}]},renderHTML({HTMLAttributes:t}){return["span",zr(t,{"data-type":"tag"}),t.text]},addNodeView(){return ml(iVe)},addCommands(){return{insertTag:t=>({chain:e})=>e().insertContent({type:this.name,attrs:t}).run()}}});var oVe=Vr.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(r=>e.updateAttributes(r,{textAlign:t})).some(r=>r):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:r})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?r.unsetTextAlign():r.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const sVe=oVe.extend({addOptions(){return{...this.parent?.(),types:["heading","paragraph"],alignments:["left","center","right","justify","distributed"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlignLast?"distributed":t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:t.textAlign==="distributed"?{style:"text-align-last: justify"}:{style:`text-align: ${t.textAlign}`}}}}]},addKeyboardShortcuts(){return{...this.parent?.(),"Mod-Shift-d":()=>this.editor.commands.setTextAlign("distributed")}}}),lVe=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a,uploadFileMap:o,deleteUploadFile:s}=Ot(),l=j.useRef(null),u=j.useRef(null),[c,f]=j.useState(!1),[d,h]=j.useState(0),[p,v]=j.useState(0),g=j.useMemo(()=>{const w=Number(e.attrs.width),_=Number(e.attrs.height);if(!(!w||!_))return{width:w,height:_,left:0,top:0,angle:0}},[e.attrs.width,e.attrs.height]),m=j.useMemo(()=>{const{nodeAlign:w,margin:_}=e.attrs,C=_?.top&&_?.top!==""?`${_.top}px`:void 0,D=_?.bottom&&_?.bottom!==""?`${_.bottom}px`:void 0;return{justifyContent:w,marginTop:C,marginBottom:D}},[e.attrs.nodeAlign,e.attrs.margin]),y=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),f(!0))};E2(l,()=>{f(!1)}),j.useEffect(()=>{(async()=>{if(!(e.attrs.uploaded||!e.attrs.id)&&o?.has(e.attrs.id))try{const _=o.get(e.attrs.id),{id:C,url:D}=await i?.onFileUpload?.(_)??{};l.current&&typeof n=="function"&&Gp(a,{id:C,src:D,uploaded:!0},n()),s(e.attrs.id)}catch(_){console.error(_)}})()},[]);const b=()=>{if(e.attrs.width===null){const{videoWidth:w=0,videoHeight:_=0}=u.current??{},C=l.current?.offsetWidth??0;h(C);const D=_>0?w/_:16/9;v(C/D),r({width:300,height:(300/D).toFixed(2)})}},x=({width:w,height:_})=>{r({width:w,height:_})};return F.jsx(yu,{id:e.attrs.id,ref:l,className:"white-video-wrapper flex max-h-full relative",style:m,children:F.jsx("div",{className:"max-w-full node-view-video white-view-node",children:F.jsxs(P_,{selected:c,rotatable:!1,boundary:!1,size:g,minWidth:200,minHeight:100,maxWidth:d,maxHeight:p,equalProportion:!0,disabled:i.editor?.readOnly,onResize:x,onFocus:y,children:[F.jsx("video",{ref:u,src:e.attrs.src,preload:"metadata",crossOrigin:"anonymous",controls:!0,onCanPlay:b,onClick:y}),!e.attrs.uploaded&&e.attrs.id!==null&&F.jsx("div",{className:"uploading absolute top-0 right-0 left-0 h-[2px] bg-[#007bff]"})]})})})},uVe=Nn.create({name:"video",group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},file:{default:null},id:{default:null},name:{default:null},size:{default:null},src:{default:null},width:{default:null},height:{default:200},draggable:{default:!1},uploaded:{default:!1},previewType:{default:"video"}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",zr(t)]},addNodeView(){return ml(lVe)},addCommands(){return{setVideo:t=>({commands:e,editor:r})=>e.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:t})}}}),cVe=({container:t,options:e,uploadFileMap:r})=>{const{document:n,users:i,file:a,disableExtensions:o}=e,s={highlight:kye.configure({multicolor:!0}),"ordered-list":Y7e,"bullet-list":txe,"line-height":P7e.configure({types:["heading","paragraph"],defaultLineHeight:1.7}),margin:B7e,link:uoe,image:loe,inlineImage:I7e,video:uVe,audio:Lbe,"code-block":d_e,tag:aVe,columns:Qbe,mention:j7e.configure({suggestion:W7e(i??[],t)}),"date-time":p_e,hr:T7e,"web-page":E7e,TaskList:fZ.configure({HTMLAttributes:{class:"white-task-list"}}),TaskItem:cZ.configure({nested:!0})},l=[hbe.configure({bulletList:!1,orderedList:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,link:!1}),bye.configure({placeholder:()=>"输入内容..."}),mye.configure({className:"white-node-focused",mode:"all"}),_7e,HX,S7e,Nye,Dye,VX,FX,L7e,sVe,q7e,Rbe,tVe,QX,nVe,rVe,b7e,X7e,Sbe.configure({scrollParent:()=>document.getElementById(`${t}`),getId:()=>Nv()}),tZ.configure(n?.typographyRules),gye.configure({limit:n?.characterLimit!==0?n?.characterLimit:void 0}),w7e.configure({allowedMimeTypes:a?.allowedMimeTypes,onPaste:async(u,c)=>{for(const f of c){const d=await Cbe(f);u.commands.insertFile({file:f,uploadFileMap:r,autoType:!0,fileDim:d})}},onDrop:(u,c,f)=>{for(const d of c)u.commands.insertFile({file:d,uploadFileMap:r,autoType:!0,pos:f})}}),BX.configure({color:"#007bff"})];return Object.values(s).forEach(u=>{if(!o?.includes(u.name)){if(Array.isArray(u)){l.push(...u);return}l.push(u)}}),l},NU=t=>{let e=!0;return t.editor?.enableMarkdown||(e=[tZ,loe]),e},fVe=j.forwardRef(({children:t,className:e=""},r)=>{const n=j.useRef(null),i=j.useRef(null),[a,o]=j.useState(!0),[s,l]=j.useState(!0),u=()=>{if(!i.current)return;const{scrollLeft:h,scrollWidth:p,clientWidth:v}=i.current;o(h===0),l(h+v+10>=p)},c=()=>{i.current&&(i.current.scrollLeft-=i.current.offsetWidth-10||100)},f=()=>{i.current&&(i.current.scrollLeft+=i.current.offsetWidth-10||100)};j.useEffect(()=>{const h=n.current;if(!h)return;const p=new ResizeObserver(()=>{u()});return p.observe(h),()=>p.disconnect()},[]),j.useEffect(()=>{const h=i.current;if(h)return h.addEventListener("scroll",u),u(),()=>h.removeEventListener("scroll",u)},[t]);const d=()=>{i.current&&(i.current.scrollLeft=0),l(!0),u()};return j.useImperativeHandle(r,()=>({update:d})),F.jsxs("div",{ref:n,className:`white-scrollable-container flex items-center ${a?"":"!pl-[36px]"} ${s?"":"!pr-[36px]"} ${e}`,children:[!a&&F.jsx("div",{className:"w-scrollable-control scrollable-left",onClick:c,children:F.jsx("i",{className:"w-iconfont icon-left"})}),F.jsx("div",{ref:i,className:"w-scrollable-content text-center flex items-center",children:t}),!s&&F.jsx("div",{className:"w-scrollable-control scrollable-right",onClick:f,children:F.jsx("i",{className:"w-iconfont icon-right"})})]})});function dVe(){const{page:t,setPage:e}=Ot(),[r,n]=j.useState(!1),i=a=>{e(o=>({...o,toolbar:a})),n(!1)};return F.jsx(ol,{trigger:"click",placement:"bottom",value:r,onVisibleChange:n,contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:`px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)] ${t.toolbar==="single"?"text-[#007aff]":""}`,onClick:()=>i("single"),children:[F.jsx("i",{className:"w-iconfont icon-single"}),"单行工具栏"]}),F.jsxs("div",{className:`px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)] ${t.toolbar==="double"?"text-[#007aff]":""}`,onClick:()=>i("double"),children:[F.jsx("i",{className:"w-iconfont icon-double"}),"双行工具栏"]})]}),children:F.jsx("span",{className:"w-[28px] h-[28px] cursor-pointer flex items-center justify-center gap-[0.4rem] text-[12px] rounded-[4px] hover:text-[#007aff] hover:bg-[#edeef2]",children:F.jsx("i",{className:`w-iconfont icon-bottom !text-[13px] transition-transform duration-200 ${r?"rotate-180":""}`})})})}function Ar(t){const{ico:e="",text:r="",hideText:n=!1,forceEnabled:i=!1,disabled:a=!1,shortcut:o,shortcutText:s,menuActive:l=!1,editor:u,onMenuClick:c,onMenuClickThrough:f,className:d,onClick:h,...p}=t,v=u?.isEditable!==!1,g=!i&&(a||!v),m=["white-editor-tool-item",n?"":"is-show-text",l&&v?"is-active":"",g?"is-disabled":"",d??""].filter(Boolean).join(" "),y=b=>{if(g){b.preventDefault();return}f?f(b):c&&c(b),h&&h(b)};return F.jsxs("button",{...p,type:"button",disabled:g,className:m,title:r,onClick:y,children:[F.jsx("i",{className:`w-iconfont w-icon icon-${e}`}),!n&&F.jsx("p",{className:"text-[12px] mt-2",children:r})]})}function DI(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"bold",text:"加粗",shortcut:"Ctrl+B",hideText:!0,menuActive:t?.isActive("bold"),disabled:!t?.can().chain().focus().toggleBold().run(),onMenuClick:()=>t?.chain().focus().toggleBold().run()})}function OI(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"underline",text:"下划线",shortcut:"Ctrl+U",hideText:!0,menuActive:t?.isActive("underline"),disabled:!t?.can().chain().focus().toggleUnderline().run(),onMenuClick:()=>t?.chain().focus().toggleUnderline().run()})}function RI(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"decoration",text:"删除线",shortcut:"Ctrl+Shift+X",hideText:!0,menuActive:t?.isActive("strike"),disabled:!t?.can().chain().focus().toggleStrike().run(),onMenuClick:()=>t?.chain().focus().toggleStrike().run()})}function II(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"italic",text:"斜体",shortcut:"Ctrl+I",hideText:!0,menuActive:t?.isActive("italic"),disabled:!t?.can().chain().focus().toggleItalic().run(),onMenuClick:()=>t?.chain().focus().toggleItalic().run()})}const xl=({ico:t="",icoSize:e=14,text:r="",hideText:n=!1,popupVisible:i,forceEnabled:a=!1,disabled:o=!1,shortcut:s,shortcutText:l,menuActive:u=!1,popupType:c="arrow",placement:f="bottom",trigger:d="click",editor:h,onMenuClick:p,onMenuClickThrough:v,onPopupVisibleChange:g,className:m,onClick:y,content:b,children:x,...w})=>{const[_,C]=j.useState(!1),D=i!==void 0?i:_,O=te=>{i===void 0&&C(te),g?.(te)},I=te=>{te.stopPropagation(),v?v(te):p&&p(te),y&&y(te)},L=h?.isEditable!==!1,V=!a&&(o||!L),H=["white-editor-tool-item","white-editor-tool-pop-item","flex","items-center","justify-center",n?"":"is-show-text",u&&L?"is-active":"",V?"is-disabled":"",m||""].filter(Boolean).join(" "),Y=b;return c==="arrow"?F.jsxs("button",{className:H,disabled:V,title:r,...w,children:[F.jsxs("div",{className:"flex items-center h-full",onClick:I,children:[F.jsxs("div",{children:[F.jsx("i",{className:`w-iconfont w-icon icon-${t}`,style:n?{fontSize:`${e}px`}:{}}),x]}),!n&&F.jsx("p",{className:"text-[13px] text-[#333639] ml-[3px]",children:r})]}),F.jsx(ol,{trigger:d,value:D,onVisibleChange:O,placement:f,disabled:V,hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow",content:Y,children:F.jsx("span",{className:"flex items-center justify-center w-full h-full",children:F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${D?"rotate-180":""}`})})})]}):F.jsx(ol,{trigger:d,value:D,onVisibleChange:O,placement:f,content:Y,children:x||F.jsx("button",{className:H,disabled:V,title:r,...w,children:F.jsxs("div",{className:"h-full gap-[5px]",children:[F.jsx("i",{className:`w-iconfont w-icon icon-${t}`,style:n?{fontSize:`${e}px`}:{}}),!n&&F.jsx("p",{className:"text-[12px] mt-2",children:r})]})})})};var Ea={},ep={},hA,DU;function doe(){if(DU)return hA;DU=1;var t=typeof sc=="object"&&sc&&sc.Object===Object&≻return hA=t,hA}var pA,OU;function wl(){if(OU)return pA;OU=1;var t=doe(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return pA=r,pA}var vA,RU;function U0(){if(RU)return vA;RU=1;var t=wl(),e=t.Symbol;return vA=e,vA}var gA,IU;function hVe(){if(IU)return gA;IU=1;var t=U0(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var s=r.call(o,i),l=o[i];try{o[i]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[i]=l:delete o[i]),c}return gA=a,gA}var mA,LU;function pVe(){if(LU)return mA;LU=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return mA=r,mA}var yA,PU;function uh(){if(PU)return yA;PU=1;var t=U0(),e=hVe(),r=pVe(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?e(s):r(s)}return yA=o,yA}var bA,BU;function xs(){if(BU)return bA;BU=1;var t=Array.isArray;return bA=t,bA}var xA,zU;function _u(){if(zU)return xA;zU=1;function t(e){return e!=null&&typeof e=="object"}return xA=t,xA}var wA,FU;function vVe(){if(FU)return wA;FU=1;var t=uh(),e=xs(),r=_u(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return wA=i,wA}var SA,VU;function gVe(){if(VU)return SA;VU=1;function t(e){return function(r,n,i){for(var a=-1,o=Object(r),s=i(r),l=s.length;l--;){var u=s[e?l:++a];if(n(o[u],u,o)===!1)break}return r}}return SA=t,SA}var _A,HU;function mVe(){if(HU)return _A;HU=1;var t=gVe(),e=t();return _A=e,_A}var TA,$U;function yVe(){if($U)return TA;$U=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return TA=t,TA}var CA,UU;function bVe(){if(UU)return CA;UU=1;var t=uh(),e=_u(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return CA=n,CA}var EA,jU;function hoe(){if(jU)return EA;jU=1;var t=bVe(),e=_u(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=t((function(){return arguments})())?t:function(o){return e(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return EA=a,EA}var zm={exports:{}},MA,GU;function xVe(){if(GU)return MA;GU=1;function t(){return!1}return MA=t,MA}zm.exports;var WU;function w4(){return WU||(WU=1,(function(t,e){var r=wl(),n=xVe(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,s=o?r.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;t.exports=u})(zm,zm.exports)),zm.exports}var AA,qU;function poe(){if(qU)return AA;qU=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return AA=r,AA}var kA,KU;function S4(){if(KU)return kA;KU=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return kA=e,kA}var NA,YU;function wVe(){if(YU)return NA;YU=1;var t=uh(),e=S4(),r=_u(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",v="[object WeakMap]",g="[object ArrayBuffer]",m="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",w="[object Int16Array]",_="[object Int32Array]",C="[object Uint8Array]",D="[object Uint8ClampedArray]",O="[object Uint16Array]",I="[object Uint32Array]",L={};L[y]=L[b]=L[x]=L[w]=L[_]=L[C]=L[D]=L[O]=L[I]=!0,L[n]=L[i]=L[g]=L[a]=L[m]=L[o]=L[s]=L[l]=L[u]=L[c]=L[f]=L[d]=L[h]=L[p]=L[v]=!1;function V(H){return r(H)&&e(H.length)&&!!L[t(H)]}return NA=V,NA}var DA,XU;function _4(){if(XU)return DA;XU=1;function t(e){return function(r){return e(r)}}return DA=t,DA}var Fm={exports:{}};Fm.exports;var ZU;function T4(){return ZU||(ZU=1,(function(t,e){var r=doe(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,s=(function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();t.exports=s})(Fm,Fm.exports)),Fm.exports}var OA,JU;function voe(){if(JU)return OA;JU=1;var t=wVe(),e=_4(),r=T4(),n=r&&r.isTypedArray,i=n?e(n):t;return OA=i,OA}var RA,QU;function goe(){if(QU)return RA;QU=1;var t=yVe(),e=hoe(),r=xs(),n=w4(),i=poe(),a=voe(),o=Object.prototype,s=o.hasOwnProperty;function l(u,c){var f=r(u),d=!f&&e(u),h=!f&&!d&&n(u),p=!f&&!d&&!h&&a(u),v=f||d||h||p,g=v?t(u.length,String):[],m=g.length;for(var y in u)(c||s.call(u,y))&&!(v&&(y=="length"||h&&(y=="offset"||y=="parent")||p&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,m)))&&g.push(y);return g}return RA=l,RA}var IA,ej;function C4(){if(ej)return IA;ej=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return IA=e,IA}var LA,tj;function moe(){if(tj)return LA;tj=1;function t(e,r){return function(n){return e(r(n))}}return LA=t,LA}var PA,rj;function SVe(){if(rj)return PA;rj=1;var t=moe(),e=t(Object.keys,Object);return PA=e,PA}var BA,nj;function _Ve(){if(nj)return BA;nj=1;var t=C4(),e=SVe(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!t(a))return e(a);var o=[];for(var s in Object(a))n.call(a,s)&&s!="constructor"&&o.push(s);return o}return BA=i,BA}var zA,ij;function Jv(){if(ij)return zA;ij=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return zA=t,zA}var FA,aj;function yoe(){if(aj)return FA;aj=1;var t=uh(),e=Jv(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!e(s))return!1;var l=t(s);return l==n||l==i||l==r||l==a}return FA=o,FA}var VA,oj;function M2(){if(oj)return VA;oj=1;var t=yoe(),e=S4();function r(n){return n!=null&&e(n.length)&&!t(n)}return VA=r,VA}var HA,sj;function j0(){if(sj)return HA;sj=1;var t=goe(),e=_Ve(),r=M2();function n(i){return r(i)?t(i):e(i)}return HA=n,HA}var $A,lj;function boe(){if(lj)return $A;lj=1;var t=mVe(),e=j0();function r(n,i){return n&&t(n,i,e)}return $A=r,$A}var UA,uj;function xoe(){if(uj)return UA;uj=1;function t(e){return e}return UA=t,UA}var jA,cj;function TVe(){if(cj)return jA;cj=1;var t=xoe();function e(r){return typeof r=="function"?r:t}return jA=e,jA}var GA,fj;function E4(){if(fj)return GA;fj=1;var t=boe(),e=TVe();function r(n,i){return n&&t(n,e(i))}return GA=r,GA}var WA,dj;function M4(){if(dj)return WA;dj=1;var t=moe(),e=t(Object.getPrototypeOf,Object);return WA=e,WA}var qA,hj;function CVe(){if(hj)return qA;hj=1;var t=uh(),e=M4(),r=_u(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,l=o.call(Object);function u(c){if(!r(c)||t(c)!=n)return!1;var f=e(c);if(f===null)return!0;var d=s.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&o.call(d)==l}return qA=u,qA}var KA,pj;function woe(){if(pj)return KA;pj=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return KA=t,KA}var YA,vj;function EVe(){if(vj)return YA;vj=1;function t(){this.__data__=[],this.size=0}return YA=t,YA}var XA,gj;function A4(){if(gj)return XA;gj=1;function t(e,r){return e===r||e!==e&&r!==r}return XA=t,XA}var ZA,mj;function A2(){if(mj)return ZA;mj=1;var t=A4();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return ZA=e,ZA}var JA,yj;function MVe(){if(yj)return JA;yj=1;var t=A2(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return JA=n,JA}var QA,bj;function AVe(){if(bj)return QA;bj=1;var t=A2();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return QA=e,QA}var ek,xj;function kVe(){if(xj)return ek;xj=1;var t=A2();function e(r){return t(this.__data__,r)>-1}return ek=e,ek}var tk,wj;function NVe(){if(wj)return tk;wj=1;var t=A2();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return tk=e,tk}var rk,Sj;function k2(){if(Sj)return rk;Sj=1;var t=EVe(),e=MVe(),r=AVe(),n=kVe(),i=NVe();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,rk=a,rk}var nk,_j;function DVe(){if(_j)return nk;_j=1;var t=k2();function e(){this.__data__=new t,this.size=0}return nk=e,nk}var ik,Tj;function OVe(){if(Tj)return ik;Tj=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return ik=t,ik}var ak,Cj;function RVe(){if(Cj)return ak;Cj=1;function t(e){return this.__data__.get(e)}return ak=t,ak}var ok,Ej;function IVe(){if(Ej)return ok;Ej=1;function t(e){return this.__data__.has(e)}return ok=t,ok}var sk,Mj;function LVe(){if(Mj)return sk;Mj=1;var t=wl(),e=t["__core-js_shared__"];return sk=e,sk}var lk,Aj;function PVe(){if(Aj)return lk;Aj=1;var t=LVe(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return lk=r,lk}var uk,kj;function Soe(){if(kj)return uk;kj=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return uk=r,uk}var ck,Nj;function BVe(){if(Nj)return ck;Nj=1;var t=yoe(),e=PVe(),r=Jv(),n=Soe(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!r(d)||e(d))return!1;var h=t(d)?c:a;return h.test(n(d))}return ck=f,ck}var fk,Dj;function zVe(){if(Dj)return fk;Dj=1;function t(e,r){return e?.[r]}return fk=t,fk}var dk,Oj;function ch(){if(Oj)return dk;Oj=1;var t=BVe(),e=zVe();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return dk=r,dk}var hk,Rj;function k4(){if(Rj)return hk;Rj=1;var t=ch(),e=wl(),r=t(e,"Map");return hk=r,hk}var pk,Ij;function N2(){if(Ij)return pk;Ij=1;var t=ch(),e=t(Object,"create");return pk=e,pk}var vk,Lj;function FVe(){if(Lj)return vk;Lj=1;var t=N2();function e(){this.__data__=t?t(null):{},this.size=0}return vk=e,vk}var gk,Pj;function VVe(){if(Pj)return gk;Pj=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return gk=t,gk}var mk,Bj;function HVe(){if(Bj)return mk;Bj=1;var t=N2(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var s=o[a];return s===e?void 0:s}return n.call(o,a)?o[a]:void 0}return mk=i,mk}var yk,zj;function $Ve(){if(zj)return yk;zj=1;var t=N2(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return yk=n,yk}var bk,Fj;function UVe(){if(Fj)return bk;Fj=1;var t=N2(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return bk=r,bk}var xk,Vj;function jVe(){if(Vj)return xk;Vj=1;var t=FVe(),e=VVe(),r=HVe(),n=$Ve(),i=UVe();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,xk=a,xk}var wk,Hj;function GVe(){if(Hj)return wk;Hj=1;var t=jVe(),e=k2(),r=k4();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return wk=n,wk}var Sk,$j;function WVe(){if($j)return Sk;$j=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Sk=t,Sk}var _k,Uj;function D2(){if(Uj)return _k;Uj=1;var t=WVe();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return _k=e,_k}var Tk,jj;function qVe(){if(jj)return Tk;jj=1;var t=D2();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return Tk=e,Tk}var Ck,Gj;function KVe(){if(Gj)return Ck;Gj=1;var t=D2();function e(r){return t(this,r).get(r)}return Ck=e,Ck}var Ek,Wj;function YVe(){if(Wj)return Ek;Wj=1;var t=D2();function e(r){return t(this,r).has(r)}return Ek=e,Ek}var Mk,qj;function XVe(){if(qj)return Mk;qj=1;var t=D2();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return Mk=e,Mk}var Ak,Kj;function N4(){if(Kj)return Ak;Kj=1;var t=GVe(),e=qVe(),r=KVe(),n=YVe(),i=XVe();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Ak=a,Ak}var kk,Yj;function ZVe(){if(Yj)return kk;Yj=1;var t=k2(),e=k4(),r=N4(),n=200;function i(a,o){var s=this.__data__;if(s instanceof t){var l=s.__data__;if(!e||l.length<n-1)return l.push([a,o]),this.size=++s.size,this;s=this.__data__=new r(l)}return s.set(a,o),this.size=s.size,this}return kk=i,kk}var Nk,Xj;function D4(){if(Xj)return Nk;Xj=1;var t=k2(),e=DVe(),r=OVe(),n=RVe(),i=IVe(),a=ZVe();function o(s){var l=this.__data__=new t(s);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,Nk=o,Nk}var Dk,Zj;function JVe(){if(Zj)return Dk;Zj=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Dk=e,Dk}var Ok,Jj;function QVe(){if(Jj)return Ok;Jj=1;function t(e){return this.__data__.has(e)}return Ok=t,Ok}var Rk,Qj;function eHe(){if(Qj)return Rk;Qj=1;var t=N4(),e=JVe(),r=QVe();function n(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new t;++a<o;)this.add(i[a])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,Rk=n,Rk}var Ik,eG;function tHe(){if(eG)return Ik;eG=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return Ik=t,Ik}var Lk,tG;function rHe(){if(tG)return Lk;tG=1;function t(e,r){return e.has(r)}return Lk=t,Lk}var Pk,rG;function _oe(){if(rG)return Pk;rG=1;var t=eHe(),e=tHe(),r=rHe(),n=1,i=2;function a(o,s,l,u,c,f){var d=l&n,h=o.length,p=s.length;if(h!=p&&!(d&&p>h))return!1;var v=f.get(o),g=f.get(s);if(v&&g)return v==s&&g==o;var m=-1,y=!0,b=l&i?new t:void 0;for(f.set(o,s),f.set(s,o);++m<h;){var x=o[m],w=s[m];if(u)var _=d?u(w,x,m,s,o,f):u(x,w,m,o,s,f);if(_!==void 0){if(_)continue;y=!1;break}if(b){if(!e(s,function(C,D){if(!r(b,D)&&(x===C||c(x,C,l,u,f)))return b.push(D)})){y=!1;break}}else if(!(x===w||c(x,w,l,u,f))){y=!1;break}}return f.delete(o),f.delete(s),y}return Pk=a,Pk}var Bk,nG;function Toe(){if(nG)return Bk;nG=1;var t=wl(),e=t.Uint8Array;return Bk=e,Bk}var zk,iG;function nHe(){if(iG)return zk;iG=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return zk=t,zk}var Fk,aG;function iHe(){if(aG)return Fk;aG=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return Fk=t,Fk}var Vk,oG;function aHe(){if(oG)return Vk;oG=1;var t=U0(),e=Toe(),r=A4(),n=_oe(),i=nHe(),a=iHe(),o=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",v="[object String]",g="[object Symbol]",m="[object ArrayBuffer]",y="[object DataView]",b=t?t.prototype:void 0,x=b?b.valueOf:void 0;function w(_,C,D,O,I,L,V){switch(D){case y:if(_.byteLength!=C.byteLength||_.byteOffset!=C.byteOffset)return!1;_=_.buffer,C=C.buffer;case m:return!(_.byteLength!=C.byteLength||!L(new e(_),new e(C)));case l:case u:case d:return r(+_,+C);case c:return _.name==C.name&&_.message==C.message;case h:case v:return _==C+"";case f:var H=i;case p:var Y=O&o;if(H||(H=a),_.size!=C.size&&!Y)return!1;var te=V.get(_);if(te)return te==C;O|=s,V.set(_,C);var Q=n(H(_),H(C),O,I,L,V);return V.delete(_),Q;case g:if(x)return x.call(_)==x.call(C)}return!1}return Vk=w,Vk}var Hk,sG;function Coe(){if(sG)return Hk;sG=1;function t(e,r){for(var n=-1,i=r.length,a=e.length;++n<i;)e[a+n]=r[n];return e}return Hk=t,Hk}var $k,lG;function Eoe(){if(lG)return $k;lG=1;var t=Coe(),e=xs();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return $k=r,$k}var Uk,uG;function oHe(){if(uG)return Uk;uG=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=0,o=[];++n<i;){var s=e[n];r(s,n,e)&&(o[a++]=s)}return o}return Uk=t,Uk}var jk,cG;function Moe(){if(cG)return jk;cG=1;function t(){return[]}return jk=t,jk}var Gk,fG;function O4(){if(fG)return Gk;fG=1;var t=oHe(),e=Moe(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),t(i(o),function(s){return n.call(o,s)}))}:e;return Gk=a,Gk}var Wk,dG;function Aoe(){if(dG)return Wk;dG=1;var t=Eoe(),e=O4(),r=j0();function n(i){return t(i,r,e)}return Wk=n,Wk}var qk,hG;function sHe(){if(hG)return qk;hG=1;var t=Aoe(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s,l,u,c){var f=s&e,d=t(a),h=d.length,p=t(o),v=p.length;if(h!=v&&!f)return!1;for(var g=h;g--;){var m=d[g];if(!(f?m in o:n.call(o,m)))return!1}var y=c.get(a),b=c.get(o);if(y&&b)return y==o&&b==a;var x=!0;c.set(a,o),c.set(o,a);for(var w=f;++g<h;){m=d[g];var _=a[m],C=o[m];if(l)var D=f?l(C,_,m,o,a,c):l(_,C,m,a,o,c);if(!(D===void 0?_===C||u(_,C,s,l,c):D)){x=!1;break}w||(w=m=="constructor")}if(x&&!w){var O=a.constructor,I=o.constructor;O!=I&&"constructor"in a&&"constructor"in o&&!(typeof O=="function"&&O instanceof O&&typeof I=="function"&&I instanceof I)&&(x=!1)}return c.delete(a),c.delete(o),x}return qk=i,qk}var Kk,pG;function lHe(){if(pG)return Kk;pG=1;var t=ch(),e=wl(),r=t(e,"DataView");return Kk=r,Kk}var Yk,vG;function uHe(){if(vG)return Yk;vG=1;var t=ch(),e=wl(),r=t(e,"Promise");return Yk=r,Yk}var Xk,gG;function cHe(){if(gG)return Xk;gG=1;var t=ch(),e=wl(),r=t(e,"Set");return Xk=r,Xk}var Zk,mG;function fHe(){if(mG)return Zk;mG=1;var t=ch(),e=wl(),r=t(e,"WeakMap");return Zk=r,Zk}var Jk,yG;function O2(){if(yG)return Jk;yG=1;var t=lHe(),e=k4(),r=uHe(),n=cHe(),i=fHe(),a=uh(),o=Soe(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",f="[object WeakMap]",d="[object DataView]",h=o(t),p=o(e),v=o(r),g=o(n),m=o(i),y=a;return(t&&y(new t(new ArrayBuffer(1)))!=d||e&&y(new e)!=s||r&&y(r.resolve())!=u||n&&y(new n)!=c||i&&y(new i)!=f)&&(y=function(b){var x=a(b),w=x==l?b.constructor:void 0,_=w?o(w):"";if(_)switch(_){case h:return d;case p:return s;case v:return u;case g:return c;case m:return f}return x}),Jk=y,Jk}var Qk,bG;function dHe(){if(bG)return Qk;bG=1;var t=D4(),e=_oe(),r=aHe(),n=sHe(),i=O2(),a=xs(),o=w4(),s=voe(),l=1,u="[object Arguments]",c="[object Array]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function p(v,g,m,y,b,x){var w=a(v),_=a(g),C=w?c:i(v),D=_?c:i(g);C=C==u?f:C,D=D==u?f:D;var O=C==f,I=D==f,L=C==D;if(L&&o(v)){if(!o(g))return!1;w=!0,O=!1}if(L&&!O)return x||(x=new t),w||s(v)?e(v,g,m,y,b,x):r(v,g,C,m,y,b,x);if(!(m&l)){var V=O&&h.call(v,"__wrapped__"),H=I&&h.call(g,"__wrapped__");if(V||H){var Y=V?v.value():v,te=H?g.value():g;return x||(x=new t),b(Y,te,m,y,x)}}return L?(x||(x=new t),n(v,g,m,y,b,x)):!1}return Qk=p,Qk}var eN,xG;function koe(){if(xG)return eN;xG=1;var t=dHe(),e=_u();function r(n,i,a,o,s){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,a,o,r,s)}return eN=r,eN}var tN,wG;function hHe(){if(wG)return tN;wG=1;var t=D4(),e=koe(),r=1,n=2;function i(a,o,s,l){var u=s.length,c=u,f=!l;if(a==null)return!c;for(a=Object(a);u--;){var d=s[u];if(f&&d[2]?d[1]!==a[d[0]]:!(d[0]in a))return!1}for(;++u<c;){d=s[u];var h=d[0],p=a[h],v=d[1];if(f&&d[2]){if(p===void 0&&!(h in a))return!1}else{var g=new t;if(l)var m=l(p,v,h,a,o,g);if(!(m===void 0?e(v,p,r|n,l,g):m))return!1}}return!0}return tN=i,tN}var rN,SG;function Noe(){if(SG)return rN;SG=1;var t=Jv();function e(r){return r===r&&!t(r)}return rN=e,rN}var nN,_G;function pHe(){if(_G)return nN;_G=1;var t=Noe(),e=j0();function r(n){for(var i=e(n),a=i.length;a--;){var o=i[a],s=n[o];i[a]=[o,s,t(s)]}return i}return nN=r,nN}var iN,TG;function Doe(){if(TG)return iN;TG=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return iN=t,iN}var aN,CG;function vHe(){if(CG)return aN;CG=1;var t=hHe(),e=pHe(),r=Doe();function n(i){var a=e(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(o){return o===i||t(o,i,a)}}return aN=n,aN}var oN,EG;function R4(){if(EG)return oN;EG=1;var t=uh(),e=_u(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return oN=n,oN}var sN,MG;function I4(){if(MG)return sN;MG=1;var t=xs(),e=R4(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return sN=i,sN}var lN,AG;function gHe(){if(AG)return lN;AG=1;var t=N4(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],l=a.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return a.cache=l.set(s,u)||l,u};return a.cache=new(r.Cache||t),a}return r.Cache=t,lN=r,lN}var uN,kG;function mHe(){if(kG)return uN;kG=1;var t=gHe(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return uN=r,uN}var cN,NG;function yHe(){if(NG)return cN;NG=1;var t=mHe(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,s,l,u){a.push(l?u.replace(r,"$1"):s||o)}),a});return cN=n,cN}var fN,DG;function bHe(){if(DG)return fN;DG=1;var t=U0(),e=woe(),r=xs(),n=R4(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(n(s))return a?a.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return fN=o,fN}var dN,OG;function xHe(){if(OG)return dN;OG=1;var t=bHe();function e(r){return r==null?"":t(r)}return dN=e,dN}var hN,RG;function Ooe(){if(RG)return hN;RG=1;var t=xs(),e=I4(),r=yHe(),n=xHe();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return hN=i,hN}var pN,IG;function R2(){if(IG)return pN;IG=1;var t=R4();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return pN=e,pN}var vN,LG;function Roe(){if(LG)return vN;LG=1;var t=Ooe(),e=R2();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return vN=r,vN}var gN,PG;function wHe(){if(PG)return gN;PG=1;var t=Roe();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return gN=e,gN}var mN,BG;function SHe(){if(BG)return mN;BG=1;function t(e,r){return e!=null&&r in Object(e)}return mN=t,mN}var yN,zG;function _He(){if(zG)return yN;zG=1;var t=Ooe(),e=hoe(),r=xs(),n=poe(),i=S4(),a=R2();function o(s,l,u){l=t(l,s);for(var c=-1,f=l.length,d=!1;++c<f;){var h=a(l[c]);if(!(d=s!=null&&u(s,h)))break;s=s[h]}return d||++c!=f?d:(f=s==null?0:s.length,!!f&&i(f)&&n(h,f)&&(r(s)||e(s)))}return yN=o,yN}var bN,FG;function THe(){if(FG)return bN;FG=1;var t=SHe(),e=_He();function r(n,i){return n!=null&&e(n,i,t)}return bN=r,bN}var xN,VG;function CHe(){if(VG)return xN;VG=1;var t=koe(),e=wHe(),r=THe(),n=I4(),i=Noe(),a=Doe(),o=R2(),s=1,l=2;function u(c,f){return n(c)&&i(f)?a(o(c),f):function(d){var h=e(d,c);return h===void 0&&h===f?r(d,c):t(f,h,s|l)}}return xN=u,xN}var wN,HG;function EHe(){if(HG)return wN;HG=1;function t(e){return function(r){return r?.[e]}}return wN=t,wN}var SN,$G;function MHe(){if($G)return SN;$G=1;var t=Roe();function e(r){return function(n){return t(n,r)}}return SN=e,SN}var _N,UG;function AHe(){if(UG)return _N;UG=1;var t=EHe(),e=MHe(),r=I4(),n=R2();function i(a){return r(a)?t(n(a)):e(a)}return _N=i,_N}var TN,jG;function kHe(){if(jG)return TN;jG=1;var t=vHe(),e=CHe(),r=xoe(),n=xs(),i=AHe();function a(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):i(o)}return TN=a,TN}var CN,GG;function NHe(){if(GG)return CN;GG=1;var t=M2();function e(r,n){return function(i,a){if(i==null)return i;if(!t(i))return r(i,a);for(var o=i.length,s=n?o:-1,l=Object(i);(n?s--:++s<o)&&a(l[s],s,l)!==!1;);return i}}return CN=e,CN}var EN,WG;function DHe(){if(WG)return EN;WG=1;var t=boe(),e=NHe(),r=e(t);return EN=r,EN}var MN,qG;function OHe(){if(qG)return MN;qG=1;var t=DHe(),e=M2();function r(n,i){var a=-1,o=e(n)?Array(n.length):[];return t(n,function(s,l,u){o[++a]=i(s,l,u)}),o}return MN=r,MN}var AN,KG;function RHe(){if(KG)return AN;KG=1;var t=woe(),e=kHe(),r=OHe(),n=xs();function i(a,o){var s=n(a)?t:r;return s(a,e(o,3))}return AN=i,AN}var YG;function IHe(){if(YG)return ep;YG=1,Object.defineProperty(ep,"__esModule",{value:!0}),ep.flattenNames=void 0;var t=vVe(),e=l(t),r=E4(),n=l(r),i=CVe(),a=l(i),o=RHe(),s=l(o);function l(c){return c&&c.__esModule?c:{default:c}}var u=ep.flattenNames=function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,s.default)(f,function(h){Array.isArray(h)?c(h).map(function(p){return d.push(p)}):(0,a.default)(h)?(0,n.default)(h,function(p,v){p===!0&&d.push(v),d.push(v+"-"+p)}):(0,e.default)(h)&&d.push(h)}),d};return ep.default=u,ep}var tp={},kN,XG;function LHe(){if(XG)return kN;XG=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i&&r(e[n],n,e)!==!1;);return e}return kN=t,kN}var NN,ZG;function PHe(){if(ZG)return NN;ZG=1;var t=ch(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return NN=e,NN}var DN,JG;function Ioe(){if(JG)return DN;JG=1;var t=PHe();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return DN=e,DN}var ON,QG;function Loe(){if(QG)return ON;QG=1;var t=Ioe(),e=A4(),r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s){var l=a[o];(!(n.call(a,o)&&e(l,s))||s===void 0&&!(o in a))&&t(a,o,s)}return ON=i,ON}var RN,eW;function I2(){if(eW)return RN;eW=1;var t=Loe(),e=Ioe();function r(n,i,a,o){var s=!a;a||(a={});for(var l=-1,u=i.length;++l<u;){var c=i[l],f=o?o(a[c],n[c],c,a,n):void 0;f===void 0&&(f=n[c]),s?e(a,c,f):t(a,c,f)}return a}return RN=r,RN}var IN,tW;function BHe(){if(tW)return IN;tW=1;var t=I2(),e=j0();function r(n,i){return n&&t(i,e(i),n)}return IN=r,IN}var LN,rW;function zHe(){if(rW)return LN;rW=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return LN=t,LN}var PN,nW;function FHe(){if(nW)return PN;nW=1;var t=Jv(),e=C4(),r=zHe(),n=Object.prototype,i=n.hasOwnProperty;function a(o){if(!t(o))return r(o);var s=e(o),l=[];for(var u in o)u=="constructor"&&(s||!i.call(o,u))||l.push(u);return l}return PN=a,PN}var BN,iW;function L4(){if(iW)return BN;iW=1;var t=goe(),e=FHe(),r=M2();function n(i){return r(i)?t(i,!0):e(i)}return BN=n,BN}var zN,aW;function VHe(){if(aW)return zN;aW=1;var t=I2(),e=L4();function r(n,i){return n&&t(i,e(i),n)}return zN=r,zN}var Vm={exports:{}};Vm.exports;var oW;function HHe(){return oW||(oW=1,(function(t,e){var r=wl(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var f=u.length,d=s?s(f):new u.constructor(f);return u.copy(d),d}t.exports=l})(Vm,Vm.exports)),Vm.exports}var FN,sW;function $He(){if(sW)return FN;sW=1;function t(e,r){var n=-1,i=e.length;for(r||(r=Array(i));++n<i;)r[n]=e[n];return r}return FN=t,FN}var VN,lW;function UHe(){if(lW)return VN;lW=1;var t=I2(),e=O4();function r(n,i){return t(n,e(n),i)}return VN=r,VN}var HN,uW;function Poe(){if(uW)return HN;uW=1;var t=Coe(),e=M4(),r=O4(),n=Moe(),i=Object.getOwnPropertySymbols,a=i?function(o){for(var s=[];o;)t(s,r(o)),o=e(o);return s}:n;return HN=a,HN}var $N,cW;function jHe(){if(cW)return $N;cW=1;var t=I2(),e=Poe();function r(n,i){return t(n,e(n),i)}return $N=r,$N}var UN,fW;function GHe(){if(fW)return UN;fW=1;var t=Eoe(),e=Poe(),r=L4();function n(i){return t(i,r,e)}return UN=n,UN}var jN,dW;function WHe(){if(dW)return jN;dW=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var i=n.length,a=new n.constructor(i);return i&&typeof n[0]=="string"&&e.call(n,"index")&&(a.index=n.index,a.input=n.input),a}return jN=r,jN}var GN,hW;function P4(){if(hW)return GN;hW=1;var t=Toe();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return GN=e,GN}var WN,pW;function qHe(){if(pW)return WN;pW=1;var t=P4();function e(r,n){var i=n?t(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.byteLength)}return WN=e,WN}var qN,vW;function KHe(){if(vW)return qN;vW=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return qN=e,qN}var KN,gW;function YHe(){if(gW)return KN;gW=1;var t=U0(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(i){return r?Object(r.call(i)):{}}return KN=n,KN}var YN,mW;function XHe(){if(mW)return YN;mW=1;var t=P4();function e(r,n){var i=n?t(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.length)}return YN=e,YN}var XN,yW;function ZHe(){if(yW)return XN;yW=1;var t=P4(),e=qHe(),r=KHe(),n=YHe(),i=XHe(),a="[object Boolean]",o="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",f="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",p="[object DataView]",v="[object Float32Array]",g="[object Float64Array]",m="[object Int8Array]",y="[object Int16Array]",b="[object Int32Array]",x="[object Uint8Array]",w="[object Uint8ClampedArray]",_="[object Uint16Array]",C="[object Uint32Array]";function D(O,I,L){var V=O.constructor;switch(I){case h:return t(O);case a:case o:return new V(+O);case p:return e(O,L);case v:case g:case m:case y:case b:case x:case w:case _:case C:return i(O,L);case s:return new V;case l:case f:return new V(O);case u:return r(O);case c:return new V;case d:return n(O)}}return XN=D,XN}var ZN,bW;function JHe(){if(bW)return ZN;bW=1;var t=Jv(),e=Object.create,r=(function(){function n(){}return function(i){if(!t(i))return{};if(e)return e(i);n.prototype=i;var a=new n;return n.prototype=void 0,a}})();return ZN=r,ZN}var JN,xW;function QHe(){if(xW)return JN;xW=1;var t=JHe(),e=M4(),r=C4();function n(i){return typeof i.constructor=="function"&&!r(i)?t(e(i)):{}}return JN=n,JN}var QN,wW;function e$e(){if(wW)return QN;wW=1;var t=O2(),e=_u(),r="[object Map]";function n(i){return e(i)&&t(i)==r}return QN=n,QN}var eD,SW;function t$e(){if(SW)return eD;SW=1;var t=e$e(),e=_4(),r=T4(),n=r&&r.isMap,i=n?e(n):t;return eD=i,eD}var tD,_W;function r$e(){if(_W)return tD;_W=1;var t=O2(),e=_u(),r="[object Set]";function n(i){return e(i)&&t(i)==r}return tD=n,tD}var rD,TW;function n$e(){if(TW)return rD;TW=1;var t=r$e(),e=_4(),r=T4(),n=r&&r.isSet,i=n?e(n):t;return rD=i,rD}var nD,CW;function i$e(){if(CW)return nD;CW=1;var t=D4(),e=LHe(),r=Loe(),n=BHe(),i=VHe(),a=HHe(),o=$He(),s=UHe(),l=jHe(),u=Aoe(),c=GHe(),f=O2(),d=WHe(),h=ZHe(),p=QHe(),v=xs(),g=w4(),m=t$e(),y=Jv(),b=n$e(),x=j0(),w=L4(),_=1,C=2,D=4,O="[object Arguments]",I="[object Array]",L="[object Boolean]",V="[object Date]",H="[object Error]",Y="[object Function]",te="[object GeneratorFunction]",Q="[object Map]",ue="[object Number]",ie="[object Object]",Se="[object RegExp]",me="[object Set]",ae="[object String]",Te="[object Symbol]",Be="[object WeakMap]",He="[object ArrayBuffer]",qe="[object DataView]",ot="[object Float32Array]",st="[object Float64Array]",he="[object Int8Array]",Ce="[object Int16Array]",ve="[object Int32Array]",xe="[object Uint8Array]",le="[object Uint8ClampedArray]",Ee="[object Uint16Array]",fe="[object Uint32Array]",Me={};Me[O]=Me[I]=Me[He]=Me[qe]=Me[L]=Me[V]=Me[ot]=Me[st]=Me[he]=Me[Ce]=Me[ve]=Me[Q]=Me[ue]=Me[ie]=Me[Se]=Me[me]=Me[ae]=Me[Te]=Me[xe]=Me[le]=Me[Ee]=Me[fe]=!0,Me[H]=Me[Y]=Me[Be]=!1;function Ne(Re,Ue,Qe,lt,vt,Bt){var zt,Et=Ue&_,yr=Ue&C,hr=Ue&D;if(Qe&&(zt=vt?Qe(Re,lt,vt,Bt):Qe(Re)),zt!==void 0)return zt;if(!y(Re))return Re;var pr=v(Re);if(pr){if(zt=d(Re),!Et)return o(Re,zt)}else{var Tr=f(Re),Ur=Tr==Y||Tr==te;if(g(Re))return a(Re,Et);if(Tr==ie||Tr==O||Ur&&!vt){if(zt=yr||Ur?{}:p(Re),!Et)return yr?l(Re,i(zt,Re)):s(Re,n(zt,Re))}else{if(!Me[Tr])return vt?Re:{};zt=h(Re,Tr,Et)}}Bt||(Bt=new t);var Zr=Bt.get(Re);if(Zr)return Zr;Bt.set(Re,zt),b(Re)?Re.forEach(function(Dr){zt.add(Ne(Dr,Ue,Qe,Dr,Re,Bt))}):m(Re)&&Re.forEach(function(Dr,Ze){zt.set(Ze,Ne(Dr,Ue,Qe,Ze,Re,Bt))});var jr=hr?yr?c:u:yr?w:x,un=pr?void 0:jr(Re);return e(un||Re,function(Dr,Ze){un&&(Ze=Dr,Dr=Re[Ze]),r(zt,Ze,Ne(Dr,Ue,Qe,Ze,Re,Bt))}),zt}return nD=Ne,nD}var iD,EW;function a$e(){if(EW)return iD;EW=1;var t=i$e(),e=1,r=4;function n(i){return t(i,e|r)}return iD=n,iD}var MW;function o$e(){if(MW)return tp;MW=1,Object.defineProperty(tp,"__esModule",{value:!0}),tp.mergeClasses=void 0;var t=E4(),e=a(t),r=a$e(),n=a(r),i=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(s[c]=u[c])}return s};function a(s){return s&&s.__esModule?s:{default:s}}var o=tp.mergeClasses=function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=l.default&&(0,n.default)(l.default)||{};return u.map(function(f){var d=l[f];return d&&(0,e.default)(d,function(h,p){c[p]||(c[p]={}),c[p]=i({},c[p],d[p])}),f}),c};return tp.default=o,tp}var rp={},AW;function s$e(){if(AW)return rp;AW=1,Object.defineProperty(rp,"__esModule",{value:!0}),rp.autoprefix=void 0;var t=E4(),e=n(t),r=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])}return o};function n(o){return o&&o.__esModule?o:{default:o}}var i={borderRadius:function(s){return{msBorderRadius:s,MozBorderRadius:s,OBorderRadius:s,WebkitBorderRadius:s,borderRadius:s}},boxShadow:function(s){return{msBoxShadow:s,MozBoxShadow:s,OBoxShadow:s,WebkitBoxShadow:s,boxShadow:s}},userSelect:function(s){return{WebkitTouchCallout:s,KhtmlUserSelect:s,MozUserSelect:s,msUserSelect:s,WebkitUserSelect:s,userSelect:s}},flex:function(s){return{WebkitBoxFlex:s,MozBoxFlex:s,WebkitFlex:s,msFlex:s,flex:s}},flexBasis:function(s){return{WebkitFlexBasis:s,flexBasis:s}},justifyContent:function(s){return{WebkitJustifyContent:s,justifyContent:s}},transition:function(s){return{msTransition:s,MozTransition:s,OTransition:s,WebkitTransition:s,transition:s}},transform:function(s){return{msTransform:s,MozTransform:s,OTransform:s,WebkitTransform:s,transform:s}},absolute:function(s){var l=s&&s.split(" ");return{position:"absolute",top:l&&l[0],right:l&&l[1],bottom:l&&l[2],left:l&&l[3]}},extend:function(s,l){var u=l[s];return u||{extend:s}}},a=rp.autoprefix=function(s){var l={};return(0,e.default)(s,function(u,c){var f={};(0,e.default)(u,function(d,h){var p=i[h];p?f=r({},f,p(d)):f[h]=d}),l[c]=f}),l};return rp.default=a,rp}var np={},kW;function l$e(){if(kW)return np;kW=1,Object.defineProperty(np,"__esModule",{value:!0}),np.hover=void 0;var t=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(l[f]=c[f])}return l},e=j,r=n(e);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function a(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function o(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=np.hover=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(f){o(d,f);function d(){var h,p,v,g;i(this,d);for(var m=arguments.length,y=Array(m),b=0;b<m;b++)y[b]=arguments[b];return g=(p=(v=a(this,(h=d.__proto__||Object.getPrototypeOf(d)).call.apply(h,[this].concat(y))),v),v.state={hover:!1},v.handleMouseOver=function(){return v.setState({hover:!0})},v.handleMouseOut=function(){return v.setState({hover:!1})},v.render=function(){return r.default.createElement(c,{onMouseOver:v.handleMouseOver,onMouseOut:v.handleMouseOut},r.default.createElement(u,t({},v.props,v.state)))},p),a(v,g)}return d})(r.default.Component)};return np.default=s,np}var ip={},NW;function u$e(){if(NW)return ip;NW=1,Object.defineProperty(ip,"__esModule",{value:!0}),ip.active=void 0;var t=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(l[f]=c[f])}return l},e=j,r=n(e);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function a(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function o(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=ip.active=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(f){o(d,f);function d(){var h,p,v,g;i(this,d);for(var m=arguments.length,y=Array(m),b=0;b<m;b++)y[b]=arguments[b];return g=(p=(v=a(this,(h=d.__proto__||Object.getPrototypeOf(d)).call.apply(h,[this].concat(y))),v),v.state={active:!1},v.handleMouseDown=function(){return v.setState({active:!0})},v.handleMouseUp=function(){return v.setState({active:!1})},v.render=function(){return r.default.createElement(c,{onMouseDown:v.handleMouseDown,onMouseUp:v.handleMouseUp},r.default.createElement(u,t({},v.props,v.state)))},p),a(v,g)}return d})(r.default.Component)};return ip.default=s,ip}var fx={},DW;function c$e(){if(DW)return fx;DW=1,Object.defineProperty(fx,"__esModule",{value:!0});var t=function(r,n){var i={},a=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i[s]=l};return r===0&&a("first-child"),r===n-1&&a("last-child"),(r===0||r%2===0)&&a("even"),Math.abs(r%2)===1&&a("odd"),a("nth-child",r),i};return fx.default=t,fx}var OW;function f$e(){if(OW)return Ea;OW=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.ReactCSS=Ea.loop=Ea.handleActive=Ea.handleHover=Ea.hover=void 0;var t=IHe(),e=d(t),r=o$e(),n=d(r),i=s$e(),a=d(i),o=l$e(),s=d(o),l=u$e(),u=d(l),c=c$e(),f=d(c);function d(p){return p&&p.__esModule?p:{default:p}}Ea.hover=s.default,Ea.handleHover=s.default,Ea.handleActive=u.default,Ea.loop=f.default;var h=Ea.ReactCSS=function(v){for(var g=arguments.length,m=Array(g>1?g-1:0),y=1;y<g;y++)m[y-1]=arguments[y];var b=(0,e.default)(m),x=(0,n.default)(v,b);return(0,a.default)(x)};return Ea.default=h,Ea}var B4=f$e();const Nr=m0(B4);var d$e=function(e,r,n,i,a){var o=a.clientWidth,s=a.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,u=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(a.getBoundingClientRect().left+window.pageXOffset),f=u-(a.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(f<0?d=0:f>s?d=1:d=Math.round(f*100/s)/100,r.a!==d)return{h:r.h,s:r.s,l:r.l,a:d,source:"rgb"}}else{var h=void 0;if(c<0?h=0:c>o?h=1:h=Math.round(c*100/o)/100,i!==h)return{h:r.h,s:r.s,l:r.l,a:h,source:"rgb"}}return null},aD={},h$e=function(e,r,n,i){if(typeof document>"u"&&!i)return null;var a=i?new i:document.createElement("canvas");a.width=n*2,a.height=n*2;var o=a.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,a.width,a.height),o.fillStyle=r,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),a.toDataURL()):null},p$e=function(e,r,n,i){var a=e+"-"+r+"-"+n+(i?"-server":"");if(aD[a])return aD[a];var o=h$e(e,r,n,i);return aD[a]=o,o},RW=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Qv=function(e){var r=e.white,n=e.grey,i=e.size,a=e.renderers,o=e.borderRadius,s=e.boxShadow,l=e.children,u=Nr({default:{grid:{borderRadius:o,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+p$e(r,n,i,a.canvas)+") center left"}}});return j.isValidElement(l)?j.cloneElement(l,RW({},l.props,{style:RW({},l.props.style,u.grid)})):j.createElement("div",{style:u.grid})};Qv.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var v$e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},g$e=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function m$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IW(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function y$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var z4=(function(t){y$e(e,t);function e(){var r,n,i,a;m$e(this,e);for(var o=arguments.length,s=Array(o),l=0;l<o;l++)s[l]=arguments[l];return a=(n=(i=IW(this,(r=e.__proto__||Object.getPrototypeOf(e)).call.apply(r,[this].concat(s))),i),i.handleChange=function(u){var c=d$e(u,i.props.hsl,i.props.direction,i.props.a,i.container);c&&typeof i.props.onChange=="function"&&i.props.onChange(c,u)},i.handleMouseDown=function(u){i.handleChange(u),window.addEventListener("mousemove",i.handleChange),window.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},i.unbindEventListeners=function(){window.removeEventListener("mousemove",i.handleChange),window.removeEventListener("mouseup",i.handleMouseUp)},n),IW(i,a)}return g$e(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var n=this,i=this.props.rgb,a=Nr({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+i.r+","+i.g+","+i.b+`, 0) 0%,
|
|
331
|
+
`)),Gr(n)),a.push({dimIdx:m.index,parser:y,comparator:new pte(d,p)})});var o=e.sourceFormat;o!==Ii&&o!==no&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),Gr(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(c,f){for(var d=0;d<a.length;d++){var h=a[d],p=e.retrieveValueFromItem(c,h.dimIdx),v=e.retrieveValueFromItem(f,h.dimIdx);h.parser&&(p=h.parser(p),v=h.parser(v));var g=h.comparator.evaluate(p,v);if(g!==0)return g}return 0}),{data:s}}};function y9e(t){t.registerTransform(g9e),t.registerTransform(m9e)}var b9e=(function(t){je(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new yte(this),RF(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),RF(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:as},e})(xr),x9e=(function(t){je(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e})(_n);function w9e(t){t.registerComponentModel(b9e),t.registerComponentView(x9e)}var Ds=fl.CMD;function Hp(t,e){return Math.abs(t-e)<1e-5}function EI(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(H,Y){i&&i.length>2&&n.push(i),i=[H,Y]}function c(H,Y,te,Q){Hp(H,te)&&Hp(Y,Q)||i.push(H,Y,te,Q,te,Q)}function f(H,Y,te,Q,ue,ie){var Se=Math.abs(Y-H),me=Math.tan(Se/4)*4/3,ae=Y<H?-1:1,Te=Math.cos(H),Be=Math.sin(H),He=Math.cos(Y),qe=Math.sin(Y),ot=Te*ue+te,st=Be*ie+Q,he=He*ue+te,Ce=qe*ie+Q,ve=ue*me*ae,xe=ie*me*ae;i.push(ot-ve*Be,st+xe*Te,he+ve*qe,Ce-xe*He,he,Ce)}for(var d,h,p,v,g=0;g<r;){var m=e[g++],y=g===1;switch(y&&(a=e[g],o=e[g+1],s=a,l=o,(m===Ds.L||m===Ds.C||m===Ds.Q)&&(i=[s,l])),m){case Ds.M:a=s=e[g++],o=l=e[g++],u(s,l);break;case Ds.L:d=e[g++],h=e[g++],c(a,o,d,h),a=d,o=h;break;case Ds.C:i.push(e[g++],e[g++],e[g++],e[g++],a=e[g++],o=e[g++]);break;case Ds.Q:d=e[g++],h=e[g++],p=e[g++],v=e[g++],i.push(a+2/3*(d-a),o+2/3*(h-o),p+2/3*(d-p),v+2/3*(h-v),p,v),a=p,o=v;break;case Ds.A:var b=e[g++],x=e[g++],w=e[g++],_=e[g++],C=e[g++],D=e[g++]+C;g+=1;var O=!e[g++];d=Math.cos(C)*w+b,h=Math.sin(C)*_+x,y?(s=d,l=h,u(s,l)):c(a,o,d,h),a=Math.cos(D)*w+b,o=Math.sin(D)*_+x;for(var I=(O?-1:1)*Math.PI/2,L=C;O?L>D:L<D;L+=I){var V=O?Math.max(L+I,D):Math.min(L+I,D);f(L,V,b,x,w,_)}break;case Ds.R:s=a=e[g++],l=o=e[g++],d=s+e[g++],h=l+e[g++],u(d,l),c(d,l,d,h),c(d,h,s,h),c(s,h,s,l),c(s,l,d,l);break;case Ds.Z:i&&c(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function MI(t,e,r,n,i,a,o,s,l,u){if(Hp(t,r)&&Hp(e,n)&&Hp(i,o)&&Hp(a,s)){l.push(o,s);return}var c=2/u,f=c*c,d=o-t,h=s-e,p=Math.sqrt(d*d+h*h);d/=p,h/=p;var v=r-t,g=n-e,m=i-o,y=a-s,b=v*v+g*g,x=m*m+y*y;if(b<f&&x<f){l.push(o,s);return}var w=d*v+h*g,_=-d*m-h*y,C=b-w*w,D=x-_*_;if(C<f&&w>=0&&D<f&&_>=0){l.push(o,s);return}var O=[],I=[];Ic(t,r,i,o,.5,O),Ic(e,n,a,s,.5,I),MI(O[0],I[0],O[1],I[1],O[2],I[2],O[3],I[3],l,u),MI(O[4],I[4],O[5],I[5],O[6],I[6],O[7],I[7],l,u)}function S9e(t,e){var r=EI(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var c=a[u++],f=a[u++],d=a[u++],h=a[u++],p=a[u++],v=a[u++];MI(s,l,c,f,d,h,p,v,o,e),s=p,l=v}n.push(o)}return n}function Qae(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var c=o*s,f=r-c;if(f>0)for(var u=0;u<f;u++)l[u%o]+=1;return l}function oU(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,c=l>Math.abs(u),f=Qae([l,u],c?0:1,e),d=(c?s:u)/f.length,h=0;h<f.length;h++)for(var p=(c?u:s)/f[h],v=0;v<f[h];v++){var g={};c?(g.startAngle=a+d*h,g.endAngle=a+d*(h+1),g.r0=n+p*v,g.r=n+p*(v+1)):(g.startAngle=a+p*v,g.endAngle=a+p*(v+1),g.r0=n+d*h,g.r=n+d*(h+1)),g.clockwise=t.clockwise,g.cx=t.cx,g.cy=t.cy,r.push(g)}}function _9e(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=Qae([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=t[s]/o.length,d=0;d<o.length;d++)for(var h=t[l]/o[d],p=0;p<o[d];p++){var v={};v[u]=d*f,v[c]=p*h,v[s]=f,v[l]=h,v.x+=t.x,v.y+=t.y,r.push(v)}}function sU(t,e,r,n){return t*n-r*e}function T9e(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,c=o-i,f=s-a,d=sU(c,f,l,u);if(Math.abs(d)<1e-6)return null;var h=t-i,p=e-a,v=sU(h,p,c,f)/d;return v<0||v>1?null:new Wt(v*l+t,v*u+e)}function C9e(t,e,r){var n=new Wt;Wt.sub(n,r,e),n.normalize();var i=new Wt;Wt.sub(i,t,e);var a=i.dot(n);return a}function Jh(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function E9e(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=T9e(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:C9e(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(g,m){return g.projPt-m.projPt});var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var f=u;u=c,c=f}for(var d=[u.pt.x,u.pt.y],h=[c.pt.x,c.pt.y],p=[d],v=[h],a=u.idx+1;a<=c.idx;a++)Jh(p,t[a].slice());Jh(p,h),Jh(p,d);for(var a=c.idx+1;a<=u.idx+n;a++)Jh(v,t[a%n].slice());return Jh(v,d),Jh(v,h),[{points:p},{points:v}]}function lU(t){var e=t.points,r=[],n=[];Z_(e,r,n);var i=new Kt(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Wt,c=new Wt;return a>o?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),E9e(e,u,c)}function n_(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);n_(t,a[0],i,n),n_(t,a[1],r-i,n)}return n}function M9e(t,e){for(var r=[],n=0;n<e;n++)r.push(EP(t));return r}function A9e(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function k9e(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function N9e(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":_9e(n,e,r),i=mr;break;case"sector":oU(n,e,r),i=ra;break;case"circle":oU({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=ra;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=at(S9e(t.getUpdatedPathProxy(),o),function(m){return k9e(m)}),l=s.length;if(l===0)n_(lU,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,f=at(s,function(m){var y=[],b=[];Z_(m,y,b);var x=(b[1]-y[1])*(b[0]-y[0]);return c+=x,{poly:m,area:x}});f.sort(function(m,y){return y.area-m.area});for(var d=e,u=0;u<l;u++){var h=f[u];if(d<=0)break;var p=u===l-1?d:Math.ceil(h.area/c*e);p<0||(n_(lU,{points:h.poly},p,r),d-=p)}}i=na;break}if(!i)return M9e(t,e);for(var v=[],u=0;u<r.length;u++){var g=new i;g.setShape(r[u]),A9e(t,g),v.push(g)}return v}function D9e(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,f=[o[0],o[1]],d=l,h=2;h<s;){var p=o[h-2],v=o[h-1],g=o[h++],m=o[h++],y=o[h++],b=o[h++],x=o[h++],w=o[h++];if(d<=0){f.push(g,m,y,b,x,w);continue}for(var _=Math.min(d,c-1)+1,C=1;C<=_;C++){var D=C/_;Ic(p,g,y,x,D,i),Ic(v,m,b,w,D,a),p=i[3],v=a[3],f.push(i[1],a[1],i[2],a[2],p,v),g=i[5],m=a[5],y=i[6],b=a[6]}d-=_-1}return o===t?[f,e]:[t,f]}function uU(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function O9e(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],c=void 0,f=void 0;l?u?(r=D9e(l,u),c=r[0],f=r[1],n=c,i=f):(f=uU(i||l,l),c=l):(c=uU(n||u,u),f=u),a.push(c),o.push(f)}return[a,o]}function cU(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],c=t[a+1],f=s*c-u*l;e+=f,r+=(s+u)*f,n+=(l+c)*f}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function R9e(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var c=u*6,f=0,d=0;d<s;d+=2){var h=d===0?c:(c+d-2)%l+2,p=t[h]-r[0],v=t[h+1]-r[1],g=e[d]-n[0],m=e[d+1]-n[1],y=g-p,b=m-v;f+=y*y+b*b}f<a&&(a=f,o=u)}return o}function I9e(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function L9e(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=cU(s),c=cU(l);a==null&&(a=u[2]<0!=c[2]<0);var f=[],d=[],h=0,p=1/0,v=[],g=s.length;a&&(s=I9e(s));for(var m=R9e(s,l,u,c)*6,y=g-2,b=0;b<y;b+=2){var x=(m+b)%y+2;f[b+2]=s[x]-u[0],f[b+3]=s[x+1]-u[1]}f[0]=s[m]-u[0],f[1]=s[m+1]-u[1];for(var w=n/r,_=-n/2;_<=n/2;_+=w){for(var C=Math.sin(_),D=Math.cos(_),O=0,b=0;b<s.length;b+=2){var I=f[b],L=f[b+1],V=l[b]-c[0],H=l[b+1]-c[1],Y=V*D-H*C,te=V*C+H*D;v[b]=Y,v[b+1]=te;var Q=Y-I,ue=te-L;O+=Q*Q+ue*ue}if(O<p){p=O,h=_;for(var ie=0;ie<v.length;ie++)d[ie]=v[ie]}}i.push({from:f,to:d,fromCp:u,toCp:c,rotation:-h})}return i}function i_(t){return t.__isCombineMorphing}var eoe="__mOriginal_";function a_(t,e,r){var n=eoe+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function yy(t,e){var r=eoe+e;t[r]&&(t[e]=t[r],t[r]=null)}function fU(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function toe(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=O9e(EI(r),EI(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&fU(a,s),l&&fU(o,l),a_(e,"updateTransform",{replace:u}),e.transform=null;var c=L9e(a,o,10,Math.PI),f=[];a_(e,"buildPath",{replace:function(d){for(var h=e.__morphT,p=1-h,v=[],g=0;g<c.length;g++){var m=c[g],y=m.from,b=m.to,x=m.rotation*h,w=m.fromCp,_=m.toCp,C=Math.sin(x),D=Math.cos(x);Mx(v,w,_,h);for(var O=0;O<y.length;O+=2){var I=y[O],L=y[O+1],V=b[O],H=b[O+1],Y=I*p+V*h,te=L*p+H*h;f[O]=Y*D-te*C+v[0],f[O+1]=Y*C+te*D+v[1]}var Q=f[0],ue=f[1];d.moveTo(Q,ue);for(var O=2;O<y.length;){var V=f[O++],H=f[O++],ie=f[O++],Se=f[O++],me=f[O++],ae=f[O++];Q===V&&ue===H&&ie===me&&Se===ae?d.lineTo(me,ae):d.bezierCurveTo(V,H,ie,Se,me,ae),Q=me,ue=ae}}}})}function y4(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;toe(t,e),e.__morphT=0;function a(){yy(e,"buildPath"),yy(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},qt({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function P9e(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var c=0,f=0;(t&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function o_(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=at(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=at(a,function(s,l){return{cp:s,z:P9e(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function roe(t){return N9e(t.path,t.count)}function AI(){return{fromIndividuals:[],toIndividuals:[],count:0}}function B9e(t,e,r){var n=[];function i(w){for(var _=0;_<w.length;_++){var C=w[_];i_(C)?i(C.childrenRef()):C instanceof Sr&&n.push(C)}}i(t);var a=n.length;if(!a)return AI();var o=r.dividePath||roe,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),AI();n=o_(n),s=o_(s);for(var l=r.done,u=r.during,c=r.individualDelay,f=new Kl,d=0;d<a;d++){var h=n[d],p=s[d];p.parent=e,p.copyTransform(f),c||toe(h,p)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function v(w){for(var _=0;_<s.length;_++)s[_].addSelfToZr(w)}a_(e,"addSelfToZr",{after:function(w){v(w)}}),a_(e,"removeSelfFromZr",{after:function(w){for(var _=0;_<s.length;_++)s[_].removeSelfFromZr(w)}});function g(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,yy(e,"addSelfToZr"),yy(e,"removeSelfFromZr")}var m=s.length;if(c)for(var y=m,b=function(){y--,y===0&&(g(),l&&l())},d=0;d<m;d++){var x=c?qt({delay:(r.delay||0)+c(d,m,n[d],s[d]),done:b},r):r;y4(n[d],s[d],x)}else e.__morphT=0,e.animateTo({__morphT:1},qt({during:function(w){for(var _=0;_<m;_++){var C=s[_];C.__morphT=e.__morphT,C.dirtyShape()}u&&u(w)},done:function(){g();for(var w=0;w<t.length;w++)yy(t[w],"updateTransform");l&&l()}},r));return e.__zr&&v(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function z9e(t,e,r){var n=e.length,i=[],a=r.dividePath||roe;function o(h){for(var p=0;p<h.length;p++){var v=h[p];i_(v)?o(v.childrenRef()):v instanceof Sr&&i.push(v)}}if(i_(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(EP(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var c=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(c);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),AI()}i=o_(i),e=o_(e);for(var f=r.individualDelay,u=0;u<n;u++){var d=f?qt({delay:(r.delay||0)+f(u,n,i[u],e[u])},r):r;y4(i[u],e[u],d)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function dU(t){return rt(t[0])}function hU(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var F9e={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=EP(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function lA(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=Hv("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;dU(t)&&(u=t,c=e),dU(e)&&(u=e,c=t);function f(m,y,b,x,w){var _=m.many,C=m.one;if(_.length===1&&!w){var D=y?_[0]:C,O=y?C:_[0];if(i_(D))f({many:[D],one:O},!0,b,x,!0);else{var I=s?qt({delay:s(b,x)},l):l;y4(D,O,I),a(D,O,D,O,I)}}else for(var L=qt({dividePath:F9e[r],individualDelay:s&&function(ue,ie,Se,me){return s(ue+b,x)}},l),V=y?B9e(_,C,L):z9e(C,_,L),H=V.fromIndividuals,Y=V.toIndividuals,te=H.length,Q=0;Q<te;Q++){var I=s?qt({delay:s(Q,te)},l):l;a(H[Q],Y[Q],y?_[Q]:m.one,y?m.one:_[Q],I)}}for(var d=u?u===t:t.length>e.length,h=u?hU(c,u):hU(d?e:t,[d?t:e]),p=0,v=0;v<h.length;v++)p+=h[v].many.length;for(var g=0,v=0;v<h.length;v++)f(h[v],d,g,p),g+=h[v].many.length}function Kf(t){if(!t)return[];if(rt(t)){for(var e=[],r=0;r<t.length;r++)e.push(Kf(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof Sr&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var noe=1e4,V9e=0,pU=1,vU=2,H9e=br();function $9e(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function U9e(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function gU(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=$9e(t,i);if(a){var o=U9e(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function mU(t){var e=[];return W(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>noe){process.env.NODE_ENV!=="production"&&kn("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:gU(n,o,i,!1),childGroupId:gU(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function uA(t,e,r){t.traverse(function(n){n instanceof Sr&&wn(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function cA(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Qh(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function j9e(t,e,r){var n=Hv("update",r,e);n&&t.traverse(function(i){if(i instanceof Bo){var a=wEe(i);a&&i.animateFrom({style:a},n)}})}function G9e(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function ioe(t,e,r){var n=mU(t),i=mU(e);function a(b,x,w,_,C){(w||b)&&x.animateFrom({style:w&&w!==b?Je(Je({},w.style),b.style):b.style},C)}var o=!1,s=V9e,l=Dt(),u=Dt();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var c=0;c<i.length;c++){var f=i[c].groupId;if(u.get(f)){s=pU;break}var d=i[c].childGroupId;if(d&&l.get(d)){s=vU;break}}function h(b,x){return function(w){var _=w.data,C=w.dataIndex;return x?_.getId(C):b?s===pU?w.childGroupId:w.groupId:s===vU?w.childGroupId:w.groupId}}var p=G9e(n,i),v={};if(!p)for(var c=0;c<i.length;c++){var g=i[c],m=g.data.getItemGraphicEl(g.dataIndex);m&&(v[m.id]=!0)}function y(b,x){var w=n[x],_=i[b],C=_.data.hostModel,D=w.data.getItemGraphicEl(w.dataIndex),O=_.data.getItemGraphicEl(_.dataIndex);if(D===O){O&&j9e(O,_.dataIndex,C);return}D&&v[D.id]||O&&(Qh(O),D?(Qh(D),cA(D),o=!0,lA(Kf(D),Kf(O),_.divide,C,b,a)):uA(O,C,b))}new du(n,i,h(!0,p),h(!1,p),null,"multiple").update(y).updateManyToOne(function(b,x){var w=i[b],_=w.data,C=_.hostModel,D=_.getItemGraphicEl(w.dataIndex),O=Yr(at(x,function(I){return n[I].data.getItemGraphicEl(n[I].dataIndex)}),function(I){return I&&I!==D&&!v[I.id]});D&&(Qh(D),O.length?(W(O,function(I){Qh(I),cA(I)}),o=!0,lA(Kf(O),Kf(D),w.divide,C,b,a)):uA(D,C,w.dataIndex))}).updateOneToMany(function(b,x){var w=n[x],_=w.data.getItemGraphicEl(w.dataIndex);if(!(_&&v[_.id])){var C=Yr(at(b,function(O){return i[O].data.getItemGraphicEl(i[O].dataIndex)}),function(O){return O&&O!==_}),D=i[b[0]].data.hostModel;C.length&&(W(C,function(O){return Qh(O)}),_?(Qh(_),cA(_),o=!0,lA(Kf(_),Kf(C),w.divide,D,b[0],a)):W(C,function(O){return uA(O,D,b[0])}))}}).updateManyToMany(function(b,x){new du(x,b,function(w){return n[w].data.getId(n[w].dataIndex)},function(w){return i[w].data.getId(i[w].dataIndex)}).update(function(w,_){y(b[w],x[_])}).execute()}).execute(),o&&W(e,function(b){var x=b.data,w=x.hostModel,_=w&&r.getViewOfSeriesModel(w),C=Hv("update",w,0);_&&w.isAnimationEnabled()&&C&&C.duration>0&&_.group.traverse(function(D){D instanceof Sr&&!D.animators.length&&D.animateFrom({style:{opacity:0}},C)})})}function yU(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function bU(t){return rt(t)?t.sort().join(","):t}function nc(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function W9e(t,e){var r=Dt(),n=Dt(),i=Dt();W(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],c=yU(o),f=bU(c);n.set(f,{dataGroupId:l,data:u}),rt(c)&&W(c,function(d){i.set(d,{key:f,dataGroupId:l,data:u})})});function a(o){r.get(o)&&kn("Duplicated seriesKey in universalTransition "+o)}return W(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=yU(o),c=bU(u),f=n.get(c);if(f)process.env.NODE_ENV!=="production"&&a(c),r.set(c,{oldSeries:[{dataGroupId:f.dataGroupId,divide:nc(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:nc(l),data:l}]});else if(rt(u)){process.env.NODE_ENV!=="production"&&a(c);var d=[];W(u,function(v){var g=n.get(v);g.data&&d.push({dataGroupId:g.dataGroupId,divide:nc(g.data),data:g.data})}),d.length&&r.set(c,{oldSeries:d,newSeries:[{dataGroupId:s,data:l,divide:nc(l)}]})}else{var h=i.get(u);if(h){var p=r.get(h.key);p||(p={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:nc(h.data)}],newSeries:[]},r.set(h.key,p)),p.newSeries.push({dataGroupId:s,data:l,divide:nc(l)})}}}}),r}function xU(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function q9e(t,e,r,n){var i=[],a=[];W(fn(t.from),function(o){var s=xU(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:nc(e.oldData[s]),groupIdDim:o.dimension})}),W(fn(t.to),function(o){var s=xU(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:nc(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&ioe(i,a,n)}function K9e(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){W(fn(n.seriesTransition),function(i){W(fn(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][zx]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=H9e(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)W(fn(a),function(h){q9e(h,i,n,r)});else{var o=W9e(i,n);W(o.keys(),function(h){var p=o.get(h);ioe(p.oldSeries,p.newSeries,r)})}W(n.updatedSeries,function(h){h[zx]&&(h[zx]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],c=i.oldData=[],f=0;f<s.length;f++){var d=s[f].getData();d.count()<noe&&(l.push(s[f]),u.push(s[f].get("dataGroupId")),c.push(d))}})}var Y9e=(function(){function t(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return t.prototype.setBreaks=function(e){this.breaks=e.breaks},t.prototype.update=function(e){Z9e(this,e);var r=this._elapsedExtent;r[0]=this.elapse(e[0]),r[1]=this.elapse(e[1])},t.prototype.hasBreaks=function(){return!!this.breaks.length},t.prototype.calcNiceTickMultiple=function(e,r){for(var n=0;n<this.breaks.length;n++){var i=this.breaks[n];if(i.vmin<e&&e<i.vmax){var a=r(e,i.vmax);return process.env.NODE_ENV!=="production"&&Mt(a>=0&&Math.round(a)===a),a}}return 0},t.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},t.prototype.normalize=function(e){var r=this._elapsedExtent[1]-this._elapsedExtent[0];return r===0?.5:(this.elapse(e)-this._elapsedExtent[0])/r},t.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},t.prototype.elapse=function(e){for(var r=wU,n=SU,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?r+=o.vmin-n+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=e-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=e-n),r},t.prototype.unelapse=function(e){for(var r=wU,n=SU,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],l=r+s.vmin-n,u=l+s.gapReal;if(e<=u){e>l?a=s.vmin+(e-l)/(u-l)*(s.vmax-s.vmin):a=n+e-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+e-r),a},t})();function X9e(){return new Y9e}var wU=0,SU=0;function Z9e(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};W(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=b4(s,e);if(u){var c=u.vmin!==s.vmin,f=u.vmax!==s.vmax,d=u.vmax-u.vmin;if(!(c&&f))if(c||f){var h=c?"S":"E";a[h][l.type].has=!0,a[h][l.type].span=d,a[h][l.type].inExtFrac=d/(s.vmax-s.vmin),a[h][l.type].val=l.val}else n[l.type].span+=d,n[l.type].val+=l.val}});var o=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));W(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function J9e(t,e,r,n,i,a){t!=="no"&&W(r,function(o){var s=b4(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],c=n(u),f=i*3/4;c>s.vmin-f&&c<s.vmax+f&&(t!=="preserve_extent_bound"||c!==a[0]&&c!==a[1])&&e.splice(l,1)}})}function Q9e(t,e,r,n){W(e,function(i){var a=b4(i,r);a&&(t.push({value:a.vmin,break:{type:"vmin",parsedBreak:a},time:n?n(a):void 0}),t.push({value:a.vmax,break:{type:"vmax",parsedBreak:a},time:n?n(a):void 0}))}),e.length&&t.sort(function(i,a){return i.value-a.value})}function b4(t,e){var r=Math.max(t.vmin,e[0]),n=Math.min(t.vmax,e[1]);return r<n||r===n&&r>e[0]&&r<e[1]?{vmin:r,vmax:n,breakOption:t.breakOption,gapParsed:t.gapParsed,gapReal:t.gapReal}:null}function kI(t,e,r){var n=[];if(!t)return{breaks:n};function i(o,s){return o>=0&&o<1-1e-5?!0:(process.env.NODE_ENV!=="production"&&Rr(s+" must be >= 0 and < 1, rather than "+o+" ."),!1)}W(t,function(o){if(!o||o.start==null||o.end==null){process.env.NODE_ENV!=="production"&&Rr("The input axis breaks start/end should not be empty.");return}if(!o.isExpanded){var s={breakOption:Ut(o),vmin:e(o.start),vmax:e(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(yt(o.gap)){var u=Ao(o.gap);if(u.match(/%$/)){var c=parseFloat(u)/100;i(c,"Percent gap")||(c=0),s.gapParsed.type="tpPrct",s.gapParsed.val=c,l=!0}}if(!l){var f=e(o.gap);(!isFinite(f)||f<0)&&(process.env.NODE_ENV!=="production"&&Rr("Axis breaks gap must positive finite rather than ("+o.gap+")."),f=0),s.gapParsed.type="tpAbs",s.gapParsed.val=f}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&W(["vmin","vmax"],function(h){s[h]<0&&(process.env.NODE_ENV!=="production"&&Rr("Axis break."+h+" must not be negative."),s[h]=0)}),s.vmin>s.vmax){var d=s.vmax;s.vmax=s.vmin,s.vmin=d}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return W(n,function(o,s){a>o.vmin&&(process.env.NODE_ENV!=="production"&&Rr("Axis breaks must not overlap."),n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function x4(t,e){return NI(e)===NI(t)}function NI(t){return t.start+"_\0_"+t.end}function e7e(t,e,r){var n=[];W(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),W(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=Jd(n,function(u){return x4(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return W(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function t7e(t,e,r,n){var i,a;if(t.break){var o=t.break.parsedBreak,s=Jd(r,function(f){return x4(f.breakOption,t.break.parsedBreak.breakOption)}),l=n(Math.pow(e,o.vmin),s.vmin),u=n(Math.pow(e,o.vmax),s.vmax),c={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?Jn(Math.pow(e,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:t.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:c,gapReal:o.gapReal}},a=s[t.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function r7e(t,e,r){var n={noNegative:!0},i=kI(t,r,n),a=kI(t,r,n),o=Math.log(e);return a.breaks=at(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,c={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:c,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var n7e={vmin:"start",vmax:"end"};function i7e(t,e){return e&&(t=t||{},t.break={type:n7e[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function a7e(){jEe({createScaleBreakContext:X9e,pruneTicksByBreak:J9e,addBreaksToTicks:Q9e,parseAxisBreakOption:kI,identifyAxisBreak:x4,serializeAxisBreakIdentifier:NI,retrieveAxisBreakPairs:e7e,getTicksLogTransformBreak:t7e,logarithmicParseBreaksFromOption:r7e,makeAxisLabelFormatterParamBreak:i7e})}var _U=br();function o7e(t,e){var r=Jd(t,function(n){return ei().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function s7e(t){W(t,function(e){return e.shouldRemove=!0})}function l7e(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function u7e(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!ei())return;var o=ei().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(O){return O.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),c=s.get("zigzagMaxSpan");u=Math.max(2,u||0),c=Math.max(u,c||0);var f=s.get("expandOnClick"),d=s.get("zigzagZ"),h=s.getModel("itemStyle"),p=h.getItemStyle(),v=p.stroke,g=p.lineWidth,m=p.lineDash,y=p.fill,b=new $t({ignoreModelZ:!0}),x=a.isHorizontal(),w=_U(e).visualList||(_U(e).visualList=[]);s7e(w);for(var _=function(O){var I=o[O][0].break.parsedBreak,L=[];L[0]=a.toGlobalCoord(a.dataToCoord(I.vmin,!0)),L[1]=a.toGlobalCoord(a.dataToCoord(I.vmax,!0)),L[1]<L[0]&&L.reverse();var V=o7e(w,I);V.shouldRemove=!1;var H=new $t;D(V.zigzagRandomList,H,L[0],L[1],x,I),f&&H.on("click",function(){var Y={type:m2,breaks:[{start:I.breakOption.start,end:I.breakOption.end}]};Y[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(Y)}),H.silent=!f,b.add(H)},C=0;C<o.length;C++)_(C);t.add(b),l7e(w);function D(O,I,L,V,H,Y){var te={stroke:v,lineWidth:g,lineDash:m,fill:"none"},Q=H?0:1,ue=1-Q,ie=n[Qt[ue]]+n[ti[ue]];function Se(Ee){var fe=[],Me=[];fe[Q]=Me[Q]=Ee,fe[ue]=n[Qt[ue]],Me[ue]=ie;var Ne={x1:fe[0],y1:fe[1],x2:Me[0],y2:Me[1]};return Q_(Ne,Ne,{lineWidth:1}),fe[0]=Ne.x1,fe[1]=Ne.y1,fe[Q]}L=Se(L),V=Se(V);for(var me=[],ae=[],Te=!0,Be=n[Qt[ue]],He=0;;He++){var qe=Be===n[Qt[ue]],ot=Be>=ie;ot&&(Be=ie);var st=[],he=[];st[Q]=L,he[Q]=V,!qe&&!ot&&(st[Q]+=Te?-l:l,he[Q]-=Te?l:-l),st[ue]=Be,he[ue]=Be,me.push(st),ae.push(he);var Ce=void 0;if(He<O.length?Ce=O[He]:(Ce=Math.random(),O.push(Ce)),Be+=Ce*(c-u)+u,Te=!Te,ot)break}var ve=ei().serializeAxisBreakIdentifier(Y.breakOption);if(I.add(new Wi({anid:"break_a_"+ve,shape:{points:me},style:te,z:d})),Y.gapReal!==0){I.add(new Wi({anid:"break_b_"+ve,shape:{points:ae},style:te,z:d}));var xe=ae.slice();xe.reverse();var le=me.concat(xe);I.add(new na({anid:"break_c_"+ve,shape:{points:le},style:{fill:y,opacity:p.opacity},z:d}))}}}function c7e(t,e,r,n){var i=t.axis,a=r.transform;Mt(n.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=ei().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(g){return g.break},!1),l=at(s,function(g){var m=g[0].break.parsedBreak,y=[i.dataToCoord(m.vmin,!0),i.dataToCoord(m.vmax,!0)];return y[0]>y[1]&&y.reverse(),{coordPair:y,brkId:ei().serializeAxisBreakIdentifier(m.breakOption)}});l.sort(function(g,m){return g.coordPair[0]-m.coordPair[0]});for(var u=o[0],c=null,f=0;f<l.length;f++){var d=l[f],h=Math.max(d.coordPair[0],o[0]),p=Math.min(d.coordPair[1],o[1]);u<=h&&v(u,h,c,d),u=p,c=d}u<=o[1]&&v(u,o[1],c,null);function v(g,m,y,b){function x(L,V){a&&(Kn(L,L,a),Kn(V,V,a))}function w(L,V){var H={x1:L[0],y1:L[1],x2:V[0],y2:V[1]};Q_(H,H,n.style),L[0]=H.x1,L[1]=H.y1,V[0]=H.x2,V[1]=H.y2}var _=[g,0],C=[m,0],D=[g,5],O=[m,5];x(_,D),w(_,D),x(C,O),w(C,O),w(_,C);var I=new Qn(Je({shape:{x1:_[0],y1:_[1],x2:C[0],y2:C[1]}},n));e.add(I),I.anid="breakLine_"+(y?y.brkId:"\0")+"_\0_"+(b?b.brkId:"\0")}}function f7e(t,e,r){if(Jd(r,function(y){return!y}))return;var n=new Wt;if(!v2(r[0],r[1],n,{direction:-(t?e+Math.PI:e),touchThreshold:0,bidirectional:!1}))return;var i=Ri();qc(i,i,-e);var a=at(r,function(y){return y.transform?Js(Ri(),i,y.transform):i});function o(y){var b=r[0].localRect,x=new Wt(b[ti[y]]*a[0][0],b[ti[y]]*a[0][1]);return Math.abs(x.y)<1e-5}var s=.5;if(o(0)||o(1)){var l=at(r,function(y,b){var x=y.localRect.clone();return x.applyTransform(a[b]),x}),u=new Wt;u.copy(r[0].label).add(r[1].label).scale(.5),u.transform(i);var c=n.clone().transform(i),f=l[0].x+l[1].x+(c.x>=0?l[0].width:l[1].width),d=(f+c.x)/2-u.x,h=Math.min(d,d-c.x),p=Math.max(d,d-c.x),v=p<0?p:h>0?h:0;s=(d-v)/c.x}var g=new Wt,m=new Wt;Wt.scale(g,n,-s),Wt.scale(m,n,1-s),DR(r[0],g),DR(r[1],m)}function d7e(t,e){var r={breaks:[]};return W(e.breaks,function(n){if(n){var i=Jd(t.get("breaks",!0),function(s){return ei().identifyAxisBreak(s,n)});if(!i){process.env.NODE_ENV!=="production"&&kn("Can not find axis break by start: "+n.start+", end: "+n.end);return}var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===m2?!0:a===Tne?!1:a===Cne?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}),r}function h7e(){uRe({adjustBreakLabelPair:f7e,buildAxisBreakLine:c7e,rectCoordBuildBreakAxis:u7e,updateModelAxisBreak:d7e})}function p7e(t){vRe(t),a7e(),h7e()}function v7e(){PRe(g7e)}function g7e(t,e){W(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=m7e(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function m7e(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof mv?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=Kv(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;c<i;c+=u){var f=n?n[c]:{value:a[0]+c},d=s(f,c),h=o.getTextRect(d),p=v(h,o.get("rotate")||0);l?l.union(p):l=p}return l;function v(g,m){var y=m*Math.PI/180,b=g.width,x=g.height,w=b*Math.abs(Math.cos(y))+Math.abs(x*Math.sin(y)),_=b*Math.abs(Math.sin(y))+Math.abs(x*Math.cos(y)),C=new Kt(g.x,g.y,w,_);return C}}fr([sOe]);fr([rOe]);fr([MOe,$Oe,JOe,tIe,dIe,tLe,ALe,fPe,OPe,FPe,GPe,QPe,W3e,g4e,M4e,U4e,q4e,n5e,c5e,w5e,M5e,B5e,x6e]);fr(F6e);fr(cBe);fr(Zne);fr(SBe);fr(Bie);fr(EBe);fr(WBe);fr(t8e);fr(H8e);fr(oze);fr($0);fr(Sze);fr(Cze);fr(Lze);fr(Uze);fr(Yze);fr(tFe);fr(fFe);fr(NFe);fr(jae);fr(Gae);fr(XFe);fr(Xae);fr(Zae);fr(e9e);fr(a9e);fr(y9e);fr(w9e);fr(K9e);fr(SDe);fr(p7e);fr(v7e);fr(rIe);function aoe(t,e,r){let n={};if(!t||!e)return n;const i=["pie","ring","radar"];e.titleText&&e.titleText!==""&&(n.title={},n.title.text=e.titleText,n.title.left=e.titleleft??"left");let a=[];function o(){n.legend={},n.legend.show=!!e.legend,n.legend[e.legendlocation]=10,n.legend.left=e.legendleft,n.legend.orient=e.legendorient,n.legend.data=[],a=t.legends,n.legend.data=t.legends}o();function s(){if(i.includes(e.seriesType)||(n.yAxis={type:"value"},n.xAxis={},n.xAxis.type="category",n.xAxis.data=t.labels),n.series=[],i.includes(e.seriesType))e.seriesType==="pie"&&n.series.push({name:"饼图",type:e.seriesType,data:t.labels.map((u,c)=>({value:t.series[0][c],name:u}))}),e.seriesType==="ring"&&n.series.push({name:"环形图",type:"pie",radius:["40%","70%"],itemStyle:{borderRadius:10,borderColor:"#fff",borderWidth:2},data:t.labels.map((u,c)=>({value:t.series[0][c],name:u}))}),e.seriesType==="radar"&&(n.series.push({name:"雷达图",type:e.seriesType,data:t.legends.map((u,c)=>({value:t.series[c],name:u}))}),n.radar={indicator:t.labels.map(u=>({name:u}))});else for(let u=0;u<a.length;u++)n.series.push({name:n.legend.data[u],type:e.seriesType,data:t.series[u]}),e.seriesType==="smooth"&&(n.series[u].type="line",n.series[u].smooth=!0),e.seriesType==="area"&&(n.series[u].type="line",n.series[u].areaStyle={});i.includes(e.seriesType)&&n.legend.data!==null&&delete n.legend.data}s(),n.grid={left:"3%",right:"4%",top:30,bottom:30,containLabel:!0},n?.legend?.show&&(n?.legend?.bottom?n.grid.bottom=60:n.grid.top=60);const l=r.echarts?.onSetOptions?.(t,e);return l!==null&&typeof l=="object"&&(n=l),JSON.parse(JSON.stringify(n))}function E2(t,e){j.useEffect(()=>{const r=n=>{const i=t?.current;!i||i.contains(n.target)||e(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,e])}const y7e=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a}=Ot(),o=j.useRef(null),s=j.useRef(null),[l,u]=j.useState(!1),[c,f]=j.useState(0),d=j.useRef(null),[h,p]=j.useState(null),v=j.useMemo(()=>{const w=Number(e.attrs.width),_=Number(e.attrs.height);if(!(!w||!_))return{width:w,height:_,left:0,top:0,angle:0}},[e.attrs.width,e.attrs.height]),g=j.useMemo(()=>{const{nodeAlign:w,margin:_}=e.attrs,C=_?.top&&_?.top!==""?`${_.top}px`:void 0,D=_?.bottom&&_?.bottom!==""?`${_.bottom}px`:void 0;return{justifyContent:w,marginTop:C,marginBottom:D}},[e.attrs.nodeAlign,e.attrs.margin]),m=j.useRef(()=>{}),y=async()=>{const{chartOptions:w,chartConfig:_,mode:C}=e.attrs,D=s.current;if(D){if(D.clientWidth===0||D.clientHeight===0){d.current&&(d.current.dispose(),d.current=null,p(null));return}if(d.current&&(d.current.dispose(),d.current=null,p(null)),C===1){if(_!==null){const O=aoe(_.data,_.config,i);O!==null&&(d.current=CR(D),d.current.setOption(O),p(O))}}else w!==null&&(d.current=CR(D),d.current.setOption(w),p(w))}};m.current=y,j.useEffect(()=>{y(),o.current&&(f(o.current.offsetWidth),e.attrs.width===null&&setTimeout(()=>{r({width:300,height:210})}));let w=null;return s.current&&(w=new ResizeObserver(()=>{d.current?d.current.resize():m.current()}),w.observe(s.current)),()=>{w?.disconnect(),d.current&&(d.current.dispose(),d.current=null)}},[]),j.useEffect(()=>{y()},[e.attrs.chartOptions,e.attrs.chartConfig,e.attrs.mode,e.attrs.id]),j.useEffect(()=>{d.current&&d.current.resize()},[e.attrs.width,e.attrs.height]);const b=({width:w,height:_})=>{r({width:Number(w.toFixed(2)),height:Number(_.toFixed(2))})},x=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),u(!0))};return E2(o,()=>{u(!1)}),F.jsx(yu,{id:e.attrs.id,ref:o,className:"flex max-h-full relative",style:g,children:F.jsx("div",{className:"max-h-full max-w-full w-auto relative z-20 white-view-node","data-options":i.document?.readOnly?JSON.stringify(h):null,children:F.jsx(P_,{selected:l,rotatable:!1,boundary:!1,disabled:i.document?.readOnly,size:v,maxWidth:c,minWidth:200,minHeight:200,zIndex:10,onResize:b,onFocus:x,children:F.jsx("div",{id:`chart-${e.attrs.id}`,ref:s,className:"min-h-[200px] w-full h-full bg-[#fff] white-chart-node"})})})})},b7e=Nn.create({name:"echarts",inline:!1,group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},id:{default:null},name:{default:null},width:{default:null},height:{default:300},draggable:{default:!1},mode:{default:1},chartOptions:{default:null,parseHTML:t=>{const e=t.hasAttribute("chart-options")?t.getAttribute("chart-options"):null;return e?JSON.parse(e):null},renderHTML:t=>({"chart-options":t.chartOptions?JSON.stringify(t.chartOptions):null})},chartConfig:{default:null,parseHTML:t=>{const e=t.hasAttribute("chart-config")?t.getAttribute("chart-config"):null;return e?JSON.parse(e):null},renderHTML:t=>({"chart-config":t.chartConfig?JSON.stringify(t.chartConfig):null})}}},parseHTML(){return[{tag:"echarts"}]},renderHTML({HTMLAttributes:t}){return["echarts",zr(t)]},addNodeView(){return ml(y7e)},addCommands(){return{setEcharts:t=>({commands:e,editor:r})=>e.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:t}),updateEcharts:t=>({commands:e,editor:r,tr:n})=>{r.commands.selectParentNode();const{selection:i}=r.state;n.setSelection(i);const{doc:a}=n,{from:o,to:s}=i;return a.nodesBetween(o,s,l=>l.type.name===this.name?(e.updateAttributes(this.name,t),!1):!0),!0}}}}),x7e=t=>{const{key:e,editor:r,onPaste:n,onDrop:i,allowedMimeTypes:a}=t;return new en({key:e||new on("fileHandler"),props:{handleDrop(o,s){const{dataTransfer:l}=s;if(!i||!l?.files.length)return;const u=o.posAtCoords({left:s.clientX,top:s.clientY});let c=Array.from(l.files);a.length>0&&(c=c.filter(f=>a.includes(f.type)?!0:a.includes(`${f.type.split("/")[0]}/*`))),c.length!==0&&i(r,c,(u===null?void 0:u.pos)??0),s.preventDefault(),s.stopPropagation()},handlePaste(o,s){const{clipboardData:l}=s;if(!n||!l?.files.length)return;let u=Array.from(l.files);const c=l.getData("text/html");a.length>0&&(u=u.filter(f=>a.includes(f.type)?!0:a.includes(`${f.type.split("/")[0]}/*`))),u.length!==0&&n(r,u,c),s.preventDefault(),s.stopPropagation()}}})},w7e=Vr.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:[]}),addProseMirrorPlugins(){return[x7e({key:new on(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}}),S7e=Vr.create({name:"fontSize",addOptions(){return{types:["textStyle"],defaultFontSize:"14px"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:this.options.defaultFontSize,parseHTML:t=>t.style.fontSize||this.options.defaultFontSize,renderHTML:t=>t.fontSize===this.options.defaultFontSize?{}:{style:`font-size: ${t.fontSize}`}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),_7e=Vr.create({name:"painter",addCommands(){return{setFormatPainter:t=>({editor:e,view:r})=>{const{tr:n}=r.state,i=e.state.selection.$head.marks();return r.painter={enabled:!0,once:t,marks:i},r.dispatch(n.setMeta("painterAction",{type:"start",marks:i})),!0},unsetFormatPainter:()=>({view:t})=>{const{tr:e}=t.state;return t.painter={enabled:!1,once:!0,marks:[]},t.dispatch(e.setMeta("painterAction",{type:"end"})),!0}}},addProseMirrorPlugins(){return[new en({key:new on("format-painter"),state:{init:()=>[],apply(t,e){const r=t.getMeta("painterAction");return r?.type==="start"?r.marks:r?.type==="end"?[]:e}},props:{handleDOMEvents:{mousedown(t){const e=this.getState(t.state),{painter:r}=t;if(!e||e.length===0)return!1;const n=()=>{if(document.removeEventListener("mouseup",n),!r.enabled)return;const{dispatch:i}=t;let{tr:a}=t.state;const{selection:o}=t.state;a=a.removeMark(o.from,o.to);for(const s of e)s.type.name!=="link"&&(a=a.addMark(o.from,o.to,s));r.once?(r.enabled=!1,r.marks=[],i(a.setMeta("painterAction",{type:"end"}))):i(a.setMeta("painterAction",{type:"start",marks:r.marks}))};return document.addEventListener("mouseup",n),!0}}}})]}}),T7e=hZ.extend({addOptions(){return{...this.parent?.(),HTMLAttributes:{"data-line-number":!1}}},parseHTML(){return[{tag:"hr"}]},addAttributes(){return{"data-type":{parseHTML:t=>t.getAttribute("data-type")??"signle"},color:{parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color,style:`color: ${t.color??"inherit"}`})}}},addCommands(){return{setHr:({type:t,color:e})=>({chain:r,state:n})=>{const{$to:i}=n.selection,a=r();return i.parentOffset===0?a.insertContentAt(Math.max(i.pos-2,0),{type:this.name,attrs:{"data-type":t,color:e}}):a.insertContent({type:this.name,attrs:{"data-type":t,color:e}}),a.command(({tr:o,dispatch:s})=>{if(s){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(ir.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(ar.create(o.doc,l.pos)):o.setSelection(ir.create(o.doc,l.pos));else{const c=l.parent.type.contentMatch.defaultType?.create()??0;c&&(o.insert(u,c),o.setSelection(ir.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[N_({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),C7e=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a}=Ot(),o=j.useRef(null),[s,l]=j.useState(!1),[u,c]=j.useState(0),f=j.useMemo(()=>{const{nodeAlign:p,margin:v}=e.attrs,g=v?.top&&v?.top!==""?`${v.top}px`:void 0,m=v?.bottom&&v?.bottom!==""?`${v.bottom}px`:void 0;return{justifyContent:p,marginTop:g,marginBottom:m}},[e.attrs.nodeAlign,e.attrs.margin]);j.useEffect(()=>{if(o.current){const{offsetWidth:p}=o.current;c(p),e.attrs.width===null&&setTimeout(()=>{r({width:p})})}},[]);const d=({width:p,height:v})=>{r({width:p,height:v})},h=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),l(!0))};return E2(o,()=>{l(!1)}),F.jsx(yu,{id:e.attrs.id,ref:o,className:"flex max-h-full relative white-iframe-node",style:f,children:e.attrs.src!==""?F.jsx("div",{className:"max-w-full white-view-node white-iframe-wrapper relative flex rounded-[4px]",children:F.jsx(P_,{selected:s,rotatable:!1,boundary:!1,width:Number(e.attrs.width),height:Number(e.attrs.height),minWidth:400,minHeight:200,maxWidth:u,equalProportion:!0,disabled:i.editor?.readOnly,onResize:d,onFocus:h,children:F.jsx("iframe",{src:e.attrs.src,style:{pointerEvents:e.attrs.clickable?"auto":"none"},className:"w-full h-full"})})}):F.jsxs("div",{className:"flex items-center gap-3 w-full h-[60px] px-4 bg-[#f8f9fb] rounded-[4px] hover:bg-[#6b729414] cursor-pointer",children:[F.jsx("div",{className:"w-[40px] h-[40px] flex items-center justify-center rounded-[4px] bg-[#7e868e1f]",children:F.jsx("i",{className:"w-iconfont icon-web-page"})}),F.jsx("span",{className:"text-[14px] text-[#333] select-none",children:"插入网址"})]})})},E7e=Nn.create({name:"iframe",inline:!1,group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},type:{default:0},src:{default:null},width:{default:null},height:{default:200},clickable:{default:!1}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",zr(t)]},addNodeView(){return ml(C7e)},addCommands(){return{setIframe:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}}});var M7e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,A7e=Nn.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{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",zr(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,r,n,i,a,o;const s=(r=(e=t.attrs)==null?void 0:e.src)!=null?r:"",l=(i=(n=t.attrs)==null?void 0:n.alt)!=null?i:"",u=(o=(a=t.attrs)==null?void 0:a.title)!=null?o:"";return u?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{const l=document.createElement("img");Object.entries(o).forEach(([f,d])=>{if(d!=null)switch(f){case"width":case"height":break;default:l.setAttribute(f,d);break}}),l.src=o.src;const u=new Ige({element:l,editor:s,node:i,getPos:a,onResize:(f,d)=>{l.style.width=`${f}px`,l.style.height=`${d}px`},onCommit:(f,d)=>{const h=a();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:f,height:d}).run()},onUpdate:(f,d,h)=>f.type===i.type,options:{directions:t,min:{width:e,height:r},preserveAspectRatio:n===!0}}),c=u.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",l.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},u}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[N_({find:M7e,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),Hf={},Gu={},TU;function k7e(){if(TU)return Gu;TU=1;var t=Gu&&Gu.__awaiter||function(a,o,s,l){function u(c){return c instanceof s?c:new s(function(f){f(c)})}return new(s||(s=Promise))(function(c,f){function d(v){try{p(l.next(v))}catch(g){f(g)}}function h(v){try{p(l.throw(v))}catch(g){f(g)}}function p(v){v.done?c(v.value):u(v.value).then(d,h)}p((l=l.apply(a,o||[])).next())})},e=Gu&&Gu.__generator||function(a,o){var s={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},l,u,c,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=d(0),f.throw=d(1),f.return=d(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(p){return function(v){return h([p,v])}}function h(p){if(l)throw new TypeError("Generator is already executing.");for(;f&&(f=0,p[0]&&(s=0)),s;)try{if(l=1,u&&(c=p[0]&2?u.return:p[0]?u.throw||((c=u.return)&&c.call(u),0):u.next)&&!(c=c.call(u,p[1])).done)return c;switch(u=0,c&&(p=[p[0]&2,c.value]),p[0]){case 0:case 1:c=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,u=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(c=s.trys,!(c=c.length>0&&c[c.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]<c[3])){s.label=p[1];break}if(p[0]===6&&s.label<c[1]){s.label=c[1],c=p;break}if(c&&s.label<c[2]){s.label=c[2],s.ops.push(p);break}c[2]&&s.ops.pop(),s.trys.pop();continue}p=o.call(a,s)}catch(v){p=[6,v],u=0}finally{l=c=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.base64ToBlob=r;function r(a){return t(this,void 0,void 0,function(){var o,s,l;return e(this,function(u){switch(u.label){case 0:return[4,fetch(a)];case 1:return o=u.sent(),[4,o.blob()];case 2:return s=u.sent(),l=i(a),l&&(s=s.slice(0,s.size,l)),[2,s]}})})}var n=/^data:(.+);base64,/;function i(a){var o;return(o=a.match(n))===null||o===void 0?void 0:o.slice(1,2).pop()}return Gu}var Wu={},CU;function N7e(){if(CU)return Wu;CU=1;var t=Wu&&Wu.__awaiter||function(n,i,a,o){function s(l){return l instanceof a?l:new a(function(u){u(l)})}return new(a||(a=Promise))(function(l,u){function c(h){try{d(o.next(h))}catch(p){u(p)}}function f(h){try{d(o.throw(h))}catch(p){u(p)}}function d(h){h.done?l(h.value):s(h.value).then(c,f)}d((o=o.apply(n,i||[])).next())})},e=Wu&&Wu.__generator||function(n,i){var a={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},o,s,l,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(d){return function(h){return f([d,h])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;u&&(u=0,d[0]&&(a=0)),a;)try{if(o=1,s&&(l=d[0]&2?s.return:d[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,d[1])).done)return l;switch(s=0,l&&(d=[d[0]&2,l.value]),d[0]){case 0:case 1:l=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,s=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(l=a.trys,!(l=l.length>0&&l[l.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!l||d[1]>l[0]&&d[1]<l[3])){a.label=d[1];break}if(d[0]===6&&a.label<l[1]){a.label=l[1],l=d;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(d);break}l[2]&&a.ops.pop(),a.trys.pop();continue}d=i.call(n,a)}catch(h){d=[6,h],s=0}finally{o=l=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}};Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.base64ToFile=r;function r(n,i,a){return t(this,void 0,void 0,function(){var o,s;return e(this,function(l){switch(l.label){case 0:return[4,fetch(n)];case 1:return o=l.sent(),[4,o.blob()];case 2:return s=l.sent(),[2,new File([s],i,a)]}})})}return Wu}var qu={},EU;function ooe(){if(EU)return qu;EU=1;var t=qu&&qu.__awaiter||function(s,l,u,c){function f(d){return d instanceof u?d:new u(function(h){h(d)})}return new(u||(u=Promise))(function(d,h){function p(m){try{g(c.next(m))}catch(y){h(y)}}function v(m){try{g(c.throw(m))}catch(y){h(y)}}function g(m){m.done?d(m.value):f(m.value).then(p,v)}g((c=c.apply(s,l||[])).next())})},e=qu&&qu.__generator||function(s,l){var u={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},c,f,d,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=p(0),h.throw=p(1),h.return=p(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function p(g){return function(m){return v([g,m])}}function v(g){if(c)throw new TypeError("Generator is already executing.");for(;h&&(h=0,g[0]&&(u=0)),u;)try{if(c=1,f&&(d=g[0]&2?f.return:g[0]?f.throw||((d=f.return)&&d.call(f),0):f.next)&&!(d=d.call(f,g[1])).done)return d;switch(f=0,d&&(g=[g[0]&2,d.value]),g[0]){case 0:case 1:d=g;break;case 4:return u.label++,{value:g[1],done:!1};case 5:u.label++,f=g[1],g=[0];continue;case 7:g=u.ops.pop(),u.trys.pop();continue;default:if(d=u.trys,!(d=d.length>0&&d[d.length-1])&&(g[0]===6||g[0]===2)){u=0;continue}if(g[0]===3&&(!d||g[1]>d[0]&&g[1]<d[3])){u.label=g[1];break}if(g[0]===6&&u.label<d[1]){u.label=d[1],d=g;break}if(d&&u.label<d[2]){u.label=d[2],u.ops.push(g);break}d[2]&&u.ops.pop(),u.trys.pop();continue}g=l.call(s,u)}catch(m){g=[6,m],f=0}finally{c=d=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}};Object.defineProperty(qu,"__esModule",{value:!0}),qu.blobToBase64=r;function r(s){return t(this,void 0,void 0,function(){return e(this,function(l){return[2,typeof FileReader=="function"?i(s):o(s)]})})}var n;(function(s){s.error="error",s.loadend="loadend"})(n||(n={}));function i(s){return t(this,void 0,void 0,function(){return e(this,function(l){return[2,new Promise(function(u,c){try{var f=new FileReader,d=function(){u(f.result),f.removeEventListener(n.loadend,d)};f.addEventListener(n.loadend,d);var h=function(){c(f.error),f.removeEventListener(n.error,h)};f.addEventListener(n.error,h),f.readAsDataURL(s)}catch(p){c(p)}})]})})}var a="application/octet-stream";function o(s){return t(this,void 0,void 0,function(){var l,u,c,f;return e(this,function(d){switch(d.label){case 0:return c=(u=Buffer).from,[4,s.text()];case 1:return l=c.apply(u,[d.sent()]),f=s.type||a,[2,"data:".concat(f,";base64,").concat(l.toString("base64"))]}})})}return qu}var fA={},MU;function D7e(){return MU||(MU=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.fileToBase64=void 0;var e=ooe();Object.defineProperty(t,"fileToBase64",{enumerable:!0,get:function(){return e.blobToBase64}})})(fA)),fA}var AU;function O7e(){return AU||(AU=1,(function(t){var e=Hf&&Hf.__createBinding||(Object.create?(function(n,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,o,s)}):(function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]})),r=Hf&&Hf.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(k7e(),t),r(N7e(),t),r(ooe(),t),r(D7e(),t)})(Hf)),Hf}var R7e=O7e();const soe=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a,uploadFileMap:o,deleteUploadFile:s}=Ot(),l=j.useRef(null),u=j.useRef(null),[c,f]=j.useState(!1),[d,h]=j.useState(0),[p,v]=j.useState(0),[g,m]=j.useState(!1),[y,b]=j.useState(!1),x=j.useMemo(()=>{const H=Number(e.attrs.width),Y=Number(e.attrs.height);if(!(!H||!Y))return{width:H,height:Y,left:0,top:0,angle:0}},[e.attrs.width,e.attrs.height]),w=j.useMemo(()=>{const{nodeAlign:H,margin:Y}=e.attrs,te=Y?.top&&Y?.top!==""?`${Y.top}px`:void 0,Q=Y?.bottom&&Y?.bottom!==""?`${Y.bottom}px`:void 0;return{justifyContent:H,marginTop:te,marginBottom:Q,zIndex:c?100:0}},[e.attrs.nodeAlign,e.attrs.margin,c]),_=e.attrs.src,C=()=>{if(m(!1),e.attrs.width===null){const{naturalWidth:H=0,naturalHeight:Y=0}=u.current??{},te=l.current?.offsetWidth??0;h(te);const Q=Y>0?H/Y:16/9;v(te/Q),r({width:200,height:(200/Q).toFixed(2)})}},D=()=>{m(!1),b(!0)};j.useEffect(()=>{typeof n=="function"&&a&&Gp(a,{error:y},n())},[y]);const O=async()=>{if(e.attrs.uploaded||!e.attrs.id||!o.has(e.attrs.id)){typeof n=="function"&&a&&Gp(a,{uploaded:!0},n());return}try{const H=o.get(e.attrs.id),{id:Y,url:te}=await i?.onFileUpload?.(H)??{};l.current&&typeof n=="function"&&a&&Gp(a,{id:Y,src:te,uploaded:!0},n()),s(e.attrs.id)}catch(H){console.error(H)}};j.useEffect(()=>{(async()=>{if(e.attrs.uploaded===!1&&!y){if(_?.startsWith("data:image")){const[Y]=_.split(","),te=Y.match(/:(.*?);/)?.[1];let Q=te?.split("/")[1];Q==="jpeg"&&(Q="jpg"),Q==="svg+xml"&&(Q="svg");const ue=Nv(),ie=await R7e.base64ToFile(_,`${ue}.${Q}`,{type:te});o.set(e.attrs.id,ie)}O()}})()},[_]);const I=({angle:H})=>{r({angle:H})},L=({width:H,height:Y})=>{r({width:H.toFixed(2),height:Y.toFixed(2)})},V=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),f(!0))};return E2(l,()=>{f(!1)}),j.useEffect(()=>{l.current&&h(l.current.offsetWidth)},[]),F.jsx(yu,{ref:l,className:`white-image-wrapper flex max-h-full relative ${e.attrs.inline?"is-inline-image":""}`,style:w,children:F.jsxs("div",{className:`max-h-full max-w-full w-auto relative z-20 node-view-image white-view-node ${_&&g?"is-loading":""} ${_&&y?"is-error":""}`,children:[_&&g&&F.jsxs("div",{className:"flex items-center justify-center text-[14px] gap-[10px] text-[#00000080]",style:{height:`${e.attrs.height}px`},children:[F.jsx("i",{className:"white-loading-icon w-iconfont icon-loading !text-[14px]"}),"图片加载中..."]}),_&&y&&F.jsxs("div",{className:"w-full h-[200px] flex items-center justify-center flex-col text-[14px] gap-[10px] text-[#00000080]",style:{height:`${e.attrs.height}px`},children:[F.jsxs("svg",{viewBox:"0 0 1316 1024",xmlns:"http://www.w3.org/2000/svg",width:"70",height:"70",children:[F.jsx("path",{d:"M690.943634 717.513143l-412.708571-391.222857a83.876571 83.876571 0 0 0-23.168 17.536l-171.922286 180.388571-9.088-336.091428c-1.152-40.411429 31.451429-74.587429 71.899429-75.593143l304.347428-8.192 71.387429-75.483429-377.782857 10.24C62.280777 41.398857-2.066651 108.946286 0.109349 190.171429l11.008 409.380571 6.893714 251.52c2.194286 81.243429 70.107429 145.188571 151.734857 143.030857l265.453714-7.168 18.048-0.512 71.387429-75.483429 175.268571-184.978286-8.96-8.448zM933.357349 437.979429c61.257143 0 110.902857-49.371429 110.902857-110.262858 0-60.909714-49.755429-110.299429-110.902857-110.299428-61.165714 0-110.921143 49.389714-110.921143 110.281143 0 60.891429 49.627429 110.281143 110.921143 110.281143z",fill:"#515151",opacity:".25"}),F.jsx("path",{d:"M1182.591634 60.196571L816.328777 9.033143l-83.163428 62.537143L1172.351634 132.882286a74.057143 74.057143 0 0 1 63.067429 83.163428l-82.011429 587.574857-182.162285-239.872a90.331429 90.331429 0 0 0-126.025143-17.645714l-66.377143 49.883429 98.230857 129.993143-83.401143 63.067428-120.009143 90.697143-82.889143 62.427429 51.565715 7.168 408.338285 56.923428a147.181714 147.181714 0 0 0 165.796572-120.118857c0.512-1.664 0.768-3.456 1.024-5.248l91.355428-654.884571c11.117714-80.201143-45.293714-154.532571-126.281142-165.796572z",fill:"#515151",opacity:".25"})]}),"图片加载失败"]}),!g&&!y&&F.jsxs(P_,{selected:c,rotatable:!1,boundary:!1,disabled:i.editor?.readOnly,angle:e.attrs.angle,size:x,minWidth:50,minHeight:50,maxWidth:d,maxHeight:p||1/0,zIndex:10,equalProportion:!0,onRotate:I,onResize:L,onFocus:V,children:[F.jsx("img",{ref:u,src:_,style:{transform:e.attrs.flipX||e.attrs.flipY?`rotateX(${e.attrs.flipX?"180":"0"}deg) rotateY(${e.attrs.flipY?"180":"0"}deg)`:"none"},"data-id":e.attrs.id,loading:"lazy",onLoad:C,onError:D}),!e.attrs.uploaded&&e.attrs.file!==null&&F.jsxs("div",{className:"absolute left-0 top-0 w-full h-full flex items-center justify-center bg-[#00000040] text-[#fff] gap-[10px]",children:[F.jsx("i",{className:"white-loading-icon w-iconfont icon-loading"}),"图片上传中..."]})]})]})})},s_=A7e.extend({atom:!0,addAttributes(){return{vnode:{default:!0},type:{default:"image"},name:{default:null},size:{default:null},id:{default:null},src:{default:null},content:{default:null},width:{default:null},height:{default:null},left:{default:0},top:{default:0},angle:{default:null},draggable:{default:!1},rotatable:{default:!1},flipX:{default:!1},flipY:{default:!1},uploaded:{default:!1},error:{default:!1},previewType:{default:"image"},inline:{default:!1}}},parseHTML(){return[{tag:"img"}]},addPasteRules(){return[...this.parent?.()??[],jge({find:/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"([^"]+)"?)?\)/g,type:this.type,getAttributes:t=>{const[,e,r,n]=t;return{src:r,alt:e,title:n}}})]},addInputRules(){return[...this.parent?.()??[],N_({find:/!\[([\S]+)\]\(([^)\s]+)(?:\s+"([\S]+)"?)?\)/g,type:this.type,getAttributes:t=>{const[,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),loe=s_.extend({...s_,addNodeView(){return ml(soe)},addCommands(){return{setImage:(t,e)=>({commands:r,editor:n})=>e?r.insertContent({type:this.name,attrs:{...t,inline:!1}}):r.insertContentAt(n.state.selection.anchor,{type:this.name,attrs:{...t,inline:!1}})}}}),I7e=s_.extend({...s_,name:"inlineImage",inline:!0,group:"inline",addAttributes(){return{...this.parent?.()??{},inline:{default:!0},width:{default:150},height:{default:80}}},parseHTML(){return[{tag:"inline-img"}]},renderHTML({HTMLAttributes:t}){return["inline-img",zr(t)]},addNodeView(){return ml(soe)},addCommands(){return{setInlineImage:t=>({commands:e,editor:r})=>e.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:{...t,inline:!0}})}}}),dA="indent-",L7e=Vr.create({name:"indent",addOptions(){return{types:["heading","listItem","taskItem","paragraph"],minLevel:0,maxLevel:5}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:null,renderHTML:t=>t.indent?t.indent>this.options.minLevel?{class:`${dA}${t.indent}`}:{}:{},parseHTML:t=>{let e="";for(const r of t.classList)if(r.startsWith(dA)){e=r;break}if(e){const r=Number.parseInt(e.slice(dA.length),10);return r&&r>this.options.minLevel?r:null}return null}}}}]},addCommands(){const t=(n,i,a)=>{const o=n.doc.nodeAt(i)??null;if(o){const s=(o.attrs.indent??0)+a,{minLevel:l,maxLevel:u}=this.options;let c=s;if(s<l?c=l:s>u&&(c=u),c!==o.attrs.indent){const f={...o.attrs};delete f.indent;const d=c>l?{...f,indent:c}:f;return n.setNodeMarkup(i,o.type,d,o.marks)}}return n},e=(n,i)=>{const{doc:a,selection:o}=n;if(a&&o&&(o instanceof ir||o instanceof Oa)){const{from:s,to:l}=o;a.nodesBetween(s,l,(u,c)=>this.options.types.includes(u.type.name)?(n=t(n,c,i),!1):!0)}return n},r=n=>()=>({tr:i,state:a,dispatch:o})=>{const{selection:s}=a;return i.setSelection(s),i=e(i,n),i.docChanged?(Ase(o)&&o(i),!0):!1};return{indent:r(1),outdent:r(-1)}},addKeyboardShortcuts(){return{Tab:()=>this.editor.isActive("bulletList")||this.editor.isActive("orderedList")?this.editor.commands.sinkListItem("listItem"):this.editor.isActive("taskList")?this.editor.commands.sinkListItem("taskItem"):this.editor.commands.indent(),"Shift-Tab":()=>this.editor.isActive("bulletList")||this.editor.isActive("orderedList")?this.editor.commands.liftListItem("listItem"):this.editor.isActive("taskList")?this.editor.commands.liftListItem("taskItem"):this.editor.commands.outdent()}}}),P7e=Vr.create({name:"lineHeight",addOptions(){return{types:[],defaultLineHeight:1.5}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:t=>t.style.lineHeight||this.options.defaultLineHeight,renderHTML:t=>t.lineHeight===this.options.defaultLineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>({commands:e})=>this.options.types.map(r=>e.updateAttributes(r,{lineHeight:t})).some(r=>r),unsetLineHeight:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"lineHeight")).some(e=>e)}}}),uoe=_Z.extend({addStorage(){return{edit:!1,meta:{}}},addProseMirrorPlugins(){return[new en({props:{handleClick(t,e,r){const n=r.target;if(n.tagName==="A"){const i=n.getAttribute("href");return t.dispatch(t.state.tr.setMeta("link-click",{target:n,href:i,pos:e})),!0}return!1}}})]},onTransaction({transaction:t}){const e=t.getMeta("link-click");e&&(this.storage.edit=!0,this.storage.meta=e)}});uoe.configure({openOnClick:t=>!t.editor.isEditable});const B7e=Vr.create({name:"margin",addOptions(){return{types:["heading","paragraph","audio","codeBlock","file","iframe","image","toc","video","horizontalRule","table","bulletList","orderedList","taskList","echarts"],margin:{top:0,bottom:0}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{margin:{default:{},parseHTML:t=>{const{marginTop:e,marginBottom:r}=t.style;if(e===""&&r===""||e==="0px"&&r==="0px")return{};const n={top:"0px",bottom:"0px"};return e&&e!=="0px"&&(n.top=e.replace(/px/g,"")),r&&r!=="0px"&&(n.bottom=r.replace(/px/g,"")),n},renderHTML:({margin:t})=>{if(!Object.keys(t).length)return{};const{top:e,bottom:r}=t;let n="";return e&&e!==""&&(n+=`margin-top: ${e}px;`),r&&r!==""&&(n+=`margin-bottom: ${r}px;`),{style:n}}}}}]},addCommands(){return{setMargin:t=>({editor:e,commands:r})=>this.options.types.every(n=>{const{margin:i}=e.getAttributes(n);return r.updateAttributes(n,{margin:Object.assign({},i,t)})}),unsetMargin:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"margin"))}}});function z7e(t){var e;const{char:r,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:s}=t,l=n&&!i,u=Pge(r),c=new RegExp(`\\s${u}$`),f=o?"^":"",d=i?"":u,h=l?new RegExp(`${f}${u}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${d}]*`,"gm"),p=((e=s.nodeBefore)==null?void 0:e.isText)&&s.nodeBefore.text;if(!p)return null;const v=s.pos-p.length,g=Array.from(p.matchAll(h)).pop();if(!g||g.input===void 0||g.index===void 0)return null;const m=g.input.slice(Math.max(0,g.index-1),g.index),y=new RegExp(`^[${a?.join("")}\0]?$`).test(m);if(a!==null&&!y)return null;const b=v+g.index;let x=b+g[0].length;return l&&c.test(p.slice(x-1,x+1))&&(g[0]+=" ",x+=1),b<s.pos&&x>=s.pos?{range:{from:b,to:x},query:g[0].slice(r.length),text:g[0]}:null}var F7e=new on("suggestion");function V7e({pluginKey:t=F7e,editor:e,char:r="@",allowSpaces:n=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:c="is-empty",command:f=()=>null,items:d=()=>[],render:h=()=>({}),allow:p=()=>!0,findSuggestionMatch:v=z7e,shouldShow:g}){let m;const y=h?.(),b=()=>{const C=e.state.selection.$anchor.pos,D=e.view.coordsAtPos(C),{top:O,right:I,bottom:L,left:V}=D;try{return new DOMRect(V,O,I-V,L-O)}catch{return null}},x=(C,D)=>D?()=>{const O=t.getState(e.state),I=O?.decorationId,L=C.dom.querySelector(`[data-decoration-id="${I}"]`);return L?.getBoundingClientRect()||null}:b;function w(C,D){var O;try{const L=t.getState(C.state),V=L?.decorationId?C.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`):null,H={editor:e,range:L?.range||{from:0,to:0},query:L?.query||null,text:L?.text||null,items:[],command:Y=>f({editor:e,range:L?.range||{from:0,to:0},props:Y}),decorationNode:V,clientRect:x(C,V)};(O=y?.onExit)==null||O.call(y,H)}catch{}const I=C.state.tr.setMeta(D,{exit:!0});C.dispatch(I)}const _=new en({key:t,view(){return{update:async(C,D)=>{var O,I,L,V,H,Y,te;const Q=(O=this.key)==null?void 0:O.getState(D),ue=(I=this.key)==null?void 0:I.getState(C.state),ie=Q.active&&ue.active&&Q.range.from!==ue.range.from,Se=!Q.active&&ue.active,me=Q.active&&!ue.active,ae=!Se&&!me&&Q.query!==ue.query,Te=Se||ie&&ae,Be=ae||ie,He=me||ie&&ae;if(!Te&&!Be&&!He)return;const qe=He&&!Te?Q:ue,ot=C.dom.querySelector(`[data-decoration-id="${qe.decorationId}"]`);m={editor:e,range:qe.range,query:qe.query,text:qe.text,items:[],command:st=>f({editor:e,range:qe.range,props:st}),decorationNode:ot,clientRect:x(C,ot)},Te&&((L=y?.onBeforeStart)==null||L.call(y,m)),Be&&((V=y?.onBeforeUpdate)==null||V.call(y,m)),(Be||Te)&&(m.items=await d({editor:e,query:qe.query})),He&&((H=y?.onExit)==null||H.call(y,m)),Be&&((Y=y?.onUpdate)==null||Y.call(y,m)),Te&&((te=y?.onStart)==null||te.call(y,m))},destroy:()=>{var C;m&&((C=y?.onExit)==null||C.call(y,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,D,O,I){const{isEditable:L}=e,{composing:V}=e.view,{selection:H}=C,{empty:Y,from:te}=H,Q={...D},ue=C.getMeta(t);if(ue&&ue.exit)return Q.active=!1,Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null,Q;if(Q.composing=V,L&&(Y||e.view.composing)){(te<D.range.from||te>D.range.to)&&!V&&!D.composing&&(Q.active=!1);const ie=v({char:r,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:H.$from}),Se=`id_${Math.floor(Math.random()*4294967295)}`;ie&&p({editor:e,state:I,range:ie.range,isActive:D.active})&&(!g||g({editor:e,range:ie.range,query:ie.query,text:ie.text,transaction:C}))?(Q.active=!0,Q.decorationId=D.decorationId?D.decorationId:Se,Q.range=ie.range,Q.query=ie.query,Q.text=ie.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(C,D){var O,I,L,V;const{active:H,range:Y}=_.getState(C.state);if(!H)return!1;if(D.key==="Escape"||D.key==="Esc"){const Q=_.getState(C.state),ue=(O=m?.decorationNode)!=null?O:null,ie=ue??(Q?.decorationId?C.dom.querySelector(`[data-decoration-id="${Q.decorationId}"]`):null);if(((I=y?.onKeyDown)==null?void 0:I.call(y,{view:C,event:D,range:Q.range}))||!1)return!0;const me={editor:e,range:Q.range,query:Q.query,text:Q.text,items:[],command:ae=>f({editor:e,range:Q.range,props:ae}),decorationNode:ie,clientRect:ie?()=>ie.getBoundingClientRect()||null:null};return(L=y?.onExit)==null||L.call(y,me),w(C,t),!0}return((V=y?.onKeyDown)==null?void 0:V.call(y,{view:C,event:D,range:Y}))||!1},decorations(C){const{active:D,range:O,decorationId:I,query:L}=_.getState(C);if(!D)return null;const V=!L?.length,H=[l];return V&&H.push(c),bn.create(C.doc,[Qi.inline(O.from,O.to,{nodeName:s,class:H.join(" "),"data-decoration-id":I,"data-decoration-content":u})])}}});return _}function H7e({editor:t,overrideSuggestionOptions:e,extensionName:r,char:n="@"}){const i=new on;return{editor:t,char:n,pluginKey:i,command:({editor:a,range:o,props:s})=>{var l,u,c;const f=a.view.state.selection.$to.nodeAfter;(l=f?.text)!=null&&l.startsWith(" ")&&(o.to+=1),a.chain().focus().insertContentAt(o,[{type:r,attrs:{...s,mentionSuggestionChar:n}},{type:"text",text:" "}]).run(),(c=(u=a.view.dom.ownerDocument.defaultView)==null?void 0:u.getSelection())==null||c.collapseToEnd()},allow:({state:a,range:o})=>{const s=a.doc.resolve(o.from),l=a.schema.nodes[r];return!!s.parent.type.contentMatch.matchType(l)},...e}}function coe(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>H7e({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function kU(t,e){const r=coe(t),n=r.find(i=>i.char===e);return n||(r.length?r[0]:null)}var $7e=Nn.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var r,n;return`${(r=e?.char)!=null?r:"@"}${(n=t.attrs.label)!=null?n:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:r}){var n,i;return["span",zr(this.HTMLAttributes,t.HTMLAttributes),`${(n=r?.char)!=null?n:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const r=kU(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",zr({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:r})];const n={...this.options};n.HTMLAttributes=zr({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t,suggestion:r});return typeof i=="string"?["span",zr({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},..._X({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(t);for(;n!==null;){const[,i,a,o]=n,s=a??o;e[i==="char"?"mentionSuggestionChar":i]=s,n=r.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,r])=>`${e==="mentionSuggestionChar"?"char":e}="${r}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:kU(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let r=!1;const{selection:n}=e,{empty:i,anchor:a}=n;if(!i)return!1;let o=new Xl,s=0;return e.doc.nodesBetween(a-1,a,(l,u)=>{if(l.type.name===this.name)return r=!0,o=l,s=u,!1}),r&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,s,s+o.nodeSize),r})}},addProseMirrorPlugins(){return coe(this).map(V7e)}});const U7e=$7e.extend({addAttributes(){return{id:{default:null},label:{default:null}}},addCommands(){return{insertMention:()=>({commands:t})=>t.insertContent(` ${this.options?.suggestion?.char??"@"}`)}}}),j7e=U7e.configure({HTMLAttributes:{class:"white-node-mention"}}),G7e=j.forwardRef((t,e)=>{const[r,n]=j.useState(0),i=l=>{const u=t.items[l];u&&t.command(u)},a=()=>{n((r+t.items.length-1)%t.items.length)},o=()=>{n((r+1)%t.items.length)},s=()=>{i(r)};return j.useEffect(()=>{n(0)},[t.items]),j.useImperativeHandle(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(a(),!0):l.key==="ArrowDown"?(o(),!0):l.key==="Enter"?(s(),!0):!1})),t.items.length===0?null:F.jsx("div",{className:"list-none text-[#333] text-[14px]",children:F.jsx("ul",{className:"bg-white border rounded-md shadow-md p-2 max-h-[300px] overflow-y-auto",children:t.items.map((l,u)=>F.jsx("li",{className:`!px-2 cursor-pointer h-[30px] flex items-center rounded-md hover:bg-[#f5f5f5] ${u===r?"bg-[#007bff] text-white hover:!bg-[#007bff] hover:text-white":""}`,onClick:()=>i(u),children:l.label},u))})})}),W7e=(t,e)=>({items:({query:r})=>t.filter(n=>n.label.includes(r)).slice(0,10),command:({editor:r,range:n,props:i})=>{console.log(i),r.chain().focus().deleteRange(n).insertContent({type:"mention",attrs:{id:i.id,label:i.label}}).run()},render:()=>{let r,n;return{onStart:i=>{r=new DX(G7e,{props:i,editor:i.editor}),i.clientRect&&(n=Iv("body",{getReferenceClientRect:i.clientRect,appendTo:document.querySelector(`#${e}`),content:r.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(i){r.updateProps(i),i.clientRect&&n[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown(i){return i.event.key==="Escape"?(n[0].hide(),!0):r.ref?.onKeyDown(i)},onExit(){n[0].destroy(),r.destroy()}}}}),q7e=Vr.create({name:"nodeAlign",addOptions(){return{defaultAlignment:"center",alignments:["flex-start","center","flex-end"],types:["image","video","audio","iframe","file","echarts"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{nodeAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.justifyContent||this.options.defaultAlignment,renderHTML:t=>t.nodeAlign===this.options.defaultAlignment?{}:{style:`justify-content: ${t.nodeAlign}`}}}}]},addCommands(){return{setNodeAlign:t=>({state:e,dispatch:r,tr:n})=>{if(!this.options.alignments.includes(t))return!1;const{selection:i}=e;let a=!1;return e.doc.nodesBetween(i.from,i.to,(o,s)=>{if(this.options.types.includes(o.type.name))return n.setNodeMarkup(s,void 0,{...o.attrs,nodeAlign:t}),a=!0,!1}),a&&r&&r(n),a},unsetNodeAlign:()=>({state:t,dispatch:e,tr:r})=>{const{selection:n}=t;let i=!1;return t.doc.nodesBetween(n.from,n.to,(a,o)=>{if(this.options.types.includes(a.type.name))return r.setNodeMarkup(o,void 0,{...a.attrs,nodeAlign:this.options.defaultAlignment}),i=!0,!1}),i&&e&&e(r),i}}}});var K7e=RL;const Y7e=K7e.extend({content:"listItem*",addAttributes(){return{...this.parent?.(),listType:{default:"decimal",parseHTML:t=>t.style.getPropertyValue("list-style-type")||"decimal",renderHTML:({listType:t})=>({style:`list-style-type: ${t}`,type:t})}}}}),X7e=Vr.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new en({key:new on("selection"),props:{decorations(e){return e.selection.empty||t.isFocused?null:bn.create(e.doc,[Qi.inline(e.selection.from,e.selection.to,{class:"white-selection"})])}}})]},addCommands(){return{setCurrentNodeSelection:()=>({editor:t,chain:e})=>{t.commands.selectParentNode();const{$anchor:r}=t.state.selection;return e().setNodeSelection(r.pos-r.depth).run()},deleteSelectionNode:()=>({editor:t,commands:e})=>{const r=au(t);return r?e.deleteSelection()?!0:e.deleteNode(r.type.name):!1}}}});function au(t){const{$anchor:e,node:r}=t.state.selection;return r?.type?.isAtom?r:(t.commands.selectParentNode(),e.node(1)||r)}function Z7e(t){const{from:e,to:r,empty:n}=t.state.selection;return n?"":t.state.doc.textBetween(e,r,"")}const J7e=t=>{const e={};return t.split(";").map(n=>n.trim()).filter(Boolean).forEach(n=>{const[i,a]=n.split(":").map(o=>o.trim());i&&a&&(e[i]=a)}),e},Q7e=t=>{const e=/\.(\w+)\s*\{([^}]+)\}/g;let r;const n={};for(;(r=e.exec(t))!==null;){const[,i,a]=r,o=J7e(a);n[i]=o}return n},eVe=eZ.extend({addProseMirrorPlugins(){return[...this.parent?.()??[],new en({key:new on("handleExcelPaste"),props:{handlePaste(t,e){const{clipboardData:r}=e;if(!r)return!1;const n=r.getData("text/html");if(!n)return!1;const a=new DOMParser().parseFromString(n,"text/html");if(!a?.querySelector("html")?.getAttribute("xmlns:x")?.includes("office:excel"))return!1;const s=a.querySelector("table");if(!s)return!1;const l=Array.from(a.head.querySelectorAll("style")).map(h=>h.textContent).join(`
|
|
332
|
+
`),u=Q7e(l);s.querySelectorAll("td, th").forEach(h=>{const p=u[h.getAttribute("class")];p?.background&&(h.style.background=p.background),p?.color&&(h.style.color=p.color),p?.["text-align"]&&h.setAttribute("align",p["text-align"])});const{schema:c}=t.state,f=$p.fromSchema(c).parse(s),d=t.state.tr.replaceSelectionWith(f);return t.dispatch(d),!0}}})]}}),tVe=eVe.configure({allowTableNodeSelection:!0,resizable:!0}),foe={addAttributes(){return{...this.parent?.(),align:{default:null,parseHTML:t=>t.getAttribute("align")??null,renderHTML:({align:t})=>({align:t})},background:{default:null,parseHTML:t=>{const r=(t.getAttribute("style")??"").match(/background(?:-color)?:\s*([^;]+)/i);return r?r[1].trim():null},renderHTML:({background:t})=>t?{style:`background-color: ${t}`}:{}},color:{default:null,parseHTML:t=>{const e=t.getAttribute("style")??"",r=e.match(new RegExp("(?<!background-)color:\\s*([^;]+)","i"));return e.includes("background-color")?null:r?r[1].trim():null},renderHTML:({color:t})=>t?{style:`color: ${t}`}:{}}}}},rVe=ZX.extend(foe),nVe=JX.extend(foe),iVe=t=>{const{node:e}=t,{options:r,editor:n}=Ot(),i=j.useMemo(()=>({color:e.attrs.color,backgroundColor:e.attrs.backgroundColor,cursor:!r.document?.readOnly||n?.isEditable?"pointer":"default"}),[e.attrs.color,e.attrs.backgroundColor,r.document?.readOnly,n?.isEditable]);return F.jsx(yu,{as:"span",className:"inline-block mx-[0.3rem] !bg-transparent",children:F.jsx("span",{className:"rounded-[0.2em] px-[0.4em] py-[0.15em] inline-block mx-[0.2em] text-sm font-[500] border-[#0000000d] box-border select-none",style:i,children:e.attrs.text})})},aVe=Nn.create({name:"tag",group:"inline",inline:!0,atom:!0,addAttributes(){return{type:{default:"default"},text:{default:"默认标签"},color:{default:"#999"},backgroundColor:{default:"rgba(0, 0, 0, 0.05)"}}},parseHTML(){return[{tag:'span[data-type="tag"]'}]},renderHTML({HTMLAttributes:t}){return["span",zr(t,{"data-type":"tag"}),t.text]},addNodeView(){return ml(iVe)},addCommands(){return{insertTag:t=>({chain:e})=>e().insertContent({type:this.name,attrs:t}).run()}}});var oVe=Vr.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(r=>e.updateAttributes(r,{textAlign:t})).some(r=>r):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:r})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?r.unsetTextAlign():r.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const sVe=oVe.extend({addOptions(){return{...this.parent?.(),types:["heading","paragraph"],alignments:["left","center","right","justify","distributed"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlignLast?"distributed":t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:t.textAlign==="distributed"?{style:"text-align-last: justify"}:{style:`text-align: ${t.textAlign}`}}}}]},addKeyboardShortcuts(){return{...this.parent?.(),"Mod-Shift-d":()=>this.editor.commands.setTextAlign("distributed")}}}),lVe=t=>{const{node:e,updateAttributes:r,getPos:n}=t,{options:i,editor:a,uploadFileMap:o,deleteUploadFile:s}=Ot(),l=j.useRef(null),u=j.useRef(null),[c,f]=j.useState(!1),[d,h]=j.useState(0),[p,v]=j.useState(0),g=j.useMemo(()=>{const w=Number(e.attrs.width),_=Number(e.attrs.height);if(!(!w||!_))return{width:w,height:_,left:0,top:0,angle:0}},[e.attrs.width,e.attrs.height]),m=j.useMemo(()=>{const{nodeAlign:w,margin:_}=e.attrs,C=_?.top&&_?.top!==""?`${_.top}px`:void 0,D=_?.bottom&&_?.bottom!==""?`${_.bottom}px`:void 0;return{justifyContent:w,marginTop:C,marginBottom:D}},[e.attrs.nodeAlign,e.attrs.margin]),y=()=>{typeof n=="function"&&(a?.chain().focus().setNodeSelection(n()).run(),f(!0))};E2(l,()=>{f(!1)}),j.useEffect(()=>{(async()=>{if(!(e.attrs.uploaded||!e.attrs.id)&&o?.has(e.attrs.id))try{const _=o.get(e.attrs.id),{id:C,url:D}=await i?.onFileUpload?.(_)??{};l.current&&typeof n=="function"&&Gp(a,{id:C,src:D,uploaded:!0},n()),s(e.attrs.id)}catch(_){console.error(_)}})()},[]);const b=()=>{if(e.attrs.width===null){const{videoWidth:w=0,videoHeight:_=0}=u.current??{},C=l.current?.offsetWidth??0;h(C);const D=_>0?w/_:16/9;v(C/D),r({width:300,height:(300/D).toFixed(2)})}},x=({width:w,height:_})=>{r({width:w,height:_})};return F.jsx(yu,{id:e.attrs.id,ref:l,className:"white-video-wrapper flex max-h-full relative",style:m,children:F.jsx("div",{className:"max-w-full node-view-video white-view-node",children:F.jsxs(P_,{selected:c,rotatable:!1,boundary:!1,size:g,minWidth:200,minHeight:100,maxWidth:d,maxHeight:p,equalProportion:!0,disabled:i.editor?.readOnly,onResize:x,onFocus:y,children:[F.jsx("video",{ref:u,src:e.attrs.src,preload:"metadata",crossOrigin:"anonymous",controls:!0,onCanPlay:b,onClick:y}),!e.attrs.uploaded&&e.attrs.id!==null&&F.jsx("div",{className:"uploading absolute top-0 right-0 left-0 h-[2px] bg-[#007bff]"})]})})})},uVe=Nn.create({name:"video",group:"block",atom:!0,addAttributes(){return{vnode:{default:!0},file:{default:null},id:{default:null},name:{default:null},size:{default:null},src:{default:null},width:{default:null},height:{default:200},draggable:{default:!1},uploaded:{default:!1},previewType:{default:"video"}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",zr(t)]},addNodeView(){return ml(lVe)},addCommands(){return{setVideo:t=>({commands:e,editor:r})=>e.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:t})}}}),cVe=({container:t,options:e,uploadFileMap:r})=>{const{document:n,users:i,file:a,disableExtensions:o}=e,s={highlight:kye.configure({multicolor:!0}),"ordered-list":Y7e,"bullet-list":txe,"line-height":P7e.configure({types:["heading","paragraph"],defaultLineHeight:1.7}),margin:B7e,link:uoe,image:loe,inlineImage:I7e,video:uVe,audio:Lbe,"code-block":d_e,tag:aVe,columns:Qbe,mention:j7e.configure({suggestion:W7e(i??[],t)}),"date-time":p_e,hr:T7e,"web-page":E7e,TaskList:fZ.configure({HTMLAttributes:{class:"white-task-list"}}),TaskItem:cZ.configure({nested:!0})},l=[hbe.configure({bulletList:!1,orderedList:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1,link:!1}),bye.configure({placeholder:()=>"输入内容..."}),mye.configure({className:"white-node-focused",mode:"all"}),_7e,HX,S7e,Nye,Dye,VX,FX,L7e,sVe,q7e,Rbe,tVe,QX,nVe,rVe,b7e,X7e,Sbe.configure({scrollParent:()=>document.getElementById(`${t}`),getId:()=>Nv()}),tZ.configure(n?.typographyRules),gye.configure({limit:n?.characterLimit!==0?n?.characterLimit:void 0}),w7e.configure({allowedMimeTypes:a?.allowedMimeTypes,onPaste:async(u,c)=>{for(const f of c){const d=await Cbe(f);u.commands.insertFile({file:f,uploadFileMap:r,autoType:!0,fileDim:d})}},onDrop:(u,c,f)=>{for(const d of c)u.commands.insertFile({file:d,uploadFileMap:r,autoType:!0,pos:f})}}),BX.configure({color:"#007bff"})];return Object.values(s).forEach(u=>{if(!o?.includes(u.name)){if(Array.isArray(u)){l.push(...u);return}l.push(u)}}),l},NU=t=>{let e=!0;return t.editor?.enableMarkdown||(e=[tZ,loe]),e},fVe=j.forwardRef(({children:t,className:e=""},r)=>{const n=j.useRef(null),i=j.useRef(null),[a,o]=j.useState(!0),[s,l]=j.useState(!0),u=()=>{if(!i.current)return;const{scrollLeft:h,scrollWidth:p,clientWidth:v}=i.current;o(h===0),l(h+v+10>=p)},c=()=>{i.current&&(i.current.scrollLeft-=i.current.offsetWidth-10||100)},f=()=>{i.current&&(i.current.scrollLeft+=i.current.offsetWidth-10||100)};j.useEffect(()=>{const h=n.current;if(!h)return;const p=new ResizeObserver(()=>{u()});return p.observe(h),()=>p.disconnect()},[]),j.useEffect(()=>{const h=i.current;if(h)return h.addEventListener("scroll",u),u(),()=>h.removeEventListener("scroll",u)},[t]);const d=()=>{i.current&&(i.current.scrollLeft=0),l(!0),u()};return j.useImperativeHandle(r,()=>({update:d})),F.jsxs("div",{ref:n,className:`white-scrollable-container flex items-center ${a?"":"!pl-[36px]"} ${s?"":"!pr-[36px]"} ${e}`,children:[!a&&F.jsx("div",{className:"w-scrollable-control scrollable-left",onClick:c,children:F.jsx("i",{className:"w-iconfont icon-left"})}),F.jsx("div",{ref:i,className:"w-scrollable-content text-center flex items-center",children:t}),!s&&F.jsx("div",{className:"w-scrollable-control scrollable-right",onClick:f,children:F.jsx("i",{className:"w-iconfont icon-right"})})]})});function dVe(){const{page:t,setPage:e}=Ot(),[r,n]=j.useState(!1),i=a=>{e(o=>({...o,toolbar:a})),n(!1)};return F.jsx(ol,{trigger:"click",placement:"bottom",value:r,onVisibleChange:n,contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:`px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)] ${t.toolbar==="single"?"text-[#007aff]":""}`,onClick:()=>i("single"),children:[F.jsx("i",{className:"w-iconfont icon-single"}),"单行工具栏"]}),F.jsxs("div",{className:`px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)] ${t.toolbar==="double"?"text-[#007aff]":""}`,onClick:()=>i("double"),children:[F.jsx("i",{className:"w-iconfont icon-double"}),"双行工具栏"]})]}),children:F.jsx("span",{className:"w-[28px] h-[28px] cursor-pointer flex items-center justify-center gap-[0.4rem] text-[12px] rounded-[4px] hover:text-[#007aff] hover:bg-[#edeef2]",children:F.jsx("i",{className:`w-iconfont icon-bottom !text-[13px] transition-transform duration-200 ${r?"rotate-180":""}`})})})}function Ar(t){const{ico:e="",text:r="",hideText:n=!1,forceEnabled:i=!1,disabled:a=!1,shortcut:o,shortcutText:s,menuActive:l=!1,editor:u,onMenuClick:c,onMenuClickThrough:f,className:d,onClick:h,...p}=t,v=u?.isEditable!==!1,g=!i&&(a||!v),m=["white-editor-tool-item",n?"":"is-show-text",l&&v?"is-active":"",g?"is-disabled":"",d??""].filter(Boolean).join(" "),y=b=>{if(g){b.preventDefault();return}f?f(b):c&&c(b),h&&h(b)};return F.jsxs("button",{...p,type:"button",disabled:g,className:m,title:r,onClick:y,children:[F.jsx("i",{className:`w-iconfont w-icon icon-${e}`}),!n&&F.jsx("p",{className:"text-[12px] mt-2",children:r})]})}function DI(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"bold",text:"加粗",shortcut:"Ctrl+B",hideText:!0,menuActive:t?.isActive("bold"),disabled:!t?.can().chain().focus().toggleBold().run(),onMenuClick:()=>t?.chain().focus().toggleBold().run()})}function OI(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"underline",text:"下划线",shortcut:"Ctrl+U",hideText:!0,menuActive:t?.isActive("underline"),disabled:!t?.can().chain().focus().toggleUnderline().run(),onMenuClick:()=>t?.chain().focus().toggleUnderline().run()})}function RI(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"decoration",text:"删除线",shortcut:"Ctrl+Shift+X",hideText:!0,menuActive:t?.isActive("strike"),disabled:!t?.can().chain().focus().toggleStrike().run(),onMenuClick:()=>t?.chain().focus().toggleStrike().run()})}function II(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"italic",text:"斜体",shortcut:"Ctrl+I",hideText:!0,menuActive:t?.isActive("italic"),disabled:!t?.can().chain().focus().toggleItalic().run(),onMenuClick:()=>t?.chain().focus().toggleItalic().run()})}const xl=({ico:t="",icoSize:e=14,text:r="",hideText:n=!1,popupVisible:i,forceEnabled:a=!1,disabled:o=!1,shortcut:s,shortcutText:l,menuActive:u=!1,popupType:c="arrow",placement:f="bottom",trigger:d="click",editor:h,onMenuClick:p,onMenuClickThrough:v,onPopupVisibleChange:g,className:m,onClick:y,content:b,children:x,...w})=>{const[_,C]=j.useState(!1),D=i!==void 0?i:_,O=te=>{i===void 0&&C(te),g?.(te)},I=te=>{te.stopPropagation(),v?v(te):p&&p(te),y&&y(te)},L=h?.isEditable!==!1,V=!a&&(o||!L),H=["white-editor-tool-item","white-editor-tool-pop-item","flex","items-center","justify-center",n?"":"is-show-text",u&&L?"is-active":"",V?"is-disabled":"",m||""].filter(Boolean).join(" "),Y=b;return c==="arrow"?F.jsxs("button",{className:H,disabled:V,title:r,...w,children:[F.jsxs("div",{className:"flex items-center h-full",onClick:I,children:[F.jsxs("div",{children:[F.jsx("i",{className:`w-iconfont w-icon icon-${t}`,style:n?{fontSize:`${e}px`}:{}}),x]}),!n&&F.jsx("p",{className:"text-[13px] text-[#333639] ml-[3px]",children:r})]}),F.jsx(ol,{trigger:d,value:D,onVisibleChange:O,placement:f,disabled:V,hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow",content:Y,children:F.jsx("span",{className:"flex items-center justify-center w-full h-full",children:F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${D?"rotate-180":""}`})})})]}):F.jsx(ol,{trigger:d,value:D,onVisibleChange:O,placement:f,content:Y,children:x||F.jsx("button",{className:H,disabled:V,title:r,...w,children:F.jsxs("div",{className:"h-full gap-[5px]",children:[F.jsx("i",{className:`w-iconfont w-icon icon-${t}`,style:n?{fontSize:`${e}px`}:{}}),!n&&F.jsx("p",{className:"text-[12px] mt-2",children:r})]})})})};var Ea={},ep={},hA,DU;function doe(){if(DU)return hA;DU=1;var t=typeof sc=="object"&&sc&&sc.Object===Object&≻return hA=t,hA}var pA,OU;function wl(){if(OU)return pA;OU=1;var t=doe(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return pA=r,pA}var vA,RU;function U0(){if(RU)return vA;RU=1;var t=wl(),e=t.Symbol;return vA=e,vA}var gA,IU;function hVe(){if(IU)return gA;IU=1;var t=U0(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var s=r.call(o,i),l=o[i];try{o[i]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[i]=l:delete o[i]),c}return gA=a,gA}var mA,LU;function pVe(){if(LU)return mA;LU=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return mA=r,mA}var yA,PU;function uh(){if(PU)return yA;PU=1;var t=U0(),e=hVe(),r=pVe(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?e(s):r(s)}return yA=o,yA}var bA,BU;function xs(){if(BU)return bA;BU=1;var t=Array.isArray;return bA=t,bA}var xA,zU;function _u(){if(zU)return xA;zU=1;function t(e){return e!=null&&typeof e=="object"}return xA=t,xA}var wA,FU;function vVe(){if(FU)return wA;FU=1;var t=uh(),e=xs(),r=_u(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return wA=i,wA}var SA,VU;function gVe(){if(VU)return SA;VU=1;function t(e){return function(r,n,i){for(var a=-1,o=Object(r),s=i(r),l=s.length;l--;){var u=s[e?l:++a];if(n(o[u],u,o)===!1)break}return r}}return SA=t,SA}var _A,HU;function mVe(){if(HU)return _A;HU=1;var t=gVe(),e=t();return _A=e,_A}var TA,$U;function yVe(){if($U)return TA;$U=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return TA=t,TA}var CA,UU;function bVe(){if(UU)return CA;UU=1;var t=uh(),e=_u(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return CA=n,CA}var EA,jU;function hoe(){if(jU)return EA;jU=1;var t=bVe(),e=_u(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=t((function(){return arguments})())?t:function(o){return e(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return EA=a,EA}var zm={exports:{}},MA,GU;function xVe(){if(GU)return MA;GU=1;function t(){return!1}return MA=t,MA}zm.exports;var WU;function w4(){return WU||(WU=1,(function(t,e){var r=wl(),n=xVe(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,s=o?r.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;t.exports=u})(zm,zm.exports)),zm.exports}var AA,qU;function poe(){if(qU)return AA;qU=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return AA=r,AA}var kA,KU;function S4(){if(KU)return kA;KU=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return kA=e,kA}var NA,YU;function wVe(){if(YU)return NA;YU=1;var t=uh(),e=S4(),r=_u(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",d="[object RegExp]",h="[object Set]",p="[object String]",v="[object WeakMap]",g="[object ArrayBuffer]",m="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",w="[object Int16Array]",_="[object Int32Array]",C="[object Uint8Array]",D="[object Uint8ClampedArray]",O="[object Uint16Array]",I="[object Uint32Array]",L={};L[y]=L[b]=L[x]=L[w]=L[_]=L[C]=L[D]=L[O]=L[I]=!0,L[n]=L[i]=L[g]=L[a]=L[m]=L[o]=L[s]=L[l]=L[u]=L[c]=L[f]=L[d]=L[h]=L[p]=L[v]=!1;function V(H){return r(H)&&e(H.length)&&!!L[t(H)]}return NA=V,NA}var DA,XU;function _4(){if(XU)return DA;XU=1;function t(e){return function(r){return e(r)}}return DA=t,DA}var Fm={exports:{}};Fm.exports;var ZU;function T4(){return ZU||(ZU=1,(function(t,e){var r=doe(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,s=(function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();t.exports=s})(Fm,Fm.exports)),Fm.exports}var OA,JU;function voe(){if(JU)return OA;JU=1;var t=wVe(),e=_4(),r=T4(),n=r&&r.isTypedArray,i=n?e(n):t;return OA=i,OA}var RA,QU;function goe(){if(QU)return RA;QU=1;var t=yVe(),e=hoe(),r=xs(),n=w4(),i=poe(),a=voe(),o=Object.prototype,s=o.hasOwnProperty;function l(u,c){var f=r(u),d=!f&&e(u),h=!f&&!d&&n(u),p=!f&&!d&&!h&&a(u),v=f||d||h||p,g=v?t(u.length,String):[],m=g.length;for(var y in u)(c||s.call(u,y))&&!(v&&(y=="length"||h&&(y=="offset"||y=="parent")||p&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,m)))&&g.push(y);return g}return RA=l,RA}var IA,ej;function C4(){if(ej)return IA;ej=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return IA=e,IA}var LA,tj;function moe(){if(tj)return LA;tj=1;function t(e,r){return function(n){return e(r(n))}}return LA=t,LA}var PA,rj;function SVe(){if(rj)return PA;rj=1;var t=moe(),e=t(Object.keys,Object);return PA=e,PA}var BA,nj;function _Ve(){if(nj)return BA;nj=1;var t=C4(),e=SVe(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!t(a))return e(a);var o=[];for(var s in Object(a))n.call(a,s)&&s!="constructor"&&o.push(s);return o}return BA=i,BA}var zA,ij;function Jv(){if(ij)return zA;ij=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return zA=t,zA}var FA,aj;function yoe(){if(aj)return FA;aj=1;var t=uh(),e=Jv(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!e(s))return!1;var l=t(s);return l==n||l==i||l==r||l==a}return FA=o,FA}var VA,oj;function M2(){if(oj)return VA;oj=1;var t=yoe(),e=S4();function r(n){return n!=null&&e(n.length)&&!t(n)}return VA=r,VA}var HA,sj;function j0(){if(sj)return HA;sj=1;var t=goe(),e=_Ve(),r=M2();function n(i){return r(i)?t(i):e(i)}return HA=n,HA}var $A,lj;function boe(){if(lj)return $A;lj=1;var t=mVe(),e=j0();function r(n,i){return n&&t(n,i,e)}return $A=r,$A}var UA,uj;function xoe(){if(uj)return UA;uj=1;function t(e){return e}return UA=t,UA}var jA,cj;function TVe(){if(cj)return jA;cj=1;var t=xoe();function e(r){return typeof r=="function"?r:t}return jA=e,jA}var GA,fj;function E4(){if(fj)return GA;fj=1;var t=boe(),e=TVe();function r(n,i){return n&&t(n,e(i))}return GA=r,GA}var WA,dj;function M4(){if(dj)return WA;dj=1;var t=moe(),e=t(Object.getPrototypeOf,Object);return WA=e,WA}var qA,hj;function CVe(){if(hj)return qA;hj=1;var t=uh(),e=M4(),r=_u(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,l=o.call(Object);function u(c){if(!r(c)||t(c)!=n)return!1;var f=e(c);if(f===null)return!0;var d=s.call(f,"constructor")&&f.constructor;return typeof d=="function"&&d instanceof d&&o.call(d)==l}return qA=u,qA}var KA,pj;function woe(){if(pj)return KA;pj=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return KA=t,KA}var YA,vj;function EVe(){if(vj)return YA;vj=1;function t(){this.__data__=[],this.size=0}return YA=t,YA}var XA,gj;function A4(){if(gj)return XA;gj=1;function t(e,r){return e===r||e!==e&&r!==r}return XA=t,XA}var ZA,mj;function A2(){if(mj)return ZA;mj=1;var t=A4();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return ZA=e,ZA}var JA,yj;function MVe(){if(yj)return JA;yj=1;var t=A2(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return JA=n,JA}var QA,bj;function AVe(){if(bj)return QA;bj=1;var t=A2();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return QA=e,QA}var ek,xj;function kVe(){if(xj)return ek;xj=1;var t=A2();function e(r){return t(this.__data__,r)>-1}return ek=e,ek}var tk,wj;function NVe(){if(wj)return tk;wj=1;var t=A2();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return tk=e,tk}var rk,Sj;function k2(){if(Sj)return rk;Sj=1;var t=EVe(),e=MVe(),r=AVe(),n=kVe(),i=NVe();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,rk=a,rk}var nk,_j;function DVe(){if(_j)return nk;_j=1;var t=k2();function e(){this.__data__=new t,this.size=0}return nk=e,nk}var ik,Tj;function OVe(){if(Tj)return ik;Tj=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return ik=t,ik}var ak,Cj;function RVe(){if(Cj)return ak;Cj=1;function t(e){return this.__data__.get(e)}return ak=t,ak}var ok,Ej;function IVe(){if(Ej)return ok;Ej=1;function t(e){return this.__data__.has(e)}return ok=t,ok}var sk,Mj;function LVe(){if(Mj)return sk;Mj=1;var t=wl(),e=t["__core-js_shared__"];return sk=e,sk}var lk,Aj;function PVe(){if(Aj)return lk;Aj=1;var t=LVe(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return lk=r,lk}var uk,kj;function Soe(){if(kj)return uk;kj=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return uk=r,uk}var ck,Nj;function BVe(){if(Nj)return ck;Nj=1;var t=yoe(),e=PVe(),r=Jv(),n=Soe(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(d){if(!r(d)||e(d))return!1;var h=t(d)?c:a;return h.test(n(d))}return ck=f,ck}var fk,Dj;function zVe(){if(Dj)return fk;Dj=1;function t(e,r){return e?.[r]}return fk=t,fk}var dk,Oj;function ch(){if(Oj)return dk;Oj=1;var t=BVe(),e=zVe();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return dk=r,dk}var hk,Rj;function k4(){if(Rj)return hk;Rj=1;var t=ch(),e=wl(),r=t(e,"Map");return hk=r,hk}var pk,Ij;function N2(){if(Ij)return pk;Ij=1;var t=ch(),e=t(Object,"create");return pk=e,pk}var vk,Lj;function FVe(){if(Lj)return vk;Lj=1;var t=N2();function e(){this.__data__=t?t(null):{},this.size=0}return vk=e,vk}var gk,Pj;function VVe(){if(Pj)return gk;Pj=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return gk=t,gk}var mk,Bj;function HVe(){if(Bj)return mk;Bj=1;var t=N2(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var s=o[a];return s===e?void 0:s}return n.call(o,a)?o[a]:void 0}return mk=i,mk}var yk,zj;function $Ve(){if(zj)return yk;zj=1;var t=N2(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return yk=n,yk}var bk,Fj;function UVe(){if(Fj)return bk;Fj=1;var t=N2(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return bk=r,bk}var xk,Vj;function jVe(){if(Vj)return xk;Vj=1;var t=FVe(),e=VVe(),r=HVe(),n=$Ve(),i=UVe();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,xk=a,xk}var wk,Hj;function GVe(){if(Hj)return wk;Hj=1;var t=jVe(),e=k2(),r=k4();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return wk=n,wk}var Sk,$j;function WVe(){if($j)return Sk;$j=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Sk=t,Sk}var _k,Uj;function D2(){if(Uj)return _k;Uj=1;var t=WVe();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return _k=e,_k}var Tk,jj;function qVe(){if(jj)return Tk;jj=1;var t=D2();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return Tk=e,Tk}var Ck,Gj;function KVe(){if(Gj)return Ck;Gj=1;var t=D2();function e(r){return t(this,r).get(r)}return Ck=e,Ck}var Ek,Wj;function YVe(){if(Wj)return Ek;Wj=1;var t=D2();function e(r){return t(this,r).has(r)}return Ek=e,Ek}var Mk,qj;function XVe(){if(qj)return Mk;qj=1;var t=D2();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return Mk=e,Mk}var Ak,Kj;function N4(){if(Kj)return Ak;Kj=1;var t=GVe(),e=qVe(),r=KVe(),n=YVe(),i=XVe();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Ak=a,Ak}var kk,Yj;function ZVe(){if(Yj)return kk;Yj=1;var t=k2(),e=k4(),r=N4(),n=200;function i(a,o){var s=this.__data__;if(s instanceof t){var l=s.__data__;if(!e||l.length<n-1)return l.push([a,o]),this.size=++s.size,this;s=this.__data__=new r(l)}return s.set(a,o),this.size=s.size,this}return kk=i,kk}var Nk,Xj;function D4(){if(Xj)return Nk;Xj=1;var t=k2(),e=DVe(),r=OVe(),n=RVe(),i=IVe(),a=ZVe();function o(s){var l=this.__data__=new t(s);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,Nk=o,Nk}var Dk,Zj;function JVe(){if(Zj)return Dk;Zj=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Dk=e,Dk}var Ok,Jj;function QVe(){if(Jj)return Ok;Jj=1;function t(e){return this.__data__.has(e)}return Ok=t,Ok}var Rk,Qj;function eHe(){if(Qj)return Rk;Qj=1;var t=N4(),e=JVe(),r=QVe();function n(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new t;++a<o;)this.add(i[a])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,Rk=n,Rk}var Ik,eG;function tHe(){if(eG)return Ik;eG=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return Ik=t,Ik}var Lk,tG;function rHe(){if(tG)return Lk;tG=1;function t(e,r){return e.has(r)}return Lk=t,Lk}var Pk,rG;function _oe(){if(rG)return Pk;rG=1;var t=eHe(),e=tHe(),r=rHe(),n=1,i=2;function a(o,s,l,u,c,f){var d=l&n,h=o.length,p=s.length;if(h!=p&&!(d&&p>h))return!1;var v=f.get(o),g=f.get(s);if(v&&g)return v==s&&g==o;var m=-1,y=!0,b=l&i?new t:void 0;for(f.set(o,s),f.set(s,o);++m<h;){var x=o[m],w=s[m];if(u)var _=d?u(w,x,m,s,o,f):u(x,w,m,o,s,f);if(_!==void 0){if(_)continue;y=!1;break}if(b){if(!e(s,function(C,D){if(!r(b,D)&&(x===C||c(x,C,l,u,f)))return b.push(D)})){y=!1;break}}else if(!(x===w||c(x,w,l,u,f))){y=!1;break}}return f.delete(o),f.delete(s),y}return Pk=a,Pk}var Bk,nG;function Toe(){if(nG)return Bk;nG=1;var t=wl(),e=t.Uint8Array;return Bk=e,Bk}var zk,iG;function nHe(){if(iG)return zk;iG=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return zk=t,zk}var Fk,aG;function iHe(){if(aG)return Fk;aG=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return Fk=t,Fk}var Vk,oG;function aHe(){if(oG)return Vk;oG=1;var t=U0(),e=Toe(),r=A4(),n=_oe(),i=nHe(),a=iHe(),o=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",v="[object String]",g="[object Symbol]",m="[object ArrayBuffer]",y="[object DataView]",b=t?t.prototype:void 0,x=b?b.valueOf:void 0;function w(_,C,D,O,I,L,V){switch(D){case y:if(_.byteLength!=C.byteLength||_.byteOffset!=C.byteOffset)return!1;_=_.buffer,C=C.buffer;case m:return!(_.byteLength!=C.byteLength||!L(new e(_),new e(C)));case l:case u:case d:return r(+_,+C);case c:return _.name==C.name&&_.message==C.message;case h:case v:return _==C+"";case f:var H=i;case p:var Y=O&o;if(H||(H=a),_.size!=C.size&&!Y)return!1;var te=V.get(_);if(te)return te==C;O|=s,V.set(_,C);var Q=n(H(_),H(C),O,I,L,V);return V.delete(_),Q;case g:if(x)return x.call(_)==x.call(C)}return!1}return Vk=w,Vk}var Hk,sG;function Coe(){if(sG)return Hk;sG=1;function t(e,r){for(var n=-1,i=r.length,a=e.length;++n<i;)e[a+n]=r[n];return e}return Hk=t,Hk}var $k,lG;function Eoe(){if(lG)return $k;lG=1;var t=Coe(),e=xs();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return $k=r,$k}var Uk,uG;function oHe(){if(uG)return Uk;uG=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=0,o=[];++n<i;){var s=e[n];r(s,n,e)&&(o[a++]=s)}return o}return Uk=t,Uk}var jk,cG;function Moe(){if(cG)return jk;cG=1;function t(){return[]}return jk=t,jk}var Gk,fG;function O4(){if(fG)return Gk;fG=1;var t=oHe(),e=Moe(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),t(i(o),function(s){return n.call(o,s)}))}:e;return Gk=a,Gk}var Wk,dG;function Aoe(){if(dG)return Wk;dG=1;var t=Eoe(),e=O4(),r=j0();function n(i){return t(i,r,e)}return Wk=n,Wk}var qk,hG;function sHe(){if(hG)return qk;hG=1;var t=Aoe(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s,l,u,c){var f=s&e,d=t(a),h=d.length,p=t(o),v=p.length;if(h!=v&&!f)return!1;for(var g=h;g--;){var m=d[g];if(!(f?m in o:n.call(o,m)))return!1}var y=c.get(a),b=c.get(o);if(y&&b)return y==o&&b==a;var x=!0;c.set(a,o),c.set(o,a);for(var w=f;++g<h;){m=d[g];var _=a[m],C=o[m];if(l)var D=f?l(C,_,m,o,a,c):l(_,C,m,a,o,c);if(!(D===void 0?_===C||u(_,C,s,l,c):D)){x=!1;break}w||(w=m=="constructor")}if(x&&!w){var O=a.constructor,I=o.constructor;O!=I&&"constructor"in a&&"constructor"in o&&!(typeof O=="function"&&O instanceof O&&typeof I=="function"&&I instanceof I)&&(x=!1)}return c.delete(a),c.delete(o),x}return qk=i,qk}var Kk,pG;function lHe(){if(pG)return Kk;pG=1;var t=ch(),e=wl(),r=t(e,"DataView");return Kk=r,Kk}var Yk,vG;function uHe(){if(vG)return Yk;vG=1;var t=ch(),e=wl(),r=t(e,"Promise");return Yk=r,Yk}var Xk,gG;function cHe(){if(gG)return Xk;gG=1;var t=ch(),e=wl(),r=t(e,"Set");return Xk=r,Xk}var Zk,mG;function fHe(){if(mG)return Zk;mG=1;var t=ch(),e=wl(),r=t(e,"WeakMap");return Zk=r,Zk}var Jk,yG;function O2(){if(yG)return Jk;yG=1;var t=lHe(),e=k4(),r=uHe(),n=cHe(),i=fHe(),a=uh(),o=Soe(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",f="[object WeakMap]",d="[object DataView]",h=o(t),p=o(e),v=o(r),g=o(n),m=o(i),y=a;return(t&&y(new t(new ArrayBuffer(1)))!=d||e&&y(new e)!=s||r&&y(r.resolve())!=u||n&&y(new n)!=c||i&&y(new i)!=f)&&(y=function(b){var x=a(b),w=x==l?b.constructor:void 0,_=w?o(w):"";if(_)switch(_){case h:return d;case p:return s;case v:return u;case g:return c;case m:return f}return x}),Jk=y,Jk}var Qk,bG;function dHe(){if(bG)return Qk;bG=1;var t=D4(),e=_oe(),r=aHe(),n=sHe(),i=O2(),a=xs(),o=w4(),s=voe(),l=1,u="[object Arguments]",c="[object Array]",f="[object Object]",d=Object.prototype,h=d.hasOwnProperty;function p(v,g,m,y,b,x){var w=a(v),_=a(g),C=w?c:i(v),D=_?c:i(g);C=C==u?f:C,D=D==u?f:D;var O=C==f,I=D==f,L=C==D;if(L&&o(v)){if(!o(g))return!1;w=!0,O=!1}if(L&&!O)return x||(x=new t),w||s(v)?e(v,g,m,y,b,x):r(v,g,C,m,y,b,x);if(!(m&l)){var V=O&&h.call(v,"__wrapped__"),H=I&&h.call(g,"__wrapped__");if(V||H){var Y=V?v.value():v,te=H?g.value():g;return x||(x=new t),b(Y,te,m,y,x)}}return L?(x||(x=new t),n(v,g,m,y,b,x)):!1}return Qk=p,Qk}var eN,xG;function koe(){if(xG)return eN;xG=1;var t=dHe(),e=_u();function r(n,i,a,o,s){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,a,o,r,s)}return eN=r,eN}var tN,wG;function hHe(){if(wG)return tN;wG=1;var t=D4(),e=koe(),r=1,n=2;function i(a,o,s,l){var u=s.length,c=u,f=!l;if(a==null)return!c;for(a=Object(a);u--;){var d=s[u];if(f&&d[2]?d[1]!==a[d[0]]:!(d[0]in a))return!1}for(;++u<c;){d=s[u];var h=d[0],p=a[h],v=d[1];if(f&&d[2]){if(p===void 0&&!(h in a))return!1}else{var g=new t;if(l)var m=l(p,v,h,a,o,g);if(!(m===void 0?e(v,p,r|n,l,g):m))return!1}}return!0}return tN=i,tN}var rN,SG;function Noe(){if(SG)return rN;SG=1;var t=Jv();function e(r){return r===r&&!t(r)}return rN=e,rN}var nN,_G;function pHe(){if(_G)return nN;_G=1;var t=Noe(),e=j0();function r(n){for(var i=e(n),a=i.length;a--;){var o=i[a],s=n[o];i[a]=[o,s,t(s)]}return i}return nN=r,nN}var iN,TG;function Doe(){if(TG)return iN;TG=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return iN=t,iN}var aN,CG;function vHe(){if(CG)return aN;CG=1;var t=hHe(),e=pHe(),r=Doe();function n(i){var a=e(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(o){return o===i||t(o,i,a)}}return aN=n,aN}var oN,EG;function R4(){if(EG)return oN;EG=1;var t=uh(),e=_u(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return oN=n,oN}var sN,MG;function I4(){if(MG)return sN;MG=1;var t=xs(),e=R4(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return sN=i,sN}var lN,AG;function gHe(){if(AG)return lN;AG=1;var t=N4(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],l=a.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return a.cache=l.set(s,u)||l,u};return a.cache=new(r.Cache||t),a}return r.Cache=t,lN=r,lN}var uN,kG;function mHe(){if(kG)return uN;kG=1;var t=gHe(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return uN=r,uN}var cN,NG;function yHe(){if(NG)return cN;NG=1;var t=mHe(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,s,l,u){a.push(l?u.replace(r,"$1"):s||o)}),a});return cN=n,cN}var fN,DG;function bHe(){if(DG)return fN;DG=1;var t=U0(),e=woe(),r=xs(),n=R4(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return e(s,o)+"";if(n(s))return a?a.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return fN=o,fN}var dN,OG;function xHe(){if(OG)return dN;OG=1;var t=bHe();function e(r){return r==null?"":t(r)}return dN=e,dN}var hN,RG;function Ooe(){if(RG)return hN;RG=1;var t=xs(),e=I4(),r=yHe(),n=xHe();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return hN=i,hN}var pN,IG;function R2(){if(IG)return pN;IG=1;var t=R4();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return pN=e,pN}var vN,LG;function Roe(){if(LG)return vN;LG=1;var t=Ooe(),e=R2();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return vN=r,vN}var gN,PG;function wHe(){if(PG)return gN;PG=1;var t=Roe();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return gN=e,gN}var mN,BG;function SHe(){if(BG)return mN;BG=1;function t(e,r){return e!=null&&r in Object(e)}return mN=t,mN}var yN,zG;function _He(){if(zG)return yN;zG=1;var t=Ooe(),e=hoe(),r=xs(),n=poe(),i=S4(),a=R2();function o(s,l,u){l=t(l,s);for(var c=-1,f=l.length,d=!1;++c<f;){var h=a(l[c]);if(!(d=s!=null&&u(s,h)))break;s=s[h]}return d||++c!=f?d:(f=s==null?0:s.length,!!f&&i(f)&&n(h,f)&&(r(s)||e(s)))}return yN=o,yN}var bN,FG;function THe(){if(FG)return bN;FG=1;var t=SHe(),e=_He();function r(n,i){return n!=null&&e(n,i,t)}return bN=r,bN}var xN,VG;function CHe(){if(VG)return xN;VG=1;var t=koe(),e=wHe(),r=THe(),n=I4(),i=Noe(),a=Doe(),o=R2(),s=1,l=2;function u(c,f){return n(c)&&i(f)?a(o(c),f):function(d){var h=e(d,c);return h===void 0&&h===f?r(d,c):t(f,h,s|l)}}return xN=u,xN}var wN,HG;function EHe(){if(HG)return wN;HG=1;function t(e){return function(r){return r?.[e]}}return wN=t,wN}var SN,$G;function MHe(){if($G)return SN;$G=1;var t=Roe();function e(r){return function(n){return t(n,r)}}return SN=e,SN}var _N,UG;function AHe(){if(UG)return _N;UG=1;var t=EHe(),e=MHe(),r=I4(),n=R2();function i(a){return r(a)?t(n(a)):e(a)}return _N=i,_N}var TN,jG;function kHe(){if(jG)return TN;jG=1;var t=vHe(),e=CHe(),r=xoe(),n=xs(),i=AHe();function a(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):i(o)}return TN=a,TN}var CN,GG;function NHe(){if(GG)return CN;GG=1;var t=M2();function e(r,n){return function(i,a){if(i==null)return i;if(!t(i))return r(i,a);for(var o=i.length,s=n?o:-1,l=Object(i);(n?s--:++s<o)&&a(l[s],s,l)!==!1;);return i}}return CN=e,CN}var EN,WG;function DHe(){if(WG)return EN;WG=1;var t=boe(),e=NHe(),r=e(t);return EN=r,EN}var MN,qG;function OHe(){if(qG)return MN;qG=1;var t=DHe(),e=M2();function r(n,i){var a=-1,o=e(n)?Array(n.length):[];return t(n,function(s,l,u){o[++a]=i(s,l,u)}),o}return MN=r,MN}var AN,KG;function RHe(){if(KG)return AN;KG=1;var t=woe(),e=kHe(),r=OHe(),n=xs();function i(a,o){var s=n(a)?t:r;return s(a,e(o,3))}return AN=i,AN}var YG;function IHe(){if(YG)return ep;YG=1,Object.defineProperty(ep,"__esModule",{value:!0}),ep.flattenNames=void 0;var t=vVe(),e=l(t),r=E4(),n=l(r),i=CVe(),a=l(i),o=RHe(),s=l(o);function l(c){return c&&c.__esModule?c:{default:c}}var u=ep.flattenNames=function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,s.default)(f,function(h){Array.isArray(h)?c(h).map(function(p){return d.push(p)}):(0,a.default)(h)?(0,n.default)(h,function(p,v){p===!0&&d.push(v),d.push(v+"-"+p)}):(0,e.default)(h)&&d.push(h)}),d};return ep.default=u,ep}var tp={},kN,XG;function LHe(){if(XG)return kN;XG=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i&&r(e[n],n,e)!==!1;);return e}return kN=t,kN}var NN,ZG;function PHe(){if(ZG)return NN;ZG=1;var t=ch(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return NN=e,NN}var DN,JG;function Ioe(){if(JG)return DN;JG=1;var t=PHe();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return DN=e,DN}var ON,QG;function Loe(){if(QG)return ON;QG=1;var t=Ioe(),e=A4(),r=Object.prototype,n=r.hasOwnProperty;function i(a,o,s){var l=a[o];(!(n.call(a,o)&&e(l,s))||s===void 0&&!(o in a))&&t(a,o,s)}return ON=i,ON}var RN,eW;function I2(){if(eW)return RN;eW=1;var t=Loe(),e=Ioe();function r(n,i,a,o){var s=!a;a||(a={});for(var l=-1,u=i.length;++l<u;){var c=i[l],f=o?o(a[c],n[c],c,a,n):void 0;f===void 0&&(f=n[c]),s?e(a,c,f):t(a,c,f)}return a}return RN=r,RN}var IN,tW;function BHe(){if(tW)return IN;tW=1;var t=I2(),e=j0();function r(n,i){return n&&t(i,e(i),n)}return IN=r,IN}var LN,rW;function zHe(){if(rW)return LN;rW=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return LN=t,LN}var PN,nW;function FHe(){if(nW)return PN;nW=1;var t=Jv(),e=C4(),r=zHe(),n=Object.prototype,i=n.hasOwnProperty;function a(o){if(!t(o))return r(o);var s=e(o),l=[];for(var u in o)u=="constructor"&&(s||!i.call(o,u))||l.push(u);return l}return PN=a,PN}var BN,iW;function L4(){if(iW)return BN;iW=1;var t=goe(),e=FHe(),r=M2();function n(i){return r(i)?t(i,!0):e(i)}return BN=n,BN}var zN,aW;function VHe(){if(aW)return zN;aW=1;var t=I2(),e=L4();function r(n,i){return n&&t(i,e(i),n)}return zN=r,zN}var Vm={exports:{}};Vm.exports;var oW;function HHe(){return oW||(oW=1,(function(t,e){var r=wl(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var f=u.length,d=s?s(f):new u.constructor(f);return u.copy(d),d}t.exports=l})(Vm,Vm.exports)),Vm.exports}var FN,sW;function $He(){if(sW)return FN;sW=1;function t(e,r){var n=-1,i=e.length;for(r||(r=Array(i));++n<i;)r[n]=e[n];return r}return FN=t,FN}var VN,lW;function UHe(){if(lW)return VN;lW=1;var t=I2(),e=O4();function r(n,i){return t(n,e(n),i)}return VN=r,VN}var HN,uW;function Poe(){if(uW)return HN;uW=1;var t=Coe(),e=M4(),r=O4(),n=Moe(),i=Object.getOwnPropertySymbols,a=i?function(o){for(var s=[];o;)t(s,r(o)),o=e(o);return s}:n;return HN=a,HN}var $N,cW;function jHe(){if(cW)return $N;cW=1;var t=I2(),e=Poe();function r(n,i){return t(n,e(n),i)}return $N=r,$N}var UN,fW;function GHe(){if(fW)return UN;fW=1;var t=Eoe(),e=Poe(),r=L4();function n(i){return t(i,r,e)}return UN=n,UN}var jN,dW;function WHe(){if(dW)return jN;dW=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var i=n.length,a=new n.constructor(i);return i&&typeof n[0]=="string"&&e.call(n,"index")&&(a.index=n.index,a.input=n.input),a}return jN=r,jN}var GN,hW;function P4(){if(hW)return GN;hW=1;var t=Toe();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return GN=e,GN}var WN,pW;function qHe(){if(pW)return WN;pW=1;var t=P4();function e(r,n){var i=n?t(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.byteLength)}return WN=e,WN}var qN,vW;function KHe(){if(vW)return qN;vW=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return qN=e,qN}var KN,gW;function YHe(){if(gW)return KN;gW=1;var t=U0(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(i){return r?Object(r.call(i)):{}}return KN=n,KN}var YN,mW;function XHe(){if(mW)return YN;mW=1;var t=P4();function e(r,n){var i=n?t(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.length)}return YN=e,YN}var XN,yW;function ZHe(){if(yW)return XN;yW=1;var t=P4(),e=qHe(),r=KHe(),n=YHe(),i=XHe(),a="[object Boolean]",o="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",f="[object String]",d="[object Symbol]",h="[object ArrayBuffer]",p="[object DataView]",v="[object Float32Array]",g="[object Float64Array]",m="[object Int8Array]",y="[object Int16Array]",b="[object Int32Array]",x="[object Uint8Array]",w="[object Uint8ClampedArray]",_="[object Uint16Array]",C="[object Uint32Array]";function D(O,I,L){var V=O.constructor;switch(I){case h:return t(O);case a:case o:return new V(+O);case p:return e(O,L);case v:case g:case m:case y:case b:case x:case w:case _:case C:return i(O,L);case s:return new V;case l:case f:return new V(O);case u:return r(O);case c:return new V;case d:return n(O)}}return XN=D,XN}var ZN,bW;function JHe(){if(bW)return ZN;bW=1;var t=Jv(),e=Object.create,r=(function(){function n(){}return function(i){if(!t(i))return{};if(e)return e(i);n.prototype=i;var a=new n;return n.prototype=void 0,a}})();return ZN=r,ZN}var JN,xW;function QHe(){if(xW)return JN;xW=1;var t=JHe(),e=M4(),r=C4();function n(i){return typeof i.constructor=="function"&&!r(i)?t(e(i)):{}}return JN=n,JN}var QN,wW;function e$e(){if(wW)return QN;wW=1;var t=O2(),e=_u(),r="[object Map]";function n(i){return e(i)&&t(i)==r}return QN=n,QN}var eD,SW;function t$e(){if(SW)return eD;SW=1;var t=e$e(),e=_4(),r=T4(),n=r&&r.isMap,i=n?e(n):t;return eD=i,eD}var tD,_W;function r$e(){if(_W)return tD;_W=1;var t=O2(),e=_u(),r="[object Set]";function n(i){return e(i)&&t(i)==r}return tD=n,tD}var rD,TW;function n$e(){if(TW)return rD;TW=1;var t=r$e(),e=_4(),r=T4(),n=r&&r.isSet,i=n?e(n):t;return rD=i,rD}var nD,CW;function i$e(){if(CW)return nD;CW=1;var t=D4(),e=LHe(),r=Loe(),n=BHe(),i=VHe(),a=HHe(),o=$He(),s=UHe(),l=jHe(),u=Aoe(),c=GHe(),f=O2(),d=WHe(),h=ZHe(),p=QHe(),v=xs(),g=w4(),m=t$e(),y=Jv(),b=n$e(),x=j0(),w=L4(),_=1,C=2,D=4,O="[object Arguments]",I="[object Array]",L="[object Boolean]",V="[object Date]",H="[object Error]",Y="[object Function]",te="[object GeneratorFunction]",Q="[object Map]",ue="[object Number]",ie="[object Object]",Se="[object RegExp]",me="[object Set]",ae="[object String]",Te="[object Symbol]",Be="[object WeakMap]",He="[object ArrayBuffer]",qe="[object DataView]",ot="[object Float32Array]",st="[object Float64Array]",he="[object Int8Array]",Ce="[object Int16Array]",ve="[object Int32Array]",xe="[object Uint8Array]",le="[object Uint8ClampedArray]",Ee="[object Uint16Array]",fe="[object Uint32Array]",Me={};Me[O]=Me[I]=Me[He]=Me[qe]=Me[L]=Me[V]=Me[ot]=Me[st]=Me[he]=Me[Ce]=Me[ve]=Me[Q]=Me[ue]=Me[ie]=Me[Se]=Me[me]=Me[ae]=Me[Te]=Me[xe]=Me[le]=Me[Ee]=Me[fe]=!0,Me[H]=Me[Y]=Me[Be]=!1;function Ne(Re,Ue,Qe,lt,vt,Bt){var zt,Et=Ue&_,yr=Ue&C,hr=Ue&D;if(Qe&&(zt=vt?Qe(Re,lt,vt,Bt):Qe(Re)),zt!==void 0)return zt;if(!y(Re))return Re;var pr=v(Re);if(pr){if(zt=d(Re),!Et)return o(Re,zt)}else{var Tr=f(Re),Ur=Tr==Y||Tr==te;if(g(Re))return a(Re,Et);if(Tr==ie||Tr==O||Ur&&!vt){if(zt=yr||Ur?{}:p(Re),!Et)return yr?l(Re,i(zt,Re)):s(Re,n(zt,Re))}else{if(!Me[Tr])return vt?Re:{};zt=h(Re,Tr,Et)}}Bt||(Bt=new t);var Zr=Bt.get(Re);if(Zr)return Zr;Bt.set(Re,zt),b(Re)?Re.forEach(function(Dr){zt.add(Ne(Dr,Ue,Qe,Dr,Re,Bt))}):m(Re)&&Re.forEach(function(Dr,Ze){zt.set(Ze,Ne(Dr,Ue,Qe,Ze,Re,Bt))});var jr=hr?yr?c:u:yr?w:x,un=pr?void 0:jr(Re);return e(un||Re,function(Dr,Ze){un&&(Ze=Dr,Dr=Re[Ze]),r(zt,Ze,Ne(Dr,Ue,Qe,Ze,Re,Bt))}),zt}return nD=Ne,nD}var iD,EW;function a$e(){if(EW)return iD;EW=1;var t=i$e(),e=1,r=4;function n(i){return t(i,e|r)}return iD=n,iD}var MW;function o$e(){if(MW)return tp;MW=1,Object.defineProperty(tp,"__esModule",{value:!0}),tp.mergeClasses=void 0;var t=E4(),e=a(t),r=a$e(),n=a(r),i=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(s[c]=u[c])}return s};function a(s){return s&&s.__esModule?s:{default:s}}var o=tp.mergeClasses=function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=l.default&&(0,n.default)(l.default)||{};return u.map(function(f){var d=l[f];return d&&(0,e.default)(d,function(h,p){c[p]||(c[p]={}),c[p]=i({},c[p],d[p])}),f}),c};return tp.default=o,tp}var rp={},AW;function s$e(){if(AW)return rp;AW=1,Object.defineProperty(rp,"__esModule",{value:!0}),rp.autoprefix=void 0;var t=E4(),e=n(t),r=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])}return o};function n(o){return o&&o.__esModule?o:{default:o}}var i={borderRadius:function(s){return{msBorderRadius:s,MozBorderRadius:s,OBorderRadius:s,WebkitBorderRadius:s,borderRadius:s}},boxShadow:function(s){return{msBoxShadow:s,MozBoxShadow:s,OBoxShadow:s,WebkitBoxShadow:s,boxShadow:s}},userSelect:function(s){return{WebkitTouchCallout:s,KhtmlUserSelect:s,MozUserSelect:s,msUserSelect:s,WebkitUserSelect:s,userSelect:s}},flex:function(s){return{WebkitBoxFlex:s,MozBoxFlex:s,WebkitFlex:s,msFlex:s,flex:s}},flexBasis:function(s){return{WebkitFlexBasis:s,flexBasis:s}},justifyContent:function(s){return{WebkitJustifyContent:s,justifyContent:s}},transition:function(s){return{msTransition:s,MozTransition:s,OTransition:s,WebkitTransition:s,transition:s}},transform:function(s){return{msTransform:s,MozTransform:s,OTransform:s,WebkitTransform:s,transform:s}},absolute:function(s){var l=s&&s.split(" ");return{position:"absolute",top:l&&l[0],right:l&&l[1],bottom:l&&l[2],left:l&&l[3]}},extend:function(s,l){var u=l[s];return u||{extend:s}}},a=rp.autoprefix=function(s){var l={};return(0,e.default)(s,function(u,c){var f={};(0,e.default)(u,function(d,h){var p=i[h];p?f=r({},f,p(d)):f[h]=d}),l[c]=f}),l};return rp.default=a,rp}var np={},kW;function l$e(){if(kW)return np;kW=1,Object.defineProperty(np,"__esModule",{value:!0}),np.hover=void 0;var t=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(l[f]=c[f])}return l},e=j,r=n(e);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function a(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function o(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=np.hover=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(f){o(d,f);function d(){var h,p,v,g;i(this,d);for(var m=arguments.length,y=Array(m),b=0;b<m;b++)y[b]=arguments[b];return g=(p=(v=a(this,(h=d.__proto__||Object.getPrototypeOf(d)).call.apply(h,[this].concat(y))),v),v.state={hover:!1},v.handleMouseOver=function(){return v.setState({hover:!0})},v.handleMouseOut=function(){return v.setState({hover:!1})},v.render=function(){return r.default.createElement(c,{onMouseOver:v.handleMouseOver,onMouseOut:v.handleMouseOut},r.default.createElement(u,t({},v.props,v.state)))},p),a(v,g)}return d})(r.default.Component)};return np.default=s,np}var ip={},NW;function u$e(){if(NW)return ip;NW=1,Object.defineProperty(ip,"__esModule",{value:!0}),ip.active=void 0;var t=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(l[f]=c[f])}return l},e=j,r=n(e);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function a(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function o(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=ip.active=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(f){o(d,f);function d(){var h,p,v,g;i(this,d);for(var m=arguments.length,y=Array(m),b=0;b<m;b++)y[b]=arguments[b];return g=(p=(v=a(this,(h=d.__proto__||Object.getPrototypeOf(d)).call.apply(h,[this].concat(y))),v),v.state={active:!1},v.handleMouseDown=function(){return v.setState({active:!0})},v.handleMouseUp=function(){return v.setState({active:!1})},v.render=function(){return r.default.createElement(c,{onMouseDown:v.handleMouseDown,onMouseUp:v.handleMouseUp},r.default.createElement(u,t({},v.props,v.state)))},p),a(v,g)}return d})(r.default.Component)};return ip.default=s,ip}var fx={},DW;function c$e(){if(DW)return fx;DW=1,Object.defineProperty(fx,"__esModule",{value:!0});var t=function(r,n){var i={},a=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i[s]=l};return r===0&&a("first-child"),r===n-1&&a("last-child"),(r===0||r%2===0)&&a("even"),Math.abs(r%2)===1&&a("odd"),a("nth-child",r),i};return fx.default=t,fx}var OW;function f$e(){if(OW)return Ea;OW=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.ReactCSS=Ea.loop=Ea.handleActive=Ea.handleHover=Ea.hover=void 0;var t=IHe(),e=d(t),r=o$e(),n=d(r),i=s$e(),a=d(i),o=l$e(),s=d(o),l=u$e(),u=d(l),c=c$e(),f=d(c);function d(p){return p&&p.__esModule?p:{default:p}}Ea.hover=s.default,Ea.handleHover=s.default,Ea.handleActive=u.default,Ea.loop=f.default;var h=Ea.ReactCSS=function(v){for(var g=arguments.length,m=Array(g>1?g-1:0),y=1;y<g;y++)m[y-1]=arguments[y];var b=(0,e.default)(m),x=(0,n.default)(v,b);return(0,a.default)(x)};return Ea.default=h,Ea}var B4=f$e();const Nr=m0(B4);var d$e=function(e,r,n,i,a){var o=a.clientWidth,s=a.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,u=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(a.getBoundingClientRect().left+window.pageXOffset),f=u-(a.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(f<0?d=0:f>s?d=1:d=Math.round(f*100/s)/100,r.a!==d)return{h:r.h,s:r.s,l:r.l,a:d,source:"rgb"}}else{var h=void 0;if(c<0?h=0:c>o?h=1:h=Math.round(c*100/o)/100,i!==h)return{h:r.h,s:r.s,l:r.l,a:h,source:"rgb"}}return null},aD={},h$e=function(e,r,n,i){if(typeof document>"u"&&!i)return null;var a=i?new i:document.createElement("canvas");a.width=n*2,a.height=n*2;var o=a.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,a.width,a.height),o.fillStyle=r,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),a.toDataURL()):null},p$e=function(e,r,n,i){var a=e+"-"+r+"-"+n+(i?"-server":"");if(aD[a])return aD[a];var o=h$e(e,r,n,i);return aD[a]=o,o},RW=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Qv=function(e){var r=e.white,n=e.grey,i=e.size,a=e.renderers,o=e.borderRadius,s=e.boxShadow,l=e.children,u=Nr({default:{grid:{borderRadius:o,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+p$e(r,n,i,a.canvas)+") center left"}}});return j.isValidElement(l)?j.cloneElement(l,RW({},l.props,{style:RW({},l.props.style,u.grid)})):j.createElement("div",{style:u.grid})};Qv.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var v$e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},g$e=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function m$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IW(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function y$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var z4=(function(t){y$e(e,t);function e(){var r,n,i,a;m$e(this,e);for(var o=arguments.length,s=Array(o),l=0;l<o;l++)s[l]=arguments[l];return a=(n=(i=IW(this,(r=e.__proto__||Object.getPrototypeOf(e)).call.apply(r,[this].concat(s))),i),i.handleChange=function(u){var c=d$e(u,i.props.hsl,i.props.direction,i.props.a,i.container);c&&typeof i.props.onChange=="function"&&i.props.onChange(c,u)},i.handleMouseDown=function(u){i.handleChange(u),window.addEventListener("mousemove",i.handleChange),window.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},i.unbindEventListeners=function(){window.removeEventListener("mousemove",i.handleChange),window.removeEventListener("mouseup",i.handleMouseUp)},n),IW(i,a)}return g$e(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var n=this,i=this.props.rgb,a=Nr({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+i.r+","+i.g+","+i.b+`, 0) 0%,
|
|
333
333
|
rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:i.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+i.r+","+i.g+","+i.b+`, 0) 0%,
|
|
334
334
|
rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)"},pointer:{left:0,top:i.a*100+"%"}},overwrite:v$e({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return j.createElement("div",{style:a.alpha},j.createElement("div",{style:a.checkboard},j.createElement(Qv,{renderers:this.props.renderers})),j.createElement("div",{style:a.gradient}),j.createElement("div",{style:a.container,ref:function(s){return n.container=s},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},j.createElement("div",{style:a.pointer},this.props.pointer?j.createElement(this.props.pointer,this.props):j.createElement("div",{style:a.slider}))))}}]),e})(j.PureComponent||j.Component),b$e=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function x$e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S$e(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function _$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var T$e=1,Boe=38,C$e=40,E$e=[Boe,C$e],M$e=function(e){return E$e.indexOf(e)>-1},A$e=function(e){return Number(String(e).replace(/%/g,""))},k$e=1,Qr=(function(t){_$e(e,t);function e(r){w$e(this,e);var n=S$e(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(i){n.setUpdatedValue(i.target.value,i)},n.handleKeyDown=function(i){var a=A$e(i.target.value);if(!isNaN(a)&&M$e(i.keyCode)){var o=n.getArrowOffset(),s=i.keyCode===Boe?a+o:a-o;n.setUpdatedValue(s,i)}},n.handleDrag=function(i){if(n.props.dragLabel){var a=Math.round(n.props.value+i.movementX);a>=0&&a<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(a),i)}},n.handleMouseDown=function(i){n.props.dragLabel&&(i.preventDefault(),n.handleDrag(i),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(r.value).toUpperCase(),blurValue:String(r.value).toUpperCase()},n.inputId="rc-editable-input-"+k$e++,n}return b$e(e,[{key:"componentDidUpdate",value:function(n,i){this.props.value!==this.state.value&&(n.value!==this.props.value||i.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(n){return x$e({},this.props.label,n)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||T$e}},{key:"setUpdatedValue",value:function(n,i){var a=this.props.label?this.getValueObjectWithLabel(n):n;this.props.onChange&&this.props.onChange(a,i),this.setState({value:n})}},{key:"render",value:function(){var n=this,i=Nr({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return j.createElement("div",{style:i.wrap},j.createElement("input",{id:this.inputId,style:i.input,ref:function(o){return n.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?j.createElement("label",{htmlFor:this.inputId,style:i.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e})(j.PureComponent||j.Component),N$e=function(e,r,n,i){var a=i.clientWidth,o=i.clientHeight,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=s-(i.getBoundingClientRect().left+window.pageXOffset),c=l-(i.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var f=void 0;if(c<0)f=359;else if(c>o)f=0;else{var d=-(c*100/o)+100;f=360*d/100}if(n.h!==f)return{h:f,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var h=void 0;if(u<0)h=0;else if(u>a)h=359;else{var p=u*100/a;h=360*p/100}if(n.h!==h)return{h,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null},D$e=(function(){function t(e,r){for(var n=0;n<r.length;n++){var i=r[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}})();function O$e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function LW(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function R$e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var eg=(function(t){R$e(e,t);function e(){var r,n,i,a;O$e(this,e);for(var o=arguments.length,s=Array(o),l=0;l<o;l++)s[l]=arguments[l];return a=(n=(i=LW(this,(r=e.__proto__||Object.getPrototypeOf(e)).call.apply(r,[this].concat(s))),i),i.handleChange=function(u){var c=N$e(u,i.props.direction,i.props.hsl,i.container);c&&typeof i.props.onChange=="function"&&i.props.onChange(c,u)},i.handleMouseDown=function(u){i.handleChange(u),window.addEventListener("mousemove",i.handleChange),window.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},n),LW(i,a)}return D$e(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var n=this,i=this.props.direction,a=i===void 0?"horizontal":i,o=Nr({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:a==="vertical"});return j.createElement("div",{style:o.hue},j.createElement("div",{className:"hue-"+a,style:o.container,ref:function(l){return n.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},j.createElement("style",null,`
|
|
335
335
|
.hue-horizontal {
|
|
@@ -395,7 +395,7 @@ Valid keys: `+JSON.stringify(Object.keys(me),null," "));var le=xe(st,ve,He,qe,o
|
|
|
395
395
|
</g>`}],uq=[{label:"默认",value:"disc",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
|
|
396
396
|
<path d="M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"></path>`},{label:"空心圆",value:"circle",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
|
|
397
397
|
<path d="M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"></path>`},{label:"实心方块",value:"square",code:`<path d="M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z" fill-opacity=".163"></path>
|
|
398
|
-
<path d="M14 27v6H8v-6h6zm0-9v6H8v-6h6zm0-9v6H8V9h6z"></path>`}],dje=[{label:"表情与角色",items:"😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 😉 😊 😇 🥰 😍 🤩 😘 😗 😚 😙 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🤫 🤔 🤐 🤨 😐 😑 😶 😶 😏 😒 🙄 😬 😮 🤥 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤮 🤧 🥵 🥶 🥴 😵 😵💫 🤯 🤠 🥳 😎 🤓 🧐 😕 😟 🙁 ☹️ 😮 😯 😲 😳 🥺 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬 😈 👿 💀 ☠️ 💩 🤡 👹 👺 👻 👽 👾 🤖 👋 🤚 🖐️ ✋ 🖖 👌 🤏 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 🖕 👇 ☝️ 👍 👎 ✊ 👊 🤛 🤜 👏 🙌 👐 🤲 🤝 🙏 ✍️ 💅 🤳 💪 🦾 🦿 🦵 🦶 👂 🦻"},{label:"动物与自然",items:"🐵 🐒 🦍 🦧 🐶 🐕 🦮 🐕🦺 🐩 🐺 🦊 🦝 🐱 🐈 🐈⬛ 🦁 🐯 🐅 🐆 🐴 🐎 🦄 🦓 🦌 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🦙 🦒 🐘 🦏 🦛 🐭 🐁 🐀 🐹 🐰 🐇 🐿️ 🦔 🦇 🐻 🐻❄️ 🐨 🐼 🦥 🦦 🦨 🦘 🦡 🐾 🦃 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🕊️ 🦅 🦆 🦢 🦉 🦩 🦚 🦜 🐸 🐊 🐢 🦎 🐍 🐲 🐉 🦕 🦖 🐳 🐋 🐬 🦭 🐟 🐠 🐡 🦈 🐙 🐚 🐌 🦋 🐛 🐜 🐝 🐞 🦗 🕷️ 🕸️ 🦂 🦟 🦠 💐 🌸 💮 🏵️ 🌹 🥀 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 ☘️ 🍀 🍁 🍂 🍃 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 ☀️ 🌝 🌞 🪐 🌟 🌠 🌌 ☁️ ⛅ ⛈️ 🌤️ 🌥️ 🌦️ 🌧️ 🌨️ 🌩️ 🌪️ 🌫️ 🌬️ 🌀 🌈 🌂 ☂️ ☔ ⛱️ ⚡ ❄️ ☃️ ⛄ ☄️ 🔥 💧 🌊"},{label:"食物与食品",items:"🍇 🍉 🍊 🍋 🍌 🍍 🥭 🍎 🍏 🍐 🍑 🍒 🍓 🥝 🍅 🥥 🥑 🍆 🥔 🥕 🌽 🌶️ 🥬 🥦 🧄 🧅 🍄 🥜 🌰 🍞 🥐 🥖 🥨 🥯 🥞 🧇 🧀 🍖 🍗 🥩 🥓 🍔 🍟 🍕 🌭 🥪 🌮 🌯 🥙 🧆 🥚 🍳 🥘 🍲 🥣 🥗 🍿 🧈 🧂 🥫 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🥮 🍡 🥟 🥠 🥡 🦀 🦞 🦐 🦑 🦪 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🧁 🥧 🍫 🍬 🍭 🍮 🍯 🍼 🥛 ☕ 🍵 🍶 🍾 🍷 🍸 🍹 🍺 🍻 🥂 🥃 🥤 🧃 🧉 🧊 🥢 🍽️ 🍴 🥄 🔪 🏺"},{label:"活动",items:"🧧 🎁 🎄 🧨 ✨ 🎈 🎉 🏮 🎗️ 🎟️ 🎫 🎖️ 🏆 🏅 🥇 🥈 🥉 ⚽ ⚾ 🥎 🏀 🏐 🏈 🏉 🎾 🥏 🎳 🏏 🏑 🏒 🥍 🏓 🏸 🥊 🥋 🥅 ⛳ ⛸️ 🎣 🤿 🎽 🎿 🛷 🥌 🎯 🪀 🪁 🎱 🔮 🧿 🎮 🕹️ 🎰 🎲 🧩 🧸 ♟️ 🃏 🀄 🎴 🎭 🖼️ 🎨 🧵 🧶"},{label:"旅行与景点",items:"🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🚚 🚛 🚜 🏎️ 🏍️ 🛵 🦽 🦼 🛺 🚲 🛴 🛹 🚏 🛣️ 🛤️ 🛢️ ⛽ 🚨 🚥 🚦 🛑 🚧 ⚓ ⛵ 🛶 🚤 🛳️ ⛴️ 🛥️ 🚢 ✈️ 🛩️ 🛫 🛬 🪂 💺 🚁 🚟 🚠 🚡 🛰️ 🚀 🛸 🛎️ 🧳 🧭 ⌚ ⏰ ⏱️ ⏲️ 🕰️ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦"},{label:"物品",items:"📔 📕 📖 📗 📘 📙 📚 📒 📃 📜 📄 📰 🗞️ 📑 🔖 🏷️ 💰 🔍 🔎 💴 💵 💶 💷 💸 💳 🧾 💹 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 🗳️ ✏️ ✒️ 🖋️ 🖊️ 🖌️ 🖍️ 📝 💼 📁 📂 🗂️ 📅 📆 🗒️ 🗓️ 📇 📈 📉 📊 📋 📌 📍 📎 🖇️ 📏 📐 ✂️ 🗃️ 🗄️ 🗑️ 🔒 🔓 🔏 🔐 🔑 🗝️ 🔨 🪓 ⛏️ ⚒️ 🛠️ 🗡️ ⚔️ 🔫 🏹 🛡️ 🔧 🔩 ⚙️ 🗜️ ⚖️ 🦯 🔗 ⛓️ 🧰 🧲 ⚗️ 🧪 🧫 🧬 🔬 🔭 📡 💉 🩸 💊 🩹 🩺 🚪 🛏️ 🛋️ 🪑 🚽 🚿 🛁 🪒 🧴 🧷 🧹 🧺 🧻 🧼 🧽 🧯 🛒 🚬 ⚰️ ⚱️ 💎 🔇 🔈 🔉 🔊 🔔 🔕 🔋 🔌 💻 🖥️ 🖨️ ⌨️ 🖱️ 🖲️ 📷 🧱"},{label:"符号",items:"💡 ✅ ☑️ ✔️ ❌ ❎ ❓ ❗ ❔ ❕ ⌛ ⏳ 💰 🆒 🆕 🆖 🅾️ 🆗 🆘 🈲 🉑 🈸 ⛔ 🚫 📵 ✳️ ✴️ ❇️ 🔟 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 ℹ️ 🆔 🆕 🆖 🅾️ 🆗 🅿️ 🆘 🆙 🆚 🈁 🈂️ 🔴 🟠 🟡 🟢 🔵 🟣 🟤 ⚫ ⚪ 🟥 🟧 🟨 🟩 🟦 🟪 🟫 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔘 🔳 🔲 💌 💘 💝 💖 💗 💓 💞 💕 💟 ❣️ 💔 🤍 💯 💢 💥 💬 💤 ➰ ➿ 🔅 📴 ➡️ 🔃 🔄 🔙 🔚 🔛 🔝 🔀 🔁 🔂"}],cq=[{label:"网页",value:"web",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M867.62382187 81.79484409c53.52106667 0 96.93866667 43.37208853 96.93866666 96.89315627v664.0071104a102.4 102.4 0 0 1-102.4 102.4H161.83751147a102.4 102.4 0 0 1-102.4-102.4V178.64248889c0-53.52106667 43.37208853-96.93866667 96.8931552-96.93866667z m28.6264896 319.2604448H127.74968853v441.59431147c0 17.29422187 12.83413333 31.58471147 29.4912 33.8147552l4.64213334 0.31857813h700.23395626a34.13333333 34.13333333 0 0 0 34.13333334-34.13333333V401.05528889z m-34.13333334-250.99377813H161.88302187a34.13333333 34.13333333 0 0 0-34.13333334 34.13333333V332.74311076h768.50062294V184.19484409a34.13333333 34.13333333 0 0 0-34.13333334-34.13333333zM216.9059552 195.93671076a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z m136.53333333 0a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z" fill="#515151" p-id="6081"></path></svg>',validate:t=>t.startsWith("http://")||t.startsWith("https://")},{label:"哔哩哔哩",value:"bilibili",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.39 3.714h.5c.88.032 1.614.337 2.2.918.586.58.889 1.312.91 2.194v4.293c-.021.88-.324 1.615-.91 2.201-.586.586-1.32.889-2.2.91H4.11c-.88-.021-1.614-.324-2.2-.91-.586-.586-.889-1.32-.91-2.2V6.825c.021-.882.324-1.613.91-2.194.586-.58 1.32-.886 2.2-.918h.452l-.684-.653a.72.72 0 0 1-.218-.529.72.72 0 0 1 .218-.529l.015-.015a.763.763 0 0 1 .537-.218c.202 0 .38.072.537.218L6.63 3.59c.041.041.078.083.109.124h2.49a.487.487 0 0 1 .092-.124l1.665-1.602a.763.763 0 0 1 .536-.218c.203 0 .386.088.542.233a.691.691 0 0 1 .228.53.72.72 0 0 1-.217.528l-.685.653zm-7.28 1.51c-.434.01-.8.16-1.096.45-.295.29-.448.66-.458 1.105v4.387c.01.445.163.813.458 1.104.296.29.662.441 1.097.45h7.778c.435-.009.801-.16 1.097-.45.295-.29.448-.659.458-1.104V6.779c-.01-.446-.163-.814-.458-1.105a1.563 1.563 0 0 0-1.097-.45H4.111zm1.557 2.255c.217 0 .399.072.544.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.736.736 0 0 1-.544.218.739.739 0 0 1-.545-.218.809.809 0 0 1-.233-.56v-.684c0-.218.075-.402.225-.553a.753.753 0 0 1 .553-.225zm4.666 0c.218 0 .4.072.545.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.737.737 0 0 1-.545.218.739.739 0 0 1-.544-.218.809.809 0 0 1-.233-.56v-.684a.809.809 0 0 1 .233-.56.738.738 0 0 1 .544-.218z" fill="#07A3D7"/></svg>',validate(t){return/^https?:\/\/(www\.)?bilibili\.com\/video\/[a-zA-Z0-9]+/.test(t)},transformURL(t){const e=t.match(/\/video\/([a-zA-Z0-9]+)/)?.[1];return e?`https://player.bilibili.com/player.html?bvid=${e}`:""}},{label:"优酷",value:"youku",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M270.528 902.592c-82.688-45.952-104.576-161.984-43.072-232 26.688-30.208 214.592-142.784 229.632-137.344 17.088 5.504 7.488-.64-112.768-71.36-105.92-62.464-129.152-83.776-144.896-129.792-34.816-105.664 58.112-218.944 166.08-202.496 24.576 4.096 102.528 42.56 175.616 87.168 13.696 8.32 70.4 41.216 125.76 73.472 119.616 69.376 153.792 97.472 178.368 148.288 20.48 41.856 24.576 100.928 10.24 151.68-8.896 32.32-41.664 78.976-71.04 100.992l-19.2 14.4-33.408-19.2c-19.2-11.008-34.176-17.92-34.176-15.808 0 1.344 12.288 10.24 27.328 18.56 15.04 8.896 27.328 17.152 27.328 19.2 0 4.8-281.6 168.832-334.208 194.24-51.904 26.112-100.48 26.112-147.584 0z" fill="#018EFF"/><path d="M665.984 654.4c0-1.088-6.912-5.888-15.936-10.624-20.16-10.112-21.248-5.888-1.088 4.736 16.512 9.024 17.024 9.6 17.024 5.888zm-50.56 5.952c-8.448-7.424-55.744-33.408-55.744-30.72 0 2.56 53.632 35.008 58.432 35.52 1.024 0 0-2.112-2.688-4.8z" fill="#018EFF"/><path d="M673.472 653.44a4171.008 4171.008 0 0 0-126.336-72.768c-43.712-24.064-92.224-52.864-233.6-137.344C238.4 398.72 213.76 374.016 199.424 332.16c-34.816-105.664 58.048-218.944 166.016-202.496 24.576 4.096 102.4 42.56 175.552 87.168 13.632 8.32 70.336 41.216 125.632 73.472 114.112 65.92 146.88 92.032 170.752 133.184 47.872 81.728 29.44 195.008-40.96 257.472-13.632 11.648-27.968 21.248-32.768 21.248-4.8-.64-45.12-21.952-90.176-48.704z" fill="#FF396E"/><path d="M270.464 902.592A152.32 152.32 0 0 1 193.28 781.76c-6.144-76.8 21.184-115.328 130.496-179.84l75.136-44.608L568.96 630.08c93.568 39.808 172.8 72.064 176.256 72.064 4.096 0 6.784 2.048 6.784 5.504 0 5.504-273.216 165.44-334.016 194.944-51.84 26.112-100.352 26.112-147.52 0z" fill="#00BEFF"/></svg>',validate(t){return/^https?:\/\/v\.youku\.com\/v_show\/id_[a-zA-Z0-9]+/.test(t)},transformURL(t){const e=t.match(/\/id_([a-zA-Z0-9]+)/)?.[1];return e?`https://player.youku.com/embed/${e}`:""}},{label:"Figma",value:"figma",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.324 8c0-1.475 1.2-2.675 2.675-2.675 1.475 0 2.675 1.2 2.675 2.675 0 1.475-1.2 2.675-2.675 2.675A2.678 2.678 0 0 1 8.324 8z" fill="#1ABCFE"/><path d="M3 13.325c0-1.475 1.2-2.675 2.675-2.675h2.65v2.675C8.325 14.8 7.125 16 5.65 16 4.175 16 3 14.8 3 13.325z" fill="#0ACF83"/><path d="M8.324 0v5.325H11c1.475 0 2.675-1.2 2.675-2.675C13.674 1.175 12.474 0 11 0H8.324z" fill="#FF7262"/><path d="M3 2.675C3 4.15 4.2 5.35 5.675 5.35h2.65V0H5.65C4.175 0 3 1.2 3 2.675z" fill="#F24E1E"/><path d="M3 8c0 1.475 1.2 2.675 2.675 2.675h2.65v-5.35H5.65C4.175 5.325 3 6.525 3 8z" fill="#A259FF"/></svg>',validate(t){return/^https?:\/\/www\.figma\.com\/file\/[a-zA-Z0-9]+/.test(t)},transformURL(t){const e=t.match(/\/file\/([a-zA-Z0-9]+)/)?.[1];return e?`https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/${e}`:""}},{label:"墨刀",value:"mado",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 3h2.715v4.752H2V3zm6.958 0H6.242v4.752h2.716V3zm4.582 0h-2.716v4.752h2.716V3zM9.107 14l-1.096-2.5a3.905 3.905 0 0 0 2.812-3.748h2.716A6.621 6.621 0 0 1 9.107 14z" fill="#F33"/></svg>',validate(t){return/^https?:\/\/modao\.cc\/app\/[a-zA-Z0-9]+/.test(t)},transformURL(t){return t}},{label:"腾讯视频",value:"tencent_video",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.314 14.541c-1.416-.025-1.71-1.416-1.964-3.16-.155-1.06-.182-2.155-.182-3.23 0-1.074.027-2.169.182-3.23.31-2.14.685-3.75 3.123-2.95 2.336.768 4.586 2.126 6.56 3.67.1.085.209.177.324.272.705.59 1.62 1.355 1.642 2.239-.021.882-.936 1.647-1.641 2.237-.115.096-.225.187-.324.274-1.975 1.543-4.225 2.901-6.561 3.67-.418.136-.774.203-1.08.208h-.08z" fill="#4396F7"/><path d="M2.98 13.143c-1.202-.029-1.527-.954-1.755-2.162l-.02-.1-.036-.206C1.025 9.847 1 8.991 1 8.152c0-.84.025-1.694.17-2.523l.036-.205.019-.1c.267-1.418.668-2.447 2.464-2.094-.151.487-.247 1.067-.339 1.692-.154 1.061-.181 2.156-.181 3.23 0 1.074.027 2.169.181 3.23.092.624.188 1.204.34 1.692a3.501 3.501 0 0 1-.592.07H2.98z" fill="#EF8E34"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.689 3.229c.125.025.256.055.395.094 2.181.6 4.28 1.66 6.124 2.866.66.483 1.812 1.16 1.834 1.962-.023.803-1.175 1.48-1.834 1.963-1.843 1.205-3.943 2.266-6.124 2.866-.139.038-.27.069-.395.094-.151-.488-.248-1.068-.338-1.693-.155-1.06-.182-2.156-.182-3.23 0-1.074.027-2.169.182-3.23.09-.62.185-1.197.335-1.683l.003-.009z" fill="#78E445"/><path d="M4.845 8.156c0-1.82.13-2.04.13-2.04.053-.234.18-.298.378-.241 0 0 .587.124 2.006.87 1.435.754 1.875 1.168 1.875 1.168.217.188.172.305 0 .483 0 0-.269.308-1.875 1.14-1.606.83-2.006.894-2.006.894-.239.056-.332-.015-.377-.24 0 0-.13-.21-.13-2.034z" fill="#fff"/></svg>',validate(t){return t.startsWith("https://modao.cc/proto/")},transformURL(t){const e=t.match(/\/cover\/[a-zA-Z0-9]+\/([a-zA-Z0-9]+)/)?.[1];return e?`https://v.qq.com/iframe/player.html?vid=${e}`:""}}];function fq(){const{editor:t}=Ot(),[e,r]=j.useState(!1),[n,i]=j.useState(""),a=o=>{if(!t)return;const s=t.chain().focus();t.isActive("orderedList")?t.getAttributes("orderedList").listType===o?s.toggleOrderedList().run():s.updateAttributes("orderedList",{listType:o}).run():(s.toggleOrderedList().run(),t.chain().updateAttributes("orderedList",{listType:o}).run()),i(o),r(!1)};return F.jsx(xl,{ico:"ordered-list",icoSize:16,text:"有序列表",hideText:!0,shortcut:"Ctrl+Shift+7",popupVisible:e,popupType:"arrow",onMenuClick:()=>{t?.isEditable!==!1&&a(lq[0].value)},onPopupVisibleChange:r,content:F.jsx("div",{className:"w-[170px] flex flex-wrap gap-[10px]",children:lq.map((o,s)=>F.jsx("div",{className:`w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5] overflow-hidden ${n===o.value?"border-[#333639]":""}`,onClick:()=>a(o.value),children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",dangerouslySetInnerHTML:{__html:o.code}})},s))})})}function dq(){const{editor:t}=Ot(),[e,r]=j.useState(!1),[n,i]=j.useState(""),a=o=>{if(!t)return;const s=t.chain().focus();t.isActive("bulletList")?t.getAttributes("bulletList").listType===o?s.toggleBulletList().run():s.updateAttributes("bulletList",{listType:o}).run():(s.toggleBulletList().run(),t.chain().updateAttributes("bulletList",{listType:o}).run()),i(o),r(!1)};return F.jsx(xl,{ico:"bullet-list",icoSize:16,text:"无序列表",hideText:!0,shortcut:"Ctrl+Shift+7",popupVisible:e,popupType:"arrow",onMenuClick:()=>{t?.isEditable!==!1&&a(uq[0].value)},onPopupVisibleChange:o=>{if(r(o),o&&t){const{listType:s}=t.getAttributes("bulletList");i(s)}},content:F.jsx("div",{className:"w-[170px] flex flex-wrap gap-[10px]",children:uq.map((o,s)=>F.jsx("div",{className:`w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5] ${n===o.value?"border-[#333639]":""}`,onClick:()=>a(o.value),children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",dangerouslySetInnerHTML:{__html:o.code}})},s))})})}function hq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"indent-right",text:"增加缩进",shortcut:"Tab",hideText:!0,onMenuClick:()=>t?.chain().focus().indent().run()})}const B2=({ico:t="",icoSize:e=16,text:r="",hideText:n=!1,forceEnabled:i=!1,disabled:a=!1,menuActive:o=!1,dropType:s="dropdown",popupVisible:l,maxHeight:u=!0,editor:c,onMenuClick:f,onMenuClickThrough:d,onPopupVisibleChange:h,className:p,onClick:v,content:g,children:m,...y})=>{const[b,x]=j.useState(!1),w=l!==void 0?l:b,_=V=>{l===void 0&&x(V),h?.(V)},C=V=>{V.stopPropagation(),d?d(V):f&&f(V),v&&v(V)},D=c?.isEditable!==!1,O=!i&&(a||!D),I=["white-editor-tool-item","white-editor-tool-drop-item","flex","items-center","justify-center",n?"":"is-show-text",o&&D?"is-active":"",O?"is-disabled":"",p||""].filter(Boolean).join(" "),L=g||m;return s==="dropdown"?F.jsxs("button",{className:I,disabled:O,title:r,...y,children:[F.jsxs("div",{className:"flex items-center h-full",onClick:C,children:[F.jsx("i",{className:`w-iconfont icon-${t}`,style:{fontSize:`${e}px`}}),!n&&F.jsx("p",{className:"text-[13px] text-[#333639] ml-[3px]",children:r})]}),F.jsx(ol,{trigger:"click",value:w,onVisibleChange:_,placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:O,hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow",content:L,children:F.jsx("span",{className:"flex items-center justify-center w-full h-full",children:F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${w?"rotate-180":""}`})})})]}):F.jsx(ol,{trigger:"click",value:w,onVisibleChange:_,placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:L,children:F.jsx("button",{className:I,disabled:O,title:r,...y,children:F.jsxs("div",{className:"flex items-center gap-[4px] h-full",children:[F.jsx("i",{className:`w-iconfont icon-${t}`,style:{fontSize:`${e}px`}}),!n&&F.jsx("p",{className:"text-[13px] text-[#333639]",children:r}),F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${w?"rotate-180":""}`})]})})})};function Koe(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=j.useMemo(()=>!t||t.isActive({textAlign:"left"})?"left":t.isActive({textAlign:"center"})?"center":t.isActive({textAlign:"right"})?"right":t.isActive({textAlign:"justify"})?"justify":t.isActive({textAlign:"distributed"})?"distributed":"left",[t?.state?.selection,t?.state?.doc]),i=a=>{if(t){switch(a){case"left":t.can().chain().focus().setTextAlign("left").run()&&t.chain().focus().setTextAlign("left").run(),t.can().chain().focus().setNodeAlign("flex-start").run()&&t.chain().focus().setNodeAlign("flex-start").run();break;case"center":t.can().chain().focus().setTextAlign("center").run()&&t.chain().focus().setTextAlign("center").run(),t.can().chain().focus().setNodeAlign("center").run()&&t.chain().focus().setNodeAlign("center").run();break;case"right":t.can().chain().focus().setTextAlign("right").run()&&t.chain().focus().setTextAlign("right").run(),t.can().chain().focus().setNodeAlign("flex-end").run()&&t.chain().focus().setNodeAlign("flex-end").run();break;case"justify":t.can().chain().focus().setTextAlign("justify").run()&&t.chain().focus().setTextAlign("justify").run();break;case"distributed":t.can().chain().focus().setTextAlign("distributed").run()&&t.chain().focus().setTextAlign("distributed").run();break}r(!1)}};return F.jsxs(B2,{ico:`align-${n}`,text:"对齐方式",hideText:!0,onMenuClick:()=>{t?.isEditable!==!1&&i(n)},popupVisible:e,onPopupVisibleChange:r,children:[F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("left"),children:[F.jsx("i",{className:"w-iconfont icon-align-left"}),"左对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("center"),children:[F.jsx("i",{className:"w-iconfont icon-align-center"}),"居中对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("right"),children:[F.jsx("i",{className:"w-iconfont icon-align-right"}),"右对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("justify"),children:[F.jsx("i",{className:"w-iconfont icon-align-justify"}),"两端对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("distributed"),children:[F.jsx("i",{className:"w-iconfont icon-align-distributed"}),"分散对齐"]})]})}function pq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"sub-script",text:"下标",shortcut:"Ctrl+,",hideText:!0,menuActive:t?.isActive("subscript"),disabled:!t?.can().chain().focus().toggleSubscript().run(),onMenuClick:()=>t?.commands.toggleSubscript()})}function vq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"sup-script",text:"上标",shortcut:"Ctrl+.",hideText:!0,menuActive:t?.isActive("superscript"),disabled:!t?.can().chain().focus().toggleSuperscript().run(),onMenuClick:()=>t?.commands.toggleSuperscript()})}function gq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"quote",text:"引用",shortcut:"Ctrl+Shift+B",hideText:!0,menuActive:t?.isActive("blockquote"),disabled:!t?.can().chain().focus().toggleBlockquote().run(),onMenuClick:()=>t?.chain().focus().toggleBlockquote().run()})}function mq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"code",text:"代码",shortcut:"Ctrl+E",hideText:!0,menuActive:t?.isActive("code"),disabled:!t?.can().chain().focus().toggleCode().run(),onMenuClick:()=>t?.chain().focus().toggleCode().run()})}function yq(){const{editor:t,dicts:e}=Ot(),[r,n]=j.useState(!1),i=e?.lineHeights.map(o=>({label:o.label,value:o.value,active:t?.isActive({lineHeight:o.value})})),a=({content:o,value:s})=>{o&&(t?.chain().focus().setLineHeight(s).run(),n(!1))};return F.jsx(B2,{dropType:"select",ico:"line-height",text:"行高",hideText:!0,popupVisible:r,onPopupVisibleChange:n,content:F.jsx(F.Fragment,{children:i?.map(o=>F.jsx("div",{className:`px-[12px] py-[5px] flex items-center gap-[4px] text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer ${o.active?"!text-[#007bff] font-[500]":""}`,onClick:()=>a({content:o.label,value:o.value}),children:o.label},o.value))})})}function bq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"unde",text:"撤销",shortcut:"Ctrl+Z",hideText:!0,disabled:!t?.can().chain().focus().undo().run(),onMenuClick:()=>t?.chain().focus().undo().run()})}function xq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"redo",text:"重做",shortcut:"Ctrl+Y",hideText:!0,disabled:!t?.can().chain().focus().redo().run(),onMenuClick:()=>t?.chain().focus().redo().run()})}function wq(){const{editor:t}=Ot(),e=r=>{if(t?.view?.painter?.enabled){t?.commands.unsetFormatPainter();return}t?.chain().focus().setFormatPainter(r).run()};return F.jsx(Ar,{ico:"format-painter",text:"格式刷",menuActive:t?.view?.painter?.enabled,disabled:t?.state?.selection?.empty,hideText:!0,onMenuClick:()=>e(!0),onDoubleClick:()=>e(!1)})}function Sq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"clear-format",text:"清除格式",hideText:!0,onMenuClick:()=>t?.chain().focus().unsetAllMarks().run()})}function _q(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"hard-break",text:"换行",hideText:!0,shortcut:"Shift+Enter",onMenuClick:()=>t?.chain().focus().setHardBreak().run()})}const Yoe=({value:t,disabled:e=!1,children:r,onChange:n,className:i=""})=>{const a=s=>{e||n?.(s.target.checked)},o=["white-checkbox",t?"checked":"",e?"disabled":"",i].filter(Boolean).join(" ");return F.jsxs("label",{className:o,children:[F.jsx("span",{className:"checkbox-input"}),F.jsx("input",{className:"checkbox-original",type:"checkbox",checked:t,onChange:a,disabled:e}),F.jsx("span",{className:"checkbox-label",children:r})]})};function hje({onInsert:t}){const[e,r]=j.useState(!0),[n,i]=j.useState([]),a=()=>{if(!n.length)return;const[o,s]=n;t({row:o,col:s,checked:e})};return F.jsxs("div",{className:"w-full white-table-generator-content",children:[F.jsxs("div",{className:"text-[14px] font-[600] mb-[5px] user-select-none flex items-center justify-between",children:[F.jsxs("span",{children:["表格 ",`${n[0]||0} * ${n[1]||0}`]}),F.jsx(Yoe,{value:e,onChange:r,children:"包含表头"})]}),F.jsx("table",{onMouseLeave:()=>i([]),onClick:a,children:F.jsx("tbody",{children:Array.from({length:10},(o,s)=>s+1).map(o=>F.jsx("tr",{children:Array.from({length:10},(s,l)=>l+1).map(s=>F.jsx("td",{onMouseEnter:()=>i([o,s]),children:F.jsx("div",{className:`cell cursor-pointer ${n.length&&n[0]&&n[1]&&o<=n[0]&&s<=n[1]?"active":""}`})},s))},o))})})]})}function Tq({hideText:t=!0}){const{editor:e}=Ot(),[r,n]=j.useState(!1),i=a=>{const{row:o,col:s,checked:l}=a;e?.chain().focus().insertTable({rows:o,cols:s,withHeaderRow:l}).run(),n(!1)};return F.jsx(xl,{ico:"edit-table",icoSize:16,text:"插入表格",hideText:t,popupVisible:r,onPopupVisibleChange:n,popupType:"select",content:F.jsx(hje,{onInsert:i})})}const jd=j.forwardRef(({value:t,disabled:e=!1,placeholder:r="",simple:n=!1,status:i="",size:a="",prefix:o,suffix:s,onChange:l,onInput:u,onBlur:c,onFocus:f,onEnter:d,className:h=""},p)=>{const[v,g]=j.useState(!1),m=j.useRef(null);j.useImperativeHandle(p,()=>({focus:()=>{m.current?.focus()}}));const y=C=>{l?.(C.target.value),u?.(C)},b=C=>{g(!0),f?.(C)},x=C=>{g(!1),c?.(C)},w=C=>{C.key==="Enter"&&d?.(C)},_=["white-input-wrapper",e?"disabled":"",v?"focused":"",n?"simple":"",a||"",i==="success"?"status-success":"",i==="error"?"status-error":"",h].filter(Boolean).join(" ");return F.jsxs("div",{className:_,children:[F.jsx("span",{className:"prefix",children:o}),F.jsx("input",{type:"text",ref:m,disabled:e,value:t,placeholder:r,onChange:y,onFocus:b,onBlur:x,onKeyDown:w}),F.jsx("span",{className:"suffix",children:s})]})});jd.displayName="Input";const ts=({checked:t=!1,disabled:e=!1,type:r="default",size:n="normal",first:i=!1,last:a=!1,children:o,onClick:s,className:l=""})=>{const u=f=>{e||s?.(f)},c=["white-button",e?"disabled":"",!e&&t?"checked":"",!e&&r==="default"?"default":"",!e&&r==="primary"?"primary":"",!e&&r==="checkbox"?"checkbox":"",!e&&r==="radio"?"radio":"",n==="small"?"small":"",i?"first":"",a?"last":"",l].filter(Boolean).join(" ");return F.jsx("button",{className:c,onClick:u,children:o})};function Cq({hideText:t=!0}){const{editor:e}=Ot(),[r,n]=j.useState(!1),[i,a]=j.useState(""),[o,s]=j.useState(""),l=()=>{e?.commands.setLink({href:i,target:"_blank"}),e?.chain().focus().insertContent(o).run(),n(!1)},u=()=>{a(""),s(""),n(!1)};return F.jsx(xl,{ico:"link",icoSize:16,text:"插入链接",hideText:t,popupVisible:r,onPopupVisibleChange:n,popupType:"select",content:F.jsxs("div",{className:"w-[250px]",children:[F.jsx("div",{className:"font-[500] text-[14px] mb-[5px]",children:"链接到"}),F.jsx(jd,{placeholder:"请输入网址",value:i,onChange:a}),F.jsx("div",{className:"font-[500] text-[14px] mb-[5px] mt-[10px]",children:"显示文案"}),F.jsx(jd,{placeholder:"请输入显示文案",value:o,onChange:s}),F.jsxs("div",{className:"flex justify-end mt-[10px] gap-[10px]",children:[F.jsx(ts,{onClick:u,children:"取消"}),F.jsx(ts,{type:"primary",onClick:l,disabled:!i||!o,children:"确定"})]})]})})}const t5=j.forwardRef(({value:t,size:e="",options:r,disabled:n=!1,search:i=!1,searchLabel:a="搜索",maxHeight:o=!0,maxWidth:s=0,editor:l,onChange:u,icon:c,children:f,className:d},h)=>{const[p,v]=j.useState(!1),g=j.useRef(null),m=j.useRef(null),[y,b]=j.useState(0),[x,w]=j.useState(""),_=j.useMemo(()=>r.find(Y=>Y.value===t)?.label||t||"请选择",[r,t]),C=j.useMemo(()=>_==="请选择",[_]),D=j.useMemo(()=>{if(!i||!x.trim())return r;const Y=r.filter(te=>te.label.toLowerCase().indexOf(x.toLowerCase())!==-1);return Y.length?Y:r},[i,x,r]);j.useEffect(()=>{p&&setTimeout(()=>{m.current&&m.current.focus()},0)},[p]),j.useEffect(()=>{const Y=()=>{g.current&&b(s?Number(s):g.current.clientWidth)},te=new ResizeObserver(Y);return g.current&&te.observe(g.current),()=>{g.current&&te.unobserve(g.current),te.disconnect()}},[s]);const O=Y=>{Y.disabled||(u?.(Y.value),v(!1))},I=Y=>{v(Y),Y||w("")};j.useImperativeHandle(h,()=>({changePopoverVisible:I}));const L=l?.isEditable!==!1,V=n||!L,H=F.jsxs("div",{className:"white-options-wrapper",style:{width:y+2+"px",maxHeight:o?"260px":"auto"},children:[i&&F.jsx("div",{className:"p-2 sticky top-0 bg-white z-10 border-b border-gray-100",children:F.jsx(jd,{ref:m,value:x,onChange:w,placeholder:a})}),f||D.map((Y,te)=>F.jsx("div",{className:`option ${Y.disabled?"disabled":""} ${Y.value===t?"selected":""}`,onClick:()=>O(Y),children:Y.label},te))]});return F.jsx(ol,{trigger:"click",value:p,onVisibleChange:I,placement:"bottom",contentStyle:{padding:0,boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:V,content:H,hasClass:`white-select-wrapper ${d||""}`,children:F.jsxs("div",{className:`select border border-[#d9d9d9] !bg-[#fff] ${e} ${V?"disabled":""}`,ref:g,children:[F.jsx("div",{className:`selector ${C?"placeholder":""}`,children:_}),F.jsx("div",{className:"icon",children:c||F.jsx("i",{className:"w-iconfont icon-bottom !text-[8px] transition-transform duration-200"})})]})})});function Eq(){const{editor:t}=Ot(),e=t?.getAttributes("textStyle").fontSize||"14px";return F.jsx(t5,{value:e,size:"small",options:h0,onChange:r=>t?.chain().focus().setFontSize(r).run()})}function Mq(){const{editor:t}=Ot(),e=[{label:"默认字体",value:null},{label:"华文宋体",value:"STSong"},{label:"华文仿宋",value:"STFangsong"},{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Helvetica",value:"Helvetica"},{label:"Tahoma",value:"Tahoma"},{label:"Georgia",value:"Georgia"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"}],r=t?.getAttributes("textStyle").fontFamily||null;return F.jsx(t5,{className:"w-[120px]",size:"small",value:r,options:e,onChange:n=>t?.chain().focus().setFontFamily(n).run()})}function pje(){const{editor:t}=Ot(),e=j.useRef(null),r=j.useMemo(()=>{const i=a=>t?.isActive("heading",{level:a});if(t){if(t.isActive("paragraph"))return"paragraph";if(i(1))return"1";if(i(2))return"2";if(i(3))return"3";if(i(4))return"4";if(i(5))return"5";if(i(6))return"6"}return""},[t?.state?.selection]),n=i=>{i==="paragraph"?t?.chain().focus().setParagraph().run():t?.chain().focus().toggleHeading({level:Number(i)}).run(),e.current?.changePopoverVisible(!1)};return F.jsx(t5,{value:r,size:"small",options:PI,maxWidth:100,ref:e,children:PI.map((i,a)=>F.jsx("div",{className:`white-heading-wrapper cursor-pointer ${i.value===r?"selected":""} ${i.element}`,onClick:()=>n(i.value),children:i.label},a))})}const vje=({visible:t,width:e=480,closeButton:r=!1,closeOnClickMask:n=!0,closeOnEsc:i=!0,contentStyle:a={},children:o,onVisibleChange:s,onClosed:l})=>{const u=j.useRef(null);j.useEffect(()=>{if(t){const p=setTimeout(()=>{u.current?.focus()},0);return()=>clearTimeout(p)}else l?.()},[t,l]);const c=()=>{s?.(!1),l?.()},f=()=>{t&&i&&c()},d=p=>{p.target===u.current&&n&&c()},h={width:`${e}px`,...a};return t?kv.createPortal(F.jsx("div",{className:"white-modal-wrapper white-editor-namespace",ref:u,tabIndex:-1,onKeyUp:p=>{p.key==="Escape"&&f()},onClick:d,children:F.jsxs("div",{className:"modal-content",style:h,children:[r&&F.jsx("span",{className:"close-btn",onClick:c,children:F.jsx("i",{className:"w-iconfont icon-close"})}),o]})}),document.body):null},Aq=30,kq=15,gje=j.forwardRef((t,e)=>{const[r,n]=j.useState(()=>{const{labels:p,series:v}=t.data,g=p.length;return[v.length+1,g+1]}),[i,a]=j.useState(null),o=j.useRef("bar"),s=j.useRef(null),l=()=>{o.current=t.type;const p=[],{labels:v,legends:g,series:m}=t.data,y=v.length,b=m.length;p.push(["",...g]);for(let x=0;x<y;x++){const w=[v[x]];for(let _=0;_<b;_++)w.push(m[_][x]+"");p.push(w)}for(let x=0;x<y+1;x++)for(let w=0;w<b+1;w++){const _=s.current?.querySelector(`#cell-${x}-${w}`);_&&(_.value=p[x][w]+"")}},u=()=>{l();const{labels:p,series:v}=t.data,g=p.length,m=v.length;n([m+1,g+1])},c=()=>{const p=[];let v=[],g=[];for(let m=1;m<Aq;m++){const y=s.current?.querySelector(`#cell-${m}-0`);y&&y.value&&p.push({rowIndex:m,value:y.value})}for(let m=1;m<kq;m++){const y=s.current?.querySelector(`#cell-0-${m}`);if(y&&y.value){v.push(y.value);const b=[];for(let x=0;x<p.length;x++){const w=s.current?.querySelector(`#cell-${p[x].rowIndex}-${m}`);let _=0;w&&w.value&&!isNaN(Number(w.value))&&(_=Number(w.value)),b.push(_)}g.push(b)}}return o.current==="scatter"&&(v.length>2&&(v=v.slice(0,2),g=g.slice(0,2)),v.length<2&&(v.push("Y"),g.length>0&&g.push(g[0]))),(o.current==="ring"||o.current==="pie")&&v.length>1&&(v=v.slice(0,1),g=g.slice(0,1)),{data:{labels:p.map(m=>m.value),legends:v,series:g},type:o.current}};j.useImperativeHandle(e,()=>({getTableData:c,initData:u}));const f=(p,v)=>{if(p===0||v===0)return;const g=s.current?.querySelector(`#cell-${p}-${v}`);g&&g.value&&(/^[0-9]+$/.test(g.value)||(g.value="0"))},d=()=>{if(!i)return;const[p,v]=i,g=s.current?.querySelector(`#cell-${p+1}-${v}`);g&&g.focus()};j.useEffect(()=>{l()},[t.data,t.type]),j.useEffect(()=>{const p=v=>{v.key.toUpperCase()===qoe.ENTER&&d()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),t.onUpdateData&&(console.log("updateData",c()),t.onUpdateData(c()))}},[]);const h=(p,v,g)=>{p.preventDefault(),console.log("handlePaste",p.clipboardData,v,g)};return F.jsx("div",{className:"white-editor-table-content",ref:s,children:F.jsx("table",{children:F.jsx("tbody",{children:Array.from({length:Aq}).map((p,v)=>F.jsx("tr",{children:Array.from({length:kq}).map((g,m)=>F.jsx("td",{className:m===0&&v<=r[1]-1||v===0&&m<=r[0]-1?"head":"",children:!(v===0&&m===0)&&F.jsx("input",{className:`item ${v<=r[1]-1&&m<=r[0]-1?"selected":""}`,id:`cell-${v}-${m}`,autoComplete:"off",onFocus:()=>a([v,m]),onBlur:()=>f(v,m),onPaste:y=>h(y,v,m)})},m))},v))})})})});function BI({icon:t="chart",text:e="插入图表",isEdit:r=!1,hideText:n=!0}){const{editor:i,options:a}=Ot(),[o,s]=j.useState(!1),[l,u]=j.useState("type"),[c]=j.useState(1),[f,d]=j.useState(null),h=j.useRef(null),p=j.useRef(null),[v,g]=j.useState({data:[],config:{seriesType:"bar",legendorient:"horizontal",titleText:"",legend:!1,legendleft:"center",legendlocation:"top",titleleft:"left"}}),m=j.useRef(null),y=()=>{m.current!==null&&(m.current.dispose(),m.current=null)},b=async L=>{setTimeout(()=>{if(!h.current)return;m.current=CR(h.current);const V=L||v;if(!V.data){console.log("图表数据为空");return}console.log("baseConfig.data",V);const H=aoe(JSON.parse(JSON.stringify(V.data)),JSON.parse(JSON.stringify(V.config)),a);try{m.current.setOption(H)}catch(Y){console.log("图表渲染错误:",Y),y()}},0)},x=()=>{const L={...v};return L.config.seriesType="bar",L.config.legend=!0,L.config.legendorient="horizontal",L.config.legendlocation="top",L.config.legendleft="center",L.config.titleText="",L.config.titleleft="left",L.data=sq[L.config.seriesType],g(L),console.log("newConfig",L),L},w=async()=>{if(s(!0),u("type"),r){if(!i)return;const L=au(i);if(d(L),L?.type?.name!=="echarts"||(x(),!L.attrs?.chartConfig))return;const V=L.attrs?.chartConfig,H=JSON.parse(JSON.stringify(V));g(H),await b(H)}else{const L=x();await b(L)}},_=L=>{typeof L=="string"&&g(V=>({...V,data:sq[L],config:{...V.config,seriesType:L}}))},C=L=>{g(V=>({...V,data:L.data}))},D=async()=>{try{y(),await b()}catch(L){console.log("图表配置错误:",L)}},O=L=>{if(u(L),L==="type")if(p.current){const{data:V}=p.current.getTableData(),H={...v,data:V};g(H);try{y(),b(H)}catch(Y){console.log("图表配置错误:",Y)}}else D()},I=()=>{const L={id:"",name:"",mode:c,chartOptions:null,chartConfig:null,nodeAlign:"center",margin:{}};r?L.id=f.attrs.id:L.id=Nv(),L.chartConfig=JSON.parse(JSON.stringify({data:v.data,config:v.config})),r?i?.commands.updateEcharts(L):i?.commands.setEcharts(L),s(!1)};return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:t,text:e,hideText:n,onMenuClick:w}),F.jsxs(vje,{visible:o,onVisibleChange:s,closeButton:!0,width:800,children:[F.jsx("div",{className:"w-full mb-6 font-[500] text-[18px]",children:"图表配置"}),F.jsxs("div",{className:"w-full inline-flex items-center mb-[15px]",children:[F.jsx("span",{className:`px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-l-md ${l==="type"?"!bg-[#007bff] !text-[#fff]":""}`,onClick:()=>O("type"),children:"图表类型"}),F.jsx("span",{className:`px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-r-md ${l==="data"?"!bg-[#007bff] !text-[#fff]":""}`,onClick:()=>O("data"),children:"图表数据"})]}),F.jsxs("div",{className:"flex items-center gap-[1.2rem] h-[400px]",style:{display:l==="type"?"flex":"none"},children:[F.jsx("div",{className:"w-[55%] h-full border rounded-md p-2",children:F.jsx("div",{ref:h,className:"w-full h-full"})}),F.jsxs("div",{className:"flex-1 h-full border rounded-md p-4",children:[F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"图表类型:"}),F.jsx(ay,{value:v.config.seriesType,options:[{label:"柱状图",value:"bar"},{label:"折线图",value:"line"},{label:"曲线图",value:"smooth"},{label:"饼图",value:"pie"},{label:"环形图",value:"ring"},{label:"面积图",value:"area"},{label:"散点图",value:"scatter"},{label:"雷达图",value:"radar"}],maxHeight:!1,onChange:_,className:"flex-1"})]}),F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"标题名称:"}),F.jsx(jd,{value:v.config.titleText,onChange:L=>g({...v,config:{...v.config,titleText:L}}),placeholder:"请输入标题名称",className:"flex-1"})]}),F.jsx("div",{className:"flex items-center gap-[10px] mb-[10px]",children:F.jsx(Yoe,{value:v.config.legend,onChange:L=>g({...v,config:{...v.config,legend:L}}),className:"flex-shrink-0",children:"显示图例"})}),v.config.legend&&F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"横向位置:"}),F.jsx(ay,{value:v.config.legendleft,options:[{label:"左侧",value:"left"},{label:"居中",value:"center"},{label:"右侧",value:"right"}],onChange:L=>{typeof L=="string"&&g({...v,config:{...v.config,legendleft:L}})},className:"flex-1"})]}),F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"纵向位置:"}),F.jsx(ay,{value:v.config.legendlocation,options:[{label:"顶部",value:"top"},{label:"底部",value:"bottom"}],onChange:L=>{typeof L=="string"&&g({...v,config:{...v.config,legendlocation:L}})},className:"flex-1"})]})]}),F.jsx(ts,{type:"primary",onClick:D,size:"small",className:"w-full",children:"预览"})]})]}),F.jsx("div",{className:"w-full h-[400px] overflow-auto",style:{display:l==="data"?"block":"none"},children:F.jsx(gje,{ref:p,type:v.config.seriesType,data:v.data,onUpdateData:C})}),F.jsxs("div",{className:"flex items-center justify-end gap-[0.8rem] mt-6",children:[F.jsx(ts,{onClick:()=>s(!1),children:"取消"}),F.jsx(ts,{type:"primary",onClick:I,children:"确定"})]})]})]})}function Nq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"indent-left",text:"减少缩进",shortcut:"Shift+Tab",hideText:!0,onMenuClick:()=>t?.chain().focus().outdent().run()})}function tg(){const{editor:t}=Ot(),e=()=>{t?.can().chain().focus().setTextAlign("center").run()&&t.chain().focus().setTextAlign("center").run(),t?.can().chain().focus().setNodeAlign("center").run()&&t.chain().focus().setNodeAlign("center").run()};return F.jsx(Ar,{ico:"align-center",shortcut:"Ctrl+Shift+E",text:"居中对齐",hideText:!0,menuActive:t?.isActive({textAlign:"center"})||t?.isActive({nodeAlign:"center"}),disabled:!t?.can().chain().focus().setTextAlign("center").run()&&!t?.can().chain().focus().setNodeAlign("center").run(),onMenuClick:e})}function rg(){const{editor:t}=Ot(),e=()=>{t?.can().chain().focus().setTextAlign("right").run()&&t.chain().focus().setTextAlign("right").run(),t?.can().chain().focus().setNodeAlign("flex-end").run()&&t.chain().focus().setNodeAlign("flex-end").run()};return F.jsx(Ar,{ico:"align-right",text:"右对齐",shortcut:"Ctrl+Shift+R",hideText:!0,menuActive:t?.isActive({textAlign:"right"})||t?.isActive({nodeAlign:"flex-end"}),disabled:!t?.can().chain().focus().setTextAlign("right").run()&&!t?.can().chain().focus().setNodeAlign("flex-end").run(),onMenuClick:e})}function ng(){const{editor:t}=Ot(),e=()=>{t?.can().chain().focus().setTextAlign("left").run()&&t.chain().focus().setTextAlign("left").run(),t?.can().chain().focus().setNodeAlign("flex-start").run()&&t.chain().focus().setNodeAlign("flex-start").run()};return F.jsx(Ar,{ico:"align-left",text:"左对齐",shortcut:"Ctrl+Shift+L",hideText:!0,menuActive:t?.isActive({textAlign:"left"})||t?.isActive({nodeAlign:"flex-start"}),disabled:!t?.can().chain().focus().setTextAlign("left").run()&&!t?.can().chain().focus().setNodeAlign("flex-start").run(),onMenuClick:e})}function mje(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"align-justify",text:"两端对齐",shortcut:"Ctrl+Shift+J",hideText:!0,menuActive:t?.isActive({textAlign:"justify"}),disabled:!t?.can().chain().focus().setTextAlign("justify").run(),onMenuClick:()=>t?.chain().focus().setTextAlign("justify").run()})}function yje(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"align-distributed",text:"分散对齐",shortcut:"Ctrl+Shift+D",hideText:!0,menuActive:t?.isActive({textAlign:"distributed"}),disabled:!t?.can().chain().focus().setTextAlign("distributed").run(),onMenuClick:()=>t?.chain().focus().setTextAlign("distributed").run()})}function bje(){const{editor:t}=Ot(),e=n=>{t?.chain().focus().setFontSize(n).run()},r=()=>{const{fontSize:n}=t?.getAttributes("textStyle")??{};if(n){const i=h0.find(({value:o})=>o===n);if(!i)return;const a=h0.find(({order:o})=>o===i.order+1);a&&e(a.value)}else e("16px")};return F.jsx(Ar,{ico:"size-increase",text:"增大字体",hideText:!0,onMenuClick:r})}function xje(){const{editor:t}=Ot(),e=n=>{t?.chain().focus().setFontSize(n).run()},r=()=>{const{fontSize:n}=t?.getAttributes("textStyle")??{};if(n){const i=h0.find(({value:o})=>o===n);if(!i)return;const a=h0.find(({order:o})=>o===i.order-1);a&&e(a.value)}else e("14px")};return F.jsx(Ar,{ico:"size-decrease",text:"减小字体",hideText:!0,onMenuClick:r})}function wje(){const{editor:t}=Ot(),e=j.useMemo(()=>{if(!t)return"";const n=i=>t.isActive("heading",{level:i});return t.isActive("paragraph")?"paragraph":n(1)?"1":n(2)?"2":n(3)?"3":n(4)?"4":n(5)?"5":n(6)?"6":""},[t?.state?.selection]),r=n=>{!t||!t.isEditable||(n==="paragraph"?t.chain().focus().setParagraph().run():t.chain().focus().toggleHeading({level:Number(n)}).run())};return F.jsx("div",{className:"p-[5px] bg-[#f3f4f6] rounded-[5px]",children:F.jsx("div",{className:"w-[240px] h-[50px] white-no-scrollbar overflow-x-auto",children:F.jsx("div",{className:`flex items-center w-max h-full ${t?.isEditable===!1?"opacity-50 cursor-not-allowed":""}`,children:PI.map(n=>F.jsxs("div",{className:`w-[80px] h-full flex flex-col gap-[2px] items-center justify-center cursor-pointer flex-shrink-0 rounded-[5px] ${e===n.value?"bg-[#fff]":""} ${t?.isEditable===!1?"cursor-not-allowed":""}`,onClick:()=>r(n.value),children:[F.jsx("div",{className:"font-[500]",children:n.label}),F.jsx("div",{className:"text-[12px] text-[#737373]",children:n.element==="p"?"段落":n.element})]},n.value))})})})}const Tu=({ico:t="",text:e="",onMenuClick:r,onMenuClickThrough:n,className:i,onClick:a,...o})=>{const s=l=>{n?n(l):r&&r(l),a&&a(l)};return F.jsxs("div",{className:`w-check-item w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center gap-2 cursor-pointer ${i||""}`,onClick:s,...o,children:[F.jsx("i",{className:`w-iconfont icon-${t}`}),F.jsx("div",{className:"text-[14px]",children:e})]})};function Sje({hideText:t=!0,isInset:e=!1}){const{editor:r,options:n,setUploadFile:i}=Ot(),a=j.useRef(null),o=j.useMemo(()=>R_("image",n?.file?.allowedMimeTypes||[]),[n?.file?.allowedMimeTypes]),s=()=>{a.current?.click()},l=u=>{const c=u.target.files;if(c&&c.length>0)for(const f of c)r?.chain().focus().insertFile({file:f,setUploadFile:i,autoType:!0}).run();a.current&&(a.current.value="")};return e?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"image",text:"图片",onMenuClick:s}),F.jsx("input",{type:"file",accept:o,multiple:!0,ref:a,style:{display:"none"},onChange:l})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"image",text:"插入图片",hideText:t,onMenuClick:s}),F.jsx("input",{type:"file",accept:o,ref:a,style:{display:"none"},onChange:l})]})}function _je({isInset:t=!1}){const{editor:e,options:r,setUploadFile:n}=Ot(),i=j.useRef(null),a=j.useMemo(()=>R_("audio",r?.file?.allowedMimeTypes||[]),[r?.file?.allowedMimeTypes]),o=()=>{i.current?.click()},s=l=>{const u=l.target.files;if(u&&u.length>0)for(const c of u)e?.chain().focus().insertFile({file:c,setUploadFile:n,autoType:!0}).run();i.current&&(i.current.value="")};return t?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"audio",text:"音频",onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"audio",text:"插入音频",hideText:!0,onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]})}function Tje({isInset:t=!1}){const{editor:e,options:r,setUploadFile:n}=Ot(),i=j.useRef(null),a=j.useMemo(()=>R_("video",r?.file?.allowedMimeTypes||[]),[r?.file?.allowedMimeTypes]),o=()=>{i.current?.click()},s=l=>{const u=l.target.files;if(u&&u.length>0)for(const c of u)e?.chain().focus().insertFile({file:c,setUploadFile:n,autoType:!0}).run();i.current&&(i.current.value="")};return t?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"video",text:"视频",onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"video",text:"插入视频",hideText:!0,onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]})}function Cje({isInset:t=!1}){const{editor:e}=Ot(),r=()=>{e?.chain().focus().insertTag().run()};return t?F.jsx(Tu,{ico:"tag",text:"标签",onMenuClick:r}):F.jsx(Ar,{ico:"tag",text:"插入标签",hideText:!0,onMenuClick:r})}function Eje({hideText:t=!0,isInset:e=!1}){const{editor:r,options:n,setUploadFile:i}=Ot(),a=j.useRef(null),o=j.useMemo(()=>R_("file",n?.file?.allowedMimeTypes||[]),[n?.file?.allowedMimeTypes]),s=()=>{a.current?.click()},l=u=>{const c=u.target.files;if(c&&c.length>0)for(const f of c)r?.chain().focus().insertFile({file:f,setUploadFile:i,autoType:!0}).run();a.current&&(a.current.value="")};return e?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"add-file",text:"文件",onMenuClick:s}),F.jsx("input",{type:"file",accept:o,multiple:!0,ref:a,style:{display:"none"},onChange:l})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"add-file",text:"插入文件",hideText:t,onMenuClick:s}),F.jsx("input",{type:"file",accept:o,multiple:!0,ref:a,style:{display:"none"},onChange:l})]})}function Mje({isInset:t=!1}){const{editor:e}=Ot(),r=a=>"2023-01-01 00:00:00",n=({content:a,format:o,capitalize:s,value:l})=>{e?.chain().insertDatetime({text:a.includes("自定义")?`[${a}]`:a,date:r(),withTime:l==="withTime",format:o,capitalize:s}).focus().run()},i=()=>{n({content:r(),format:"YYYY-MM-DD HH:mm:ss",capitalize:!0,value:"withTime"})};return t?F.jsx(Tu,{ico:"date",text:"日期",onMenuClick:i}):F.jsx(Ar,{ico:"date",text:"插入日期",shortcut:"Ctrl+B",hideText:!0,onMenuClick:i})}function Aje({isInset:t=!1}){const{editor:e}=Ot(),r=()=>{e?.chain().focus().setHr({type:"signle",color:"#000"}).run()};return t?F.jsx(Tu,{ico:"divider",text:"分隔线",onMenuClick:r}):F.jsx(Ar,{ico:"divider",text:"分隔线",hideText:!0,onMenuClick:r})}function kje({onSelect:t}){return F.jsx("div",{className:"w-[310px] max-h-[400px] overflow-auto white-no-scrollbar",children:dje.map((e,r)=>F.jsxs(j.Fragment,{children:[F.jsx("div",{className:`text-[12px] text-[#666] mb-[10px] ${r!==0?"mt-[10px]":""}`,children:e.label}),F.jsx("div",{className:"flex flex-wrap gap-[0.5rem]",children:e.items.split(" ").map((n,i)=>F.jsx("div",{className:"text-[25px] w-[32px] h-[32px] rounded-[4px] cursor-pointer flex items-center justify-center hover:bg-[#f1f2f2]",onClick:()=>t(n),children:n},i))})]},r))})}function Nje({hideText:t=!0,onSelectEmoji:e}){const{editor:r}=Ot(),[n,i]=j.useState(!1),a=o=>{e?e(o):r?.chain().focus().insertContent(o).run(),i(!1)};return F.jsx(xl,{ico:"emoji",icoSize:16,text:"插入表情",hideText:t,popupVisible:n,onPopupVisibleChange:i,popupType:"select",placement:"right",trigger:"mouseenter",content:F.jsx(kje,{onSelect:a}),children:F.jsxs("div",{className:`w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer ${n?"bg-[#edeef2]":""}`,children:[F.jsxs("span",{className:"inline-flex items-center gap-2",children:[F.jsx("i",{className:"w-iconfont icon-emoji"}),F.jsx("span",{className:"text-[14px]",children:"表情"})]}),F.jsx("i",{className:"w-iconfont icon-right !text-[10px]"})]})})}function Dje(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=[1,2,3,4,5],[i,a]=j.useState(0),o=s=>{t?.chain().focus().setColumns(s,!0).run(),t?.chain().focus().updateAttributes("columnBlock",{columnSize:s}).run(),r(!1)};return F.jsx(xl,{ico:"column",icoSize:16,text:"插入分栏",hideText:!0,popupVisible:e,onPopupVisibleChange:r,popupType:"select",placement:"right",trigger:"mouseenter",content:F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"w-full text-center pb-2",children:[i," 分栏"]}),F.jsx("div",{className:"w-[175px] h-[80px] flex items-center gap-[6px]",children:n.map(s=>F.jsx("div",{className:`w-[30px] h-full bg-[rgba(23,26,29,0.06)] rounded-[4px] cursor-pointer flex-shrink-0 ${i>=s?"!bg-[#007bff]":""}`,onMouseEnter:()=>a(s),onClick:()=>o(s)},s))})]}),children:F.jsxs("div",{className:`w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer ${e?"bg-[#edeef2]":""}`,children:[F.jsxs("span",{className:"inline-flex items-center gap-2",children:[F.jsx("i",{className:"w-iconfont icon-column"})," ",F.jsx("span",{className:"text-[14px]",children:"分栏"})]}),F.jsx("i",{className:"w-iconfont icon-right !text-[10px]"})]})})}function Oje(){const{editor:t}=Ot();return F.jsx(Tu,{ico:"code",text:"代码块",onMenuClick:()=>t?.chain().focus().setCodeBlock().run()})}function Rje(){const{editor:t}=Ot(),e=()=>{t?.chain().focus().setParagraph().run(),t?.chain().focus().setIframe({type:"",src:""}).run()};return F.jsx(Tu,{ico:"web-page",text:"网页",onMenuClick:e})}function Dq({hideText:t=!1}){const{editor:e}=Ot(),[r,n]=j.useState(!1);return F.jsx(xl,{ico:"add-circle",icoSize:16,text:"插入元素",hideText:t,popupVisible:r,onPopupVisibleChange:n,popupType:"select",content:F.jsxs("div",{className:"w-[110px]",children:[F.jsx(Sje,{isInset:!0}),F.jsx(_je,{isInset:!0}),F.jsx(Tje,{isInset:!0}),F.jsx(Eje,{isInset:!0}),F.jsx(Cje,{isInset:!0}),F.jsx(Mje,{isInset:!0}),F.jsx(Aje,{isInset:!0}),F.jsx(Nje,{}),F.jsx(Dje,{}),F.jsx(Oje,{}),F.jsx(Rje,{})]}),children:t&&F.jsxs("button",{disabled:e?.isEditable===!1,className:`white-editor-tool-item flex items-center justify-center gap-[6px] px-[7px] ${e?.isEditable===!1?"is-disabled":""}`,title:"插入元素",children:[F.jsx("i",{className:"w-iconfont icon-add-circle"}),F.jsx("span",{className:"text-[14px]",children:"插入"})]})})}function Oq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"task-list",text:"任务列表",shortcut:"Ctrl+Shift+9",hideText:!0,menuActive:t?.isActive("taskList"),disabled:!t?.can().chain().focus().toggleTaskList().run(),onMenuClick:()=>t?.chain().focus().toggleTaskList().run()})}function Ije(){const{page:t,editor:e}=Ot(),[,r]=j.useState({});return j.useEffect(()=>{if(!e)return;const n=()=>r({});return e.on("transaction",n),e.on("selectionUpdate",n),()=>{e.off("transaction",n),e.off("selectionUpdate",n)}},[e]),F.jsxs("div",{className:"flex w-full h-full",children:[F.jsx(fVe,{className:"flex-1 h-full p-[10px]",children:t?.toolbar==="double"?F.jsxs("div",{className:"inline-flex items-center mx-auto",children:[F.jsx("div",{className:"pr-[20px] flex-shrink-0",children:F.jsx(Dq,{})}),F.jsxs("div",{className:"space-y-[6px] px-[20px] border-r border-l",children:[F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(bq,{}),F.jsx(xq,{})]}),F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(wq,{}),F.jsx(Sq,{})]})]}),F.jsxs("div",{className:"space-y-[6px] px-[20px] border-r",children:[F.jsxs("div",{className:"space-x-[8px] flex",children:[F.jsx(Mq,{}),F.jsx(Eq,{}),F.jsx(bje,{}),F.jsx(xje,{})]}),F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(DI,{}),F.jsx(OI,{}),F.jsx(RI,{}),F.jsx(II,{}),F.jsx(vq,{}),F.jsx(pq,{}),F.jsx(aq,{}),F.jsx(oq,{})]})]}),F.jsxs("div",{className:"space-y-[6px] px-[20px] border-r",children:[F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(fq,{}),F.jsx(dq,{}),F.jsx(hq,{}),F.jsx(Nq,{}),F.jsx(yq,{}),F.jsx(Oq,{})]}),F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(mje,{}),F.jsx(yje,{}),F.jsx(gq,{}),F.jsx(mq,{}),F.jsx(_q,{})]})]}),F.jsx("div",{className:"px-[20px] border-r",children:F.jsx(wje,{})}),F.jsxs("div",{className:"space-x-[6px] pl-[20px] flex",children:[F.jsx(Tq,{hideText:!1}),F.jsx(BI,{hideText:!1}),F.jsx(Cq,{hideText:!1})]})]}):F.jsxs("div",{className:"inline-flex items-center gap-[10px] mx-auto",children:[F.jsx(Dq,{hideText:!0}),F.jsx(bq,{}),F.jsx(xq,{}),F.jsx(wq,{}),F.jsx(Sq,{}),F.jsx(pje,{}),F.jsx(Mq,{}),F.jsx(Eq,{}),F.jsx(DI,{}),F.jsx(OI,{}),F.jsx(RI,{}),F.jsx(II,{}),F.jsx(aq,{}),F.jsx(oq,{}),F.jsx(fq,{}),F.jsx(dq,{}),F.jsx(Oq,{}),F.jsx(hq,{}),F.jsx(Nq,{}),F.jsx(Koe,{}),F.jsx(yq,{}),F.jsx(vq,{}),F.jsx(pq,{}),F.jsx(_q,{}),F.jsx(gq,{}),F.jsx(mq,{}),F.jsx(BI,{}),F.jsx(Tq,{}),F.jsx(Cq,{})]})}),F.jsx("div",{className:"px-4 inline-flex items-center",children:F.jsx(dVe,{})})]})}function Lje(){const{options:t,page:e,setPage:r,dicts:n}=Ot(),[i,a]=j.useState(!1),[o,s]=j.useState(!1),{editor:l}=Ot(),u={characters:l?.storage.characterCount?.characters()??0,words:l?.storage.characterCount?.words()??0,paragraphs:0,images:0,headings:0};if(l){let d=0,h=0,p=0;l.state.doc.descendants(v=>(v.type.name==="paragraph"&&d++,v.type.name==="image"&&h++,v.type.name==="heading"&&p++,!0)),u.paragraphs=d,u.images=h,u.headings=p}const c=d=>{if(d.layout==="web"){r(h=>({...h,layout:d.layout}));return}r(h=>({...h,size:{width:d.width,height:d.height}}))},f=j.useMemo(()=>{if(!e?.size)return"";const d=n.pageSizeOption.find(h=>h.width===e.size.width&&h.height===e.size.height);return d?d.label:""},[e,n]);return F.jsxs("div",{className:"h-full flex items-center gap-[0.8rem]",children:[t.layout.toc.show&&F.jsx("span",{className:`cursor-pointer hover:bg-[#e8e8e8] p-[0.3rem] rounded ${e.showToc?"bg-[#e8e8e8]":""}`,title:e.showToc?"关闭大纲":"打开大纲",onClick:()=>r(d=>({...d,showToc:!d.showToc})),children:F.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",children:[F.jsx("path",{d:"M369.0496 460.3392H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.832a81.92 81.92 0 0 1-81.92 81.92zM184.32 173.1072a20.48 20.48 0 0 0-20.48 20.48v184.832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.832a20.48 20.48 0 0 0-20.48-20.48zM369.0496 914.688H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92zM184.32 627.4048a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48zM827.904 914.688h-184.8832a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.8832a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92z m-184.8832-287.2832a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.8832a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48z",fill:"#474A54","p-id":"15222"}),F.jsx("path",{d:"M527.230586 280.884442m36.203867-36.203867l130.732164-130.732164q36.203867-36.203867 72.407735 0l130.732164 130.732164q36.203867 36.203867 0 72.407735l-130.732164 130.732164q-36.203867 36.203867-72.407735 0l-130.732164-130.732164q-36.203867-36.203867 0-72.407735Z",fill:"#FDA338","p-id":"15223"}),F.jsx("path",{d:"M730.3168 493.4656a81.92 81.92 0 0 1-57.9072-23.9104L541.696 338.7904a81.92 81.92 0 0 1 0-115.8144L672.4096 92.16A81.92 81.92 0 0 1 788.48 92.16l130.7648 130.7136a81.92 81.92 0 0 1 0 115.8144L788.48 469.5552a81.92 81.92 0 0 1-58.1632 23.9104z m0-363.52a20.48 20.48 0 0 0-14.4896 5.9904L585.1136 266.24a20.48 20.48 0 0 0 0 28.9792l130.7136 130.7136a20.48 20.48 0 0 0 28.9792 0L875.52 295.3728a20.48 20.48 0 0 0 0-29.1328l-130.7136-130.56a20.48 20.48 0 0 0-14.4896-5.9904z",fill:"#474A54","p-id":"15224"})]})}),F.jsx(ol,{trigger:"click",placement:"top",value:i,onVisibleChange:a,contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:F.jsx("div",{className:"flex flex-col",children:n.pageSizeOption.map((d,h)=>F.jsxs("div",{className:`px-[12px] py-[7px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)] ${f===d.label?"text-[#007aff]":""}`,onClick:()=>{c(d),a(!1)},children:[F.jsx("span",{className:"text-[14px] font-[500]",children:d.label}),d.width&&F.jsxs("span",{className:"text-[12px] ml-[0.4rem]",children:[d.width," * ",d.height,"cm"]})]},h))}),children:t.layout.foot.pageSize&&F.jsxs("div",{className:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none",children:[F.jsx("span",{className:"flex-1 text-center text-[14px]",children:"页面大小"}),F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${i?"rotate-180":""}`})]})}),F.jsx(ol,{trigger:"click",value:o,onVisibleChange:s,placement:"top",content:F.jsxs("div",{className:"w-[150px] flex flex-col gap-[0.8rem] text-[14px] px-[0.6rem] py-2",children:[F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"字符数:"}),u.characters]}),F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"段落:"}),u.paragraphs]}),F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"图片:"}),u.images]}),F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"标题:"}),u.headings]})]}),children:t.layout.foot.character&&F.jsxs("div",{className:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none",children:[F.jsxs("span",{className:"flex-1 text-center text-[14px]",children:[u.characters," 字符"]}),F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${o?"rotate-180":""}`})]})})]})}var Wx={exports:{}},Pje=Wx.exports,Rq;function Bje(){return Rq||(Rq=1,(function(t,e){(function(r,n){n()})(Pje,function(){function r(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function n(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){l(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function a(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof sc=="object"&&sc.global===sc?sc:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,f){var d=o.URL||o.webkitURL,h=document.createElement("a");c=c||u.name||"download",h.download=c,h.rel="noopener",typeof u=="string"?(h.href=u,h.origin===location.origin?a(h):i(h.href)?n(u,c,f):a(h,h.target="_blank")):(h.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(r(u,f),c);else if(i(u))n(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){a(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return n(u,c,f);var h=u.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var b=g.result;b=v?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=b:location=b,d=null},g.readAsDataURL(u)}else{var m=o.URL||o.webkitURL,y=m.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});o.saveAs=l.saveAs=l,t.exports=l})})(Wx)),Wx.exports}var zje=Bje();const Fje=()=>{const t=document.createElement("iframe");return t.style.width="0",t.style.height="0",t.style.position="absolute",t.style.right="0",t.style.top="0",t.style.border="0",document.body.appendChild(t),t},Vje=async(t,e)=>{const r=Fje(),n=r.contentWindow;if(!r.contentDocument||!n)return;r.contentDocument.write(t),r.contentDocument.close();const i=()=>{console.log("handleLoadIframe"),n.focus(),n.print()},a=()=>{r.removeEventListener("load",i),n.removeEventListener("afterprint",a),document.body.removeChild(r),e()};r.addEventListener("load",i),n.addEventListener("afterprint",a)};function Hje(){const{options:t,container:e,page:r,dicts:n}=Ot(),i=j.useMemo(()=>n?.lineHeights?.find(c=>c.default)?.value??1.7,[n]),a=c=>{const f=document.createElement("div");f.innerHTML=c;const d=f.querySelectorAll(".white-chart-node");for(const h of d){const p=tre(h);if(p){const v=p.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#fff"}),g=document.createElement("img");g.src=v,g.style.width="100%",h?.parentNode?.replaceChild(g,h)}}return f.innerHTML},o=()=>Array.from(document.querySelectorAll("link, style")).map(c=>c.outerHTML).join(""),s=()=>{const c=document.querySelector(`#${e} .white-editor-container`)?.outerHTML??"";return a(c)},l=()=>{const{size:c,margin:f}=r;return`
|
|
398
|
+
<path d="M14 27v6H8v-6h6zm0-9v6H8v-6h6zm0-9v6H8V9h6z"></path>`}],dje=[{label:"表情与角色",items:"😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 😉 😊 😇 🥰 😍 🤩 😘 😗 😚 😙 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🤫 🤔 🤐 🤨 😐 😑 😶 😶 😏 😒 🙄 😬 😮 🤥 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤮 🤧 🥵 🥶 🥴 😵 😵💫 🤯 🤠 🥳 😎 🤓 🧐 😕 😟 🙁 ☹️ 😮 😯 😲 😳 🥺 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬 😈 👿 💀 ☠️ 💩 🤡 👹 👺 👻 👽 👾 🤖 👋 🤚 🖐️ ✋ 🖖 👌 🤏 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 🖕 👇 ☝️ 👍 👎 ✊ 👊 🤛 🤜 👏 🙌 👐 🤲 🤝 🙏 ✍️ 💅 🤳 💪 🦾 🦿 🦵 🦶 👂 🦻"},{label:"动物与自然",items:"🐵 🐒 🦍 🦧 🐶 🐕 🦮 🐕🦺 🐩 🐺 🦊 🦝 🐱 🐈 🐈⬛ 🦁 🐯 🐅 🐆 🐴 🐎 🦄 🦓 🦌 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🦙 🦒 🐘 🦏 🦛 🐭 🐁 🐀 🐹 🐰 🐇 🐿️ 🦔 🦇 🐻 🐻❄️ 🐨 🐼 🦥 🦦 🦨 🦘 🦡 🐾 🦃 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🕊️ 🦅 🦆 🦢 🦉 🦩 🦚 🦜 🐸 🐊 🐢 🦎 🐍 🐲 🐉 🦕 🦖 🐳 🐋 🐬 🦭 🐟 🐠 🐡 🦈 🐙 🐚 🐌 🦋 🐛 🐜 🐝 🐞 🦗 🕷️ 🕸️ 🦂 🦟 🦠 💐 🌸 💮 🏵️ 🌹 🥀 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 ☘️ 🍀 🍁 🍂 🍃 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 ☀️ 🌝 🌞 🪐 🌟 🌠 🌌 ☁️ ⛅ ⛈️ 🌤️ 🌥️ 🌦️ 🌧️ 🌨️ 🌩️ 🌪️ 🌫️ 🌬️ 🌀 🌈 🌂 ☂️ ☔ ⛱️ ⚡ ❄️ ☃️ ⛄ ☄️ 🔥 💧 🌊"},{label:"食物与食品",items:"🍇 🍉 🍊 🍋 🍌 🍍 🥭 🍎 🍏 🍐 🍑 🍒 🍓 🥝 🍅 🥥 🥑 🍆 🥔 🥕 🌽 🌶️ 🥬 🥦 🧄 🧅 🍄 🥜 🌰 🍞 🥐 🥖 🥨 🥯 🥞 🧇 🧀 🍖 🍗 🥩 🥓 🍔 🍟 🍕 🌭 🥪 🌮 🌯 🥙 🧆 🥚 🍳 🥘 🍲 🥣 🥗 🍿 🧈 🧂 🥫 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🥮 🍡 🥟 🥠 🥡 🦀 🦞 🦐 🦑 🦪 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🧁 🥧 🍫 🍬 🍭 🍮 🍯 🍼 🥛 ☕ 🍵 🍶 🍾 🍷 🍸 🍹 🍺 🍻 🥂 🥃 🥤 🧃 🧉 🧊 🥢 🍽️ 🍴 🥄 🔪 🏺"},{label:"活动",items:"🧧 🎁 🎄 🧨 ✨ 🎈 🎉 🏮 🎗️ 🎟️ 🎫 🎖️ 🏆 🏅 🥇 🥈 🥉 ⚽ ⚾ 🥎 🏀 🏐 🏈 🏉 🎾 🥏 🎳 🏏 🏑 🏒 🥍 🏓 🏸 🥊 🥋 🥅 ⛳ ⛸️ 🎣 🤿 🎽 🎿 🛷 🥌 🎯 🪀 🪁 🎱 🔮 🧿 🎮 🕹️ 🎰 🎲 🧩 🧸 ♟️ 🃏 🀄 🎴 🎭 🖼️ 🎨 🧵 🧶"},{label:"旅行与景点",items:"🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🚚 🚛 🚜 🏎️ 🏍️ 🛵 🦽 🦼 🛺 🚲 🛴 🛹 🚏 🛣️ 🛤️ 🛢️ ⛽ 🚨 🚥 🚦 🛑 🚧 ⚓ ⛵ 🛶 🚤 🛳️ ⛴️ 🛥️ 🚢 ✈️ 🛩️ 🛫 🛬 🪂 💺 🚁 🚟 🚠 🚡 🛰️ 🚀 🛸 🛎️ 🧳 🧭 ⌚ ⏰ ⏱️ ⏲️ 🕰️ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦"},{label:"物品",items:"📔 📕 📖 📗 📘 📙 📚 📒 📃 📜 📄 📰 🗞️ 📑 🔖 🏷️ 💰 🔍 🔎 💴 💵 💶 💷 💸 💳 🧾 💹 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 🗳️ ✏️ ✒️ 🖋️ 🖊️ 🖌️ 🖍️ 📝 💼 📁 📂 🗂️ 📅 📆 🗒️ 🗓️ 📇 📈 📉 📊 📋 📌 📍 📎 🖇️ 📏 📐 ✂️ 🗃️ 🗄️ 🗑️ 🔒 🔓 🔏 🔐 🔑 🗝️ 🔨 🪓 ⛏️ ⚒️ 🛠️ 🗡️ ⚔️ 🔫 🏹 🛡️ 🔧 🔩 ⚙️ 🗜️ ⚖️ 🦯 🔗 ⛓️ 🧰 🧲 ⚗️ 🧪 🧫 🧬 🔬 🔭 📡 💉 🩸 💊 🩹 🩺 🚪 🛏️ 🛋️ 🪑 🚽 🚿 🛁 🪒 🧴 🧷 🧹 🧺 🧻 🧼 🧽 🧯 🛒 🚬 ⚰️ ⚱️ 💎 🔇 🔈 🔉 🔊 🔔 🔕 🔋 🔌 💻 🖥️ 🖨️ ⌨️ 🖱️ 🖲️ 📷 🧱"},{label:"符号",items:"💡 ✅ ☑️ ✔️ ❌ ❎ ❓ ❗ ❔ ❕ ⌛ ⏳ 💰 🆒 🆕 🆖 🅾️ 🆗 🆘 🈲 🉑 🈸 ⛔ 🚫 📵 ✳️ ✴️ ❇️ 🔟 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 ℹ️ 🆔 🆕 🆖 🅾️ 🆗 🅿️ 🆘 🆙 🆚 🈁 🈂️ 🔴 🟠 🟡 🟢 🔵 🟣 🟤 ⚫ ⚪ 🟥 🟧 🟨 🟩 🟦 🟪 🟫 🔶 🔷 🔸 🔹 🔺 🔻 💠 🔘 🔳 🔲 💌 💘 💝 💖 💗 💓 💞 💕 💟 ❣️ 💔 🤍 💯 💢 💥 💬 💤 ➰ ➿ 🔅 📴 ➡️ 🔃 🔄 🔙 🔚 🔛 🔝 🔀 🔁 🔂"}],cq=[{label:"网页",value:"web",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M867.62382187 81.79484409c53.52106667 0 96.93866667 43.37208853 96.93866666 96.89315627v664.0071104a102.4 102.4 0 0 1-102.4 102.4H161.83751147a102.4 102.4 0 0 1-102.4-102.4V178.64248889c0-53.52106667 43.37208853-96.93866667 96.8931552-96.93866667z m28.6264896 319.2604448H127.74968853v441.59431147c0 17.29422187 12.83413333 31.58471147 29.4912 33.8147552l4.64213334 0.31857813h700.23395626a34.13333333 34.13333333 0 0 0 34.13333334-34.13333333V401.05528889z m-34.13333334-250.99377813H161.88302187a34.13333333 34.13333333 0 0 0-34.13333334 34.13333333V332.74311076h768.50062294V184.19484409a34.13333333 34.13333333 0 0 0-34.13333334-34.13333333zM216.9059552 195.93671076a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z m136.53333333 0a45.51111147 45.51111147 0 1 1 0 91.02222293 45.51111147 45.51111147 0 0 1 0-91.02222293z" fill="#515151" p-id="6081"></path></svg>',validate:t=>t.startsWith("http://")||t.startsWith("https://")},{label:"哔哩哔哩",value:"bilibili",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.39 3.714h.5c.88.032 1.614.337 2.2.918.586.58.889 1.312.91 2.194v4.293c-.021.88-.324 1.615-.91 2.201-.586.586-1.32.889-2.2.91H4.11c-.88-.021-1.614-.324-2.2-.91-.586-.586-.889-1.32-.91-2.2V6.825c.021-.882.324-1.613.91-2.194.586-.58 1.32-.886 2.2-.918h.452l-.684-.653a.72.72 0 0 1-.218-.529.72.72 0 0 1 .218-.529l.015-.015a.763.763 0 0 1 .537-.218c.202 0 .38.072.537.218L6.63 3.59c.041.041.078.083.109.124h2.49a.487.487 0 0 1 .092-.124l1.665-1.602a.763.763 0 0 1 .536-.218c.203 0 .386.088.542.233a.691.691 0 0 1 .228.53.72.72 0 0 1-.217.528l-.685.653zm-7.28 1.51c-.434.01-.8.16-1.096.45-.295.29-.448.66-.458 1.105v4.387c.01.445.163.813.458 1.104.296.29.662.441 1.097.45h7.778c.435-.009.801-.16 1.097-.45.295-.29.448-.659.458-1.104V6.779c-.01-.446-.163-.814-.458-1.105a1.563 1.563 0 0 0-1.097-.45H4.111zm1.557 2.255c.217 0 .399.072.544.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.736.736 0 0 1-.544.218.739.739 0 0 1-.545-.218.809.809 0 0 1-.233-.56v-.684c0-.218.075-.402.225-.553a.753.753 0 0 1 .553-.225zm4.666 0c.218 0 .4.072.545.218a.809.809 0 0 1 .233.56v.684a.809.809 0 0 1-.233.56.737.737 0 0 1-.545.218.739.739 0 0 1-.544-.218.809.809 0 0 1-.233-.56v-.684a.809.809 0 0 1 .233-.56.738.738 0 0 1 .544-.218z" fill="#07A3D7"/></svg>',validate(t){return/^https?:\/\/(www\.)?bilibili\.com\/video\/[a-zA-Z0-9]+/.test(t)},transformURL(t){const e=t.match(/\/video\/([a-zA-Z0-9]+)/)?.[1];return e?`https://player.bilibili.com/player.html?bvid=${e}`:""}},{label:"优酷",value:"youku",icon:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M270.528 902.592c-82.688-45.952-104.576-161.984-43.072-232 26.688-30.208 214.592-142.784 229.632-137.344 17.088 5.504 7.488-.64-112.768-71.36-105.92-62.464-129.152-83.776-144.896-129.792-34.816-105.664 58.112-218.944 166.08-202.496 24.576 4.096 102.528 42.56 175.616 87.168 13.696 8.32 70.4 41.216 125.76 73.472 119.616 69.376 153.792 97.472 178.368 148.288 20.48 41.856 24.576 100.928 10.24 151.68-8.896 32.32-41.664 78.976-71.04 100.992l-19.2 14.4-33.408-19.2c-19.2-11.008-34.176-17.92-34.176-15.808 0 1.344 12.288 10.24 27.328 18.56 15.04 8.896 27.328 17.152 27.328 19.2 0 4.8-281.6 168.832-334.208 194.24-51.904 26.112-100.48 26.112-147.584 0z" fill="#018EFF"/><path d="M665.984 654.4c0-1.088-6.912-5.888-15.936-10.624-20.16-10.112-21.248-5.888-1.088 4.736 16.512 9.024 17.024 9.6 17.024 5.888zm-50.56 5.952c-8.448-7.424-55.744-33.408-55.744-30.72 0 2.56 53.632 35.008 58.432 35.52 1.024 0 0-2.112-2.688-4.8z" fill="#018EFF"/><path d="M673.472 653.44a4171.008 4171.008 0 0 0-126.336-72.768c-43.712-24.064-92.224-52.864-233.6-137.344C238.4 398.72 213.76 374.016 199.424 332.16c-34.816-105.664 58.048-218.944 166.016-202.496 24.576 4.096 102.4 42.56 175.552 87.168 13.632 8.32 70.336 41.216 125.632 73.472 114.112 65.92 146.88 92.032 170.752 133.184 47.872 81.728 29.44 195.008-40.96 257.472-13.632 11.648-27.968 21.248-32.768 21.248-4.8-.64-45.12-21.952-90.176-48.704z" fill="#FF396E"/><path d="M270.464 902.592A152.32 152.32 0 0 1 193.28 781.76c-6.144-76.8 21.184-115.328 130.496-179.84l75.136-44.608L568.96 630.08c93.568 39.808 172.8 72.064 176.256 72.064 4.096 0 6.784 2.048 6.784 5.504 0 5.504-273.216 165.44-334.016 194.944-51.84 26.112-100.352 26.112-147.52 0z" fill="#00BEFF"/></svg>',validate(t){return/^https?:\/\/v\.youku\.com\/v_show\/id_[a-zA-Z0-9]+/.test(t)},transformURL(t){const e=t.match(/\/id_([a-zA-Z0-9]+)/)?.[1];return e?`https://player.youku.com/embed/${e}`:""}},{label:"Figma",value:"figma",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.324 8c0-1.475 1.2-2.675 2.675-2.675 1.475 0 2.675 1.2 2.675 2.675 0 1.475-1.2 2.675-2.675 2.675A2.678 2.678 0 0 1 8.324 8z" fill="#1ABCFE"/><path d="M3 13.325c0-1.475 1.2-2.675 2.675-2.675h2.65v2.675C8.325 14.8 7.125 16 5.65 16 4.175 16 3 14.8 3 13.325z" fill="#0ACF83"/><path d="M8.324 0v5.325H11c1.475 0 2.675-1.2 2.675-2.675C13.674 1.175 12.474 0 11 0H8.324z" fill="#FF7262"/><path d="M3 2.675C3 4.15 4.2 5.35 5.675 5.35h2.65V0H5.65C4.175 0 3 1.2 3 2.675z" fill="#F24E1E"/><path d="M3 8c0 1.475 1.2 2.675 2.675 2.675h2.65v-5.35H5.65C4.175 5.325 3 6.525 3 8z" fill="#A259FF"/></svg>',validate(t){return/^https?:\/\/www\.figma\.com\/file\/[a-zA-Z0-9]+/.test(t)},transformURL(t){const e=t.match(/\/file\/([a-zA-Z0-9]+)/)?.[1];return e?`https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/${e}`:""}},{label:"墨刀",value:"mado",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 3h2.715v4.752H2V3zm6.958 0H6.242v4.752h2.716V3zm4.582 0h-2.716v4.752h2.716V3zM9.107 14l-1.096-2.5a3.905 3.905 0 0 0 2.812-3.748h2.716A6.621 6.621 0 0 1 9.107 14z" fill="#F33"/></svg>',validate(t){return/^https?:\/\/modao\.cc\/app\/[a-zA-Z0-9]+/.test(t)},transformURL(t){return t}},{label:"腾讯视频",value:"tencent_video",icon:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.314 14.541c-1.416-.025-1.71-1.416-1.964-3.16-.155-1.06-.182-2.155-.182-3.23 0-1.074.027-2.169.182-3.23.31-2.14.685-3.75 3.123-2.95 2.336.768 4.586 2.126 6.56 3.67.1.085.209.177.324.272.705.59 1.62 1.355 1.642 2.239-.021.882-.936 1.647-1.641 2.237-.115.096-.225.187-.324.274-1.975 1.543-4.225 2.901-6.561 3.67-.418.136-.774.203-1.08.208h-.08z" fill="#4396F7"/><path d="M2.98 13.143c-1.202-.029-1.527-.954-1.755-2.162l-.02-.1-.036-.206C1.025 9.847 1 8.991 1 8.152c0-.84.025-1.694.17-2.523l.036-.205.019-.1c.267-1.418.668-2.447 2.464-2.094-.151.487-.247 1.067-.339 1.692-.154 1.061-.181 2.156-.181 3.23 0 1.074.027 2.169.181 3.23.092.624.188 1.204.34 1.692a3.501 3.501 0 0 1-.592.07H2.98z" fill="#EF8E34"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.689 3.229c.125.025.256.055.395.094 2.181.6 4.28 1.66 6.124 2.866.66.483 1.812 1.16 1.834 1.962-.023.803-1.175 1.48-1.834 1.963-1.843 1.205-3.943 2.266-6.124 2.866-.139.038-.27.069-.395.094-.151-.488-.248-1.068-.338-1.693-.155-1.06-.182-2.156-.182-3.23 0-1.074.027-2.169.182-3.23.09-.62.185-1.197.335-1.683l.003-.009z" fill="#78E445"/><path d="M4.845 8.156c0-1.82.13-2.04.13-2.04.053-.234.18-.298.378-.241 0 0 .587.124 2.006.87 1.435.754 1.875 1.168 1.875 1.168.217.188.172.305 0 .483 0 0-.269.308-1.875 1.14-1.606.83-2.006.894-2.006.894-.239.056-.332-.015-.377-.24 0 0-.13-.21-.13-2.034z" fill="#fff"/></svg>',validate(t){return t.startsWith("https://modao.cc/proto/")},transformURL(t){const e=t.match(/\/cover\/[a-zA-Z0-9]+\/([a-zA-Z0-9]+)/)?.[1];return e?`https://v.qq.com/iframe/player.html?vid=${e}`:""}}];function fq(){const{editor:t}=Ot(),[e,r]=j.useState(!1),[n,i]=j.useState(""),a=o=>{if(!t)return;const s=t.chain().focus();t.isActive("orderedList")?t.getAttributes("orderedList").listType===o?s.toggleOrderedList().run():s.updateAttributes("orderedList",{listType:o}).run():(s.toggleOrderedList().run(),t.chain().updateAttributes("orderedList",{listType:o}).run()),i(o),r(!1)};return F.jsx(xl,{ico:"ordered-list",icoSize:16,text:"有序列表",hideText:!0,shortcut:"Ctrl+Shift+7",popupVisible:e,popupType:"arrow",onMenuClick:()=>{t?.isEditable!==!1&&a(lq[0].value)},onPopupVisibleChange:r,content:F.jsx("div",{className:"w-[170px] flex flex-wrap gap-[10px]",children:lq.map((o,s)=>F.jsx("div",{className:`w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5] overflow-hidden ${n===o.value?"border-[#333639]":""}`,onClick:()=>a(o.value),children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",dangerouslySetInnerHTML:{__html:o.code}})},s))})})}function dq(){const{editor:t}=Ot(),[e,r]=j.useState(!1),[n,i]=j.useState(""),a=o=>{if(!t)return;const s=t.chain().focus();t.isActive("bulletList")?t.getAttributes("bulletList").listType===o?s.toggleBulletList().run():s.updateAttributes("bulletList",{listType:o}).run():(s.toggleBulletList().run(),t.chain().updateAttributes("bulletList",{listType:o}).run()),i(o),r(!1)};return F.jsx(xl,{ico:"bullet-list",icoSize:16,text:"无序列表",hideText:!0,shortcut:"Ctrl+Shift+7",popupVisible:e,popupType:"arrow",onMenuClick:()=>{t?.isEditable!==!1&&a(uq[0].value)},onPopupVisibleChange:o=>{if(r(o),o&&t){const{listType:s}=t.getAttributes("bulletList");i(s)}},content:F.jsx("div",{className:"w-[170px] flex flex-wrap gap-[10px]",children:uq.map((o,s)=>F.jsx("div",{className:`w-[50px] h-[50px] cursor-pointer rounded-[3px] flex items-center justify-center border hover:bg-[#F5F5F5] ${n===o.value?"border-[#333639]":""}`,onClick:()=>a(o.value),children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 44 44",dangerouslySetInnerHTML:{__html:o.code}})},s))})})}function hq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"indent-right",text:"增加缩进",shortcut:"Tab",hideText:!0,onMenuClick:()=>t?.chain().focus().indent().run()})}const B2=({ico:t="",icoSize:e=16,text:r="",hideText:n=!1,forceEnabled:i=!1,disabled:a=!1,menuActive:o=!1,dropType:s="dropdown",popupVisible:l,maxHeight:u=!0,editor:c,onMenuClick:f,onMenuClickThrough:d,onPopupVisibleChange:h,className:p,onClick:v,content:g,children:m,...y})=>{const[b,x]=j.useState(!1),w=l!==void 0?l:b,_=V=>{l===void 0&&x(V),h?.(V)},C=V=>{V.stopPropagation(),d?d(V):f&&f(V),v&&v(V)},D=c?.isEditable!==!1,O=!i&&(a||!D),I=["white-editor-tool-item","white-editor-tool-drop-item","flex","items-center","justify-center",n?"":"is-show-text",o&&D?"is-active":"",O?"is-disabled":"",p||""].filter(Boolean).join(" "),L=g||m;return s==="dropdown"?F.jsxs("button",{className:I,disabled:O,title:r,...y,children:[F.jsxs("div",{className:"flex items-center h-full",onClick:C,children:[F.jsx("i",{className:`w-iconfont icon-${t}`,style:{fontSize:`${e}px`}}),!n&&F.jsx("p",{className:"text-[13px] text-[#333639] ml-[3px]",children:r})]}),F.jsx(ol,{trigger:"click",value:w,onVisibleChange:_,placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:O,hasClass:"flex items-center justify-center w-[13px] h-full hover:bg-[#d7d3d3] mr-[-6px] ml-[4px] w-arrow",content:L,children:F.jsx("span",{className:"flex items-center justify-center w-full h-full",children:F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${w?"rotate-180":""}`})})})]}):F.jsx(ol,{trigger:"click",value:w,onVisibleChange:_,placement:"bottom",contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:L,children:F.jsx("button",{className:I,disabled:O,title:r,...y,children:F.jsxs("div",{className:"flex items-center gap-[4px] h-full",children:[F.jsx("i",{className:`w-iconfont icon-${t}`,style:{fontSize:`${e}px`}}),!n&&F.jsx("p",{className:"text-[13px] text-[#333639]",children:r}),F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${w?"rotate-180":""}`})]})})})};function Koe(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=j.useMemo(()=>!t||t.isActive({textAlign:"left"})?"left":t.isActive({textAlign:"center"})?"center":t.isActive({textAlign:"right"})?"right":t.isActive({textAlign:"justify"})?"justify":t.isActive({textAlign:"distributed"})?"distributed":"left",[t?.state?.selection,t?.state?.doc]),i=a=>{if(t){switch(a){case"left":t.can().chain().focus().setTextAlign("left").run()&&t.chain().focus().setTextAlign("left").run(),t.can().chain().focus().setNodeAlign("flex-start").run()&&t.chain().focus().setNodeAlign("flex-start").run();break;case"center":t.can().chain().focus().setTextAlign("center").run()&&t.chain().focus().setTextAlign("center").run(),t.can().chain().focus().setNodeAlign("center").run()&&t.chain().focus().setNodeAlign("center").run();break;case"right":t.can().chain().focus().setTextAlign("right").run()&&t.chain().focus().setTextAlign("right").run(),t.can().chain().focus().setNodeAlign("flex-end").run()&&t.chain().focus().setNodeAlign("flex-end").run();break;case"justify":t.can().chain().focus().setTextAlign("justify").run()&&t.chain().focus().setTextAlign("justify").run();break;case"distributed":t.can().chain().focus().setTextAlign("distributed").run()&&t.chain().focus().setTextAlign("distributed").run();break}r(!1)}};return F.jsxs(B2,{ico:`align-${n}`,text:"对齐方式",hideText:!0,onMenuClick:()=>{t?.isEditable!==!1&&i(n)},popupVisible:e,onPopupVisibleChange:r,children:[F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("left"),children:[F.jsx("i",{className:"w-iconfont icon-align-left"}),"左对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("center"),children:[F.jsx("i",{className:"w-iconfont icon-align-center"}),"居中对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("right"),children:[F.jsx("i",{className:"w-iconfont icon-align-right"}),"右对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("justify"),children:[F.jsx("i",{className:"w-iconfont icon-align-justify"}),"两端对齐"]}),F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-2 text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer",onClick:()=>i("distributed"),children:[F.jsx("i",{className:"w-iconfont icon-align-distributed"}),"分散对齐"]})]})}function pq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"sub-script",text:"下标",shortcut:"Ctrl+,",hideText:!0,menuActive:t?.isActive("subscript"),disabled:!t?.can().chain().focus().toggleSubscript().run(),onMenuClick:()=>t?.commands.toggleSubscript()})}function vq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"sup-script",text:"上标",shortcut:"Ctrl+.",hideText:!0,menuActive:t?.isActive("superscript"),disabled:!t?.can().chain().focus().toggleSuperscript().run(),onMenuClick:()=>t?.commands.toggleSuperscript()})}function gq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"quote",text:"引用",shortcut:"Ctrl+Shift+B",hideText:!0,menuActive:t?.isActive("blockquote"),disabled:!t?.can().chain().focus().toggleBlockquote().run(),onMenuClick:()=>t?.chain().focus().toggleBlockquote().run()})}function mq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"code",text:"代码",shortcut:"Ctrl+E",hideText:!0,menuActive:t?.isActive("code"),disabled:!t?.can().chain().focus().toggleCode().run(),onMenuClick:()=>t?.chain().focus().toggleCode().run()})}function yq(){const{editor:t,dicts:e}=Ot(),[r,n]=j.useState(!1),i=e?.lineHeights.map(o=>({label:o.label,value:o.value,active:t?.isActive({lineHeight:o.value})})),a=({content:o,value:s})=>{o&&(t?.chain().focus().setLineHeight(s).run(),n(!1))};return F.jsx(B2,{dropType:"select",ico:"line-height",text:"行高",hideText:!0,popupVisible:r,onPopupVisibleChange:n,content:F.jsx(F.Fragment,{children:i?.map(o=>F.jsx("div",{className:`px-[12px] py-[5px] flex items-center gap-[4px] text-[14px] hover:bg-[rgb(242,243,245)] cursor-pointer ${o.active?"!text-[#007bff] font-[500]":""}`,onClick:()=>a({content:o.label,value:o.value}),children:o.label},o.value))})})}function bq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"unde",text:"撤销",shortcut:"Ctrl+Z",hideText:!0,disabled:!t?.can().chain().focus().undo().run(),onMenuClick:()=>t?.chain().focus().undo().run()})}function xq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"redo",text:"重做",shortcut:"Ctrl+Y",hideText:!0,disabled:!t?.can().chain().focus().redo().run(),onMenuClick:()=>t?.chain().focus().redo().run()})}function wq(){const{editor:t}=Ot(),e=r=>{if(t?.view?.painter?.enabled){t?.commands.unsetFormatPainter();return}t?.chain().focus().setFormatPainter(r).run()};return F.jsx(Ar,{ico:"format-painter",text:"格式刷",menuActive:t?.view?.painter?.enabled,disabled:t?.state?.selection?.empty,hideText:!0,onMenuClick:()=>e(!0),onDoubleClick:()=>e(!1)})}function Sq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"clear-format",text:"清除格式",hideText:!0,onMenuClick:()=>t?.chain().focus().unsetAllMarks().run()})}function _q(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"hard-break",text:"换行",hideText:!0,shortcut:"Shift+Enter",onMenuClick:()=>t?.chain().focus().setHardBreak().run()})}const Yoe=({value:t,disabled:e=!1,children:r,onChange:n,className:i=""})=>{const a=s=>{e||n?.(s.target.checked)},o=["white-checkbox",t?"checked":"",e?"disabled":"",i].filter(Boolean).join(" ");return F.jsxs("label",{className:o,children:[F.jsx("span",{className:"checkbox-input"}),F.jsx("input",{className:"checkbox-original",type:"checkbox",checked:t,onChange:a,disabled:e}),F.jsx("span",{className:"checkbox-label",children:r})]})};function hje({onInsert:t}){const[e,r]=j.useState(!0),[n,i]=j.useState([]),a=()=>{if(!n.length)return;const[o,s]=n;t({row:o,col:s,checked:e})};return F.jsxs("div",{className:"w-full white-table-generator-content",children:[F.jsxs("div",{className:"text-[14px] font-[600] mb-[5px] user-select-none flex items-center justify-between",children:[F.jsxs("span",{children:["表格 ",`${n[0]||0} * ${n[1]||0}`]}),F.jsx(Yoe,{value:e,onChange:r,children:"包含表头"})]}),F.jsx("table",{onMouseLeave:()=>i([]),onClick:a,children:F.jsx("tbody",{children:Array.from({length:10},(o,s)=>s+1).map(o=>F.jsx("tr",{children:Array.from({length:10},(s,l)=>l+1).map(s=>F.jsx("td",{onMouseEnter:()=>i([o,s]),children:F.jsx("div",{className:`cell cursor-pointer ${n.length&&n[0]&&n[1]&&o<=n[0]&&s<=n[1]?"active":""}`})},s))},o))})})]})}function Tq({hideText:t=!0}){const{editor:e}=Ot(),[r,n]=j.useState(!1),i=a=>{const{row:o,col:s,checked:l}=a;e?.chain().focus().insertTable({rows:o,cols:s,withHeaderRow:l}).run(),n(!1)};return F.jsx(xl,{ico:"edit-table",icoSize:16,text:"插入表格",hideText:t,popupVisible:r,onPopupVisibleChange:n,popupType:"select",content:F.jsx(hje,{onInsert:i})})}const jd=j.forwardRef(({value:t,disabled:e=!1,placeholder:r="",simple:n=!1,status:i="",size:a="",prefix:o,suffix:s,onChange:l,onInput:u,onBlur:c,onFocus:f,onEnter:d,className:h=""},p)=>{const[v,g]=j.useState(!1),m=j.useRef(null);j.useImperativeHandle(p,()=>({focus:()=>{m.current?.focus()}}));const y=C=>{l?.(C.target.value),u?.(C)},b=C=>{g(!0),f?.(C)},x=C=>{g(!1),c?.(C)},w=C=>{C.key==="Enter"&&d?.(C)},_=["white-input-wrapper",e?"disabled":"",v?"focused":"",n?"simple":"",a||"",i==="success"?"status-success":"",i==="error"?"status-error":"",h].filter(Boolean).join(" ");return F.jsxs("div",{className:_,children:[F.jsx("span",{className:"prefix",children:o}),F.jsx("input",{type:"text",ref:m,disabled:e,value:t,placeholder:r,onChange:y,onFocus:b,onBlur:x,onKeyDown:w}),F.jsx("span",{className:"suffix",children:s})]})});jd.displayName="Input";const ts=({checked:t=!1,disabled:e=!1,type:r="default",size:n="normal",first:i=!1,last:a=!1,children:o,onClick:s,className:l=""})=>{const u=f=>{e||s?.(f)},c=["white-button",e?"disabled":"",!e&&t?"checked":"",!e&&r==="default"?"default":"",!e&&r==="primary"?"primary":"",!e&&r==="checkbox"?"checkbox":"",!e&&r==="radio"?"radio":"",n==="small"?"small":"",i?"first":"",a?"last":"",l].filter(Boolean).join(" ");return F.jsx("button",{className:c,onClick:u,children:o})};function Cq({hideText:t=!0}){const{editor:e}=Ot(),[r,n]=j.useState(!1),[i,a]=j.useState(""),[o,s]=j.useState(""),l=()=>{e?.commands.setLink({href:i,target:"_blank"}),e?.chain().focus().insertContent(o).run(),n(!1)},u=()=>{a(""),s(""),n(!1)};return F.jsx(xl,{ico:"link",icoSize:16,text:"插入链接",hideText:t,popupVisible:r,onPopupVisibleChange:n,popupType:"select",content:F.jsxs("div",{className:"w-[250px]",children:[F.jsx("div",{className:"font-[500] text-[14px] mb-[5px]",children:"链接到"}),F.jsx(jd,{placeholder:"请输入网址",value:i,onChange:a}),F.jsx("div",{className:"font-[500] text-[14px] mb-[5px] mt-[10px]",children:"显示文案"}),F.jsx(jd,{placeholder:"请输入显示文案",value:o,onChange:s}),F.jsxs("div",{className:"flex justify-end mt-[10px] gap-[10px]",children:[F.jsx(ts,{onClick:u,children:"取消"}),F.jsx(ts,{type:"primary",onClick:l,disabled:!i||!o,children:"确定"})]})]})})}const t5=j.forwardRef(({value:t,size:e="",options:r,disabled:n=!1,search:i=!1,searchLabel:a="搜索",maxHeight:o=!0,maxWidth:s=0,editor:l,onChange:u,icon:c,children:f,className:d},h)=>{const[p,v]=j.useState(!1),g=j.useRef(null),m=j.useRef(null),[y,b]=j.useState(0),[x,w]=j.useState(""),_=j.useMemo(()=>r.find(Y=>Y.value===t)?.label||t||"请选择",[r,t]),C=j.useMemo(()=>_==="请选择",[_]),D=j.useMemo(()=>{if(!i||!x.trim())return r;const Y=r.filter(te=>te.label.toLowerCase().indexOf(x.toLowerCase())!==-1);return Y.length?Y:r},[i,x,r]);j.useEffect(()=>{p&&setTimeout(()=>{m.current&&m.current.focus()},0)},[p]),j.useEffect(()=>{const Y=()=>{g.current&&b(s?Number(s):g.current.clientWidth)},te=new ResizeObserver(Y);return g.current&&te.observe(g.current),()=>{g.current&&te.unobserve(g.current),te.disconnect()}},[s]);const O=Y=>{Y.disabled||(u?.(Y.value),v(!1))},I=Y=>{v(Y),Y||w("")};j.useImperativeHandle(h,()=>({changePopoverVisible:I}));const L=l?.isEditable!==!1,V=n||!L,H=F.jsxs("div",{className:"white-options-wrapper",style:{width:y+2+"px",maxHeight:o?"260px":"auto"},children:[i&&F.jsx("div",{className:"p-2 sticky top-0 bg-white z-10 border-b border-gray-100",children:F.jsx(jd,{ref:m,value:x,onChange:w,placeholder:a})}),f||D.map((Y,te)=>F.jsx("div",{className:`option ${Y.disabled?"disabled":""} ${Y.value===t?"selected":""}`,onClick:()=>O(Y),children:Y.label},te))]});return F.jsx(ol,{trigger:"click",value:p,onVisibleChange:I,placement:"bottom",contentStyle:{padding:0,boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},disabled:V,content:H,hasClass:`white-select-wrapper ${d||""}`,children:F.jsxs("div",{className:`select border border-[#d9d9d9] !bg-[#fff] ${e} ${V?"disabled":""}`,ref:g,children:[F.jsx("div",{className:`selector ${C?"placeholder":""}`,children:_}),F.jsx("div",{className:"icon",children:c||F.jsx("i",{className:"w-iconfont icon-bottom !text-[8px] transition-transform duration-200"})})]})})});function Eq(){const{editor:t}=Ot(),e=t?.getAttributes("textStyle").fontSize||"14px";return F.jsx(t5,{value:e,size:"small",options:h0,onChange:r=>t?.chain().focus().setFontSize(r).run()})}function Mq(){const{editor:t}=Ot(),e=[{label:"默认字体",value:null},{label:"华文宋体",value:"STSong"},{label:"华文仿宋",value:"STFangsong"},{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Helvetica",value:"Helvetica"},{label:"Tahoma",value:"Tahoma"},{label:"Georgia",value:"Georgia"},{label:"Comic Sans MS",value:"Comic Sans MS"},{label:"Impact",value:"Impact"}],r=t?.getAttributes("textStyle").fontFamily||null;return F.jsx(t5,{className:"w-[120px]",size:"small",value:r,options:e,onChange:n=>t?.chain().focus().setFontFamily(n).run()})}function pje(){const{editor:t}=Ot(),e=j.useRef(null),r=j.useMemo(()=>{const i=a=>t?.isActive("heading",{level:a});if(t){if(t.isActive("paragraph"))return"paragraph";if(i(1))return"1";if(i(2))return"2";if(i(3))return"3";if(i(4))return"4";if(i(5))return"5";if(i(6))return"6"}return""},[t?.state?.selection]),n=i=>{i==="paragraph"?t?.chain().focus().setParagraph().run():t?.chain().focus().toggleHeading({level:Number(i)}).run(),e.current?.changePopoverVisible(!1)};return F.jsx(t5,{value:r,size:"small",options:PI,maxWidth:100,ref:e,children:PI.map((i,a)=>F.jsx("div",{className:`white-heading-wrapper cursor-pointer ${i.value===r?"selected":""} ${i.element}`,onClick:()=>n(i.value),children:i.label},a))})}const vje=({visible:t,width:e=480,closeButton:r=!1,closeOnClickMask:n=!0,closeOnEsc:i=!0,contentStyle:a={},children:o,onVisibleChange:s,onClosed:l})=>{const u=j.useRef(null);j.useEffect(()=>{if(t){const p=setTimeout(()=>{u.current?.focus()},0);return()=>clearTimeout(p)}else l?.()},[t,l]);const c=()=>{s?.(!1),l?.()},f=()=>{t&&i&&c()},d=p=>{p.target===u.current&&n&&c()},h={width:`${e}px`,...a};return t?kv.createPortal(F.jsx("div",{className:"white-modal-wrapper white-editor-namespace",ref:u,tabIndex:-1,onKeyUp:p=>{p.key==="Escape"&&f()},onClick:d,children:F.jsxs("div",{className:"modal-content",style:h,children:[r&&F.jsx("span",{className:"close-btn",onClick:c,children:F.jsx("i",{className:"w-iconfont icon-close"})}),o]})}),document.body):null},Aq=30,kq=15,gje=j.forwardRef((t,e)=>{const[r,n]=j.useState(()=>{const{labels:p,series:v}=t.data,g=p.length;return[v.length+1,g+1]}),[i,a]=j.useState(null),o=j.useRef("bar"),s=j.useRef(null),l=()=>{o.current=t.type;const p=[],{labels:v,legends:g,series:m}=t.data,y=v.length,b=m.length;p.push(["",...g]);for(let x=0;x<y;x++){const w=[v[x]];for(let _=0;_<b;_++)w.push(m[_][x]+"");p.push(w)}for(let x=0;x<y+1;x++)for(let w=0;w<b+1;w++){const _=s.current?.querySelector(`#cell-${x}-${w}`);_&&(_.value=p[x][w]+"")}},u=()=>{l();const{labels:p,series:v}=t.data,g=p.length,m=v.length;n([m+1,g+1])},c=()=>{const p=[];let v=[],g=[];for(let m=1;m<Aq;m++){const y=s.current?.querySelector(`#cell-${m}-0`);y&&y.value&&p.push({rowIndex:m,value:y.value})}for(let m=1;m<kq;m++){const y=s.current?.querySelector(`#cell-0-${m}`);if(y&&y.value){v.push(y.value);const b=[];for(let x=0;x<p.length;x++){const w=s.current?.querySelector(`#cell-${p[x].rowIndex}-${m}`);let _=0;w&&w.value&&!isNaN(Number(w.value))&&(_=Number(w.value)),b.push(_)}g.push(b)}}return o.current==="scatter"&&(v.length>2&&(v=v.slice(0,2),g=g.slice(0,2)),v.length<2&&(v.push("Y"),g.length>0&&g.push(g[0]))),(o.current==="ring"||o.current==="pie")&&v.length>1&&(v=v.slice(0,1),g=g.slice(0,1)),{data:{labels:p.map(m=>m.value),legends:v,series:g},type:o.current}};j.useImperativeHandle(e,()=>({getTableData:c,initData:u}));const f=(p,v)=>{if(p===0||v===0)return;const g=s.current?.querySelector(`#cell-${p}-${v}`);g&&g.value&&(/^[0-9]+$/.test(g.value)||(g.value="0"))},d=()=>{if(!i)return;const[p,v]=i,g=s.current?.querySelector(`#cell-${p+1}-${v}`);g&&g.focus()};j.useEffect(()=>{l()},[t.data,t.type]),j.useEffect(()=>{const p=v=>{v.key.toUpperCase()===qoe.ENTER&&d()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[]);const h=(p,v,g)=>{p.preventDefault()};return F.jsx("div",{className:"white-editor-table-content",ref:s,children:F.jsx("table",{children:F.jsx("tbody",{children:Array.from({length:Aq}).map((p,v)=>F.jsx("tr",{children:Array.from({length:kq}).map((g,m)=>F.jsx("td",{className:m===0&&v<=r[1]-1||v===0&&m<=r[0]-1?"head":"",children:!(v===0&&m===0)&&F.jsx("input",{className:`item ${v<=r[1]-1&&m<=r[0]-1?"selected":""}`,id:`cell-${v}-${m}`,autoComplete:"off",onFocus:()=>a([v,m]),onBlur:()=>f(v,m),onPaste:y=>h(y)})},m))},v))})})})});function BI({icon:t="chart",text:e="插入图表",isEdit:r=!1,hideText:n=!0}){const{editor:i,options:a}=Ot(),[o,s]=j.useState(!1),[l,u]=j.useState("type"),[c]=j.useState(1),[f,d]=j.useState(null),h=j.useRef(null),p=j.useRef(null),[v,g]=j.useState({data:[],config:{seriesType:"bar",legendorient:"horizontal",titleText:"",legend:!1,legendleft:"center",legendlocation:"top",titleleft:"left"}}),m=j.useRef(null),y=()=>{m.current!==null&&(m.current.dispose(),m.current=null)},b=async L=>{setTimeout(()=>{if(!h.current)return;m.current=CR(h.current);const V=L||v;if(!V.data){console.log("图表数据为空");return}const H=aoe(JSON.parse(JSON.stringify(V.data)),JSON.parse(JSON.stringify(V.config)),a);try{m.current.setOption(H)}catch(Y){console.log("图表渲染错误:",Y),y()}},0)},x=()=>{const L={...v};return L.config.seriesType="bar",L.config.legend=!0,L.config.legendorient="horizontal",L.config.legendlocation="top",L.config.legendleft="center",L.config.titleText="",L.config.titleleft="left",L.data=sq[L.config.seriesType],g(L),L},w=async()=>{if(s(!0),u("type"),r){if(!i)return;const L=au(i);if(d(L),L?.type?.name!=="echarts"||(x(),!L.attrs?.chartConfig))return;const V=L.attrs?.chartConfig,H=JSON.parse(JSON.stringify(V));g(H),await b(H)}else{const L=x();await b(L)}},_=L=>{typeof L=="string"&&g(V=>({...V,data:sq[L],config:{...V.config,seriesType:L}}))},C=L=>{g(V=>({...V,data:L.data}))},D=async()=>{try{y(),await b()}catch(L){console.log("图表配置错误:",L)}},O=L=>{if(u(L),L==="type")if(p.current){const{data:V}=p.current.getTableData(),H={...v,data:V};g(H);try{y(),b(H)}catch(Y){console.log("图表配置错误:",Y)}}else D()},I=()=>{const L={id:"",name:"",mode:c,chartOptions:null,chartConfig:null,nodeAlign:"center",margin:{}};r?L.id=f.attrs.id:L.id=Nv();let V=v.data;l==="data"&&p.current&&(V=p.current.getTableData().data),L.chartConfig=JSON.parse(JSON.stringify({data:V,config:v.config})),r?i?.commands.updateEcharts(L):i?.commands.setEcharts(L),s(!1)};return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:t,text:e,hideText:n,onMenuClick:w}),F.jsxs(vje,{visible:o,onVisibleChange:s,closeButton:!0,width:800,children:[F.jsx("div",{className:"w-full mb-6 font-[500] text-[18px]",children:"图表配置"}),F.jsxs("div",{className:"w-full inline-flex items-center mb-[15px]",children:[F.jsx("span",{className:`px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-l-md ${l==="type"?"!bg-[#007bff] !text-[#fff]":""}`,onClick:()=>O("type"),children:"图表类型"}),F.jsx("span",{className:`px-3 py-2 bg-[#f5f5f5] text-[#333] cursor-pointer rounded-r-md ${l==="data"?"!bg-[#007bff] !text-[#fff]":""}`,onClick:()=>O("data"),children:"图表数据"})]}),F.jsxs("div",{className:"flex items-center gap-[1.2rem] h-[400px]",style:{display:l==="type"?"flex":"none"},children:[F.jsx("div",{className:"w-[55%] h-full border rounded-md p-2",children:F.jsx("div",{ref:h,className:"w-full h-full"})}),F.jsxs("div",{className:"flex-1 h-full border rounded-md p-4",children:[F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"图表类型:"}),F.jsx(ay,{value:v.config.seriesType,options:[{label:"柱状图",value:"bar"},{label:"折线图",value:"line"},{label:"曲线图",value:"smooth"},{label:"饼图",value:"pie"},{label:"环形图",value:"ring"},{label:"面积图",value:"area"},{label:"散点图",value:"scatter"},{label:"雷达图",value:"radar"}],maxHeight:!1,onChange:_,className:"flex-1"})]}),F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"标题名称:"}),F.jsx(jd,{value:v.config.titleText,onChange:L=>g({...v,config:{...v.config,titleText:L}}),placeholder:"请输入标题名称",className:"flex-1"})]}),F.jsx("div",{className:"flex items-center gap-[10px] mb-[10px]",children:F.jsx(Yoe,{value:v.config.legend,onChange:L=>g({...v,config:{...v.config,legend:L}}),className:"flex-shrink-0",children:"显示图例"})}),v.config.legend&&F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"横向位置:"}),F.jsx(ay,{value:v.config.legendleft,options:[{label:"左侧",value:"left"},{label:"居中",value:"center"},{label:"右侧",value:"right"}],onChange:L=>{typeof L=="string"&&g({...v,config:{...v.config,legendleft:L}})},className:"flex-1"})]}),F.jsxs("div",{className:"flex items-center gap-[10px] mb-[10px]",children:[F.jsx("span",{className:"flex-shrink-0",children:"纵向位置:"}),F.jsx(ay,{value:v.config.legendlocation,options:[{label:"顶部",value:"top"},{label:"底部",value:"bottom"}],onChange:L=>{typeof L=="string"&&g({...v,config:{...v.config,legendlocation:L}})},className:"flex-1"})]})]}),F.jsx(ts,{type:"primary",onClick:D,size:"small",className:"w-full",children:"预览"})]})]}),F.jsx("div",{className:"w-full h-[400px] overflow-auto",style:{display:l==="data"?"block":"none"},children:F.jsx(gje,{ref:p,type:v.config.seriesType,data:v.data,onUpdateData:C})}),F.jsxs("div",{className:"flex items-center justify-end gap-[0.8rem] mt-6",children:[F.jsx(ts,{onClick:()=>s(!1),children:"取消"}),F.jsx(ts,{type:"primary",onClick:I,children:"确定"})]})]})]})}function Nq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"indent-left",text:"减少缩进",shortcut:"Shift+Tab",hideText:!0,onMenuClick:()=>t?.chain().focus().outdent().run()})}function tg(){const{editor:t}=Ot(),e=()=>{t?.can().chain().focus().setTextAlign("center").run()&&t.chain().focus().setTextAlign("center").run(),t?.can().chain().focus().setNodeAlign("center").run()&&t.chain().focus().setNodeAlign("center").run()};return F.jsx(Ar,{ico:"align-center",shortcut:"Ctrl+Shift+E",text:"居中对齐",hideText:!0,menuActive:t?.isActive({textAlign:"center"})||t?.isActive({nodeAlign:"center"}),disabled:!t?.can().chain().focus().setTextAlign("center").run()&&!t?.can().chain().focus().setNodeAlign("center").run(),onMenuClick:e})}function rg(){const{editor:t}=Ot(),e=()=>{t?.can().chain().focus().setTextAlign("right").run()&&t.chain().focus().setTextAlign("right").run(),t?.can().chain().focus().setNodeAlign("flex-end").run()&&t.chain().focus().setNodeAlign("flex-end").run()};return F.jsx(Ar,{ico:"align-right",text:"右对齐",shortcut:"Ctrl+Shift+R",hideText:!0,menuActive:t?.isActive({textAlign:"right"})||t?.isActive({nodeAlign:"flex-end"}),disabled:!t?.can().chain().focus().setTextAlign("right").run()&&!t?.can().chain().focus().setNodeAlign("flex-end").run(),onMenuClick:e})}function ng(){const{editor:t}=Ot(),e=()=>{t?.can().chain().focus().setTextAlign("left").run()&&t.chain().focus().setTextAlign("left").run(),t?.can().chain().focus().setNodeAlign("flex-start").run()&&t.chain().focus().setNodeAlign("flex-start").run()};return F.jsx(Ar,{ico:"align-left",text:"左对齐",shortcut:"Ctrl+Shift+L",hideText:!0,menuActive:t?.isActive({textAlign:"left"})||t?.isActive({nodeAlign:"flex-start"}),disabled:!t?.can().chain().focus().setTextAlign("left").run()&&!t?.can().chain().focus().setNodeAlign("flex-start").run(),onMenuClick:e})}function mje(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"align-justify",text:"两端对齐",shortcut:"Ctrl+Shift+J",hideText:!0,menuActive:t?.isActive({textAlign:"justify"}),disabled:!t?.can().chain().focus().setTextAlign("justify").run(),onMenuClick:()=>t?.chain().focus().setTextAlign("justify").run()})}function yje(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"align-distributed",text:"分散对齐",shortcut:"Ctrl+Shift+D",hideText:!0,menuActive:t?.isActive({textAlign:"distributed"}),disabled:!t?.can().chain().focus().setTextAlign("distributed").run(),onMenuClick:()=>t?.chain().focus().setTextAlign("distributed").run()})}function bje(){const{editor:t}=Ot(),e=n=>{t?.chain().focus().setFontSize(n).run()},r=()=>{const{fontSize:n}=t?.getAttributes("textStyle")??{};if(n){const i=h0.find(({value:o})=>o===n);if(!i)return;const a=h0.find(({order:o})=>o===i.order+1);a&&e(a.value)}else e("16px")};return F.jsx(Ar,{ico:"size-increase",text:"增大字体",hideText:!0,onMenuClick:r})}function xje(){const{editor:t}=Ot(),e=n=>{t?.chain().focus().setFontSize(n).run()},r=()=>{const{fontSize:n}=t?.getAttributes("textStyle")??{};if(n){const i=h0.find(({value:o})=>o===n);if(!i)return;const a=h0.find(({order:o})=>o===i.order-1);a&&e(a.value)}else e("14px")};return F.jsx(Ar,{ico:"size-decrease",text:"减小字体",hideText:!0,onMenuClick:r})}function wje(){const{editor:t}=Ot(),e=j.useMemo(()=>{if(!t)return"";const n=i=>t.isActive("heading",{level:i});return t.isActive("paragraph")?"paragraph":n(1)?"1":n(2)?"2":n(3)?"3":n(4)?"4":n(5)?"5":n(6)?"6":""},[t?.state?.selection]),r=n=>{!t||!t.isEditable||(n==="paragraph"?t.chain().focus().setParagraph().run():t.chain().focus().toggleHeading({level:Number(n)}).run())};return F.jsx("div",{className:"p-[5px] bg-[#f3f4f6] rounded-[5px]",children:F.jsx("div",{className:"w-[240px] h-[50px] white-no-scrollbar overflow-x-auto",children:F.jsx("div",{className:`flex items-center w-max h-full ${t?.isEditable===!1?"opacity-50 cursor-not-allowed":""}`,children:PI.map(n=>F.jsxs("div",{className:`w-[80px] h-full flex flex-col gap-[2px] items-center justify-center cursor-pointer flex-shrink-0 rounded-[5px] ${e===n.value?"bg-[#fff]":""} ${t?.isEditable===!1?"cursor-not-allowed":""}`,onClick:()=>r(n.value),children:[F.jsx("div",{className:"font-[500]",children:n.label}),F.jsx("div",{className:"text-[12px] text-[#737373]",children:n.element==="p"?"段落":n.element})]},n.value))})})})}const Tu=({ico:t="",text:e="",onMenuClick:r,onMenuClickThrough:n,className:i,onClick:a,...o})=>{const s=l=>{n?n(l):r&&r(l),a&&a(l)};return F.jsxs("div",{className:`w-check-item w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center gap-2 cursor-pointer ${i||""}`,onClick:s,...o,children:[F.jsx("i",{className:`w-iconfont icon-${t}`}),F.jsx("div",{className:"text-[14px]",children:e})]})};function Sje({hideText:t=!0,isInset:e=!1}){const{editor:r,options:n,setUploadFile:i}=Ot(),a=j.useRef(null),o=j.useMemo(()=>R_("image",n?.file?.allowedMimeTypes||[]),[n?.file?.allowedMimeTypes]),s=()=>{a.current?.click()},l=u=>{const c=u.target.files;if(c&&c.length>0)for(const f of c)r?.chain().focus().insertFile({file:f,setUploadFile:i,autoType:!0}).run();a.current&&(a.current.value="")};return e?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"image",text:"图片",onMenuClick:s}),F.jsx("input",{type:"file",accept:o,multiple:!0,ref:a,style:{display:"none"},onChange:l})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"image",text:"插入图片",hideText:t,onMenuClick:s}),F.jsx("input",{type:"file",accept:o,ref:a,style:{display:"none"},onChange:l})]})}function _je({isInset:t=!1}){const{editor:e,options:r,setUploadFile:n}=Ot(),i=j.useRef(null),a=j.useMemo(()=>R_("audio",r?.file?.allowedMimeTypes||[]),[r?.file?.allowedMimeTypes]),o=()=>{i.current?.click()},s=l=>{const u=l.target.files;if(u&&u.length>0)for(const c of u)e?.chain().focus().insertFile({file:c,setUploadFile:n,autoType:!0}).run();i.current&&(i.current.value="")};return t?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"audio",text:"音频",onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"audio",text:"插入音频",hideText:!0,onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]})}function Tje({isInset:t=!1}){const{editor:e,options:r,setUploadFile:n}=Ot(),i=j.useRef(null),a=j.useMemo(()=>R_("video",r?.file?.allowedMimeTypes||[]),[r?.file?.allowedMimeTypes]),o=()=>{i.current?.click()},s=l=>{const u=l.target.files;if(u&&u.length>0)for(const c of u)e?.chain().focus().insertFile({file:c,setUploadFile:n,autoType:!0}).run();i.current&&(i.current.value="")};return t?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"video",text:"视频",onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"video",text:"插入视频",hideText:!0,onMenuClick:o}),F.jsx("input",{type:"file",accept:a,multiple:!0,ref:i,style:{display:"none"},onChange:s})]})}function Cje({isInset:t=!1}){const{editor:e}=Ot(),r=()=>{e?.chain().focus().insertTag().run()};return t?F.jsx(Tu,{ico:"tag",text:"标签",onMenuClick:r}):F.jsx(Ar,{ico:"tag",text:"插入标签",hideText:!0,onMenuClick:r})}function Eje({hideText:t=!0,isInset:e=!1}){const{editor:r,options:n,setUploadFile:i}=Ot(),a=j.useRef(null),o=j.useMemo(()=>R_("file",n?.file?.allowedMimeTypes||[]),[n?.file?.allowedMimeTypes]),s=()=>{a.current?.click()},l=u=>{const c=u.target.files;if(c&&c.length>0)for(const f of c)r?.chain().focus().insertFile({file:f,setUploadFile:i,autoType:!0}).run();a.current&&(a.current.value="")};return e?F.jsxs(F.Fragment,{children:[F.jsx(Tu,{ico:"add-file",text:"文件",onMenuClick:s}),F.jsx("input",{type:"file",accept:o,multiple:!0,ref:a,style:{display:"none"},onChange:l})]}):F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"add-file",text:"插入文件",hideText:t,onMenuClick:s}),F.jsx("input",{type:"file",accept:o,multiple:!0,ref:a,style:{display:"none"},onChange:l})]})}function Mje({isInset:t=!1}){const{editor:e}=Ot(),r=a=>"2023-01-01 00:00:00",n=({content:a,format:o,capitalize:s,value:l})=>{e?.chain().insertDatetime({text:a.includes("自定义")?`[${a}]`:a,date:r(),withTime:l==="withTime",format:o,capitalize:s}).focus().run()},i=()=>{n({content:r(),format:"YYYY-MM-DD HH:mm:ss",capitalize:!0,value:"withTime"})};return t?F.jsx(Tu,{ico:"date",text:"日期",onMenuClick:i}):F.jsx(Ar,{ico:"date",text:"插入日期",shortcut:"Ctrl+B",hideText:!0,onMenuClick:i})}function Aje({isInset:t=!1}){const{editor:e}=Ot(),r=()=>{e?.chain().focus().setHr({type:"signle",color:"#000"}).run()};return t?F.jsx(Tu,{ico:"divider",text:"分隔线",onMenuClick:r}):F.jsx(Ar,{ico:"divider",text:"分隔线",hideText:!0,onMenuClick:r})}function kje({onSelect:t}){return F.jsx("div",{className:"w-[310px] max-h-[400px] overflow-auto white-no-scrollbar",children:dje.map((e,r)=>F.jsxs(j.Fragment,{children:[F.jsx("div",{className:`text-[12px] text-[#666] mb-[10px] ${r!==0?"mt-[10px]":""}`,children:e.label}),F.jsx("div",{className:"flex flex-wrap gap-[0.5rem]",children:e.items.split(" ").map((n,i)=>F.jsx("div",{className:"text-[25px] w-[32px] h-[32px] rounded-[4px] cursor-pointer flex items-center justify-center hover:bg-[#f1f2f2]",onClick:()=>t(n),children:n},i))})]},r))})}function Nje({hideText:t=!0,onSelectEmoji:e}){const{editor:r}=Ot(),[n,i]=j.useState(!1),a=o=>{e?e(o):r?.chain().focus().insertContent(o).run(),i(!1)};return F.jsx(xl,{ico:"emoji",icoSize:16,text:"插入表情",hideText:t,popupVisible:n,onPopupVisibleChange:i,popupType:"select",placement:"right",trigger:"mouseenter",content:F.jsx(kje,{onSelect:a}),children:F.jsxs("div",{className:`w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer ${n?"bg-[#edeef2]":""}`,children:[F.jsxs("span",{className:"inline-flex items-center gap-2",children:[F.jsx("i",{className:"w-iconfont icon-emoji"}),F.jsx("span",{className:"text-[14px]",children:"表情"})]}),F.jsx("i",{className:"w-iconfont icon-right !text-[10px]"})]})})}function Dje(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=[1,2,3,4,5],[i,a]=j.useState(0),o=s=>{t?.chain().focus().setColumns(s,!0).run(),t?.chain().focus().updateAttributes("columnBlock",{columnSize:s}).run(),r(!1)};return F.jsx(xl,{ico:"column",icoSize:16,text:"插入分栏",hideText:!0,popupVisible:e,onPopupVisibleChange:r,popupType:"select",placement:"right",trigger:"mouseenter",content:F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"w-full text-center pb-2",children:[i," 分栏"]}),F.jsx("div",{className:"w-[175px] h-[80px] flex items-center gap-[6px]",children:n.map(s=>F.jsx("div",{className:`w-[30px] h-full bg-[rgba(23,26,29,0.06)] rounded-[4px] cursor-pointer flex-shrink-0 ${i>=s?"!bg-[#007bff]":""}`,onMouseEnter:()=>a(s),onClick:()=>o(s)},s))})]}),children:F.jsxs("div",{className:`w-full rounded-[4px] hover:bg-[#edeef2] px-2 py-[0.3rem] inline-flex items-center justify-between cursor-pointer ${e?"bg-[#edeef2]":""}`,children:[F.jsxs("span",{className:"inline-flex items-center gap-2",children:[F.jsx("i",{className:"w-iconfont icon-column"})," ",F.jsx("span",{className:"text-[14px]",children:"分栏"})]}),F.jsx("i",{className:"w-iconfont icon-right !text-[10px]"})]})})}function Oje(){const{editor:t}=Ot();return F.jsx(Tu,{ico:"code",text:"代码块",onMenuClick:()=>t?.chain().focus().setCodeBlock().run()})}function Rje(){const{editor:t}=Ot(),e=()=>{t?.chain().focus().setParagraph().run(),t?.chain().focus().setIframe({type:"",src:""}).run()};return F.jsx(Tu,{ico:"web-page",text:"网页",onMenuClick:e})}function Dq({hideText:t=!1}){const{editor:e}=Ot(),[r,n]=j.useState(!1);return F.jsx(xl,{ico:"add-circle",icoSize:16,text:"插入元素",hideText:t,popupVisible:r,onPopupVisibleChange:n,popupType:"select",content:F.jsxs("div",{className:"w-[110px]",children:[F.jsx(Sje,{isInset:!0}),F.jsx(_je,{isInset:!0}),F.jsx(Tje,{isInset:!0}),F.jsx(Eje,{isInset:!0}),F.jsx(Cje,{isInset:!0}),F.jsx(Mje,{isInset:!0}),F.jsx(Aje,{isInset:!0}),F.jsx(Nje,{}),F.jsx(Dje,{}),F.jsx(Oje,{}),F.jsx(Rje,{})]}),children:t&&F.jsxs("button",{disabled:e?.isEditable===!1,className:`white-editor-tool-item flex items-center justify-center gap-[6px] px-[7px] ${e?.isEditable===!1?"is-disabled":""}`,title:"插入元素",children:[F.jsx("i",{className:"w-iconfont icon-add-circle"}),F.jsx("span",{className:"text-[14px]",children:"插入"})]})})}function Oq(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"task-list",text:"任务列表",shortcut:"Ctrl+Shift+9",hideText:!0,menuActive:t?.isActive("taskList"),disabled:!t?.can().chain().focus().toggleTaskList().run(),onMenuClick:()=>t?.chain().focus().toggleTaskList().run()})}function Ije(){const{page:t,editor:e}=Ot(),[,r]=j.useState({});return j.useEffect(()=>{if(!e)return;const n=()=>r({});return e.on("transaction",n),e.on("selectionUpdate",n),()=>{e.off("transaction",n),e.off("selectionUpdate",n)}},[e]),F.jsxs("div",{className:"flex w-full h-full",children:[F.jsx(fVe,{className:"flex-1 h-full p-[10px]",children:t?.toolbar==="double"?F.jsxs("div",{className:"inline-flex items-center mx-auto",children:[F.jsx("div",{className:"pr-[20px] flex-shrink-0",children:F.jsx(Dq,{})}),F.jsxs("div",{className:"space-y-[6px] px-[20px] border-r border-l",children:[F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(bq,{}),F.jsx(xq,{})]}),F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(wq,{}),F.jsx(Sq,{})]})]}),F.jsxs("div",{className:"space-y-[6px] px-[20px] border-r",children:[F.jsxs("div",{className:"space-x-[8px] flex",children:[F.jsx(Mq,{}),F.jsx(Eq,{}),F.jsx(bje,{}),F.jsx(xje,{})]}),F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(DI,{}),F.jsx(OI,{}),F.jsx(RI,{}),F.jsx(II,{}),F.jsx(vq,{}),F.jsx(pq,{}),F.jsx(aq,{}),F.jsx(oq,{})]})]}),F.jsxs("div",{className:"space-y-[6px] px-[20px] border-r",children:[F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(fq,{}),F.jsx(dq,{}),F.jsx(hq,{}),F.jsx(Nq,{}),F.jsx(yq,{}),F.jsx(Oq,{})]}),F.jsxs("div",{className:"space-x-[5px] flex",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(mje,{}),F.jsx(yje,{}),F.jsx(gq,{}),F.jsx(mq,{}),F.jsx(_q,{})]})]}),F.jsx("div",{className:"px-[20px] border-r",children:F.jsx(wje,{})}),F.jsxs("div",{className:"space-x-[6px] pl-[20px] flex",children:[F.jsx(Tq,{hideText:!1}),F.jsx(BI,{hideText:!1}),F.jsx(Cq,{hideText:!1})]})]}):F.jsxs("div",{className:"inline-flex items-center gap-[10px] mx-auto",children:[F.jsx(Dq,{hideText:!0}),F.jsx(bq,{}),F.jsx(xq,{}),F.jsx(wq,{}),F.jsx(Sq,{}),F.jsx(pje,{}),F.jsx(Mq,{}),F.jsx(Eq,{}),F.jsx(DI,{}),F.jsx(OI,{}),F.jsx(RI,{}),F.jsx(II,{}),F.jsx(aq,{}),F.jsx(oq,{}),F.jsx(fq,{}),F.jsx(dq,{}),F.jsx(Oq,{}),F.jsx(hq,{}),F.jsx(Nq,{}),F.jsx(Koe,{}),F.jsx(yq,{}),F.jsx(vq,{}),F.jsx(pq,{}),F.jsx(_q,{}),F.jsx(gq,{}),F.jsx(mq,{}),F.jsx(BI,{}),F.jsx(Tq,{}),F.jsx(Cq,{})]})}),F.jsx("div",{className:"px-4 inline-flex items-center",children:F.jsx(dVe,{})})]})}function Lje(){const{options:t,page:e,setPage:r,dicts:n}=Ot(),[i,a]=j.useState(!1),[o,s]=j.useState(!1),{editor:l}=Ot(),u={characters:l?.storage.characterCount?.characters()??0,words:l?.storage.characterCount?.words()??0,paragraphs:0,images:0,headings:0};if(l){let d=0,h=0,p=0;l.state.doc.descendants(v=>(v.type.name==="paragraph"&&d++,v.type.name==="image"&&h++,v.type.name==="heading"&&p++,!0)),u.paragraphs=d,u.images=h,u.headings=p}const c=d=>{if(d.layout==="web"){r(h=>({...h,layout:d.layout}));return}r(h=>({...h,size:{width:d.width,height:d.height}}))},f=j.useMemo(()=>{if(!e?.size)return"";const d=n.pageSizeOption.find(h=>h.width===e.size.width&&h.height===e.size.height);return d?d.label:""},[e,n]);return F.jsxs("div",{className:"h-full flex items-center gap-[0.8rem]",children:[t.layout.toc.show&&F.jsx("span",{className:`cursor-pointer hover:bg-[#e8e8e8] p-[0.3rem] rounded ${e.showToc?"bg-[#e8e8e8]":""}`,title:e.showToc?"关闭大纲":"打开大纲",onClick:()=>r(d=>({...d,showToc:!d.showToc})),children:F.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",children:[F.jsx("path",{d:"M369.0496 460.3392H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.832a81.92 81.92 0 0 1-81.92 81.92zM184.32 173.1072a20.48 20.48 0 0 0-20.48 20.48v184.832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.832a20.48 20.48 0 0 0-20.48-20.48zM369.0496 914.688H184.32a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.7296a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92zM184.32 627.4048a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.7296a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48zM827.904 914.688h-184.8832a81.92 81.92 0 0 1-81.92-81.92v-184.8832a81.92 81.92 0 0 1 81.92-81.92h184.8832a81.92 81.92 0 0 1 81.92 81.92v184.8832a81.92 81.92 0 0 1-81.92 81.92z m-184.8832-287.2832a20.48 20.48 0 0 0-20.48 20.48v184.8832a20.48 20.48 0 0 0 20.48 20.48h184.8832a20.48 20.48 0 0 0 20.48-20.48v-184.8832a20.48 20.48 0 0 0-20.48-20.48z",fill:"#474A54","p-id":"15222"}),F.jsx("path",{d:"M527.230586 280.884442m36.203867-36.203867l130.732164-130.732164q36.203867-36.203867 72.407735 0l130.732164 130.732164q36.203867 36.203867 0 72.407735l-130.732164 130.732164q-36.203867 36.203867-72.407735 0l-130.732164-130.732164q-36.203867-36.203867 0-72.407735Z",fill:"#FDA338","p-id":"15223"}),F.jsx("path",{d:"M730.3168 493.4656a81.92 81.92 0 0 1-57.9072-23.9104L541.696 338.7904a81.92 81.92 0 0 1 0-115.8144L672.4096 92.16A81.92 81.92 0 0 1 788.48 92.16l130.7648 130.7136a81.92 81.92 0 0 1 0 115.8144L788.48 469.5552a81.92 81.92 0 0 1-58.1632 23.9104z m0-363.52a20.48 20.48 0 0 0-14.4896 5.9904L585.1136 266.24a20.48 20.48 0 0 0 0 28.9792l130.7136 130.7136a20.48 20.48 0 0 0 28.9792 0L875.52 295.3728a20.48 20.48 0 0 0 0-29.1328l-130.7136-130.56a20.48 20.48 0 0 0-14.4896-5.9904z",fill:"#474A54","p-id":"15224"})]})}),F.jsx(ol,{trigger:"click",placement:"top",value:i,onVisibleChange:a,contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:F.jsx("div",{className:"flex flex-col",children:n.pageSizeOption.map((d,h)=>F.jsxs("div",{className:`px-[12px] py-[7px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)] ${f===d.label?"text-[#007aff]":""}`,onClick:()=>{c(d),a(!1)},children:[F.jsx("span",{className:"text-[14px] font-[500]",children:d.label}),d.width&&F.jsxs("span",{className:"text-[12px] ml-[0.4rem]",children:[d.width," * ",d.height,"cm"]})]},h))}),children:t.layout.foot.pageSize&&F.jsxs("div",{className:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none",children:[F.jsx("span",{className:"flex-1 text-center text-[14px]",children:"页面大小"}),F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${i?"rotate-180":""}`})]})}),F.jsx(ol,{trigger:"click",value:o,onVisibleChange:s,placement:"top",content:F.jsxs("div",{className:"w-[150px] flex flex-col gap-[0.8rem] text-[14px] px-[0.6rem] py-2",children:[F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"字符数:"}),u.characters]}),F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"段落:"}),u.paragraphs]}),F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"图片:"}),u.images]}),F.jsxs("div",{className:"flex justify-between",children:[F.jsx("span",{className:"w-[80px]",children:"标题:"}),u.headings]})]}),children:t.layout.foot.character&&F.jsxs("div",{className:"min-w-[100px] flex items-center gap-[0.4rem] rounded hover:text-[#007aff] px-[0.4rem] py-[0.3rem] cursor-pointer select-none",children:[F.jsxs("span",{className:"flex-1 text-center text-[14px]",children:[u.characters," 字符"]}),F.jsx("i",{className:`w-iconfont icon-bottom !text-[8px] transition-transform duration-200 ${o?"rotate-180":""}`})]})})]})}var Wx={exports:{}},Pje=Wx.exports,Rq;function Bje(){return Rq||(Rq=1,(function(t,e){(function(r,n){n()})(Pje,function(){function r(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function n(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){l(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function a(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof sc=="object"&&sc.global===sc?sc:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,f){var d=o.URL||o.webkitURL,h=document.createElement("a");c=c||u.name||"download",h.download=c,h.rel="noopener",typeof u=="string"?(h.href=u,h.origin===location.origin?a(h):i(h.href)?n(u,c,f):a(h,h.target="_blank")):(h.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(r(u,f),c);else if(i(u))n(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){a(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return n(u,c,f);var h=u.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var b=g.result;b=v?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=b:location=b,d=null},g.readAsDataURL(u)}else{var m=o.URL||o.webkitURL,y=m.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});o.saveAs=l.saveAs=l,t.exports=l})})(Wx)),Wx.exports}var zje=Bje();const Fje=()=>{const t=document.createElement("iframe");return t.style.width="0",t.style.height="0",t.style.position="absolute",t.style.right="0",t.style.top="0",t.style.border="0",document.body.appendChild(t),t},Vje=async(t,e)=>{const r=Fje(),n=r.contentWindow;if(!r.contentDocument||!n)return;r.contentDocument.write(t),r.contentDocument.close();const i=()=>{console.log("handleLoadIframe"),n.focus(),n.print()},a=()=>{r.removeEventListener("load",i),n.removeEventListener("afterprint",a),document.body.removeChild(r),e()};r.addEventListener("load",i),n.addEventListener("afterprint",a)};function Hje(){const{options:t,container:e,page:r,dicts:n}=Ot(),i=j.useMemo(()=>n?.lineHeights?.find(c=>c.default)?.value??1.7,[n]),a=c=>{const f=document.createElement("div");f.innerHTML=c;const d=f.querySelectorAll(".white-chart-node");for(const h of d){const p=tre(h);if(p){const v=p.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#fff"}),g=document.createElement("img");g.src=v,g.style.width="100%",h?.parentNode?.replaceChild(g,h)}}return f.innerHTML},o=()=>Array.from(document.querySelectorAll("link, style")).map(c=>c.outerHTML).join(""),s=()=>{const c=document.querySelector(`#${e} .white-editor-container`)?.outerHTML??"";return a(c)},l=()=>{const{size:c,margin:f}=r;return`
|
|
399
399
|
<!DOCTYPE html>
|
|
400
400
|
<html lang="zh-CN">
|
|
401
401
|
<head>
|
|
@@ -453,4 +453,4 @@ Valid keys: `+JSON.stringify(Object.keys(me),null," "));var le=xe(st,ve,He,qe,o
|
|
|
453
453
|
});
|
|
454
454
|
<\/script>
|
|
455
455
|
</body>
|
|
456
|
-
</html>`},u=()=>{const c=l();Vje(c,()=>{console.log("打印完成")})};return F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:u,children:[F.jsx("i",{className:"w-iconfont icon-export-pdf"}),"导出为PDF"]})}function $je(){const{editor:t,options:e}=Ot(),[r,n]=j.useState(!1),i=async()=>{if(!t)return;const o=t.getHTML();try{await navigator.clipboard.writeText(o)}catch(s){console.error("Failed to copy: ",s)}},a=()=>{if(!t)return;const o=new Blob([t.getText()],{type:"text/plain;charset=utf-8"}),{title:s}=e.document??{},l=s!==""?e.document?.title:"无标题文档";zje.saveAs(o,`${l}.txt`),n(!1)};return F.jsxs("div",{className:"flex items-center gap-[20px] text-[#333] foot-action",children:[e.layout.foot.copy&&F.jsxs("span",{className:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]",onClick:i,children:[F.jsx("i",{className:"w-iconfont icon-copy-content"}),"复制全文"]}),F.jsx(ol,{trigger:"click",placement:"top",value:r,onVisibleChange:n,contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:a,children:[F.jsx("i",{className:"w-iconfont icon-text"}),"导出为文本"]}),F.jsx(Hje,{})]}),children:e.layout.foot.download&&F.jsxs("span",{className:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]",children:[F.jsx("i",{className:"w-iconfont icon-down"}),"下载"]})})]})}function Uje(){return F.jsxs("div",{className:"w-full h-full flex items-center justify-between",children:[F.jsx(Lje,{}),F.jsx($je,{})]})}const jje=({size:t="1em",top:e="30%",title:r="暂无数据"})=>F.jsxs("div",{className:"flex items-center justify-center flex-col gap-2",style:{paddingTop:e},children:[F.jsxs("svg",{className:"icon",viewBox:"0 0 1030 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,children:[F.jsx("path",{d:"M927.053254 896q0 1.254249-0.496852 2.508497t-1.484497 2.508497q-0.993704 1.248189-2.48426 2.49032-1.478438 1.248189-3.453728 2.48426-1.969231 1.230012-4.429254 2.447905-2.453964 1.217893-5.392663 2.423669-2.938698 1.199716-6.343953 2.381254-3.405254 1.187598-7.277065 2.3449-3.87787 1.163361-8.198059 2.302485-4.320189 1.133065-9.088757 2.241893t-9.967338 2.181302q-5.210888 1.084592-10.82168 2.126769-5.616852 1.048237-11.645728 2.060119-6.022817 1.005822-12.439479 1.97529-6.422722 0.969467-13.208994 1.90258-6.792331 0.933112-13.948213 1.817751-7.149822 0.890698-14.645018 1.738982-7.495195 0.842225-15.311527 1.635977-7.822391 0.799811-15.94168 1.551148-8.125349 0.745278-16.541539 1.442082-8.404071 0.702864-17.086863 1.345137-8.670675 0.648331-17.589776 1.24213-8.919101 0.593799-18.068449 1.127006-9.14329 0.539266-18.480474 1.01794-9.349302 0.484734-18.874319 0.908876-9.518959 0.424142-19.201515 0.787693-9.676497 0.36355-19.492355 0.666508-9.809799 0.302959-19.728663 0.551385-9.918864 0.242367-19.928615 0.430201-9.997633 0.181775-20.067977 0.302959-10.064284 0.127243-20.170982 0.187834-10.100639 0.060592-20.213396 0.060592-10.118817 0-20.219456-0.060592-10.100639-0.060592-20.164923-0.181775-10.070343-0.121183-20.074035-0.302959-10.003692-0.187834-19.922557-0.43626-9.924923-0.242367-19.734722-0.545325-9.815858-0.309018-19.492355-0.672568-9.676497-0.36355-19.201514-0.787693-9.518959-0.424142-18.868261-0.908876-9.343243-0.478675-18.486532-1.01794-9.14329-0.533207-18.062391-1.127006t-17.595834-1.24213q-8.676734-0.642272-17.086864-1.345137-8.41013-0.696805-16.535479-1.442082-8.11929-0.751337-15.935622-1.551148-7.822391-0.793751-15.317585-1.635977-7.495195-0.848284-14.651077-1.732923-7.149822-0.890698-13.936095-1.817751-6.798391-0.933112-13.208994-1.908639-6.422722-0.969467-12.445539-1.981349-6.028876-1.005822-11.645727-2.05406-5.622911-1.042178-10.821681-2.12071t-9.967337-2.187361q-4.768568-1.108828-9.088757-2.241893-4.326249-1.139124-8.19806-2.302485-3.871811-1.163361-7.277065-2.3449-3.405254-1.181538-6.343953-2.381254-2.938698-1.205775-5.392663-2.423669-2.460024-1.217893-4.429254-2.447905-1.97529-1.236071-3.453728-2.48426-1.490556-1.24213-2.48426-2.49032-0.987645-1.254249-1.484497-2.508497t-0.496852-2.508497z",fill:"#007bff",opacity:".1"}),F.jsx("path",{d:"M117.426746 376.832c0 8.70703 6.695385 15.36 15.450887 15.36 8.755503 0 15.450888-6.65297 15.450888-15.36 0-8.70097-6.695385-15.36-15.450888-15.36-8.240473 0-15.450888 7.168-15.450887 15.36z m814.776804 455.16497c-19.571124 5.12-23.691361 9.222059-28.326627 28.16303-5.150296-19.449941-9.270533-23.552-28.326627-28.16303 19.056095-5.12 23.691361-9.209941 28.326627-28.15697 4.635266 18.94703 8.755503 23.552 28.326627 28.15697zM203.436686 323.07503c-25.23645 6.65297-30.386746 11.77297-37.08213 36.864-6.695385-25.08497-11.84568-30.21103-37.08213-36.864 25.23645-6.65903 30.386746-12.288 37.08213-36.864 6.180355 25.08497 11.84568 30.20497 37.08213 36.864z m618.035503-88.064c-15.450888 4.096-18.541065 7.168-22.661301 22.528-4.120237-15.36-7.210414-18.432-22.661302-22.528 15.450888-4.096 18.541065-7.168 22.661302-22.528 3.605207 15.36 7.210414 18.432 22.661301 22.528z m66.438817-78.848c-40.172308 10.24-48.412781 18.94097-59.228402 58.87697-10.300592-39.929941-19.056095-48.128-59.228403-58.87697 40.172308-10.24 48.412781-18.94703 59.228403-58.88303 10.300592 39.42703 19.056095 48.128 59.228402 58.88303z",fill:"#007bff",opacity:".5"}),F.jsx("path",{d:"M422.32426 713.21297v4.096l33.991953 31.23503 130.302485-62.97903-117.941775 75.26703v36.864l19.056095-18.432v-0.51503 0.51503l19.056094 18.432 100.945799-122.88v-4.096l-185.410651 42.49297z",fill:"#007bff",opacity:".2"}),F.jsx("path",{d:"M865.249704 551.936v-1.024c0-1.024-0.51503-1.53297-0.515029-2.55697v-0.51503L754.003314 260.61103c-15.965917-48.64303-61.288521-81.41103-112.79148-81.41103H389.362367c-51.502959 0-96.825562 32.768-112.791479 81.41103L165.839527 547.84v0.51503c-0.51503 1.024-0.51503 1.53297-0.51503 2.55697v206.848c0 65.02097 53.048047 117.76 118.456805 117.76h463.526627c65.408757 0 118.456805-52.73903 118.456805-117.76v-204.8c-0.51503-0.50897-0.51503-0.50897-0.51503-1.024zM305.412544 271.36q0-0.50897 0.51503-0.50897c11.330651-36.864 45.322604-60.93103 83.434793-60.93103h251.334438c38.112189 0 72.104142 24.06703 83.949822 60.416q0 0.51503 0.51503 0.51503l102.490887 266.24H592.284024c-8.755503 0-15.450888 6.65297-15.450888 15.36 0 33.792-27.811598 61.44-61.80355 61.44-33.991953 0-61.80355-27.648-61.80355-61.44 0-8.70703-6.695385-15.36-15.450888-15.36H202.921657l102.490887-265.73103zM834.347929 757.76c0 48.128-39.142249 87.04-87.55503 87.04h-463.526627c-48.412781 0-87.55503-38.912-87.555029-87.04V568.32h228.158106c7.210414 43.52303 45.322604 76.8 91.160237 76.8 45.837633 0 83.949822-33.27697 91.160236-76.8H834.347929v189.44z",fill:"#007bff",opacity:".5"}),F.jsx("path",{d:"M515.029586 578.566059c-14.420828 0-25.751479-11.264-25.751479-25.6v-51.2H254.939645l84.464852-219.136 0.51503-1.024c7.210414-21.504 26.781538-35.84 49.44284-35.84h251.334438c22.661302 0 42.232426 14.336 49.44284 35.84l0.51503 1.024 84.464852 219.136H540.781065v51.2c0 14.336-11.330651 25.6-25.751479 25.6z",fill:"#007bff",opacity:".2"})]}),F.jsx("p",{className:"text-[#666]",children:r})]}),Gje=()=>{const{editor:t,options:e,setPage:r}=Ot(),[n,i]=j.useState([]),[a,o]=j.useState(""),s=j.useMemo(()=>dK(()=>{if(t){const u=t.storage.tableOfContents?.content;u&&i(u)}},200),[t]);j.useEffect(()=>{if(!t)return;s();const u=()=>{s()};return t.on("update",u),()=>{t.off("update",u)}},[t,s]);const l=u=>{if(!t)return;o(u.id);const c=t.view.dom.querySelector(`[data-toc-id="${u.id}"]`);if(!c)return;c.scrollIntoView({behavior:"smooth"});const f=t.view.posAtDOM(c,0),{tr:d}=t.view.state,h=d.doc.nodeAt(f);if(h){const p=f+h.nodeSize;d.setSelection(ir.create(d.doc,p))}else d.setSelection(new ir(d.doc.resolve(f)));t.view.dispatch(d),t.view.focus()};return F.jsxs("div",{className:"w-[260px] h-full flex flex-col overflow-hidden",children:[e?.layout?.foot?.show&&F.jsx("div",{className:"h-[50px] flex-none flex items-center px-4 text-[15px] text-[#666] hover:text-[#333]",children:F.jsxs("span",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>r(u=>({...u,showToc:!1})),children:[F.jsx("i",{className:"w-iconfont icon-left !text-[12px]"}),"收起大纲"]})}),F.jsx("div",{className:"overflow-y-auto min-h-0",children:n?.length>0?F.jsx("ul",{className:"flex-1 px-4 py-2 space-y-[0.3rem]",children:n.map(u=>F.jsx("li",{className:`cursor-pointer text-[#333] text-[14px] h-[34px] block leading-[34px] pr-2 hover:text-[#101219] rounded text-ellipsis overflow-hidden whitespace-nowrap ${a===u.id?"font-bold bg-[#f5f5f5]":""}`,style:{textIndent:`${u.level}rem`},onClick:()=>l(u),children:u.textContent},u.id))}):F.jsx(jje,{size:"120px"})})]})},Xoe=["top","right","bottom","left"],Iq=["start","end"],Lq=Xoe.reduce((t,e)=>t.concat(e,e+"-"+Iq[0],e+"-"+Iq[1]),[]),vl=Math.min,ha=Math.max,u_=Math.round,rl=t=>({x:t,y:t}),Wje={left:"right",right:"left",bottom:"top",top:"bottom"},qje={start:"end",end:"start"};function zI(t,e,r){return ha(t,vl(e,r))}function Cu(t,e){return typeof t=="function"?t(e):t}function Fo(t){return t.split("-")[0]}function ss(t){return t.split("-")[1]}function Zoe(t){return t==="x"?"y":"x"}function r5(t){return t==="y"?"height":"width"}const Kje=new Set(["top","bottom"]);function Ys(t){return Kje.has(Fo(t))?"y":"x"}function n5(t){return Zoe(Ys(t))}function Joe(t,e,r){r===void 0&&(r=!1);const n=ss(t),i=n5(t),a=r5(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=f_(o)),[o,f_(o)]}function Yje(t){const e=f_(t);return[c_(t),e,c_(e)]}function c_(t){return t.replace(/start|end/g,e=>qje[e])}const Pq=["left","right"],Bq=["right","left"],Xje=["top","bottom"],Zje=["bottom","top"];function Jje(t,e,r){switch(t){case"top":case"bottom":return r?e?Bq:Pq:e?Pq:Bq;case"left":case"right":return e?Xje:Zje;default:return[]}}function Qje(t,e,r,n){const i=ss(t);let a=Jje(Fo(t),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(c_)))),a}function f_(t){return t.replace(/left|right|bottom|top/g,e=>Wje[e])}function eGe(t){return{top:0,right:0,bottom:0,left:0,...t}}function i5(t){return typeof t!="number"?eGe(t):{top:t,right:t,bottom:t,left:t}}function Ev(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function zq(t,e,r){let{reference:n,floating:i}=t;const a=Ys(e),o=n5(e),s=r5(o),l=Fo(e),u=a==="y",c=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:n.y-i.height};break;case"bottom":h={x:c,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(ss(e)){case"start":h[o]-=d*(r&&u?-1:1);break;case"end":h[o]+=d*(r&&u?-1:1);break}return h}const tGe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=zq(u,n,l),d=n,h={},p=0;for(let v=0;v<s.length;v++){const{name:g,fn:m}=s[v],{x:y,y:b,data:x,reset:w}=await m({x:c,y:f,initialPlacement:n,placement:d,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});c=y??c,f=b??f,h={...h,[g]:{...h[g],...x}},w&&p<=50&&(p++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:c,y:f}=zq(u,d,l)),v=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function Mv(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:o,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Cu(e,t),p=i5(h),g=s[d?f==="floating"?"reference":"floating":f],m=Ev(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(g)))==null||r?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y=f==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),x=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},w=Ev(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(m.top-w.top+p.top)/x.y,bottom:(w.bottom-m.bottom+p.bottom)/x.y,left:(m.left-w.left+p.left)/x.x,right:(w.right-m.right+p.right)/x.x}}const rGe=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=Cu(t,e)||{};if(u==null)return{};const f=i5(c),d={x:r,y:n},h=n5(i),p=r5(h),v=await o.getDimensions(u),g=h==="y",m=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=a.reference[p]+a.reference[h]-d[h]-a.floating[p],w=d[h]-a.reference[h],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=_?_[b]:0;(!C||!await(o.isElement==null?void 0:o.isElement(_)))&&(C=s.floating[b]||a.floating[p]);const D=x/2-w/2,O=C/2-v[p]/2-1,I=vl(f[m],O),L=vl(f[y],O),V=I,H=C-v[p]-L,Y=C/2-v[p]/2+D,te=zI(V,Y,H),Q=!l.arrow&&ss(i)!=null&&Y!==te&&a.reference[p]/2-(Y<V?I:L)-v[p]/2<0,ue=Q?Y<V?Y-V:Y-H:0;return{[h]:d[h]+ue,data:{[h]:te,centerOffset:Y-te-ue,...Q&&{alignmentOffset:ue}},reset:Q}}});function nGe(t,e,r){return(t?[...r.filter(i=>ss(i)===t),...r.filter(i=>ss(i)!==t)]:r.filter(i=>Fo(i)===i)).filter(i=>t?ss(i)===t||(e?c_(i)!==i:!1):!0)}const iGe=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,n,i;const{rects:a,middlewareData:o,placement:s,platform:l,elements:u}=e,{crossAxis:c=!1,alignment:f,allowedPlacements:d=Lq,autoAlignment:h=!0,...p}=Cu(t,e),v=f!==void 0||d===Lq?nGe(f||null,h,d):d,g=await Mv(e,p),m=((r=o.autoPlacement)==null?void 0:r.index)||0,y=v[m];if(y==null)return{};const b=Joe(y,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==y)return{reset:{placement:v[0]}};const x=[g[Fo(y)],g[b[0]],g[b[1]]],w=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:y,overflows:x}],_=v[m+1];if(_)return{data:{index:m+1,overflows:w},reset:{placement:_}};const C=w.map(I=>{const L=ss(I.placement);return[I.placement,L&&c?I.overflows.slice(0,2).reduce((V,H)=>V+H,0):I.overflows[0],I.overflows]}).sort((I,L)=>I[1]-L[1]),O=((i=C.filter(I=>I[2].slice(0,ss(I[0])?2:3).every(L=>L<=0))[0])==null?void 0:i[0])||C[0][0];return O!==s?{data:{index:m+1,overflows:w},reset:{placement:O}}:{}}}},aGe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=Cu(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const m=Fo(i),y=Ys(s),b=Fo(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=d||(b||!v?[f_(s)]:Yje(s)),_=p!=="none";!d&&_&&w.push(...Qje(s,v,p,x));const C=[s,...w],D=await Mv(e,g),O=[];let I=((n=a.flip)==null?void 0:n.overflows)||[];if(c&&O.push(D[m]),f){const Y=Joe(i,o,x);O.push(D[Y[0]],D[Y[1]])}if(I=[...I,{placement:i,overflows:O}],!O.every(Y=>Y<=0)){var L,V;const Y=(((L=a.flip)==null?void 0:L.index)||0)+1,te=C[Y];if(te&&(!(f==="alignment"?y!==Ys(te):!1)||I.every(ie=>Ys(ie.placement)===y?ie.overflows[0]>0:!0)))return{data:{index:Y,overflows:I},reset:{placement:te}};let Q=(V=I.filter(ue=>ue.overflows[0]<=0).sort((ue,ie)=>ue.overflows[1]-ie.overflows[1])[0])==null?void 0:V.placement;if(!Q)switch(h){case"bestFit":{var H;const ue=(H=I.filter(ie=>{if(_){const Se=Ys(ie.placement);return Se===y||Se==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(Se=>Se>0).reduce((Se,me)=>Se+me,0)]).sort((ie,Se)=>ie[1]-Se[1])[0])==null?void 0:H[0];ue&&(Q=ue);break}case"initialPlacement":Q=s;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};function Fq(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Vq(t){return Xoe.some(e=>t[e]>=0)}const oGe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=Cu(t,e);switch(n){case"referenceHidden":{const a=await Mv(e,{...i,elementContext:"reference"}),o=Fq(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Vq(o)}}}case"escaped":{const a=await Mv(e,{...i,altBoundary:!0}),o=Fq(a,r.floating);return{data:{escapedOffsets:o,escaped:Vq(o)}}}default:return{}}}}};function Qoe(t){const e=vl(...t.map(a=>a.left)),r=vl(...t.map(a=>a.top)),n=ha(...t.map(a=>a.right)),i=ha(...t.map(a=>a.bottom));return{x:e,y:r,width:n-e,height:i-r}}function sGe(t){const e=t.slice().sort((i,a)=>i.y-a.y),r=[];let n=null;for(let i=0;i<e.length;i++){const a=e[i];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(i=>Ev(Qoe(i)))}const lGe=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:r,elements:n,rects:i,platform:a,strategy:o}=e,{padding:s=2,x:l,y:u}=Cu(t,e),c=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(n.reference))||[]),f=sGe(c),d=Ev(Qoe(c)),h=i5(s);function p(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&u!=null)return f.find(g=>l>g.left-h.left&&l<g.right+h.right&&u>g.top-h.top&&u<g.bottom+h.bottom)||d;if(f.length>=2){if(Ys(r)==="y"){const I=f[0],L=f[f.length-1],V=Fo(r)==="top",H=I.top,Y=L.bottom,te=V?I.left:L.left,Q=V?I.right:L.right,ue=Q-te,ie=Y-H;return{top:H,bottom:Y,left:te,right:Q,width:ue,height:ie,x:te,y:H}}const g=Fo(r)==="left",m=ha(...f.map(I=>I.right)),y=vl(...f.map(I=>I.left)),b=f.filter(I=>g?I.left===y:I.right===m),x=b[0].top,w=b[b.length-1].bottom,_=y,C=m,D=C-_,O=w-x;return{top:x,bottom:w,left:_,right:C,width:D,height:O,x:_,y:x}}return d}const v=await a.getElementRects({reference:{getBoundingClientRect:p},floating:n.floating,strategy:o});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},uGe=new Set(["left","top"]);async function cGe(t,e){const{placement:r,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Fo(r),s=ss(r),l=Ys(r)==="y",u=uGe.has(o)?-1:1,c=a&&l?-1:1,f=Cu(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),l?{x:h*c,y:d*u}:{x:d*u,y:h*c}}const fGe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:a,placement:o,middlewareData:s}=e,l=await cGe(e,t);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},dGe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:g=>{let{x:m,y}=g;return{x:m,y}}},...l}=Cu(t,e),u={x:r,y:n},c=await Mv(e,l),f=Ys(Fo(i)),d=Zoe(f);let h=u[d],p=u[f];if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",y=h+c[g],b=h-c[m];h=zI(y,h,b)}if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",y=p+c[g],b=p-c[m];p=zI(y,p,b)}const v=s.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[d]:a,[f]:o}}}}}},hGe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:a,platform:o,elements:s}=e,{apply:l=()=>{},...u}=Cu(t,e),c=await Mv(e,u),f=Fo(i),d=ss(i),h=Ys(i)==="y",{width:p,height:v}=a.floating;let g,m;f==="top"||f==="bottom"?(g=f,m=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=f,g=d==="end"?"top":"bottom");const y=v-c.top-c.bottom,b=p-c.left-c.right,x=vl(v-c[g],y),w=vl(p-c[m],b),_=!e.middlewareData.shift;let C=x,D=w;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(D=b),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(C=y),_&&!d){const I=ha(c.left,0),L=ha(c.right,0),V=ha(c.top,0),H=ha(c.bottom,0);h?D=p-2*(I!==0||L!==0?I+L:ha(c.left,c.right)):C=v-2*(V!==0||H!==0?V+H:ha(c.top,c.bottom))}await l({...e,availableWidth:D,availableHeight:C});const O=await o.getDimensions(s.floating);return p!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function z2(){return typeof window<"u"}function ig(t){return ese(t)?(t.nodeName||"").toLowerCase():"#document"}function Qa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Eu(t){var e;return(e=(ese(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ese(t){return z2()?t instanceof Node||t instanceof Qa(t).Node:!1}function ds(t){return z2()?t instanceof Element||t instanceof Qa(t).Element:!1}function gl(t){return z2()?t instanceof HTMLElement||t instanceof Qa(t).HTMLElement:!1}function Hq(t){return!z2()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qa(t).ShadowRoot}const pGe=new Set(["inline","contents"]);function W0(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=hs(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!pGe.has(i)}const vGe=new Set(["table","td","th"]);function gGe(t){return vGe.has(ig(t))}const mGe=[":popover-open",":modal"];function F2(t){return mGe.some(e=>{try{return t.matches(e)}catch{return!1}})}const yGe=["transform","translate","scale","rotate","perspective"],bGe=["transform","translate","scale","rotate","perspective","filter"],xGe=["paint","layout","strict","content"];function a5(t){const e=o5(),r=ds(t)?hs(t):t;return yGe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||bGe.some(n=>(r.willChange||"").includes(n))||xGe.some(n=>(r.contain||"").includes(n))}function wGe(t){let e=$c(t);for(;gl(e)&&!Av(e);){if(a5(e))return e;if(F2(e))return null;e=$c(e)}return null}function o5(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SGe=new Set(["html","body","#document"]);function Av(t){return SGe.has(ig(t))}function hs(t){return Qa(t).getComputedStyle(t)}function V2(t){return ds(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $c(t){if(ig(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Hq(t)&&t.host||Eu(t);return Hq(e)?e.host:e}function tse(t){const e=$c(t);return Av(e)?t.ownerDocument?t.ownerDocument.body:t.body:gl(e)&&W0(e)?e:tse(e)}function rse(t,e,r){var n;e===void 0&&(e=[]);const i=tse(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),o=Qa(i);return a?(FI(o),e.concat(o,o.visualViewport||[],W0(i)?i:[],[])):e.concat(i,rse(i,[]))}function FI(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function nse(t){const e=hs(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=gl(t),a=i?t.offsetWidth:r,o=i?t.offsetHeight:n,s=u_(r)!==a||u_(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function ise(t){return ds(t)?t:t.contextElement}function Zp(t){const e=ise(t);if(!gl(e))return rl(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:a}=nse(e);let o=(a?u_(r.width):r.width)/n,s=(a?u_(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const _Ge=rl(0);function ase(t){const e=Qa(t);return!o5()||!e.visualViewport?_Ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function TGe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Qa(t)?!1:e}function p0(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),a=ise(t);let o=rl(1);e&&(n?ds(n)&&(o=Zp(n)):o=Zp(t));const s=TGe(a,r,n)?ase(a):rl(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(a){const d=Qa(a),h=n&&ds(n)?Qa(n):n;let p=d,v=FI(p);for(;v&&n&&h!==p;){const g=Zp(v),m=v.getBoundingClientRect(),y=hs(v),b=m.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,x=m.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=b,u+=x,p=Qa(v),v=FI(p)}}return Ev({width:c,height:f,x:l,y:u})}function H2(t,e){const r=V2(t).scrollLeft;return e?e.left+r:p0(Eu(t)).left+r}function ose(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-H2(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function CGe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const a=i==="fixed",o=Eu(n),s=e?F2(e.floating):!1;if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=rl(1);const c=rl(0),f=gl(n);if((f||!f&&!a)&&((ig(n)!=="body"||W0(o))&&(l=V2(n)),gl(n))){const h=p0(n);u=Zp(n),c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}const d=o&&!f&&!a?ose(o,l):rl(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:r.y*u.y-l.scrollTop*u.y+c.y+d.y}}function EGe(t){return Array.from(t.getClientRects())}function MGe(t){const e=Eu(t),r=V2(t),n=t.ownerDocument.body,i=ha(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=ha(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+H2(t);const s=-r.scrollTop;return hs(n).direction==="rtl"&&(o+=ha(e.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:s}}const $q=25;function AGe(t,e){const r=Qa(t),n=Eu(t),i=r.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const c=o5();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const u=H2(n);if(u<=0){const c=n.ownerDocument,f=c.body,d=getComputedStyle(f),h=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(n.clientWidth-f.clientWidth-h);p<=$q&&(a-=p)}else u<=$q&&(a+=u);return{width:a,height:o,x:s,y:l}}const kGe=new Set(["absolute","fixed"]);function NGe(t,e){const r=p0(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,a=gl(t)?Zp(t):rl(1),o=t.clientWidth*a.x,s=t.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:o,height:s,x:l,y:u}}function Uq(t,e,r){let n;if(e==="viewport")n=AGe(t,r);else if(e==="document")n=MGe(Eu(t));else if(ds(e))n=NGe(e,r);else{const i=ase(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ev(n)}function sse(t,e){const r=$c(t);return r===e||!ds(r)||Av(r)?!1:hs(r).position==="fixed"||sse(r,e)}function DGe(t,e){const r=e.get(t);if(r)return r;let n=rse(t,[]).filter(s=>ds(s)&&ig(s)!=="body"),i=null;const a=hs(t).position==="fixed";let o=a?$c(t):t;for(;ds(o)&&!Av(o);){const s=hs(o),l=a5(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&kGe.has(i.position)||W0(o)&&!l&&sse(t,o))?n=n.filter(c=>c!==o):i=s,o=$c(o)}return e.set(t,n),n}function OGe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?F2(e)?[]:DGe(e,this._c):[].concat(r),n],s=o[0],l=o.reduce((u,c)=>{const f=Uq(e,c,i);return u.top=ha(f.top,u.top),u.right=vl(f.right,u.right),u.bottom=vl(f.bottom,u.bottom),u.left=ha(f.left,u.left),u},Uq(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RGe(t){const{width:e,height:r}=nse(t);return{width:e,height:r}}function IGe(t,e,r){const n=gl(e),i=Eu(e),a=r==="fixed",o=p0(t,!0,a,e);let s={scrollLeft:0,scrollTop:0};const l=rl(0);function u(){l.x=H2(i)}if(n||!n&&!a)if((ig(e)!=="body"||W0(i))&&(s=V2(e)),n){const h=p0(e,!0,a,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&u();a&&!n&&i&&u();const c=i&&!n&&!a?ose(i,s):rl(0),f=o.left+s.scrollLeft-l.x-c.x,d=o.top+s.scrollTop-l.y-c.y;return{x:f,y:d,width:o.width,height:o.height}}function hD(t){return hs(t).position==="static"}function jq(t,e){if(!gl(t)||hs(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Eu(t)===r&&(r=r.ownerDocument.body),r}function lse(t,e){const r=Qa(t);if(F2(t))return r;if(!gl(t)){let i=$c(t);for(;i&&!Av(i);){if(ds(i)&&!hD(i))return i;i=$c(i)}return r}let n=jq(t,e);for(;n&&gGe(n)&&hD(n);)n=jq(n,e);return n&&Av(n)&&hD(n)&&!a5(n)?r:n||wGe(t)||r}const LGe=async function(t){const e=this.getOffsetParent||lse,r=this.getDimensions,n=await r(t.floating);return{reference:IGe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function PGe(t){return hs(t).direction==="rtl"}const BGe={convertOffsetParentRelativeRectToViewportRelativeRect:CGe,getDocumentElement:Eu,getClippingRect:OGe,getOffsetParent:lse,getElementRects:LGe,getClientRects:EGe,getDimensions:RGe,getScale:Zp,isElement:ds,isRTL:PGe},use=fGe,cse=iGe,fse=dGe,dse=aGe,hse=hGe,pse=oGe,vse=rGe,gse=lGe,mse=(t,e,r)=>{const n=new Map,i={platform:BGe,...r},a={...i.platform,_c:n};return tGe(t,e,{...i,platform:a})};function zGe(t,e){const r=Math.min(t.top,e.top),n=Math.max(t.bottom,e.bottom),i=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-i,s=n-r,l=i,u=r;return new DOMRect(l,u,o,s)}var FGe=class{constructor({editor:t,element:e,view:r,updateDelay:n=250,resizeDelay:i=60,shouldShow:a,appendTo:o,getReferencedVirtualElement:s,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:c,state:f,from:d,to:h})=>{const{doc:p,selection:v}=f,{empty:g}=v,m=!p.textBetween(d,h).length&&xL(f.selection),y=this.element.contains(document.activeElement);return!(!(c.hasFocus()||y)||g||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:c})=>{var f;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}c?.relatedTarget&&((f=this.element.parentNode)!=null&&f.contains(c.relatedTarget))||c?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(c,f)=>{const d=!f?.selection.eq(c.state.selection),h=!f?.doc.eq(c.state.doc);!d&&!h||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(c,d,h,f)},this.updateDelay))},this.updateHandler=(c,f,d,h)=>{const{composing:p}=c;if(p||!f&&!d)return;if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:c})=>{c.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var u;this.editor=t,this.element=e,this.view=r,this.updateDelay=n,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(u=l?.scrollTarget)!=null?u:window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(dse(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(fse(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(use(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(vse(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(hse(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(cse(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(pse(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(gse(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t;const{selection:e}=this.editor.state,r=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(r)return r;const n=sX(this.view,e.from,e.to);let i={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof ar){let a=this.view.nodeDOM(e.from);const o=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");o&&(a=o),a&&(i={getBoundingClientRect:()=>a.getBoundingClientRect(),getClientRects:()=>[a.getBoundingClientRect()]})}if(e instanceof Cn){const{$anchorCell:a,$headCell:o}=e,s=a?a.pos:o.pos,l=o?o.pos:a.pos,u=this.view.nodeDOM(s),c=this.view.nodeDOM(l);if(!u||!c)return;const f=u===c?u.getBoundingClientRect():zGe(u.getBoundingClientRect(),c.getBoundingClientRect());i={getBoundingClientRect:()=>f,getClientRects:()=>[f]}}return i}updatePosition(){const t=this.virtualElement;t&&mse(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:r,strategy:n})=>{this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${r}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const{state:r}=t,n=r.selection.from!==r.selection.to;if(this.updateDelay>0&&n){this.handleDebouncedUpdate(t,e);return}const i=!e?.selection.eq(t.state.selection),a=!e?.doc.eq(t.state.doc);this.updateHandler(t,i,a,e)}getShouldShow(t){var e;const{state:r}=this.view,{selection:n}=r,{ranges:i}=n,a=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:r,oldState:t,from:a,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},yse=t=>new en({key:typeof t.pluginKey=="string"?new on(t.pluginKey):t.pluginKey,view:e=>new FGe({view:e,...t})});Vr.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[yse({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var VGe=class{constructor({editor:t,element:e,view:r,options:n,appendTo:i,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:o,state:s})=>{const{selection:l}=s,{$anchor:u,empty:c}=l,f=u.depth===1,d=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!o.hasFocus()||!c||!f||!d||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(o,s,l,u)=>{const{composing:c}=o;if(c||!s&&!l)return;if(!this.getShouldShow(u)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var s;if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&((s=this.element.parentNode)!=null&&s.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=t,this.element=e,this.view=r,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return tX(t,{textSerializers:_L(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(dse(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(fse(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(use(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(vse(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(hse(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(cse(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(pse(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(gse(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:r}=this.view,{selection:n}=r,{ranges:i}=n,a=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:r,oldState:t,from:a,to:o})}updatePosition(){const{selection:t}=this.editor.state,e=sX(this.view,t.from,t.to);mse({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:i,strategy:a})=>{this.element.style.width="max-content",this.element.style.position=a,this.element.style.left=`${n}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const r=!e?.selection.eq(t.state.selection),n=!e?.doc.eq(t.state.doc);this.updateHandler(t,r,n,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},bse=t=>new en({key:typeof t.pluginKey=="string"?new on(t.pluginKey):t.pluginKey,view:e=>new VGe({view:e,...t})});Vr.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[bse({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var HGe=j.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:r,resizeDelay:n,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:l,...u},c)=>{const f=j.useRef(document.createElement("div"));typeof c=="function"?c(f.current):c&&(c.current=f.current);const{editor:d}=AX(),h=e||d,p={updateDelay:r,resizeDelay:n,appendTo:i,pluginKey:t,shouldShow:a,getReferencedVirtualElement:o,options:s},v=j.useRef(p);return v.current=p,j.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const g=f.current;g.style.visibility="hidden",g.style.position="absolute";const m=yse({...v.current,editor:h,element:g});h.registerPlugin(m);const y=v.current.pluginKey;return()=>{h.unregisterPlugin(y),window.requestAnimationFrame(()=>{g.parentNode&&g.parentNode.removeChild(g)})}},[h]),kv.createPortal(F.jsx("div",{...u,children:l}),f.current)});j.forwardRef(({pluginKey:t="floatingMenu",editor:e,appendTo:r,shouldShow:n=null,options:i,children:a,...o},s)=>{const l=j.useRef(document.createElement("div"));typeof s=="function"?s(l.current):s&&(s.current=l.current);const{editor:u}=AX();return j.useEffect(()=>{const c=l.current;if(c.style.visibility="hidden",c.style.position="absolute",e?.isDestroyed||u?.isDestroyed)return;const f=e||u;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=bse({editor:f,element:c,pluginKey:t,appendTo:r,shouldShow:n,options:i});return f.registerPlugin(d),()=>{f.unregisterPlugin(t),window.requestAnimationFrame(()=>{c.parentNode&&c.parentNode.removeChild(c)})}},[e,u,r,t,n,i]),kv.createPortal(F.jsx("div",{...o,children:a}),l.current)});function $Ge(){const{editor:t}=Ot(),[e,r]=j.useReducer(o=>o+1,0);j.useEffect(()=>{if(!t)return;const o=()=>r();return t.on("selectionUpdate",o),t.on("transaction",o),()=>{t.off("selectionUpdate",o),t.off("transaction",o)}},[t]);const n=j.useMemo(()=>{const o=t?au(t):null;return o?.type?.name?t?.getAttributes(o.type.name)?.flipY:!1},[t,e]),i=j.useMemo(()=>{const o=t?au(t):null;return o?.type?.name?t?.getAttributes(o.type.name)?.flipX:!1},[t,e]),a=o=>{const s=t?au(t):null,{flipX:l,flipY:u}=s?.attrs??{};s&&o==="flipX"&&t?.commands.updateAttributes(s.type,{flipX:!l}),s&&o==="flipY"&&t?.commands.updateAttributes(s.type,{flipY:!u})};return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"flip-x",text:"水平翻转",hideText:!0,menuActive:n,onMenuClick:()=>a("flipY")}),F.jsx(Ar,{ico:"flip-y",text:"垂直翻转",hideText:!0,menuActive:i,onMenuClick:()=>a("flipX")})]})}function xse(){const{editor:t}=Ot(),e=()=>{const r=t?au(t):null;r?.attrs.src&&window.open(r.attrs.src)};return F.jsx(Ar,{ico:"open",text:"新窗口打开",shortcut:"Backspace",hideText:!0,onMenuClick:e})}function UGe(){const{editor:t}=Ot(),e=j.useMemo(()=>(t?au(t):null)?.type?.name==="inlineImage"?"转为节点图片":"转为行内图片",[t?.state.selection]),[r,n]=j.useReducer(a=>a+1,0);j.useEffect(()=>{if(!t)return;const a=()=>n();return t.on("selectionUpdate",a),t.on("transaction",a),()=>{t.off("selectionUpdate",a),t.off("transaction",a)}},[t]);const i=()=>{const a=t?au(t):null;if(a){const o=a?.type?.name==="inlineImage"?"inlineImage":"image",s=a.attrs??{};!s.error&&s.src&&(t?.chain().focus().deleteSelectionNode().run(),o==="inlineImage"?t?.chain().focus().setImage({...s,equalProportion:!1,inline:!1}).run():t?.chain().focus().setInlineImage({...s,inline:!0,equalProportion:!1}).run())}};return F.jsx(Ar,{ico:"huantu",text:e,hideText:!0,onMenuClick:i})}function dh(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"remove",text:"删除",shortcut:"Backspace",hideText:!0,onMenuClick:()=>t?.chain().focus().deleteSelectionNode().run()})}function jGe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx($Ge,{}),F.jsx(UGe,{}),F.jsx(xse,{}),F.jsx(dh,{})]})}function GGe(){const{editor:t}=Ot(),e=()=>{const r=t?au(t):null;if(!r)return;const n=document.createElement("a");n.href=r.attrs.url,n.download=r.attrs.name,document.body.appendChild(n),n.click(),document.body.removeChild(n)};return t?.getAttributes("file")?.uploaded?F.jsx(Ar,{ico:"down",text:"下载",hideText:!0,onMenuClick:e}):null}function WGe(){const{editor:t}=Ot();return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),(t?.isActive("file")||t?.isActive("video")||t?.isActive("audio"))&&F.jsx(GGe,{}),F.jsx(dh,{})]})}function qGe({defaultColor:t="#007bff"}){const{editor:e}=Ot(),[r,n]=j.useState(!1),[i,a]=j.useState(t),o=l=>{a(l),n(!1);const u=l===""?null:l;e?.chain().focus().setCellAttribute("background",u).run()},s=g0(l=>{a(l);const u=l===""?null:l;e?.chain().focus().setCellAttribute("background",u).run()},200);return F.jsx(xl,{ico:"fill",text:"填充背景",hideText:!0,popupVisible:r,disabled:!e?.can().setCellAttribute("background",""),popupType:"arrow",onMenuClick:()=>o(i),onPopupVisibleChange:n,content:F.jsx("div",{className:"p-2",children:F.jsx("input",{type:"color",value:i,onChange:l=>s(l.target.value),className:"w-full h-8 cursor-pointer",style:{width:"100%",height:"32px",cursor:"pointer",border:"none",background:"transparent"}})}),children:F.jsx("div",{className:"w-[14px] h-[2px] mx-auto",style:{backgroundColor:i}})})}function KGe({hideText:t=!0}){const{editor:e}=Ot();return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"charutop",text:"上方插入一行",hideText:t,disabled:!e?.can().addRowBefore(),onMenuClick:()=>e?.chain().focus().addRowBefore().run()}),F.jsx(Ar,{ico:"charubottom",text:"下方插入一行",hideText:t,disabled:!e?.can().addRowAfter(),onMenuClick:()=>e?.chain().focus().addRowAfter().run()}),F.jsx(Ar,{ico:"charuleft",text:"左方插入一列",hideText:t,disabled:!e?.can().addColumnBefore(),onMenuClick:()=>e?.chain().focus().addColumnBefore().run()}),F.jsx(Ar,{ico:"charuright",text:"右方插入一列",hideText:t,disabled:!e?.can().addColumnAfter(),onMenuClick:()=>e?.chain().focus().addColumnAfter().run()})]})}function YGe({hideText:t=!0}){const{editor:e}=Ot();return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"removehang",text:"删除行",hideText:t,disabled:!e?.can().deleteColumn(),onMenuClick:()=>e?.chain().focus().deleteRow().run()}),F.jsx(Ar,{ico:"removelie",text:"删除列",hideText:t,disabled:!e?.can().deleteColumn(),onMenuClick:()=>e?.chain().focus().deleteColumn().run()})]})}function XGe({hideText:t=!0}){const{editor:e}=Ot();return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"merge-cell",text:"合并单元格",hideText:t,disabled:!e?.can().mergeCells(),onMenuClick:()=>e?.chain().focus().mergeCells().run()}),F.jsx(Ar,{ico:"split-cell",text:"拆分单元格",hideText:t,disabled:!e?.can().splitCell(),onMenuClick:()=>e?.chain().focus().splitCell().run()})]})}function ZGe(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"remove",text:"删除表格",shortcut:"Backspace",hideText:!0,disabled:!t?.can().deleteTable(),onMenuClick:()=>t?.chain().focus().deleteTable().run()})}function JGe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(qGe,{}),F.jsx(KGe,{}),F.jsx(YGe,{}),F.jsx(XGe,{}),F.jsx(ZGe,{})]})}function QGe(){const{editor:t}=Ot(),[e,r]=j.useState(""),n=()=>{if(e==="")return;t?.state?.selection?.$from?.node()&&t?.commands.updateAttributes("tag",{text:e})},i=()=>{const a=t?.getAttributes("tag");a?.text&&r(a.text)};return j.useEffect(()=>{if(t)return i(),t.on("selectionUpdate",i),()=>{t.off("selectionUpdate",i)}},[t]),F.jsxs(F.Fragment,{children:[F.jsx(jd,{placeholder:"请输入标签",value:e,onChange:a=>r(a),size:"small"}),F.jsx(ts,{type:"primary",size:"small",onClick:n,children:"确认"})]})}function eWe(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=[{label:"蓝色",color:"#007bff",bgcolor:"rgb(217, 231, 255)"},{label:"红色",color:"rgba(200, 78, 67, 1)",bgcolor:"rgb(252, 223, 220)"},{label:"黄色",color:"rgba(240, 196, 23, 1)",bgcolor:"rgb(255, 245, 210)"},{label:"绿色",color:"rgba(5, 205, 153, 1)",bgcolor:"rgb(205, 245, 235)"},{label:"紫色",color:"#e6afff",bgcolor:"rgb(220, 223, 252)"}],i=o=>{t?.state?.selection?.$from?.node()&&t?.commands.updateAttributes("tag",{type:o.type,color:o.color,backgroundColor:o.bgcolor}),r(!1)},a=()=>{t?.state?.selection?.$from?.node()&&t?.commands.updateAttributes("tag",{type:"default",color:"#999",backgroundColor:"rgba(0, 0, 0, 0.05)"}),r(!1)};return F.jsx(B2,{ico:"fill",text:"高亮填充",hideText:!0,onMenuClick:()=>i(),maxHeight:!1,popupVisible:e,onPopupVisibleChange:r,content:F.jsxs("div",{className:"px-2",children:[n.map((o,s)=>F.jsxs("div",{onClick:()=>i(o),style:{backgroundColor:o.bgcolor},className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer",children:[F.jsx("i",{className:"w-iconfont icon-tumo !text-[14px]"}),o.label]},s)),F.jsxs("div",{className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:a,children:[F.jsx("i",{className:"w-iconfont icon-clear-format !text-[14px]"}),"清除"]})]})})}function tWe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(QGe,{}),F.jsx(eWe,{}),F.jsx(dh,{})]})}function rWe(){const{editor:t,setAssistant:e}=Ot(),r=()=>{e(!0),t?.commands.focus()};return F.jsx(Ar,{ico:"ai-assistant",text:"AI智能助手",hideText:!0,onMenuClick:r})}function nWe(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=[{label:"默认",bgcolor:"#007bff"},{label:"红色",bgcolor:"#ff8a8a"},{label:"黄色",bgcolor:"#ffff8a"},{label:"绿色",bgcolor:"#a7ffa7"},{label:"紫色",bgcolor:"#e6afff"},{label:"蓝色",bgcolor:"#83d3ff"}],i=o=>{if(!o){t?.chain().focus().setHighlight({color:n[0].bgcolor}).run();return}t?.chain().focus().setHighlight({color:o.bgcolor}).run(),r(!1)},a=()=>{t?.chain().focus().unsetHighlight().run(),r(!1)};return F.jsx(B2,{ico:"fill",text:"高亮填充",hideText:!0,onMenuClick:()=>i(),maxHeight:!1,popupVisible:e,onPopupVisibleChange:r,content:F.jsxs("div",{className:"px-2",children:[n.map((o,s)=>F.jsxs("div",{onClick:()=>i(o),style:{backgroundColor:o.bgcolor},className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer",children:[F.jsx("i",{className:"w-iconfont icon-tumo !text-[14px]"}),o.label]},s)),F.jsxs("div",{className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:a,children:[F.jsx("i",{className:"w-iconfont icon-clear-format !text-[14px]"}),"清除"]})]})})}function iWe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(rWe,{}),F.jsx(DI,{}),F.jsx(OI,{}),F.jsx(RI,{}),F.jsx(II,{}),F.jsx(Koe,{}),F.jsx(nWe,{}),F.jsx(dh,{})]})}function aWe(){const{editor:t}=Ot(),[e,r]=j.useState(""),[n,i]=j.useState(""),a=s=>{i(s)},o=()=>{const s=cq.find(c=>c.value===n),{validate:l,transformURL:u}=s||{};l&&!l(e)||t?.chain().focus().setParagraph().setIframe({type:n,src:u?u(e):e}).run()};return F.jsx("div",{className:"flex items-center gap-2",children:t?.getAttributes("iframe").src===""?F.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[F.jsxs("div",{className:"flex flex-col items-center gap-1 h-[80px]",children:[F.jsx("span",{className:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{lineHeight:"24px"},children:"1"}),F.jsx("div",{className:"w-[1px] flex-1 bg-[#e5e5e5]"}),F.jsx("span",{className:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{lineHeight:"24px"},children:"2"})]}),F.jsxs("div",{className:"flex-1 h-[90px] flex flex-col justify-between gap-1",children:[F.jsx("div",{className:"mb-2",children:F.jsx(ay,{value:n,placeholder:"选择网页类型",options:cq,className:"w-full",onChange:a,renderOption:s=>F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx("span",{dangerouslySetInnerHTML:{__html:s.icon}}),s.label]})})}),F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(jd,{value:e,onChange:s=>r(s.target?s.target.value:s),placeholder:"打开网址复制链接,以http:// 或 https:// 开头",className:"w-[300px]"}),F.jsx(ts,{type:"primary",size:"small",disabled:!e,onClick:o,children:"添加"})]})]})]}):F.jsxs(F.Fragment,{children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(xse,{}),F.jsx(dh,{})]})})}function oWe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(BI,{icon:"setting",text:"图表配置",isEdit:!0}),F.jsx(dh,{})]})}const sWe="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='14'%20cy='14'%20r='11.0833'%20fill='%23258AFF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.8581%2011.2155C11.9065%2011.1088%2012.058%2011.1088%2012.1064%2011.2155L14.6199%2016.7534C14.6609%2016.8437%2014.5948%2016.9461%2014.4957%2016.9461H11.6756C11.461%2016.9461%2011.2663%2017.072%2011.1782%2017.2677L10.7355%2018.2514C10.6273%2018.492%2010.8033%2018.7642%2011.0671%2018.7642H16.0477C16.7417%2018.7642%2017.2037%2018.0471%2016.9169%2017.4152L12.8512%208.45725C12.5122%207.71045%2011.4515%207.71057%2011.1127%208.45743L6.67056%2018.2504C6.56136%2018.4911%206.73737%2018.7642%207.00171%2018.7642H8.08241C8.29645%2018.7642%208.49072%2018.639%208.57914%2018.4441L11.8581%2011.2155ZM19.373%2018.4441C19.4614%2018.639%2019.6557%2018.7642%2019.8698%2018.7642H20.9504C21.2147%2018.7642%2021.3907%2018.4911%2021.2816%2018.2504L16.7334%208.22172C16.645%208.02677%2016.4508%207.90156%2016.2367%207.90156L15.156%207.90156C14.8917%207.90156%2014.7157%208.17464%2014.8249%208.41537L19.373%2018.4441Z'%20fill='white'/%3e%3c/svg%3e";function lWe(){const{editor:t,options:e,setAssistant:r}=Ot(),[n,i]=j.useState(""),[a,o]=j.useState({prompt:"",content:"",error:!1,command:""}),[s,l]=j.useState(!1),[u]=j.useState(600),c=j.useRef(null),f=()=>{r(!1),t?.commands.focus()},d=async()=>{if(a.content)try{await navigator.clipboard.writeText(a.content)}catch(b){console.error("Failed to copy: ",b)}},h=()=>{a.command&&(i(a.command),v(a.command))},p=()=>{i(""),o(b=>({...b,prompt:"",content:""}))},v=async b=>{const x=b??n;if(!x)return;l(!0),o(C=>({...C,error:!1,prompt:"",content:""}));const w={lang:"",input:t?Z7e(t):"",command:x},_={html:t?.getHTML()??"",text:t?.getText()??"",json:t?.getJSON()??{}};try{const C=await e.ai?.sendMessage?.(w,_),D=O=>{o(I=>{let L=I.content+O,V=I.error;return L.startsWith("[ERROR]: ")&&(V=!0,L=L.replace("[ERROR]: ","")),{...I,content:L,error:V}})};if(C instanceof ReadableStream){const O=new WritableStream({write(I){D(I)},close(){l(!1),o(I=>({...I,command:x}))}});await C.pipeTo(O)}else Mse(C)?(l(!1),o(O=>{let I=C,L=!1;return I.startsWith("[ERROR]: ")&&(L=!0,I=I.replace("[ERROR]: ","")),{...O,content:I,error:L,command:x}})):(console.error('"ai.assistant.onMessage" method returns data in an incorrect format, it can be a ReadableStream or plain text.'),l(!1))}catch(C){console.error(C),r(!1),l(!1)}},g=()=>{t?.chain().insertContent(a.content).run(),f()},m=()=>{const{to:b}=t?.state.selection??{};b&&t?.chain().insertContentAt(b,a.content).focus().run(),f()},y=()=>{t?.commands.selectParentNode();const{to:b}=t?.state.selection??{};b&&t?.chain().insertContentAt(b,a.content).focus().run(),f()};return F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative flex items-center gap-4 h-[50px] border-b px-3 white-ai-wrapper",style:{width:`${u}px`},children:[F.jsx("div",{className:"flex-shrink-0",children:F.jsx("img",{src:sWe,alt:"ai",className:"w-8 h-8"})}),F.jsx("input",{ref:c,value:n,onChange:b=>i(b.target.value),className:`flex-1 outline-none h-full ${s?"input-disabled":""}`,maxLength:e.ai?.maxlength,disabled:s,autoComplete:"false",placeholder:"告诉AI下一步怎么做",onKeyDown:b=>{b.key==="Enter"&&!s&&v()}}),F.jsx("button",{className:"ai-button",disabled:s,onClick:()=>v(),children:s?F.jsx("i",{className:"w-iconfont icon-loading animate-spin"}):F.jsx("i",{className:"w-iconfont icon-send"})})]}),a.content&&F.jsxs("div",{className:"w-full px-3 py-2",style:{width:`${u}px`},children:[F.jsx("div",{className:`w-full min-h-[50px] overflow-y-auto line-clamp-6 result-content ${a.error?"error":""}`,dangerouslySetInnerHTML:{__html:a.content}}),F.jsxs("div",{className:"flex items-center gap-2 text-handle",children:[F.jsx(ts,{type:"primary",size:"small",onClick:g,children:"替换所选"}),F.jsx(ts,{size:"small",onClick:y,children:"插入下方"}),F.jsx(ts,{size:"small",onClick:m,children:"插入后方"}),F.jsx(ts,{size:"small",onClick:p,children:"放弃"}),F.jsx("i",{className:"w-iconfont icon-copy-text cursor-pointer",title:"复制",onClick:d}),F.jsx("i",{className:"w-iconfont icon-refresh cursor-pointer",title:"重新生成",onClick:h})]})]})]})}function uWe(){const{editor:t,assistant:e,setAssistant:r}=Ot(),n=j.useMemo(()=>({placement:e?"bottom":"top",onHide(){r(!1)}}),[e,r]);return t?F.jsx(HGe,{className:`white-editor-bubble-menu rounded-md ${e?"":"px-3 py-2"}`,editor:t,pluginKey:"bubbleMenu",style:{maxWidth:600},options:n,ref:i=>{i&&(i.style.zIndex="200")},children:e?F.jsx(lWe,{}):F.jsx(F.Fragment,{children:t.isActive("toc")||t.isActive("pageBreak")||t.isActive("horizontalRule")||t.isActive("codeBlock")||t.getAttributes("image").error?F.jsx(dh,{}):t.isActive("image")&&!t.getAttributes("image").error||t.isActive("inlineImage")&&!t.getAttributes("inlineImage").error?F.jsx(jGe,{}):t.isActive("video")||t.isActive("audio")||t.isActive("file")?F.jsx(WGe,{}):t.isActive("iframe")?F.jsx(aWe,{}):t.isActive("table")?F.jsx(JGe,{}):t.isActive("tag")?F.jsx(tWe,{}):t.isActive("echarts")?F.jsx(oWe,{}):F.jsx(iWe,{})})}):null}const cWe=()=>{const{editor:t,page:e}=Ot(),[r,n]=j.useReducer(s=>s+1,0);j.useEffect(()=>{if(!t)return;const s=()=>n();return t.on("transaction",s),t.on("selectionUpdate",s),t.on("update",s),()=>{t.off("transaction",s),t.off("selectionUpdate",s),t.off("update",s)}},[t]);const i=j.useMemo(()=>{const{width:s,height:l}=e.size??{width:0,height:0};return{width:s,height:l}},[e.size]),a=j.useMemo(()=>e.layout==="web"?"100%":`calc(${i.width}cm * 1)`,[e.layout,i.width]),o=j.useMemo(()=>{const s=["white-editor-content","flex-1","flex","flex-col"];return t&&(t.isEmpty&&t.state.doc.childCount<=1&&s.push("is-empty"),t.isEditable&&s.push("is-readonly"),t.view?.painter?.enabled&&s.push("format-painter")),s.join(" ")},[t,r,t?.isEmpty,t?.isEditable]);return F.jsxs("div",{className:`white-editor-container min-h-full mx-auto overflow-hidden relative flex flex-col ${e.layout==="page"?"shadow-[0_0_10px_rgba(0,0,0,0.1)] bg-white":""}`,style:{width:a},children:[e.layout==="page"&&F.jsx("div",{className:"w-full h-[4rem]"}),F.jsx(Fme,{editor:t,className:o}),e.layout==="page"&&F.jsx("div",{className:"w-full h-[4rem]"}),t&&F.jsx(uWe,{})]})},fWe=()=>{const{page:t,container:e,options:r,uploadFileMap:n,setEditor:i}=Ot(),a=cVe({container:e,options:r,uploadFileMap:n}),o=Gme({extensions:a,editable:!r?.editor?.readOnly,autofocus:r?.editor?.autofocus,content:Zme(r.document?.content),enableInputRules:NU(r),enablePasteRules:NU(r),editorProps:{attributes:{class:"white-editor"}},parseOptions:r?.editor?.parseOptions});return j.useEffect(()=>{o&&(o.storage.container=e,o.storage.options=r,i(o))},[o,e,r,i]),console.log(r,e),F.jsx("div",{className:"white-editor-namespace white-give-editor-wrapper",children:F.jsxs("div",{className:"flex flex-col ",children:[r.layout?.toolbar?.show&&F.jsx("div",{className:"w-full flex-none border-b border-[#d9d9d9]",children:F.jsx(Ije,{})}),F.jsxs("div",{className:"w-full flex-1 min-h-0 flex overflow-hidden",id:e,children:[t.showToc&&r.layout.toc.show&&F.jsx(Gje,{}),F.jsx("div",{className:`flex-1 h-full overflow-y-auto py-[20px] ${t.layout==="page"?"bg-[#f4f6fa]":""}`,children:F.jsx(cWe,{})})]}),r.layout.foot.show&&F.jsx("div",{className:"w-full h-[40px] flex-none border-t border-[#d9d9d9] px-[2rem]",children:F.jsx(Uje,{})})]})})},dWe=t=>F.jsx(pK,{...t,children:F.jsx(fWe,{})});exports.EditorProvider=pK;exports.WhiteEditor=dWe;exports.useEditorContext=Ot;
|
|
456
|
+
</html>`},u=()=>{const c=l();Vje(c,()=>{console.log("打印完成")})};return F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:u,children:[F.jsx("i",{className:"w-iconfont icon-export-pdf"}),"导出为PDF"]})}function $je(){const{editor:t,options:e}=Ot(),[r,n]=j.useState(!1),i=async()=>{if(!t)return;const o=t.getHTML();try{await navigator.clipboard.writeText(o)}catch(s){console.error("Failed to copy: ",s)}},a=()=>{if(!t)return;const o=new Blob([t.getText()],{type:"text/plain;charset=utf-8"}),{title:s}=e.document??{},l=s!==""?e.document?.title:"无标题文档";zje.saveAs(o,`${l}.txt`),n(!1)};return F.jsxs("div",{className:"flex items-center gap-[20px] text-[#333] foot-action",children:[e.layout.foot.copy&&F.jsxs("span",{className:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]",onClick:i,children:[F.jsx("i",{className:"w-iconfont icon-copy-content"}),"复制全文"]}),F.jsx(ol,{trigger:"click",placement:"top",value:r,onVisibleChange:n,contentStyle:{padding:"6px 0",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08)"},content:F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"px-[12px] py-[5px] flex items-center gap-[0.4rem] cursor-pointer hover:bg-[rgb(242,243,245)]",onClick:a,children:[F.jsx("i",{className:"w-iconfont icon-text"}),"导出为文本"]}),F.jsx(Hje,{})]}),children:e.layout.foot.download&&F.jsxs("span",{className:"cursor-pointer flex items-center gap-[0.4rem] text-[14px] hover:text-[#007aff]",children:[F.jsx("i",{className:"w-iconfont icon-down"}),"下载"]})})]})}function Uje(){return F.jsxs("div",{className:"w-full h-full flex items-center justify-between",children:[F.jsx(Lje,{}),F.jsx($je,{})]})}const jje=({size:t="1em",top:e="30%",title:r="暂无数据"})=>F.jsxs("div",{className:"flex items-center justify-center flex-col gap-2",style:{paddingTop:e},children:[F.jsxs("svg",{className:"icon",viewBox:"0 0 1030 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,children:[F.jsx("path",{d:"M927.053254 896q0 1.254249-0.496852 2.508497t-1.484497 2.508497q-0.993704 1.248189-2.48426 2.49032-1.478438 1.248189-3.453728 2.48426-1.969231 1.230012-4.429254 2.447905-2.453964 1.217893-5.392663 2.423669-2.938698 1.199716-6.343953 2.381254-3.405254 1.187598-7.277065 2.3449-3.87787 1.163361-8.198059 2.302485-4.320189 1.133065-9.088757 2.241893t-9.967338 2.181302q-5.210888 1.084592-10.82168 2.126769-5.616852 1.048237-11.645728 2.060119-6.022817 1.005822-12.439479 1.97529-6.422722 0.969467-13.208994 1.90258-6.792331 0.933112-13.948213 1.817751-7.149822 0.890698-14.645018 1.738982-7.495195 0.842225-15.311527 1.635977-7.822391 0.799811-15.94168 1.551148-8.125349 0.745278-16.541539 1.442082-8.404071 0.702864-17.086863 1.345137-8.670675 0.648331-17.589776 1.24213-8.919101 0.593799-18.068449 1.127006-9.14329 0.539266-18.480474 1.01794-9.349302 0.484734-18.874319 0.908876-9.518959 0.424142-19.201515 0.787693-9.676497 0.36355-19.492355 0.666508-9.809799 0.302959-19.728663 0.551385-9.918864 0.242367-19.928615 0.430201-9.997633 0.181775-20.067977 0.302959-10.064284 0.127243-20.170982 0.187834-10.100639 0.060592-20.213396 0.060592-10.118817 0-20.219456-0.060592-10.100639-0.060592-20.164923-0.181775-10.070343-0.121183-20.074035-0.302959-10.003692-0.187834-19.922557-0.43626-9.924923-0.242367-19.734722-0.545325-9.815858-0.309018-19.492355-0.672568-9.676497-0.36355-19.201514-0.787693-9.518959-0.424142-18.868261-0.908876-9.343243-0.478675-18.486532-1.01794-9.14329-0.533207-18.062391-1.127006t-17.595834-1.24213q-8.676734-0.642272-17.086864-1.345137-8.41013-0.696805-16.535479-1.442082-8.11929-0.751337-15.935622-1.551148-7.822391-0.793751-15.317585-1.635977-7.495195-0.848284-14.651077-1.732923-7.149822-0.890698-13.936095-1.817751-6.798391-0.933112-13.208994-1.908639-6.422722-0.969467-12.445539-1.981349-6.028876-1.005822-11.645727-2.05406-5.622911-1.042178-10.821681-2.12071t-9.967337-2.187361q-4.768568-1.108828-9.088757-2.241893-4.326249-1.139124-8.19806-2.302485-3.871811-1.163361-7.277065-2.3449-3.405254-1.181538-6.343953-2.381254-2.938698-1.205775-5.392663-2.423669-2.460024-1.217893-4.429254-2.447905-1.97529-1.236071-3.453728-2.48426-1.490556-1.24213-2.48426-2.49032-0.987645-1.254249-1.484497-2.508497t-0.496852-2.508497z",fill:"#007bff",opacity:".1"}),F.jsx("path",{d:"M117.426746 376.832c0 8.70703 6.695385 15.36 15.450887 15.36 8.755503 0 15.450888-6.65297 15.450888-15.36 0-8.70097-6.695385-15.36-15.450888-15.36-8.240473 0-15.450888 7.168-15.450887 15.36z m814.776804 455.16497c-19.571124 5.12-23.691361 9.222059-28.326627 28.16303-5.150296-19.449941-9.270533-23.552-28.326627-28.16303 19.056095-5.12 23.691361-9.209941 28.326627-28.15697 4.635266 18.94703 8.755503 23.552 28.326627 28.15697zM203.436686 323.07503c-25.23645 6.65297-30.386746 11.77297-37.08213 36.864-6.695385-25.08497-11.84568-30.21103-37.08213-36.864 25.23645-6.65903 30.386746-12.288 37.08213-36.864 6.180355 25.08497 11.84568 30.20497 37.08213 36.864z m618.035503-88.064c-15.450888 4.096-18.541065 7.168-22.661301 22.528-4.120237-15.36-7.210414-18.432-22.661302-22.528 15.450888-4.096 18.541065-7.168 22.661302-22.528 3.605207 15.36 7.210414 18.432 22.661301 22.528z m66.438817-78.848c-40.172308 10.24-48.412781 18.94097-59.228402 58.87697-10.300592-39.929941-19.056095-48.128-59.228403-58.87697 40.172308-10.24 48.412781-18.94703 59.228403-58.88303 10.300592 39.42703 19.056095 48.128 59.228402 58.88303z",fill:"#007bff",opacity:".5"}),F.jsx("path",{d:"M422.32426 713.21297v4.096l33.991953 31.23503 130.302485-62.97903-117.941775 75.26703v36.864l19.056095-18.432v-0.51503 0.51503l19.056094 18.432 100.945799-122.88v-4.096l-185.410651 42.49297z",fill:"#007bff",opacity:".2"}),F.jsx("path",{d:"M865.249704 551.936v-1.024c0-1.024-0.51503-1.53297-0.515029-2.55697v-0.51503L754.003314 260.61103c-15.965917-48.64303-61.288521-81.41103-112.79148-81.41103H389.362367c-51.502959 0-96.825562 32.768-112.791479 81.41103L165.839527 547.84v0.51503c-0.51503 1.024-0.51503 1.53297-0.51503 2.55697v206.848c0 65.02097 53.048047 117.76 118.456805 117.76h463.526627c65.408757 0 118.456805-52.73903 118.456805-117.76v-204.8c-0.51503-0.50897-0.51503-0.50897-0.51503-1.024zM305.412544 271.36q0-0.50897 0.51503-0.50897c11.330651-36.864 45.322604-60.93103 83.434793-60.93103h251.334438c38.112189 0 72.104142 24.06703 83.949822 60.416q0 0.51503 0.51503 0.51503l102.490887 266.24H592.284024c-8.755503 0-15.450888 6.65297-15.450888 15.36 0 33.792-27.811598 61.44-61.80355 61.44-33.991953 0-61.80355-27.648-61.80355-61.44 0-8.70703-6.695385-15.36-15.450888-15.36H202.921657l102.490887-265.73103zM834.347929 757.76c0 48.128-39.142249 87.04-87.55503 87.04h-463.526627c-48.412781 0-87.55503-38.912-87.555029-87.04V568.32h228.158106c7.210414 43.52303 45.322604 76.8 91.160237 76.8 45.837633 0 83.949822-33.27697 91.160236-76.8H834.347929v189.44z",fill:"#007bff",opacity:".5"}),F.jsx("path",{d:"M515.029586 578.566059c-14.420828 0-25.751479-11.264-25.751479-25.6v-51.2H254.939645l84.464852-219.136 0.51503-1.024c7.210414-21.504 26.781538-35.84 49.44284-35.84h251.334438c22.661302 0 42.232426 14.336 49.44284 35.84l0.51503 1.024 84.464852 219.136H540.781065v51.2c0 14.336-11.330651 25.6-25.751479 25.6z",fill:"#007bff",opacity:".2"})]}),F.jsx("p",{className:"text-[#666]",children:r})]}),Gje=()=>{const{editor:t,options:e,setPage:r}=Ot(),[n,i]=j.useState([]),[a,o]=j.useState(""),s=j.useMemo(()=>dK(()=>{if(t){const u=t.storage.tableOfContents?.content;u&&i(u)}},200),[t]);j.useEffect(()=>{if(!t)return;s();const u=()=>{s()};return t.on("update",u),()=>{t.off("update",u)}},[t,s]);const l=u=>{if(!t)return;o(u.id);const c=t.view.dom.querySelector(`[data-toc-id="${u.id}"]`);if(!c)return;c.scrollIntoView({behavior:"smooth"});const f=t.view.posAtDOM(c,0),{tr:d}=t.view.state,h=d.doc.nodeAt(f);if(h){const p=f+h.nodeSize;d.setSelection(ir.create(d.doc,p))}else d.setSelection(new ir(d.doc.resolve(f)));t.view.dispatch(d),t.view.focus()};return F.jsxs("div",{className:"w-[260px] h-full flex flex-col overflow-hidden",children:[e?.layout?.foot?.show&&F.jsx("div",{className:"h-[50px] flex-none flex items-center px-4 text-[15px] text-[#666] hover:text-[#333]",children:F.jsxs("span",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>r(u=>({...u,showToc:!1})),children:[F.jsx("i",{className:"w-iconfont icon-left !text-[12px]"}),"收起大纲"]})}),F.jsx("div",{className:"overflow-y-auto min-h-0",children:n?.length>0?F.jsx("ul",{className:"flex-1 px-4 py-2 space-y-[0.3rem]",children:n.map(u=>F.jsx("li",{className:`cursor-pointer text-[#333] text-[14px] h-[34px] block leading-[34px] pr-2 hover:text-[#101219] rounded text-ellipsis overflow-hidden whitespace-nowrap ${a===u.id?"font-bold bg-[#f5f5f5]":""}`,style:{textIndent:`${u.level}rem`},onClick:()=>l(u),children:u.textContent},u.id))}):F.jsx(jje,{size:"120px"})})]})},Xoe=["top","right","bottom","left"],Iq=["start","end"],Lq=Xoe.reduce((t,e)=>t.concat(e,e+"-"+Iq[0],e+"-"+Iq[1]),[]),vl=Math.min,ha=Math.max,u_=Math.round,rl=t=>({x:t,y:t}),Wje={left:"right",right:"left",bottom:"top",top:"bottom"},qje={start:"end",end:"start"};function zI(t,e,r){return ha(t,vl(e,r))}function Cu(t,e){return typeof t=="function"?t(e):t}function Fo(t){return t.split("-")[0]}function ss(t){return t.split("-")[1]}function Zoe(t){return t==="x"?"y":"x"}function r5(t){return t==="y"?"height":"width"}const Kje=new Set(["top","bottom"]);function Ys(t){return Kje.has(Fo(t))?"y":"x"}function n5(t){return Zoe(Ys(t))}function Joe(t,e,r){r===void 0&&(r=!1);const n=ss(t),i=n5(t),a=r5(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=f_(o)),[o,f_(o)]}function Yje(t){const e=f_(t);return[c_(t),e,c_(e)]}function c_(t){return t.replace(/start|end/g,e=>qje[e])}const Pq=["left","right"],Bq=["right","left"],Xje=["top","bottom"],Zje=["bottom","top"];function Jje(t,e,r){switch(t){case"top":case"bottom":return r?e?Bq:Pq:e?Pq:Bq;case"left":case"right":return e?Xje:Zje;default:return[]}}function Qje(t,e,r,n){const i=ss(t);let a=Jje(Fo(t),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(c_)))),a}function f_(t){return t.replace(/left|right|bottom|top/g,e=>Wje[e])}function eGe(t){return{top:0,right:0,bottom:0,left:0,...t}}function i5(t){return typeof t!="number"?eGe(t):{top:t,right:t,bottom:t,left:t}}function Ev(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function zq(t,e,r){let{reference:n,floating:i}=t;const a=Ys(e),o=n5(e),s=r5(o),l=Fo(e),u=a==="y",c=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:n.y-i.height};break;case"bottom":h={x:c,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(ss(e)){case"start":h[o]-=d*(r&&u?-1:1);break;case"end":h[o]+=d*(r&&u?-1:1);break}return h}const tGe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:f}=zq(u,n,l),d=n,h={},p=0;for(let v=0;v<s.length;v++){const{name:g,fn:m}=s[v],{x:y,y:b,data:x,reset:w}=await m({x:c,y:f,initialPlacement:n,placement:d,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});c=y??c,f=b??f,h={...h,[g]:{...h[g],...x}},w&&p<=50&&(p++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:c,y:f}=zq(u,d,l)),v=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function Mv(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:o,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Cu(e,t),p=i5(h),g=s[d?f==="floating"?"reference":"floating":f],m=Ev(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(g)))==null||r?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y=f==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),x=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},w=Ev(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(m.top-w.top+p.top)/x.y,bottom:(w.bottom-m.bottom+p.bottom)/x.y,left:(m.left-w.left+p.left)/x.x,right:(w.right-m.right+p.right)/x.x}}const rGe=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=Cu(t,e)||{};if(u==null)return{};const f=i5(c),d={x:r,y:n},h=n5(i),p=r5(h),v=await o.getDimensions(u),g=h==="y",m=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=a.reference[p]+a.reference[h]-d[h]-a.floating[p],w=d[h]-a.reference[h],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=_?_[b]:0;(!C||!await(o.isElement==null?void 0:o.isElement(_)))&&(C=s.floating[b]||a.floating[p]);const D=x/2-w/2,O=C/2-v[p]/2-1,I=vl(f[m],O),L=vl(f[y],O),V=I,H=C-v[p]-L,Y=C/2-v[p]/2+D,te=zI(V,Y,H),Q=!l.arrow&&ss(i)!=null&&Y!==te&&a.reference[p]/2-(Y<V?I:L)-v[p]/2<0,ue=Q?Y<V?Y-V:Y-H:0;return{[h]:d[h]+ue,data:{[h]:te,centerOffset:Y-te-ue,...Q&&{alignmentOffset:ue}},reset:Q}}});function nGe(t,e,r){return(t?[...r.filter(i=>ss(i)===t),...r.filter(i=>ss(i)!==t)]:r.filter(i=>Fo(i)===i)).filter(i=>t?ss(i)===t||(e?c_(i)!==i:!1):!0)}const iGe=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,n,i;const{rects:a,middlewareData:o,placement:s,platform:l,elements:u}=e,{crossAxis:c=!1,alignment:f,allowedPlacements:d=Lq,autoAlignment:h=!0,...p}=Cu(t,e),v=f!==void 0||d===Lq?nGe(f||null,h,d):d,g=await Mv(e,p),m=((r=o.autoPlacement)==null?void 0:r.index)||0,y=v[m];if(y==null)return{};const b=Joe(y,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==y)return{reset:{placement:v[0]}};const x=[g[Fo(y)],g[b[0]],g[b[1]]],w=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:y,overflows:x}],_=v[m+1];if(_)return{data:{index:m+1,overflows:w},reset:{placement:_}};const C=w.map(I=>{const L=ss(I.placement);return[I.placement,L&&c?I.overflows.slice(0,2).reduce((V,H)=>V+H,0):I.overflows[0],I.overflows]}).sort((I,L)=>I[1]-L[1]),O=((i=C.filter(I=>I[2].slice(0,ss(I[0])?2:3).every(L=>L<=0))[0])==null?void 0:i[0])||C[0][0];return O!==s?{data:{index:m+1,overflows:w},reset:{placement:O}}:{}}}},aGe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=Cu(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const m=Fo(i),y=Ys(s),b=Fo(s)===s,x=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=d||(b||!v?[f_(s)]:Yje(s)),_=p!=="none";!d&&_&&w.push(...Qje(s,v,p,x));const C=[s,...w],D=await Mv(e,g),O=[];let I=((n=a.flip)==null?void 0:n.overflows)||[];if(c&&O.push(D[m]),f){const Y=Joe(i,o,x);O.push(D[Y[0]],D[Y[1]])}if(I=[...I,{placement:i,overflows:O}],!O.every(Y=>Y<=0)){var L,V;const Y=(((L=a.flip)==null?void 0:L.index)||0)+1,te=C[Y];if(te&&(!(f==="alignment"?y!==Ys(te):!1)||I.every(ie=>Ys(ie.placement)===y?ie.overflows[0]>0:!0)))return{data:{index:Y,overflows:I},reset:{placement:te}};let Q=(V=I.filter(ue=>ue.overflows[0]<=0).sort((ue,ie)=>ue.overflows[1]-ie.overflows[1])[0])==null?void 0:V.placement;if(!Q)switch(h){case"bestFit":{var H;const ue=(H=I.filter(ie=>{if(_){const Se=Ys(ie.placement);return Se===y||Se==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(Se=>Se>0).reduce((Se,me)=>Se+me,0)]).sort((ie,Se)=>ie[1]-Se[1])[0])==null?void 0:H[0];ue&&(Q=ue);break}case"initialPlacement":Q=s;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};function Fq(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Vq(t){return Xoe.some(e=>t[e]>=0)}const oGe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=Cu(t,e);switch(n){case"referenceHidden":{const a=await Mv(e,{...i,elementContext:"reference"}),o=Fq(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Vq(o)}}}case"escaped":{const a=await Mv(e,{...i,altBoundary:!0}),o=Fq(a,r.floating);return{data:{escapedOffsets:o,escaped:Vq(o)}}}default:return{}}}}};function Qoe(t){const e=vl(...t.map(a=>a.left)),r=vl(...t.map(a=>a.top)),n=ha(...t.map(a=>a.right)),i=ha(...t.map(a=>a.bottom));return{x:e,y:r,width:n-e,height:i-r}}function sGe(t){const e=t.slice().sort((i,a)=>i.y-a.y),r=[];let n=null;for(let i=0;i<e.length;i++){const a=e[i];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(i=>Ev(Qoe(i)))}const lGe=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:r,elements:n,rects:i,platform:a,strategy:o}=e,{padding:s=2,x:l,y:u}=Cu(t,e),c=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(n.reference))||[]),f=sGe(c),d=Ev(Qoe(c)),h=i5(s);function p(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&u!=null)return f.find(g=>l>g.left-h.left&&l<g.right+h.right&&u>g.top-h.top&&u<g.bottom+h.bottom)||d;if(f.length>=2){if(Ys(r)==="y"){const I=f[0],L=f[f.length-1],V=Fo(r)==="top",H=I.top,Y=L.bottom,te=V?I.left:L.left,Q=V?I.right:L.right,ue=Q-te,ie=Y-H;return{top:H,bottom:Y,left:te,right:Q,width:ue,height:ie,x:te,y:H}}const g=Fo(r)==="left",m=ha(...f.map(I=>I.right)),y=vl(...f.map(I=>I.left)),b=f.filter(I=>g?I.left===y:I.right===m),x=b[0].top,w=b[b.length-1].bottom,_=y,C=m,D=C-_,O=w-x;return{top:x,bottom:w,left:_,right:C,width:D,height:O,x:_,y:x}}return d}const v=await a.getElementRects({reference:{getBoundingClientRect:p},floating:n.floating,strategy:o});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},uGe=new Set(["left","top"]);async function cGe(t,e){const{placement:r,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Fo(r),s=ss(r),l=Ys(r)==="y",u=uGe.has(o)?-1:1,c=a&&l?-1:1,f=Cu(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),l?{x:h*c,y:d*u}:{x:d*u,y:h*c}}const fGe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:a,placement:o,middlewareData:s}=e,l=await cGe(e,t);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},dGe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:g=>{let{x:m,y}=g;return{x:m,y}}},...l}=Cu(t,e),u={x:r,y:n},c=await Mv(e,l),f=Ys(Fo(i)),d=Zoe(f);let h=u[d],p=u[f];if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",y=h+c[g],b=h-c[m];h=zI(y,h,b)}if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",y=p+c[g],b=p-c[m];p=zI(y,p,b)}const v=s.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[d]:a,[f]:o}}}}}},hGe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:a,platform:o,elements:s}=e,{apply:l=()=>{},...u}=Cu(t,e),c=await Mv(e,u),f=Fo(i),d=ss(i),h=Ys(i)==="y",{width:p,height:v}=a.floating;let g,m;f==="top"||f==="bottom"?(g=f,m=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=f,g=d==="end"?"top":"bottom");const y=v-c.top-c.bottom,b=p-c.left-c.right,x=vl(v-c[g],y),w=vl(p-c[m],b),_=!e.middlewareData.shift;let C=x,D=w;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(D=b),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(C=y),_&&!d){const I=ha(c.left,0),L=ha(c.right,0),V=ha(c.top,0),H=ha(c.bottom,0);h?D=p-2*(I!==0||L!==0?I+L:ha(c.left,c.right)):C=v-2*(V!==0||H!==0?V+H:ha(c.top,c.bottom))}await l({...e,availableWidth:D,availableHeight:C});const O=await o.getDimensions(s.floating);return p!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function z2(){return typeof window<"u"}function ig(t){return ese(t)?(t.nodeName||"").toLowerCase():"#document"}function Qa(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Eu(t){var e;return(e=(ese(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ese(t){return z2()?t instanceof Node||t instanceof Qa(t).Node:!1}function ds(t){return z2()?t instanceof Element||t instanceof Qa(t).Element:!1}function gl(t){return z2()?t instanceof HTMLElement||t instanceof Qa(t).HTMLElement:!1}function Hq(t){return!z2()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qa(t).ShadowRoot}const pGe=new Set(["inline","contents"]);function W0(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=hs(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!pGe.has(i)}const vGe=new Set(["table","td","th"]);function gGe(t){return vGe.has(ig(t))}const mGe=[":popover-open",":modal"];function F2(t){return mGe.some(e=>{try{return t.matches(e)}catch{return!1}})}const yGe=["transform","translate","scale","rotate","perspective"],bGe=["transform","translate","scale","rotate","perspective","filter"],xGe=["paint","layout","strict","content"];function a5(t){const e=o5(),r=ds(t)?hs(t):t;return yGe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||bGe.some(n=>(r.willChange||"").includes(n))||xGe.some(n=>(r.contain||"").includes(n))}function wGe(t){let e=$c(t);for(;gl(e)&&!Av(e);){if(a5(e))return e;if(F2(e))return null;e=$c(e)}return null}function o5(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SGe=new Set(["html","body","#document"]);function Av(t){return SGe.has(ig(t))}function hs(t){return Qa(t).getComputedStyle(t)}function V2(t){return ds(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $c(t){if(ig(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Hq(t)&&t.host||Eu(t);return Hq(e)?e.host:e}function tse(t){const e=$c(t);return Av(e)?t.ownerDocument?t.ownerDocument.body:t.body:gl(e)&&W0(e)?e:tse(e)}function rse(t,e,r){var n;e===void 0&&(e=[]);const i=tse(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),o=Qa(i);return a?(FI(o),e.concat(o,o.visualViewport||[],W0(i)?i:[],[])):e.concat(i,rse(i,[]))}function FI(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function nse(t){const e=hs(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=gl(t),a=i?t.offsetWidth:r,o=i?t.offsetHeight:n,s=u_(r)!==a||u_(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function ise(t){return ds(t)?t:t.contextElement}function Zp(t){const e=ise(t);if(!gl(e))return rl(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:a}=nse(e);let o=(a?u_(r.width):r.width)/n,s=(a?u_(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const _Ge=rl(0);function ase(t){const e=Qa(t);return!o5()||!e.visualViewport?_Ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function TGe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Qa(t)?!1:e}function p0(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),a=ise(t);let o=rl(1);e&&(n?ds(n)&&(o=Zp(n)):o=Zp(t));const s=TGe(a,r,n)?ase(a):rl(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(a){const d=Qa(a),h=n&&ds(n)?Qa(n):n;let p=d,v=FI(p);for(;v&&n&&h!==p;){const g=Zp(v),m=v.getBoundingClientRect(),y=hs(v),b=m.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,x=m.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,f*=g.y,l+=b,u+=x,p=Qa(v),v=FI(p)}}return Ev({width:c,height:f,x:l,y:u})}function H2(t,e){const r=V2(t).scrollLeft;return e?e.left+r:p0(Eu(t)).left+r}function ose(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-H2(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function CGe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const a=i==="fixed",o=Eu(n),s=e?F2(e.floating):!1;if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=rl(1);const c=rl(0),f=gl(n);if((f||!f&&!a)&&((ig(n)!=="body"||W0(o))&&(l=V2(n)),gl(n))){const h=p0(n);u=Zp(n),c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}const d=o&&!f&&!a?ose(o,l):rl(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:r.y*u.y-l.scrollTop*u.y+c.y+d.y}}function EGe(t){return Array.from(t.getClientRects())}function MGe(t){const e=Eu(t),r=V2(t),n=t.ownerDocument.body,i=ha(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=ha(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+H2(t);const s=-r.scrollTop;return hs(n).direction==="rtl"&&(o+=ha(e.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:s}}const $q=25;function AGe(t,e){const r=Qa(t),n=Eu(t),i=r.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const c=o5();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const u=H2(n);if(u<=0){const c=n.ownerDocument,f=c.body,d=getComputedStyle(f),h=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(n.clientWidth-f.clientWidth-h);p<=$q&&(a-=p)}else u<=$q&&(a+=u);return{width:a,height:o,x:s,y:l}}const kGe=new Set(["absolute","fixed"]);function NGe(t,e){const r=p0(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,a=gl(t)?Zp(t):rl(1),o=t.clientWidth*a.x,s=t.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:o,height:s,x:l,y:u}}function Uq(t,e,r){let n;if(e==="viewport")n=AGe(t,r);else if(e==="document")n=MGe(Eu(t));else if(ds(e))n=NGe(e,r);else{const i=ase(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ev(n)}function sse(t,e){const r=$c(t);return r===e||!ds(r)||Av(r)?!1:hs(r).position==="fixed"||sse(r,e)}function DGe(t,e){const r=e.get(t);if(r)return r;let n=rse(t,[]).filter(s=>ds(s)&&ig(s)!=="body"),i=null;const a=hs(t).position==="fixed";let o=a?$c(t):t;for(;ds(o)&&!Av(o);){const s=hs(o),l=a5(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&kGe.has(i.position)||W0(o)&&!l&&sse(t,o))?n=n.filter(c=>c!==o):i=s,o=$c(o)}return e.set(t,n),n}function OGe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?F2(e)?[]:DGe(e,this._c):[].concat(r),n],s=o[0],l=o.reduce((u,c)=>{const f=Uq(e,c,i);return u.top=ha(f.top,u.top),u.right=vl(f.right,u.right),u.bottom=vl(f.bottom,u.bottom),u.left=ha(f.left,u.left),u},Uq(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function RGe(t){const{width:e,height:r}=nse(t);return{width:e,height:r}}function IGe(t,e,r){const n=gl(e),i=Eu(e),a=r==="fixed",o=p0(t,!0,a,e);let s={scrollLeft:0,scrollTop:0};const l=rl(0);function u(){l.x=H2(i)}if(n||!n&&!a)if((ig(e)!=="body"||W0(i))&&(s=V2(e)),n){const h=p0(e,!0,a,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&u();a&&!n&&i&&u();const c=i&&!n&&!a?ose(i,s):rl(0),f=o.left+s.scrollLeft-l.x-c.x,d=o.top+s.scrollTop-l.y-c.y;return{x:f,y:d,width:o.width,height:o.height}}function hD(t){return hs(t).position==="static"}function jq(t,e){if(!gl(t)||hs(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Eu(t)===r&&(r=r.ownerDocument.body),r}function lse(t,e){const r=Qa(t);if(F2(t))return r;if(!gl(t)){let i=$c(t);for(;i&&!Av(i);){if(ds(i)&&!hD(i))return i;i=$c(i)}return r}let n=jq(t,e);for(;n&&gGe(n)&&hD(n);)n=jq(n,e);return n&&Av(n)&&hD(n)&&!a5(n)?r:n||wGe(t)||r}const LGe=async function(t){const e=this.getOffsetParent||lse,r=this.getDimensions,n=await r(t.floating);return{reference:IGe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function PGe(t){return hs(t).direction==="rtl"}const BGe={convertOffsetParentRelativeRectToViewportRelativeRect:CGe,getDocumentElement:Eu,getClippingRect:OGe,getOffsetParent:lse,getElementRects:LGe,getClientRects:EGe,getDimensions:RGe,getScale:Zp,isElement:ds,isRTL:PGe},use=fGe,cse=iGe,fse=dGe,dse=aGe,hse=hGe,pse=oGe,vse=rGe,gse=lGe,mse=(t,e,r)=>{const n=new Map,i={platform:BGe,...r},a={...i.platform,_c:n};return tGe(t,e,{...i,platform:a})};function zGe(t,e){const r=Math.min(t.top,e.top),n=Math.max(t.bottom,e.bottom),i=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-i,s=n-r,l=i,u=r;return new DOMRect(l,u,o,s)}var FGe=class{constructor({editor:t,element:e,view:r,updateDelay:n=250,resizeDelay:i=60,shouldShow:a,appendTo:o,getReferencedVirtualElement:s,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:c,state:f,from:d,to:h})=>{const{doc:p,selection:v}=f,{empty:g}=v,m=!p.textBetween(d,h).length&&xL(f.selection),y=this.element.contains(document.activeElement);return!(!(c.hasFocus()||y)||g||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:c})=>{var f;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}c?.relatedTarget&&((f=this.element.parentNode)!=null&&f.contains(c.relatedTarget))||c?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(c,f)=>{const d=!f?.selection.eq(c.state.selection),h=!f?.doc.eq(c.state.doc);!d&&!h||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(c,d,h,f)},this.updateDelay))},this.updateHandler=(c,f,d,h)=>{const{composing:p}=c;if(p||!f&&!d)return;if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:c})=>{c.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var u;this.editor=t,this.element=e,this.view=r,this.updateDelay=n,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(u=l?.scrollTarget)!=null?u:window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(dse(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(fse(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(use(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(vse(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(hse(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(cse(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(pse(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(gse(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t;const{selection:e}=this.editor.state,r=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(r)return r;const n=sX(this.view,e.from,e.to);let i={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof ar){let a=this.view.nodeDOM(e.from);const o=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");o&&(a=o),a&&(i={getBoundingClientRect:()=>a.getBoundingClientRect(),getClientRects:()=>[a.getBoundingClientRect()]})}if(e instanceof Cn){const{$anchorCell:a,$headCell:o}=e,s=a?a.pos:o.pos,l=o?o.pos:a.pos,u=this.view.nodeDOM(s),c=this.view.nodeDOM(l);if(!u||!c)return;const f=u===c?u.getBoundingClientRect():zGe(u.getBoundingClientRect(),c.getBoundingClientRect());i={getBoundingClientRect:()=>f,getClientRects:()=>[f]}}return i}updatePosition(){const t=this.virtualElement;t&&mse(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:r,strategy:n})=>{this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${r}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const{state:r}=t,n=r.selection.from!==r.selection.to;if(this.updateDelay>0&&n){this.handleDebouncedUpdate(t,e);return}const i=!e?.selection.eq(t.state.selection),a=!e?.doc.eq(t.state.doc);this.updateHandler(t,i,a,e)}getShouldShow(t){var e;const{state:r}=this.view,{selection:n}=r,{ranges:i}=n,a=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:r,oldState:t,from:a,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},yse=t=>new en({key:typeof t.pluginKey=="string"?new on(t.pluginKey):t.pluginKey,view:e=>new FGe({view:e,...t})});Vr.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[yse({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var VGe=class{constructor({editor:t,element:e,view:r,options:n,appendTo:i,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:o,state:s})=>{const{selection:l}=s,{$anchor:u,empty:c}=l,f=u.depth===1,d=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!o.hasFocus()||!c||!f||!d||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(o,s,l,u)=>{const{composing:c}=o;if(c||!s&&!l)return;if(!this.getShouldShow(u)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var s;if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&((s=this.element.parentNode)!=null&&s.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=t,this.element=e,this.view=r,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return tX(t,{textSerializers:_L(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(dse(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(fse(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(use(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(vse(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(hse(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(cse(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(pse(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(gse(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:r}=this.view,{selection:n}=r,{ranges:i}=n,a=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:r,oldState:t,from:a,to:o})}updatePosition(){const{selection:t}=this.editor.state,e=sX(this.view,t.from,t.to);mse({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:i,strategy:a})=>{this.element.style.width="max-content",this.element.style.position=a,this.element.style.left=`${n}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const r=!e?.selection.eq(t.state.selection),n=!e?.doc.eq(t.state.doc);this.updateHandler(t,r,n,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},bse=t=>new en({key:typeof t.pluginKey=="string"?new on(t.pluginKey):t.pluginKey,view:e=>new VGe({view:e,...t})});Vr.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[bse({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var HGe=j.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:r,resizeDelay:n,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:l,...u},c)=>{const f=j.useRef(document.createElement("div"));typeof c=="function"?c(f.current):c&&(c.current=f.current);const{editor:d}=AX(),h=e||d,p={updateDelay:r,resizeDelay:n,appendTo:i,pluginKey:t,shouldShow:a,getReferencedVirtualElement:o,options:s},v=j.useRef(p);return v.current=p,j.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const g=f.current;g.style.visibility="hidden",g.style.position="absolute";const m=yse({...v.current,editor:h,element:g});h.registerPlugin(m);const y=v.current.pluginKey;return()=>{h.unregisterPlugin(y),window.requestAnimationFrame(()=>{g.parentNode&&g.parentNode.removeChild(g)})}},[h]),kv.createPortal(F.jsx("div",{...u,children:l}),f.current)});j.forwardRef(({pluginKey:t="floatingMenu",editor:e,appendTo:r,shouldShow:n=null,options:i,children:a,...o},s)=>{const l=j.useRef(document.createElement("div"));typeof s=="function"?s(l.current):s&&(s.current=l.current);const{editor:u}=AX();return j.useEffect(()=>{const c=l.current;if(c.style.visibility="hidden",c.style.position="absolute",e?.isDestroyed||u?.isDestroyed)return;const f=e||u;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=bse({editor:f,element:c,pluginKey:t,appendTo:r,shouldShow:n,options:i});return f.registerPlugin(d),()=>{f.unregisterPlugin(t),window.requestAnimationFrame(()=>{c.parentNode&&c.parentNode.removeChild(c)})}},[e,u,r,t,n,i]),kv.createPortal(F.jsx("div",{...o,children:a}),l.current)});function $Ge(){const{editor:t}=Ot(),[e,r]=j.useReducer(o=>o+1,0);j.useEffect(()=>{if(!t)return;const o=()=>r();return t.on("selectionUpdate",o),t.on("transaction",o),()=>{t.off("selectionUpdate",o),t.off("transaction",o)}},[t]);const n=j.useMemo(()=>{const o=t?au(t):null;return o?.type?.name?t?.getAttributes(o.type.name)?.flipY:!1},[t,e]),i=j.useMemo(()=>{const o=t?au(t):null;return o?.type?.name?t?.getAttributes(o.type.name)?.flipX:!1},[t,e]),a=o=>{const s=t?au(t):null,{flipX:l,flipY:u}=s?.attrs??{};s&&o==="flipX"&&t?.commands.updateAttributes(s.type,{flipX:!l}),s&&o==="flipY"&&t?.commands.updateAttributes(s.type,{flipY:!u})};return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"flip-x",text:"水平翻转",hideText:!0,menuActive:n,onMenuClick:()=>a("flipY")}),F.jsx(Ar,{ico:"flip-y",text:"垂直翻转",hideText:!0,menuActive:i,onMenuClick:()=>a("flipX")})]})}function xse(){const{editor:t}=Ot(),e=()=>{const r=t?au(t):null;r?.attrs.src&&window.open(r.attrs.src)};return F.jsx(Ar,{ico:"open",text:"新窗口打开",shortcut:"Backspace",hideText:!0,onMenuClick:e})}function UGe(){const{editor:t}=Ot(),e=j.useMemo(()=>(t?au(t):null)?.type?.name==="inlineImage"?"转为节点图片":"转为行内图片",[t?.state.selection]),[r,n]=j.useReducer(a=>a+1,0);j.useEffect(()=>{if(!t)return;const a=()=>n();return t.on("selectionUpdate",a),t.on("transaction",a),()=>{t.off("selectionUpdate",a),t.off("transaction",a)}},[t]);const i=()=>{const a=t?au(t):null;if(a){const o=a?.type?.name==="inlineImage"?"inlineImage":"image",s=a.attrs??{};!s.error&&s.src&&(t?.chain().focus().deleteSelectionNode().run(),o==="inlineImage"?t?.chain().focus().setImage({...s,equalProportion:!1,inline:!1}).run():t?.chain().focus().setInlineImage({...s,inline:!0,equalProportion:!1}).run())}};return F.jsx(Ar,{ico:"huantu",text:e,hideText:!0,onMenuClick:i})}function dh(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"remove",text:"删除",shortcut:"Backspace",hideText:!0,onMenuClick:()=>t?.chain().focus().deleteSelectionNode().run()})}function jGe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx($Ge,{}),F.jsx(UGe,{}),F.jsx(xse,{}),F.jsx(dh,{})]})}function GGe(){const{editor:t}=Ot(),e=()=>{const r=t?au(t):null;if(!r)return;const n=document.createElement("a");n.href=r.attrs.url,n.download=r.attrs.name,document.body.appendChild(n),n.click(),document.body.removeChild(n)};return t?.getAttributes("file")?.uploaded?F.jsx(Ar,{ico:"down",text:"下载",hideText:!0,onMenuClick:e}):null}function WGe(){const{editor:t}=Ot();return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),(t?.isActive("file")||t?.isActive("video")||t?.isActive("audio"))&&F.jsx(GGe,{}),F.jsx(dh,{})]})}function qGe({defaultColor:t="#007bff"}){const{editor:e}=Ot(),[r,n]=j.useState(!1),[i,a]=j.useState(t),o=l=>{a(l),n(!1);const u=l===""?null:l;e?.chain().focus().setCellAttribute("background",u).run()},s=g0(l=>{a(l);const u=l===""?null:l;e?.chain().focus().setCellAttribute("background",u).run()},200);return F.jsx(xl,{ico:"fill",text:"填充背景",hideText:!0,popupVisible:r,disabled:!e?.can().setCellAttribute("background",""),popupType:"arrow",onMenuClick:()=>o(i),onPopupVisibleChange:n,content:F.jsx("div",{className:"p-2",children:F.jsx("input",{type:"color",value:i,onChange:l=>s(l.target.value),className:"w-full h-8 cursor-pointer",style:{width:"100%",height:"32px",cursor:"pointer",border:"none",background:"transparent"}})}),children:F.jsx("div",{className:"w-[14px] h-[2px] mx-auto",style:{backgroundColor:i}})})}function KGe({hideText:t=!0}){const{editor:e}=Ot();return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"charutop",text:"上方插入一行",hideText:t,disabled:!e?.can().addRowBefore(),onMenuClick:()=>e?.chain().focus().addRowBefore().run()}),F.jsx(Ar,{ico:"charubottom",text:"下方插入一行",hideText:t,disabled:!e?.can().addRowAfter(),onMenuClick:()=>e?.chain().focus().addRowAfter().run()}),F.jsx(Ar,{ico:"charuleft",text:"左方插入一列",hideText:t,disabled:!e?.can().addColumnBefore(),onMenuClick:()=>e?.chain().focus().addColumnBefore().run()}),F.jsx(Ar,{ico:"charuright",text:"右方插入一列",hideText:t,disabled:!e?.can().addColumnAfter(),onMenuClick:()=>e?.chain().focus().addColumnAfter().run()})]})}function YGe({hideText:t=!0}){const{editor:e}=Ot();return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"removehang",text:"删除行",hideText:t,disabled:!e?.can().deleteColumn(),onMenuClick:()=>e?.chain().focus().deleteRow().run()}),F.jsx(Ar,{ico:"removelie",text:"删除列",hideText:t,disabled:!e?.can().deleteColumn(),onMenuClick:()=>e?.chain().focus().deleteColumn().run()})]})}function XGe({hideText:t=!0}){const{editor:e}=Ot();return F.jsxs(F.Fragment,{children:[F.jsx(Ar,{ico:"merge-cell",text:"合并单元格",hideText:t,disabled:!e?.can().mergeCells(),onMenuClick:()=>e?.chain().focus().mergeCells().run()}),F.jsx(Ar,{ico:"split-cell",text:"拆分单元格",hideText:t,disabled:!e?.can().splitCell(),onMenuClick:()=>e?.chain().focus().splitCell().run()})]})}function ZGe(){const{editor:t}=Ot();return F.jsx(Ar,{ico:"remove",text:"删除表格",shortcut:"Backspace",hideText:!0,disabled:!t?.can().deleteTable(),onMenuClick:()=>t?.chain().focus().deleteTable().run()})}function JGe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(qGe,{}),F.jsx(KGe,{}),F.jsx(YGe,{}),F.jsx(XGe,{}),F.jsx(ZGe,{})]})}function QGe(){const{editor:t}=Ot(),[e,r]=j.useState(""),n=()=>{if(e==="")return;t?.state?.selection?.$from?.node()&&t?.commands.updateAttributes("tag",{text:e})},i=()=>{const a=t?.getAttributes("tag");a?.text&&r(a.text)};return j.useEffect(()=>{if(t)return i(),t.on("selectionUpdate",i),()=>{t.off("selectionUpdate",i)}},[t]),F.jsxs(F.Fragment,{children:[F.jsx(jd,{placeholder:"请输入标签",value:e,onChange:a=>r(a),size:"small"}),F.jsx(ts,{type:"primary",size:"small",onClick:n,children:"确认"})]})}function eWe(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=[{label:"蓝色",color:"#007bff",bgcolor:"rgb(217, 231, 255)"},{label:"红色",color:"rgba(200, 78, 67, 1)",bgcolor:"rgb(252, 223, 220)"},{label:"黄色",color:"rgba(240, 196, 23, 1)",bgcolor:"rgb(255, 245, 210)"},{label:"绿色",color:"rgba(5, 205, 153, 1)",bgcolor:"rgb(205, 245, 235)"},{label:"紫色",color:"#e6afff",bgcolor:"rgb(220, 223, 252)"}],i=o=>{t?.state?.selection?.$from?.node()&&t?.commands.updateAttributes("tag",{type:o.type,color:o.color,backgroundColor:o.bgcolor}),r(!1)},a=()=>{t?.state?.selection?.$from?.node()&&t?.commands.updateAttributes("tag",{type:"default",color:"#999",backgroundColor:"rgba(0, 0, 0, 0.05)"}),r(!1)};return F.jsx(B2,{ico:"fill",text:"高亮填充",hideText:!0,onMenuClick:()=>i(),maxHeight:!1,popupVisible:e,onPopupVisibleChange:r,content:F.jsxs("div",{className:"px-2",children:[n.map((o,s)=>F.jsxs("div",{onClick:()=>i(o),style:{backgroundColor:o.bgcolor},className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer",children:[F.jsx("i",{className:"w-iconfont icon-tumo !text-[14px]"}),o.label]},s)),F.jsxs("div",{className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:a,children:[F.jsx("i",{className:"w-iconfont icon-clear-format !text-[14px]"}),"清除"]})]})})}function tWe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(QGe,{}),F.jsx(eWe,{}),F.jsx(dh,{})]})}function rWe(){const{editor:t,setAssistant:e}=Ot(),r=()=>{e(!0),t?.commands.focus()};return F.jsx(Ar,{ico:"ai-assistant",text:"AI智能助手",hideText:!0,onMenuClick:r})}function nWe(){const{editor:t}=Ot(),[e,r]=j.useState(!1),n=[{label:"默认",bgcolor:"#007bff"},{label:"红色",bgcolor:"#ff8a8a"},{label:"黄色",bgcolor:"#ffff8a"},{label:"绿色",bgcolor:"#a7ffa7"},{label:"紫色",bgcolor:"#e6afff"},{label:"蓝色",bgcolor:"#83d3ff"}],i=o=>{if(!o){t?.chain().focus().setHighlight({color:n[0].bgcolor}).run();return}t?.chain().focus().setHighlight({color:o.bgcolor}).run(),r(!1)},a=()=>{t?.chain().focus().unsetHighlight().run(),r(!1)};return F.jsx(B2,{ico:"fill",text:"高亮填充",hideText:!0,onMenuClick:()=>i(),maxHeight:!1,popupVisible:e,onPopupVisibleChange:r,content:F.jsxs("div",{className:"px-2",children:[n.map((o,s)=>F.jsxs("div",{onClick:()=>i(o),style:{backgroundColor:o.bgcolor},className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer",children:[F.jsx("i",{className:"w-iconfont icon-tumo !text-[14px]"}),o.label]},s)),F.jsxs("div",{className:"h-[30px] w-[90px] flex items-center justify-center gap-2 mb-2 rounded-[3px] cursor-pointer border",onClick:a,children:[F.jsx("i",{className:"w-iconfont icon-clear-format !text-[14px]"}),"清除"]})]})})}function iWe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(rWe,{}),F.jsx(DI,{}),F.jsx(OI,{}),F.jsx(RI,{}),F.jsx(II,{}),F.jsx(Koe,{}),F.jsx(nWe,{}),F.jsx(dh,{})]})}function aWe(){const{editor:t}=Ot(),[e,r]=j.useState(""),[n,i]=j.useState(""),a=s=>{i(s)},o=()=>{const s=cq.find(c=>c.value===n),{validate:l,transformURL:u}=s||{};l&&!l(e)||t?.chain().focus().setParagraph().setIframe({type:n,src:u?u(e):e}).run()};return F.jsx("div",{className:"flex items-center gap-2",children:t?.getAttributes("iframe").src===""?F.jsxs("div",{className:"flex items-center gap-2 py-2 px-1",children:[F.jsxs("div",{className:"flex flex-col items-center gap-1 h-[80px]",children:[F.jsx("span",{className:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{lineHeight:"24px"},children:"1"}),F.jsx("div",{className:"w-[1px] flex-1 bg-[#e5e5e5]"}),F.jsx("span",{className:"w-[24px] h-[24px] text-center rounded-full bg-[#007bff] text-[12px] text-[#fff] font-500",style:{lineHeight:"24px"},children:"2"})]}),F.jsxs("div",{className:"flex-1 h-[90px] flex flex-col justify-between gap-1",children:[F.jsx("div",{className:"mb-2",children:F.jsx(ay,{value:n,placeholder:"选择网页类型",options:cq,className:"w-full",onChange:a,renderOption:s=>F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx("span",{dangerouslySetInnerHTML:{__html:s.icon}}),s.label]})})}),F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(jd,{value:e,onChange:s=>r(s.target?s.target.value:s),placeholder:"打开网址复制链接,以http:// 或 https:// 开头",className:"w-[300px]"}),F.jsx(ts,{type:"primary",size:"small",disabled:!e,onClick:o,children:"添加"})]})]})]}):F.jsxs(F.Fragment,{children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(xse,{}),F.jsx(dh,{})]})})}function oWe(){return F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(ng,{}),F.jsx(tg,{}),F.jsx(rg,{}),F.jsx(BI,{icon:"setting",text:"图表配置",isEdit:!0}),F.jsx(dh,{})]})}const sWe="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='14'%20cy='14'%20r='11.0833'%20fill='%23258AFF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.8581%2011.2155C11.9065%2011.1088%2012.058%2011.1088%2012.1064%2011.2155L14.6199%2016.7534C14.6609%2016.8437%2014.5948%2016.9461%2014.4957%2016.9461H11.6756C11.461%2016.9461%2011.2663%2017.072%2011.1782%2017.2677L10.7355%2018.2514C10.6273%2018.492%2010.8033%2018.7642%2011.0671%2018.7642H16.0477C16.7417%2018.7642%2017.2037%2018.0471%2016.9169%2017.4152L12.8512%208.45725C12.5122%207.71045%2011.4515%207.71057%2011.1127%208.45743L6.67056%2018.2504C6.56136%2018.4911%206.73737%2018.7642%207.00171%2018.7642H8.08241C8.29645%2018.7642%208.49072%2018.639%208.57914%2018.4441L11.8581%2011.2155ZM19.373%2018.4441C19.4614%2018.639%2019.6557%2018.7642%2019.8698%2018.7642H20.9504C21.2147%2018.7642%2021.3907%2018.4911%2021.2816%2018.2504L16.7334%208.22172C16.645%208.02677%2016.4508%207.90156%2016.2367%207.90156L15.156%207.90156C14.8917%207.90156%2014.7157%208.17464%2014.8249%208.41537L19.373%2018.4441Z'%20fill='white'/%3e%3c/svg%3e";function lWe(){const{editor:t,options:e,setAssistant:r}=Ot(),[n,i]=j.useState(""),[a,o]=j.useState({prompt:"",content:"",error:!1,command:""}),[s,l]=j.useState(!1),[u]=j.useState(600),c=j.useRef(null),f=()=>{r(!1),t?.commands.focus()},d=async()=>{if(a.content)try{await navigator.clipboard.writeText(a.content)}catch(b){console.error("Failed to copy: ",b)}},h=()=>{a.command&&(i(a.command),v(a.command))},p=()=>{i(""),o(b=>({...b,prompt:"",content:""}))},v=async b=>{const x=b??n;if(!x)return;l(!0),o(C=>({...C,error:!1,prompt:"",content:""}));const w={lang:"",input:t?Z7e(t):"",command:x},_={html:t?.getHTML()??"",text:t?.getText()??"",json:t?.getJSON()??{}};try{const C=await e.ai?.sendMessage?.(w,_),D=O=>{o(I=>{let L=I.content+O,V=I.error;return L.startsWith("[ERROR]: ")&&(V=!0,L=L.replace("[ERROR]: ","")),{...I,content:L,error:V}})};if(C instanceof ReadableStream){const O=new WritableStream({write(I){D(I)},close(){l(!1),o(I=>({...I,command:x}))}});await C.pipeTo(O)}else Mse(C)?(l(!1),o(O=>{let I=C,L=!1;return I.startsWith("[ERROR]: ")&&(L=!0,I=I.replace("[ERROR]: ","")),{...O,content:I,error:L,command:x}})):(console.error('"ai.assistant.onMessage" method returns data in an incorrect format, it can be a ReadableStream or plain text.'),l(!1))}catch(C){console.error(C),r(!1),l(!1)}},g=()=>{t?.chain().insertContent(a.content).run(),f()},m=()=>{const{to:b}=t?.state.selection??{};b&&t?.chain().insertContentAt(b,a.content).focus().run(),f()},y=()=>{t?.commands.selectParentNode();const{to:b}=t?.state.selection??{};b&&t?.chain().insertContentAt(b,a.content).focus().run(),f()};return F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative flex items-center gap-4 h-[50px] border-b px-3 white-ai-wrapper",style:{width:`${u}px`},children:[F.jsx("div",{className:"flex-shrink-0",children:F.jsx("img",{src:sWe,alt:"ai",className:"w-8 h-8"})}),F.jsx("input",{ref:c,value:n,onChange:b=>i(b.target.value),className:`flex-1 outline-none h-full ${s?"input-disabled":""}`,maxLength:e.ai?.maxlength,disabled:s,autoComplete:"false",placeholder:"告诉AI下一步怎么做",onKeyDown:b=>{b.key==="Enter"&&!s&&v()}}),F.jsx("button",{className:"ai-button",disabled:s,onClick:()=>v(),children:s?F.jsx("i",{className:"w-iconfont icon-loading animate-spin"}):F.jsx("i",{className:"w-iconfont icon-send"})})]}),a.content&&F.jsxs("div",{className:"w-full px-3 py-2",style:{width:`${u}px`},children:[F.jsx("div",{className:`w-full min-h-[50px] overflow-y-auto line-clamp-6 result-content ${a.error?"error":""}`,dangerouslySetInnerHTML:{__html:a.content}}),F.jsxs("div",{className:"flex items-center gap-2 text-handle",children:[F.jsx(ts,{type:"primary",size:"small",onClick:g,children:"替换所选"}),F.jsx(ts,{size:"small",onClick:y,children:"插入下方"}),F.jsx(ts,{size:"small",onClick:m,children:"插入后方"}),F.jsx(ts,{size:"small",onClick:p,children:"放弃"}),F.jsx("i",{className:"w-iconfont icon-copy-text cursor-pointer",title:"复制",onClick:d}),F.jsx("i",{className:"w-iconfont icon-refresh cursor-pointer",title:"重新生成",onClick:h})]})]})]})}function uWe(){const{editor:t,assistant:e,setAssistant:r}=Ot(),n=j.useMemo(()=>({placement:e?"bottom":"top",onHide(){r(!1)}}),[e,r]);return t?F.jsx(HGe,{className:`white-editor-bubble-menu rounded-md ${e?"":"px-3 py-2"}`,editor:t,pluginKey:"bubbleMenu",style:{maxWidth:600},options:n,ref:i=>{i&&(i.style.zIndex="200")},children:e?F.jsx(lWe,{}):F.jsx(F.Fragment,{children:t.isActive("toc")||t.isActive("pageBreak")||t.isActive("horizontalRule")||t.isActive("codeBlock")||t.getAttributes("image").error?F.jsx(dh,{}):t.isActive("image")&&!t.getAttributes("image").error||t.isActive("inlineImage")&&!t.getAttributes("inlineImage").error?F.jsx(jGe,{}):t.isActive("video")||t.isActive("audio")||t.isActive("file")?F.jsx(WGe,{}):t.isActive("iframe")?F.jsx(aWe,{}):t.isActive("table")?F.jsx(JGe,{}):t.isActive("tag")?F.jsx(tWe,{}):t.isActive("echarts")?F.jsx(oWe,{}):F.jsx(iWe,{})})}):null}const cWe=()=>{const{editor:t,page:e}=Ot(),[r,n]=j.useReducer(s=>s+1,0);j.useEffect(()=>{if(!t)return;const s=()=>n();return t.on("transaction",s),t.on("selectionUpdate",s),t.on("update",s),()=>{t.off("transaction",s),t.off("selectionUpdate",s),t.off("update",s)}},[t]);const i=j.useMemo(()=>{const{width:s,height:l}=e.size??{width:0,height:0};return{width:s,height:l}},[e.size]),a=j.useMemo(()=>e.layout==="web"?"100%":`calc(${i.width}cm * 1)`,[e.layout,i.width]),o=j.useMemo(()=>{const s=["white-editor-content","flex-1","flex","flex-col"];return t&&(t.isEmpty&&t.state.doc.childCount<=1&&s.push("is-empty"),t.isEditable&&s.push("is-readonly"),t.view?.painter?.enabled&&s.push("format-painter")),s.join(" ")},[t,r,t?.isEmpty,t?.isEditable]);return F.jsxs("div",{className:`white-editor-container min-h-full mx-auto overflow-hidden relative flex flex-col ${e.layout==="page"?"shadow-[0_0_10px_rgba(0,0,0,0.1)] bg-white":""}`,style:{width:a},children:[e.layout==="page"&&F.jsx("div",{className:"w-full h-[4rem]"}),F.jsx(Fme,{editor:t,className:o}),e.layout==="page"&&F.jsx("div",{className:"w-full h-[4rem]"}),t&&F.jsx(uWe,{})]})},fWe=()=>{const{page:t,container:e,options:r,uploadFileMap:n,setEditor:i}=Ot(),a=cVe({container:e,options:r,uploadFileMap:n}),o=Gme({extensions:a,editable:!r?.editor?.readOnly,autofocus:r?.editor?.autofocus,content:Zme(r.document?.content),enableInputRules:NU(r),enablePasteRules:NU(r),editorProps:{attributes:{class:"white-editor"}},parseOptions:r?.editor?.parseOptions});return j.useEffect(()=>{o&&(o.storage.container=e,o.storage.options=r,i(o))},[o,e,r,i]),console.log(r,e),F.jsx("div",{className:"white-editor-namespace white-give-editor-wrapper",children:F.jsxs("div",{className:"flex flex-col w-full h-full",children:[r.layout?.toolbar?.show&&F.jsx("div",{className:"w-full flex-none border-b border-[#d9d9d9]",children:F.jsx(Ije,{})}),F.jsxs("div",{className:"w-full flex-1 min-h-0 flex overflow-hidden",id:e,children:[t.showToc&&r.layout.toc.show&&F.jsx(Gje,{}),F.jsx("div",{className:`flex-1 h-full overflow-y-auto py-[20px] ${t.layout==="page"?"bg-[#f4f6fa]":""}`,children:F.jsx(cWe,{})})]}),r.layout.foot.show&&F.jsx("div",{className:"w-full h-[40px] flex-none border-t border-[#d9d9d9] px-[2rem]",children:F.jsx(Uje,{})})]})})},dWe=t=>F.jsx(pK,{...t,children:F.jsx(fWe,{})});exports.EditorProvider=pK;exports.WhiteEditor=dWe;exports.useEditorContext=Ot;
|