@wangeditor-next/plugin-formula 1.0.36 → 1.0.38
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/README.md +2 -2
- package/dist/core/src/editor/dom-editor.d.ts +1 -0
- package/dist/core/src/editor/interface.d.ts +4 -1
- package/dist/core/src/render/text/renderText.d.ts +1 -1
- package/dist/core/src/text-area/TextArea.d.ts +3 -0
- package/dist/core/src/text-area/helpers.d.ts +7 -3
- package/dist/core/src/utils/weak-maps.d.ts +2 -0
- package/dist/editor/src/register-builtin-modules/index.d.ts +1 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -94,6 +94,7 @@ export declare const DomEditor: {
|
|
|
94
94
|
toSlatePoint<T extends boolean>(editor: IDomEditor, domPoint: DOMPoint, options: {
|
|
95
95
|
exactMatch: T;
|
|
96
96
|
suppressThrow: T;
|
|
97
|
+
searchDirection?: "forward" | "backward";
|
|
97
98
|
}): T extends true ? Point | null : Point;
|
|
98
99
|
hasRange(editor: IDomEditor, range: Range): boolean;
|
|
99
100
|
getNodeType(node: Node): string;
|
|
@@ -11,6 +11,7 @@ import { DOMElement } from '../utils/dom';
|
|
|
11
11
|
export type ElementWithId = Element & {
|
|
12
12
|
id: string;
|
|
13
13
|
};
|
|
14
|
+
type MoveOptions = Parameters<Editor['move']>[0];
|
|
14
15
|
export type getMenuConfigReturnType<K> = K extends keyof IMenuConfig ? IMenuConfig[K] : ISingleMenuConfig;
|
|
15
16
|
/**
|
|
16
17
|
* 扩展 slate Editor 接口
|
|
@@ -53,7 +54,8 @@ export interface IDomEditor extends Editor {
|
|
|
53
54
|
getEditableContainer: () => DOMElement;
|
|
54
55
|
select: (at: Location) => void;
|
|
55
56
|
deselect: () => void;
|
|
56
|
-
move
|
|
57
|
+
move(options?: MoveOptions): void;
|
|
58
|
+
move(distance: number, reverse?: boolean): void;
|
|
57
59
|
moveReverse: (distance: number) => void;
|
|
58
60
|
restoreSelection: () => void;
|
|
59
61
|
getTableSelection?: () => NodeEntryWithContext[][] | null;
|
|
@@ -68,3 +70,4 @@ export interface IDomEditor extends Editor {
|
|
|
68
70
|
undo?: () => void;
|
|
69
71
|
redo?: () => void;
|
|
70
72
|
}
|
|
73
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description render text node
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { Text as SlateText
|
|
5
|
+
import { Ancestor, Text as SlateText } from 'slate';
|
|
6
6
|
import { VNode } from 'snabbdom';
|
|
7
7
|
import { IDomEditor } from '../../editor/interface';
|
|
8
8
|
declare function renderText(textNode: SlateText, parent: Ancestor, editor: IDomEditor): VNode;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Dom7Array, DOMElement } from '../utils/dom';
|
|
6
6
|
declare class TextArea {
|
|
7
|
+
private selectionChangeRoot;
|
|
7
8
|
readonly id: number;
|
|
8
9
|
$box: Dom7Array;
|
|
9
10
|
$textAreaContainer: Dom7Array;
|
|
@@ -20,7 +21,9 @@ declare class TextArea {
|
|
|
20
21
|
private latestEditorSelection;
|
|
21
22
|
constructor(boxSelector: string | DOMElement);
|
|
22
23
|
private get editorInstance();
|
|
24
|
+
private bindSelectionChange;
|
|
23
25
|
private onDOMSelectionChange;
|
|
26
|
+
flushDOMSelectionChange(): void;
|
|
24
27
|
/**
|
|
25
28
|
* 绑定事件,如 beforeinput onblur onfocus keydown click copy/paste drag/drop 等
|
|
26
29
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @description textarea helper fns
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { DOMRange, DOMNode } from '../utils/dom';
|
|
6
5
|
import { IDomEditor } from '../editor/interface';
|
|
6
|
+
import { DOMNode, DOMRange } from '../utils/dom';
|
|
7
7
|
/**
|
|
8
8
|
* Check if two DOM range objects are equal.
|
|
9
9
|
*/
|
|
@@ -12,14 +12,18 @@ export declare const isRangeEqual: (a: DOMRange, b: DOMRange) => boolean;
|
|
|
12
12
|
* Check if the target is editable and in the editor.
|
|
13
13
|
*/
|
|
14
14
|
export declare function hasEditableTarget(editor: IDomEditor, target: EventTarget | null): target is DOMNode;
|
|
15
|
+
/**
|
|
16
|
+
* Check if the target is in the editor.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hasTarget(editor: IDomEditor, target: EventTarget | null): target is DOMNode;
|
|
15
19
|
/**
|
|
16
20
|
* Check if the target is inside void and in an non-readonly editor.
|
|
17
21
|
*/
|
|
18
22
|
export declare function isTargetInsideNonReadonlyVoid(editor: IDomEditor, target: EventTarget | null): boolean;
|
|
19
23
|
/**
|
|
20
|
-
* Check if the target
|
|
24
|
+
* Check if the target can participate in editor selection.
|
|
21
25
|
*/
|
|
22
|
-
export declare function
|
|
26
|
+
export declare function hasSelectableTarget(editor: IDomEditor, target: EventTarget | null): boolean;
|
|
23
27
|
/**
|
|
24
28
|
* Check if a DOM event is overrode by a handler.
|
|
25
29
|
*/
|
|
@@ -56,3 +56,5 @@ export declare const CHANGING_NODE_PATH: WeakMap<Editor, Path>;
|
|
|
56
56
|
export declare const EDITOR_TO_SELECTION: WeakMap<Editor, Range>;
|
|
57
57
|
export declare const EDITOR_TO_EMITTER: WeakMap<Editor, Emitter>;
|
|
58
58
|
export declare const EDITOR_TO_CAN_PASTE: WeakMap<Editor, boolean>;
|
|
59
|
+
export declare const EDITOR_TO_PENDING_COMPOSITION_END: WeakMap<Editor, boolean>;
|
|
60
|
+
export declare const EDITOR_TO_PENDING_SELECTION: WeakMap<Editor, Range | null>;
|
|
@@ -2,9 +2,4 @@
|
|
|
2
2
|
* @description register builtin modules
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import '@wangeditor-next/list-module/dist/css/style.css';
|
|
7
|
-
import '@wangeditor-next/table-module/dist/css/style.css';
|
|
8
|
-
import '@wangeditor-next/video-module/dist/css/style.css';
|
|
9
|
-
import '@wangeditor-next/upload-image-module/dist/css/style.css';
|
|
10
|
-
import '@wangeditor-next/code-highlight/dist/css/style.css';
|
|
5
|
+
export {};
|
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:{},a={};function f(){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,b,w,E,x,O,S,j,T,L,P,A,I,M,C,R,k,N,_,F,D,H,z,$,B,V,q,W,U,G={exports:{}};function K(){if(d)return p;d=1;var t=f(),n=Object.defineProperty;return p=function(e,r){try{n(t,e,{value:r,configurable:!0,writable:!0})}catch(n){t[e]=r}return r}}function X(){if(v)return G.exports;v=1;var t=s?l:(s=1,l=!1),n=f(),e=K(),r="__core-js_shared__",o=G.exports=n[r]||e(r,{});return(o.versions||(o.versions=[])).push({version:"3.48.0",mode:t?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"}),G.exports}function Y(){if(m)return h;m=1;var t=X();return h=function(n,e){return t[n]||(t[n]=e||{})}}function J(){return g?y:(g=1,y=function(t){try{return!!t()}catch(t){return!0}})}function Q(){if(w)return b;w=1;var t=J();return b=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function Z(){if(x)return E;x=1;var t=Q(),n=Function.prototype,e=n.call,r=t&&n.bind.bind(e,e);return E=t?r:function(t){return function(){return e.apply(t,arguments)}},E}function tt(){return S?O:(S=1,O=function(t){return null==t})}function nt(){if(T)return j;T=1;var t=tt(),n=TypeError;return j=function(e){if(t(e))throw new n("Can't call method on "+e);return e}}function et(){if(P)return L;P=1;var t=nt(),n=Object;return L=function(e){return n(t(e))}}function rt(){if(I)return A;I=1;var t=Z(),n=et(),e=t({}.hasOwnProperty);return A=Object.hasOwn||function(t,r){return e(n(t),r)}}function ot(){if(C)return M;C=1;var t=Z(),n=0,e=Math.random(),r=t(1.1.toString);return M=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++n+e,36)}}function it(){if(_)return N;_=1;var t,n,e=f(),r=function(){if(k)return R;k=1;var t=f().navigator,n=t&&t.userAgent;return R=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]),N=n}function ut(){if(D)return F;D=1;var t=it(),n=J(),e=f().String;return F=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!e(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function ct(){if(z)return H;z=1;var t=ut();return H=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function at(){if(B)return $;B=1;var t=f(),n=Y(),e=rt(),r=ot(),o=ut(),i=ct(),u=t.Symbol,c=n("wks"),a=i?u.for||u:u&&u.withoutSetter||r;return $=function(t){return e(c,t)||(c[t]=o&&e(u,t)?u[t]:a("Symbol."+t)),c[t]}}function ft(){if(q)return V;q=1;var t={};return t[at()("toStringTag")]="z",V="[object z]"===String(t)}function lt(){if(U)return W;U=1;var t="object"==typeof document&&document.all;return W=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var st,pt,dt,vt,ht,mt,yt,gt,bt,wt,Et,xt,Ot,St,jt,Tt,Lt,Pt,At,It,Mt,Ct,Rt,kt,Nt,_t,Ft,Dt,Ht,zt,$t,Bt,Vt,qt={};function Wt(){if(pt)return st;pt=1;var t=J();return st=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Ut(){if(vt)return dt;vt=1;var t=lt();return dt=function(n){return"object"==typeof n?null!==n:t(n)}}function Gt(){if(mt)return ht;mt=1;var t=f(),n=Ut(),e=t.document,r=n(e)&&n(e.createElement);return ht=function(t){return r?e.createElement(t):{}}}function Kt(){if(gt)return yt;gt=1;var t=Wt(),n=J(),e=Gt();return yt=!t&&!n(function(){return 7!==Object.defineProperty(e("div"),"a",{get:function(){return 7}}).a})}function Xt(){if(wt)return bt;wt=1;var t=Wt(),n=J();return bt=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Yt(){if(xt)return Et;xt=1;var t=Ut(),n=String,e=TypeError;return Et=function(r){if(t(r))return r;throw new e(n(r)+" is not an object")}}function Jt(){if(St)return Ot;St=1;var t=Q(),n=Function.prototype.call;return Ot=t?n.bind(n):function(){return n.apply(n,arguments)},Ot}function Qt(){if(Tt)return jt;Tt=1;var t=f(),n=lt();return jt=function(e,r){return arguments.length<2?(o=t[e],n(o)?o:void 0):t[e]&&t[e][r];var o},jt}function Zt(){if(It)return At;It=1;var t=Qt(),n=lt(),e=function(){if(Pt)return Lt;Pt=1;var t=Z();return Lt=t({}.isPrototypeOf)}(),r=ct(),o=Object;return At=r?function(t){return"symbol"==typeof t}:function(r){var i=t("Symbol");return n(i)&&e(i.prototype,o(r))}}function tn(){if(Ct)return Mt;Ct=1;var t=String;return Mt=function(n){try{return t(n)}catch(t){return"Object"}}}function nn(){if(kt)return Rt;kt=1;var t=lt(),n=tn(),e=TypeError;return Rt=function(r){if(t(r))return r;throw new e(n(r)+" is not a function")}}function en(){if(_t)return Nt;_t=1;var t=nn(),n=tt();return Nt=function(e,r){var o=e[r];return n(o)?void 0:t(o)}}function rn(){if(Dt)return Ft;Dt=1;var t=Jt(),n=lt(),e=Ut(),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}function on(){if(zt)return Ht;zt=1;var t=Jt(),n=Ut(),e=Zt(),r=en(),o=rn(),i=at(),u=TypeError,c=i("toPrimitive");return Ht=function(i,a){if(!n(i)||e(i))return i;var f,l=r(i,c);if(l){if(void 0===a&&(a="default"),f=t(l,i,a),!n(f)||e(f))return f;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),o(i,a)}}function un(){if(Bt)return $t;Bt=1;var t=on(),n=Zt();return $t=function(e){var r=t(e,"string");return n(r)?r:r+""}}function cn(){if(Vt)return qt;Vt=1;var t=Wt(),n=Kt(),e=Xt(),r=Yt(),o=un(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,a="enumerable",f="configurable",l="writable";return qt.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:f in e?e[f]:i[f],enumerable:a in e?e[a]:i[a],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},qt}var an,fn,ln,sn,pn,dn,vn,hn,mn,yn,gn,bn,wn,En,xn,On,Sn,jn,Tn,Ln,Pn,An,In,Mn,Cn,Rn,kn={exports:{}};function Nn(){if(fn)return an;fn=1;var t=Wt(),n=rt(),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 an={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function _n(){if(sn)return ln;sn=1;var t=Z(),n=lt(),e=X(),r=t(Function.toString);return n(e.inspectSource)||(e.inspectSource=function(t){return r(t)}),ln=e.inspectSource}function Fn(){return hn?vn:(hn=1,vn=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Dn(){if(yn)return mn;yn=1;var t=Wt(),n=cn(),e=Fn();return mn=t?function(t,r,o){return n.f(t,r,e(1,o))}:function(t,n,e){return t[n]=e,t}}function Hn(){if(bn)return gn;bn=1;var t=Y(),n=ot(),e=t("keys");return gn=function(t){return e[t]||(e[t]=n(t))}}function zn(){return En?wn:(En=1,wn={})}function $n(){if(On)return xn;On=1;var t,n,e,r=function(){if(dn)return pn;dn=1;var t=f(),n=lt(),e=t.WeakMap;return pn=n(e)&&/native code/.test(String(e))}(),o=f(),i=Ut(),u=Dn(),c=rt(),a=X(),l=Hn(),s=zn(),p="Object already initialized",d=o.TypeError,v=o.WeakMap;if(r||a.state){var h=a.state||(a.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 xn={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 Bn(){if(Sn)return kn.exports;Sn=1;var t=Z(),n=J(),e=lt(),r=rt(),o=Wt(),i=Nn().CONFIGURABLE,u=_n(),c=$n(),a=c.enforce,f=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=kn.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=a(t);return r(u,"source")||(u.source=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return e(this)&&f(this).source||u(this)},"toString"),kn.exports}function Vn(){if(Tn)return jn;Tn=1;var t=lt(),n=cn(),e=Bn(),r=K();return jn=function(o,i,u,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:i;if(t(u)&&e(u,f,c),c.global)a?o[i]=u:r(i,u);else{try{c.unsafe?o[i]&&(a=!0):delete o[i]}catch(t){}a?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}function qn(){if(Pn)return Ln;Pn=1;var t=Z(),n=t({}.toString),e=t("".slice);return Ln=function(t){return e(n(t),8,-1)}}function Wn(){if(In)return An;In=1;var t=ft(),n=lt(),e=qn(),r=at()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return An=t?e:function(t){var u,c,a;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"===(a=e(u))&&n(u.callee)?"Arguments":a}}!function(){if(Rn)return a;Rn=1;var t=ft(),n=Vn(),e=function(){if(Cn)return Mn;Cn=1;var t=ft(),n=Wn();return Mn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",e,{unsafe:!0})}();var Un,Gn,Kn,Xn,Yn,Jn,Qn={},Zn={},te={};function ne(){if(Kn)return Gn;Kn=1;var t=Z(),n=J(),e=qn(),r=Object,o=t("".split);return Gn=n(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===e(t)?o(t,""):r(t)}:r}function ee(){if(Yn)return Xn;Yn=1;var t=ne(),n=nt();return Xn=function(e){return t(n(e))}}function re(){if(Jn)return Zn;Jn=1;var t=Wt(),n=Jt(),e=function(){if(Un)return te;Un=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,e=n&&!t.call({1:2},1);return te.f=e?function(t){var e=n(this,t);return!!e&&e.enumerable}:t,te}(),r=Fn(),o=ee(),i=un(),u=rt(),c=Kt(),a=Object.getOwnPropertyDescriptor;return Zn.f=t?a:function(t,f){if(t=o(t),f=i(f),c)try{return a(t,f)}catch(t){}if(u(t,f))return r(!n(e.f,t,f),t[f])},Zn}var oe,ie,ue,ce,ae,fe,le,se,pe,de,ve,he,me,ye,ge,be,we,Ee={};function xe(){if(ce)return ue;ce=1;var t=function(){if(ie)return oe;ie=1;var t=Math.ceil,n=Math.floor;return oe=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}}();return ue=function(n){var e=+n;return e!=e||0===e?0:t(e)}}function Oe(){if(fe)return ae;fe=1;var t=xe(),n=Math.max,e=Math.min;return ae=function(r,o){var i=t(r);return i<0?n(i+o,0):e(i,o)}}function Se(){if(se)return le;se=1;var t=xe(),n=Math.min;return le=function(e){var r=t(e);return r>0?n(r,9007199254740991):0}}function je(){if(de)return pe;de=1;var t=Se();return pe=function(n){return t(n.length)}}function Te(){if(ye)return me;ye=1;var t=Z(),n=rt(),e=ee(),r=function(){if(he)return ve;he=1;var t=ee(),n=Oe(),e=je(),r=function(r){return function(o,i,u){var c=t(o),a=e(c);if(0===a)return!r&&-1;var f,l=n(u,a);if(r&&i!=i){for(;a>l;)if((f=c[l++])!=f)return!0}else for(;a>l;l++)if((r||l in c)&&c[l]===i)return r||l||0;return!r&&-1}};return ve={includes:r(!0),indexOf:r(!1)}}().indexOf,o=zn(),i=t([].push);return me=function(t,u){var c,a=e(t),f=0,l=[];for(c in a)!n(o,c)&&n(a,c)&&i(l,c);for(;u.length>f;)n(a,c=u[f++])&&(~r(l,c)||i(l,c));return l}}function Le(){return be?ge:(be=1,ge=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Pe,Ae,Ie,Me,Ce,Re,ke,Ne,_e,Fe,De,He,ze,$e,Be,Ve,qe,We,Ue,Ge={};function Ke(){if(Ie)return Ae;Ie=1;var t=Qt(),n=Z(),e=function(){if(we)return Ee;we=1;var t=Te(),n=Le().concat("length","prototype");return Ee.f=Object.getOwnPropertyNames||function(e){return t(e,n)},Ee}(),r=(Pe||(Pe=1,Ge.f=Object.getOwnPropertySymbols),Ge),o=Yt(),i=n([].concat);return Ae=t("Reflect","ownKeys")||function(t){var n=e.f(o(t)),u=r.f;return u?i(n,u(t)):n}}function Xe(){if(Ce)return Me;Ce=1;var t=rt(),n=Ke(),e=re(),r=cn();return Me=function(o,i,u){for(var c=n(i),a=r.f,f=e.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||a(o,s,f(i,s))}}}function Ye(){if(_e)return Ne;_e=1;var t=f(),n=re().f,e=Dn(),r=Vn(),o=K(),i=Xe(),u=function(){if(ke)return Re;ke=1;var t=J(),n=lt(),e=/#|\.prototype\./,r=function(e,r){var a=i[o(e)];return a===c||a!==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 Re=r}();return Ne=function(c,a){var f,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(f=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in a){if(p=a[l],s=c.dontCallGetSet?(d=n(f,l))&&d.value:f[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(f,l,p,c)}}}function Je(){if(ze)return He;ze=1;var t=Z();return He=t([].slice)}function Qe(){if(Be)return $e;Be=1;var t=Z(),n=nn(),e=Ut(),r=rt(),o=Je(),i=Q(),u=Function,c=t([].concat),a=t([].join),f={};return $e=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(f,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";f[n]=u("C,a","return new C("+a(o,",")+")")}return f[n](t,e)}(i,n.length,n):i.apply(t,n)};return e(l)&&(p.prototype=l),p},$e}function Ze(){if(qe)return Ve;qe=1;var t=Z(),n=J(),e=lt(),r=Wn(),o=Qt(),i=_n(),u=function(){},c=o("Reflect","construct"),a=/^\s*(?:class|function)\b/,f=t(a.exec),l=!a.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||!!f(a,i(t))}catch(t){return!0}};return p.sham=!0,Ve=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function tr(){if(Ue)return We;Ue=1;var t=Ze(),n=tn(),e=TypeError;return We=function(r){if(t(r))return r;throw new e(n(r)+" is not a constructor")}}var nr,er,rr,or,ir,ur,cr,ar,fr={};function lr(){if(er)return nr;er=1;var t=Te(),n=Le();return nr=Object.keys||function(e){return t(e,n)}}function sr(){if(cr)return ur;cr=1;var t,n=Yt(),e=function(){if(rr)return fr;rr=1;var t=Wt(),n=Xt(),e=cn(),r=Yt(),o=ee(),i=lr();return fr.f=t&&!n?Object.defineProperties:function(t,n){r(t);for(var u,c=o(n),a=i(n),f=a.length,l=0;f>l;)e.f(t,u=a[l++],c[u]);return t},fr}(),r=Le(),o=zn(),i=function(){if(ir)return or;ir=1;var t=Qt();return or=t("document","documentElement")}(),u=Gt(),c=Hn(),a="prototype",f="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+f+">"+t+"</"+f+">"},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"+f+":",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[a][r[c]];return v()};return o[l]=!0,ur=Object.create||function(t,r){var o;return null!==t?(s[a]=n(t),o=new s,s[a]=null,o[l]=t):o=v(),void 0===r?o:e.f(o,r)}}!function(){if(ar)return Qn;ar=1;var t=Ye(),n=Qt(),e=function(){if(De)return Fe;De=1;var t=Q(),n=Function.prototype,e=n.apply,r=n.call;return Fe="object"==typeof Reflect&&Reflect.apply||(t?r.bind(e):function(){return r.apply(e,arguments)}),Fe}(),r=Qe(),o=tr(),i=Yt(),u=Ut(),c=sr(),a=J(),f=n("Reflect","construct"),l=Object.prototype,s=[].push,p=a(function(){function t(){}return!(f(function(){},[],t)instanceof t)}),d=!a(function(){f(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var a=arguments.length<3?t:o(arguments[2]);if(d&&!p)return f(t,n,a);if(t===a){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=a.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){var t=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 pr=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",pr),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 dr,vr,hr,mr,yr,gr,br,wr,Er,xr,Or,Sr,jr,Tr,Lr,Pr,Ar,Ir={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>')}},Mr={};function Cr(){if(mr)return hr;mr=1;var t=function(){if(vr)return dr;vr=1;var t=qn(),n=Z();return dr=function(e){if("Function"===t(e))return n(e)}}(),n=nn(),e=Q(),r=t(t.bind);return hr=function(t,o){return n(t),void 0===o?t:e?r(t,o):function(){return t.apply(o,arguments)}},hr}function Rr(){if(gr)return yr;gr=1;var t=qn();return yr=Array.isArray||function(n){return"Array"===t(n)}}function kr(){if(wr)return br;wr=1;var t=Rr(),n=Ze(),e=Ut(),r=at()("species"),o=Array;return br=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 Nr(){if(xr)return Er;xr=1;var t=kr();return Er=function(n,e){return new(t(n))(0===e?0:e)}}function _r(){if(Sr)return Or;Sr=1;var t=Wt(),n=cn(),e=Fn();return Or=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Fr(){if(Pr)return Lr;Pr=1;var t=at(),n=sr(),e=cn().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&e(o,r,{configurable:!0,value:n(null)}),Lr=function(t){o[r][t]=!0}}!function(){if(Ar)return Mr;Ar=1;var t=Ye(),n=function(){if(Tr)return jr;Tr=1;var t=Cr(),n=ne(),e=et(),r=je(),o=Nr(),i=_r(),u=function(u){var c=1===u,a=2===u,f=3===u,l=4===u,s=6===u,p=7===u,d=5===u||s;return function(v,h,m){for(var y,g,b=e(v),w=n(b),E=r(w),x=t(h,m),O=0,S=0,j=c?o(v,E):a||p?o(v,0):void 0;E>O;O++)if((d||O in w)&&(g=x(y=w[O],O,b),u))if(c)i(j,O,g);else if(g)switch(u){case 3:return!0;case 5:return y;case 6:return O;case 2:i(j,S++,y)}else switch(u){case 4:return!1;case 7:i(j,S++,y)}return s?-1:f||l?l:j}};return jr={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}}().find,e=Fr(),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 Dr,Hr,zr,$r,Br,Vr,qr,Wr,Ur,Gr,Kr,Xr,Yr,Jr={};function Qr(){if(Hr)return Dr;Hr=1;var t=Wn(),n=String;return Dr=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Zr(){if($r)return zr;$r=1;var t=Yt();return zr=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 to(){if(Xr)return Kr;Xr=1;var t,n,e=Jt(),r=Z(),o=Qr(),i=Zr(),u=function(){if(Vr)return Br;Vr=1;var t=J(),n=f().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 Br={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=Y(),a=sr(),l=$n().get,s=function(){if(Wr)return qr;Wr=1;var t=J(),n=f().RegExp;return qr=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),p=function(){if(Gr)return Ur;Gr=1;var t=J(),n=f().RegExp;return Ur=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),b=r("".slice),w=(n=/b*/g,e(v,t=/a/,"a"),e(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),E=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(w||x||E||s||p)&&(h=function(t){var n,r,u,c,f,s,p,O=this,S=l(O),j=o(t),T=S.raw;if(T)return T.lastIndex=O.lastIndex,n=e(h,T,j),O.lastIndex=T.lastIndex,n;var L=S.groups,P=E&&O.sticky,A=e(i,O),I=O.source,M=0,C=j;if(P&&(A=g(A,"y",""),-1===y(A,"g")&&(A+="g"),C=b(j,O.lastIndex),O.lastIndex>0&&(!O.multiline||O.multiline&&"\n"!==m(j,O.lastIndex-1))&&(I="(?: "+I+")",C=" "+C,M++),r=new RegExp("^(?:"+I+")",A)),x&&(r=new RegExp("^"+I+"$(?!\\s)",A)),w&&(u=O.lastIndex),c=e(v,P?r:O,C),P?c?(c.input=b(c.input,M),c[0]=b(c[0],M),c.index=O.lastIndex,O.lastIndex+=c[0].length):O.lastIndex=0:w&&c&&(O.lastIndex=O.global?c.index+c[0].length:u),x&&c&&c.length>1&&e(d,c[0],r,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(c[f]=void 0)}),c&&L)for(c.groups=s=a(null),f=0;f<L.length;f++)s[(p=L[f])[0]]=c[p[1]];return c}),Kr=h}!function(){if(Yr)return Jr;Yr=1;var t=Ye(),n=to();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var no,eo,ro,oo,io,uo,co,ao={};function fo(){return eo?no:(eo=1,no="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(co)return ao;co=1;var t=Ye(),n=function(){if(oo)return ro;oo=1;var t=Z(),n=nt(),e=Qr(),r=fo(),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 ro={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(uo)return io;uo=1;var t=Nn().PROPER,n=J(),e=fo();return io=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 lo,so,po={};function vo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function ho(t={},n={}){Object.keys(n).forEach(e=>{void 0===t[e]?t[e]=n[e]:vo(n[e])&&vo(t[e])&&Object.keys(n[e]).length>0&&ho(t[e],n[e])})}so||(so=1,function(){if(lo)return po;lo=1;var t=Ye(),n=f();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const mo={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 yo(){const t="undefined"!=typeof document?document:{};return ho(t,mo),t}const go={document:mo,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 bo(){const t="undefined"!=typeof window?window:{};return ho(t,go),t}class wo 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 Eo(t,n){const e=bo(),r=yo();let o=[];if(!n&&t instanceof wo)return t;if(!t)return new wo(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 wo)return t;o=t}return new wo(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 xo(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 Oo(...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),Eo(n).is(e))r.apply(n,o);else{const t=Eo(n).parents();for(let n=0;n<t.length;n+=1)Eo(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 a;for(let t=0;t<this.length;t+=1){const n=this[t];if(e)for(a=0;a<c.length;a+=1){const t=c[a];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(a=0;a<c.length;a+=1){const t=c[a];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 So(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 jo(t){const n=bo(),e=yo(),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=Eo(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 wo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function To(...t){let n;const e=yo();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 wo)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Lo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?Eo(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return Eo(n)}function Po(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 Eo(n)}Eo.fn=wo.prototype;const Ao="resize scroll".split(" ");const Io=(Mo="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)Ao.indexOf(Mo)<0&&(Mo in this[t]?this[t][Mo]():Eo(this[t]).trigger(Mo));return this}return this.on(Mo,...t)});var Mo;To&&(Eo.fn.append=To),So&&(Eo.fn.html=So),xo&&(Eo.fn.val=xo),Oo&&(Eo.fn.on=Oo),Io&&(Eo.fn.focus=Io),jo&&(Eo.fn.is=jo),Lo&&(Eo.fn.parents=Lo),Po&&(Eo.fn.find=Po);var Co,Ro,ko,No,_o,Fo,Do,Ho={};function zo(){if(Ro)return Co;Ro=1;var t=TypeError;return Co=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function $o(){if(Fo)return _o;Fo=1;var t=J(),n=at(),e=it(),r=n("species");return _o=function(n){return e>=51||!t(function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if(Do)return Ho;Do=1;var t=Ye(),n=J(),e=Rr(),r=Ut(),o=et(),i=je(),u=zo(),c=_r(),a=function(){if(No)return ko;No=1;var t=Wt(),n=Rr(),e=TypeError,r=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return ko=o?function(t,o){if(n(t)&&!r(t,"length").writable)throw new e("Cannot set read only .length");return t.length=o}:function(t,n){return t.length=n}}(),f=Nr(),l=$o(),s=at(),p=it(),d=s("isConcatSpreadable"),v=p>=51||!n(function(){var t=[];return t[d]=!1,t.concat()[0]!==t}),h=function(t){if(!r(t))return!1;var n=t[d];return void 0!==n?!!n:e(t)};t({target:"Array",proto:!0,arity:1,forced:!v||!l("concat")},{concat:function(t){var n,e,r,l,s,p=o(this),d=f(p,0),v=0;for(n=-1,r=arguments.length;n<r;n++)if(h(s=-1===n?p:arguments[n]))for(l=i(s),u(v+l),e=0;e<l;e++,v++)e in s&&c(d,v,s[e]);else u(v+1),c(d,v++,s);return a(d,v),d}})}();function Bo(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 Vo(){return Bo("w-e-insert-formula")}var qo=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=Vo(),this.buttonId=Vo()}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],a=Eo(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=Eo("<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(f);var p=this.getValue(t);return a.val(p),setTimeout(function(){a.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 Wo(){return Bo("w-e-insert-formula")}var Uo=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=Wo(),this.buttonId=Wo()}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],a=Eo(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=Eo("<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(f),a.val(""),setTimeout(function(){a.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,a=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"}},[a])}}],elemsToHtml:[Ir],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 Uo}},{key:"editFormula",factory:function(){return new qo}}]}});
|
|
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:{},a={};function f(){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,b,w,E,x,O,S,j,T,L,I,P,A,M,C,R,k,N,_,F,D,H,z,$,B,V,q,W,U,G={exports:{}};function K(){if(d)return p;d=1;var t=f(),n=Object.defineProperty;return p=function(e,r){try{n(t,e,{value:r,configurable:!0,writable:!0})}catch(n){t[e]=r}return r}}function X(){if(v)return G.exports;v=1;var t=s?l:(s=1,l=!1),n=f(),e=K(),r="__core-js_shared__",o=G.exports=n[r]||e(r,{});return(o.versions||(o.versions=[])).push({version:"3.49.0",mode:t?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"}),G.exports}function Y(){if(m)return h;m=1;var t=X();return h=function(n,e){return t[n]||(t[n]=e||{})}}function J(){return g?y:(g=1,y=function(t){try{return!!t()}catch(t){return!0}})}function Q(){if(w)return b;w=1;var t=J();return b=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function Z(){if(x)return E;x=1;var t=Q(),n=Function.prototype,e=n.call,r=t&&n.bind.bind(e,e);return E=t?r:function(t){return function(){return e.apply(t,arguments)}},E}function tt(){return S?O:(S=1,O=function(t){return null==t})}function nt(){if(T)return j;T=1;var t=tt(),n=TypeError;return j=function(e){if(t(e))throw new n("Can't call method on "+e);return e}}function et(){if(I)return L;I=1;var t=nt(),n=Object;return L=function(e){return n(t(e))}}function rt(){if(A)return P;A=1;var t=Z(),n=et(),e=t({}.hasOwnProperty);return P=Object.hasOwn||function(t,r){return e(n(t),r)}}function ot(){if(C)return M;C=1;var t=Z(),n=0,e=Math.random(),r=t(1.1.toString);return M=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++n+e,36)}}function it(){if(_)return N;_=1;var t,n,e=f(),r=function(){if(k)return R;k=1;var t=f().navigator,n=t&&t.userAgent;return R=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]),N=n}function ut(){if(D)return F;D=1;var t=it(),n=J(),e=f().String;return F=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!e(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function ct(){if(z)return H;z=1;var t=ut();return H=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function at(){if(B)return $;B=1;var t=f(),n=Y(),e=rt(),r=ot(),o=ut(),i=ct(),u=t.Symbol,c=n("wks"),a=i?u.for||u:u&&u.withoutSetter||r;return $=function(t){return e(c,t)||(c[t]=o&&e(u,t)?u[t]:a("Symbol."+t)),c[t]}}function ft(){if(q)return V;q=1;var t={};return t[at()("toStringTag")]="z",V="[object z]"===String(t)}function lt(){if(U)return W;U=1;var t="object"==typeof document&&document.all;return W=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var st,pt,dt,vt,ht,mt,yt,gt,bt,wt,Et,xt,Ot,St,jt,Tt,Lt,It,Pt,At,Mt,Ct,Rt,kt,Nt,_t,Ft,Dt,Ht,zt,$t,Bt,Vt,qt={};function Wt(){if(pt)return st;pt=1;var t=J();return st=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Ut(){if(vt)return dt;vt=1;var t=lt();return dt=function(n){return"object"==typeof n?null!==n:t(n)}}function Gt(){if(mt)return ht;mt=1;var t=f(),n=Ut(),e=t.document,r=n(e)&&n(e.createElement);return ht=function(t){return r?e.createElement(t):{}}}function Kt(){if(gt)return yt;gt=1;var t=Wt(),n=J(),e=Gt();return yt=!t&&!n(function(){return 7!==Object.defineProperty(e("div"),"a",{get:function(){return 7}}).a})}function Xt(){if(wt)return bt;wt=1;var t=Wt(),n=J();return bt=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Yt(){if(xt)return Et;xt=1;var t=Ut(),n=String,e=TypeError;return Et=function(r){if(t(r))return r;throw new e(n(r)+" is not an object")}}function Jt(){if(St)return Ot;St=1;var t=Q(),n=Function.prototype.call;return Ot=t?n.bind(n):function(){return n.apply(n,arguments)},Ot}function Qt(){if(Tt)return jt;Tt=1;var t=f(),n=lt();return jt=function(e,r){return arguments.length<2?(o=t[e],n(o)?o:void 0):t[e]&&t[e][r];var o},jt}function Zt(){if(At)return Pt;At=1;var t=Qt(),n=lt(),e=function(){if(It)return Lt;It=1;var t=Z();return Lt=t({}.isPrototypeOf)}(),r=ct(),o=Object;return Pt=r?function(t){return"symbol"==typeof t}:function(r){var i=t("Symbol");return n(i)&&e(i.prototype,o(r))}}function tn(){if(Ct)return Mt;Ct=1;var t=String;return Mt=function(n){try{return t(n)}catch(t){return"Object"}}}function nn(){if(kt)return Rt;kt=1;var t=lt(),n=tn(),e=TypeError;return Rt=function(r){if(t(r))return r;throw new e(n(r)+" is not a function")}}function en(){if(_t)return Nt;_t=1;var t=nn(),n=tt();return Nt=function(e,r){var o=e[r];return n(o)?void 0:t(o)}}function rn(){if(Dt)return Ft;Dt=1;var t=Jt(),n=lt(),e=Ut(),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}function on(){if(zt)return Ht;zt=1;var t=Jt(),n=Ut(),e=Zt(),r=en(),o=rn(),i=at(),u=TypeError,c=i("toPrimitive");return Ht=function(i,a){if(!n(i)||e(i))return i;var f,l=r(i,c);if(l){if(void 0===a&&(a="default"),f=t(l,i,a),!n(f)||e(f))return f;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),o(i,a)}}function un(){if(Bt)return $t;Bt=1;var t=on(),n=Zt();return $t=function(e){var r=t(e,"string");return n(r)?r:r+""}}function cn(){if(Vt)return qt;Vt=1;var t=Wt(),n=Kt(),e=Xt(),r=Yt(),o=un(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,a="enumerable",f="configurable",l="writable";return qt.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:f in e?e[f]:i[f],enumerable:a in e?e[a]:i[a],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},qt}var an,fn,ln,sn,pn,dn,vn,hn,mn,yn,gn,bn,wn,En,xn,On,Sn,jn,Tn,Ln,In,Pn,An,Mn,Cn,Rn,kn={exports:{}};function Nn(){if(fn)return an;fn=1;var t=Wt(),n=rt(),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 an={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function _n(){if(sn)return ln;sn=1;var t=Z(),n=lt(),e=X(),r=t(Function.toString);return n(e.inspectSource)||(e.inspectSource=function(t){return r(t)}),ln=e.inspectSource}function Fn(){return hn?vn:(hn=1,vn=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Dn(){if(yn)return mn;yn=1;var t=Wt(),n=cn(),e=Fn();return mn=t?function(t,r,o){return n.f(t,r,e(1,o))}:function(t,n,e){return t[n]=e,t}}function Hn(){if(bn)return gn;bn=1;var t=Y(),n=ot(),e=t("keys");return gn=function(t){return e[t]||(e[t]=n(t))}}function zn(){return En?wn:(En=1,wn={})}function $n(){if(On)return xn;On=1;var t,n,e,r=function(){if(dn)return pn;dn=1;var t=f(),n=lt(),e=t.WeakMap;return pn=n(e)&&/native code/.test(String(e))}(),o=f(),i=Ut(),u=Dn(),c=rt(),a=X(),l=Hn(),s=zn(),p="Object already initialized",d=o.TypeError,v=o.WeakMap;if(r||a.state){var h=a.state||(a.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 xn={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 Bn(){if(Sn)return kn.exports;Sn=1;var t=Z(),n=J(),e=lt(),r=rt(),o=Wt(),i=Nn().CONFIGURABLE,u=_n(),c=$n(),a=c.enforce,f=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=kn.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=a(t);return r(u,"source")||(u.source=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return e(this)&&f(this).source||u(this)},"toString"),kn.exports}function Vn(){if(Tn)return jn;Tn=1;var t=lt(),n=cn(),e=Bn(),r=K();return jn=function(o,i,u,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:i;if(t(u)&&e(u,f,c),c.global)a?o[i]=u:r(i,u);else{try{c.unsafe?o[i]&&(a=!0):delete o[i]}catch(t){}a?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}function qn(){if(In)return Ln;In=1;var t=Z(),n=t({}.toString),e=t("".slice);return Ln=function(t){return e(n(t),8,-1)}}function Wn(){if(An)return Pn;An=1;var t=ft(),n=lt(),e=qn(),r=at()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return Pn=t?e:function(t){var u,c,a;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"===(a=e(u))&&n(u.callee)?"Arguments":a}}!function(){if(Rn)return a;Rn=1;var t=ft(),n=Vn(),e=function(){if(Cn)return Mn;Cn=1;var t=ft(),n=Wn();return Mn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",e,{unsafe:!0})}();var Un,Gn,Kn,Xn,Yn,Jn,Qn={},Zn={},te={};function ne(){if(Kn)return Gn;Kn=1;var t=Z(),n=J(),e=qn(),r=Object,o=t("".split);return Gn=n(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===e(t)?o(t,""):r(t)}:r}function ee(){if(Yn)return Xn;Yn=1;var t=ne(),n=nt();return Xn=function(e){return t(n(e))}}function re(){if(Jn)return Zn;Jn=1;var t=Wt(),n=Jt(),e=function(){if(Un)return te;Un=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,e=n&&!t.call({1:2},1);return te.f=e?function(t){var e=n(this,t);return!!e&&e.enumerable}:t,te}(),r=Fn(),o=ee(),i=un(),u=rt(),c=Kt(),a=Object.getOwnPropertyDescriptor;return Zn.f=t?a:function(t,f){if(t=o(t),f=i(f),c)try{return a(t,f)}catch(t){}if(u(t,f))return r(!n(e.f,t,f),t[f])},Zn}var oe,ie,ue,ce,ae,fe,le,se,pe,de,ve,he,me,ye,ge,be,we,Ee={};function xe(){if(ce)return ue;ce=1;var t=function(){if(ie)return oe;ie=1;var t=Math.ceil,n=Math.floor;return oe=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}}();return ue=function(n){var e=+n;return e!=e||0===e?0:t(e)}}function Oe(){if(fe)return ae;fe=1;var t=xe(),n=Math.max,e=Math.min;return ae=function(r,o){var i=t(r);return i<0?n(i+o,0):e(i,o)}}function Se(){if(se)return le;se=1;var t=xe(),n=Math.min;return le=function(e){var r=t(e);return r>0?n(r,9007199254740991):0}}function je(){if(de)return pe;de=1;var t=Se();return pe=function(n){return t(n.length)}}function Te(){if(ye)return me;ye=1;var t=Z(),n=rt(),e=ee(),r=function(){if(he)return ve;he=1;var t=ee(),n=Oe(),e=je(),r=function(r){return function(o,i,u){var c=t(o),a=e(c);if(0===a)return!r&&-1;var f,l=n(u,a);if(r&&i!=i){for(;a>l;)if((f=c[l++])!=f)return!0}else for(;a>l;l++)if((r||l in c)&&c[l]===i)return r||l||0;return!r&&-1}};return ve={includes:r(!0),indexOf:r(!1)}}().indexOf,o=zn(),i=t([].push);return me=function(t,u){var c,a=e(t),f=0,l=[];for(c in a)!n(o,c)&&n(a,c)&&i(l,c);for(;u.length>f;)n(a,c=u[f++])&&(~r(l,c)||i(l,c));return l}}function Le(){return be?ge:(be=1,ge=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Ie,Pe,Ae,Me,Ce,Re,ke,Ne,_e,Fe,De,He,ze,$e,Be,Ve,qe,We,Ue,Ge={};function Ke(){if(Ae)return Pe;Ae=1;var t=Qt(),n=Z(),e=function(){if(we)return Ee;we=1;var t=Te(),n=Le().concat("length","prototype");return Ee.f=Object.getOwnPropertyNames||function(e){return t(e,n)},Ee}(),r=(Ie||(Ie=1,Ge.f=Object.getOwnPropertySymbols),Ge),o=Yt(),i=n([].concat);return Pe=t("Reflect","ownKeys")||function(t){var n=e.f(o(t)),u=r.f;return u?i(n,u(t)):n}}function Xe(){if(Ce)return Me;Ce=1;var t=rt(),n=Ke(),e=re(),r=cn();return Me=function(o,i,u){for(var c=n(i),a=r.f,f=e.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||a(o,s,f(i,s))}}}function Ye(){if(_e)return Ne;_e=1;var t=f(),n=re().f,e=Dn(),r=Vn(),o=K(),i=Xe(),u=function(){if(ke)return Re;ke=1;var t=J(),n=lt(),e=/#|\.prototype\./,r=function(e,r){var a=i[o(e)];return a===c||a!==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 Re=r}();return Ne=function(c,a){var f,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(f=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in a){if(p=a[l],s=c.dontCallGetSet?(d=n(f,l))&&d.value:f[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(f,l,p,c)}}}function Je(){if(ze)return He;ze=1;var t=Z();return He=t([].slice)}function Qe(){if(Be)return $e;Be=1;var t=Z(),n=nn(),e=Ut(),r=rt(),o=Je(),i=Q(),u=Function,c=t([].concat),a=t([].join),f={};return $e=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(f,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";f[n]=u("C,a","return new C("+a(o,",")+")")}return f[n](t,e)}(i,n.length,n):i.apply(t,n)};return e(l)&&(p.prototype=l),p},$e}function Ze(){if(qe)return Ve;qe=1;var t=Z(),n=J(),e=lt(),r=Wn(),o=Qt(),i=_n(),u=function(){},c=o("Reflect","construct"),a=/^\s*(?:class|function)\b/,f=t(a.exec),l=!a.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||!!f(a,i(t))}catch(t){return!0}};return p.sham=!0,Ve=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function tr(){if(Ue)return We;Ue=1;var t=Ze(),n=tn(),e=TypeError;return We=function(r){if(t(r))return r;throw new e(n(r)+" is not a constructor")}}var nr,er,rr,or,ir,ur,cr,ar,fr={};function lr(){if(er)return nr;er=1;var t=Te(),n=Le();return nr=Object.keys||function(e){return t(e,n)}}function sr(){if(cr)return ur;cr=1;var t,n=Yt(),e=function(){if(rr)return fr;rr=1;var t=Wt(),n=Xt(),e=cn(),r=Yt(),o=ee(),i=lr();return fr.f=t&&!n?Object.defineProperties:function(t,n){r(t);for(var u,c=o(n),a=i(n),f=a.length,l=0;f>l;)e.f(t,u=a[l++],c[u]);return t},fr}(),r=Le(),o=zn(),i=function(){if(ir)return or;ir=1;var t=Qt();return or=t("document","documentElement")}(),u=Gt(),c=Hn(),a="prototype",f="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+f+">"+t+"</"+f+">"},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"+f+":",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[a][r[c]];return v()};return o[l]=!0,ur=Object.create||function(t,r){var o;return null!==t?(s[a]=n(t),o=new s,s[a]=null,o[l]=t):o=v(),void 0===r?o:e.f(o,r)}}!function(){if(ar)return Qn;ar=1;var t=Ye(),n=Qt(),e=function(){if(De)return Fe;De=1;var t=Q(),n=Function.prototype,e=n.apply,r=n.call;return Fe="object"==typeof Reflect&&Reflect.apply||(t?r.bind(e):function(){return r.apply(e,arguments)}),Fe}(),r=Qe(),o=tr(),i=Yt(),u=Ut(),c=sr(),a=J(),f=n("Reflect","construct"),l=Object.prototype,s=[].push,p=a(function(){function t(){}return!(f(function(){},[],t)instanceof t)}),d=!a(function(){f(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t);var a=arguments.length<3?t:o(arguments[2]);if(i(n),d&&!p)return f(t,n,a);if(t===a){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=a.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){var t=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 pr=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",pr),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 dr,vr,hr,mr,yr,gr,br,wr,Er,xr,Or,Sr,jr,Tr,Lr,Ir,Pr,Ar={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>')}},Mr={};function Cr(){if(mr)return hr;mr=1;var t=function(){if(vr)return dr;vr=1;var t=qn(),n=Z();return dr=function(e){if("Function"===t(e))return n(e)}}(),n=nn(),e=Q(),r=t(t.bind);return hr=function(t,o){return n(t),void 0===o?t:e?r(t,o):function(){return t.apply(o,arguments)}},hr}function Rr(){if(gr)return yr;gr=1;var t=qn();return yr=Array.isArray||function(n){return"Array"===t(n)}}function kr(){if(wr)return br;wr=1;var t=Rr(),n=Ze(),e=Ut(),r=at()("species"),o=Array;return br=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 Nr(){if(xr)return Er;xr=1;var t=kr();return Er=function(n,e){return new(t(n))(0===e?0:e)}}function _r(){if(Sr)return Or;Sr=1;var t=Wt(),n=cn(),e=Fn();return Or=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Fr(){if(Ir)return Lr;Ir=1;var t=at(),n=sr(),e=cn().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&e(o,r,{configurable:!0,value:n(null)}),Lr=function(t){o[r][t]=!0}}!function(){if(Pr)return Mr;Pr=1;var t=Ye(),n=function(){if(Tr)return jr;Tr=1;var t=Cr(),n=ne(),e=et(),r=je(),o=Nr(),i=_r(),u=function(u){var c=1===u,a=2===u,f=3===u,l=4===u,s=6===u,p=7===u,d=5===u||s;return function(v,h,m){for(var y,g,b=e(v),w=n(b),E=r(w),x=t(h,m),O=0,S=0,j=c?o(v,E):a||p?o(v,0):void 0;E>O;O++)if((d||O in w)&&(g=x(y=w[O],O,b),u))if(c)i(j,O,g);else if(g)switch(u){case 3:return!0;case 5:return y;case 6:return O;case 2:i(j,S++,y)}else switch(u){case 4:return!1;case 7:i(j,S++,y)}return s?-1:f||l?l:j}};return jr={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}}().find,e=Fr(),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 Dr,Hr,zr,$r,Br,Vr,qr,Wr,Ur,Gr,Kr,Xr,Yr,Jr={};function Qr(){if(Hr)return Dr;Hr=1;var t=Wn(),n=String;return Dr=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Zr(){if($r)return zr;$r=1;var t=Yt();return zr=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 to(){if(Xr)return Kr;Xr=1;var t,n,e=Jt(),r=Z(),o=Qr(),i=Zr(),u=function(){if(Vr)return Br;Vr=1;var t=J(),n=f().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 Br={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=Y(),a=sr(),l=$n().get,s=function(){if(Wr)return qr;Wr=1;var t=J(),n=f().RegExp;return qr=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),p=function(){if(Gr)return Ur;Gr=1;var t=J(),n=f().RegExp;return Ur=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),b=r("".slice),w=(n=/b*/g,e(v,t=/a/,"a"),e(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),E=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1],O=function(t,n){for(var e=t.groups=a(null),r=0;r<n.length;r++){var o=n[r];e[o[0]]=t[o[1]]}};return(w||x||E||s||p)&&(h=function(t){var n,r,u,c=this,a=l(c),f=o(t),s=a.raw;if(s)return s.lastIndex=c.lastIndex,n=e(h,s,f),c.lastIndex=s.lastIndex,n&&a.groups&&O(n,a.groups),n;var p=a.groups,S=E&&c.sticky,j=e(i,c),T=c.source,L=0,I=f;if(S){j=g(j,"y",""),-1===y(j,"g")&&(j+="g"),I=b(f,c.lastIndex);var P=c.lastIndex>0&&m(f,c.lastIndex-1);c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==P&&"\r"!==P&&"\u2028"!==P&&"\u2029"!==P)&&(T="(?: (?:"+T+"))",I=" "+I,L++),r=new RegExp("^(?:"+T+")",j)}x&&(r=new RegExp("^"+T+"$(?!\\s)",j)),w&&(u=c.lastIndex);var A=e(v,S?r:c,I);return S?A?(A.input=f,A[0]=b(A[0],L),A.index=c.lastIndex,c.lastIndex+=A[0].length):c.lastIndex=0:w&&A&&(c.lastIndex=c.global?A.index+A[0].length:u),x&&A&&A.length>1&&e(d,A[0],r,function(){for(var t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(A[t]=void 0)}),A&&p&&O(A,p),A}),Kr=h}!function(){if(Yr)return Jr;Yr=1;var t=Ye(),n=to();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var no,eo,ro,oo,io,uo,co,ao={};function fo(){return eo?no:(eo=1,no="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(co)return ao;co=1;var t=Ye(),n=function(){if(oo)return ro;oo=1;var t=Z(),n=nt(),e=Qr(),r=fo(),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 ro={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(uo)return io;uo=1;var t=Nn().PROPER,n=J(),e=fo();return io=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 lo,so,po={};function vo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function ho(t={},n={}){Object.keys(n).forEach(e=>{void 0===t[e]?t[e]=n[e]:vo(n[e])&&vo(t[e])&&Object.keys(n[e]).length>0&&ho(t[e],n[e])})}so||(so=1,function(){if(lo)return po;lo=1;var t=Ye(),n=f();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const mo={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 yo(){const t="undefined"!=typeof document?document:{};return ho(t,mo),t}const go={document:mo,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 bo(){const t="undefined"!=typeof window?window:{};return ho(t,go),t}class wo 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 Eo(t,n){const e=bo(),r=yo();let o=[];if(!n&&t instanceof wo)return t;if(!t)return new wo(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 wo)return t;o=t}return new wo(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 xo(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 Oo(...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),Eo(n).is(e))r.apply(n,o);else{const t=Eo(n).parents();for(let n=0;n<t.length;n+=1)Eo(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 a;for(let t=0;t<this.length;t+=1){const n=this[t];if(e)for(a=0;a<c.length;a+=1){const t=c[a];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(a=0;a<c.length;a+=1){const t=c[a];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 So(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 jo(t){const n=bo(),e=yo(),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=Eo(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 wo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function To(...t){let n;const e=yo();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 wo)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Lo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?Eo(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return Eo(n)}function Io(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 Eo(n)}Eo.fn=wo.prototype;const Po="resize scroll".split(" ");const Ao=(Mo="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)Po.indexOf(Mo)<0&&(Mo in this[t]?this[t][Mo]():Eo(this[t]).trigger(Mo));return this}return this.on(Mo,...t)});var Mo;To&&(Eo.fn.append=To),So&&(Eo.fn.html=So),xo&&(Eo.fn.val=xo),Oo&&(Eo.fn.on=Oo),Ao&&(Eo.fn.focus=Ao),jo&&(Eo.fn.is=jo),Lo&&(Eo.fn.parents=Lo),Io&&(Eo.fn.find=Io);var Co,Ro,ko,No,_o,Fo,Do,Ho={};function zo(){if(Ro)return Co;Ro=1;var t=TypeError;return Co=function(n){if(n>9007199254740991)throw new t("Maximum allowed index exceeded");return n}}function $o(){if(Fo)return _o;Fo=1;var t=J(),n=at(),e=it(),r=n("species");return _o=function(n){return e>=51||!t(function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if(Do)return Ho;Do=1;var t=Ye(),n=J(),e=Rr(),r=Ut(),o=et(),i=je(),u=zo(),c=_r(),a=function(){if(No)return ko;No=1;var t=Wt(),n=Rr(),e=TypeError,r=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return ko=o?function(t,o){if(n(t)&&!r(t,"length").writable)throw new e("Cannot set read only .length");return t.length=o}:function(t,n){return t.length=n}}(),f=Nr(),l=$o(),s=at(),p=it(),d=s("isConcatSpreadable"),v=p>=51||!n(function(){var t=[];return t[d]=!1,t.concat()[0]!==t}),h=function(t){if(!r(t))return!1;var n=t[d];return void 0!==n?!!n:e(t)};t({target:"Array",proto:!0,arity:1,forced:!v||!l("concat")},{concat:function(t){var n,e,r,l,s,p=o(this),d=f(p,0),v=0;for(n=-1,r=arguments.length;n<r;n++)if(h(s=-1===n?p:arguments[n]))for(l=i(s),u(v+l),e=0;e<l;e++,v++)e in s&&c(d,v,s[e]);else u(v+1),c(d,v++,s);return a(d,v),d}})}();function Bo(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 Vo(){return Bo("w-e-insert-formula")}var qo=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=Vo(),this.buttonId=Vo()}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],a=Eo(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=Eo("<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(f);var p=this.getValue(t);return a.val(p),setTimeout(function(){a.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 Wo(){return Bo("w-e-insert-formula")}var Uo=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=Wo(),this.buttonId=Wo()}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],a=Eo(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=Eo("<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(f),a.val(""),setTimeout(function(){a.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,a=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"}},[a])}}],elemsToHtml:[Ar],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 Uo}},{key:"editFormula",factory:function(){return new qo}}]}});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|