@wangeditor-next/plugin-formula 0.0.11 → 0.0.12-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,2 +1,2590 @@
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,_,k,F,R,W,V,H,q,B,z,$,U,G,X={exports:{}};function K(){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 X.exports;v=1;var t=h?l:(h=1,l=!1),e=s(),n=K(),r="__core-js_shared__",i=X.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"}),X.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(F)return k;F=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]),k=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(H)return V;H=1;var t=at();return V=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ct(){if(B)return q;B=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 q=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,kt,Ft,Rt,Wt,Vt,Ht,qt,Bt,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 Xt(){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 Kt(){if(bt)return yt;bt=1;var t=Ut(),e=Q(),n=Xt();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(Ft)return kt;Ft=1;var t=ne(),e=et();return kt=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(Ht)return Vt;Ht=1;var t=Qt(),e=Gt(),n=te(),r=re(),i=ie(),o=ct(),u=TypeError,a=o("toPrimitive");return Vt=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(Bt)return qt;Bt=1;var t=oe(),e=te();return qt=function(n){var r=t(n,"string");return e(r)?r:r+""}}function ae(){if(zt)return $t;zt=1;var t=Ut(),e=Kt(),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 ke(){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 Fe(){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=Fe();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 Ve(){return Ee?we:(Ee=1,we={})}function He(){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=Ve(),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 qe(){if(Oe)return De.exports;Oe=1;var t=tt(),e=Q(),n=lt(),r=it(),i=Ut(),o=_e().CONFIGURABLE,u=ke(),a=He(),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 Be(){if(Te)return Ae;Te=1;var t=lt(),e=ae(),n=qe(),r=K();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=Be(),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,Xe,Ke,Ye,Je,Qe={},Ze={},tn={};function en(){if(Xe)return Ge;Xe=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 Ke;Ye=1;var t=en(),e=nt();return Ke=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=Fe(),i=nn(),o=ue(),u=it(),a=Kt(),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=Ve(),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,kn,Fn,Rn,Wn,Vn,Hn,qn,Bn,zn,$n,Un,Gn,Xn={};function Kn(){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,Xn.f=Object.getOwnPropertySymbols),Xn),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=Kn(),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(Fn)return kn;Fn=1;var t=s(),e=rn().f,n=Re(),r=Be(),i=K(),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 kn=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(Hn)return Vn;Hn=1;var t=tt();return Vn=t([].slice)}function Zn(){if(Bn)return qn;Bn=1;var t=tt(),e=ne(),n=Gt(),r=it(),i=Qn(),o=Z(),u=Function,a=t([].concat),f=t([].join),c={};return qn=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},qn}function tr(){if($n)return zn;$n=1;var t=tt(),e=Q(),n=lt(),r=$e(),i=Zt(),o=ke(),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=Ve(),o=hr(),u=Xt(),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,i=r.createElement("link");i.rel="stylesheet",i.href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css",i.integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV",i.crossOrigin="anonymous",n.appendChild(i);var o=r.createElement("span");return o.style.display="inline-block",n.appendChild(o),t.span=o,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})},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 kr(){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=kr(),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 Fr,Rr,Wr,Vr,Hr,qr,Br,zr,$r,Ur,Gr,Xr,Kr,Yr={};function Jr(){if(Rr)return Fr;Rr=1;var t=$e(),e=String;return Fr=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return e(n)}}function Qr(){if(Vr)return Wr;Vr=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(Xr)return Gr;Xr=1;var t,e,n=Qt(),r=tt(),i=Jr(),o=Qr(),u=function(){if(qr)return Hr;qr=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 Hr={BROKEN_CARET:i,MISSED_STICKY:r,UNSUPPORTED_Y:n}}(),a=J(),f=pr(),c=He().get,l=function(){if(zr)return Br;zr=1;var t=Q(),e=s().RegExp;return Br=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(Kr)return Yr;Kr=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=Fe();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 ki=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",{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 ki}},{key:"editFormula",factory:function(){return new Di}}]}}));
2
- //# sourceMappingURL=index.js.map
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('katex'), require('@wangeditor-next/editor'), require('snabbdom')) :
3
+ typeof define === 'function' && define.amd ? define(['katex', '@wangeditor-next/editor', 'snabbdom'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.WangEditorFormulaPlugin = factory(global.katex, global.editor, global.snabbdom));
5
+ })(this, (function (katex, editor, snabbdom) { 'use strict';
6
+
7
+ /******************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise, SuppressedError, Symbol */
22
+
23
+ var extendStatics = function(d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+
30
+ function __extends(d, b) {
31
+ if (typeof b !== "function" && b !== null)
32
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
+ extendStatics(d, b);
34
+ function __() { this.constructor = d; }
35
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
+ }
37
+
38
+ function __read(o, n) {
39
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
40
+ if (!m) return o;
41
+ var i = m.call(o), r, ar = [], e;
42
+ try {
43
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
+ }
45
+ catch (error) { e = { error: error }; }
46
+ finally {
47
+ try {
48
+ if (r && !r.done && (m = i["return"])) m.call(i);
49
+ }
50
+ finally { if (e) throw e.error; }
51
+ }
52
+ return ar;
53
+ }
54
+
55
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
56
+ var e = new Error(message);
57
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
58
+ };
59
+
60
+ // @ts-nocheck
61
+ // 参考 https://github.com/webcomponents/custom-elements/blob/master/src/native-shim.js
62
+ /**
63
+ * @license
64
+ * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
65
+ * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
66
+ * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
67
+ * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
68
+ * Code distributed by Google as part of the polymer project is also
69
+ * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
70
+ */
71
+ /**
72
+ * This shim allows elements written in, or compiled to, ES5 to work on native
73
+ * implementations of Custom Elements v1. It sets new.target to the value of
74
+ * this.constructor so that the native HTMLElement constructor can access the
75
+ * current under-construction element's definition.
76
+ */
77
+ (function () {
78
+ if (
79
+ // No Reflect, no classes, no need for shim because native custom elements
80
+ // require ES2015 classes or Reflect.
81
+ window.Reflect === undefined
82
+ || window.customElements === undefined
83
+ // The webcomponentsjs custom elements polyfill doesn't require
84
+ // ES2015-compatible construction (`super()` or `Reflect.construct`).
85
+ || window.customElements.polyfillWrapFlushCallback) {
86
+ return;
87
+ }
88
+ var BuiltInHTMLElement = HTMLElement;
89
+ /**
90
+ * With jscompiler's RECOMMENDED_FLAGS the function name will be optimized away.
91
+ * However, if we declare the function as a property on an object literal, and
92
+ * use quotes for the property name, then closure will leave that much intact,
93
+ * which is enough for the JS VM to correctly set Function.prototype.name.
94
+ */
95
+ var wrapperForTheName = {
96
+ // eslint-disable-next-line func-names
97
+ HTMLElement: /** @this {!Object} */ function HTMLElement() {
98
+ return Reflect.construct(BuiltInHTMLElement, [], /** @type {!Function} */ this.constructor);
99
+ },
100
+ };
101
+ window.HTMLElement = wrapperForTheName.HTMLElement;
102
+ HTMLElement.prototype = BuiltInHTMLElement.prototype;
103
+ HTMLElement.prototype.constructor = HTMLElement;
104
+ Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);
105
+ }());
106
+
107
+ var katexStyleContent = undefined;
108
+
109
+ /**
110
+ * @description 注册自定义 elem
111
+ * @author wangfupeng
112
+ */
113
+ var WangEditorFormulaCard = /** @class */ (function (_super) {
114
+ __extends(WangEditorFormulaCard, _super);
115
+ function WangEditorFormulaCard() {
116
+ var _this = _super.call(this) || this;
117
+ var shadow = _this.attachShadow({ mode: 'open' });
118
+ var document = shadow.ownerDocument;
119
+ var style = document.createElement('style');
120
+ style.innerHTML = katexStyleContent; // 加载 css 文本
121
+ shadow.appendChild(style);
122
+ var span = document.createElement('span');
123
+ span.style.display = 'inline-block';
124
+ shadow.appendChild(span);
125
+ _this.span = span;
126
+ return _this;
127
+ }
128
+ Object.defineProperty(WangEditorFormulaCard, "observedAttributes", {
129
+ // 监听的 attr
130
+ get: function () {
131
+ return ['data-value'];
132
+ },
133
+ enumerable: false,
134
+ configurable: true
135
+ });
136
+ // connectedCallback() {
137
+ // // 当 custom element首次被插入文档DOM时,被调用
138
+ // console.log('connected')
139
+ // }
140
+ // disconnectedCallback() {
141
+ // // 当 custom element从文档DOM中删除时,被调用
142
+ // console.log('disconnected')
143
+ // }
144
+ // adoptedCallback() {
145
+ // // 当 custom element被移动到新的文档时,被调用
146
+ // console.log('adopted')
147
+ // }
148
+ WangEditorFormulaCard.prototype.attributeChangedCallback = function (name, oldValue, newValue) {
149
+ if (name === 'data-value') {
150
+ if (oldValue === newValue) {
151
+ return;
152
+ }
153
+ this.render(newValue || '');
154
+ }
155
+ };
156
+ WangEditorFormulaCard.prototype.render = function (value) {
157
+ katex.render(value, this.span, {
158
+ throwOnError: false,
159
+ });
160
+ };
161
+ return WangEditorFormulaCard;
162
+ }(HTMLElement));
163
+ if (!window.customElements.get('w-e-formula-card')) {
164
+ window.customElements.define('w-e-formula-card', WangEditorFormulaCard);
165
+ }
166
+
167
+ /**
168
+ * @description 多语言
169
+ * @author wangfupeng
170
+ */
171
+ editor.i18nAddResources('en', {
172
+ formula: {
173
+ formula: 'Formula',
174
+ placeholder: 'Use LateX syntax',
175
+ insert: 'Insert formula',
176
+ edit: 'Edit formula',
177
+ ok: 'OK',
178
+ },
179
+ });
180
+ editor.i18nAddResources('zh-CN', {
181
+ formula: {
182
+ formula: '公式',
183
+ placeholder: '使用 LateX 语法',
184
+ insert: '插入公式',
185
+ edit: '编辑公式',
186
+ ok: '确定',
187
+ },
188
+ });
189
+
190
+ /**
191
+ * @description elem to html
192
+ * @author wangfupeng
193
+ */
194
+ // 生成 html 的函数
195
+ function formulaToHtml(elem, _childrenHtml) {
196
+ var _a = elem.value, value = _a === void 0 ? '' : _a;
197
+ return "<span data-w-e-type=\"formula\" data-w-e-is-void data-w-e-is-inline data-value=\"".concat(value, "\"></span>");
198
+ }
199
+ // 配置
200
+ var conf$1 = {
201
+ type: 'formula', // 节点 type ,重要!!!
202
+ elemToHtml: formulaToHtml,
203
+ };
204
+
205
+ /**
206
+ * @description icon svg
207
+ * @author wangfupeng
208
+ */
209
+ /**
210
+ * 【注意】svg 字符串的长度 ,否则会导致代码体积过大
211
+ * 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
212
+ * 找不到再从 iconfont.com 搜索
213
+ */
214
+ // 公式
215
+ var SIGMA_SVG = '<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>';
216
+ // 编辑
217
+ var PENCIL_SVG = '<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>';
218
+
219
+ function getDefaultExportFromCjs (x) {
220
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
221
+ }
222
+
223
+ var dom7_cjs = {};
224
+
225
+ var ssrWindow_umd$1 = {exports: {}};
226
+
227
+ /**
228
+ * SSR Window 3.0.0
229
+ * Better handling for window object in SSR environment
230
+ * https://github.com/nolimits4web/ssr-window
231
+ *
232
+ * Copyright 2020, Vladimir Kharlampidi
233
+ *
234
+ * Licensed under MIT
235
+ *
236
+ * Released on: November 9, 2020
237
+ */
238
+ var ssrWindow_umd = ssrWindow_umd$1.exports;
239
+
240
+ var hasRequiredSsrWindow_umd;
241
+
242
+ function requireSsrWindow_umd () {
243
+ if (hasRequiredSsrWindow_umd) return ssrWindow_umd$1.exports;
244
+ hasRequiredSsrWindow_umd = 1;
245
+ (function (module, exports) {
246
+ (function (global, factory) {
247
+ factory(exports) ;
248
+ }(ssrWindow_umd, (function (exports) {
249
+ /* eslint-disable no-param-reassign */
250
+ function isObject(obj) {
251
+ return (obj !== null &&
252
+ typeof obj === 'object' &&
253
+ 'constructor' in obj &&
254
+ obj.constructor === Object);
255
+ }
256
+ function extend(target, src) {
257
+ if (target === void 0) { target = {}; }
258
+ if (src === void 0) { src = {}; }
259
+ Object.keys(src).forEach(function (key) {
260
+ if (typeof target[key] === 'undefined')
261
+ target[key] = src[key];
262
+ else if (isObject(src[key]) &&
263
+ isObject(target[key]) &&
264
+ Object.keys(src[key]).length > 0) {
265
+ extend(target[key], src[key]);
266
+ }
267
+ });
268
+ }
269
+
270
+ var ssrDocument = {
271
+ body: {},
272
+ addEventListener: function () { },
273
+ removeEventListener: function () { },
274
+ activeElement: {
275
+ blur: function () { },
276
+ nodeName: '',
277
+ },
278
+ querySelector: function () {
279
+ return null;
280
+ },
281
+ querySelectorAll: function () {
282
+ return [];
283
+ },
284
+ getElementById: function () {
285
+ return null;
286
+ },
287
+ createEvent: function () {
288
+ return {
289
+ initEvent: function () { },
290
+ };
291
+ },
292
+ createElement: function () {
293
+ return {
294
+ children: [],
295
+ childNodes: [],
296
+ style: {},
297
+ setAttribute: function () { },
298
+ getElementsByTagName: function () {
299
+ return [];
300
+ },
301
+ };
302
+ },
303
+ createElementNS: function () {
304
+ return {};
305
+ },
306
+ importNode: function () {
307
+ return null;
308
+ },
309
+ location: {
310
+ hash: '',
311
+ host: '',
312
+ hostname: '',
313
+ href: '',
314
+ origin: '',
315
+ pathname: '',
316
+ protocol: '',
317
+ search: '',
318
+ },
319
+ };
320
+ function getDocument() {
321
+ var doc = typeof document !== 'undefined' ? document : {};
322
+ extend(doc, ssrDocument);
323
+ return doc;
324
+ }
325
+
326
+ var ssrWindow = {
327
+ document: ssrDocument,
328
+ navigator: {
329
+ userAgent: '',
330
+ },
331
+ location: {
332
+ hash: '',
333
+ host: '',
334
+ hostname: '',
335
+ href: '',
336
+ origin: '',
337
+ pathname: '',
338
+ protocol: '',
339
+ search: '',
340
+ },
341
+ history: {
342
+ replaceState: function () { },
343
+ pushState: function () { },
344
+ go: function () { },
345
+ back: function () { },
346
+ },
347
+ CustomEvent: function CustomEvent() {
348
+ return this;
349
+ },
350
+ addEventListener: function () { },
351
+ removeEventListener: function () { },
352
+ getComputedStyle: function () {
353
+ return {
354
+ getPropertyValue: function () {
355
+ return '';
356
+ },
357
+ };
358
+ },
359
+ Image: function () { },
360
+ Date: function () { },
361
+ screen: {},
362
+ setTimeout: function () { },
363
+ clearTimeout: function () { },
364
+ matchMedia: function () {
365
+ return {};
366
+ },
367
+ requestAnimationFrame: function (callback) {
368
+ if (typeof setTimeout === 'undefined') {
369
+ callback();
370
+ return null;
371
+ }
372
+ return setTimeout(callback, 0);
373
+ },
374
+ cancelAnimationFrame: function (id) {
375
+ if (typeof setTimeout === 'undefined') {
376
+ return;
377
+ }
378
+ clearTimeout(id);
379
+ },
380
+ };
381
+ function getWindow() {
382
+ var win = typeof window !== 'undefined' ? window : {};
383
+ extend(win, ssrWindow);
384
+ return win;
385
+ }
386
+
387
+ exports.extend = extend;
388
+ exports.getDocument = getDocument;
389
+ exports.getWindow = getWindow;
390
+ exports.ssrDocument = ssrDocument;
391
+ exports.ssrWindow = ssrWindow;
392
+
393
+ Object.defineProperty(exports, '__esModule', { value: true });
394
+
395
+ })));
396
+
397
+ } (ssrWindow_umd$1, ssrWindow_umd$1.exports));
398
+ return ssrWindow_umd$1.exports;
399
+ }
400
+
401
+ /**
402
+ * Dom7 3.0.0
403
+ * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
404
+ * https://framework7.io/docs/dom7.html
405
+ *
406
+ * Copyright 2020, Vladimir Kharlampidi
407
+ *
408
+ * Licensed under MIT
409
+ *
410
+ * Released on: November 9, 2020
411
+ */
412
+
413
+ var hasRequiredDom7_cjs;
414
+
415
+ function requireDom7_cjs () {
416
+ if (hasRequiredDom7_cjs) return dom7_cjs;
417
+ hasRequiredDom7_cjs = 1;
418
+
419
+ Object.defineProperty(dom7_cjs, '__esModule', { value: true });
420
+
421
+ var ssrWindow = requireSsrWindow_umd();
422
+
423
+ function _inheritsLoose(subClass, superClass) {
424
+ subClass.prototype = Object.create(superClass.prototype);
425
+ subClass.prototype.constructor = subClass;
426
+ subClass.__proto__ = superClass;
427
+ }
428
+
429
+ function _getPrototypeOf(o) {
430
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
431
+ return o.__proto__ || Object.getPrototypeOf(o);
432
+ };
433
+ return _getPrototypeOf(o);
434
+ }
435
+
436
+ function _setPrototypeOf(o, p) {
437
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
438
+ o.__proto__ = p;
439
+ return o;
440
+ };
441
+
442
+ return _setPrototypeOf(o, p);
443
+ }
444
+
445
+ function _isNativeReflectConstruct() {
446
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
447
+ if (Reflect.construct.sham) return false;
448
+ if (typeof Proxy === "function") return true;
449
+
450
+ try {
451
+ Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
452
+ return true;
453
+ } catch (e) {
454
+ return false;
455
+ }
456
+ }
457
+
458
+ function _construct(Parent, args, Class) {
459
+ if (_isNativeReflectConstruct()) {
460
+ _construct = Reflect.construct;
461
+ } else {
462
+ _construct = function _construct(Parent, args, Class) {
463
+ var a = [null];
464
+ a.push.apply(a, args);
465
+ var Constructor = Function.bind.apply(Parent, a);
466
+ var instance = new Constructor();
467
+ if (Class) _setPrototypeOf(instance, Class.prototype);
468
+ return instance;
469
+ };
470
+ }
471
+
472
+ return _construct.apply(null, arguments);
473
+ }
474
+
475
+ function _isNativeFunction(fn) {
476
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
477
+ }
478
+
479
+ function _wrapNativeSuper(Class) {
480
+ var _cache = typeof Map === "function" ? new Map() : undefined;
481
+
482
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
483
+ if (Class === null || !_isNativeFunction(Class)) return Class;
484
+
485
+ if (typeof Class !== "function") {
486
+ throw new TypeError("Super expression must either be null or a function");
487
+ }
488
+
489
+ if (typeof _cache !== "undefined") {
490
+ if (_cache.has(Class)) return _cache.get(Class);
491
+
492
+ _cache.set(Class, Wrapper);
493
+ }
494
+
495
+ function Wrapper() {
496
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
497
+ }
498
+
499
+ Wrapper.prototype = Object.create(Class.prototype, {
500
+ constructor: {
501
+ value: Wrapper,
502
+ enumerable: false,
503
+ writable: true,
504
+ configurable: true
505
+ }
506
+ });
507
+ return _setPrototypeOf(Wrapper, Class);
508
+ };
509
+
510
+ return _wrapNativeSuper(Class);
511
+ }
512
+
513
+ function _assertThisInitialized(self) {
514
+ if (self === void 0) {
515
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
516
+ }
517
+
518
+ return self;
519
+ }
520
+
521
+ /* eslint-disable no-proto */
522
+ function makeReactive(obj) {
523
+ var proto = obj.__proto__;
524
+ Object.defineProperty(obj, '__proto__', {
525
+ get: function get() {
526
+ return proto;
527
+ },
528
+ set: function set(value) {
529
+ proto.__proto__ = value;
530
+ }
531
+ });
532
+ }
533
+
534
+ var Dom7 = /*#__PURE__*/function (_Array) {
535
+ _inheritsLoose(Dom7, _Array);
536
+
537
+ function Dom7(items) {
538
+ var _this;
539
+
540
+ _this = _Array.call.apply(_Array, [this].concat(items)) || this;
541
+ makeReactive(_assertThisInitialized(_this));
542
+ return _this;
543
+ }
544
+
545
+ return Dom7;
546
+ }( /*#__PURE__*/_wrapNativeSuper(Array));
547
+
548
+ function arrayFlat(arr) {
549
+ if (arr === void 0) {
550
+ arr = [];
551
+ }
552
+
553
+ var res = [];
554
+ arr.forEach(function (el) {
555
+ if (Array.isArray(el)) {
556
+ res.push.apply(res, arrayFlat(el));
557
+ } else {
558
+ res.push(el);
559
+ }
560
+ });
561
+ return res;
562
+ }
563
+ function arrayFilter(arr, callback) {
564
+ return Array.prototype.filter.call(arr, callback);
565
+ }
566
+ function arrayUnique(arr) {
567
+ var uniqueArray = [];
568
+
569
+ for (var i = 0; i < arr.length; i += 1) {
570
+ if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);
571
+ }
572
+
573
+ return uniqueArray;
574
+ }
575
+ function toCamelCase(string) {
576
+ return string.toLowerCase().replace(/-(.)/g, function (match, group) {
577
+ return group.toUpperCase();
578
+ });
579
+ }
580
+
581
+ function qsa(selector, context) {
582
+ if (typeof selector !== 'string') {
583
+ return [selector];
584
+ }
585
+
586
+ var a = [];
587
+ var res = context.querySelectorAll(selector);
588
+
589
+ for (var i = 0; i < res.length; i += 1) {
590
+ a.push(res[i]);
591
+ }
592
+
593
+ return a;
594
+ }
595
+
596
+ function $(selector, context) {
597
+ var window = ssrWindow.getWindow();
598
+ var document = ssrWindow.getDocument();
599
+ var arr = [];
600
+
601
+ if (!context && selector instanceof Dom7) {
602
+ return selector;
603
+ }
604
+
605
+ if (!selector) {
606
+ return new Dom7(arr);
607
+ }
608
+
609
+ if (typeof selector === 'string') {
610
+ var html = selector.trim();
611
+
612
+ if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
613
+ var toCreate = 'div';
614
+ if (html.indexOf('<li') === 0) toCreate = 'ul';
615
+ if (html.indexOf('<tr') === 0) toCreate = 'tbody';
616
+ if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';
617
+ if (html.indexOf('<tbody') === 0) toCreate = 'table';
618
+ if (html.indexOf('<option') === 0) toCreate = 'select';
619
+ var tempParent = document.createElement(toCreate);
620
+ tempParent.innerHTML = html;
621
+
622
+ for (var i = 0; i < tempParent.childNodes.length; i += 1) {
623
+ arr.push(tempParent.childNodes[i]);
624
+ }
625
+ } else {
626
+ arr = qsa(selector.trim(), context || document);
627
+ } // arr = qsa(selector, document);
628
+
629
+ } else if (selector.nodeType || selector === window || selector === document) {
630
+ arr.push(selector);
631
+ } else if (Array.isArray(selector)) {
632
+ if (selector instanceof Dom7) return selector;
633
+ arr = selector;
634
+ }
635
+
636
+ return new Dom7(arrayUnique(arr));
637
+ }
638
+
639
+ $.fn = Dom7.prototype;
640
+
641
+ function addClass() {
642
+ for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {
643
+ classes[_key] = arguments[_key];
644
+ }
645
+
646
+ var classNames = arrayFlat(classes.map(function (c) {
647
+ return c.split(' ');
648
+ }));
649
+ this.forEach(function (el) {
650
+ var _el$classList;
651
+
652
+ (_el$classList = el.classList).add.apply(_el$classList, classNames);
653
+ });
654
+ return this;
655
+ }
656
+
657
+ function removeClass() {
658
+ for (var _len2 = arguments.length, classes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
659
+ classes[_key2] = arguments[_key2];
660
+ }
661
+
662
+ var classNames = arrayFlat(classes.map(function (c) {
663
+ return c.split(' ');
664
+ }));
665
+ this.forEach(function (el) {
666
+ var _el$classList2;
667
+
668
+ (_el$classList2 = el.classList).remove.apply(_el$classList2, classNames);
669
+ });
670
+ return this;
671
+ }
672
+
673
+ function toggleClass() {
674
+ for (var _len3 = arguments.length, classes = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
675
+ classes[_key3] = arguments[_key3];
676
+ }
677
+
678
+ var classNames = arrayFlat(classes.map(function (c) {
679
+ return c.split(' ');
680
+ }));
681
+ this.forEach(function (el) {
682
+ classNames.forEach(function (className) {
683
+ el.classList.toggle(className);
684
+ });
685
+ });
686
+ }
687
+
688
+ function hasClass() {
689
+ for (var _len4 = arguments.length, classes = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
690
+ classes[_key4] = arguments[_key4];
691
+ }
692
+
693
+ var classNames = arrayFlat(classes.map(function (c) {
694
+ return c.split(' ');
695
+ }));
696
+ return arrayFilter(this, function (el) {
697
+ return classNames.filter(function (className) {
698
+ return el.classList.contains(className);
699
+ }).length > 0;
700
+ }).length > 0;
701
+ }
702
+
703
+ function attr(attrs, value) {
704
+ if (arguments.length === 1 && typeof attrs === 'string') {
705
+ // Get attr
706
+ if (this[0]) return this[0].getAttribute(attrs);
707
+ return undefined;
708
+ } // Set attrs
709
+
710
+
711
+ for (var i = 0; i < this.length; i += 1) {
712
+ if (arguments.length === 2) {
713
+ // String
714
+ this[i].setAttribute(attrs, value);
715
+ } else {
716
+ // Object
717
+ for (var attrName in attrs) {
718
+ this[i][attrName] = attrs[attrName];
719
+ this[i].setAttribute(attrName, attrs[attrName]);
720
+ }
721
+ }
722
+ }
723
+
724
+ return this;
725
+ }
726
+
727
+ function removeAttr(attr) {
728
+ for (var i = 0; i < this.length; i += 1) {
729
+ this[i].removeAttribute(attr);
730
+ }
731
+
732
+ return this;
733
+ }
734
+
735
+ function prop(props, value) {
736
+ if (arguments.length === 1 && typeof props === 'string') {
737
+ // Get prop
738
+ if (this[0]) return this[0][props];
739
+ } else {
740
+ // Set props
741
+ for (var i = 0; i < this.length; i += 1) {
742
+ if (arguments.length === 2) {
743
+ // String
744
+ this[i][props] = value;
745
+ } else {
746
+ // Object
747
+ for (var propName in props) {
748
+ this[i][propName] = props[propName];
749
+ }
750
+ }
751
+ }
752
+
753
+ return this;
754
+ }
755
+
756
+ return this;
757
+ }
758
+
759
+ function data(key, value) {
760
+ var el;
761
+
762
+ if (typeof value === 'undefined') {
763
+ el = this[0];
764
+ if (!el) return undefined; // Get value
765
+
766
+ if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) {
767
+ return el.dom7ElementDataStorage[key];
768
+ }
769
+
770
+ var dataKey = el.getAttribute("data-" + key);
771
+
772
+ if (dataKey) {
773
+ return dataKey;
774
+ }
775
+
776
+ return undefined;
777
+ } // Set value
778
+
779
+
780
+ for (var i = 0; i < this.length; i += 1) {
781
+ el = this[i];
782
+ if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};
783
+ el.dom7ElementDataStorage[key] = value;
784
+ }
785
+
786
+ return this;
787
+ }
788
+
789
+ function removeData(key) {
790
+ for (var i = 0; i < this.length; i += 1) {
791
+ var el = this[i];
792
+
793
+ if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {
794
+ el.dom7ElementDataStorage[key] = null;
795
+ delete el.dom7ElementDataStorage[key];
796
+ }
797
+ }
798
+ }
799
+
800
+ function dataset() {
801
+ var el = this[0];
802
+ if (!el) return undefined;
803
+ var dataset = {}; // eslint-disable-line
804
+
805
+ if (el.dataset) {
806
+ for (var dataKey in el.dataset) {
807
+ dataset[dataKey] = el.dataset[dataKey];
808
+ }
809
+ } else {
810
+ for (var i = 0; i < el.attributes.length; i += 1) {
811
+ var _attr = el.attributes[i];
812
+
813
+ if (_attr.name.indexOf('data-') >= 0) {
814
+ dataset[toCamelCase(_attr.name.split('data-')[1])] = _attr.value;
815
+ }
816
+ }
817
+ }
818
+
819
+ for (var key in dataset) {
820
+ if (dataset[key] === 'false') dataset[key] = false;else if (dataset[key] === 'true') dataset[key] = true;else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1;
821
+ }
822
+
823
+ return dataset;
824
+ }
825
+
826
+ function val(value) {
827
+ if (typeof value === 'undefined') {
828
+ // get value
829
+ var el = this[0];
830
+ if (!el) return undefined;
831
+
832
+ if (el.multiple && el.nodeName.toLowerCase() === 'select') {
833
+ var values = [];
834
+
835
+ for (var i = 0; i < el.selectedOptions.length; i += 1) {
836
+ values.push(el.selectedOptions[i].value);
837
+ }
838
+
839
+ return values;
840
+ }
841
+
842
+ return el.value;
843
+ } // set value
844
+
845
+
846
+ for (var _i = 0; _i < this.length; _i += 1) {
847
+ var _el = this[_i];
848
+
849
+ if (Array.isArray(value) && _el.multiple && _el.nodeName.toLowerCase() === 'select') {
850
+ for (var j = 0; j < _el.options.length; j += 1) {
851
+ _el.options[j].selected = value.indexOf(_el.options[j].value) >= 0;
852
+ }
853
+ } else {
854
+ _el.value = value;
855
+ }
856
+ }
857
+
858
+ return this;
859
+ }
860
+
861
+ function value(value) {
862
+ return this.val(value);
863
+ }
864
+
865
+ function transform(transform) {
866
+ for (var i = 0; i < this.length; i += 1) {
867
+ this[i].style.transform = transform;
868
+ }
869
+
870
+ return this;
871
+ }
872
+
873
+ function transition(duration) {
874
+ for (var i = 0; i < this.length; i += 1) {
875
+ this[i].style.transitionDuration = typeof duration !== 'string' ? duration + "ms" : duration;
876
+ }
877
+
878
+ return this;
879
+ }
880
+
881
+ function on() {
882
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
883
+ args[_key5] = arguments[_key5];
884
+ }
885
+
886
+ var eventType = args[0],
887
+ targetSelector = args[1],
888
+ listener = args[2],
889
+ capture = args[3];
890
+
891
+ if (typeof args[1] === 'function') {
892
+ eventType = args[0];
893
+ listener = args[1];
894
+ capture = args[2];
895
+ targetSelector = undefined;
896
+ }
897
+
898
+ if (!capture) capture = false;
899
+
900
+ function handleLiveEvent(e) {
901
+ var target = e.target;
902
+ if (!target) return;
903
+ var eventData = e.target.dom7EventData || [];
904
+
905
+ if (eventData.indexOf(e) < 0) {
906
+ eventData.unshift(e);
907
+ }
908
+
909
+ if ($(target).is(targetSelector)) listener.apply(target, eventData);else {
910
+ var _parents = $(target).parents(); // eslint-disable-line
911
+
912
+
913
+ for (var k = 0; k < _parents.length; k += 1) {
914
+ if ($(_parents[k]).is(targetSelector)) listener.apply(_parents[k], eventData);
915
+ }
916
+ }
917
+ }
918
+
919
+ function handleEvent(e) {
920
+ var eventData = e && e.target ? e.target.dom7EventData || [] : [];
921
+
922
+ if (eventData.indexOf(e) < 0) {
923
+ eventData.unshift(e);
924
+ }
925
+
926
+ listener.apply(this, eventData);
927
+ }
928
+
929
+ var events = eventType.split(' ');
930
+ var j;
931
+
932
+ for (var i = 0; i < this.length; i += 1) {
933
+ var el = this[i];
934
+
935
+ if (!targetSelector) {
936
+ for (j = 0; j < events.length; j += 1) {
937
+ var event = events[j];
938
+ if (!el.dom7Listeners) el.dom7Listeners = {};
939
+ if (!el.dom7Listeners[event]) el.dom7Listeners[event] = [];
940
+ el.dom7Listeners[event].push({
941
+ listener: listener,
942
+ proxyListener: handleEvent
943
+ });
944
+ el.addEventListener(event, handleEvent, capture);
945
+ }
946
+ } else {
947
+ // Live events
948
+ for (j = 0; j < events.length; j += 1) {
949
+ var _event = events[j];
950
+ if (!el.dom7LiveListeners) el.dom7LiveListeners = {};
951
+ if (!el.dom7LiveListeners[_event]) el.dom7LiveListeners[_event] = [];
952
+
953
+ el.dom7LiveListeners[_event].push({
954
+ listener: listener,
955
+ proxyListener: handleLiveEvent
956
+ });
957
+
958
+ el.addEventListener(_event, handleLiveEvent, capture);
959
+ }
960
+ }
961
+ }
962
+
963
+ return this;
964
+ }
965
+
966
+ function off() {
967
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
968
+ args[_key6] = arguments[_key6];
969
+ }
970
+
971
+ var eventType = args[0],
972
+ targetSelector = args[1],
973
+ listener = args[2],
974
+ capture = args[3];
975
+
976
+ if (typeof args[1] === 'function') {
977
+ eventType = args[0];
978
+ listener = args[1];
979
+ capture = args[2];
980
+ targetSelector = undefined;
981
+ }
982
+
983
+ if (!capture) capture = false;
984
+ var events = eventType.split(' ');
985
+
986
+ for (var i = 0; i < events.length; i += 1) {
987
+ var event = events[i];
988
+
989
+ for (var j = 0; j < this.length; j += 1) {
990
+ var el = this[j];
991
+ var handlers = void 0;
992
+
993
+ if (!targetSelector && el.dom7Listeners) {
994
+ handlers = el.dom7Listeners[event];
995
+ } else if (targetSelector && el.dom7LiveListeners) {
996
+ handlers = el.dom7LiveListeners[event];
997
+ }
998
+
999
+ if (handlers && handlers.length) {
1000
+ for (var k = handlers.length - 1; k >= 0; k -= 1) {
1001
+ var handler = handlers[k];
1002
+
1003
+ if (listener && handler.listener === listener) {
1004
+ el.removeEventListener(event, handler.proxyListener, capture);
1005
+ handlers.splice(k, 1);
1006
+ } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {
1007
+ el.removeEventListener(event, handler.proxyListener, capture);
1008
+ handlers.splice(k, 1);
1009
+ } else if (!listener) {
1010
+ el.removeEventListener(event, handler.proxyListener, capture);
1011
+ handlers.splice(k, 1);
1012
+ }
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ return this;
1019
+ }
1020
+
1021
+ function once() {
1022
+ var dom = this;
1023
+
1024
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1025
+ args[_key7] = arguments[_key7];
1026
+ }
1027
+
1028
+ var eventName = args[0],
1029
+ targetSelector = args[1],
1030
+ listener = args[2],
1031
+ capture = args[3];
1032
+
1033
+ if (typeof args[1] === 'function') {
1034
+ eventName = args[0];
1035
+ listener = args[1];
1036
+ capture = args[2];
1037
+ targetSelector = undefined;
1038
+ }
1039
+
1040
+ function onceHandler() {
1041
+ for (var _len8 = arguments.length, eventArgs = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
1042
+ eventArgs[_key8] = arguments[_key8];
1043
+ }
1044
+
1045
+ listener.apply(this, eventArgs);
1046
+ dom.off(eventName, targetSelector, onceHandler, capture);
1047
+
1048
+ if (onceHandler.dom7proxy) {
1049
+ delete onceHandler.dom7proxy;
1050
+ }
1051
+ }
1052
+
1053
+ onceHandler.dom7proxy = listener;
1054
+ return dom.on(eventName, targetSelector, onceHandler, capture);
1055
+ }
1056
+
1057
+ function trigger() {
1058
+ var window = ssrWindow.getWindow();
1059
+
1060
+ for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
1061
+ args[_key9] = arguments[_key9];
1062
+ }
1063
+
1064
+ var events = args[0].split(' ');
1065
+ var eventData = args[1];
1066
+
1067
+ for (var i = 0; i < events.length; i += 1) {
1068
+ var event = events[i];
1069
+
1070
+ for (var j = 0; j < this.length; j += 1) {
1071
+ var el = this[j];
1072
+
1073
+ if (window.CustomEvent) {
1074
+ var evt = new window.CustomEvent(event, {
1075
+ detail: eventData,
1076
+ bubbles: true,
1077
+ cancelable: true
1078
+ });
1079
+ el.dom7EventData = args.filter(function (data, dataIndex) {
1080
+ return dataIndex > 0;
1081
+ });
1082
+ el.dispatchEvent(evt);
1083
+ el.dom7EventData = [];
1084
+ delete el.dom7EventData;
1085
+ }
1086
+ }
1087
+ }
1088
+
1089
+ return this;
1090
+ }
1091
+
1092
+ function transitionEnd(callback) {
1093
+ var dom = this;
1094
+
1095
+ function fireCallBack(e) {
1096
+ if (e.target !== this) return;
1097
+ callback.call(this, e);
1098
+ dom.off('transitionend', fireCallBack);
1099
+ }
1100
+
1101
+ if (callback) {
1102
+ dom.on('transitionend', fireCallBack);
1103
+ }
1104
+
1105
+ return this;
1106
+ }
1107
+
1108
+ function animationEnd(callback) {
1109
+ var dom = this;
1110
+
1111
+ function fireCallBack(e) {
1112
+ if (e.target !== this) return;
1113
+ callback.call(this, e);
1114
+ dom.off('animationend', fireCallBack);
1115
+ }
1116
+
1117
+ if (callback) {
1118
+ dom.on('animationend', fireCallBack);
1119
+ }
1120
+
1121
+ return this;
1122
+ }
1123
+
1124
+ function width() {
1125
+ var window = ssrWindow.getWindow();
1126
+
1127
+ if (this[0] === window) {
1128
+ return window.innerWidth;
1129
+ }
1130
+
1131
+ if (this.length > 0) {
1132
+ return parseFloat(this.css('width'));
1133
+ }
1134
+
1135
+ return null;
1136
+ }
1137
+
1138
+ function outerWidth(includeMargins) {
1139
+ if (this.length > 0) {
1140
+ if (includeMargins) {
1141
+ var _styles = this.styles();
1142
+
1143
+ return this[0].offsetWidth + parseFloat(_styles.getPropertyValue('margin-right')) + parseFloat(_styles.getPropertyValue('margin-left'));
1144
+ }
1145
+
1146
+ return this[0].offsetWidth;
1147
+ }
1148
+
1149
+ return null;
1150
+ }
1151
+
1152
+ function height() {
1153
+ var window = ssrWindow.getWindow();
1154
+
1155
+ if (this[0] === window) {
1156
+ return window.innerHeight;
1157
+ }
1158
+
1159
+ if (this.length > 0) {
1160
+ return parseFloat(this.css('height'));
1161
+ }
1162
+
1163
+ return null;
1164
+ }
1165
+
1166
+ function outerHeight(includeMargins) {
1167
+ if (this.length > 0) {
1168
+ if (includeMargins) {
1169
+ var _styles2 = this.styles();
1170
+
1171
+ return this[0].offsetHeight + parseFloat(_styles2.getPropertyValue('margin-top')) + parseFloat(_styles2.getPropertyValue('margin-bottom'));
1172
+ }
1173
+
1174
+ return this[0].offsetHeight;
1175
+ }
1176
+
1177
+ return null;
1178
+ }
1179
+
1180
+ function offset() {
1181
+ if (this.length > 0) {
1182
+ var window = ssrWindow.getWindow();
1183
+ var document = ssrWindow.getDocument();
1184
+ var el = this[0];
1185
+ var box = el.getBoundingClientRect();
1186
+ var body = document.body;
1187
+ var clientTop = el.clientTop || body.clientTop || 0;
1188
+ var clientLeft = el.clientLeft || body.clientLeft || 0;
1189
+ var scrollTop = el === window ? window.scrollY : el.scrollTop;
1190
+ var scrollLeft = el === window ? window.scrollX : el.scrollLeft;
1191
+ return {
1192
+ top: box.top + scrollTop - clientTop,
1193
+ left: box.left + scrollLeft - clientLeft
1194
+ };
1195
+ }
1196
+
1197
+ return null;
1198
+ }
1199
+
1200
+ function hide() {
1201
+ for (var i = 0; i < this.length; i += 1) {
1202
+ this[i].style.display = 'none';
1203
+ }
1204
+
1205
+ return this;
1206
+ }
1207
+
1208
+ function show() {
1209
+ var window = ssrWindow.getWindow();
1210
+
1211
+ for (var i = 0; i < this.length; i += 1) {
1212
+ var el = this[i];
1213
+
1214
+ if (el.style.display === 'none') {
1215
+ el.style.display = '';
1216
+ }
1217
+
1218
+ if (window.getComputedStyle(el, null).getPropertyValue('display') === 'none') {
1219
+ // Still not visible
1220
+ el.style.display = 'block';
1221
+ }
1222
+ }
1223
+
1224
+ return this;
1225
+ }
1226
+
1227
+ function styles() {
1228
+ var window = ssrWindow.getWindow();
1229
+ if (this[0]) return window.getComputedStyle(this[0], null);
1230
+ return {};
1231
+ }
1232
+
1233
+ function css(props, value) {
1234
+ var window = ssrWindow.getWindow();
1235
+ var i;
1236
+
1237
+ if (arguments.length === 1) {
1238
+ if (typeof props === 'string') {
1239
+ // .css('width')
1240
+ if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props);
1241
+ } else {
1242
+ // .css({ width: '100px' })
1243
+ for (i = 0; i < this.length; i += 1) {
1244
+ for (var _prop in props) {
1245
+ this[i].style[_prop] = props[_prop];
1246
+ }
1247
+ }
1248
+
1249
+ return this;
1250
+ }
1251
+ }
1252
+
1253
+ if (arguments.length === 2 && typeof props === 'string') {
1254
+ // .css('width', '100px')
1255
+ for (i = 0; i < this.length; i += 1) {
1256
+ this[i].style[props] = value;
1257
+ }
1258
+
1259
+ return this;
1260
+ }
1261
+
1262
+ return this;
1263
+ }
1264
+
1265
+ function each(callback) {
1266
+ if (!callback) return this;
1267
+ this.forEach(function (el, index) {
1268
+ callback.apply(el, [el, index]);
1269
+ });
1270
+ return this;
1271
+ }
1272
+
1273
+ function filter(callback) {
1274
+ var result = arrayFilter(this, callback);
1275
+ return $(result);
1276
+ }
1277
+
1278
+ function html(html) {
1279
+ if (typeof html === 'undefined') {
1280
+ return this[0] ? this[0].innerHTML : null;
1281
+ }
1282
+
1283
+ for (var i = 0; i < this.length; i += 1) {
1284
+ this[i].innerHTML = html;
1285
+ }
1286
+
1287
+ return this;
1288
+ }
1289
+
1290
+ function text(text) {
1291
+ if (typeof text === 'undefined') {
1292
+ return this[0] ? this[0].textContent.trim() : null;
1293
+ }
1294
+
1295
+ for (var i = 0; i < this.length; i += 1) {
1296
+ this[i].textContent = text;
1297
+ }
1298
+
1299
+ return this;
1300
+ }
1301
+
1302
+ function is(selector) {
1303
+ var window = ssrWindow.getWindow();
1304
+ var document = ssrWindow.getDocument();
1305
+ var el = this[0];
1306
+ var compareWith;
1307
+ var i;
1308
+ if (!el || typeof selector === 'undefined') return false;
1309
+
1310
+ if (typeof selector === 'string') {
1311
+ if (el.matches) return el.matches(selector);
1312
+ if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
1313
+ if (el.msMatchesSelector) return el.msMatchesSelector(selector);
1314
+ compareWith = $(selector);
1315
+
1316
+ for (i = 0; i < compareWith.length; i += 1) {
1317
+ if (compareWith[i] === el) return true;
1318
+ }
1319
+
1320
+ return false;
1321
+ }
1322
+
1323
+ if (selector === document) {
1324
+ return el === document;
1325
+ }
1326
+
1327
+ if (selector === window) {
1328
+ return el === window;
1329
+ }
1330
+
1331
+ if (selector.nodeType || selector instanceof Dom7) {
1332
+ compareWith = selector.nodeType ? [selector] : selector;
1333
+
1334
+ for (i = 0; i < compareWith.length; i += 1) {
1335
+ if (compareWith[i] === el) return true;
1336
+ }
1337
+
1338
+ return false;
1339
+ }
1340
+
1341
+ return false;
1342
+ }
1343
+
1344
+ function index() {
1345
+ var child = this[0];
1346
+ var i;
1347
+
1348
+ if (child) {
1349
+ i = 0; // eslint-disable-next-line
1350
+
1351
+ while ((child = child.previousSibling) !== null) {
1352
+ if (child.nodeType === 1) i += 1;
1353
+ }
1354
+
1355
+ return i;
1356
+ }
1357
+
1358
+ return undefined;
1359
+ }
1360
+
1361
+ function eq(index) {
1362
+ if (typeof index === 'undefined') return this;
1363
+ var length = this.length;
1364
+
1365
+ if (index > length - 1) {
1366
+ return $([]);
1367
+ }
1368
+
1369
+ if (index < 0) {
1370
+ var returnIndex = length + index;
1371
+ if (returnIndex < 0) return $([]);
1372
+ return $([this[returnIndex]]);
1373
+ }
1374
+
1375
+ return $([this[index]]);
1376
+ }
1377
+
1378
+ function append() {
1379
+ var newChild;
1380
+ var document = ssrWindow.getDocument();
1381
+
1382
+ for (var k = 0; k < arguments.length; k += 1) {
1383
+ newChild = k < 0 || arguments.length <= k ? undefined : arguments[k];
1384
+
1385
+ for (var i = 0; i < this.length; i += 1) {
1386
+ if (typeof newChild === 'string') {
1387
+ var tempDiv = document.createElement('div');
1388
+ tempDiv.innerHTML = newChild;
1389
+
1390
+ while (tempDiv.firstChild) {
1391
+ this[i].appendChild(tempDiv.firstChild);
1392
+ }
1393
+ } else if (newChild instanceof Dom7) {
1394
+ for (var j = 0; j < newChild.length; j += 1) {
1395
+ this[i].appendChild(newChild[j]);
1396
+ }
1397
+ } else {
1398
+ this[i].appendChild(newChild);
1399
+ }
1400
+ }
1401
+ }
1402
+
1403
+ return this;
1404
+ }
1405
+
1406
+ function appendTo(parent) {
1407
+ $(parent).append(this);
1408
+ return this;
1409
+ }
1410
+
1411
+ function prepend(newChild) {
1412
+ var document = ssrWindow.getDocument();
1413
+ var i;
1414
+ var j;
1415
+
1416
+ for (i = 0; i < this.length; i += 1) {
1417
+ if (typeof newChild === 'string') {
1418
+ var tempDiv = document.createElement('div');
1419
+ tempDiv.innerHTML = newChild;
1420
+
1421
+ for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {
1422
+ this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
1423
+ }
1424
+ } else if (newChild instanceof Dom7) {
1425
+ for (j = 0; j < newChild.length; j += 1) {
1426
+ this[i].insertBefore(newChild[j], this[i].childNodes[0]);
1427
+ }
1428
+ } else {
1429
+ this[i].insertBefore(newChild, this[i].childNodes[0]);
1430
+ }
1431
+ }
1432
+
1433
+ return this;
1434
+ }
1435
+
1436
+ function prependTo(parent) {
1437
+ $(parent).prepend(this);
1438
+ return this;
1439
+ }
1440
+
1441
+ function insertBefore(selector) {
1442
+ var before = $(selector);
1443
+
1444
+ for (var i = 0; i < this.length; i += 1) {
1445
+ if (before.length === 1) {
1446
+ before[0].parentNode.insertBefore(this[i], before[0]);
1447
+ } else if (before.length > 1) {
1448
+ for (var j = 0; j < before.length; j += 1) {
1449
+ before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);
1450
+ }
1451
+ }
1452
+ }
1453
+ }
1454
+
1455
+ function insertAfter(selector) {
1456
+ var after = $(selector);
1457
+
1458
+ for (var i = 0; i < this.length; i += 1) {
1459
+ if (after.length === 1) {
1460
+ after[0].parentNode.insertBefore(this[i], after[0].nextSibling);
1461
+ } else if (after.length > 1) {
1462
+ for (var j = 0; j < after.length; j += 1) {
1463
+ after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);
1464
+ }
1465
+ }
1466
+ }
1467
+ }
1468
+
1469
+ function next(selector) {
1470
+ if (this.length > 0) {
1471
+ if (selector) {
1472
+ if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {
1473
+ return $([this[0].nextElementSibling]);
1474
+ }
1475
+
1476
+ return $([]);
1477
+ }
1478
+
1479
+ if (this[0].nextElementSibling) return $([this[0].nextElementSibling]);
1480
+ return $([]);
1481
+ }
1482
+
1483
+ return $([]);
1484
+ }
1485
+
1486
+ function nextAll(selector) {
1487
+ var nextEls = [];
1488
+ var el = this[0];
1489
+ if (!el) return $([]);
1490
+
1491
+ while (el.nextElementSibling) {
1492
+ var _next = el.nextElementSibling; // eslint-disable-line
1493
+
1494
+ if (selector) {
1495
+ if ($(_next).is(selector)) nextEls.push(_next);
1496
+ } else nextEls.push(_next);
1497
+
1498
+ el = _next;
1499
+ }
1500
+
1501
+ return $(nextEls);
1502
+ }
1503
+
1504
+ function prev(selector) {
1505
+ if (this.length > 0) {
1506
+ var el = this[0];
1507
+
1508
+ if (selector) {
1509
+ if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {
1510
+ return $([el.previousElementSibling]);
1511
+ }
1512
+
1513
+ return $([]);
1514
+ }
1515
+
1516
+ if (el.previousElementSibling) return $([el.previousElementSibling]);
1517
+ return $([]);
1518
+ }
1519
+
1520
+ return $([]);
1521
+ }
1522
+
1523
+ function prevAll(selector) {
1524
+ var prevEls = [];
1525
+ var el = this[0];
1526
+ if (!el) return $([]);
1527
+
1528
+ while (el.previousElementSibling) {
1529
+ var _prev = el.previousElementSibling; // eslint-disable-line
1530
+
1531
+ if (selector) {
1532
+ if ($(_prev).is(selector)) prevEls.push(_prev);
1533
+ } else prevEls.push(_prev);
1534
+
1535
+ el = _prev;
1536
+ }
1537
+
1538
+ return $(prevEls);
1539
+ }
1540
+
1541
+ function siblings(selector) {
1542
+ return this.nextAll(selector).add(this.prevAll(selector));
1543
+ }
1544
+
1545
+ function parent(selector) {
1546
+ var parents = []; // eslint-disable-line
1547
+
1548
+ for (var i = 0; i < this.length; i += 1) {
1549
+ if (this[i].parentNode !== null) {
1550
+ if (selector) {
1551
+ if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);
1552
+ } else {
1553
+ parents.push(this[i].parentNode);
1554
+ }
1555
+ }
1556
+ }
1557
+
1558
+ return $(parents);
1559
+ }
1560
+
1561
+ function parents(selector) {
1562
+ var parents = []; // eslint-disable-line
1563
+
1564
+ for (var i = 0; i < this.length; i += 1) {
1565
+ var _parent = this[i].parentNode; // eslint-disable-line
1566
+
1567
+ while (_parent) {
1568
+ if (selector) {
1569
+ if ($(_parent).is(selector)) parents.push(_parent);
1570
+ } else {
1571
+ parents.push(_parent);
1572
+ }
1573
+
1574
+ _parent = _parent.parentNode;
1575
+ }
1576
+ }
1577
+
1578
+ return $(parents);
1579
+ }
1580
+
1581
+ function closest(selector) {
1582
+ var closest = this; // eslint-disable-line
1583
+
1584
+ if (typeof selector === 'undefined') {
1585
+ return $([]);
1586
+ }
1587
+
1588
+ if (!closest.is(selector)) {
1589
+ closest = closest.parents(selector).eq(0);
1590
+ }
1591
+
1592
+ return closest;
1593
+ }
1594
+
1595
+ function find(selector) {
1596
+ var foundElements = [];
1597
+
1598
+ for (var i = 0; i < this.length; i += 1) {
1599
+ var found = this[i].querySelectorAll(selector);
1600
+
1601
+ for (var j = 0; j < found.length; j += 1) {
1602
+ foundElements.push(found[j]);
1603
+ }
1604
+ }
1605
+
1606
+ return $(foundElements);
1607
+ }
1608
+
1609
+ function children(selector) {
1610
+ var children = []; // eslint-disable-line
1611
+
1612
+ for (var i = 0; i < this.length; i += 1) {
1613
+ var childNodes = this[i].children;
1614
+
1615
+ for (var j = 0; j < childNodes.length; j += 1) {
1616
+ if (!selector || $(childNodes[j]).is(selector)) {
1617
+ children.push(childNodes[j]);
1618
+ }
1619
+ }
1620
+ }
1621
+
1622
+ return $(children);
1623
+ }
1624
+
1625
+ function remove() {
1626
+ for (var i = 0; i < this.length; i += 1) {
1627
+ if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);
1628
+ }
1629
+
1630
+ return this;
1631
+ }
1632
+
1633
+ function detach() {
1634
+ return this.remove();
1635
+ }
1636
+
1637
+ function add() {
1638
+ var dom = this;
1639
+ var i;
1640
+ var j;
1641
+
1642
+ for (var _len10 = arguments.length, els = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
1643
+ els[_key10] = arguments[_key10];
1644
+ }
1645
+
1646
+ for (i = 0; i < els.length; i += 1) {
1647
+ var toAdd = $(els[i]);
1648
+
1649
+ for (j = 0; j < toAdd.length; j += 1) {
1650
+ dom.push(toAdd[j]);
1651
+ }
1652
+ }
1653
+
1654
+ return dom;
1655
+ }
1656
+
1657
+ function empty() {
1658
+ for (var i = 0; i < this.length; i += 1) {
1659
+ var el = this[i];
1660
+
1661
+ if (el.nodeType === 1) {
1662
+ for (var j = 0; j < el.childNodes.length; j += 1) {
1663
+ if (el.childNodes[j].parentNode) {
1664
+ el.childNodes[j].parentNode.removeChild(el.childNodes[j]);
1665
+ }
1666
+ }
1667
+
1668
+ el.textContent = '';
1669
+ }
1670
+ }
1671
+
1672
+ return this;
1673
+ }
1674
+
1675
+ function scrollTo() {
1676
+ var window = ssrWindow.getWindow();
1677
+
1678
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1679
+ args[_key] = arguments[_key];
1680
+ }
1681
+
1682
+ var left = args[0],
1683
+ top = args[1],
1684
+ duration = args[2],
1685
+ easing = args[3],
1686
+ callback = args[4];
1687
+
1688
+ if (args.length === 4 && typeof easing === 'function') {
1689
+ callback = easing;
1690
+ left = args[0];
1691
+ top = args[1];
1692
+ duration = args[2];
1693
+ callback = args[3];
1694
+ easing = args[4];
1695
+ }
1696
+
1697
+ if (typeof easing === 'undefined') easing = 'swing';
1698
+ return this.each(function animate() {
1699
+ var el = this;
1700
+ var currentTop;
1701
+ var currentLeft;
1702
+ var maxTop;
1703
+ var maxLeft;
1704
+ var newTop;
1705
+ var newLeft;
1706
+ var scrollTop; // eslint-disable-line
1707
+
1708
+ var scrollLeft; // eslint-disable-line
1709
+
1710
+ var animateTop = top > 0 || top === 0;
1711
+ var animateLeft = left > 0 || left === 0;
1712
+
1713
+ if (typeof easing === 'undefined') {
1714
+ easing = 'swing';
1715
+ }
1716
+
1717
+ if (animateTop) {
1718
+ currentTop = el.scrollTop;
1719
+
1720
+ if (!duration) {
1721
+ el.scrollTop = top;
1722
+ }
1723
+ }
1724
+
1725
+ if (animateLeft) {
1726
+ currentLeft = el.scrollLeft;
1727
+
1728
+ if (!duration) {
1729
+ el.scrollLeft = left;
1730
+ }
1731
+ }
1732
+
1733
+ if (!duration) return;
1734
+
1735
+ if (animateTop) {
1736
+ maxTop = el.scrollHeight - el.offsetHeight;
1737
+ newTop = Math.max(Math.min(top, maxTop), 0);
1738
+ }
1739
+
1740
+ if (animateLeft) {
1741
+ maxLeft = el.scrollWidth - el.offsetWidth;
1742
+ newLeft = Math.max(Math.min(left, maxLeft), 0);
1743
+ }
1744
+
1745
+ var startTime = null;
1746
+ if (animateTop && newTop === currentTop) animateTop = false;
1747
+ if (animateLeft && newLeft === currentLeft) animateLeft = false;
1748
+
1749
+ function render(time) {
1750
+ if (time === void 0) {
1751
+ time = new Date().getTime();
1752
+ }
1753
+
1754
+ if (startTime === null) {
1755
+ startTime = time;
1756
+ }
1757
+
1758
+ var progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
1759
+ var easeProgress = easing === 'linear' ? progress : 0.5 - Math.cos(progress * Math.PI) / 2;
1760
+ var done;
1761
+ if (animateTop) scrollTop = currentTop + easeProgress * (newTop - currentTop);
1762
+ if (animateLeft) scrollLeft = currentLeft + easeProgress * (newLeft - currentLeft);
1763
+
1764
+ if (animateTop && newTop > currentTop && scrollTop >= newTop) {
1765
+ el.scrollTop = newTop;
1766
+ done = true;
1767
+ }
1768
+
1769
+ if (animateTop && newTop < currentTop && scrollTop <= newTop) {
1770
+ el.scrollTop = newTop;
1771
+ done = true;
1772
+ }
1773
+
1774
+ if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) {
1775
+ el.scrollLeft = newLeft;
1776
+ done = true;
1777
+ }
1778
+
1779
+ if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) {
1780
+ el.scrollLeft = newLeft;
1781
+ done = true;
1782
+ }
1783
+
1784
+ if (done) {
1785
+ if (callback) callback();
1786
+ return;
1787
+ }
1788
+
1789
+ if (animateTop) el.scrollTop = scrollTop;
1790
+ if (animateLeft) el.scrollLeft = scrollLeft;
1791
+ window.requestAnimationFrame(render);
1792
+ }
1793
+
1794
+ window.requestAnimationFrame(render);
1795
+ });
1796
+ } // scrollTop(top, duration, easing, callback) {
1797
+
1798
+
1799
+ function scrollTop() {
1800
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1801
+ args[_key2] = arguments[_key2];
1802
+ }
1803
+
1804
+ var top = args[0],
1805
+ duration = args[1],
1806
+ easing = args[2],
1807
+ callback = args[3];
1808
+
1809
+ if (args.length === 3 && typeof easing === 'function') {
1810
+ top = args[0];
1811
+ duration = args[1];
1812
+ callback = args[2];
1813
+ easing = args[3];
1814
+ }
1815
+
1816
+ var dom = this;
1817
+
1818
+ if (typeof top === 'undefined') {
1819
+ if (dom.length > 0) return dom[0].scrollTop;
1820
+ return null;
1821
+ }
1822
+
1823
+ return dom.scrollTo(undefined, top, duration, easing, callback);
1824
+ }
1825
+
1826
+ function scrollLeft() {
1827
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1828
+ args[_key3] = arguments[_key3];
1829
+ }
1830
+
1831
+ var left = args[0],
1832
+ duration = args[1],
1833
+ easing = args[2],
1834
+ callback = args[3];
1835
+
1836
+ if (args.length === 3 && typeof easing === 'function') {
1837
+ left = args[0];
1838
+ duration = args[1];
1839
+ callback = args[2];
1840
+ easing = args[3];
1841
+ }
1842
+
1843
+ var dom = this;
1844
+
1845
+ if (typeof left === 'undefined') {
1846
+ if (dom.length > 0) return dom[0].scrollLeft;
1847
+ return null;
1848
+ }
1849
+
1850
+ return dom.scrollTo(left, undefined, duration, easing, callback);
1851
+ }
1852
+
1853
+ function animate(initialProps, initialParams) {
1854
+ var window = ssrWindow.getWindow();
1855
+ var els = this;
1856
+ var a = {
1857
+ props: Object.assign({}, initialProps),
1858
+ params: Object.assign({
1859
+ duration: 300,
1860
+ easing: 'swing' // or 'linear'
1861
+
1862
+ /* Callbacks
1863
+ begin(elements)
1864
+ complete(elements)
1865
+ progress(elements, complete, remaining, start, tweenValue)
1866
+ */
1867
+
1868
+ }, initialParams),
1869
+ elements: els,
1870
+ animating: false,
1871
+ que: [],
1872
+ easingProgress: function easingProgress(easing, progress) {
1873
+ if (easing === 'swing') {
1874
+ return 0.5 - Math.cos(progress * Math.PI) / 2;
1875
+ }
1876
+
1877
+ if (typeof easing === 'function') {
1878
+ return easing(progress);
1879
+ }
1880
+
1881
+ return progress;
1882
+ },
1883
+ stop: function stop() {
1884
+ if (a.frameId) {
1885
+ window.cancelAnimationFrame(a.frameId);
1886
+ }
1887
+
1888
+ a.animating = false;
1889
+ a.elements.each(function (el) {
1890
+ var element = el;
1891
+ delete element.dom7AnimateInstance;
1892
+ });
1893
+ a.que = [];
1894
+ },
1895
+ done: function done(complete) {
1896
+ a.animating = false;
1897
+ a.elements.each(function (el) {
1898
+ var element = el;
1899
+ delete element.dom7AnimateInstance;
1900
+ });
1901
+ if (complete) complete(els);
1902
+
1903
+ if (a.que.length > 0) {
1904
+ var que = a.que.shift();
1905
+ a.animate(que[0], que[1]);
1906
+ }
1907
+ },
1908
+ animate: function animate(props, params) {
1909
+ if (a.animating) {
1910
+ a.que.push([props, params]);
1911
+ return a;
1912
+ }
1913
+
1914
+ var elements = []; // Define & Cache Initials & Units
1915
+
1916
+ a.elements.each(function (el, index) {
1917
+ var initialFullValue;
1918
+ var initialValue;
1919
+ var unit;
1920
+ var finalValue;
1921
+ var finalFullValue;
1922
+ if (!el.dom7AnimateInstance) a.elements[index].dom7AnimateInstance = a;
1923
+ elements[index] = {
1924
+ container: el
1925
+ };
1926
+ Object.keys(props).forEach(function (prop) {
1927
+ initialFullValue = window.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.');
1928
+ initialValue = parseFloat(initialFullValue);
1929
+ unit = initialFullValue.replace(initialValue, '');
1930
+ finalValue = parseFloat(props[prop]);
1931
+ finalFullValue = props[prop] + unit;
1932
+ elements[index][prop] = {
1933
+ initialFullValue: initialFullValue,
1934
+ initialValue: initialValue,
1935
+ unit: unit,
1936
+ finalValue: finalValue,
1937
+ finalFullValue: finalFullValue,
1938
+ currentValue: initialValue
1939
+ };
1940
+ });
1941
+ });
1942
+ var startTime = null;
1943
+ var time;
1944
+ var elementsDone = 0;
1945
+ var propsDone = 0;
1946
+ var done;
1947
+ var began = false;
1948
+ a.animating = true;
1949
+
1950
+ function render() {
1951
+ time = new Date().getTime();
1952
+ var progress;
1953
+ var easeProgress; // let el;
1954
+
1955
+ if (!began) {
1956
+ began = true;
1957
+ if (params.begin) params.begin(els);
1958
+ }
1959
+
1960
+ if (startTime === null) {
1961
+ startTime = time;
1962
+ }
1963
+
1964
+ if (params.progress) {
1965
+ // eslint-disable-next-line
1966
+ params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), startTime + params.duration - time < 0 ? 0 : startTime + params.duration - time, startTime);
1967
+ }
1968
+
1969
+ elements.forEach(function (element) {
1970
+ var el = element;
1971
+ if (done || el.done) return;
1972
+ Object.keys(props).forEach(function (prop) {
1973
+ if (done || el.done) return;
1974
+ progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0);
1975
+ easeProgress = a.easingProgress(params.easing, progress);
1976
+ var _el$prop = el[prop],
1977
+ initialValue = _el$prop.initialValue,
1978
+ finalValue = _el$prop.finalValue,
1979
+ unit = _el$prop.unit;
1980
+ el[prop].currentValue = initialValue + easeProgress * (finalValue - initialValue);
1981
+ var currentValue = el[prop].currentValue;
1982
+
1983
+ if (finalValue > initialValue && currentValue >= finalValue || finalValue < initialValue && currentValue <= finalValue) {
1984
+ el.container.style[prop] = finalValue + unit;
1985
+ propsDone += 1;
1986
+
1987
+ if (propsDone === Object.keys(props).length) {
1988
+ el.done = true;
1989
+ elementsDone += 1;
1990
+ }
1991
+
1992
+ if (elementsDone === elements.length) {
1993
+ done = true;
1994
+ }
1995
+ }
1996
+
1997
+ if (done) {
1998
+ a.done(params.complete);
1999
+ return;
2000
+ }
2001
+
2002
+ el.container.style[prop] = currentValue + unit;
2003
+ });
2004
+ });
2005
+ if (done) return; // Then call
2006
+
2007
+ a.frameId = window.requestAnimationFrame(render);
2008
+ }
2009
+
2010
+ a.frameId = window.requestAnimationFrame(render);
2011
+ return a;
2012
+ }
2013
+ };
2014
+
2015
+ if (a.elements.length === 0) {
2016
+ return els;
2017
+ }
2018
+
2019
+ var animateInstance;
2020
+
2021
+ for (var i = 0; i < a.elements.length; i += 1) {
2022
+ if (a.elements[i].dom7AnimateInstance) {
2023
+ animateInstance = a.elements[i].dom7AnimateInstance;
2024
+ } else a.elements[i].dom7AnimateInstance = a;
2025
+ }
2026
+
2027
+ if (!animateInstance) {
2028
+ animateInstance = a;
2029
+ }
2030
+
2031
+ if (initialProps === 'stop') {
2032
+ animateInstance.stop();
2033
+ } else {
2034
+ animateInstance.animate(a.props, a.params);
2035
+ }
2036
+
2037
+ return els;
2038
+ }
2039
+
2040
+ function stop() {
2041
+ var els = this;
2042
+
2043
+ for (var i = 0; i < els.length; i += 1) {
2044
+ if (els[i].dom7AnimateInstance) {
2045
+ els[i].dom7AnimateInstance.stop();
2046
+ }
2047
+ }
2048
+ }
2049
+
2050
+ var noTrigger = 'resize scroll'.split(' ');
2051
+
2052
+ function shortcut(name) {
2053
+ function eventHandler() {
2054
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2055
+ args[_key] = arguments[_key];
2056
+ }
2057
+
2058
+ if (typeof args[0] === 'undefined') {
2059
+ for (var i = 0; i < this.length; i += 1) {
2060
+ if (noTrigger.indexOf(name) < 0) {
2061
+ if (name in this[i]) this[i][name]();else {
2062
+ $(this[i]).trigger(name);
2063
+ }
2064
+ }
2065
+ }
2066
+
2067
+ return this;
2068
+ }
2069
+
2070
+ return this.on.apply(this, [name].concat(args));
2071
+ }
2072
+
2073
+ return eventHandler;
2074
+ }
2075
+
2076
+ var click = shortcut('click');
2077
+ var blur = shortcut('blur');
2078
+ var focus = shortcut('focus');
2079
+ var focusin = shortcut('focusin');
2080
+ var focusout = shortcut('focusout');
2081
+ var keyup = shortcut('keyup');
2082
+ var keydown = shortcut('keydown');
2083
+ var keypress = shortcut('keypress');
2084
+ var submit = shortcut('submit');
2085
+ var change = shortcut('change');
2086
+ var mousedown = shortcut('mousedown');
2087
+ var mousemove = shortcut('mousemove');
2088
+ var mouseup = shortcut('mouseup');
2089
+ var mouseenter = shortcut('mouseenter');
2090
+ var mouseleave = shortcut('mouseleave');
2091
+ var mouseout = shortcut('mouseout');
2092
+ var mouseover = shortcut('mouseover');
2093
+ var touchstart = shortcut('touchstart');
2094
+ var touchend = shortcut('touchend');
2095
+ var touchmove = shortcut('touchmove');
2096
+ var resize = shortcut('resize');
2097
+ var scroll = shortcut('scroll');
2098
+
2099
+ dom7_cjs.$ = $;
2100
+ dom7_cjs.add = add;
2101
+ dom7_cjs.addClass = addClass;
2102
+ dom7_cjs.animate = animate;
2103
+ dom7_cjs.animationEnd = animationEnd;
2104
+ dom7_cjs.append = append;
2105
+ dom7_cjs.appendTo = appendTo;
2106
+ dom7_cjs.attr = attr;
2107
+ dom7_cjs.blur = blur;
2108
+ dom7_cjs.change = change;
2109
+ dom7_cjs.children = children;
2110
+ dom7_cjs.click = click;
2111
+ dom7_cjs.closest = closest;
2112
+ dom7_cjs.css = css;
2113
+ dom7_cjs.data = data;
2114
+ dom7_cjs.dataset = dataset;
2115
+ dom7_cjs.default = $;
2116
+ dom7_cjs.detach = detach;
2117
+ dom7_cjs.each = each;
2118
+ dom7_cjs.empty = empty;
2119
+ dom7_cjs.eq = eq;
2120
+ dom7_cjs.filter = filter;
2121
+ dom7_cjs.find = find;
2122
+ dom7_cjs.focus = focus;
2123
+ dom7_cjs.focusin = focusin;
2124
+ dom7_cjs.focusout = focusout;
2125
+ dom7_cjs.hasClass = hasClass;
2126
+ dom7_cjs.height = height;
2127
+ dom7_cjs.hide = hide;
2128
+ dom7_cjs.html = html;
2129
+ dom7_cjs.index = index;
2130
+ dom7_cjs.insertAfter = insertAfter;
2131
+ dom7_cjs.insertBefore = insertBefore;
2132
+ dom7_cjs.is = is;
2133
+ dom7_cjs.keydown = keydown;
2134
+ dom7_cjs.keypress = keypress;
2135
+ dom7_cjs.keyup = keyup;
2136
+ dom7_cjs.mousedown = mousedown;
2137
+ dom7_cjs.mouseenter = mouseenter;
2138
+ dom7_cjs.mouseleave = mouseleave;
2139
+ dom7_cjs.mousemove = mousemove;
2140
+ dom7_cjs.mouseout = mouseout;
2141
+ dom7_cjs.mouseover = mouseover;
2142
+ dom7_cjs.mouseup = mouseup;
2143
+ dom7_cjs.next = next;
2144
+ dom7_cjs.nextAll = nextAll;
2145
+ dom7_cjs.off = off;
2146
+ dom7_cjs.offset = offset;
2147
+ dom7_cjs.on = on;
2148
+ dom7_cjs.once = once;
2149
+ dom7_cjs.outerHeight = outerHeight;
2150
+ dom7_cjs.outerWidth = outerWidth;
2151
+ dom7_cjs.parent = parent;
2152
+ dom7_cjs.parents = parents;
2153
+ dom7_cjs.prepend = prepend;
2154
+ dom7_cjs.prependTo = prependTo;
2155
+ dom7_cjs.prev = prev;
2156
+ dom7_cjs.prevAll = prevAll;
2157
+ dom7_cjs.prop = prop;
2158
+ dom7_cjs.remove = remove;
2159
+ dom7_cjs.removeAttr = removeAttr;
2160
+ dom7_cjs.removeClass = removeClass;
2161
+ dom7_cjs.removeData = removeData;
2162
+ dom7_cjs.resize = resize;
2163
+ dom7_cjs.scroll = scroll;
2164
+ dom7_cjs.scrollLeft = scrollLeft;
2165
+ dom7_cjs.scrollTo = scrollTo;
2166
+ dom7_cjs.scrollTop = scrollTop;
2167
+ dom7_cjs.show = show;
2168
+ dom7_cjs.siblings = siblings;
2169
+ dom7_cjs.stop = stop;
2170
+ dom7_cjs.styles = styles;
2171
+ dom7_cjs.submit = submit;
2172
+ dom7_cjs.text = text;
2173
+ dom7_cjs.toggleClass = toggleClass;
2174
+ dom7_cjs.touchend = touchend;
2175
+ dom7_cjs.touchmove = touchmove;
2176
+ dom7_cjs.touchstart = touchstart;
2177
+ dom7_cjs.transform = transform;
2178
+ dom7_cjs.transition = transition;
2179
+ dom7_cjs.transitionEnd = transitionEnd;
2180
+ dom7_cjs.trigger = trigger;
2181
+ dom7_cjs.val = val;
2182
+ dom7_cjs.value = value;
2183
+ dom7_cjs.width = width;
2184
+ return dom7_cjs;
2185
+ }
2186
+
2187
+ var dom7_cjsExports = /*@__PURE__*/ requireDom7_cjs();
2188
+ var $ = /*@__PURE__*/getDefaultExportFromCjs(dom7_cjsExports);
2189
+
2190
+ /**
2191
+ * @description DOM 操作
2192
+ * @author wangfupeng
2193
+ */
2194
+ if (dom7_cjsExports.append) {
2195
+ $.fn.append = dom7_cjsExports.append;
2196
+ }
2197
+ if (dom7_cjsExports.html) {
2198
+ $.fn.html = dom7_cjsExports.html;
2199
+ }
2200
+ if (dom7_cjsExports.val) {
2201
+ $.fn.val = dom7_cjsExports.val;
2202
+ }
2203
+ if (dom7_cjsExports.on) {
2204
+ $.fn.on = dom7_cjsExports.on;
2205
+ }
2206
+ if (dom7_cjsExports.focus) {
2207
+ $.fn.focus = dom7_cjsExports.focus;
2208
+ }
2209
+ if (dom7_cjsExports.is) {
2210
+ $.fn.is = dom7_cjsExports.is;
2211
+ }
2212
+ if (dom7_cjsExports.parents) {
2213
+ $.fn.parents = dom7_cjsExports.parents;
2214
+ }
2215
+ if (dom7_cjsExports.find) {
2216
+ $.fn.find = dom7_cjsExports.find;
2217
+ }
2218
+
2219
+ let nanoid = (size = 21) =>
2220
+ crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
2221
+ byte &= 63;
2222
+ if (byte < 36) {
2223
+ id += byte.toString(36);
2224
+ } else if (byte < 62) {
2225
+ id += (byte - 26).toString(36).toUpperCase();
2226
+ } else if (byte > 62) {
2227
+ id += '-';
2228
+ } else {
2229
+ id += '_';
2230
+ }
2231
+ return id
2232
+ }, '');
2233
+
2234
+ /**
2235
+ * @description 工具函数
2236
+ * @author wangfupeng
2237
+ */
2238
+ /**
2239
+ * 获取随机数字符串
2240
+ * @param prefix 前缀
2241
+ * @returns 随机数字符串
2242
+ */
2243
+ function genRandomStr(prefix) {
2244
+ return "".concat(prefix, "-").concat(nanoid());
2245
+ }
2246
+ // export function replaceSymbols(str: string) {
2247
+ // return str.replace(/</g, '&lt;').replace(/>/g, '&gt;')
2248
+ // }
2249
+
2250
+ /**
2251
+ * @description edit formula menu
2252
+ * @author wangfupeng
2253
+ */
2254
+ /**
2255
+ * 生成唯一的 DOM ID
2256
+ */
2257
+ function genDomID$1() {
2258
+ return genRandomStr('w-e-insert-formula');
2259
+ }
2260
+ var EditFormulaMenu = /** @class */ (function () {
2261
+ function EditFormulaMenu() {
2262
+ this.title = editor.t('formula.edit');
2263
+ this.iconSvg = PENCIL_SVG;
2264
+ this.tag = 'button';
2265
+ this.showModal = true; // 点击 button 时显示 modal
2266
+ this.modalWidth = 300;
2267
+ this.$content = null;
2268
+ this.textareaId = genDomID$1();
2269
+ this.buttonId = genDomID$1();
2270
+ }
2271
+ EditFormulaMenu.prototype.getSelectedElem = function (editor$1) {
2272
+ var node = editor.DomEditor.getSelectedNodeByType(editor$1, 'formula');
2273
+ if (node == null) {
2274
+ return null;
2275
+ }
2276
+ return node;
2277
+ };
2278
+ /**
2279
+ * 获取公式 value
2280
+ * @param editor editor
2281
+ */
2282
+ EditFormulaMenu.prototype.getValue = function (editor) {
2283
+ var formulaElem = this.getSelectedElem(editor);
2284
+ if (formulaElem) {
2285
+ return formulaElem.value || '';
2286
+ }
2287
+ return '';
2288
+ };
2289
+ EditFormulaMenu.prototype.isActive = function (_editor) {
2290
+ // 无需 active
2291
+ return false;
2292
+ };
2293
+ EditFormulaMenu.prototype.exec = function (_editor, _value) {
2294
+ // 点击菜单时,弹出 modal 之前,不需要执行其他代码
2295
+ // 此处空着即可
2296
+ };
2297
+ EditFormulaMenu.prototype.isDisabled = function (editor$1) {
2298
+ var selection = editor$1.selection;
2299
+ if (selection == null) {
2300
+ return true;
2301
+ }
2302
+ if (editor.SlateRange.isExpanded(selection)) {
2303
+ return true;
2304
+ } // 选区非折叠,禁用
2305
+ // 未匹配到 formula node 则禁用
2306
+ var formulaElem = this.getSelectedElem(editor$1);
2307
+ if (formulaElem == null) {
2308
+ return true;
2309
+ }
2310
+ return false;
2311
+ };
2312
+ // modal 定位
2313
+ EditFormulaMenu.prototype.getModalPositionNode = function (editor) {
2314
+ return this.getSelectedElem(editor);
2315
+ };
2316
+ EditFormulaMenu.prototype.getModalContentElem = function (editor$1) {
2317
+ var _this = this;
2318
+ var _a = this, textareaId = _a.textareaId, buttonId = _a.buttonId;
2319
+ var _b = __read(editor.genModalTextareaElems(editor.t('formula.formula'), textareaId, editor.t('formula.placeholder')), 2), textareaContainerElem = _b[0], textareaElem = _b[1];
2320
+ var $textarea = $(textareaElem);
2321
+ var _c = __read(editor.genModalButtonElems(buttonId, editor.t('formula.ok')), 1), buttonContainerElem = _c[0];
2322
+ if (this.$content == null) {
2323
+ // 第一次渲染
2324
+ var $content_1 = $('<div></div>');
2325
+ // 绑定事件(第一次渲染时绑定,不要重复绑定)
2326
+ $content_1.on('click', "#".concat(buttonId), function (e) {
2327
+ e.preventDefault();
2328
+ var value = $content_1.find("#".concat(textareaId)).val().trim();
2329
+ _this.updateFormula(editor$1, value);
2330
+ editor$1.hidePanelOrModal(); // 隐藏 modal
2331
+ });
2332
+ // 记录属性,重要
2333
+ this.$content = $content_1;
2334
+ }
2335
+ var $content = this.$content;
2336
+ $content.html(''); // 先清空内容
2337
+ // append textarea and button
2338
+ $content.append(textareaContainerElem);
2339
+ $content.append(buttonContainerElem);
2340
+ // 设置 input val
2341
+ var value = this.getValue(editor$1);
2342
+ $textarea.val(value);
2343
+ // focus 一个 input(异步,此时 DOM 尚未渲染)
2344
+ setTimeout(function () {
2345
+ $textarea.focus();
2346
+ });
2347
+ return $content[0];
2348
+ };
2349
+ EditFormulaMenu.prototype.updateFormula = function (editor$1, value) {
2350
+ if (!value) {
2351
+ return;
2352
+ }
2353
+ // 还原选区
2354
+ editor$1.restoreSelection();
2355
+ if (this.isDisabled(editor$1)) {
2356
+ return;
2357
+ }
2358
+ var selectedElem = this.getSelectedElem(editor$1);
2359
+ if (selectedElem == null) {
2360
+ return;
2361
+ }
2362
+ var path = editor.DomEditor.findPath(editor$1, selectedElem);
2363
+ var props = { value: value };
2364
+ editor.SlateTransforms.setNodes(editor$1, props, { at: path });
2365
+ };
2366
+ return EditFormulaMenu;
2367
+ }());
2368
+
2369
+ /**
2370
+ * @description insert formula menu
2371
+ * @author wangfupeng
2372
+ */
2373
+ /**
2374
+ * 生成唯一的 DOM ID
2375
+ */
2376
+ function genDomID() {
2377
+ return genRandomStr('w-e-insert-formula');
2378
+ }
2379
+ var InsertFormulaMenu = /** @class */ (function () {
2380
+ function InsertFormulaMenu() {
2381
+ this.title = editor.t('formula.insert');
2382
+ this.iconSvg = SIGMA_SVG;
2383
+ this.tag = 'button';
2384
+ this.showModal = true; // 点击 button 时显示 modal
2385
+ this.modalWidth = 300;
2386
+ this.$content = null;
2387
+ this.textareaId = genDomID();
2388
+ this.buttonId = genDomID();
2389
+ }
2390
+ InsertFormulaMenu.prototype.getValue = function (_editor) {
2391
+ // 插入菜单,不需要 value
2392
+ return '';
2393
+ };
2394
+ InsertFormulaMenu.prototype.isActive = function (_editor) {
2395
+ // 任何时候,都不用激活 menu
2396
+ return false;
2397
+ };
2398
+ InsertFormulaMenu.prototype.exec = function (_editor, _value) {
2399
+ // 点击菜单时,弹出 modal 之前,不需要执行其他代码
2400
+ // 此处空着即可
2401
+ };
2402
+ InsertFormulaMenu.prototype.isDisabled = function (editor$1) {
2403
+ var selection = editor$1.selection;
2404
+ if (selection == null) {
2405
+ return true;
2406
+ }
2407
+ if (editor.SlateRange.isExpanded(selection)) {
2408
+ return true;
2409
+ } // 选区非折叠,禁用
2410
+ var selectedElems = editor.DomEditor.getSelectedElems(editor$1);
2411
+ var hasVoidElem = selectedElems.some(function (elem) { return editor$1.isVoid(elem); });
2412
+ if (hasVoidElem) {
2413
+ return true;
2414
+ } // 选中了 void 元素,禁用
2415
+ var hasPreElem = selectedElems.some(function (elem) { return editor.DomEditor.getNodeType(elem) === 'pre'; });
2416
+ if (hasPreElem) {
2417
+ return true;
2418
+ } // 选中了 pre 原则,禁用
2419
+ return false;
2420
+ };
2421
+ InsertFormulaMenu.prototype.getModalPositionNode = function (_editor) {
2422
+ return null; // modal 依据选区定位
2423
+ };
2424
+ InsertFormulaMenu.prototype.getModalContentElem = function (editor$1) {
2425
+ var _this = this;
2426
+ var _a = this, textareaId = _a.textareaId, buttonId = _a.buttonId;
2427
+ var _b = __read(editor.genModalTextareaElems(editor.t('formula.formula'), textareaId, editor.t('formula.placeholder')), 2), textareaContainerElem = _b[0], textareaElem = _b[1];
2428
+ var $textarea = $(textareaElem);
2429
+ var _c = __read(editor.genModalButtonElems(buttonId, editor.t('formula.ok')), 1), buttonContainerElem = _c[0];
2430
+ if (this.$content == null) {
2431
+ // 第一次渲染
2432
+ var $content_1 = $('<div></div>');
2433
+ // 绑定事件(第一次渲染时绑定,不要重复绑定)
2434
+ $content_1.on('click', "#".concat(buttonId), function (e) {
2435
+ e.preventDefault();
2436
+ var value = $content_1.find("#".concat(textareaId)).val().trim();
2437
+ _this.insertFormula(editor$1, value);
2438
+ editor$1.hidePanelOrModal(); // 隐藏 modal
2439
+ });
2440
+ // 记录属性,重要
2441
+ this.$content = $content_1;
2442
+ }
2443
+ var $content = this.$content;
2444
+ $content.html(''); // 先清空内容
2445
+ // append textarea and button
2446
+ $content.append(textareaContainerElem);
2447
+ $content.append(buttonContainerElem);
2448
+ // 设置 input val
2449
+ $textarea.val('');
2450
+ // focus 一个 input(异步,此时 DOM 尚未渲染)
2451
+ setTimeout(function () {
2452
+ $textarea.focus();
2453
+ });
2454
+ return $content[0];
2455
+ };
2456
+ InsertFormulaMenu.prototype.insertFormula = function (editor, value) {
2457
+ if (!value) {
2458
+ return;
2459
+ }
2460
+ // 还原选区
2461
+ editor.restoreSelection();
2462
+ if (this.isDisabled(editor)) {
2463
+ return;
2464
+ }
2465
+ var formulaElem = {
2466
+ type: 'formula',
2467
+ value: value,
2468
+ children: [{ text: '' }], // void node 需要有一个空 text
2469
+ };
2470
+ editor.insertNode(formulaElem);
2471
+ };
2472
+ return InsertFormulaMenu;
2473
+ }());
2474
+
2475
+ /**
2476
+ * @description formula menu entry
2477
+ * @author wangfupeng
2478
+ */
2479
+ var insertFormulaMenuConf = {
2480
+ key: 'insertFormula', // menu key ,唯一。注册之后,可配置到工具栏
2481
+ factory: function () {
2482
+ return new InsertFormulaMenu();
2483
+ },
2484
+ };
2485
+ var editFormulaMenuConf = {
2486
+ key: 'editFormula', // menu key ,唯一。注册之后,可配置到工具栏
2487
+ factory: function () {
2488
+ return new EditFormulaMenu();
2489
+ },
2490
+ };
2491
+
2492
+ /**
2493
+ * @description parse elem html
2494
+ * @author wangfupeng
2495
+ */
2496
+ function parseHtml(elem, _children, _editor) {
2497
+ var value = elem.getAttribute('data-value') || '';
2498
+ return {
2499
+ type: 'formula',
2500
+ value: value,
2501
+ children: [{ text: '' }], // void node 必须有一个空白 text
2502
+ };
2503
+ }
2504
+ var parseHtmlConf = {
2505
+ selector: 'span[data-w-e-type="formula"]',
2506
+ parseElemHtml: parseHtml,
2507
+ };
2508
+
2509
+ /**
2510
+ * @description formula plugin
2511
+ * @author wangfupeng
2512
+ */
2513
+ function withFormula(editor$1) {
2514
+ var isInline = editor$1.isInline, isVoid = editor$1.isVoid;
2515
+ var newEditor = editor$1;
2516
+ // 重写 isInline
2517
+ newEditor.isInline = function (elem) {
2518
+ var type = editor.DomEditor.getNodeType(elem);
2519
+ if (type === 'formula') {
2520
+ return true;
2521
+ }
2522
+ return isInline(elem);
2523
+ };
2524
+ // 重写 isVoid
2525
+ newEditor.isVoid = function (elem) {
2526
+ var type = editor.DomEditor.getNodeType(elem);
2527
+ if (type === 'formula') {
2528
+ return true;
2529
+ }
2530
+ return isVoid(elem);
2531
+ };
2532
+ return newEditor;
2533
+ }
2534
+
2535
+ /**
2536
+ * @description render elem
2537
+ * @author wangfupeng
2538
+ */
2539
+ function renderFormula(elem, children, editor$1) {
2540
+ // 当前节点是否选中
2541
+ var selected = editor.DomEditor.isNodeSelected(editor$1, elem);
2542
+ // 构建 formula vnode
2543
+ var _a = elem.value, value = _a === void 0 ? '' : _a;
2544
+ var formulaVnode = snabbdom.h('w-e-formula-card', {
2545
+ dataset: { value: value },
2546
+ }, null);
2547
+ // 构建容器 vnode
2548
+ var containerVnode = snabbdom.h('div', {
2549
+ props: {
2550
+ contentEditable: false, // 不可编辑
2551
+ },
2552
+ style: {
2553
+ display: 'inline-block', // inline
2554
+ marginLeft: '3px',
2555
+ marginRight: '3px',
2556
+ border: selected // 选中/不选中,样式不一样
2557
+ ? '2px solid var(--w-e-textarea-selected-border-color)' // wangEditor 提供了 css var https://www.wangeditor.com/v5/theme.html
2558
+ : '2px solid transparent',
2559
+ borderRadius: '3px',
2560
+ padding: '3px 3px',
2561
+ },
2562
+ }, [formulaVnode]);
2563
+ return containerVnode;
2564
+ }
2565
+ var conf = {
2566
+ type: 'formula', // 节点 type ,重要!!!
2567
+ renderElem: renderFormula,
2568
+ };
2569
+
2570
+ /**
2571
+ * @description formula module entry
2572
+ * @author wangfupeng
2573
+ */
2574
+ var module = {
2575
+ editorPlugin: withFormula,
2576
+ renderElems: [conf],
2577
+ elemsToHtml: [conf$1],
2578
+ parseElemsHtml: [parseHtmlConf],
2579
+ menus: [insertFormulaMenuConf, editFormulaMenuConf],
2580
+ };
2581
+
2582
+ /**
2583
+ * @description src entry
2584
+ * @author wangfupeng
2585
+ */
2586
+ // 全局注册自定义组件,用于渲染公式
2587
+
2588
+ return module;
2589
+
2590
+ }));