@wangeditor-next/plugin-formula 1.0.20 → 1.0.21

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 - present wangEditor-team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -199,6 +199,7 @@ export interface IEditorConfig {
199
199
  MENU_CONF?: Partial<IMenuConfig>;
200
200
  hoverbarKeys?: IHoverbarConf;
201
201
  EXTEND_CONF?: any;
202
+ skipCacheTypes?: string[];
202
203
  }
203
204
  /**
204
205
  * toolbar config
@@ -2,6 +2,7 @@
2
2
  * @description editor interface
3
3
  * @author wangfupeng
4
4
  */
5
+ import { NodeEntryWithContext } from '@wangeditor-next/table-module/src/utils';
5
6
  import ee from 'event-emitter';
6
7
  import { Ancestor, Editor, Element, Location, Node } from 'slate';
7
8
  import { AlertType, IEditorConfig, IMenuConfig, ISingleMenuConfig } from '../config/interface';
@@ -55,6 +56,7 @@ export interface IDomEditor extends Editor {
55
56
  move: (distance: number, reverse?: boolean) => void;
56
57
  moveReverse: (distance: number) => void;
57
58
  restoreSelection: () => void;
59
+ getTableSelection?: () => NodeEntryWithContext[][] | null;
58
60
  getSelectionPosition: () => Partial<IPositionStyle>;
59
61
  getNodePosition: (node: Node) => Partial<IPositionStyle>;
60
62
  isSelectedAll: () => boolean;
@@ -3,17 +3,17 @@
3
3
  * @author wangfupeng
4
4
  */
5
5
  import { Emitter } from 'event-emitter';
6
+ import { Ancestor, Editor, Node, Path, Range } from 'slate';
6
7
  import { VNode } from 'snabbdom';
7
- import { Node, Ancestor, Editor, Path, Range } from 'slate';
8
+ import { IEditorConfig } from '../config/interface';
8
9
  import { IDomEditor } from '../editor/interface';
9
- import TextArea from '../text-area/TextArea';
10
- import Toolbar from '../menus/bar/Toolbar';
11
10
  import HoverBar from '../menus/bar/HoverBar';
11
+ import Toolbar from '../menus/bar/Toolbar';
12
12
  import { IBarItem } from '../menus/bar-item/index';
13
- import { Key } from './key';
14
- import { PatchFn } from '../utils/vdom';
15
- import { IEditorConfig } from '../config/interface';
16
13
  import PanelAndModal from '../menus/panel-and-modal/BaseClass';
14
+ import TextArea from '../text-area/TextArea';
15
+ import { PatchFn } from '../utils/vdom';
16
+ import { Key } from './key';
17
17
  export declare const EDITOR_TO_TEXTAREA: WeakMap<IDomEditor, TextArea>;
18
18
  export declare const TEXTAREA_TO_EDITOR: WeakMap<TextArea, IDomEditor>;
19
19
  export declare const TOOLBAR_TO_EDITOR: WeakMap<Toolbar, IDomEditor>;
@@ -27,6 +27,8 @@ export declare const EDITOR_TO_CONFIG: WeakMap<IDomEditor, IEditorConfig>;
27
27
  export declare const IS_FIRST_PATCH: WeakMap<TextArea, boolean>;
28
28
  export declare const TEXTAREA_TO_PATCH_FN: WeakMap<TextArea, PatchFn>;
29
29
  export declare const TEXTAREA_TO_VNODE: WeakMap<TextArea, VNode>;
30
+ export declare const NODE_TO_VNODE: WeakMap<Node, [number, VNode]>;
31
+ export declare const NODE_TO_HTML: WeakMap<Node, String>;
30
32
  /**
31
33
  * Two weak maps that allow us rebuild a path given a node. They are populated
32
34
  * at render time such that after a render occurs we can always backtrack.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("katex"),require("@wangeditor-next/editor"),require("snabbdom")):"function"==typeof define&&define.amd?define(["katex","@wangeditor-next/editor","snabbdom"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFormulaPlugin=n(t.katex,t.editor,t.snabbdom)}(this,(function(t,n,e){"use strict";var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},r(t,n)};function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var i,u,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f={};function a(){if(u)return i;u=1;var t=function(t){return t&&t.Math===Math&&t};return i=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof c&&c)||t("object"==typeof i&&i)||function(){return this}()||Function("return this")()}var l,s,p,d,v,h,m,y,g={};function b(){return s?l:(s=1,l=function(t){try{return!!t()}catch(t){return!0}})}function w(){if(d)return p;d=1;var t=b();return p=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function E(){if(h)return v;h=1;var t=b();return v=!t((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function O(){if(y)return m;y=1;var t=E(),n=Function.prototype.call;return m=t?n.bind(n):function(){return n.apply(n,arguments)},m}var x,S,j,T,L,P,I,A,M,R,_,C,N,k,F,D,H,z,B,$,V,W,q,U,K,G,X,Y,Q,J,Z,tt,nt,et,rt,ot,it,ut,ct,ft,at,lt={};function st(){return j?S:(j=1,S=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function pt(){if(L)return T;L=1;var t=E(),n=Function.prototype,e=n.call,r=t&&n.bind.bind(e,e);return T=t?r:function(t){return function(){return e.apply(t,arguments)}},T}function dt(){if(I)return P;I=1;var t=pt(),n=t({}.toString),e=t("".slice);return P=function(t){return e(n(t),8,-1)}}function vt(){if(M)return A;M=1;var t=pt(),n=b(),e=dt(),r=Object,o=t("".split);return A=n((function(){return!r("z").propertyIsEnumerable(0)}))?function(t){return"String"===e(t)?o(t,""):r(t)}:r}function ht(){return _?R:(_=1,R=function(t){return null==t})}function mt(){if(N)return C;N=1;var t=ht(),n=TypeError;return C=function(e){if(t(e))throw new n("Can't call method on "+e);return e}}function yt(){if(F)return k;F=1;var t=vt(),n=mt();return k=function(e){return t(n(e))}}function gt(){if(H)return D;H=1;var t="object"==typeof document&&document.all;return D=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}function bt(){if(B)return z;B=1;var t=gt();return z=function(n){return"object"==typeof n?null!==n:t(n)}}function wt(){if(V)return $;V=1;var t=a(),n=gt();return $=function(e,r){return arguments.length<2?(o=t[e],n(o)?o:void 0):t[e]&&t[e][r];var o},$}function Et(){if(X)return G;X=1;var t,n,e=a(),r=function(){if(K)return U;K=1;var t=a().navigator,n=t&&t.userAgent;return U=n?String(n):""}(),o=e.process,i=e.Deno,u=o&&o.versions||i&&i.version,c=u&&u.v8;return c&&(n=(t=c.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!n&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(n=+t[1]),G=n}function Ot(){if(Q)return Y;Q=1;var t=Et(),n=b(),e=a().String;return Y=!!Object.getOwnPropertySymbols&&!n((function(){var n=Symbol("symbol detection");return!e(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41}))}function xt(){if(Z)return J;Z=1;var t=Ot();return J=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function St(){if(nt)return tt;nt=1;var t=wt(),n=gt(),e=function(){if(q)return W;q=1;var t=pt();return W=t({}.isPrototypeOf)}(),r=xt(),o=Object;return tt=r?function(t){return"symbol"==typeof t}:function(r){var i=t("Symbol");return n(i)&&e(i.prototype,o(r))}}function jt(){if(rt)return et;rt=1;var t=String;return et=function(n){try{return t(n)}catch(t){return"Object"}}}function Tt(){if(it)return ot;it=1;var t=gt(),n=jt(),e=TypeError;return ot=function(r){if(t(r))return r;throw new e(n(r)+" is not a function")}}function Lt(){if(ct)return ut;ct=1;var t=Tt(),n=ht();return ut=function(e,r){var o=e[r];return n(o)?void 0:t(o)}}function Pt(){if(at)return ft;at=1;var t=O(),n=gt(),e=bt(),r=TypeError;return ft=function(o,i){var u,c;if("string"===i&&n(u=o.toString)&&!e(c=t(u,o)))return c;if(n(u=o.valueOf)&&!e(c=t(u,o)))return c;if("string"!==i&&n(u=o.toString)&&!e(c=t(u,o)))return c;throw new r("Can't convert object to primitive value")},ft}var It,At,Mt,Rt,_t,Ct,Nt,kt,Ft,Dt,Ht,zt,Bt,$t,Vt,Wt,qt,Ut,Kt,Gt,Xt,Yt,Qt,Jt,Zt={exports:{}};function tn(){if(Rt)return Mt;Rt=1;var t=a(),n=Object.defineProperty;return Mt=function(e,r){try{n(t,e,{value:r,configurable:!0,writable:!0})}catch(n){t[e]=r}return r}}function nn(){if(_t)return Zt.exports;_t=1;var t=At?It:(At=1,It=!1),n=a(),e=tn(),r="__core-js_shared__",o=Zt.exports=n[r]||e(r,{});return(o.versions||(o.versions=[])).push({version:"3.38.1",mode:t?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"}),Zt.exports}function en(){if(Nt)return Ct;Nt=1;var t=nn();return Ct=function(n,e){return t[n]||(t[n]=e||{})}}function rn(){if(Ft)return kt;Ft=1;var t=mt(),n=Object;return kt=function(e){return n(t(e))}}function on(){if(Ht)return Dt;Ht=1;var t=pt(),n=rn(),e=t({}.hasOwnProperty);return Dt=Object.hasOwn||function(t,r){return e(n(t),r)}}function un(){if(Bt)return zt;Bt=1;var t=pt(),n=0,e=Math.random(),r=t(1..toString);return zt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++n+e,36)}}function cn(){if(Vt)return $t;Vt=1;var t=a(),n=en(),e=on(),r=un(),o=Ot(),i=xt(),u=t.Symbol,c=n("wks"),f=i?u.for||u:u&&u.withoutSetter||r;return $t=function(t){return e(c,t)||(c[t]=o&&e(u,t)?u[t]:f("Symbol."+t)),c[t]}}function fn(){if(qt)return Wt;qt=1;var t=O(),n=bt(),e=St(),r=Lt(),o=Pt(),i=cn(),u=TypeError,c=i("toPrimitive");return Wt=function(i,f){if(!n(i)||e(i))return i;var a,l=r(i,c);if(l){if(void 0===f&&(f="default"),a=t(l,i,f),!n(a)||e(a))return a;throw new u("Can't convert object to primitive value")}return void 0===f&&(f="number"),o(i,f)}}function an(){if(Kt)return Ut;Kt=1;var t=fn(),n=St();return Ut=function(e){var r=t(e,"string");return n(r)?r:r+""}}function ln(){if(Xt)return Gt;Xt=1;var t=a(),n=bt(),e=t.document,r=n(e)&&n(e.createElement);return Gt=function(t){return r?e.createElement(t):{}}}function sn(){if(Qt)return Yt;Qt=1;var t=w(),n=b(),e=ln();return Yt=!t&&!n((function(){return 7!==Object.defineProperty(e("div"),"a",{get:function(){return 7}}).a}))}function pn(){if(Jt)return g;Jt=1;var t=w(),n=O(),e=function(){if(x)return lt;x=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,e=n&&!t.call({1:2},1);return lt.f=e?function(t){var e=n(this,t);return!!e&&e.enumerable}:t,lt}(),r=st(),o=yt(),i=an(),u=on(),c=sn(),f=Object.getOwnPropertyDescriptor;return g.f=t?f:function(t,a){if(t=o(t),a=i(a),c)try{return f(t,a)}catch(t){}if(u(t,a))return r(!n(e.f,t,a),t[a])},g}var dn,vn,hn,mn,yn,gn,bn,wn={};function En(){if(vn)return dn;vn=1;var t=w(),n=b();return dn=t&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function On(){if(mn)return hn;mn=1;var t=bt(),n=String,e=TypeError;return hn=function(r){if(t(r))return r;throw new e(n(r)+" is not an object")}}function xn(){if(yn)return wn;yn=1;var t=w(),n=sn(),e=En(),r=On(),o=an(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",a="configurable",l="writable";return wn.f=t?e?function(t,n,e){if(r(t),n=o(n),r(e),"function"==typeof t&&"prototype"===n&&"value"in e&&l in e&&!e[l]){var i=c(t,n);i&&i[l]&&(t[n]=e.value,e={configurable:a in e?e[a]:i[a],enumerable:f in e?e[f]:i[f],writable:!1})}return u(t,n,e)}:u:function(t,e,c){if(r(t),e=o(e),r(c),n)try{return u(t,e,c)}catch(t){}if("get"in c||"set"in c)throw new i("Accessors not supported");return"value"in c&&(t[e]=c.value),t},wn}function Sn(){if(bn)return gn;bn=1;var t=w(),n=xn(),e=st();return gn=t?function(t,r,o){return n.f(t,r,e(1,o))}:function(t,n,e){return t[n]=e,t}}var jn,Tn,Ln,Pn,In,An,Mn,Rn,_n,Cn,Nn,kn,Fn,Dn,Hn,zn={exports:{}};function Bn(){if(Tn)return jn;Tn=1;var t=w(),n=on(),e=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,o=n(e,"name"),i=o&&"something"===function(){}.name,u=o&&(!t||t&&r(e,"name").configurable);return jn={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function $n(){if(Pn)return Ln;Pn=1;var t=pt(),n=gt(),e=nn(),r=t(Function.toString);return n(e.inspectSource)||(e.inspectSource=function(t){return r(t)}),Ln=e.inspectSource}function Vn(){if(Rn)return Mn;Rn=1;var t=en(),n=un(),e=t("keys");return Mn=function(t){return e[t]||(e[t]=n(t))}}function Wn(){return Cn?_n:(Cn=1,_n={})}function qn(){if(kn)return Nn;kn=1;var t,n,e,r=function(){if(An)return In;An=1;var t=a(),n=gt(),e=t.WeakMap;return In=n(e)&&/native code/.test(String(e))}(),o=a(),i=bt(),u=Sn(),c=on(),f=nn(),l=Vn(),s=Wn(),p="Object already initialized",d=o.TypeError,v=o.WeakMap;if(r||f.state){var h=f.state||(f.state=new v);h.get=h.get,h.has=h.has,h.set=h.set,t=function(t,n){if(h.has(t))throw new d(p);return n.facade=t,h.set(t,n),n},n=function(t){return h.get(t)||{}},e=function(t){return h.has(t)}}else{var m=l("state");s[m]=!0,t=function(t,n){if(c(t,m))throw new d(p);return n.facade=t,u(t,m,n),n},n=function(t){return c(t,m)?t[m]:{}},e=function(t){return c(t,m)}}return Nn={set:t,get:n,has:e,enforce:function(r){return e(r)?n(r):t(r,{})},getterFor:function(t){return function(e){var r;if(!i(e)||(r=n(e)).type!==t)throw new d("Incompatible receiver, "+t+" required");return r}}}}function Un(){if(Fn)return zn.exports;Fn=1;var t=pt(),n=b(),e=gt(),r=on(),o=w(),i=Bn().CONFIGURABLE,u=$n(),c=qn(),f=c.enforce,a=c.get,l=String,s=Object.defineProperty,p=t("".slice),d=t("".replace),v=t([].join),h=o&&!n((function(){return 8!==s((function(){}),"length",{value:8}).length})),m=String(String).split("String"),y=zn.exports=function(t,n,e){"Symbol("===p(l(n),0,7)&&(n="["+d(l(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(n="get "+n),e&&e.setter&&(n="set "+n),(!r(t,"name")||i&&t.name!==n)&&(o?s(t,"name",{value:n,configurable:!0}):t.name=n),h&&e&&r(e,"arity")&&t.length!==e.arity&&s(t,"length",{value:e.arity});try{e&&r(e,"constructor")&&e.constructor?o&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=f(t);return r(u,"source")||(u.source=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y((function(){return e(this)&&a(this).source||u(this)}),"toString"),zn.exports}function Kn(){if(Hn)return Dn;Hn=1;var t=gt(),n=xn(),e=Un(),r=tn();return Dn=function(o,i,u,c){c||(c={});var f=c.enumerable,a=void 0!==c.name?c.name:i;if(t(u)&&e(u,a,c),c.global)f?o[i]=u:r(i,u);else{try{c.unsafe?o[i]&&(f=!0):delete o[i]}catch(t){}f?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}var Gn,Xn,Yn,Qn,Jn,Zn,te,ne,ee,re,oe,ie,ue,ce,fe,ae,le,se={};function pe(){if(Qn)return Yn;Qn=1;var t=function(){if(Xn)return Gn;Xn=1;var t=Math.ceil,n=Math.floor;return Gn=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}}();return Yn=function(n){var e=+n;return e!=e||0===e?0:t(e)}}function de(){if(Zn)return Jn;Zn=1;var t=pe(),n=Math.max,e=Math.min;return Jn=function(r,o){var i=t(r);return i<0?n(i+o,0):e(i,o)}}function ve(){if(ne)return te;ne=1;var t=pe(),n=Math.min;return te=function(e){var r=t(e);return r>0?n(r,9007199254740991):0}}function he(){if(re)return ee;re=1;var t=ve();return ee=function(n){return t(n.length)}}function me(){if(ce)return ue;ce=1;var t=pt(),n=on(),e=yt(),r=function(){if(ie)return oe;ie=1;var t=yt(),n=de(),e=he(),r=function(r){return function(o,i,u){var c=t(o),f=e(c);if(0===f)return!r&&-1;var a,l=n(u,f);if(r&&i!=i){for(;f>l;)if((a=c[l++])!=a)return!0}else for(;f>l;l++)if((r||l in c)&&c[l]===i)return r||l||0;return!r&&-1}};return oe={includes:r(!0),indexOf:r(!1)}}().indexOf,o=Wn(),i=t([].push);return ue=function(t,u){var c,f=e(t),a=0,l=[];for(c in f)!n(o,c)&&n(f,c)&&i(l,c);for(;u.length>a;)n(f,c=u[a++])&&(~r(l,c)||i(l,c));return l}}function ye(){return ae?fe:(ae=1,fe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var ge,be,we,Ee,Oe,xe,Se,je,Te,Le,Pe,Ie,Ae,Me,Re={};function _e(){if(we)return be;we=1;var t=wt(),n=pt(),e=function(){if(le)return se;le=1;var t=me(),n=ye().concat("length","prototype");return se.f=Object.getOwnPropertyNames||function(e){return t(e,n)},se}(),r=(ge||(ge=1,Re.f=Object.getOwnPropertySymbols),Re),o=On(),i=n([].concat);return be=t("Reflect","ownKeys")||function(t){var n=e.f(o(t)),u=r.f;return u?i(n,u(t)):n}}function Ce(){if(Oe)return Ee;Oe=1;var t=on(),n=_e(),e=pn(),r=xn();return Ee=function(o,i,u){for(var c=n(i),f=r.f,a=e.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||f(o,s,a(i,s))}}}function Ne(){if(Te)return je;Te=1;var t=a(),n=pn().f,e=Sn(),r=Kn(),o=tn(),i=Ce(),u=function(){if(Se)return xe;Se=1;var t=b(),n=gt(),e=/#|\.prototype\./,r=function(e,r){var f=i[o(e)];return f===c||f!==u&&(n(r)?t(r):!!r)},o=r.normalize=function(t){return String(t).replace(e,".").toLowerCase()},i=r.data={},u=r.NATIVE="N",c=r.POLYFILL="P";return xe=r}();return je=function(c,f){var a,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(a=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in f){if(p=f[l],s=c.dontCallGetSet?(d=n(a,l))&&d.value:a[l],!u(h?l:v+(m?".":"#")+l,c.forced)&&void 0!==s){if(typeof p==typeof s)continue;i(p,s)}(c.sham||s&&s.sham)&&e(p,"sham",!0),r(a,l,p,c)}}}function ke(){if(Pe)return Le;Pe=1;var t=b();return Le=!t((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))}!function(){if(Me)return f;Me=1;var t=Ne(),n=b(),e=rn(),r=function(){if(Ae)return Ie;Ae=1;var t=on(),n=gt(),e=rn(),r=Vn(),o=ke(),i=r("IE_PROTO"),u=Object,c=u.prototype;return Ie=o?u.getPrototypeOf:function(r){var o=e(r);if(t(o,i))return o[i];var f=o.constructor;return n(f)&&o instanceof f?f.prototype:o instanceof u?c:null}}(),o=ke();t({target:"Object",stat:!0,forced:n((function(){r(1)})),sham:!o},{getPrototypeOf:function(t){return r(e(t))}})}();var Fe,De,He,ze,Be,$e,Ve,We={};function qe(){if(De)return Fe;De=1;var t={};return t[cn()("toStringTag")]="z",Fe="[object z]"===String(t)}function Ue(){if(ze)return He;ze=1;var t=qe(),n=gt(),e=dt(),r=cn()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return He=t?e:function(t){var u,c,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,n){try{return t[n]}catch(t){}}(u=o(t),r))?c:i?e(u):"Object"===(f=e(u))&&n(u.callee)?"Arguments":f}}!function(){if(Ve)return We;Ve=1;var t=qe(),n=Kn(),e=function(){if($e)return Be;$e=1;var t=qe(),n=Ue();return Be=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",e,{unsafe:!0})}();var Ke,Ge,Xe,Ye,Qe,Je,Ze,tr,nr,er,rr={};function or(){if(Ye)return Xe;Ye=1;var t=pt();return Xe=t([].slice)}function ir(){if(Je)return Qe;Je=1;var t=pt(),n=Tt(),e=bt(),r=on(),o=or(),i=E(),u=Function,c=t([].concat),f=t([].join),a={};return Qe=i?u.bind:function(t){var i=n(this),l=i.prototype,s=o(arguments,1),p=function(){var n=c(s,o(arguments));return this instanceof p?function(t,n,e){if(!r(a,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";a[n]=u("C,a","return new C("+f(o,",")+")")}return a[n](t,e)}(i,n.length,n):i.apply(t,n)};return e(l)&&(p.prototype=l),p},Qe}function ur(){if(tr)return Ze;tr=1;var t=pt(),n=b(),e=gt(),r=Ue(),o=wt(),i=$n(),u=function(){},c=o("Reflect","construct"),f=/^\s*(?:class|function)\b/,a=t(f.exec),l=!f.test(u),s=function(t){if(!e(t))return!1;try{return c(u,[],t),!0}catch(t){return!1}},p=function(t){if(!e(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!a(f,i(t))}catch(t){return!0}};return p.sham=!0,Ze=!c||n((function(){var t;return s(s.call)||!s(Object)||!s((function(){t=!0}))||t}))?p:s}function cr(){if(er)return nr;er=1;var t=ur(),n=jt(),e=TypeError;return nr=function(r){if(t(r))return r;throw new e(n(r)+" is not a constructor")}}var fr,ar,lr,sr,pr,dr,vr,hr,mr={};function yr(){if(ar)return fr;ar=1;var t=me(),n=ye();return fr=Object.keys||function(e){return t(e,n)}}function gr(){if(vr)return dr;vr=1;var t,n=On(),e=function(){if(lr)return mr;lr=1;var t=w(),n=En(),e=xn(),r=On(),o=yt(),i=yr();return mr.f=t&&!n?Object.defineProperties:function(t,n){r(t);for(var u,c=o(n),f=i(n),a=f.length,l=0;a>l;)e.f(t,u=f[l++],c[u]);return t},mr}(),r=ye(),o=Wn(),i=function(){if(pr)return sr;pr=1;var t=wt();return sr=t("document","documentElement")}(),u=ln(),c=Vn(),f="prototype",a="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+a+">"+t+"</"+a+">"},d=function(t){t.write(p("")),t.close();var n=t.parentWindow.Object;return t=null,n},v=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var n,e,o;v="undefined"!=typeof document?document.domain&&t?d(t):(e=u("iframe"),o="java"+a+":",e.style.display="none",i.appendChild(e),e.src=String(o),(n=e.contentWindow.document).open(),n.write(p("document.F=Object")),n.close(),n.F):d(t);for(var c=r.length;c--;)delete v[f][r[c]];return v()};return o[l]=!0,dr=Object.create||function(t,r){var o;return null!==t?(s[f]=n(t),o=new s,s[f]=null,o[l]=t):o=v(),void 0===r?o:e.f(o,r)}}!function(){if(hr)return rr;hr=1;var t=Ne(),n=wt(),e=function(){if(Ge)return Ke;Ge=1;var t=E(),n=Function.prototype,e=n.apply,r=n.call;return Ke="object"==typeof Reflect&&Reflect.apply||(t?r.bind(e):function(){return r.apply(e,arguments)}),Ke}(),r=ir(),o=cr(),i=On(),u=bt(),c=gr(),f=b(),a=n("Reflect","construct"),l=Object.prototype,s=[].push,p=f((function(){function t(){}return!(a((function(){}),[],t)instanceof t)})),d=!f((function(){a((function(){}))})),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var f=arguments.length<3?t:o(arguments[2]);if(d&&!p)return a(t,n,f);if(t===f){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var v=[null];return e(s,v,n),new(e(r,t,v))}var h=f.prototype,m=c(u(h)?h:l),y=e(t,m,n);return u(y)?y:m}})}(),function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback&&!window.__POWERED_BY_QIANKUN__){var t=Object.getPrototypeOf(window).HTMLElement,n=function(){return Reflect.construct(t,[],this.constructor)};window.HTMLElement=n,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}();var br=function(n){function e(){var t=n.call(this)||this,e=t.attachShadow({mode:"open"}),r=e.ownerDocument.createElement("span");return r.style.display="inline-block",e.appendChild(r),t.span=r,t}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(e,n),Object.defineProperty(e,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),e.prototype.attributeChangedCallback=function(t,n,e){if("data-value"===t){if(n===e)return;this.render(e||"")}},e.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1,output:"mathml"})},e}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",br),n.i18nAddResources("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),n.i18nAddResources("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var wr,Er,Or,xr,Sr,jr,Tr,Lr,Pr,Ir,Ar,Mr,Rr,_r,Cr,Nr={type:"formula",elemToHtml:function(t,n){var e=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===e?"":e,'"></span>')}},kr={};function Fr(){if(xr)return Or;xr=1;var t=function(){if(Er)return wr;Er=1;var t=dt(),n=pt();return wr=function(e){if("Function"===t(e))return n(e)}}(),n=Tt(),e=E(),r=t(t.bind);return Or=function(t,o){return n(t),void 0===o?t:e?r(t,o):function(){return t.apply(o,arguments)}},Or}function Dr(){if(jr)return Sr;jr=1;var t=dt();return Sr=Array.isArray||function(n){return"Array"===t(n)}}function Hr(){if(Lr)return Tr;Lr=1;var t=Dr(),n=ur(),e=bt(),r=cn()("species"),o=Array;return Tr=function(i){var u;return t(i)&&(u=i.constructor,(n(u)&&(u===o||t(u.prototype))||e(u)&&null===(u=u[r]))&&(u=void 0)),void 0===u?o:u}}function zr(){if(Ir)return Pr;Ir=1;var t=Hr();return Pr=function(n,e){return new(t(n))(0===e?0:e)}}function Br(){if(_r)return Rr;_r=1;var t=cn(),n=gr(),e=xn().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&e(o,r,{configurable:!0,value:n(null)}),Rr=function(t){o[r][t]=!0}}!function(){if(Cr)return kr;Cr=1;var t=Ne(),n=function(){if(Mr)return Ar;Mr=1;var t=Fr(),n=pt(),e=vt(),r=rn(),o=he(),i=zr(),u=n([].push),c=function(n){var c=1===n,f=2===n,a=3===n,l=4===n,s=6===n,p=7===n,d=5===n||s;return function(v,h,m,y){for(var g,b,w=r(v),E=e(w),O=o(E),x=t(h,m),S=0,j=y||i,T=c?j(v,O):f||p?j(v,0):void 0;O>S;S++)if((d||S in E)&&(b=x(g=E[S],S,w),n))if(c)T[S]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return S;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:a||l?l:T}};return Ar={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}}().find,e=Br(),r="find",o=!0;r in[]&&Array(1)[r]((function(){o=!1})),t({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),e(r)}();var $r,Vr,Wr,qr,Ur,Kr,Gr,Xr,Yr,Qr,Jr,Zr,to,no={};function eo(){if(Vr)return $r;Vr=1;var t=Ue(),n=String;return $r=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function ro(){if(qr)return Wr;qr=1;var t=On();return Wr=function(){var n=t(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e}}function oo(){if(Zr)return Jr;Zr=1;var t,n,e=O(),r=pt(),o=eo(),i=ro(),u=function(){if(Kr)return Ur;Kr=1;var t=b(),n=a().RegExp,e=t((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),r=e||t((function(){return!n("a","y").sticky})),o=e||t((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return Ur={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=en(),f=gr(),l=qn().get,s=function(){if(Xr)return Gr;Xr=1;var t=b(),n=a().RegExp;return Gr=t((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}(),p=function(){if(Qr)return Yr;Qr=1;var t=b(),n=a().RegExp;return Yr=t((function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}(),d=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,h=v,m=r("".charAt),y=r("".indexOf),g=r("".replace),w=r("".slice),E=(n=/b*/g,e(v,t=/a/,"a"),e(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),x=u.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];return(E||S||x||s||p)&&(h=function(t){var n,r,u,c,a,s,p,b=this,O=l(b),j=o(t),T=O.raw;if(T)return T.lastIndex=b.lastIndex,n=e(h,T,j),b.lastIndex=T.lastIndex,n;var L=O.groups,P=x&&b.sticky,I=e(i,b),A=b.source,M=0,R=j;if(P&&(I=g(I,"y",""),-1===y(I,"g")&&(I+="g"),R=w(j,b.lastIndex),b.lastIndex>0&&(!b.multiline||b.multiline&&"\n"!==m(j,b.lastIndex-1))&&(A="(?: "+A+")",R=" "+R,M++),r=new RegExp("^(?:"+A+")",I)),S&&(r=new RegExp("^"+A+"$(?!\\s)",I)),E&&(u=b.lastIndex),c=e(v,P?r:b,R),P?c?(c.input=w(c.input,M),c[0]=w(c[0],M),c.index=b.lastIndex,b.lastIndex+=c[0].length):b.lastIndex=0:E&&c&&(b.lastIndex=b.global?c.index+c[0].length:u),S&&c&&c.length>1&&e(d,c[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(c[a]=void 0)})),c&&L)for(c.groups=s=f(null),a=0;a<L.length;a++)s[(p=L[a])[0]]=c[p[1]];return c}),Jr=h}!function(){if(to)return no;to=1;var t=Ne(),n=oo();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var io,uo,co,fo,ao,lo,so,po={};function vo(){return uo?io:(uo=1,io="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(so)return po;so=1;var t=Ne(),n=function(){if(fo)return co;fo=1;var t=pt(),n=mt(),e=eo(),r=vo(),o=t("".replace),i=RegExp("^["+r+"]+"),u=RegExp("(^|[^"+r+"])["+r+"]+$"),c=function(t){return function(r){var c=e(n(r));return 1&t&&(c=o(c,i,"")),2&t&&(c=o(c,u,"$1")),c}};return co={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(lo)return ao;lo=1;var t=Bn().PROPER,n=b(),e=vo();return ao=function(r){return n((function(){return!!e[r]()||"​…᠎"!=="​…᠎"[r]()||t&&e[r].name!==r}))}}();t({target:"String",proto:!0,forced:e("trim")},{trim:function(){return n(this)}})}();var ho,mo,yo={};function go(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function bo(t={},n={}){Object.keys(n).forEach((e=>{void 0===t[e]?t[e]=n[e]:go(n[e])&&go(t[e])&&Object.keys(n[e]).length>0&&bo(t[e],n[e])}))}mo||(mo=1,function(){if(ho)return yo;ho=1;var t=Ne(),n=a();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const wo={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Eo(){const t="undefined"!=typeof document?document:{};return bo(t,wo),t}const Oo={document:wo,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:t=>"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0),cancelAnimationFrame(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function xo(){const t="undefined"!=typeof window?window:{};return bo(t,Oo),t}class So extends Array{constructor(t){"number"==typeof t?super(t):(super(...t||[]),function(t){const n=t.__proto__;Object.defineProperty(t,"__proto__",{get:()=>n,set(t){n.__proto__=t}})}(this))}}function jo(t,n){const e=xo(),r=Eo();let o=[];if(!n&&t instanceof So)return t;if(!t)return new So(o);if("string"==typeof t){const e=t.trim();if(e.indexOf("<")>=0&&e.indexOf(">")>=0){let t="div";0===e.indexOf("<li")&&(t="ul"),0===e.indexOf("<tr")&&(t="tbody"),0!==e.indexOf("<td")&&0!==e.indexOf("<th")||(t="tr"),0===e.indexOf("<tbody")&&(t="table"),0===e.indexOf("<option")&&(t="select");const n=r.createElement(t);n.innerHTML=e;for(let t=0;t<n.childNodes.length;t+=1)o.push(n.childNodes[t])}else o=function(t,n){if("string"!=typeof t)return[t];const e=[],r=n.querySelectorAll(t);for(let t=0;t<r.length;t+=1)e.push(r[t]);return e}(t.trim(),n||r)}else if(t.nodeType||t===e||t===r)o.push(t);else if(Array.isArray(t)){if(t instanceof So)return t;o=t}return new So(function(t){const n=[];for(let e=0;e<t.length;e+=1)-1===n.indexOf(t[e])&&n.push(t[e]);return n}(o))}function To(t){if(void 0===t){const t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){const n=[];for(let e=0;e<t.selectedOptions.length;e+=1)n.push(t.selectedOptions[e].value);return n}return t.value}for(let n=0;n<this.length;n+=1){const e=this[n];if(Array.isArray(t)&&e.multiple&&"select"===e.nodeName.toLowerCase())for(let n=0;n<e.options.length;n+=1)e.options[n].selected=t.indexOf(e.options[n].value)>=0;else e.value=t}return this}function Lo(...t){let[n,e,r,o]=t;function i(t){const n=t.target;if(!n)return;const o=t.target.dom7EventData||[];if(o.indexOf(t)<0&&o.unshift(t),jo(n).is(e))r.apply(n,o);else{const t=jo(n).parents();for(let n=0;n<t.length;n+=1)jo(t[n]).is(e)&&r.apply(t[n],o)}}function u(t){const n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),r.apply(this,n)}"function"==typeof t[1]&&([n,r,o]=t,e=void 0),o||(o=!1);const c=n.split(" ");let f;for(let t=0;t<this.length;t+=1){const n=this[t];if(e)for(f=0;f<c.length;f+=1){const t=c[f];n.dom7LiveListeners||(n.dom7LiveListeners={}),n.dom7LiveListeners[t]||(n.dom7LiveListeners[t]=[]),n.dom7LiveListeners[t].push({listener:r,proxyListener:i}),n.addEventListener(t,i,o)}else for(f=0;f<c.length;f+=1){const t=c[f];n.dom7Listeners||(n.dom7Listeners={}),n.dom7Listeners[t]||(n.dom7Listeners[t]=[]),n.dom7Listeners[t].push({listener:r,proxyListener:u}),n.addEventListener(t,u,o)}}return this}function Po(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(let n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function Io(t){const n=xo(),e=Eo(),r=this[0];let o,i;if(!r||void 0===t)return!1;if("string"==typeof t){if(r.matches)return r.matches(t);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(r.msMatchesSelector)return r.msMatchesSelector(t);for(o=jo(t),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(t===e)return r===e;if(t===n)return r===n;if(t.nodeType||t instanceof So){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function Ao(...t){let n;const e=Eo();for(let r=0;r<t.length;r+=1){n=t[r];for(let t=0;t<this.length;t+=1)if("string"==typeof n){const r=e.createElement("div");for(r.innerHTML=n;r.firstChild;)this[t].appendChild(r.firstChild)}else if(n instanceof So)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Mo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?jo(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return jo(n)}function Ro(t){const n=[];for(let e=0;e<this.length;e+=1){const r=this[e].querySelectorAll(t);for(let t=0;t<r.length;t+=1)n.push(r[t])}return jo(n)}jo.fn=So.prototype;const _o="resize scroll".split(" ");const Co=(No="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)_o.indexOf(No)<0&&(No in this[t]?this[t][No]():jo(this[t]).trigger(No));return this}return this.on(No,...t)});var No;Ao&&(jo.fn.append=Ao),Po&&(jo.fn.html=Po),To&&(jo.fn.val=To),Lo&&(jo.fn.on=Lo),Co&&(jo.fn.focus=Co),Io&&(jo.fn.is=Io),Mo&&(jo.fn.parents=Mo),Ro&&(jo.fn.find=Ro);var ko,Fo,Do,Ho,zo,Bo,$o,Vo={};function Wo(){if(Fo)return ko;Fo=1;var t=TypeError;return ko=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function qo(){if(Ho)return Do;Ho=1;var t=w(),n=xn(),e=st();return Do=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Uo(){if(Bo)return zo;Bo=1;var t=b(),n=cn(),e=Et(),r=n("species");return zo=function(n){return e>=51||!t((function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo}))}}!function(){if($o)return Vo;$o=1;var t=Ne(),n=b(),e=Dr(),r=bt(),o=rn(),i=he(),u=Wo(),c=qo(),f=zr(),a=Uo(),l=cn(),s=Et(),p=l("isConcatSpreadable"),d=s>=51||!n((function(){var t=[];return t[p]=!1,t.concat()[0]!==t})),v=function(t){if(!r(t))return!1;var n=t[p];return void 0!==n?!!n:e(t)};t({target:"Array",proto:!0,arity:1,forced:!d||!a("concat")},{concat:function(t){var n,e,r,a,l,s=o(this),p=f(s,0),d=0;for(n=-1,r=arguments.length;n<r;n++)if(v(l=-1===n?s:arguments[n]))for(a=i(l),u(d+a),e=0;e<a;e++,d++)e in l&&c(p,d,l[e]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();let Ko=(t=21)=>{let n="",e=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&e[t]];return n};function Go(t){return"".concat(t,"-").concat(Ko())}function Xo(){return Go("w-e-insert-formula")}var Yo=function(){function t(){this.title=n.t("formula.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=Xo(),this.buttonId=Xo()}return t.prototype.getSelectedElem=function(t){var e=n.DomEditor.getSelectedNodeByType(t,"formula");return null==e?null:e},t.prototype.getValue=function(t){var n=this.getSelectedElem(t);return n&&n.value||""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var e=t.selection;return null==e||(!!n.SlateRange.isExpanded(e)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],f=jo(u[1]),a=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=jo("<div></div>");l.on("click","#".concat(i),(function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.updateFormula(t,o),t.hidePanelOrModal()})),this.$content=l}var s=this.$content;s.html(""),s.append(c),s.append(a);var p=this.getValue(t);return f.val(p),setTimeout((function(){f.focus()})),s[0]},t.prototype.updateFormula=function(t,e){if(e&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var o=n.DomEditor.findPath(t,r),i={value:e};n.SlateTransforms.setNodes(t,i,{at:o})}}},t}();function Qo(){return Go("w-e-insert-formula")}var Jo=function(){function t(){this.title=n.t("formula.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=Qo(),this.buttonId=Qo()}return t.prototype.getValue=function(t){return""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var e=t.selection;if(null==e)return!0;if(n.SlateRange.isExpanded(e))return!0;var r=n.DomEditor.getSelectedElems(t);return!!r.some((function(n){return t.isVoid(n)}))||!!r.some((function(t){return"pre"===n.DomEditor.getNodeType(t)}))},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],f=jo(u[1]),a=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=jo("<div></div>");l.on("click","#".concat(i),(function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.insertFormula(t,o),t.hidePanelOrModal()})),this.$content=l}var s=this.$content;return s.html(""),s.append(c),s.append(a),f.val(""),setTimeout((function(){f.focus()})),s[0]},t.prototype.insertFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var e={type:"formula",value:n,children:[{text:""}]};t.insertNode(e)}},t}();return{editorPlugin:function(t){var e=t.isInline,r=t.isVoid,o=t;return o.isInline=function(t){return"formula"===n.DomEditor.getNodeType(t)||e(t)},o.isVoid=function(t){return"formula"===n.DomEditor.getNodeType(t)||r(t)},o},renderElems:[{type:"formula",renderElem:function(t,r,o){var i=n.DomEditor.isNodeSelected(o,t),u=t.value,c=void 0===u?"":u,f=e.h("w-e-formula-card",{dataset:{value:c}},null);return e.h("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:i?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[f])}}],elemsToHtml:[Nr],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,n,e){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new Jo}},{key:"editFormula",factory:function(){return new Yo}}]}}));
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("katex"),require("@wangeditor-next/editor"),require("snabbdom")):"function"==typeof define&&define.amd?define(["katex","@wangeditor-next/editor","snabbdom"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFormulaPlugin=n(t.katex,t.editor,t.snabbdom)}(this,function(t,n,e){"use strict";var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},r(t,n)};function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var i,u,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f={};function a(){if(u)return i;u=1;var t=function(t){return t&&t.Math===Math&&t};return i=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof c&&c)||t("object"==typeof i&&i)||function(){return this}()||Function("return this")()}var l,s,p,d,v,h,m,y,g={};function b(){return s?l:(s=1,l=function(t){try{return!!t()}catch(t){return!0}})}function w(){if(d)return p;d=1;var t=b();return p=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function E(){if(h)return v;h=1;var t=b();return v=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function O(){if(y)return m;y=1;var t=E(),n=Function.prototype.call;return m=t?n.bind(n):function(){return n.apply(n,arguments)},m}var x,S,j,T,L,P,I,A,M,R,_,C,N,k,F,D,H,z,B,$,V,W,q,U,K,G,X,Y,Q,J,Z,tt,nt,et,rt,ot,it,ut,ct,ft,at,lt={};function st(){return j?S:(j=1,S=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function pt(){if(L)return T;L=1;var t=E(),n=Function.prototype,e=n.call,r=t&&n.bind.bind(e,e);return T=t?r:function(t){return function(){return e.apply(t,arguments)}},T}function dt(){if(I)return P;I=1;var t=pt(),n=t({}.toString),e=t("".slice);return P=function(t){return e(n(t),8,-1)}}function vt(){if(M)return A;M=1;var t=pt(),n=b(),e=dt(),r=Object,o=t("".split);return A=n(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===e(t)?o(t,""):r(t)}:r}function ht(){return _?R:(_=1,R=function(t){return null==t})}function mt(){if(N)return C;N=1;var t=ht(),n=TypeError;return C=function(e){if(t(e))throw new n("Can't call method on "+e);return e}}function yt(){if(F)return k;F=1;var t=vt(),n=mt();return k=function(e){return t(n(e))}}function gt(){if(H)return D;H=1;var t="object"==typeof document&&document.all;return D=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}function bt(){if(B)return z;B=1;var t=gt();return z=function(n){return"object"==typeof n?null!==n:t(n)}}function wt(){if(V)return $;V=1;var t=a(),n=gt();return $=function(e,r){return arguments.length<2?(o=t[e],n(o)?o:void 0):t[e]&&t[e][r];var o},$}function Et(){if(X)return G;X=1;var t,n,e=a(),r=function(){if(K)return U;K=1;var t=a().navigator,n=t&&t.userAgent;return U=n?String(n):""}(),o=e.process,i=e.Deno,u=o&&o.versions||i&&i.version,c=u&&u.v8;return c&&(n=(t=c.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!n&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(n=+t[1]),G=n}function Ot(){if(Q)return Y;Q=1;var t=Et(),n=b(),e=a().String;return Y=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!e(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function xt(){if(Z)return J;Z=1;var t=Ot();return J=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function St(){if(nt)return tt;nt=1;var t=wt(),n=gt(),e=function(){if(q)return W;q=1;var t=pt();return W=t({}.isPrototypeOf)}(),r=xt(),o=Object;return tt=r?function(t){return"symbol"==typeof t}:function(r){var i=t("Symbol");return n(i)&&e(i.prototype,o(r))}}function jt(){if(rt)return et;rt=1;var t=String;return et=function(n){try{return t(n)}catch(t){return"Object"}}}function Tt(){if(it)return ot;it=1;var t=gt(),n=jt(),e=TypeError;return ot=function(r){if(t(r))return r;throw new e(n(r)+" is not a function")}}function Lt(){if(ct)return ut;ct=1;var t=Tt(),n=ht();return ut=function(e,r){var o=e[r];return n(o)?void 0:t(o)}}function Pt(){if(at)return ft;at=1;var t=O(),n=gt(),e=bt(),r=TypeError;return ft=function(o,i){var u,c;if("string"===i&&n(u=o.toString)&&!e(c=t(u,o)))return c;if(n(u=o.valueOf)&&!e(c=t(u,o)))return c;if("string"!==i&&n(u=o.toString)&&!e(c=t(u,o)))return c;throw new r("Can't convert object to primitive value")},ft}var It,At,Mt,Rt,_t,Ct,Nt,kt,Ft,Dt,Ht,zt,Bt,$t,Vt,Wt,qt,Ut,Kt,Gt,Xt,Yt,Qt,Jt,Zt={exports:{}};function tn(){if(Rt)return Mt;Rt=1;var t=a(),n=Object.defineProperty;return Mt=function(e,r){try{n(t,e,{value:r,configurable:!0,writable:!0})}catch(n){t[e]=r}return r}}function nn(){if(_t)return Zt.exports;_t=1;var t=At?It:(At=1,It=!1),n=a(),e=tn(),r="__core-js_shared__",o=Zt.exports=n[r]||e(r,{});return(o.versions||(o.versions=[])).push({version:"3.43.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Zt.exports}function en(){if(Nt)return Ct;Nt=1;var t=nn();return Ct=function(n,e){return t[n]||(t[n]=e||{})}}function rn(){if(Ft)return kt;Ft=1;var t=mt(),n=Object;return kt=function(e){return n(t(e))}}function on(){if(Ht)return Dt;Ht=1;var t=pt(),n=rn(),e=t({}.hasOwnProperty);return Dt=Object.hasOwn||function(t,r){return e(n(t),r)}}function un(){if(Bt)return zt;Bt=1;var t=pt(),n=0,e=Math.random(),r=t(1.1.toString);return zt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++n+e,36)}}function cn(){if(Vt)return $t;Vt=1;var t=a(),n=en(),e=on(),r=un(),o=Ot(),i=xt(),u=t.Symbol,c=n("wks"),f=i?u.for||u:u&&u.withoutSetter||r;return $t=function(t){return e(c,t)||(c[t]=o&&e(u,t)?u[t]:f("Symbol."+t)),c[t]}}function fn(){if(qt)return Wt;qt=1;var t=O(),n=bt(),e=St(),r=Lt(),o=Pt(),i=cn(),u=TypeError,c=i("toPrimitive");return Wt=function(i,f){if(!n(i)||e(i))return i;var a,l=r(i,c);if(l){if(void 0===f&&(f="default"),a=t(l,i,f),!n(a)||e(a))return a;throw new u("Can't convert object to primitive value")}return void 0===f&&(f="number"),o(i,f)}}function an(){if(Kt)return Ut;Kt=1;var t=fn(),n=St();return Ut=function(e){var r=t(e,"string");return n(r)?r:r+""}}function ln(){if(Xt)return Gt;Xt=1;var t=a(),n=bt(),e=t.document,r=n(e)&&n(e.createElement);return Gt=function(t){return r?e.createElement(t):{}}}function sn(){if(Qt)return Yt;Qt=1;var t=w(),n=b(),e=ln();return Yt=!t&&!n(function(){return 7!==Object.defineProperty(e("div"),"a",{get:function(){return 7}}).a})}function pn(){if(Jt)return g;Jt=1;var t=w(),n=O(),e=function(){if(x)return lt;x=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,e=n&&!t.call({1:2},1);return lt.f=e?function(t){var e=n(this,t);return!!e&&e.enumerable}:t,lt}(),r=st(),o=yt(),i=an(),u=on(),c=sn(),f=Object.getOwnPropertyDescriptor;return g.f=t?f:function(t,a){if(t=o(t),a=i(a),c)try{return f(t,a)}catch(t){}if(u(t,a))return r(!n(e.f,t,a),t[a])},g}var dn,vn,hn,mn,yn,gn,bn,wn={};function En(){if(vn)return dn;vn=1;var t=w(),n=b();return dn=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function On(){if(mn)return hn;mn=1;var t=bt(),n=String,e=TypeError;return hn=function(r){if(t(r))return r;throw new e(n(r)+" is not an object")}}function xn(){if(yn)return wn;yn=1;var t=w(),n=sn(),e=En(),r=On(),o=an(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",a="configurable",l="writable";return wn.f=t?e?function(t,n,e){if(r(t),n=o(n),r(e),"function"==typeof t&&"prototype"===n&&"value"in e&&l in e&&!e[l]){var i=c(t,n);i&&i[l]&&(t[n]=e.value,e={configurable:a in e?e[a]:i[a],enumerable:f in e?e[f]:i[f],writable:!1})}return u(t,n,e)}:u:function(t,e,c){if(r(t),e=o(e),r(c),n)try{return u(t,e,c)}catch(t){}if("get"in c||"set"in c)throw new i("Accessors not supported");return"value"in c&&(t[e]=c.value),t},wn}function Sn(){if(bn)return gn;bn=1;var t=w(),n=xn(),e=st();return gn=t?function(t,r,o){return n.f(t,r,e(1,o))}:function(t,n,e){return t[n]=e,t}}var jn,Tn,Ln,Pn,In,An,Mn,Rn,_n,Cn,Nn,kn,Fn,Dn,Hn,zn={exports:{}};function Bn(){if(Tn)return jn;Tn=1;var t=w(),n=on(),e=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,o=n(e,"name"),i=o&&"something"===function(){}.name,u=o&&(!t||t&&r(e,"name").configurable);return jn={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function $n(){if(Pn)return Ln;Pn=1;var t=pt(),n=gt(),e=nn(),r=t(Function.toString);return n(e.inspectSource)||(e.inspectSource=function(t){return r(t)}),Ln=e.inspectSource}function Vn(){if(Rn)return Mn;Rn=1;var t=en(),n=un(),e=t("keys");return Mn=function(t){return e[t]||(e[t]=n(t))}}function Wn(){return Cn?_n:(Cn=1,_n={})}function qn(){if(kn)return Nn;kn=1;var t,n,e,r=function(){if(An)return In;An=1;var t=a(),n=gt(),e=t.WeakMap;return In=n(e)&&/native code/.test(String(e))}(),o=a(),i=bt(),u=Sn(),c=on(),f=nn(),l=Vn(),s=Wn(),p="Object already initialized",d=o.TypeError,v=o.WeakMap;if(r||f.state){var h=f.state||(f.state=new v);h.get=h.get,h.has=h.has,h.set=h.set,t=function(t,n){if(h.has(t))throw new d(p);return n.facade=t,h.set(t,n),n},n=function(t){return h.get(t)||{}},e=function(t){return h.has(t)}}else{var m=l("state");s[m]=!0,t=function(t,n){if(c(t,m))throw new d(p);return n.facade=t,u(t,m,n),n},n=function(t){return c(t,m)?t[m]:{}},e=function(t){return c(t,m)}}return Nn={set:t,get:n,has:e,enforce:function(r){return e(r)?n(r):t(r,{})},getterFor:function(t){return function(e){var r;if(!i(e)||(r=n(e)).type!==t)throw new d("Incompatible receiver, "+t+" required");return r}}}}function Un(){if(Fn)return zn.exports;Fn=1;var t=pt(),n=b(),e=gt(),r=on(),o=w(),i=Bn().CONFIGURABLE,u=$n(),c=qn(),f=c.enforce,a=c.get,l=String,s=Object.defineProperty,p=t("".slice),d=t("".replace),v=t([].join),h=o&&!n(function(){return 8!==s(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=zn.exports=function(t,n,e){"Symbol("===p(l(n),0,7)&&(n="["+d(l(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(n="get "+n),e&&e.setter&&(n="set "+n),(!r(t,"name")||i&&t.name!==n)&&(o?s(t,"name",{value:n,configurable:!0}):t.name=n),h&&e&&r(e,"arity")&&t.length!==e.arity&&s(t,"length",{value:e.arity});try{e&&r(e,"constructor")&&e.constructor?o&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=f(t);return r(u,"source")||(u.source=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return e(this)&&a(this).source||u(this)},"toString"),zn.exports}function Kn(){if(Hn)return Dn;Hn=1;var t=gt(),n=xn(),e=Un(),r=tn();return Dn=function(o,i,u,c){c||(c={});var f=c.enumerable,a=void 0!==c.name?c.name:i;if(t(u)&&e(u,a,c),c.global)f?o[i]=u:r(i,u);else{try{c.unsafe?o[i]&&(f=!0):delete o[i]}catch(t){}f?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}var Gn,Xn,Yn,Qn,Jn,Zn,te,ne,ee,re,oe,ie,ue,ce,fe,ae,le,se={};function pe(){if(Qn)return Yn;Qn=1;var t=function(){if(Xn)return Gn;Xn=1;var t=Math.ceil,n=Math.floor;return Gn=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}}();return Yn=function(n){var e=+n;return e!=e||0===e?0:t(e)}}function de(){if(Zn)return Jn;Zn=1;var t=pe(),n=Math.max,e=Math.min;return Jn=function(r,o){var i=t(r);return i<0?n(i+o,0):e(i,o)}}function ve(){if(ne)return te;ne=1;var t=pe(),n=Math.min;return te=function(e){var r=t(e);return r>0?n(r,9007199254740991):0}}function he(){if(re)return ee;re=1;var t=ve();return ee=function(n){return t(n.length)}}function me(){if(ce)return ue;ce=1;var t=pt(),n=on(),e=yt(),r=function(){if(ie)return oe;ie=1;var t=yt(),n=de(),e=he(),r=function(r){return function(o,i,u){var c=t(o),f=e(c);if(0===f)return!r&&-1;var a,l=n(u,f);if(r&&i!=i){for(;f>l;)if((a=c[l++])!=a)return!0}else for(;f>l;l++)if((r||l in c)&&c[l]===i)return r||l||0;return!r&&-1}};return oe={includes:r(!0),indexOf:r(!1)}}().indexOf,o=Wn(),i=t([].push);return ue=function(t,u){var c,f=e(t),a=0,l=[];for(c in f)!n(o,c)&&n(f,c)&&i(l,c);for(;u.length>a;)n(f,c=u[a++])&&(~r(l,c)||i(l,c));return l}}function ye(){return ae?fe:(ae=1,fe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var ge,be,we,Ee,Oe,xe,Se,je,Te,Le,Pe,Ie,Ae,Me,Re={};function _e(){if(we)return be;we=1;var t=wt(),n=pt(),e=function(){if(le)return se;le=1;var t=me(),n=ye().concat("length","prototype");return se.f=Object.getOwnPropertyNames||function(e){return t(e,n)},se}(),r=(ge||(ge=1,Re.f=Object.getOwnPropertySymbols),Re),o=On(),i=n([].concat);return be=t("Reflect","ownKeys")||function(t){var n=e.f(o(t)),u=r.f;return u?i(n,u(t)):n}}function Ce(){if(Oe)return Ee;Oe=1;var t=on(),n=_e(),e=pn(),r=xn();return Ee=function(o,i,u){for(var c=n(i),f=r.f,a=e.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||f(o,s,a(i,s))}}}function Ne(){if(Te)return je;Te=1;var t=a(),n=pn().f,e=Sn(),r=Kn(),o=tn(),i=Ce(),u=function(){if(Se)return xe;Se=1;var t=b(),n=gt(),e=/#|\.prototype\./,r=function(e,r){var f=i[o(e)];return f===c||f!==u&&(n(r)?t(r):!!r)},o=r.normalize=function(t){return String(t).replace(e,".").toLowerCase()},i=r.data={},u=r.NATIVE="N",c=r.POLYFILL="P";return xe=r}();return je=function(c,f){var a,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(a=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in f){if(p=f[l],s=c.dontCallGetSet?(d=n(a,l))&&d.value:a[l],!u(h?l:v+(m?".":"#")+l,c.forced)&&void 0!==s){if(typeof p==typeof s)continue;i(p,s)}(c.sham||s&&s.sham)&&e(p,"sham",!0),r(a,l,p,c)}}}function ke(){if(Pe)return Le;Pe=1;var t=b();return Le=!t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})}!function(){if(Me)return f;Me=1;var t=Ne(),n=b(),e=rn(),r=function(){if(Ae)return Ie;Ae=1;var t=on(),n=gt(),e=rn(),r=Vn(),o=ke(),i=r("IE_PROTO"),u=Object,c=u.prototype;return Ie=o?u.getPrototypeOf:function(r){var o=e(r);if(t(o,i))return o[i];var f=o.constructor;return n(f)&&o instanceof f?f.prototype:o instanceof u?c:null}}(),o=ke();t({target:"Object",stat:!0,forced:n(function(){r(1)}),sham:!o},{getPrototypeOf:function(t){return r(e(t))}})}();var Fe,De,He,ze,Be,$e,Ve,We={};function qe(){if(De)return Fe;De=1;var t={};return t[cn()("toStringTag")]="z",Fe="[object z]"===String(t)}function Ue(){if(ze)return He;ze=1;var t=qe(),n=gt(),e=dt(),r=cn()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return He=t?e:function(t){var u,c,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,n){try{return t[n]}catch(t){}}(u=o(t),r))?c:i?e(u):"Object"===(f=e(u))&&n(u.callee)?"Arguments":f}}!function(){if(Ve)return We;Ve=1;var t=qe(),n=Kn(),e=function(){if($e)return Be;$e=1;var t=qe(),n=Ue();return Be=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",e,{unsafe:!0})}();var Ke,Ge,Xe,Ye,Qe,Je,Ze,tr,nr,er,rr={};function or(){if(Ye)return Xe;Ye=1;var t=pt();return Xe=t([].slice)}function ir(){if(Je)return Qe;Je=1;var t=pt(),n=Tt(),e=bt(),r=on(),o=or(),i=E(),u=Function,c=t([].concat),f=t([].join),a={};return Qe=i?u.bind:function(t){var i=n(this),l=i.prototype,s=o(arguments,1),p=function(){var n=c(s,o(arguments));return this instanceof p?function(t,n,e){if(!r(a,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";a[n]=u("C,a","return new C("+f(o,",")+")")}return a[n](t,e)}(i,n.length,n):i.apply(t,n)};return e(l)&&(p.prototype=l),p},Qe}function ur(){if(tr)return Ze;tr=1;var t=pt(),n=b(),e=gt(),r=Ue(),o=wt(),i=$n(),u=function(){},c=o("Reflect","construct"),f=/^\s*(?:class|function)\b/,a=t(f.exec),l=!f.test(u),s=function(t){if(!e(t))return!1;try{return c(u,[],t),!0}catch(t){return!1}},p=function(t){if(!e(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!a(f,i(t))}catch(t){return!0}};return p.sham=!0,Ze=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function cr(){if(er)return nr;er=1;var t=ur(),n=jt(),e=TypeError;return nr=function(r){if(t(r))return r;throw new e(n(r)+" is not a constructor")}}var fr,ar,lr,sr,pr,dr,vr,hr,mr={};function yr(){if(ar)return fr;ar=1;var t=me(),n=ye();return fr=Object.keys||function(e){return t(e,n)}}function gr(){if(vr)return dr;vr=1;var t,n=On(),e=function(){if(lr)return mr;lr=1;var t=w(),n=En(),e=xn(),r=On(),o=yt(),i=yr();return mr.f=t&&!n?Object.defineProperties:function(t,n){r(t);for(var u,c=o(n),f=i(n),a=f.length,l=0;a>l;)e.f(t,u=f[l++],c[u]);return t},mr}(),r=ye(),o=Wn(),i=function(){if(pr)return sr;pr=1;var t=wt();return sr=t("document","documentElement")}(),u=ln(),c=Vn(),f="prototype",a="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+a+">"+t+"</"+a+">"},d=function(t){t.write(p("")),t.close();var n=t.parentWindow.Object;return t=null,n},v=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var n,e,o;v="undefined"!=typeof document?document.domain&&t?d(t):(e=u("iframe"),o="java"+a+":",e.style.display="none",i.appendChild(e),e.src=String(o),(n=e.contentWindow.document).open(),n.write(p("document.F=Object")),n.close(),n.F):d(t);for(var c=r.length;c--;)delete v[f][r[c]];return v()};return o[l]=!0,dr=Object.create||function(t,r){var o;return null!==t?(s[f]=n(t),o=new s,s[f]=null,o[l]=t):o=v(),void 0===r?o:e.f(o,r)}}!function(){if(hr)return rr;hr=1;var t=Ne(),n=wt(),e=function(){if(Ge)return Ke;Ge=1;var t=E(),n=Function.prototype,e=n.apply,r=n.call;return Ke="object"==typeof Reflect&&Reflect.apply||(t?r.bind(e):function(){return r.apply(e,arguments)}),Ke}(),r=ir(),o=cr(),i=On(),u=bt(),c=gr(),f=b(),a=n("Reflect","construct"),l=Object.prototype,s=[].push,p=f(function(){function t(){}return!(a(function(){},[],t)instanceof t)}),d=!f(function(){a(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var f=arguments.length<3?t:o(arguments[2]);if(d&&!p)return a(t,n,f);if(t===f){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var v=[null];return e(s,v,n),new(e(r,t,v))}var h=f.prototype,m=c(u(h)?h:l),y=e(t,m,n);return u(y)?y:m}})}(),function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback&&!window.__POWERED_BY_QIANKUN__){var t=Object.getPrototypeOf(window).HTMLElement,n=function(){return Reflect.construct(t,[],this.constructor)};window.HTMLElement=n,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}();var br=function(n){function e(){var t=n.call(this)||this,e=t.attachShadow({mode:"open"}),r=e.ownerDocument.createElement("span");return r.style.display="inline-block",e.appendChild(r),t.span=r,t}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(e,n),Object.defineProperty(e,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),e.prototype.attributeChangedCallback=function(t,n,e){if("data-value"===t){if(n===e)return;this.render(e||"")}},e.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1,output:"mathml"})},e}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",br),n.i18nAddResources("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),n.i18nAddResources("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var wr,Er,Or,xr,Sr,jr,Tr,Lr,Pr,Ir,Ar,Mr,Rr,_r,Cr,Nr={type:"formula",elemToHtml:function(t,n){var e=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===e?"":e,'"></span>')}},kr={};function Fr(){if(xr)return Or;xr=1;var t=function(){if(Er)return wr;Er=1;var t=dt(),n=pt();return wr=function(e){if("Function"===t(e))return n(e)}}(),n=Tt(),e=E(),r=t(t.bind);return Or=function(t,o){return n(t),void 0===o?t:e?r(t,o):function(){return t.apply(o,arguments)}},Or}function Dr(){if(jr)return Sr;jr=1;var t=dt();return Sr=Array.isArray||function(n){return"Array"===t(n)}}function Hr(){if(Lr)return Tr;Lr=1;var t=Dr(),n=ur(),e=bt(),r=cn()("species"),o=Array;return Tr=function(i){var u;return t(i)&&(u=i.constructor,(n(u)&&(u===o||t(u.prototype))||e(u)&&null===(u=u[r]))&&(u=void 0)),void 0===u?o:u}}function zr(){if(Ir)return Pr;Ir=1;var t=Hr();return Pr=function(n,e){return new(t(n))(0===e?0:e)}}function Br(){if(_r)return Rr;_r=1;var t=cn(),n=gr(),e=xn().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&e(o,r,{configurable:!0,value:n(null)}),Rr=function(t){o[r][t]=!0}}!function(){if(Cr)return kr;Cr=1;var t=Ne(),n=function(){if(Mr)return Ar;Mr=1;var t=Fr(),n=pt(),e=vt(),r=rn(),o=he(),i=zr(),u=n([].push),c=function(n){var c=1===n,f=2===n,a=3===n,l=4===n,s=6===n,p=7===n,d=5===n||s;return function(v,h,m,y){for(var g,b,w=r(v),E=e(w),O=o(E),x=t(h,m),S=0,j=y||i,T=c?j(v,O):f||p?j(v,0):void 0;O>S;S++)if((d||S in E)&&(b=x(g=E[S],S,w),n))if(c)T[S]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return S;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:a||l?l:T}};return Ar={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}}().find,e=Br(),r="find",o=!0;r in[]&&Array(1)[r](function(){o=!1}),t({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),e(r)}();var $r,Vr,Wr,qr,Ur,Kr,Gr,Xr,Yr,Qr,Jr,Zr,to,no={};function eo(){if(Vr)return $r;Vr=1;var t=Ue(),n=String;return $r=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function ro(){if(qr)return Wr;qr=1;var t=On();return Wr=function(){var n=t(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e}}function oo(){if(Zr)return Jr;Zr=1;var t,n,e=O(),r=pt(),o=eo(),i=ro(),u=function(){if(Kr)return Ur;Kr=1;var t=b(),n=a().RegExp,e=t(function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),r=e||t(function(){return!n("a","y").sticky}),o=e||t(function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")});return Ur={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=en(),f=gr(),l=qn().get,s=function(){if(Xr)return Gr;Xr=1;var t=b(),n=a().RegExp;return Gr=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),p=function(){if(Qr)return Yr;Qr=1;var t=b(),n=a().RegExp;return Yr=t(function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})}(),d=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,h=v,m=r("".charAt),y=r("".indexOf),g=r("".replace),w=r("".slice),E=(n=/b*/g,e(v,t=/a/,"a"),e(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),x=u.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];return(E||S||x||s||p)&&(h=function(t){var n,r,u,c,a,s,p,b=this,O=l(b),j=o(t),T=O.raw;if(T)return T.lastIndex=b.lastIndex,n=e(h,T,j),b.lastIndex=T.lastIndex,n;var L=O.groups,P=x&&b.sticky,I=e(i,b),A=b.source,M=0,R=j;if(P&&(I=g(I,"y",""),-1===y(I,"g")&&(I+="g"),R=w(j,b.lastIndex),b.lastIndex>0&&(!b.multiline||b.multiline&&"\n"!==m(j,b.lastIndex-1))&&(A="(?: "+A+")",R=" "+R,M++),r=new RegExp("^(?:"+A+")",I)),S&&(r=new RegExp("^"+A+"$(?!\\s)",I)),E&&(u=b.lastIndex),c=e(v,P?r:b,R),P?c?(c.input=w(c.input,M),c[0]=w(c[0],M),c.index=b.lastIndex,b.lastIndex+=c[0].length):b.lastIndex=0:E&&c&&(b.lastIndex=b.global?c.index+c[0].length:u),S&&c&&c.length>1&&e(d,c[0],r,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(c[a]=void 0)}),c&&L)for(c.groups=s=f(null),a=0;a<L.length;a++)s[(p=L[a])[0]]=c[p[1]];return c}),Jr=h}!function(){if(to)return no;to=1;var t=Ne(),n=oo();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var io,uo,co,fo,ao,lo,so,po={};function vo(){return uo?io:(uo=1,io="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(so)return po;so=1;var t=Ne(),n=function(){if(fo)return co;fo=1;var t=pt(),n=mt(),e=eo(),r=vo(),o=t("".replace),i=RegExp("^["+r+"]+"),u=RegExp("(^|[^"+r+"])["+r+"]+$"),c=function(t){return function(r){var c=e(n(r));return 1&t&&(c=o(c,i,"")),2&t&&(c=o(c,u,"$1")),c}};return co={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(lo)return ao;lo=1;var t=Bn().PROPER,n=b(),e=vo();return ao=function(r){return n(function(){return!!e[r]()||"​…᠎"!=="​…᠎"[r]()||t&&e[r].name!==r})}}();t({target:"String",proto:!0,forced:e("trim")},{trim:function(){return n(this)}})}();var ho,mo,yo={};function go(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function bo(t={},n={}){Object.keys(n).forEach(e=>{void 0===t[e]?t[e]=n[e]:go(n[e])&&go(t[e])&&Object.keys(n[e]).length>0&&bo(t[e],n[e])})}mo||(mo=1,function(){if(ho)return yo;ho=1;var t=Ne(),n=a();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const wo={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Eo(){const t="undefined"!=typeof document?document:{};return bo(t,wo),t}const Oo={document:wo,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:t=>"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0),cancelAnimationFrame(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function xo(){const t="undefined"!=typeof window?window:{};return bo(t,Oo),t}class So extends Array{constructor(t){"number"==typeof t?super(t):(super(...t||[]),function(t){const n=t.__proto__;Object.defineProperty(t,"__proto__",{get:()=>n,set(t){n.__proto__=t}})}(this))}}function jo(t,n){const e=xo(),r=Eo();let o=[];if(!n&&t instanceof So)return t;if(!t)return new So(o);if("string"==typeof t){const e=t.trim();if(e.indexOf("<")>=0&&e.indexOf(">")>=0){let t="div";0===e.indexOf("<li")&&(t="ul"),0===e.indexOf("<tr")&&(t="tbody"),0!==e.indexOf("<td")&&0!==e.indexOf("<th")||(t="tr"),0===e.indexOf("<tbody")&&(t="table"),0===e.indexOf("<option")&&(t="select");const n=r.createElement(t);n.innerHTML=e;for(let t=0;t<n.childNodes.length;t+=1)o.push(n.childNodes[t])}else o=function(t,n){if("string"!=typeof t)return[t];const e=[],r=n.querySelectorAll(t);for(let t=0;t<r.length;t+=1)e.push(r[t]);return e}(t.trim(),n||r)}else if(t.nodeType||t===e||t===r)o.push(t);else if(Array.isArray(t)){if(t instanceof So)return t;o=t}return new So(function(t){const n=[];for(let e=0;e<t.length;e+=1)-1===n.indexOf(t[e])&&n.push(t[e]);return n}(o))}function To(t){if(void 0===t){const t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){const n=[];for(let e=0;e<t.selectedOptions.length;e+=1)n.push(t.selectedOptions[e].value);return n}return t.value}for(let n=0;n<this.length;n+=1){const e=this[n];if(Array.isArray(t)&&e.multiple&&"select"===e.nodeName.toLowerCase())for(let n=0;n<e.options.length;n+=1)e.options[n].selected=t.indexOf(e.options[n].value)>=0;else e.value=t}return this}function Lo(...t){let[n,e,r,o]=t;function i(t){const n=t.target;if(!n)return;const o=t.target.dom7EventData||[];if(o.indexOf(t)<0&&o.unshift(t),jo(n).is(e))r.apply(n,o);else{const t=jo(n).parents();for(let n=0;n<t.length;n+=1)jo(t[n]).is(e)&&r.apply(t[n],o)}}function u(t){const n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),r.apply(this,n)}"function"==typeof t[1]&&([n,r,o]=t,e=void 0),o||(o=!1);const c=n.split(" ");let f;for(let t=0;t<this.length;t+=1){const n=this[t];if(e)for(f=0;f<c.length;f+=1){const t=c[f];n.dom7LiveListeners||(n.dom7LiveListeners={}),n.dom7LiveListeners[t]||(n.dom7LiveListeners[t]=[]),n.dom7LiveListeners[t].push({listener:r,proxyListener:i}),n.addEventListener(t,i,o)}else for(f=0;f<c.length;f+=1){const t=c[f];n.dom7Listeners||(n.dom7Listeners={}),n.dom7Listeners[t]||(n.dom7Listeners[t]=[]),n.dom7Listeners[t].push({listener:r,proxyListener:u}),n.addEventListener(t,u,o)}}return this}function Po(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(let n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function Io(t){const n=xo(),e=Eo(),r=this[0];let o,i;if(!r||void 0===t)return!1;if("string"==typeof t){if(r.matches)return r.matches(t);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(r.msMatchesSelector)return r.msMatchesSelector(t);for(o=jo(t),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(t===e)return r===e;if(t===n)return r===n;if(t.nodeType||t instanceof So){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function Ao(...t){let n;const e=Eo();for(let r=0;r<t.length;r+=1){n=t[r];for(let t=0;t<this.length;t+=1)if("string"==typeof n){const r=e.createElement("div");for(r.innerHTML=n;r.firstChild;)this[t].appendChild(r.firstChild)}else if(n instanceof So)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Mo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?jo(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return jo(n)}function Ro(t){const n=[];for(let e=0;e<this.length;e+=1){const r=this[e].querySelectorAll(t);for(let t=0;t<r.length;t+=1)n.push(r[t])}return jo(n)}jo.fn=So.prototype;const _o="resize scroll".split(" ");const Co=(No="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)_o.indexOf(No)<0&&(No in this[t]?this[t][No]():jo(this[t]).trigger(No));return this}return this.on(No,...t)});var No;Ao&&(jo.fn.append=Ao),Po&&(jo.fn.html=Po),To&&(jo.fn.val=To),Lo&&(jo.fn.on=Lo),Co&&(jo.fn.focus=Co),Io&&(jo.fn.is=Io),Mo&&(jo.fn.parents=Mo),Ro&&(jo.fn.find=Ro);var ko,Fo,Do,Ho,zo,Bo,$o,Vo={};function Wo(){if(Fo)return ko;Fo=1;var t=TypeError;return ko=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function qo(){if(Ho)return Do;Ho=1;var t=w(),n=xn(),e=st();return Do=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Uo(){if(Bo)return zo;Bo=1;var t=b(),n=cn(),e=Et(),r=n("species");return zo=function(n){return e>=51||!t(function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if($o)return Vo;$o=1;var t=Ne(),n=b(),e=Dr(),r=bt(),o=rn(),i=he(),u=Wo(),c=qo(),f=zr(),a=Uo(),l=cn(),s=Et(),p=l("isConcatSpreadable"),d=s>=51||!n(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),v=function(t){if(!r(t))return!1;var n=t[p];return void 0!==n?!!n:e(t)};t({target:"Array",proto:!0,arity:1,forced:!d||!a("concat")},{concat:function(t){var n,e,r,a,l,s=o(this),p=f(s,0),d=0;for(n=-1,r=arguments.length;n<r;n++)if(v(l=-1===n?s:arguments[n]))for(a=i(l),u(d+a),e=0;e<a;e++,d++)e in l&&c(p,d,l[e]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();function Ko(t){return"".concat(t,"-").concat(((t=21)=>{let n="",e=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&e[t]];return n})())}function Go(){return Ko("w-e-insert-formula")}var Xo=function(){function t(){this.title=n.t("formula.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=Go(),this.buttonId=Go()}return t.prototype.getSelectedElem=function(t){var e=n.DomEditor.getSelectedNodeByType(t,"formula");return null==e?null:e},t.prototype.getValue=function(t){var n=this.getSelectedElem(t);return n&&n.value||""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var e=t.selection;return null==e||(!!n.SlateRange.isExpanded(e)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],f=jo(u[1]),a=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=jo("<div></div>");l.on("click","#".concat(i),function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.updateFormula(t,o),t.hidePanelOrModal()}),this.$content=l}var s=this.$content;s.html(""),s.append(c),s.append(a);var p=this.getValue(t);return f.val(p),setTimeout(function(){f.focus()}),s[0]},t.prototype.updateFormula=function(t,e){if(e&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var o=n.DomEditor.findPath(t,r),i={value:e};n.SlateTransforms.setNodes(t,i,{at:o})}}},t}();function Yo(){return Ko("w-e-insert-formula")}var Qo=function(){function t(){this.title=n.t("formula.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=Yo(),this.buttonId=Yo()}return t.prototype.getValue=function(t){return""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var e=t.selection;if(null==e)return!0;if(n.SlateRange.isExpanded(e))return!0;var r=n.DomEditor.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!!r.some(function(t){return"pre"===n.DomEditor.getNodeType(t)})},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],f=jo(u[1]),a=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=jo("<div></div>");l.on("click","#".concat(i),function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.insertFormula(t,o),t.hidePanelOrModal()}),this.$content=l}var s=this.$content;return s.html(""),s.append(c),s.append(a),f.val(""),setTimeout(function(){f.focus()}),s[0]},t.prototype.insertFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var e={type:"formula",value:n,children:[{text:""}]};t.insertNode(e)}},t}();return{editorPlugin:function(t){var e=t.isInline,r=t.isVoid,o=t;return o.isInline=function(t){return"formula"===n.DomEditor.getNodeType(t)||e(t)},o.isVoid=function(t){return"formula"===n.DomEditor.getNodeType(t)||r(t)},o},renderElems:[{type:"formula",renderElem:function(t,r,o){var i=n.DomEditor.isNodeSelected(o,t),u=t.value,c=void 0===u?"":u,f=e.h("w-e-formula-card",{dataset:{value:c}},null);return e.h("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:i?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[f])}}],elemsToHtml:[Nr],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,n,e){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new Qo}},{key:"editFormula",factory:function(){return new Xo}}]}});
2
2
  //# sourceMappingURL=index.js.map