@wangeditor-next/plugin-formula 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("katex"),require("@wangeditor-next/editor"),require("snabbdom")):"function"==typeof define&&define.amd?define(["katex","@wangeditor-next/editor","snabbdom"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFormulaPlugin=e(t.katex,t.editor,t.snabbdom)}(this,(function(t,e,n){"use strict";var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var a,f,c={};function s(){if(f)return a;f=1;var t=function(t){return t&&t.Math===Math&&t};return a=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof o&&o)||t("object"==typeof a&&a)||function(){return this}()||Function("return this")()}var l,h,p,d,v,m,g,y,b,w,E,x,S,O,A,T,L,j,M,P,I,C,N,D,_,F,k,R,W,H,V,B,q,z,$,U,G,K={exports:{}};function X(){if(d)return p;d=1;var t=s(),e=Object.defineProperty;return p=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch(e){t[n]=r}return r}}function Y(){if(v)return K.exports;v=1;var t=h?l:(h=1,l=!1),e=s(),n=X(),r="__core-js_shared__",i=K.exports=e[r]||n(r,{});return(i.versions||(i.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"}),K.exports}function J(){if(g)return m;g=1;var t=Y();return m=function(e,n){return t[e]||(t[e]=n||{})}}function Q(){return b?y:(b=1,y=function(t){try{return!!t()}catch(t){return!0}})}function Z(){if(E)return w;E=1;var t=Q();return w=!t((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function tt(){if(S)return x;S=1;var t=Z(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return x=t?r:function(t){return function(){return n.apply(t,arguments)}},x}function et(){return A?O:(A=1,O=function(t){return null==t})}function nt(){if(L)return T;L=1;var t=et(),e=TypeError;return T=function(n){if(t(n))throw new e("Can't call method on "+n);return n}}function rt(){if(M)return j;M=1;var t=nt(),e=Object;return j=function(n){return e(t(n))}}function it(){if(I)return P;I=1;var t=tt(),e=rt(),n=t({}.hasOwnProperty);return P=Object.hasOwn||function(t,r){return n(e(t),r)}}function ot(){if(N)return C;N=1;var t=tt(),e=0,n=Math.random(),r=t(1..toString);return C=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++e+n,36)}}function ut(){if(k)return F;k=1;var t,e,n=s(),r=function(){if(_)return D;_=1;var t=s().navigator,e=t&&t.userAgent;return D=e?String(e):""}(),i=n.process,o=n.Deno,u=i&&i.versions||o&&o.version,a=u&&u.v8;return a&&(e=(t=a.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(e=+t[1]),F=e}function at(){if(W)return R;W=1;var t=ut(),e=Q(),n=s().String;return R=!!Object.getOwnPropertySymbols&&!e((function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41}))}function ft(){if(V)return H;V=1;var t=at();return H=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ct(){if(q)return B;q=1;var t=s(),e=J(),n=it(),r=ot(),i=at(),o=ft(),u=t.Symbol,a=e("wks"),f=o?u.for||u:u&&u.withoutSetter||r;return B=function(t){return n(a,t)||(a[t]=i&&n(u,t)?u[t]:f("Symbol."+t)),a[t]}}function st(){if($)return z;$=1;var t={};return t[ct()("toStringTag")]="z",z="[object z]"===String(t)}function lt(){if(G)return U;G=1;var t="object"==typeof document&&document.all;return U=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}var ht,pt,dt,vt,mt,gt,yt,bt,wt,Et,xt,St,Ot,At,Tt,Lt,jt,Mt,Pt,It,Ct,Nt,Dt,_t,Ft,kt,Rt,Wt,Ht,Vt,Bt,qt,zt,$t={};function Ut(){if(pt)return ht;pt=1;var t=Q();return ht=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function Gt(){if(vt)return dt;vt=1;var t=lt();return dt=function(e){return"object"==typeof e?null!==e:t(e)}}function Kt(){if(gt)return mt;gt=1;var t=s(),e=Gt(),n=t.document,r=e(n)&&e(n.createElement);return mt=function(t){return r?n.createElement(t):{}}}function Xt(){if(bt)return yt;bt=1;var t=Ut(),e=Q(),n=Kt();return yt=!t&&!e((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function Yt(){if(Et)return wt;Et=1;var t=Ut(),e=Q();return wt=t&&e((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function Jt(){if(St)return xt;St=1;var t=Gt(),e=String,n=TypeError;return xt=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")}}function Qt(){if(At)return Ot;At=1;var t=Z(),e=Function.prototype.call;return Ot=t?e.bind(e):function(){return e.apply(e,arguments)},Ot}function Zt(){if(Lt)return Tt;Lt=1;var t=s(),e=lt();return Tt=function(n,r){return arguments.length<2?(i=t[n],e(i)?i:void 0):t[n]&&t[n][r];var i},Tt}function te(){if(It)return Pt;It=1;var t=Zt(),e=lt(),n=function(){if(Mt)return jt;Mt=1;var t=tt();return jt=t({}.isPrototypeOf)}(),r=ft(),i=Object;return Pt=r?function(t){return"symbol"==typeof t}:function(r){var o=t("Symbol");return e(o)&&n(o.prototype,i(r))}}function ee(){if(Nt)return Ct;Nt=1;var t=String;return Ct=function(e){try{return t(e)}catch(t){return"Object"}}}function ne(){if(_t)return Dt;_t=1;var t=lt(),e=ee(),n=TypeError;return Dt=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")}}function re(){if(kt)return Ft;kt=1;var t=ne(),e=et();return Ft=function(n,r){var i=n[r];return e(i)?void 0:t(i)}}function ie(){if(Wt)return Rt;Wt=1;var t=Qt(),e=lt(),n=Gt(),r=TypeError;return Rt=function(i,o){var u,a;if("string"===o&&e(u=i.toString)&&!n(a=t(u,i)))return a;if(e(u=i.valueOf)&&!n(a=t(u,i)))return a;if("string"!==o&&e(u=i.toString)&&!n(a=t(u,i)))return a;throw new r("Can't convert object to primitive value")}}function oe(){if(Vt)return Ht;Vt=1;var t=Qt(),e=Gt(),n=te(),r=re(),i=ie(),o=ct(),u=TypeError,a=o("toPrimitive");return Ht=function(o,f){if(!e(o)||n(o))return o;var c,s=r(o,a);if(s){if(void 0===f&&(f="default"),c=t(s,o,f),!e(c)||n(c))return c;throw new u("Can't convert object to primitive value")}return void 0===f&&(f="number"),i(o,f)}}function ue(){if(qt)return Bt;qt=1;var t=oe(),e=te();return Bt=function(n){var r=t(n,"string");return e(r)?r:r+""}}function ae(){if(zt)return $t;zt=1;var t=Ut(),e=Xt(),n=Yt(),r=Jt(),i=ue(),o=TypeError,u=Object.defineProperty,a=Object.getOwnPropertyDescriptor,f="enumerable",c="configurable",s="writable";return $t.f=t?n?function(t,e,n){if(r(t),e=i(e),r(n),"function"==typeof t&&"prototype"===e&&"value"in n&&s in n&&!n[s]){var o=a(t,e);o&&o[s]&&(t[e]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:f in n?n[f]:o[f],writable:!1})}return u(t,e,n)}:u:function(t,n,a){if(r(t),n=i(n),r(a),e)try{return u(t,n,a)}catch(t){}if("get"in a||"set"in a)throw new o("Accessors not supported");return"value"in a&&(t[n]=a.value),t},$t}var fe,ce,se,le,he,pe,de,ve,me,ge,ye,be,we,Ee,xe,Se,Oe,Ae,Te,Le,je,Me,Pe,Ie,Ce,Ne,De={exports:{}};function _e(){if(ce)return fe;ce=1;var t=Ut(),e=it(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&"something"===function(){}.name,u=i&&(!t||t&&r(n,"name").configurable);return fe={EXISTS:i,PROPER:o,CONFIGURABLE:u}}function Fe(){if(le)return se;le=1;var t=tt(),e=lt(),n=Y(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(t){return r(t)}),se=n.inspectSource}function ke(){return ve?de:(ve=1,de=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function Re(){if(ge)return me;ge=1;var t=Ut(),e=ae(),n=ke();return me=t?function(t,r,i){return e.f(t,r,n(1,i))}:function(t,e,n){return t[e]=n,t}}function We(){if(be)return ye;be=1;var t=J(),e=ot(),n=t("keys");return ye=function(t){return n[t]||(n[t]=e(t))}}function He(){return Ee?we:(Ee=1,we={})}function Ve(){if(Se)return xe;Se=1;var t,e,n,r=function(){if(pe)return he;pe=1;var t=s(),e=lt(),n=t.WeakMap;return he=e(n)&&/native code/.test(String(n))}(),i=s(),o=Gt(),u=Re(),a=it(),f=Y(),c=We(),l=He(),h="Object already initialized",p=i.TypeError,d=i.WeakMap;if(r||f.state){var v=f.state||(f.state=new d);v.get=v.get,v.has=v.has,v.set=v.set,t=function(t,e){if(v.has(t))throw new p(h);return e.facade=t,v.set(t,e),e},e=function(t){return v.get(t)||{}},n=function(t){return v.has(t)}}else{var m=c("state");l[m]=!0,t=function(t,e){if(a(t,m))throw new p(h);return e.facade=t,u(t,m,e),e},e=function(t){return a(t,m)?t[m]:{}},n=function(t){return a(t,m)}}return xe={set:t,get:e,has:n,enforce:function(r){return n(r)?e(r):t(r,{})},getterFor:function(t){return function(n){var r;if(!o(n)||(r=e(n)).type!==t)throw new p("Incompatible receiver, "+t+" required");return r}}}}function Be(){if(Oe)return De.exports;Oe=1;var t=tt(),e=Q(),n=lt(),r=it(),i=Ut(),o=_e().CONFIGURABLE,u=Fe(),a=Ve(),f=a.enforce,c=a.get,s=String,l=Object.defineProperty,h=t("".slice),p=t("".replace),d=t([].join),v=i&&!e((function(){return 8!==l((function(){}),"length",{value:8}).length})),m=String(String).split("String"),g=De.exports=function(t,e,n){"Symbol("===h(s(e),0,7)&&(e="["+p(s(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!r(t,"name")||o&&t.name!==e)&&(i?l(t,"name",{value:e,configurable:!0}):t.name=e),v&&n&&r(n,"arity")&&t.length!==n.arity&&l(t,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&l(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=f(t);return r(u,"source")||(u.source=d(m,"string"==typeof e?e:"")),t};return Function.prototype.toString=g((function(){return n(this)&&c(this).source||u(this)}),"toString"),De.exports}function qe(){if(Te)return Ae;Te=1;var t=lt(),e=ae(),n=Be(),r=X();return Ae=function(i,o,u,a){a||(a={});var f=a.enumerable,c=void 0!==a.name?a.name:o;if(t(u)&&n(u,c,a),a.global)f?i[o]=u:r(o,u);else{try{a.unsafe?i[o]&&(f=!0):delete i[o]}catch(t){}f?i[o]=u:e.f(i,o,{value:u,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i}}function ze(){if(je)return Le;je=1;var t=tt(),e=t({}.toString),n=t("".slice);return Le=function(t){return n(e(t),8,-1)}}function $e(){if(Pe)return Me;Pe=1;var t=st(),e=lt(),n=ze(),r=ct()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Me=t?n:function(t){var u,a,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,e){try{return t[e]}catch(t){}}(u=i(t),r))?a:o?n(u):"Object"===(f=n(u))&&e(u.callee)?"Arguments":f}}!function(){if(Ne)return c;Ne=1;var t=st(),e=qe(),n=function(){if(Ce)return Ie;Ce=1;var t=st(),e=$e();return Ie=t?{}.toString:function(){return"[object "+e(this)+"]"}}();t||e(Object.prototype,"toString",n,{unsafe:!0})}();var Ue,Ge,Ke,Xe,Ye,Je,Qe={},Ze={},tn={};function en(){if(Ke)return Ge;Ke=1;var t=tt(),e=Q(),n=ze(),r=Object,i=t("".split);return Ge=e((function(){return!r("z").propertyIsEnumerable(0)}))?function(t){return"String"===n(t)?i(t,""):r(t)}:r}function nn(){if(Ye)return Xe;Ye=1;var t=en(),e=nt();return Xe=function(n){return t(e(n))}}function rn(){if(Je)return Ze;Je=1;var t=Ut(),e=Qt(),n=function(){if(Ue)return tn;Ue=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return tn.f=n?function(t){var n=e(this,t);return!!n&&n.enumerable}:t,tn}(),r=ke(),i=nn(),o=ue(),u=it(),a=Xt(),f=Object.getOwnPropertyDescriptor;return Ze.f=t?f:function(t,c){if(t=i(t),c=o(c),a)try{return f(t,c)}catch(t){}if(u(t,c))return r(!e(n.f,t,c),t[c])},Ze}var on,un,an,fn,cn,sn,ln,hn,pn,dn,vn,mn,gn,yn,bn,wn,En,xn={};function Sn(){if(fn)return an;fn=1;var t=function(){if(un)return on;un=1;var t=Math.ceil,e=Math.floor;return on=Math.trunc||function(n){var r=+n;return(r>0?e:t)(r)}}();return an=function(e){var n=+e;return n!=n||0===n?0:t(n)}}function On(){if(sn)return cn;sn=1;var t=Sn(),e=Math.max,n=Math.min;return cn=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)}}function An(){if(hn)return ln;hn=1;var t=Sn(),e=Math.min;return ln=function(n){var r=t(n);return r>0?e(r,9007199254740991):0}}function Tn(){if(dn)return pn;dn=1;var t=An();return pn=function(e){return t(e.length)}}function Ln(){if(yn)return gn;yn=1;var t=tt(),e=it(),n=nn(),r=function(){if(mn)return vn;mn=1;var t=nn(),e=On(),n=Tn(),r=function(r){return function(i,o,u){var a=t(i),f=n(a);if(0===f)return!r&&-1;var c,s=e(u,f);if(r&&o!=o){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((r||s in a)&&a[s]===o)return r||s||0;return!r&&-1}};return vn={includes:r(!0),indexOf:r(!1)}}().indexOf,i=He(),o=t([].push);return gn=function(t,u){var a,f=n(t),c=0,s=[];for(a in f)!e(i,a)&&e(f,a)&&o(s,a);for(;u.length>c;)e(f,a=u[c++])&&(~r(s,a)||o(s,a));return s}}function jn(){return wn?bn:(wn=1,bn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Mn,Pn,In,Cn,Nn,Dn,_n,Fn,kn,Rn,Wn,Hn,Vn,Bn,qn,zn,$n,Un,Gn,Kn={};function Xn(){if(In)return Pn;In=1;var t=Zt(),e=tt(),n=function(){if(En)return xn;En=1;var t=Ln(),e=jn().concat("length","prototype");return xn.f=Object.getOwnPropertyNames||function(n){return t(n,e)},xn}(),r=(Mn||(Mn=1,Kn.f=Object.getOwnPropertySymbols),Kn),i=Jt(),o=e([].concat);return Pn=t("Reflect","ownKeys")||function(t){var e=n.f(i(t)),u=r.f;return u?o(e,u(t)):e}}function Yn(){if(Nn)return Cn;Nn=1;var t=it(),e=Xn(),n=rn(),r=ae();return Cn=function(i,o,u){for(var a=e(o),f=r.f,c=n.f,s=0;s<a.length;s++){var l=a[s];t(i,l)||u&&t(u,l)||f(i,l,c(o,l))}}}function Jn(){if(kn)return Fn;kn=1;var t=s(),e=rn().f,n=Re(),r=qe(),i=X(),o=Yn(),u=function(){if(_n)return Dn;_n=1;var t=Q(),e=lt(),n=/#|\.prototype\./,r=function(n,r){var f=o[i(n)];return f===a||f!==u&&(e(r)?t(r):!!r)},i=r.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=r.data={},u=r.NATIVE="N",a=r.POLYFILL="P";return Dn=r}();return Fn=function(a,f){var c,s,l,h,p,d=a.target,v=a.global,m=a.stat;if(c=v?t:m?t[d]||i(d,{}):t[d]&&t[d].prototype)for(s in f){if(h=f[s],l=a.dontCallGetSet?(p=e(c,s))&&p.value:c[s],!u(v?s:d+(m?".":"#")+s,a.forced)&&void 0!==l){if(typeof h==typeof l)continue;o(h,l)}(a.sham||l&&l.sham)&&n(h,"sham",!0),r(c,s,h,a)}}}function Qn(){if(Vn)return Hn;Vn=1;var t=tt();return Hn=t([].slice)}function Zn(){if(qn)return Bn;qn=1;var t=tt(),e=ne(),n=Gt(),r=it(),i=Qn(),o=Z(),u=Function,a=t([].concat),f=t([].join),c={};return Bn=o?u.bind:function(t){var o=e(this),s=o.prototype,l=i(arguments,1),h=function(){var e=a(l,i(arguments));return this instanceof h?function(t,e,n){if(!r(c,e)){for(var i=[],o=0;o<e;o++)i[o]="a["+o+"]";c[e]=u("C,a","return new C("+f(i,",")+")")}return c[e](t,n)}(o,e.length,e):o.apply(t,e)};return n(s)&&(h.prototype=s),h},Bn}function tr(){if($n)return zn;$n=1;var t=tt(),e=Q(),n=lt(),r=$e(),i=Zt(),o=Fe(),u=function(){},a=i("Reflect","construct"),f=/^\s*(?:class|function)\b/,c=t(f.exec),s=!f.test(u),l=function(t){if(!n(t))return!1;try{return a(u,[],t),!0}catch(t){return!1}},h=function(t){if(!n(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return s||!!c(f,o(t))}catch(t){return!0}};return h.sham=!0,zn=!a||e((function(){var t;return l(l.call)||!l(Object)||!l((function(){t=!0}))||t}))?h:l}function er(){if(Gn)return Un;Gn=1;var t=tr(),e=ee(),n=TypeError;return Un=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}var nr,rr,ir,or,ur,ar,fr,cr,sr={};function lr(){if(rr)return nr;rr=1;var t=Ln(),e=jn();return nr=Object.keys||function(n){return t(n,e)}}function hr(){if(ur)return or;ur=1;var t=Zt();return or=t("document","documentElement")}function pr(){if(fr)return ar;fr=1;var t,e=Jt(),n=function(){if(ir)return sr;ir=1;var t=Ut(),e=Yt(),n=ae(),r=Jt(),i=nn(),o=lr();return sr.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var u,a=i(e),f=o(e),c=f.length,s=0;c>s;)n.f(t,u=f[s++],a[u]);return t},sr}(),r=jn(),i=He(),o=hr(),u=Kt(),a=We(),f="prototype",c="script",s=a("IE_PROTO"),l=function(){},h=function(t){return"<"+c+">"+t+"</"+c+">"},p=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},d=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,i;d="undefined"!=typeof document?document.domain&&t?p(t):(n=u("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(e=n.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):p(t);for(var a=r.length;a--;)delete d[f][r[a]];return d()};return i[s]=!0,ar=Object.create||function(t,r){var i;return null!==t?(l[f]=e(t),i=new l,l[f]=null,i[s]=t):i=d(),void 0===r?i:n.f(i,r)}}!function(){if(cr)return Qe;cr=1;var t=Jn(),e=Zt(),n=function(){if(Wn)return Rn;Wn=1;var t=Z(),e=Function.prototype,n=e.apply,r=e.call;return Rn="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Rn}(),r=Zn(),i=er(),o=Jt(),u=Gt(),a=pr(),f=Q(),c=e("Reflect","construct"),s=Object.prototype,l=[].push,h=f((function(){function t(){}return!(c((function(){}),[],t)instanceof t)})),p=!f((function(){c((function(){}))})),d=h||p;t({target:"Reflect",stat:!0,forced:d,sham:d},{construct:function(t,e){i(t),o(e);var f=arguments.length<3?t:i(arguments[2]);if(p&&!h)return c(t,e,f);if(t===f){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var d=[null];return n(l,d,e),new(n(r,t,d))}var v=f.prototype,m=a(u(v)?v:s),g=n(t,m,e);return u(g)?g:m}})}(),function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback){var t=HTMLElement,e=function(){return Reflect.construct(t,[],this.constructor)};window.HTMLElement=e,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}();var dr=function(e){function n(){var t=e.call(this)||this,n=t.attachShadow({mode:"open"}),r=n.ownerDocument.createElement("span");return r.style.display="inline-block",n.appendChild(r),t.span=r,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,e),Object.defineProperty(n,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),n.prototype.attributeChangedCallback=function(t,e,n){if("data-value"===t){if(e===n)return;this.render(n||"")}},n.prototype.render=function(e){t.render(e,this.span,{throwOnError:!1,output:"mathml"})},n}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",dr),e.i18nAddResources("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),e.i18nAddResources("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var vr,mr,gr,yr,br,wr,Er,xr,Sr,Or,Ar,Tr,Lr,jr,Mr,Pr={type:"formula",elemToHtml:function(t,e){var n=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===n?"":n,'"></span>')}},Ir={};function Cr(){if(yr)return gr;yr=1;var t=function(){if(mr)return vr;mr=1;var t=ze(),e=tt();return vr=function(n){if("Function"===t(n))return e(n)}}(),e=ne(),n=Z(),r=t(t.bind);return gr=function(t,i){return e(t),void 0===i?t:n?r(t,i):function(){return t.apply(i,arguments)}},gr}function Nr(){if(wr)return br;wr=1;var t=ze();return br=Array.isArray||function(e){return"Array"===t(e)}}function Dr(){if(xr)return Er;xr=1;var t=Nr(),e=tr(),n=Gt(),r=ct()("species"),i=Array;return Er=function(o){var u;return t(o)&&(u=o.constructor,(e(u)&&(u===i||t(u.prototype))||n(u)&&null===(u=u[r]))&&(u=void 0)),void 0===u?i:u}}function _r(){if(Or)return Sr;Or=1;var t=Dr();return Sr=function(e,n){return new(t(e))(0===n?0:n)}}function Fr(){if(jr)return Lr;jr=1;var t=ct(),e=pr(),n=ae().f,r=t("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:e(null)}),Lr=function(t){i[r][t]=!0}}!function(){if(Mr)return Ir;Mr=1;var t=Jn(),e=function(){if(Tr)return Ar;Tr=1;var t=Cr(),e=tt(),n=en(),r=rt(),i=Tn(),o=_r(),u=e([].push),a=function(e){var a=1===e,f=2===e,c=3===e,s=4===e,l=6===e,h=7===e,p=5===e||l;return function(d,v,m,g){for(var y,b,w=r(d),E=n(w),x=i(E),S=t(v,m),O=0,A=g||o,T=a?A(d,x):f||h?A(d,0):void 0;x>O;O++)if((p||O in E)&&(b=S(y=E[O],O,w),e))if(a)T[O]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return O;case 2:u(T,y)}else switch(e){case 4:return!1;case 7:u(T,y)}return l?-1:c||s?s:T}};return Ar={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)}}().find,n=Fr(),r="find",i=!0;r in[]&&Array(1)[r]((function(){i=!1})),t({target:"Array",proto:!0,forced:i},{find:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n(r)}();var kr,Rr,Wr,Hr,Vr,Br,qr,zr,$r,Ur,Gr,Kr,Xr,Yr={};function Jr(){if(Rr)return kr;Rr=1;var t=$e(),e=String;return kr=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return e(n)}}function Qr(){if(Hr)return Wr;Hr=1;var t=Jt();return Wr=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n}}function Zr(){if(Kr)return Gr;Kr=1;var t,e,n=Qt(),r=tt(),i=Jr(),o=Qr(),u=function(){if(Br)return Vr;Br=1;var t=Q(),e=s().RegExp,n=t((function(){var t=e("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),r=n||t((function(){return!e("a","y").sticky})),i=n||t((function(){var t=e("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return Vr={BROKEN_CARET:i,MISSED_STICKY:r,UNSUPPORTED_Y:n}}(),a=J(),f=pr(),c=Ve().get,l=function(){if(zr)return qr;zr=1;var t=Q(),e=s().RegExp;return qr=t((function(){var t=e(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}(),h=function(){if(Ur)return $r;Ur=1;var t=Q(),e=s().RegExp;return $r=t((function(){var t=e("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}(),p=a("native-string-replace",String.prototype.replace),d=RegExp.prototype.exec,v=d,m=r("".charAt),g=r("".indexOf),y=r("".replace),b=r("".slice),w=(e=/b*/g,n(d,t=/a/,"a"),n(d,e,"a"),0!==t.lastIndex||0!==e.lastIndex),E=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(w||x||E||l||h)&&(v=function(t){var e,r,u,a,s,l,h,S=this,O=c(S),A=i(t),T=O.raw;if(T)return T.lastIndex=S.lastIndex,e=n(v,T,A),S.lastIndex=T.lastIndex,e;var L=O.groups,j=E&&S.sticky,M=n(o,S),P=S.source,I=0,C=A;if(j&&(M=y(M,"y",""),-1===g(M,"g")&&(M+="g"),C=b(A,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==m(A,S.lastIndex-1))&&(P="(?: "+P+")",C=" "+C,I++),r=new RegExp("^(?:"+P+")",M)),x&&(r=new RegExp("^"+P+"$(?!\\s)",M)),w&&(u=S.lastIndex),a=n(d,j?r:S,C),j?a?(a.input=b(a.input,I),a[0]=b(a[0],I),a.index=S.lastIndex,S.lastIndex+=a[0].length):S.lastIndex=0:w&&a&&(S.lastIndex=S.global?a.index+a[0].length:u),x&&a&&a.length>1&&n(p,a[0],r,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(a[s]=void 0)})),a&&L)for(a.groups=l=f(null),s=0;s<L.length;s++)l[(h=L[s])[0]]=a[h[1]];return a}),Gr=v}!function(){if(Xr)return Yr;Xr=1;var t=Jn(),e=Zr();t({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})}();var ti,ei,ni,ri,ii,oi,ui,ai={};function fi(){return ei?ti:(ei=1,ti="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(ui)return ai;ui=1;var t=Jn(),e=function(){if(ri)return ni;ri=1;var t=tt(),e=nt(),n=Jr(),r=fi(),i=t("".replace),o=RegExp("^["+r+"]+"),u=RegExp("(^|[^"+r+"])["+r+"]+$"),a=function(t){return function(r){var a=n(e(r));return 1&t&&(a=i(a,o,"")),2&t&&(a=i(a,u,"$1")),a}};return ni={start:a(1),end:a(2),trim:a(3)}}().trim,n=function(){if(oi)return ii;oi=1;var t=_e().PROPER,e=Q(),n=fi();return ii=function(r){return e((function(){return!!n[r]()||"
"!=="
"[r]()||t&&n[r].name!==r}))}}();t({target:"String",proto:!0,forced:n("trim")},{trim:function(){return e(this)}})}();var ci,si,li={};si||(si=1,function(){if(ci)return li;ci=1;var t=Jn(),e=s();t({global:!0,forced:e.globalThis!==e},{globalThis:e})}());var hi,pi,di={},vi={exports:{}};vi.exports;function mi(){return hi||(hi=1,function(t,e){!function(t){function e(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function n(t,r){void 0===t&&(t={}),void 0===r&&(r={}),Object.keys(r).forEach((function(i){void 0===t[i]?t[i]=r[i]:e(r[i])&&e(t[i])&&Object.keys(r[i]).length>0&&n(t[i],r[i])}))}var r={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function i(){var t="undefined"!=typeof document?document:{};return n(t,r),t}var o={document:r,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function u(){var t="undefined"!=typeof window?window:{};return n(t,o),t}t.extend=n,t.getDocument=i,t.getWindow=u,t.ssrDocument=r,t.ssrWindow=o,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,vi.exports)),vi.exports}function gi(){if(pi)return di;pi=1,Object.defineProperty(di,"__esModule",{value:!0});var t=mi();function e(t){return e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(t)}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}function r(t,e,i){return r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},r.apply(null,arguments)}function i(t){var o="function"==typeof Map?new Map:void 0;return i=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,u)}function u(){return r(t,arguments,e(this).constructor)}return u.prototype=Object.create(t.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),n(u,t)},i(t)}var o=function(t){var e,n;function r(e){var n,r,i;return n=t.call.apply(t,[this].concat(e))||this,r=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),i=r.__proto__,Object.defineProperty(r,"__proto__",{get:function(){return i},set:function(t){i.__proto__=t}}),n}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r}(i(Array));function u(t){void 0===t&&(t=[]);var e=[];return t.forEach((function(t){Array.isArray(t)?e.push.apply(e,u(t)):e.push(t)})),e}function a(t,e){return Array.prototype.filter.call(t,e)}function f(e,n){var r=t.getWindow(),i=t.getDocument(),u=[];if(!n&&e instanceof o)return e;if(!e)return new o(u);if("string"==typeof e){var a=e.trim();if(a.indexOf("<")>=0&&a.indexOf(">")>=0){var f="div";0===a.indexOf("<li")&&(f="ul"),0===a.indexOf("<tr")&&(f="tbody"),0!==a.indexOf("<td")&&0!==a.indexOf("<th")||(f="tr"),0===a.indexOf("<tbody")&&(f="table"),0===a.indexOf("<option")&&(f="select");var c=i.createElement(f);c.innerHTML=a;for(var s=0;s<c.childNodes.length;s+=1)u.push(c.childNodes[s])}else u=function(t,e){if("string"!=typeof t)return[t];for(var n=[],r=e.querySelectorAll(t),i=0;i<r.length;i+=1)n.push(r[i]);return n}(e.trim(),n||i)}else if(e.nodeType||e===r||e===i)u.push(e);else if(Array.isArray(e)){if(e instanceof o)return e;u=e}return new o(function(t){for(var e=[],n=0;n<t.length;n+=1)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(u))}f.fn=o.prototype;var c="resize scroll".split(" ");function s(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(void 0===n[0]){for(var i=0;i<this.length;i+=1)c.indexOf(t)<0&&(t in this[i]?this[i][t]():f(this[i]).trigger(t));return this}return this.on.apply(this,[t].concat(n))}}var l=s("click"),h=s("blur"),p=s("focus"),d=s("focusin"),v=s("focusout"),m=s("keyup"),g=s("keydown"),y=s("keypress"),b=s("submit"),w=s("change"),E=s("mousedown"),x=s("mousemove"),S=s("mouseup"),O=s("mouseenter"),A=s("mouseleave"),T=s("mouseout"),L=s("mouseover"),j=s("touchstart"),M=s("touchend"),P=s("touchmove"),I=s("resize"),C=s("scroll");return di.$=f,di.add=function(){for(var t,e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(t=0;t<r.length;t+=1){var o=f(r[t]);for(e=0;e<o.length;e+=1)this.push(o[e])}return this},di.addClass=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=u(e.map((function(t){return t.split(" ")})));return this.forEach((function(t){var e;(e=t.classList).add.apply(e,r)})),this},di.animate=function(e,n){var r,i=t.getWindow(),o=this,u={props:Object.assign({},e),params:Object.assign({duration:300,easing:"swing"},n),elements:o,animating:!1,que:[],easingProgress:function(t,e){return"swing"===t?.5-Math.cos(e*Math.PI)/2:"function"==typeof t?t(e):e},stop:function(){u.frameId&&i.cancelAnimationFrame(u.frameId),u.animating=!1,u.elements.each((function(t){delete t.dom7AnimateInstance})),u.que=[]},done:function(t){if(u.animating=!1,u.elements.each((function(t){delete t.dom7AnimateInstance})),t&&t(o),u.que.length>0){var e=u.que.shift();u.animate(e[0],e[1])}},animate:function(t,e){if(u.animating)return u.que.push([t,e]),u;var n=[];u.elements.each((function(e,r){var o,a,f,c,s;e.dom7AnimateInstance||(u.elements[r].dom7AnimateInstance=u),n[r]={container:e},Object.keys(t).forEach((function(u){o=i.getComputedStyle(e,null).getPropertyValue(u).replace(",","."),a=parseFloat(o),f=o.replace(a,""),c=parseFloat(t[u]),s=t[u]+f,n[r][u]={initialFullValue:o,initialValue:a,unit:f,finalValue:c,finalFullValue:s,currentValue:a}}))}));var r,a,f=null,c=0,s=0,l=!1;return u.animating=!0,u.frameId=i.requestAnimationFrame((function h(){var p,d;r=(new Date).getTime(),l||(l=!0,e.begin&&e.begin(o)),null===f&&(f=r),e.progress&&e.progress(o,Math.max(Math.min((r-f)/e.duration,1),0),f+e.duration-r<0?0:f+e.duration-r,f),n.forEach((function(i){var o=i;a||o.done||Object.keys(t).forEach((function(i){if(!a&&!o.done){p=Math.max(Math.min((r-f)/e.duration,1),0),d=u.easingProgress(e.easing,p);var l=o[i],h=l.initialValue,v=l.finalValue,m=l.unit;o[i].currentValue=h+d*(v-h);var g=o[i].currentValue;(v>h&&g>=v||v<h&&g<=v)&&(o.container.style[i]=v+m,(s+=1)===Object.keys(t).length&&(o.done=!0,c+=1),c===n.length&&(a=!0)),a?u.done(e.complete):o.container.style[i]=g+m}}))})),a||(u.frameId=i.requestAnimationFrame(h))})),u}};if(0===u.elements.length)return o;for(var a=0;a<u.elements.length;a+=1)u.elements[a].dom7AnimateInstance?r=u.elements[a].dom7AnimateInstance:u.elements[a].dom7AnimateInstance=u;return r||(r=u),"stop"===e?r.stop():r.animate(u.props,u.params),o},di.animationEnd=function(t){var e=this;return t&&e.on("animationend",(function n(r){r.target===this&&(t.call(this,r),e.off("animationend",n))})),this},di.append=function(){for(var e,n=t.getDocument(),r=0;r<arguments.length;r+=1){e=r<0||arguments.length<=r?void 0:arguments[r];for(var i=0;i<this.length;i+=1)if("string"==typeof e){var u=n.createElement("div");for(u.innerHTML=e;u.firstChild;)this[i].appendChild(u.firstChild)}else if(e instanceof o)for(var a=0;a<e.length;a+=1)this[i].appendChild(e[a]);else this[i].appendChild(e)}return this},di.appendTo=function(t){return f(t).append(this),this},di.attr=function(t,e){if(1===arguments.length&&"string"==typeof t)return this[0]?this[0].getAttribute(t):void 0;for(var n=0;n<this.length;n+=1)if(2===arguments.length)this[n].setAttribute(t,e);else for(var r in t)this[n][r]=t[r],this[n].setAttribute(r,t[r]);return this},di.blur=h,di.change=w,di.children=function(t){for(var e=[],n=0;n<this.length;n+=1)for(var r=this[n].children,i=0;i<r.length;i+=1)t&&!f(r[i]).is(t)||e.push(r[i]);return f(e)},di.click=l,di.closest=function(t){var e=this;return void 0===t?f([]):(e.is(t)||(e=e.parents(t).eq(0)),e)},di.css=function(e,n){var r,i=t.getWindow();if(1===arguments.length){if("string"!=typeof e){for(r=0;r<this.length;r+=1)for(var o in e)this[r].style[o]=e[o];return this}if(this[0])return i.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(r=0;r<this.length;r+=1)this[r].style[e]=n;return this}return this},di.data=function(t,e){var n;if(void 0===e){if(!(n=this[0]))return;if(n.dom7ElementDataStorage&&t in n.dom7ElementDataStorage)return n.dom7ElementDataStorage[t];var r=n.getAttribute("data-"+t);return r||void 0}for(var i=0;i<this.length;i+=1)(n=this[i]).dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[t]=e;return this},di.dataset=function(){var t=this[0];if(t){var e,n={};if(t.dataset)for(var r in t.dataset)n[r]=t.dataset[r];else for(var i=0;i<t.attributes.length;i+=1){var o=t.attributes[i];o.name.indexOf("data-")>=0&&(n[(e=o.name.split("data-")[1],e.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})))]=o.value)}for(var u in n)"false"===n[u]?n[u]=!1:"true"===n[u]?n[u]=!0:parseFloat(n[u])===1*n[u]&&(n[u]*=1);return n}},di.default=f,di.detach=function(){return this.remove()},di.each=function(t){return t?(this.forEach((function(e,n){t.apply(e,[e,n])})),this):this},di.empty=function(){for(var t=0;t<this.length;t+=1){var e=this[t];if(1===e.nodeType){for(var n=0;n<e.childNodes.length;n+=1)e.childNodes[n].parentNode&&e.childNodes[n].parentNode.removeChild(e.childNodes[n]);e.textContent=""}}return this},di.eq=function(t){if(void 0===t)return this;var e=this.length;if(t>e-1)return f([]);if(t<0){var n=e+t;return f(n<0?[]:[this[n]])}return f([this[t]])},di.filter=function(t){return f(a(this,t))},di.find=function(t){for(var e=[],n=0;n<this.length;n+=1)for(var r=this[n].querySelectorAll(t),i=0;i<r.length;i+=1)e.push(r[i]);return f(e)},di.focus=p,di.focusin=d,di.focusout=v,di.hasClass=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=u(e.map((function(t){return t.split(" ")})));return a(this,(function(t){return r.filter((function(e){return t.classList.contains(e)})).length>0})).length>0},di.height=function(){var e=t.getWindow();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null},di.hide=function(){for(var t=0;t<this.length;t+=1)this[t].style.display="none";return this},di.html=function(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(var e=0;e<this.length;e+=1)this[e].innerHTML=t;return this},di.index=function(){var t,e=this[0];if(e){for(t=0;null!==(e=e.previousSibling);)1===e.nodeType&&(t+=1);return t}},di.insertAfter=function(t){for(var e=f(t),n=0;n<this.length;n+=1)if(1===e.length)e[0].parentNode.insertBefore(this[n],e[0].nextSibling);else if(e.length>1)for(var r=0;r<e.length;r+=1)e[r].parentNode.insertBefore(this[n].cloneNode(!0),e[r].nextSibling)},di.insertBefore=function(t){for(var e=f(t),n=0;n<this.length;n+=1)if(1===e.length)e[0].parentNode.insertBefore(this[n],e[0]);else if(e.length>1)for(var r=0;r<e.length;r+=1)e[r].parentNode.insertBefore(this[n].cloneNode(!0),e[r])},di.is=function(e){var n,r,i=t.getWindow(),u=t.getDocument(),a=this[0];if(!a||void 0===e)return!1;if("string"==typeof e){if(a.matches)return a.matches(e);if(a.webkitMatchesSelector)return a.webkitMatchesSelector(e);if(a.msMatchesSelector)return a.msMatchesSelector(e);for(n=f(e),r=0;r<n.length;r+=1)if(n[r]===a)return!0;return!1}if(e===u)return a===u;if(e===i)return a===i;if(e.nodeType||e instanceof o){for(n=e.nodeType?[e]:e,r=0;r<n.length;r+=1)if(n[r]===a)return!0;return!1}return!1},di.keydown=g,di.keypress=y,di.keyup=m,di.mousedown=E,di.mouseenter=O,di.mouseleave=A,di.mousemove=x,di.mouseout=T,di.mouseover=L,di.mouseup=S,di.next=function(t){return this.length>0?t?this[0].nextElementSibling&&f(this[0].nextElementSibling).is(t)?f([this[0].nextElementSibling]):f([]):this[0].nextElementSibling?f([this[0].nextElementSibling]):f([]):f([])},di.nextAll=function(t){var e=[],n=this[0];if(!n)return f([]);for(;n.nextElementSibling;){var r=n.nextElementSibling;t?f(r).is(t)&&e.push(r):e.push(r),n=r}return f(e)},di.off=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],o=e[2],u=e[3];"function"==typeof e[1]&&(r=e[0],o=e[1],u=e[2],i=void 0),u||(u=!1);for(var a=r.split(" "),f=0;f<a.length;f+=1)for(var c=a[f],s=0;s<this.length;s+=1){var l=this[s],h=void 0;if(!i&&l.dom7Listeners?h=l.dom7Listeners[c]:i&&l.dom7LiveListeners&&(h=l.dom7LiveListeners[c]),h&&h.length)for(var p=h.length-1;p>=0;p-=1){var d=h[p];o&&d.listener===o||o&&d.listener&&d.listener.dom7proxy&&d.listener.dom7proxy===o?(l.removeEventListener(c,d.proxyListener,u),h.splice(p,1)):o||(l.removeEventListener(c,d.proxyListener,u),h.splice(p,1))}}return this},di.offset=function(){if(this.length>0){var e=t.getWindow(),n=t.getDocument(),r=this[0],i=r.getBoundingClientRect(),o=n.body,u=r.clientTop||o.clientTop||0,a=r.clientLeft||o.clientLeft||0,f=r===e?e.scrollY:r.scrollTop,c=r===e?e.scrollX:r.scrollLeft;return{top:i.top+f-u,left:i.left+c-a}}return null},di.on=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],o=e[2],u=e[3];function a(t){var e=t.target;if(e){var n=t.target.dom7EventData||[];if(n.indexOf(t)<0&&n.unshift(t),f(e).is(i))o.apply(e,n);else for(var r=f(e).parents(),u=0;u<r.length;u+=1)f(r[u]).is(i)&&o.apply(r[u],n)}}function c(t){var e=t&&t.target&&t.target.dom7EventData||[];e.indexOf(t)<0&&e.unshift(t),o.apply(this,e)}"function"==typeof e[1]&&(r=e[0],o=e[1],u=e[2],i=void 0),u||(u=!1);for(var s,l=r.split(" "),h=0;h<this.length;h+=1){var p=this[h];if(i)for(s=0;s<l.length;s+=1){var d=l[s];p.dom7LiveListeners||(p.dom7LiveListeners={}),p.dom7LiveListeners[d]||(p.dom7LiveListeners[d]=[]),p.dom7LiveListeners[d].push({listener:o,proxyListener:a}),p.addEventListener(d,a,u)}else for(s=0;s<l.length;s+=1){var v=l[s];p.dom7Listeners||(p.dom7Listeners={}),p.dom7Listeners[v]||(p.dom7Listeners[v]=[]),p.dom7Listeners[v].push({listener:o,proxyListener:c}),p.addEventListener(v,c,u)}}return this},di.once=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],o=n[1],u=n[2],a=n[3];function f(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];u.apply(this,n),t.off(i,o,f,a),f.dom7proxy&&delete f.dom7proxy}return"function"==typeof n[1]&&(i=n[0],u=n[1],a=n[2],o=void 0),f.dom7proxy=u,t.on(i,o,f,a)},di.outerHeight=function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},di.outerWidth=function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},di.parent=function(t){for(var e=[],n=0;n<this.length;n+=1)null!==this[n].parentNode&&(t?f(this[n].parentNode).is(t)&&e.push(this[n].parentNode):e.push(this[n].parentNode));return f(e)},di.parents=function(t){for(var e=[],n=0;n<this.length;n+=1)for(var r=this[n].parentNode;r;)t?f(r).is(t)&&e.push(r):e.push(r),r=r.parentNode;return f(e)},di.prepend=function(e){var n,r,i=t.getDocument();for(n=0;n<this.length;n+=1)if("string"==typeof e){var u=i.createElement("div");for(u.innerHTML=e,r=u.childNodes.length-1;r>=0;r-=1)this[n].insertBefore(u.childNodes[r],this[n].childNodes[0])}else if(e instanceof o)for(r=0;r<e.length;r+=1)this[n].insertBefore(e[r],this[n].childNodes[0]);else this[n].insertBefore(e,this[n].childNodes[0]);return this},di.prependTo=function(t){return f(t).prepend(this),this},di.prev=function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&f(e.previousElementSibling).is(t)?f([e.previousElementSibling]):f([]):e.previousElementSibling?f([e.previousElementSibling]):f([])}return f([])},di.prevAll=function(t){var e=[],n=this[0];if(!n)return f([]);for(;n.previousElementSibling;){var r=n.previousElementSibling;t?f(r).is(t)&&e.push(r):e.push(r),n=r}return f(e)},di.prop=function(t,e){if(1!==arguments.length||"string"!=typeof t){for(var n=0;n<this.length;n+=1)if(2===arguments.length)this[n][t]=e;else for(var r in t)this[n][r]=t[r];return this}return this[0]?this[0][t]:this},di.remove=function(){for(var t=0;t<this.length;t+=1)this[t].parentNode&&this[t].parentNode.removeChild(this[t]);return this},di.removeAttr=function(t){for(var e=0;e<this.length;e+=1)this[e].removeAttribute(t);return this},di.removeClass=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=u(e.map((function(t){return t.split(" ")})));return this.forEach((function(t){var e;(e=t.classList).remove.apply(e,r)})),this},di.removeData=function(t){for(var e=0;e<this.length;e+=1){var n=this[e];n.dom7ElementDataStorage&&n.dom7ElementDataStorage[t]&&(n.dom7ElementDataStorage[t]=null,delete n.dom7ElementDataStorage[t])}},di.resize=I,di.scroll=C,di.scrollLeft=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],o=e[2],u=e[3];3===e.length&&"function"==typeof o&&(r=e[0],i=e[1],u=e[2],o=e[3]);var a=this;return void 0===r?a.length>0?a[0].scrollLeft:null:a.scrollTo(r,void 0,i,o,u)},di.scrollTo=function(){for(var e=t.getWindow(),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r[0],u=r[1],a=r[2],f=r[3],c=r[4];return 4===r.length&&"function"==typeof f&&(c=f,o=r[0],u=r[1],a=r[2],c=r[3],f=r[4]),void 0===f&&(f="swing"),this.each((function(){var t,n,r,i,s,l,h,p,d=this,v=u>0||0===u,m=o>0||0===o;if(void 0===f&&(f="swing"),v&&(t=d.scrollTop,a||(d.scrollTop=u)),m&&(n=d.scrollLeft,a||(d.scrollLeft=o)),a){v&&(r=d.scrollHeight-d.offsetHeight,s=Math.max(Math.min(u,r),0)),m&&(i=d.scrollWidth-d.offsetWidth,l=Math.max(Math.min(o,i),0));var g=null;v&&s===t&&(v=!1),m&&l===n&&(m=!1),e.requestAnimationFrame((function r(i){void 0===i&&(i=(new Date).getTime()),null===g&&(g=i);var o,u=Math.max(Math.min((i-g)/a,1),0),y="linear"===f?u:.5-Math.cos(u*Math.PI)/2;v&&(h=t+y*(s-t)),m&&(p=n+y*(l-n)),v&&s>t&&h>=s&&(d.scrollTop=s,o=!0),v&&s<t&&h<=s&&(d.scrollTop=s,o=!0),m&&l>n&&p>=l&&(d.scrollLeft=l,o=!0),m&&l<n&&p<=l&&(d.scrollLeft=l,o=!0),o?c&&c():(v&&(d.scrollTop=h),m&&(d.scrollLeft=p),e.requestAnimationFrame(r))}))}}))},di.scrollTop=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0],i=e[1],o=e[2],u=e[3];3===e.length&&"function"==typeof o&&(r=e[0],i=e[1],u=e[2],o=e[3]);var a=this;return void 0===r?a.length>0?a[0].scrollTop:null:a.scrollTo(void 0,r,i,o,u)},di.show=function(){for(var e=t.getWindow(),n=0;n<this.length;n+=1){var r=this[n];"none"===r.style.display&&(r.style.display=""),"none"===e.getComputedStyle(r,null).getPropertyValue("display")&&(r.style.display="block")}return this},di.siblings=function(t){return this.nextAll(t).add(this.prevAll(t))},di.stop=function(){for(var t=this,e=0;e<t.length;e+=1)t[e].dom7AnimateInstance&&t[e].dom7AnimateInstance.stop()},di.styles=function(){var e=t.getWindow();return this[0]?e.getComputedStyle(this[0],null):{}},di.submit=b,di.text=function(t){if(void 0===t)return this[0]?this[0].textContent.trim():null;for(var e=0;e<this.length;e+=1)this[e].textContent=t;return this},di.toggleClass=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=u(e.map((function(t){return t.split(" ")})));this.forEach((function(t){r.forEach((function(e){t.classList.toggle(e)}))}))},di.touchend=M,di.touchmove=P,di.touchstart=j,di.transform=function(t){for(var e=0;e<this.length;e+=1)this[e].style.transform=t;return this},di.transition=function(t){for(var e=0;e<this.length;e+=1)this[e].style.transitionDuration="string"!=typeof t?t+"ms":t;return this},di.transitionEnd=function(t){var e=this;return t&&e.on("transitionend",(function n(r){r.target===this&&(t.call(this,r),e.off("transitionend",n))})),this},di.trigger=function(){for(var e=t.getWindow(),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r[0].split(" "),u=r[1],a=0;a<o.length;a+=1)for(var f=o[a],c=0;c<this.length;c+=1){var s=this[c];if(e.CustomEvent){var l=new e.CustomEvent(f,{detail:u,bubbles:!0,cancelable:!0});s.dom7EventData=r.filter((function(t,e){return e>0})),s.dispatchEvent(l),s.dom7EventData=[],delete s.dom7EventData}}return this},di.val=function(t){if(void 0===t){var e=this[0];if(!e)return;if(e.multiple&&"select"===e.nodeName.toLowerCase()){for(var n=[],r=0;r<e.selectedOptions.length;r+=1)n.push(e.selectedOptions[r].value);return n}return e.value}for(var i=0;i<this.length;i+=1){var o=this[i];if(Array.isArray(t)&&o.multiple&&"select"===o.nodeName.toLowerCase())for(var u=0;u<o.options.length;u+=1)o.options[u].selected=t.indexOf(o.options[u].value)>=0;else o.value=t}return this},di.value=function(t){return this.val(t)},di.width=function(){var e=t.getWindow();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null},di}var yi=gi(),bi=u(yi);yi.append&&(bi.fn.append=yi.append),yi.html&&(bi.fn.html=yi.html),yi.val&&(bi.fn.val=yi.val),yi.on&&(bi.fn.on=yi.on),yi.focus&&(bi.fn.focus=yi.focus),yi.is&&(bi.fn.is=yi.is),yi.parents&&(bi.fn.parents=yi.parents),yi.find&&(bi.fn.find=yi.find);var wi,Ei,xi,Si,Oi,Ai,Ti,Li={};function ji(){if(Ei)return wi;Ei=1;var t=TypeError;return wi=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}}function Mi(){if(Si)return xi;Si=1;var t=Ut(),e=ae(),n=ke();return xi=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o}}function Pi(){if(Ai)return Oi;Ai=1;var t=Q(),e=ct(),n=ut(),r=e("species");return Oi=function(e){return n>=51||!t((function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}}!function(){if(Ti)return Li;Ti=1;var t=Jn(),e=Q(),n=Nr(),r=Gt(),i=rt(),o=Tn(),u=ji(),a=Mi(),f=_r(),c=Pi(),s=ct(),l=ut(),h=s("isConcatSpreadable"),p=l>=51||!e((function(){var t=[];return t[h]=!1,t.concat()[0]!==t})),d=function(t){if(!r(t))return!1;var e=t[h];return void 0!==e?!!e:n(t)};t({target:"Array",proto:!0,arity:1,forced:!p||!c("concat")},{concat:function(t){var e,n,r,c,s,l=i(this),h=f(l,0),p=0;for(e=-1,r=arguments.length;e<r;e++)if(d(s=-1===e?l:arguments[e]))for(c=o(s),u(p+c),n=0;n<c;n++,p++)n in s&&a(h,p,s[n]);else u(p+1),a(h,p++,s);return h.length=p,h}})}();let Ii=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"");function Ci(t){return"".concat(t,"-").concat(Ii())}function Ni(){return Ci("w-e-insert-formula")}var Di=function(){function t(){this.title=e.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=Ni(),this.buttonId=Ni()}return t.prototype.getSelectedElem=function(t){var n=e.DomEditor.getSelectedNodeByType(t,"formula");return null==n?null:n},t.prototype.getValue=function(t){var e=this.getSelectedElem(t);return e&&e.value||""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,e){},t.prototype.isDisabled=function(t){var n=t.selection;return null==n||(!!e.SlateRange.isExpanded(n)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var n=this,r=this.textareaId,o=this.buttonId,u=i(e.genModalTextareaElems(e.t("formula.formula"),r,e.t("formula.placeholder")),2),a=u[0],f=u[1],c=bi(f),s=i(e.genModalButtonElems(o,e.t("formula.ok")),1)[0];if(null==this.$content){var l=bi("<div></div>");l.on("click","#".concat(o),(function(e){e.preventDefault();var i=l.find("#".concat(r)).val().trim();n.updateFormula(t,i),t.hidePanelOrModal()})),this.$content=l}var h=this.$content;h.html(""),h.append(a),h.append(s);var p=this.getValue(t);return c.val(p),setTimeout((function(){c.focus()})),h[0]},t.prototype.updateFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var i=e.DomEditor.findPath(t,r),o={value:n};e.SlateTransforms.setNodes(t,o,{at:i})}}},t}();function _i(){return Ci("w-e-insert-formula")}var Fi=function(){function t(){this.title=e.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=_i(),this.buttonId=_i()}return t.prototype.getValue=function(t){return""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,e){},t.prototype.isDisabled=function(t){var n=t.selection;if(null==n)return!0;if(e.SlateRange.isExpanded(n))return!0;var r=e.DomEditor.getSelectedElems(t);return!!r.some((function(e){return t.isVoid(e)}))||!!r.some((function(t){return"pre"===e.DomEditor.getNodeType(t)}))},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var n=this,r=this.textareaId,o=this.buttonId,u=i(e.genModalTextareaElems(e.t("formula.formula"),r,e.t("formula.placeholder")),2),a=u[0],f=u[1],c=bi(f),s=i(e.genModalButtonElems(o,e.t("formula.ok")),1)[0];if(null==this.$content){var l=bi("<div></div>");l.on("click","#".concat(o),(function(e){e.preventDefault();var i=l.find("#".concat(r)).val().trim();n.insertFormula(t,i),t.hidePanelOrModal()})),this.$content=l}var h=this.$content;return h.html(""),h.append(a),h.append(s),c.val(""),setTimeout((function(){c.focus()})),h[0]},t.prototype.insertFormula=function(t,e){if(e&&(t.restoreSelection(),!this.isDisabled(t))){var n={type:"formula",value:e,children:[{text:""}]};t.insertNode(n)}},t}();return{editorPlugin:function(t){var n=t.isInline,r=t.isVoid,i=t;return i.isInline=function(t){return"formula"===e.DomEditor.getNodeType(t)||n(t)},i.isVoid=function(t){return"formula"===e.DomEditor.getNodeType(t)||r(t)},i},renderElems:[{type:"formula",renderElem:function(t,r,i){var o=e.DomEditor.isNodeSelected(i,t),u=t.value,a=void 0===u?"":u,f=n.h("w-e-formula-card",{dataset:{value:a}},null);return n.h("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[f])}}],elemsToHtml:[Pr],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,e,n){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new Fi}},{key:"editFormula",factory:function(){return new Di}}]}}));
|
|
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,S,O,j,T,L,I,M,A,P,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.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"}),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 O?S:(O=1,S=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 M;A=1;var t=Z(),n=et(),e=t({}.hasOwnProperty);return M=Object.hasOwn||function(t,r){return e(n(t),r)}}function ot(){if(C)return P;C=1;var t=Z(),n=0,e=Math.random(),r=t(1..toString);return P=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,St,Ot,jt,Tt,Lt,It,Mt,At,Pt,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(Ot)return St;Ot=1;var t=Q(),n=Function.prototype.call;return St=t?n.bind(n):function(){return n.apply(n,arguments)},St}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 Mt;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 Mt=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 Pt;Ct=1;var t=String;return Pt=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,Sn,On,jn,Tn,Ln,In,Mn,An,Pn,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(Sn)return xn;Sn=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(On)return kn.exports;On=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 Mn;An=1;var t=ft(),n=lt(),e=qn(),r=at()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return Mn=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 Pn;Cn=1;var t=ft(),n=Wn();return Pn=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 Se(){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 Oe(){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=Oe();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=Se(),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,Me,Ae,Pe,Ce,Re,ke,Ne,_e,Fe,De,He,ze,$e,Be,Ve,qe,We,Ue,Ge={};function Ke(){if(Ae)return Me;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 Me=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 Pe;Ce=1;var t=rt(),n=Ke(),e=re(),r=cn();return Pe=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,Sr,Or,jr,Tr,Lr,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 Ar(){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 Pr(){if(gr)return yr;gr=1;var t=qn();return yr=Array.isArray||function(n){return"Array"===t(n)}}function Cr(){if(wr)return br;wr=1;var t=Pr(),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 Rr(){if(xr)return Er;xr=1;var t=Cr();return Er=function(n,e){return new(t(n))(0===e?0:e)}}function kr(){if(Tr)return jr;Tr=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)}),jr=function(t){o[r][t]=!0}}!function(){if(Lr)return Mr;Lr=1;var t=Ye(),n=function(){if(Or)return Sr;Or=1;var t=Ar(),n=Z(),e=ne(),r=et(),o=je(),i=Rr(),u=n([].push),c=function(n){var c=1===n,a=2===n,f=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),x=o(E),S=t(h,m),O=0,j=y||i,T=c?j(v,x):a||p?j(v,0):void 0;x>O;O++)if((d||O in E)&&(b=S(g=E[O],O,w),n))if(c)T[O]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return O;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:f||l?l:T}};return Sr={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=kr(),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 Nr,_r,Fr,Dr,Hr,zr,$r,Br,Vr,qr,Wr,Ur,Gr,Kr={};function Xr(){if(_r)return Nr;_r=1;var t=Wn(),n=String;return Nr=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Yr(){if(Dr)return Fr;Dr=1;var t=Yt();return Fr=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 Jr(){if(Ur)return Wr;Ur=1;var t,n,e=Jt(),r=Z(),o=Xr(),i=Yr(),u=function(){if(zr)return Hr;zr=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 Hr={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=Y(),a=sr(),l=$n().get,s=function(){if(Br)return $r;Br=1;var t=J(),n=f().RegExp;return $r=t((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}(),p=function(){if(qr)return Vr;qr=1;var t=J(),n=f().RegExp;return Vr=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,S=this,O=l(S),j=o(t),T=O.raw;if(T)return T.lastIndex=S.lastIndex,n=e(h,T,j),S.lastIndex=T.lastIndex,n;var L=O.groups,I=E&&S.sticky,M=e(i,S),A=S.source,P=0,C=j;if(I&&(M=g(M,"y",""),-1===y(M,"g")&&(M+="g"),C=b(j,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==m(j,S.lastIndex-1))&&(A="(?: "+A+")",C=" "+C,P++),r=new RegExp("^(?:"+A+")",M)),x&&(r=new RegExp("^"+A+"$(?!\\s)",M)),w&&(u=S.lastIndex),c=e(v,I?r:S,C),I?c?(c.input=b(c.input,P),c[0]=b(c[0],P),c.index=S.lastIndex,S.lastIndex+=c[0].length):S.lastIndex=0:w&&c&&(S.lastIndex=S.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}),Wr=h}!function(){if(Gr)return Kr;Gr=1;var t=Ye(),n=Jr();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var Qr,Zr,to,no,eo,ro,oo,io={};function uo(){return Zr?Qr:(Zr=1,Qr="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(oo)return io;oo=1;var t=Ye(),n=function(){if(no)return to;no=1;var t=Z(),n=nt(),e=Xr(),r=uo(),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 to={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(ro)return eo;ro=1;var t=Nn().PROPER,n=J(),e=uo();return eo=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 co,ao,fo={};function lo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function so(t={},n={}){Object.keys(n).forEach((e=>{void 0===t[e]?t[e]=n[e]:lo(n[e])&&lo(t[e])&&Object.keys(n[e]).length>0&&so(t[e],n[e])}))}ao||(ao=1,function(){if(co)return fo;co=1;var t=Ye(),n=f();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const po={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 vo(){const t="undefined"!=typeof document?document:{};return so(t,po),t}const ho={document:po,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 mo(){const t="undefined"!=typeof window?window:{};return so(t,ho),t}class yo 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 go(t,n){const e=mo(),r=vo();let o=[];if(!n&&t instanceof yo)return t;if(!t)return new yo(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 yo)return t;o=t}return new yo(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 bo(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 wo(...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),go(n).is(e))r.apply(n,o);else{const t=go(n).parents();for(let n=0;n<t.length;n+=1)go(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 Eo(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 xo(t){const n=mo(),e=vo(),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=go(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 yo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function So(...t){let n;const e=vo();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 yo)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Oo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?go(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return go(n)}function jo(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 go(n)}go.fn=yo.prototype;const To="resize scroll".split(" ");const Lo=(Io="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)To.indexOf(Io)<0&&(Io in this[t]?this[t][Io]():go(this[t]).trigger(Io));return this}return this.on(Io,...t)});var Io;So&&(go.fn.append=So),Eo&&(go.fn.html=Eo),bo&&(go.fn.val=bo),wo&&(go.fn.on=wo),Lo&&(go.fn.focus=Lo),xo&&(go.fn.is=xo),Oo&&(go.fn.parents=Oo),jo&&(go.fn.find=jo);var Mo,Ao,Po,Co,Ro,ko,No,_o={};function Fo(){if(Ao)return Mo;Ao=1;var t=TypeError;return Mo=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Do(){if(Co)return Po;Co=1;var t=Wt(),n=cn(),e=Fn();return Po=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Ho(){if(ko)return Ro;ko=1;var t=J(),n=at(),e=it(),r=n("species");return Ro=function(n){return e>=51||!t((function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo}))}}!function(){if(No)return _o;No=1;var t=Ye(),n=J(),e=Pr(),r=Ut(),o=et(),i=je(),u=Fo(),c=Do(),a=Rr(),f=Ho(),l=at(),s=it(),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||!f("concat")},{concat:function(t){var n,e,r,f,l,s=o(this),p=a(s,0),d=0;for(n=-1,r=arguments.length;n<r;n++)if(v(l=-1===n?s:arguments[n]))for(f=i(l),u(d+f),e=0;e<f;e++,d++)e in l&&c(p,d,l[e]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();let zo=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,n)=>t+=(n&=63)<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n>62?"-":"_"),"");function $o(t){return"".concat(t,"-").concat(zo())}function Bo(){return $o("w-e-insert-formula")}var Vo=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=Bo(),this.buttonId=Bo()}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=go(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=go("<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 qo(){return $o("w-e-insert-formula")}var Wo=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],a=go(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=go("<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 Wo}},{key:"editFormula",factory:function(){return new Vo}}]}}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|