@guihz/trading-vue-editor-tes 0.0.120 → 0.0.122

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,65 +1,65 @@
1
- var qC=Object.defineProperty;var UC=(ye,tt,Mt)=>tt in ye?qC(ye,tt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):ye[tt]=Mt;var U=(ye,tt,Mt)=>(UC(ye,typeof tt!="symbol"?tt+"":tt,Mt),Mt),pl=(ye,tt,Mt)=>{if(!tt.has(ye))throw TypeError("Cannot "+Mt)};var on=(ye,tt,Mt)=>(pl(ye,tt,"read from private field"),Mt?Mt.call(ye):tt.get(ye)),_l=(ye,tt,Mt)=>{if(tt.has(ye))throw TypeError("Cannot add the same private member more than once");tt instanceof WeakSet?tt.add(ye):tt.set(ye,Mt)},Ea=(ye,tt,Mt,Xn)=>(pl(ye,tt,"write to private field"),Xn?Xn.call(ye,Mt):tt.set(ye,Mt),Mt);var vl=(ye,tt,Mt)=>(pl(ye,tt,"access private method"),Mt);(function(){"use strict";var _s,gl,Ri,tr;var ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tt(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Mt(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var Xn={exports:{}};/**
1
+ var qC=Object.defineProperty;var UC=(ye,tt,Mt)=>tt in ye?qC(ye,tt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):ye[tt]=Mt;var U=(ye,tt,Mt)=>(UC(ye,typeof tt!="symbol"?tt+"":tt,Mt),Mt),pl=(ye,tt,Mt)=>{if(!tt.has(ye))throw TypeError("Cannot "+Mt)};var on=(ye,tt,Mt)=>(pl(ye,tt,"read from private field"),Mt?Mt.call(ye):tt.get(ye)),_l=(ye,tt,Mt)=>{if(tt.has(ye))throw TypeError("Cannot add the same private member more than once");tt instanceof WeakSet?tt.add(ye):tt.set(ye,Mt)},Ea=(ye,tt,Mt,Xn)=>(pl(ye,tt,"write to private field"),Xn?Xn.call(ye,Mt):tt.set(ye,Mt),Mt);var vl=(ye,tt,Mt)=>(pl(ye,tt,"access private method"),Mt);(function(){"use strict";var _s,gl,Li,tr;var ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tt(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Mt(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var Xn={exports:{}};/**
2
2
  * @license
3
3
  * Lodash <https://lodash.com/>
4
4
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
5
  * Released under MIT license <https://lodash.com/license>
6
6
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
7
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
- */Xn.exports,function(s,e){(function(){var t,r="4.17.21",n=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",d=1,p=2,v=4,x=1,_=2,y=1,m=2,w=4,D=8,C=16,b=32,F=64,B=128,M=256,O=512,A=30,N="...",I=800,R=16,k=1,z=2,L=3,G=1/0,H=9007199254740991,ee=17976931348623157e292,te=NaN,j=4294967295,X=j-1,Y=j>>>1,Q=[["ary",B],["bind",y],["bindKey",m],["curry",D],["curryRight",C],["flip",O],["partial",b],["partialRight",F],["rearg",M]],pe="[object Arguments]",De="[object Array]",we="[object AsyncFunction]",be="[object Boolean]",Oe="[object Date]",Fe="[object DOMException]",nt="[object Error]",Ye="[object Function]",Ie="[object GeneratorFunction]",Re="[object Map]",xt="[object Number]",Ut="[object Null]",Et="[object Object]",lr="[object Promise]",Lr="[object Proxy]",cr="[object RegExp]",yt="[object Set]",Ot="[object String]",P="[object Symbol]",V="[object Undefined]",J="[object WeakMap]",ie="[object WeakSet]",ue="[object ArrayBuffer]",se="[object DataView]",_e="[object Float32Array]",he="[object Float64Array]",de="[object Int8Array]",fe="[object Int16Array]",Xe="[object Int32Array]",et="[object Uint8Array]",ht="[object Uint8ClampedArray]",kt="[object Uint16Array]",It="[object Uint32Array]",rr=/\b__p \+= '';/g,fr=/\b(__p \+=) '' \+/g,en=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Dn=/&(?:amp|lt|gt|quot|#39);/g,li=/[&<>"']/g,vs=RegExp(Dn.source),gs=RegExp(li.source),ms=/<%-([\s\S]+?)%>/g,Li=/<%([\s\S]+?)%>/g,Pi=/<%=([\s\S]+?)%>/g,xs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ki=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zn=/[\\^$.*+?()[\]{}|]/g,Xt=RegExp(zn.source),mr=/^\s+/,zi=/\s/,Ds=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ju=/\{\n\/\* \[wrapped with (.+)\] \*/,Yu=/,? & /,Zu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vu=/[()=,{}\[\]\/\s]/,Gu=/\\(\\)?/g,Ku=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ro=/\w*$/,Xu=/^[-+]0x[0-9a-f]+$/i,Qu=/^0b[01]+$/i,Ju=/^\[object .+?Constructor\]$/,e0=/^0o[0-7]+$/i,t0=/^(?:0|[1-9]\d*)$/,r0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qi=/($^)/,ci=/['\n\r\u2028\u2029\\]/g,Qe="\\ud800-\\udfff",nr="\\u0300-\\u036f",n0="\\ufe20-\\ufe2f",Ui="\\u20d0-\\u20ff",qn=nr+n0+Ui,Lo="\\u2700-\\u27bf",zh="a-z\\xdf-\\xf6\\xf8-\\xff",Lw="\\xac\\xb1\\xd7\\xf7",Pw="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kw="\\u2000-\\u206f",zw=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qh="A-Z\\xc0-\\xd6\\xd8-\\xde",Uh="\\ufe0e\\ufe0f",Wh=Lw+Pw+kw+zw,i0="['’]",qw="["+Qe+"]",Hh="["+Wh+"]",Po="["+qn+"]",jh="\\d+",Uw="["+Lo+"]",Yh="["+zh+"]",Zh="[^"+Qe+Wh+jh+Lo+zh+qh+"]",s0="\\ud83c[\\udffb-\\udfff]",Ww="(?:"+Po+"|"+s0+")",Vh="[^"+Qe+"]",o0="(?:\\ud83c[\\udde6-\\uddff]){2}",a0="[\\ud800-\\udbff][\\udc00-\\udfff]",Wi="["+qh+"]",Gh="\\u200d",Kh="(?:"+Yh+"|"+Zh+")",Hw="(?:"+Wi+"|"+Zh+")",Xh="(?:"+i0+"(?:d|ll|m|re|s|t|ve))?",Qh="(?:"+i0+"(?:D|LL|M|RE|S|T|VE))?",Jh=Ww+"?",ed="["+Uh+"]?",jw="(?:"+Gh+"(?:"+[Vh,o0,a0].join("|")+")"+ed+Jh+")*",Yw="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",td=ed+Jh+jw,Vw="(?:"+[Uw,o0,a0].join("|")+")"+td,Gw="(?:"+[Vh+Po+"?",Po,o0,a0,qw].join("|")+")",Kw=RegExp(i0,"g"),Xw=RegExp(Po,"g"),u0=RegExp(s0+"(?="+s0+")|"+Gw+td,"g"),Qw=RegExp([Wi+"?"+Yh+"+"+Xh+"(?="+[Hh,Wi,"$"].join("|")+")",Hw+"+"+Qh+"(?="+[Hh,Wi+Kh,"$"].join("|")+")",Wi+"?"+Kh+"+"+Xh,Wi+"+"+Qh,Zw,Yw,jh,Vw].join("|"),"g"),Jw=RegExp("["+Gh+Qe+qn+Uh+"]"),e2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,t2=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],r2=-1,Dt={};Dt[_e]=Dt[he]=Dt[de]=Dt[fe]=Dt[Xe]=Dt[et]=Dt[ht]=Dt[kt]=Dt[It]=!0,Dt[pe]=Dt[De]=Dt[ue]=Dt[be]=Dt[se]=Dt[Oe]=Dt[nt]=Dt[Ye]=Dt[Re]=Dt[xt]=Dt[Et]=Dt[cr]=Dt[yt]=Dt[Ot]=Dt[J]=!1;var _t={};_t[pe]=_t[De]=_t[ue]=_t[se]=_t[be]=_t[Oe]=_t[_e]=_t[he]=_t[de]=_t[fe]=_t[Xe]=_t[Re]=_t[xt]=_t[Et]=_t[cr]=_t[yt]=_t[Ot]=_t[P]=_t[et]=_t[ht]=_t[kt]=_t[It]=!0,_t[nt]=_t[Ye]=_t[J]=!1;var n2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},i2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},o2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},a2=parseFloat,u2=parseInt,rd=typeof ye=="object"&&ye&&ye.Object===Object&&ye,l2=typeof self=="object"&&self&&self.Object===Object&&self,Qt=rd||l2||Function("return this")(),l0=e&&!e.nodeType&&e,fi=l0&&!0&&s&&!s.nodeType&&s,nd=fi&&fi.exports===l0,c0=nd&&rd.process,Pr=function(){try{var Z=fi&&fi.require&&fi.require("util").types;return Z||c0&&c0.binding&&c0.binding("util")}catch{}}(),id=Pr&&Pr.isArrayBuffer,sd=Pr&&Pr.isDate,od=Pr&&Pr.isMap,ad=Pr&&Pr.isRegExp,ud=Pr&&Pr.isSet,ld=Pr&&Pr.isTypedArray;function Cr(Z,ne,re){switch(re.length){case 0:return Z.call(ne);case 1:return Z.call(ne,re[0]);case 2:return Z.call(ne,re[0],re[1]);case 3:return Z.call(ne,re[0],re[1],re[2])}return Z.apply(ne,re)}function c2(Z,ne,re,Ee){for(var Le=-1,st=Z==null?0:Z.length;++Le<st;){var Wt=Z[Le];ne(Ee,Wt,re(Wt),Z)}return Ee}function kr(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length;++re<Ee&&ne(Z[re],re,Z)!==!1;);return Z}function f2(Z,ne){for(var re=Z==null?0:Z.length;re--&&ne(Z[re],re,Z)!==!1;);return Z}function cd(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length;++re<Ee;)if(!ne(Z[re],re,Z))return!1;return!0}function Un(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length,Le=0,st=[];++re<Ee;){var Wt=Z[re];ne(Wt,re,Z)&&(st[Le++]=Wt)}return st}function ko(Z,ne){var re=Z==null?0:Z.length;return!!re&&Hi(Z,ne,0)>-1}function f0(Z,ne,re){for(var Ee=-1,Le=Z==null?0:Z.length;++Ee<Le;)if(re(ne,Z[Ee]))return!0;return!1}function At(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length,Le=Array(Ee);++re<Ee;)Le[re]=ne(Z[re],re,Z);return Le}function Wn(Z,ne){for(var re=-1,Ee=ne.length,Le=Z.length;++re<Ee;)Z[Le+re]=ne[re];return Z}function h0(Z,ne,re,Ee){var Le=-1,st=Z==null?0:Z.length;for(Ee&&st&&(re=Z[++Le]);++Le<st;)re=ne(re,Z[Le],Le,Z);return re}function h2(Z,ne,re,Ee){var Le=Z==null?0:Z.length;for(Ee&&Le&&(re=Z[--Le]);Le--;)re=ne(re,Z[Le],Le,Z);return re}function d0(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length;++re<Ee;)if(ne(Z[re],re,Z))return!0;return!1}var d2=p0("length");function p2(Z){return Z.split("")}function _2(Z){return Z.match(Zu)||[]}function fd(Z,ne,re){var Ee;return re(Z,function(Le,st,Wt){if(ne(Le,st,Wt))return Ee=st,!1}),Ee}function zo(Z,ne,re,Ee){for(var Le=Z.length,st=re+(Ee?1:-1);Ee?st--:++st<Le;)if(ne(Z[st],st,Z))return st;return-1}function Hi(Z,ne,re){return ne===ne?F2(Z,ne,re):zo(Z,hd,re)}function v2(Z,ne,re,Ee){for(var Le=re-1,st=Z.length;++Le<st;)if(Ee(Z[Le],ne))return Le;return-1}function hd(Z){return Z!==Z}function dd(Z,ne){var re=Z==null?0:Z.length;return re?v0(Z,ne)/re:te}function p0(Z){return function(ne){return ne==null?t:ne[Z]}}function _0(Z){return function(ne){return Z==null?t:Z[ne]}}function pd(Z,ne,re,Ee,Le){return Le(Z,function(st,Wt,dt){re=Ee?(Ee=!1,st):ne(re,st,Wt,dt)}),re}function g2(Z,ne){var re=Z.length;for(Z.sort(ne);re--;)Z[re]=Z[re].value;return Z}function v0(Z,ne){for(var re,Ee=-1,Le=Z.length;++Ee<Le;){var st=ne(Z[Ee]);st!==t&&(re=re===t?st:re+st)}return re}function g0(Z,ne){for(var re=-1,Ee=Array(Z);++re<Z;)Ee[re]=ne(re);return Ee}function m2(Z,ne){return At(ne,function(re){return[re,Z[re]]})}function _d(Z){return Z&&Z.slice(0,xd(Z)+1).replace(mr,"")}function Fr(Z){return function(ne){return Z(ne)}}function m0(Z,ne){return At(ne,function(re){return Z[re]})}function ws(Z,ne){return Z.has(ne)}function vd(Z,ne){for(var re=-1,Ee=Z.length;++re<Ee&&Hi(ne,Z[re],0)>-1;);return re}function gd(Z,ne){for(var re=Z.length;re--&&Hi(ne,Z[re],0)>-1;);return re}function x2(Z,ne){for(var re=Z.length,Ee=0;re--;)Z[re]===ne&&++Ee;return Ee}var y2=_0(n2),D2=_0(i2);function w2(Z){return"\\"+o2[Z]}function b2(Z,ne){return Z==null?t:Z[ne]}function ji(Z){return Jw.test(Z)}function E2(Z){return e2.test(Z)}function A2(Z){for(var ne,re=[];!(ne=Z.next()).done;)re.push(ne.value);return re}function x0(Z){var ne=-1,re=Array(Z.size);return Z.forEach(function(Ee,Le){re[++ne]=[Le,Ee]}),re}function md(Z,ne){return function(re){return Z(ne(re))}}function Hn(Z,ne){for(var re=-1,Ee=Z.length,Le=0,st=[];++re<Ee;){var Wt=Z[re];(Wt===ne||Wt===h)&&(Z[re]=h,st[Le++]=re)}return st}function qo(Z){var ne=-1,re=Array(Z.size);return Z.forEach(function(Ee){re[++ne]=Ee}),re}function C2(Z){var ne=-1,re=Array(Z.size);return Z.forEach(function(Ee){re[++ne]=[Ee,Ee]}),re}function F2(Z,ne,re){for(var Ee=re-1,Le=Z.length;++Ee<Le;)if(Z[Ee]===ne)return Ee;return-1}function B2(Z,ne,re){for(var Ee=re+1;Ee--;)if(Z[Ee]===ne)return Ee;return Ee}function Yi(Z){return ji(Z)?N2(Z):d2(Z)}function tn(Z){return ji(Z)?S2(Z):p2(Z)}function xd(Z){for(var ne=Z.length;ne--&&zi.test(Z.charAt(ne)););return ne}var M2=_0(s2);function N2(Z){for(var ne=u0.lastIndex=0;u0.test(Z);)++ne;return ne}function S2(Z){return Z.match(u0)||[]}function O2(Z){return Z.match(Qw)||[]}var I2=function Z(ne){ne=ne==null?Qt:Zi.defaults(Qt.Object(),ne,Zi.pick(Qt,t2));var re=ne.Array,Ee=ne.Date,Le=ne.Error,st=ne.Function,Wt=ne.Math,dt=ne.Object,y0=ne.RegExp,T2=ne.String,zr=ne.TypeError,Uo=re.prototype,$2=st.prototype,Vi=dt.prototype,Wo=ne["__core-js_shared__"],Ho=$2.toString,lt=Vi.hasOwnProperty,R2=0,yd=function(){var o=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),jo=Vi.toString,L2=Ho.call(dt),P2=Qt._,k2=y0("^"+Ho.call(lt).replace(zn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yo=nd?ne.Buffer:t,jn=ne.Symbol,Zo=ne.Uint8Array,Dd=Yo?Yo.allocUnsafe:t,Vo=md(dt.getPrototypeOf,dt),wd=dt.create,bd=Vi.propertyIsEnumerable,Go=Uo.splice,Ed=jn?jn.isConcatSpreadable:t,bs=jn?jn.iterator:t,hi=jn?jn.toStringTag:t,Ko=function(){try{var o=gi(dt,"defineProperty");return o({},"",{}),o}catch{}}(),z2=ne.clearTimeout!==Qt.clearTimeout&&ne.clearTimeout,q2=Ee&&Ee.now!==Qt.Date.now&&Ee.now,U2=ne.setTimeout!==Qt.setTimeout&&ne.setTimeout,Xo=Wt.ceil,Qo=Wt.floor,D0=dt.getOwnPropertySymbols,W2=Yo?Yo.isBuffer:t,Ad=ne.isFinite,H2=Uo.join,j2=md(dt.keys,dt),Ht=Wt.max,ir=Wt.min,Y2=Ee.now,Z2=ne.parseInt,Cd=Wt.random,V2=Uo.reverse,w0=gi(ne,"DataView"),Es=gi(ne,"Map"),b0=gi(ne,"Promise"),Gi=gi(ne,"Set"),As=gi(ne,"WeakMap"),Cs=gi(dt,"create"),Jo=As&&new As,Ki={},G2=mi(w0),K2=mi(Es),X2=mi(b0),Q2=mi(Gi),J2=mi(As),ea=jn?jn.prototype:t,Fs=ea?ea.valueOf:t,Fd=ea?ea.toString:t;function T(o){if(Nt(o)&&!Pe(o)&&!(o instanceof Ze)){if(o instanceof qr)return o;if(lt.call(o,"__wrapped__"))return Bp(o)}return new qr(o)}var Xi=function(){function o(){}return function(l){if(!Bt(l))return{};if(wd)return wd(l);o.prototype=l;var g=new o;return o.prototype=t,g}}();function ta(){}function qr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}T.templateSettings={escape:ms,evaluate:Li,interpolate:Pi,variable:"",imports:{_:T}},T.prototype=ta.prototype,T.prototype.constructor=T,qr.prototype=Xi(ta.prototype),qr.prototype.constructor=qr;function Ze(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function eb(){var o=new Ze(this.__wrapped__);return o.__actions__=xr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=xr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=xr(this.__views__),o}function tb(){if(this.__filtered__){var o=new Ze(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function rb(){var o=this.__wrapped__.value(),l=this.__dir__,g=Pe(o),E=l<0,S=g?o.length:0,$=pE(0,S,this.__views__),q=$.start,W=$.end,K=W-q,oe=E?W:q-1,ae=this.__iteratees__,ce=ae.length,ge=0,Ae=ir(K,this.__takeCount__);if(!g||!E&&S==K&&Ae==K)return Xd(o,this.__actions__);var Ne=[];e:for(;K--&&ge<Ae;){oe+=l;for(var qe=-1,Se=o[oe];++qe<ce;){var He=ae[qe],Ke=He.iteratee,Nr=He.type,pr=Ke(Se);if(Nr==z)Se=pr;else if(!pr){if(Nr==k)continue e;break e}}Ne[ge++]=Se}return Ne}Ze.prototype=Xi(ta.prototype),Ze.prototype.constructor=Ze;function di(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l<g;){var E=o[l];this.set(E[0],E[1])}}function nb(){this.__data__=Cs?Cs(null):{},this.size=0}function ib(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function sb(o){var l=this.__data__;if(Cs){var g=l[o];return g===f?t:g}return lt.call(l,o)?l[o]:t}function ob(o){var l=this.__data__;return Cs?l[o]!==t:lt.call(l,o)}function ab(o,l){var g=this.__data__;return this.size+=this.has(o)?0:1,g[o]=Cs&&l===t?f:l,this}di.prototype.clear=nb,di.prototype.delete=ib,di.prototype.get=sb,di.prototype.has=ob,di.prototype.set=ab;function wn(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l<g;){var E=o[l];this.set(E[0],E[1])}}function ub(){this.__data__=[],this.size=0}function lb(o){var l=this.__data__,g=ra(l,o);if(g<0)return!1;var E=l.length-1;return g==E?l.pop():Go.call(l,g,1),--this.size,!0}function cb(o){var l=this.__data__,g=ra(l,o);return g<0?t:l[g][1]}function fb(o){return ra(this.__data__,o)>-1}function hb(o,l){var g=this.__data__,E=ra(g,o);return E<0?(++this.size,g.push([o,l])):g[E][1]=l,this}wn.prototype.clear=ub,wn.prototype.delete=lb,wn.prototype.get=cb,wn.prototype.has=fb,wn.prototype.set=hb;function bn(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l<g;){var E=o[l];this.set(E[0],E[1])}}function db(){this.size=0,this.__data__={hash:new di,map:new(Es||wn),string:new di}}function pb(o){var l=pa(this,o).delete(o);return this.size-=l?1:0,l}function _b(o){return pa(this,o).get(o)}function vb(o){return pa(this,o).has(o)}function gb(o,l){var g=pa(this,o),E=g.size;return g.set(o,l),this.size+=g.size==E?0:1,this}bn.prototype.clear=db,bn.prototype.delete=pb,bn.prototype.get=_b,bn.prototype.has=vb,bn.prototype.set=gb;function pi(o){var l=-1,g=o==null?0:o.length;for(this.__data__=new bn;++l<g;)this.add(o[l])}function mb(o){return this.__data__.set(o,f),this}function xb(o){return this.__data__.has(o)}pi.prototype.add=pi.prototype.push=mb,pi.prototype.has=xb;function rn(o){var l=this.__data__=new wn(o);this.size=l.size}function yb(){this.__data__=new wn,this.size=0}function Db(o){var l=this.__data__,g=l.delete(o);return this.size=l.size,g}function wb(o){return this.__data__.get(o)}function bb(o){return this.__data__.has(o)}function Eb(o,l){var g=this.__data__;if(g instanceof wn){var E=g.__data__;if(!Es||E.length<n-1)return E.push([o,l]),this.size=++g.size,this;g=this.__data__=new bn(E)}return g.set(o,l),this.size=g.size,this}rn.prototype.clear=yb,rn.prototype.delete=Db,rn.prototype.get=wb,rn.prototype.has=bb,rn.prototype.set=Eb;function Bd(o,l){var g=Pe(o),E=!g&&xi(o),S=!g&&!E&&Kn(o),$=!g&&!E&&!S&&ts(o),q=g||E||S||$,W=q?g0(o.length,T2):[],K=W.length;for(var oe in o)(l||lt.call(o,oe))&&!(q&&(oe=="length"||S&&(oe=="offset"||oe=="parent")||$&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||Fn(oe,K)))&&W.push(oe);return W}function Md(o){var l=o.length;return l?o[T0(0,l-1)]:t}function Ab(o,l){return _a(xr(o),_i(l,0,o.length))}function Cb(o){return _a(xr(o))}function E0(o,l,g){(g!==t&&!nn(o[l],g)||g===t&&!(l in o))&&En(o,l,g)}function Bs(o,l,g){var E=o[l];(!(lt.call(o,l)&&nn(E,g))||g===t&&!(l in o))&&En(o,l,g)}function ra(o,l){for(var g=o.length;g--;)if(nn(o[g][0],l))return g;return-1}function Fb(o,l,g,E){return Yn(o,function(S,$,q){l(E,S,g(S),q)}),E}function Nd(o,l){return o&&hn(l,Yt(l),o)}function Bb(o,l){return o&&hn(l,Dr(l),o)}function En(o,l,g){l=="__proto__"&&Ko?Ko(o,l,{configurable:!0,enumerable:!0,value:g,writable:!0}):o[l]=g}function A0(o,l){for(var g=-1,E=l.length,S=re(E),$=o==null;++g<E;)S[g]=$?t:sl(o,l[g]);return S}function _i(o,l,g){return o===o&&(g!==t&&(o=o<=g?o:g),l!==t&&(o=o>=l?o:l)),o}function Ur(o,l,g,E,S,$){var q,W=l&d,K=l&p,oe=l&v;if(g&&(q=S?g(o,E,S,$):g(o)),q!==t)return q;if(!Bt(o))return o;var ae=Pe(o);if(ae){if(q=vE(o),!W)return xr(o,q)}else{var ce=sr(o),ge=ce==Ye||ce==Ie;if(Kn(o))return ep(o,W);if(ce==Et||ce==pe||ge&&!S){if(q=K||ge?{}:xp(o),!W)return K?sE(o,Bb(q,o)):iE(o,Nd(q,o))}else{if(!_t[ce])return S?o:{};q=gE(o,ce,W)}}$||($=new rn);var Ae=$.get(o);if(Ae)return Ae;$.set(o,q),Vp(o)?o.forEach(function(Se){q.add(Ur(Se,l,g,Se,o,$))}):Yp(o)&&o.forEach(function(Se,He){q.set(He,Ur(Se,l,g,He,o,$))});var Ne=oe?K?j0:H0:K?Dr:Yt,qe=ae?t:Ne(o);return kr(qe||o,function(Se,He){qe&&(He=Se,Se=o[He]),Bs(q,He,Ur(Se,l,g,He,o,$))}),q}function Mb(o){var l=Yt(o);return function(g){return Sd(g,o,l)}}function Sd(o,l,g){var E=g.length;if(o==null)return!E;for(o=dt(o);E--;){var S=g[E],$=l[S],q=o[S];if(q===t&&!(S in o)||!$(q))return!1}return!0}function Od(o,l,g){if(typeof o!="function")throw new zr(a);return $s(function(){o.apply(t,g)},l)}function Ms(o,l,g,E){var S=-1,$=ko,q=!0,W=o.length,K=[],oe=l.length;if(!W)return K;g&&(l=At(l,Fr(g))),E?($=f0,q=!1):l.length>=n&&($=ws,q=!1,l=new pi(l));e:for(;++S<W;){var ae=o[S],ce=g==null?ae:g(ae);if(ae=E||ae!==0?ae:0,q&&ce===ce){for(var ge=oe;ge--;)if(l[ge]===ce)continue e;K.push(ae)}else $(l,ce,E)||K.push(ae)}return K}var Yn=sp(fn),Id=sp(F0,!0);function Nb(o,l){var g=!0;return Yn(o,function(E,S,$){return g=!!l(E,S,$),g}),g}function na(o,l,g){for(var E=-1,S=o.length;++E<S;){var $=o[E],q=l($);if(q!=null&&(W===t?q===q&&!Mr(q):g(q,W)))var W=q,K=$}return K}function Sb(o,l,g,E){var S=o.length;for(g=ze(g),g<0&&(g=-g>S?0:S+g),E=E===t||E>S?S:ze(E),E<0&&(E+=S),E=g>E?0:Kp(E);g<E;)o[g++]=l;return o}function Td(o,l){var g=[];return Yn(o,function(E,S,$){l(E,S,$)&&g.push(E)}),g}function Jt(o,l,g,E,S){var $=-1,q=o.length;for(g||(g=xE),S||(S=[]);++$<q;){var W=o[$];l>0&&g(W)?l>1?Jt(W,l-1,g,E,S):Wn(S,W):E||(S[S.length]=W)}return S}var C0=op(),$d=op(!0);function fn(o,l){return o&&C0(o,l,Yt)}function F0(o,l){return o&&$d(o,l,Yt)}function ia(o,l){return Un(l,function(g){return Bn(o[g])})}function vi(o,l){l=Vn(l,o);for(var g=0,E=l.length;o!=null&&g<E;)o=o[dn(l[g++])];return g&&g==E?o:t}function Rd(o,l,g){var E=l(o);return Pe(o)?E:Wn(E,g(o))}function hr(o){return o==null?o===t?V:Ut:hi&&hi in dt(o)?dE(o):CE(o)}function B0(o,l){return o>l}function Ob(o,l){return o!=null&&lt.call(o,l)}function Ib(o,l){return o!=null&&l in dt(o)}function Tb(o,l,g){return o>=ir(l,g)&&o<Ht(l,g)}function M0(o,l,g){for(var E=g?f0:ko,S=o[0].length,$=o.length,q=$,W=re($),K=1/0,oe=[];q--;){var ae=o[q];q&&l&&(ae=At(ae,Fr(l))),K=ir(ae.length,K),W[q]=!g&&(l||S>=120&&ae.length>=120)?new pi(q&&ae):t}ae=o[0];var ce=-1,ge=W[0];e:for(;++ce<S&&oe.length<K;){var Ae=ae[ce],Ne=l?l(Ae):Ae;if(Ae=g||Ae!==0?Ae:0,!(ge?ws(ge,Ne):E(oe,Ne,g))){for(q=$;--q;){var qe=W[q];if(!(qe?ws(qe,Ne):E(o[q],Ne,g)))continue e}ge&&ge.push(Ne),oe.push(Ae)}}return oe}function $b(o,l,g,E){return fn(o,function(S,$,q){l(E,g(S),$,q)}),E}function Ns(o,l,g){l=Vn(l,o),o=bp(o,l);var E=o==null?o:o[dn(Hr(l))];return E==null?t:Cr(E,o,g)}function Ld(o){return Nt(o)&&hr(o)==pe}function Rb(o){return Nt(o)&&hr(o)==ue}function Lb(o){return Nt(o)&&hr(o)==Oe}function Ss(o,l,g,E,S){return o===l?!0:o==null||l==null||!Nt(o)&&!Nt(l)?o!==o&&l!==l:Pb(o,l,g,E,Ss,S)}function Pb(o,l,g,E,S,$){var q=Pe(o),W=Pe(l),K=q?De:sr(o),oe=W?De:sr(l);K=K==pe?Et:K,oe=oe==pe?Et:oe;var ae=K==Et,ce=oe==Et,ge=K==oe;if(ge&&Kn(o)){if(!Kn(l))return!1;q=!0,ae=!1}if(ge&&!ae)return $||($=new rn),q||ts(o)?vp(o,l,g,E,S,$):fE(o,l,K,g,E,S,$);if(!(g&x)){var Ae=ae&&lt.call(o,"__wrapped__"),Ne=ce&&lt.call(l,"__wrapped__");if(Ae||Ne){var qe=Ae?o.value():o,Se=Ne?l.value():l;return $||($=new rn),S(qe,Se,g,E,$)}}return ge?($||($=new rn),hE(o,l,g,E,S,$)):!1}function kb(o){return Nt(o)&&sr(o)==Re}function N0(o,l,g,E){var S=g.length,$=S,q=!E;if(o==null)return!$;for(o=dt(o);S--;){var W=g[S];if(q&&W[2]?W[1]!==o[W[0]]:!(W[0]in o))return!1}for(;++S<$;){W=g[S];var K=W[0],oe=o[K],ae=W[1];if(q&&W[2]){if(oe===t&&!(K in o))return!1}else{var ce=new rn;if(E)var ge=E(oe,ae,K,o,l,ce);if(!(ge===t?Ss(ae,oe,x|_,E,ce):ge))return!1}}return!0}function Pd(o){if(!Bt(o)||DE(o))return!1;var l=Bn(o)?k2:Ju;return l.test(mi(o))}function zb(o){return Nt(o)&&hr(o)==cr}function qb(o){return Nt(o)&&sr(o)==yt}function Ub(o){return Nt(o)&&Da(o.length)&&!!Dt[hr(o)]}function kd(o){return typeof o=="function"?o:o==null?wr:typeof o=="object"?Pe(o)?Ud(o[0],o[1]):qd(o):a1(o)}function S0(o){if(!Ts(o))return j2(o);var l=[];for(var g in dt(o))lt.call(o,g)&&g!="constructor"&&l.push(g);return l}function Wb(o){if(!Bt(o))return AE(o);var l=Ts(o),g=[];for(var E in o)E=="constructor"&&(l||!lt.call(o,E))||g.push(E);return g}function O0(o,l){return o<l}function zd(o,l){var g=-1,E=yr(o)?re(o.length):[];return Yn(o,function(S,$,q){E[++g]=l(S,$,q)}),E}function qd(o){var l=Z0(o);return l.length==1&&l[0][2]?Dp(l[0][0],l[0][1]):function(g){return g===o||N0(g,o,l)}}function Ud(o,l){return G0(o)&&yp(l)?Dp(dn(o),l):function(g){var E=sl(g,o);return E===t&&E===l?ol(g,o):Ss(l,E,x|_)}}function sa(o,l,g,E,S){o!==l&&C0(l,function($,q){if(S||(S=new rn),Bt($))Hb(o,l,q,g,sa,E,S);else{var W=E?E(X0(o,q),$,q+"",o,l,S):t;W===t&&(W=$),E0(o,q,W)}},Dr)}function Hb(o,l,g,E,S,$,q){var W=X0(o,g),K=X0(l,g),oe=q.get(K);if(oe){E0(o,g,oe);return}var ae=$?$(W,K,g+"",o,l,q):t,ce=ae===t;if(ce){var ge=Pe(K),Ae=!ge&&Kn(K),Ne=!ge&&!Ae&&ts(K);ae=K,ge||Ae||Ne?Pe(W)?ae=W:Tt(W)?ae=xr(W):Ae?(ce=!1,ae=ep(K,!0)):Ne?(ce=!1,ae=tp(K,!0)):ae=[]:Rs(K)||xi(K)?(ae=W,xi(W)?ae=Xp(W):(!Bt(W)||Bn(W))&&(ae=xp(K))):ce=!1}ce&&(q.set(K,ae),S(ae,K,E,$,q),q.delete(K)),E0(o,g,ae)}function Wd(o,l){var g=o.length;if(g)return l+=l<0?g:0,Fn(l,g)?o[l]:t}function Hd(o,l,g){l.length?l=At(l,function($){return Pe($)?function(q){return vi(q,$.length===1?$[0]:$)}:$}):l=[wr];var E=-1;l=At(l,Fr(Me()));var S=zd(o,function($,q,W){var K=At(l,function(oe){return oe($)});return{criteria:K,index:++E,value:$}});return g2(S,function($,q){return nE($,q,g)})}function jb(o,l){return jd(o,l,function(g,E){return ol(o,E)})}function jd(o,l,g){for(var E=-1,S=l.length,$={};++E<S;){var q=l[E],W=vi(o,q);g(W,q)&&Os($,Vn(q,o),W)}return $}function Yb(o){return function(l){return vi(l,o)}}function I0(o,l,g,E){var S=E?v2:Hi,$=-1,q=l.length,W=o;for(o===l&&(l=xr(l)),g&&(W=At(o,Fr(g)));++$<q;)for(var K=0,oe=l[$],ae=g?g(oe):oe;(K=S(W,ae,K,E))>-1;)W!==o&&Go.call(W,K,1),Go.call(o,K,1);return o}function Yd(o,l){for(var g=o?l.length:0,E=g-1;g--;){var S=l[g];if(g==E||S!==$){var $=S;Fn(S)?Go.call(o,S,1):L0(o,S)}}return o}function T0(o,l){return o+Qo(Cd()*(l-o+1))}function Zb(o,l,g,E){for(var S=-1,$=Ht(Xo((l-o)/(g||1)),0),q=re($);$--;)q[E?$:++S]=o,o+=g;return q}function $0(o,l){var g="";if(!o||l<1||l>H)return g;do l%2&&(g+=o),l=Qo(l/2),l&&(o+=o);while(l);return g}function Ue(o,l){return Q0(wp(o,l,wr),o+"")}function Vb(o){return Md(rs(o))}function Gb(o,l){var g=rs(o);return _a(g,_i(l,0,g.length))}function Os(o,l,g,E){if(!Bt(o))return o;l=Vn(l,o);for(var S=-1,$=l.length,q=$-1,W=o;W!=null&&++S<$;){var K=dn(l[S]),oe=g;if(K==="__proto__"||K==="constructor"||K==="prototype")return o;if(S!=q){var ae=W[K];oe=E?E(ae,K,W):t,oe===t&&(oe=Bt(ae)?ae:Fn(l[S+1])?[]:{})}Bs(W,K,oe),W=W[K]}return o}var Zd=Jo?function(o,l){return Jo.set(o,l),o}:wr,Kb=Ko?function(o,l){return Ko(o,"toString",{configurable:!0,enumerable:!1,value:ul(l),writable:!0})}:wr;function Xb(o){return _a(rs(o))}function Wr(o,l,g){var E=-1,S=o.length;l<0&&(l=-l>S?0:S+l),g=g>S?S:g,g<0&&(g+=S),S=l>g?0:g-l>>>0,l>>>=0;for(var $=re(S);++E<S;)$[E]=o[E+l];return $}function Qb(o,l){var g;return Yn(o,function(E,S,$){return g=l(E,S,$),!g}),!!g}function oa(o,l,g){var E=0,S=o==null?E:o.length;if(typeof l=="number"&&l===l&&S<=Y){for(;E<S;){var $=E+S>>>1,q=o[$];q!==null&&!Mr(q)&&(g?q<=l:q<l)?E=$+1:S=$}return S}return R0(o,l,wr,g)}function R0(o,l,g,E){var S=0,$=o==null?0:o.length;if($===0)return 0;l=g(l);for(var q=l!==l,W=l===null,K=Mr(l),oe=l===t;S<$;){var ae=Qo((S+$)/2),ce=g(o[ae]),ge=ce!==t,Ae=ce===null,Ne=ce===ce,qe=Mr(ce);if(q)var Se=E||Ne;else oe?Se=Ne&&(E||ge):W?Se=Ne&&ge&&(E||!Ae):K?Se=Ne&&ge&&!Ae&&(E||!qe):Ae||qe?Se=!1:Se=E?ce<=l:ce<l;Se?S=ae+1:$=ae}return ir($,X)}function Vd(o,l){for(var g=-1,E=o.length,S=0,$=[];++g<E;){var q=o[g],W=l?l(q):q;if(!g||!nn(W,K)){var K=W;$[S++]=q===0?0:q}}return $}function Gd(o){return typeof o=="number"?o:Mr(o)?te:+o}function Br(o){if(typeof o=="string")return o;if(Pe(o))return At(o,Br)+"";if(Mr(o))return Fd?Fd.call(o):"";var l=o+"";return l=="0"&&1/o==-G?"-0":l}function Zn(o,l,g){var E=-1,S=ko,$=o.length,q=!0,W=[],K=W;if(g)q=!1,S=f0;else if($>=n){var oe=l?null:lE(o);if(oe)return qo(oe);q=!1,S=ws,K=new pi}else K=l?[]:W;e:for(;++E<$;){var ae=o[E],ce=l?l(ae):ae;if(ae=g||ae!==0?ae:0,q&&ce===ce){for(var ge=K.length;ge--;)if(K[ge]===ce)continue e;l&&K.push(ce),W.push(ae)}else S(K,ce,g)||(K!==W&&K.push(ce),W.push(ae))}return W}function L0(o,l){return l=Vn(l,o),o=bp(o,l),o==null||delete o[dn(Hr(l))]}function Kd(o,l,g,E){return Os(o,l,g(vi(o,l)),E)}function aa(o,l,g,E){for(var S=o.length,$=E?S:-1;(E?$--:++$<S)&&l(o[$],$,o););return g?Wr(o,E?0:$,E?$+1:S):Wr(o,E?$+1:0,E?S:$)}function Xd(o,l){var g=o;return g instanceof Ze&&(g=g.value()),h0(l,function(E,S){return S.func.apply(S.thisArg,Wn([E],S.args))},g)}function P0(o,l,g){var E=o.length;if(E<2)return E?Zn(o[0]):[];for(var S=-1,$=re(E);++S<E;)for(var q=o[S],W=-1;++W<E;)W!=S&&($[S]=Ms($[S]||q,o[W],l,g));return Zn(Jt($,1),l,g)}function Qd(o,l,g){for(var E=-1,S=o.length,$=l.length,q={};++E<S;){var W=E<$?l[E]:t;g(q,o[E],W)}return q}function k0(o){return Tt(o)?o:[]}function z0(o){return typeof o=="function"?o:wr}function Vn(o,l){return Pe(o)?o:G0(o,l)?[o]:Fp(at(o))}var Jb=Ue;function Gn(o,l,g){var E=o.length;return g=g===t?E:g,!l&&g>=E?o:Wr(o,l,g)}var Jd=z2||function(o){return Qt.clearTimeout(o)};function ep(o,l){if(l)return o.slice();var g=o.length,E=Dd?Dd(g):new o.constructor(g);return o.copy(E),E}function q0(o){var l=new o.constructor(o.byteLength);return new Zo(l).set(new Zo(o)),l}function eE(o,l){var g=l?q0(o.buffer):o.buffer;return new o.constructor(g,o.byteOffset,o.byteLength)}function tE(o){var l=new o.constructor(o.source,Ro.exec(o));return l.lastIndex=o.lastIndex,l}function rE(o){return Fs?dt(Fs.call(o)):{}}function tp(o,l){var g=l?q0(o.buffer):o.buffer;return new o.constructor(g,o.byteOffset,o.length)}function rp(o,l){if(o!==l){var g=o!==t,E=o===null,S=o===o,$=Mr(o),q=l!==t,W=l===null,K=l===l,oe=Mr(l);if(!W&&!oe&&!$&&o>l||$&&q&&K&&!W&&!oe||E&&q&&K||!g&&K||!S)return 1;if(!E&&!$&&!oe&&o<l||oe&&g&&S&&!E&&!$||W&&g&&S||!q&&S||!K)return-1}return 0}function nE(o,l,g){for(var E=-1,S=o.criteria,$=l.criteria,q=S.length,W=g.length;++E<q;){var K=rp(S[E],$[E]);if(K){if(E>=W)return K;var oe=g[E];return K*(oe=="desc"?-1:1)}}return o.index-l.index}function np(o,l,g,E){for(var S=-1,$=o.length,q=g.length,W=-1,K=l.length,oe=Ht($-q,0),ae=re(K+oe),ce=!E;++W<K;)ae[W]=l[W];for(;++S<q;)(ce||S<$)&&(ae[g[S]]=o[S]);for(;oe--;)ae[W++]=o[S++];return ae}function ip(o,l,g,E){for(var S=-1,$=o.length,q=-1,W=g.length,K=-1,oe=l.length,ae=Ht($-W,0),ce=re(ae+oe),ge=!E;++S<ae;)ce[S]=o[S];for(var Ae=S;++K<oe;)ce[Ae+K]=l[K];for(;++q<W;)(ge||S<$)&&(ce[Ae+g[q]]=o[S++]);return ce}function xr(o,l){var g=-1,E=o.length;for(l||(l=re(E));++g<E;)l[g]=o[g];return l}function hn(o,l,g,E){var S=!g;g||(g={});for(var $=-1,q=l.length;++$<q;){var W=l[$],K=E?E(g[W],o[W],W,g,o):t;K===t&&(K=o[W]),S?En(g,W,K):Bs(g,W,K)}return g}function iE(o,l){return hn(o,V0(o),l)}function sE(o,l){return hn(o,gp(o),l)}function ua(o,l){return function(g,E){var S=Pe(g)?c2:Fb,$=l?l():{};return S(g,o,Me(E,2),$)}}function Qi(o){return Ue(function(l,g){var E=-1,S=g.length,$=S>1?g[S-1]:t,q=S>2?g[2]:t;for($=o.length>3&&typeof $=="function"?(S--,$):t,q&&dr(g[0],g[1],q)&&($=S<3?t:$,S=1),l=dt(l);++E<S;){var W=g[E];W&&o(l,W,E,$)}return l})}function sp(o,l){return function(g,E){if(g==null)return g;if(!yr(g))return o(g,E);for(var S=g.length,$=l?S:-1,q=dt(g);(l?$--:++$<S)&&E(q[$],$,q)!==!1;);return g}}function op(o){return function(l,g,E){for(var S=-1,$=dt(l),q=E(l),W=q.length;W--;){var K=q[o?W:++S];if(g($[K],K,$)===!1)break}return l}}function oE(o,l,g){var E=l&y,S=Is(o);function $(){var q=this&&this!==Qt&&this instanceof $?S:o;return q.apply(E?g:this,arguments)}return $}function ap(o){return function(l){l=at(l);var g=ji(l)?tn(l):t,E=g?g[0]:l.charAt(0),S=g?Gn(g,1).join(""):l.slice(1);return E[o]()+S}}function Ji(o){return function(l){return h0(s1(i1(l).replace(Kw,"")),o,"")}}function Is(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var g=Xi(o.prototype),E=o.apply(g,l);return Bt(E)?E:g}}function aE(o,l,g){var E=Is(o);function S(){for(var $=arguments.length,q=re($),W=$,K=es(S);W--;)q[W]=arguments[W];var oe=$<3&&q[0]!==K&&q[$-1]!==K?[]:Hn(q,K);if($-=oe.length,$<g)return hp(o,l,la,S.placeholder,t,q,oe,t,t,g-$);var ae=this&&this!==Qt&&this instanceof S?E:o;return Cr(ae,this,q)}return S}function up(o){return function(l,g,E){var S=dt(l);if(!yr(l)){var $=Me(g,3);l=Yt(l),g=function(W){return $(S[W],W,S)}}var q=o(l,g,E);return q>-1?S[$?l[q]:q]:t}}function lp(o){return Cn(function(l){var g=l.length,E=g,S=qr.prototype.thru;for(o&&l.reverse();E--;){var $=l[E];if(typeof $!="function")throw new zr(a);if(S&&!q&&da($)=="wrapper")var q=new qr([],!0)}for(E=q?E:g;++E<g;){$=l[E];var W=da($),K=W=="wrapper"?Y0($):t;K&&K0(K[0])&&K[1]==(B|D|b|M)&&!K[4].length&&K[9]==1?q=q[da(K[0])].apply(q,K[3]):q=$.length==1&&K0($)?q[W]():q.thru($)}return function(){var oe=arguments,ae=oe[0];if(q&&oe.length==1&&Pe(ae))return q.plant(ae).value();for(var ce=0,ge=g?l[ce].apply(this,oe):ae;++ce<g;)ge=l[ce].call(this,ge);return ge}})}function la(o,l,g,E,S,$,q,W,K,oe){var ae=l&B,ce=l&y,ge=l&m,Ae=l&(D|C),Ne=l&O,qe=ge?t:Is(o);function Se(){for(var He=arguments.length,Ke=re(He),Nr=He;Nr--;)Ke[Nr]=arguments[Nr];if(Ae)var pr=es(Se),Sr=x2(Ke,pr);if(E&&(Ke=np(Ke,E,S,Ae)),$&&(Ke=ip(Ke,$,q,Ae)),He-=Sr,Ae&&He<oe){var $t=Hn(Ke,pr);return hp(o,l,la,Se.placeholder,g,Ke,$t,W,K,oe-He)}var sn=ce?g:this,Nn=ge?sn[o]:o;return He=Ke.length,W?Ke=FE(Ke,W):Ne&&He>1&&Ke.reverse(),ae&&K<He&&(Ke.length=K),this&&this!==Qt&&this instanceof Se&&(Nn=qe||Is(Nn)),Nn.apply(sn,Ke)}return Se}function cp(o,l){return function(g,E){return $b(g,o,l(E),{})}}function ca(o,l){return function(g,E){var S;if(g===t&&E===t)return l;if(g!==t&&(S=g),E!==t){if(S===t)return E;typeof g=="string"||typeof E=="string"?(g=Br(g),E=Br(E)):(g=Gd(g),E=Gd(E)),S=o(g,E)}return S}}function U0(o){return Cn(function(l){return l=At(l,Fr(Me())),Ue(function(g){var E=this;return o(l,function(S){return Cr(S,E,g)})})})}function fa(o,l){l=l===t?" ":Br(l);var g=l.length;if(g<2)return g?$0(l,o):l;var E=$0(l,Xo(o/Yi(l)));return ji(l)?Gn(tn(E),0,o).join(""):E.slice(0,o)}function uE(o,l,g,E){var S=l&y,$=Is(o);function q(){for(var W=-1,K=arguments.length,oe=-1,ae=E.length,ce=re(ae+K),ge=this&&this!==Qt&&this instanceof q?$:o;++oe<ae;)ce[oe]=E[oe];for(;K--;)ce[oe++]=arguments[++W];return Cr(ge,S?g:this,ce)}return q}function fp(o){return function(l,g,E){return E&&typeof E!="number"&&dr(l,g,E)&&(g=E=t),l=Mn(l),g===t?(g=l,l=0):g=Mn(g),E=E===t?l<g?1:-1:Mn(E),Zb(l,g,E,o)}}function ha(o){return function(l,g){return typeof l=="string"&&typeof g=="string"||(l=jr(l),g=jr(g)),o(l,g)}}function hp(o,l,g,E,S,$,q,W,K,oe){var ae=l&D,ce=ae?q:t,ge=ae?t:q,Ae=ae?$:t,Ne=ae?t:$;l|=ae?b:F,l&=~(ae?F:b),l&w||(l&=~(y|m));var qe=[o,l,S,Ae,ce,Ne,ge,W,K,oe],Se=g.apply(t,qe);return K0(o)&&Ep(Se,qe),Se.placeholder=E,Ap(Se,o,l)}function W0(o){var l=Wt[o];return function(g,E){if(g=jr(g),E=E==null?0:ir(ze(E),292),E&&Ad(g)){var S=(at(g)+"e").split("e"),$=l(S[0]+"e"+(+S[1]+E));return S=(at($)+"e").split("e"),+(S[0]+"e"+(+S[1]-E))}return l(g)}}var lE=Gi&&1/qo(new Gi([,-0]))[1]==G?function(o){return new Gi(o)}:fl;function dp(o){return function(l){var g=sr(l);return g==Re?x0(l):g==yt?C2(l):m2(l,o(l))}}function An(o,l,g,E,S,$,q,W){var K=l&m;if(!K&&typeof o!="function")throw new zr(a);var oe=E?E.length:0;if(oe||(l&=~(b|F),E=S=t),q=q===t?q:Ht(ze(q),0),W=W===t?W:ze(W),oe-=S?S.length:0,l&F){var ae=E,ce=S;E=S=t}var ge=K?t:Y0(o),Ae=[o,l,g,E,S,ae,ce,$,q,W];if(ge&&EE(Ae,ge),o=Ae[0],l=Ae[1],g=Ae[2],E=Ae[3],S=Ae[4],W=Ae[9]=Ae[9]===t?K?0:o.length:Ht(Ae[9]-oe,0),!W&&l&(D|C)&&(l&=~(D|C)),!l||l==y)var Ne=oE(o,l,g);else l==D||l==C?Ne=aE(o,l,W):(l==b||l==(y|b))&&!S.length?Ne=uE(o,l,g,E):Ne=la.apply(t,Ae);var qe=ge?Zd:Ep;return Ap(qe(Ne,Ae),o,l)}function pp(o,l,g,E){return o===t||nn(o,Vi[g])&&!lt.call(E,g)?l:o}function _p(o,l,g,E,S,$){return Bt(o)&&Bt(l)&&($.set(l,o),sa(o,l,t,_p,$),$.delete(l)),o}function cE(o){return Rs(o)?t:o}function vp(o,l,g,E,S,$){var q=g&x,W=o.length,K=l.length;if(W!=K&&!(q&&K>W))return!1;var oe=$.get(o),ae=$.get(l);if(oe&&ae)return oe==l&&ae==o;var ce=-1,ge=!0,Ae=g&_?new pi:t;for($.set(o,l),$.set(l,o);++ce<W;){var Ne=o[ce],qe=l[ce];if(E)var Se=q?E(qe,Ne,ce,l,o,$):E(Ne,qe,ce,o,l,$);if(Se!==t){if(Se)continue;ge=!1;break}if(Ae){if(!d0(l,function(He,Ke){if(!ws(Ae,Ke)&&(Ne===He||S(Ne,He,g,E,$)))return Ae.push(Ke)})){ge=!1;break}}else if(!(Ne===qe||S(Ne,qe,g,E,$))){ge=!1;break}}return $.delete(o),$.delete(l),ge}function fE(o,l,g,E,S,$,q){switch(g){case se:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case ue:return!(o.byteLength!=l.byteLength||!$(new Zo(o),new Zo(l)));case be:case Oe:case xt:return nn(+o,+l);case nt:return o.name==l.name&&o.message==l.message;case cr:case Ot:return o==l+"";case Re:var W=x0;case yt:var K=E&x;if(W||(W=qo),o.size!=l.size&&!K)return!1;var oe=q.get(o);if(oe)return oe==l;E|=_,q.set(o,l);var ae=vp(W(o),W(l),E,S,$,q);return q.delete(o),ae;case P:if(Fs)return Fs.call(o)==Fs.call(l)}return!1}function hE(o,l,g,E,S,$){var q=g&x,W=H0(o),K=W.length,oe=H0(l),ae=oe.length;if(K!=ae&&!q)return!1;for(var ce=K;ce--;){var ge=W[ce];if(!(q?ge in l:lt.call(l,ge)))return!1}var Ae=$.get(o),Ne=$.get(l);if(Ae&&Ne)return Ae==l&&Ne==o;var qe=!0;$.set(o,l),$.set(l,o);for(var Se=q;++ce<K;){ge=W[ce];var He=o[ge],Ke=l[ge];if(E)var Nr=q?E(Ke,He,ge,l,o,$):E(He,Ke,ge,o,l,$);if(!(Nr===t?He===Ke||S(He,Ke,g,E,$):Nr)){qe=!1;break}Se||(Se=ge=="constructor")}if(qe&&!Se){var pr=o.constructor,Sr=l.constructor;pr!=Sr&&"constructor"in o&&"constructor"in l&&!(typeof pr=="function"&&pr instanceof pr&&typeof Sr=="function"&&Sr instanceof Sr)&&(qe=!1)}return $.delete(o),$.delete(l),qe}function Cn(o){return Q0(wp(o,t,Sp),o+"")}function H0(o){return Rd(o,Yt,V0)}function j0(o){return Rd(o,Dr,gp)}var Y0=Jo?function(o){return Jo.get(o)}:fl;function da(o){for(var l=o.name+"",g=Ki[l],E=lt.call(Ki,l)?g.length:0;E--;){var S=g[E],$=S.func;if($==null||$==o)return S.name}return l}function es(o){var l=lt.call(T,"placeholder")?T:o;return l.placeholder}function Me(){var o=T.iteratee||ll;return o=o===ll?kd:o,arguments.length?o(arguments[0],arguments[1]):o}function pa(o,l){var g=o.__data__;return yE(l)?g[typeof l=="string"?"string":"hash"]:g.map}function Z0(o){for(var l=Yt(o),g=l.length;g--;){var E=l[g],S=o[E];l[g]=[E,S,yp(S)]}return l}function gi(o,l){var g=b2(o,l);return Pd(g)?g:t}function dE(o){var l=lt.call(o,hi),g=o[hi];try{o[hi]=t;var E=!0}catch{}var S=jo.call(o);return E&&(l?o[hi]=g:delete o[hi]),S}var V0=D0?function(o){return o==null?[]:(o=dt(o),Un(D0(o),function(l){return bd.call(o,l)}))}:hl,gp=D0?function(o){for(var l=[];o;)Wn(l,V0(o)),o=Vo(o);return l}:hl,sr=hr;(w0&&sr(new w0(new ArrayBuffer(1)))!=se||Es&&sr(new Es)!=Re||b0&&sr(b0.resolve())!=lr||Gi&&sr(new Gi)!=yt||As&&sr(new As)!=J)&&(sr=function(o){var l=hr(o),g=l==Et?o.constructor:t,E=g?mi(g):"";if(E)switch(E){case G2:return se;case K2:return Re;case X2:return lr;case Q2:return yt;case J2:return J}return l});function pE(o,l,g){for(var E=-1,S=g.length;++E<S;){var $=g[E],q=$.size;switch($.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=ir(l,o+q);break;case"takeRight":o=Ht(o,l-q);break}}return{start:o,end:l}}function _E(o){var l=o.match(ju);return l?l[1].split(Yu):[]}function mp(o,l,g){l=Vn(l,o);for(var E=-1,S=l.length,$=!1;++E<S;){var q=dn(l[E]);if(!($=o!=null&&g(o,q)))break;o=o[q]}return $||++E!=S?$:(S=o==null?0:o.length,!!S&&Da(S)&&Fn(q,S)&&(Pe(o)||xi(o)))}function vE(o){var l=o.length,g=new o.constructor(l);return l&&typeof o[0]=="string"&&lt.call(o,"index")&&(g.index=o.index,g.input=o.input),g}function xp(o){return typeof o.constructor=="function"&&!Ts(o)?Xi(Vo(o)):{}}function gE(o,l,g){var E=o.constructor;switch(l){case ue:return q0(o);case be:case Oe:return new E(+o);case se:return eE(o,g);case _e:case he:case de:case fe:case Xe:case et:case ht:case kt:case It:return tp(o,g);case Re:return new E;case xt:case Ot:return new E(o);case cr:return tE(o);case yt:return new E;case P:return rE(o)}}function mE(o,l){var g=l.length;if(!g)return o;var E=g-1;return l[E]=(g>1?"& ":"")+l[E],l=l.join(g>2?", ":" "),o.replace(Ds,`{
8
+ */Xn.exports,function(s,e){(function(){var t,r="4.17.21",n=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",d=1,p=2,v=4,x=1,_=2,y=1,m=2,w=4,D=8,C=16,b=32,F=64,B=128,M=256,O=512,A=30,N="...",I=800,L=16,k=1,z=2,R=3,G=1/0,H=9007199254740991,ee=17976931348623157e292,te=NaN,j=4294967295,X=j-1,Y=j>>>1,Q=[["ary",B],["bind",y],["bindKey",m],["curry",D],["curryRight",C],["flip",O],["partial",b],["partialRight",F],["rearg",M]],pe="[object Arguments]",De="[object Array]",we="[object AsyncFunction]",be="[object Boolean]",Oe="[object Date]",Fe="[object DOMException]",nt="[object Error]",Ye="[object Function]",Ie="[object GeneratorFunction]",Le="[object Map]",xt="[object Number]",Ut="[object Null]",Et="[object Object]",lr="[object Promise]",Rr="[object Proxy]",fr="[object RegExp]",yt="[object Set]",Ot="[object String]",P="[object Symbol]",V="[object Undefined]",J="[object WeakMap]",ie="[object WeakSet]",ue="[object ArrayBuffer]",se="[object DataView]",_e="[object Float32Array]",he="[object Float64Array]",de="[object Int8Array]",ce="[object Int16Array]",Xe="[object Int32Array]",et="[object Uint8Array]",ht="[object Uint8ClampedArray]",kt="[object Uint16Array]",It="[object Uint32Array]",rr=/\b__p \+= '';/g,cr=/\b(__p \+=) '' \+/g,en=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Dn=/&(?:amp|lt|gt|quot|#39);/g,li=/[&<>"']/g,vs=RegExp(Dn.source),gs=RegExp(li.source),ms=/<%-([\s\S]+?)%>/g,Ri=/<%([\s\S]+?)%>/g,Pi=/<%=([\s\S]+?)%>/g,xs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ki=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zn=/[\\^$.*+?()[\]{}|]/g,Xt=RegExp(zn.source),mr=/^\s+/,zi=/\s/,Ds=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ju=/\{\n\/\* \[wrapped with (.+)\] \*/,Yu=/,? & /,Zu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vu=/[()=,{}\[\]\/\s]/,Gu=/\\(\\)?/g,Ku=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lo=/\w*$/,Xu=/^[-+]0x[0-9a-f]+$/i,Qu=/^0b[01]+$/i,Ju=/^\[object .+?Constructor\]$/,e0=/^0o[0-7]+$/i,t0=/^(?:0|[1-9]\d*)$/,r0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qi=/($^)/,fi=/['\n\r\u2028\u2029\\]/g,Qe="\\ud800-\\udfff",nr="\\u0300-\\u036f",n0="\\ufe20-\\ufe2f",Ui="\\u20d0-\\u20ff",qn=nr+n0+Ui,Ro="\\u2700-\\u27bf",zh="a-z\\xdf-\\xf6\\xf8-\\xff",Rw="\\xac\\xb1\\xd7\\xf7",Pw="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kw="\\u2000-\\u206f",zw=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qh="A-Z\\xc0-\\xd6\\xd8-\\xde",Uh="\\ufe0e\\ufe0f",Wh=Rw+Pw+kw+zw,i0="['’]",qw="["+Qe+"]",Hh="["+Wh+"]",Po="["+qn+"]",jh="\\d+",Uw="["+Ro+"]",Yh="["+zh+"]",Zh="[^"+Qe+Wh+jh+Ro+zh+qh+"]",s0="\\ud83c[\\udffb-\\udfff]",Ww="(?:"+Po+"|"+s0+")",Vh="[^"+Qe+"]",o0="(?:\\ud83c[\\udde6-\\uddff]){2}",a0="[\\ud800-\\udbff][\\udc00-\\udfff]",Wi="["+qh+"]",Gh="\\u200d",Kh="(?:"+Yh+"|"+Zh+")",Hw="(?:"+Wi+"|"+Zh+")",Xh="(?:"+i0+"(?:d|ll|m|re|s|t|ve))?",Qh="(?:"+i0+"(?:D|LL|M|RE|S|T|VE))?",Jh=Ww+"?",ed="["+Uh+"]?",jw="(?:"+Gh+"(?:"+[Vh,o0,a0].join("|")+")"+ed+Jh+")*",Yw="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",td=ed+Jh+jw,Vw="(?:"+[Uw,o0,a0].join("|")+")"+td,Gw="(?:"+[Vh+Po+"?",Po,o0,a0,qw].join("|")+")",Kw=RegExp(i0,"g"),Xw=RegExp(Po,"g"),u0=RegExp(s0+"(?="+s0+")|"+Gw+td,"g"),Qw=RegExp([Wi+"?"+Yh+"+"+Xh+"(?="+[Hh,Wi,"$"].join("|")+")",Hw+"+"+Qh+"(?="+[Hh,Wi+Kh,"$"].join("|")+")",Wi+"?"+Kh+"+"+Xh,Wi+"+"+Qh,Zw,Yw,jh,Vw].join("|"),"g"),Jw=RegExp("["+Gh+Qe+qn+Uh+"]"),e2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,t2=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],r2=-1,Dt={};Dt[_e]=Dt[he]=Dt[de]=Dt[ce]=Dt[Xe]=Dt[et]=Dt[ht]=Dt[kt]=Dt[It]=!0,Dt[pe]=Dt[De]=Dt[ue]=Dt[be]=Dt[se]=Dt[Oe]=Dt[nt]=Dt[Ye]=Dt[Le]=Dt[xt]=Dt[Et]=Dt[fr]=Dt[yt]=Dt[Ot]=Dt[J]=!1;var _t={};_t[pe]=_t[De]=_t[ue]=_t[se]=_t[be]=_t[Oe]=_t[_e]=_t[he]=_t[de]=_t[ce]=_t[Xe]=_t[Le]=_t[xt]=_t[Et]=_t[fr]=_t[yt]=_t[Ot]=_t[P]=_t[et]=_t[ht]=_t[kt]=_t[It]=!0,_t[nt]=_t[Ye]=_t[J]=!1;var n2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},i2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},o2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},a2=parseFloat,u2=parseInt,rd=typeof ye=="object"&&ye&&ye.Object===Object&&ye,l2=typeof self=="object"&&self&&self.Object===Object&&self,Qt=rd||l2||Function("return this")(),l0=e&&!e.nodeType&&e,ci=l0&&!0&&s&&!s.nodeType&&s,nd=ci&&ci.exports===l0,f0=nd&&rd.process,Pr=function(){try{var Z=ci&&ci.require&&ci.require("util").types;return Z||f0&&f0.binding&&f0.binding("util")}catch{}}(),id=Pr&&Pr.isArrayBuffer,sd=Pr&&Pr.isDate,od=Pr&&Pr.isMap,ad=Pr&&Pr.isRegExp,ud=Pr&&Pr.isSet,ld=Pr&&Pr.isTypedArray;function Cr(Z,ne,re){switch(re.length){case 0:return Z.call(ne);case 1:return Z.call(ne,re[0]);case 2:return Z.call(ne,re[0],re[1]);case 3:return Z.call(ne,re[0],re[1],re[2])}return Z.apply(ne,re)}function f2(Z,ne,re,Ee){for(var Re=-1,st=Z==null?0:Z.length;++Re<st;){var Wt=Z[Re];ne(Ee,Wt,re(Wt),Z)}return Ee}function kr(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length;++re<Ee&&ne(Z[re],re,Z)!==!1;);return Z}function c2(Z,ne){for(var re=Z==null?0:Z.length;re--&&ne(Z[re],re,Z)!==!1;);return Z}function fd(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length;++re<Ee;)if(!ne(Z[re],re,Z))return!1;return!0}function Un(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length,Re=0,st=[];++re<Ee;){var Wt=Z[re];ne(Wt,re,Z)&&(st[Re++]=Wt)}return st}function ko(Z,ne){var re=Z==null?0:Z.length;return!!re&&Hi(Z,ne,0)>-1}function c0(Z,ne,re){for(var Ee=-1,Re=Z==null?0:Z.length;++Ee<Re;)if(re(ne,Z[Ee]))return!0;return!1}function At(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length,Re=Array(Ee);++re<Ee;)Re[re]=ne(Z[re],re,Z);return Re}function Wn(Z,ne){for(var re=-1,Ee=ne.length,Re=Z.length;++re<Ee;)Z[Re+re]=ne[re];return Z}function h0(Z,ne,re,Ee){var Re=-1,st=Z==null?0:Z.length;for(Ee&&st&&(re=Z[++Re]);++Re<st;)re=ne(re,Z[Re],Re,Z);return re}function h2(Z,ne,re,Ee){var Re=Z==null?0:Z.length;for(Ee&&Re&&(re=Z[--Re]);Re--;)re=ne(re,Z[Re],Re,Z);return re}function d0(Z,ne){for(var re=-1,Ee=Z==null?0:Z.length;++re<Ee;)if(ne(Z[re],re,Z))return!0;return!1}var d2=p0("length");function p2(Z){return Z.split("")}function _2(Z){return Z.match(Zu)||[]}function cd(Z,ne,re){var Ee;return re(Z,function(Re,st,Wt){if(ne(Re,st,Wt))return Ee=st,!1}),Ee}function zo(Z,ne,re,Ee){for(var Re=Z.length,st=re+(Ee?1:-1);Ee?st--:++st<Re;)if(ne(Z[st],st,Z))return st;return-1}function Hi(Z,ne,re){return ne===ne?F2(Z,ne,re):zo(Z,hd,re)}function v2(Z,ne,re,Ee){for(var Re=re-1,st=Z.length;++Re<st;)if(Ee(Z[Re],ne))return Re;return-1}function hd(Z){return Z!==Z}function dd(Z,ne){var re=Z==null?0:Z.length;return re?v0(Z,ne)/re:te}function p0(Z){return function(ne){return ne==null?t:ne[Z]}}function _0(Z){return function(ne){return Z==null?t:Z[ne]}}function pd(Z,ne,re,Ee,Re){return Re(Z,function(st,Wt,dt){re=Ee?(Ee=!1,st):ne(re,st,Wt,dt)}),re}function g2(Z,ne){var re=Z.length;for(Z.sort(ne);re--;)Z[re]=Z[re].value;return Z}function v0(Z,ne){for(var re,Ee=-1,Re=Z.length;++Ee<Re;){var st=ne(Z[Ee]);st!==t&&(re=re===t?st:re+st)}return re}function g0(Z,ne){for(var re=-1,Ee=Array(Z);++re<Z;)Ee[re]=ne(re);return Ee}function m2(Z,ne){return At(ne,function(re){return[re,Z[re]]})}function _d(Z){return Z&&Z.slice(0,xd(Z)+1).replace(mr,"")}function Fr(Z){return function(ne){return Z(ne)}}function m0(Z,ne){return At(ne,function(re){return Z[re]})}function ws(Z,ne){return Z.has(ne)}function vd(Z,ne){for(var re=-1,Ee=Z.length;++re<Ee&&Hi(ne,Z[re],0)>-1;);return re}function gd(Z,ne){for(var re=Z.length;re--&&Hi(ne,Z[re],0)>-1;);return re}function x2(Z,ne){for(var re=Z.length,Ee=0;re--;)Z[re]===ne&&++Ee;return Ee}var y2=_0(n2),D2=_0(i2);function w2(Z){return"\\"+o2[Z]}function b2(Z,ne){return Z==null?t:Z[ne]}function ji(Z){return Jw.test(Z)}function E2(Z){return e2.test(Z)}function A2(Z){for(var ne,re=[];!(ne=Z.next()).done;)re.push(ne.value);return re}function x0(Z){var ne=-1,re=Array(Z.size);return Z.forEach(function(Ee,Re){re[++ne]=[Re,Ee]}),re}function md(Z,ne){return function(re){return Z(ne(re))}}function Hn(Z,ne){for(var re=-1,Ee=Z.length,Re=0,st=[];++re<Ee;){var Wt=Z[re];(Wt===ne||Wt===h)&&(Z[re]=h,st[Re++]=re)}return st}function qo(Z){var ne=-1,re=Array(Z.size);return Z.forEach(function(Ee){re[++ne]=Ee}),re}function C2(Z){var ne=-1,re=Array(Z.size);return Z.forEach(function(Ee){re[++ne]=[Ee,Ee]}),re}function F2(Z,ne,re){for(var Ee=re-1,Re=Z.length;++Ee<Re;)if(Z[Ee]===ne)return Ee;return-1}function B2(Z,ne,re){for(var Ee=re+1;Ee--;)if(Z[Ee]===ne)return Ee;return Ee}function Yi(Z){return ji(Z)?N2(Z):d2(Z)}function tn(Z){return ji(Z)?S2(Z):p2(Z)}function xd(Z){for(var ne=Z.length;ne--&&zi.test(Z.charAt(ne)););return ne}var M2=_0(s2);function N2(Z){for(var ne=u0.lastIndex=0;u0.test(Z);)++ne;return ne}function S2(Z){return Z.match(u0)||[]}function O2(Z){return Z.match(Qw)||[]}var I2=function Z(ne){ne=ne==null?Qt:Zi.defaults(Qt.Object(),ne,Zi.pick(Qt,t2));var re=ne.Array,Ee=ne.Date,Re=ne.Error,st=ne.Function,Wt=ne.Math,dt=ne.Object,y0=ne.RegExp,T2=ne.String,zr=ne.TypeError,Uo=re.prototype,$2=st.prototype,Vi=dt.prototype,Wo=ne["__core-js_shared__"],Ho=$2.toString,lt=Vi.hasOwnProperty,L2=0,yd=function(){var o=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),jo=Vi.toString,R2=Ho.call(dt),P2=Qt._,k2=y0("^"+Ho.call(lt).replace(zn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yo=nd?ne.Buffer:t,jn=ne.Symbol,Zo=ne.Uint8Array,Dd=Yo?Yo.allocUnsafe:t,Vo=md(dt.getPrototypeOf,dt),wd=dt.create,bd=Vi.propertyIsEnumerable,Go=Uo.splice,Ed=jn?jn.isConcatSpreadable:t,bs=jn?jn.iterator:t,hi=jn?jn.toStringTag:t,Ko=function(){try{var o=gi(dt,"defineProperty");return o({},"",{}),o}catch{}}(),z2=ne.clearTimeout!==Qt.clearTimeout&&ne.clearTimeout,q2=Ee&&Ee.now!==Qt.Date.now&&Ee.now,U2=ne.setTimeout!==Qt.setTimeout&&ne.setTimeout,Xo=Wt.ceil,Qo=Wt.floor,D0=dt.getOwnPropertySymbols,W2=Yo?Yo.isBuffer:t,Ad=ne.isFinite,H2=Uo.join,j2=md(dt.keys,dt),Ht=Wt.max,ir=Wt.min,Y2=Ee.now,Z2=ne.parseInt,Cd=Wt.random,V2=Uo.reverse,w0=gi(ne,"DataView"),Es=gi(ne,"Map"),b0=gi(ne,"Promise"),Gi=gi(ne,"Set"),As=gi(ne,"WeakMap"),Cs=gi(dt,"create"),Jo=As&&new As,Ki={},G2=mi(w0),K2=mi(Es),X2=mi(b0),Q2=mi(Gi),J2=mi(As),ea=jn?jn.prototype:t,Fs=ea?ea.valueOf:t,Fd=ea?ea.toString:t;function T(o){if(Nt(o)&&!Pe(o)&&!(o instanceof Ze)){if(o instanceof qr)return o;if(lt.call(o,"__wrapped__"))return Bp(o)}return new qr(o)}var Xi=function(){function o(){}return function(l){if(!Bt(l))return{};if(wd)return wd(l);o.prototype=l;var g=new o;return o.prototype=t,g}}();function ta(){}function qr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}T.templateSettings={escape:ms,evaluate:Ri,interpolate:Pi,variable:"",imports:{_:T}},T.prototype=ta.prototype,T.prototype.constructor=T,qr.prototype=Xi(ta.prototype),qr.prototype.constructor=qr;function Ze(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function eb(){var o=new Ze(this.__wrapped__);return o.__actions__=xr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=xr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=xr(this.__views__),o}function tb(){if(this.__filtered__){var o=new Ze(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function rb(){var o=this.__wrapped__.value(),l=this.__dir__,g=Pe(o),E=l<0,S=g?o.length:0,$=pE(0,S,this.__views__),q=$.start,W=$.end,K=W-q,oe=E?W:q-1,ae=this.__iteratees__,fe=ae.length,ge=0,Ae=ir(K,this.__takeCount__);if(!g||!E&&S==K&&Ae==K)return Xd(o,this.__actions__);var Ne=[];e:for(;K--&&ge<Ae;){oe+=l;for(var qe=-1,Se=o[oe];++qe<fe;){var He=ae[qe],Ke=He.iteratee,Nr=He.type,pr=Ke(Se);if(Nr==z)Se=pr;else if(!pr){if(Nr==k)continue e;break e}}Ne[ge++]=Se}return Ne}Ze.prototype=Xi(ta.prototype),Ze.prototype.constructor=Ze;function di(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l<g;){var E=o[l];this.set(E[0],E[1])}}function nb(){this.__data__=Cs?Cs(null):{},this.size=0}function ib(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function sb(o){var l=this.__data__;if(Cs){var g=l[o];return g===c?t:g}return lt.call(l,o)?l[o]:t}function ob(o){var l=this.__data__;return Cs?l[o]!==t:lt.call(l,o)}function ab(o,l){var g=this.__data__;return this.size+=this.has(o)?0:1,g[o]=Cs&&l===t?c:l,this}di.prototype.clear=nb,di.prototype.delete=ib,di.prototype.get=sb,di.prototype.has=ob,di.prototype.set=ab;function wn(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l<g;){var E=o[l];this.set(E[0],E[1])}}function ub(){this.__data__=[],this.size=0}function lb(o){var l=this.__data__,g=ra(l,o);if(g<0)return!1;var E=l.length-1;return g==E?l.pop():Go.call(l,g,1),--this.size,!0}function fb(o){var l=this.__data__,g=ra(l,o);return g<0?t:l[g][1]}function cb(o){return ra(this.__data__,o)>-1}function hb(o,l){var g=this.__data__,E=ra(g,o);return E<0?(++this.size,g.push([o,l])):g[E][1]=l,this}wn.prototype.clear=ub,wn.prototype.delete=lb,wn.prototype.get=fb,wn.prototype.has=cb,wn.prototype.set=hb;function bn(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l<g;){var E=o[l];this.set(E[0],E[1])}}function db(){this.size=0,this.__data__={hash:new di,map:new(Es||wn),string:new di}}function pb(o){var l=pa(this,o).delete(o);return this.size-=l?1:0,l}function _b(o){return pa(this,o).get(o)}function vb(o){return pa(this,o).has(o)}function gb(o,l){var g=pa(this,o),E=g.size;return g.set(o,l),this.size+=g.size==E?0:1,this}bn.prototype.clear=db,bn.prototype.delete=pb,bn.prototype.get=_b,bn.prototype.has=vb,bn.prototype.set=gb;function pi(o){var l=-1,g=o==null?0:o.length;for(this.__data__=new bn;++l<g;)this.add(o[l])}function mb(o){return this.__data__.set(o,c),this}function xb(o){return this.__data__.has(o)}pi.prototype.add=pi.prototype.push=mb,pi.prototype.has=xb;function rn(o){var l=this.__data__=new wn(o);this.size=l.size}function yb(){this.__data__=new wn,this.size=0}function Db(o){var l=this.__data__,g=l.delete(o);return this.size=l.size,g}function wb(o){return this.__data__.get(o)}function bb(o){return this.__data__.has(o)}function Eb(o,l){var g=this.__data__;if(g instanceof wn){var E=g.__data__;if(!Es||E.length<n-1)return E.push([o,l]),this.size=++g.size,this;g=this.__data__=new bn(E)}return g.set(o,l),this.size=g.size,this}rn.prototype.clear=yb,rn.prototype.delete=Db,rn.prototype.get=wb,rn.prototype.has=bb,rn.prototype.set=Eb;function Bd(o,l){var g=Pe(o),E=!g&&xi(o),S=!g&&!E&&Kn(o),$=!g&&!E&&!S&&ts(o),q=g||E||S||$,W=q?g0(o.length,T2):[],K=W.length;for(var oe in o)(l||lt.call(o,oe))&&!(q&&(oe=="length"||S&&(oe=="offset"||oe=="parent")||$&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||Fn(oe,K)))&&W.push(oe);return W}function Md(o){var l=o.length;return l?o[T0(0,l-1)]:t}function Ab(o,l){return _a(xr(o),_i(l,0,o.length))}function Cb(o){return _a(xr(o))}function E0(o,l,g){(g!==t&&!nn(o[l],g)||g===t&&!(l in o))&&En(o,l,g)}function Bs(o,l,g){var E=o[l];(!(lt.call(o,l)&&nn(E,g))||g===t&&!(l in o))&&En(o,l,g)}function ra(o,l){for(var g=o.length;g--;)if(nn(o[g][0],l))return g;return-1}function Fb(o,l,g,E){return Yn(o,function(S,$,q){l(E,S,g(S),q)}),E}function Nd(o,l){return o&&hn(l,Yt(l),o)}function Bb(o,l){return o&&hn(l,Dr(l),o)}function En(o,l,g){l=="__proto__"&&Ko?Ko(o,l,{configurable:!0,enumerable:!0,value:g,writable:!0}):o[l]=g}function A0(o,l){for(var g=-1,E=l.length,S=re(E),$=o==null;++g<E;)S[g]=$?t:sl(o,l[g]);return S}function _i(o,l,g){return o===o&&(g!==t&&(o=o<=g?o:g),l!==t&&(o=o>=l?o:l)),o}function Ur(o,l,g,E,S,$){var q,W=l&d,K=l&p,oe=l&v;if(g&&(q=S?g(o,E,S,$):g(o)),q!==t)return q;if(!Bt(o))return o;var ae=Pe(o);if(ae){if(q=vE(o),!W)return xr(o,q)}else{var fe=sr(o),ge=fe==Ye||fe==Ie;if(Kn(o))return ep(o,W);if(fe==Et||fe==pe||ge&&!S){if(q=K||ge?{}:xp(o),!W)return K?sE(o,Bb(q,o)):iE(o,Nd(q,o))}else{if(!_t[fe])return S?o:{};q=gE(o,fe,W)}}$||($=new rn);var Ae=$.get(o);if(Ae)return Ae;$.set(o,q),Vp(o)?o.forEach(function(Se){q.add(Ur(Se,l,g,Se,o,$))}):Yp(o)&&o.forEach(function(Se,He){q.set(He,Ur(Se,l,g,He,o,$))});var Ne=oe?K?j0:H0:K?Dr:Yt,qe=ae?t:Ne(o);return kr(qe||o,function(Se,He){qe&&(He=Se,Se=o[He]),Bs(q,He,Ur(Se,l,g,He,o,$))}),q}function Mb(o){var l=Yt(o);return function(g){return Sd(g,o,l)}}function Sd(o,l,g){var E=g.length;if(o==null)return!E;for(o=dt(o);E--;){var S=g[E],$=l[S],q=o[S];if(q===t&&!(S in o)||!$(q))return!1}return!0}function Od(o,l,g){if(typeof o!="function")throw new zr(a);return $s(function(){o.apply(t,g)},l)}function Ms(o,l,g,E){var S=-1,$=ko,q=!0,W=o.length,K=[],oe=l.length;if(!W)return K;g&&(l=At(l,Fr(g))),E?($=c0,q=!1):l.length>=n&&($=ws,q=!1,l=new pi(l));e:for(;++S<W;){var ae=o[S],fe=g==null?ae:g(ae);if(ae=E||ae!==0?ae:0,q&&fe===fe){for(var ge=oe;ge--;)if(l[ge]===fe)continue e;K.push(ae)}else $(l,fe,E)||K.push(ae)}return K}var Yn=sp(cn),Id=sp(F0,!0);function Nb(o,l){var g=!0;return Yn(o,function(E,S,$){return g=!!l(E,S,$),g}),g}function na(o,l,g){for(var E=-1,S=o.length;++E<S;){var $=o[E],q=l($);if(q!=null&&(W===t?q===q&&!Mr(q):g(q,W)))var W=q,K=$}return K}function Sb(o,l,g,E){var S=o.length;for(g=ze(g),g<0&&(g=-g>S?0:S+g),E=E===t||E>S?S:ze(E),E<0&&(E+=S),E=g>E?0:Kp(E);g<E;)o[g++]=l;return o}function Td(o,l){var g=[];return Yn(o,function(E,S,$){l(E,S,$)&&g.push(E)}),g}function Jt(o,l,g,E,S){var $=-1,q=o.length;for(g||(g=xE),S||(S=[]);++$<q;){var W=o[$];l>0&&g(W)?l>1?Jt(W,l-1,g,E,S):Wn(S,W):E||(S[S.length]=W)}return S}var C0=op(),$d=op(!0);function cn(o,l){return o&&C0(o,l,Yt)}function F0(o,l){return o&&$d(o,l,Yt)}function ia(o,l){return Un(l,function(g){return Bn(o[g])})}function vi(o,l){l=Vn(l,o);for(var g=0,E=l.length;o!=null&&g<E;)o=o[dn(l[g++])];return g&&g==E?o:t}function Ld(o,l,g){var E=l(o);return Pe(o)?E:Wn(E,g(o))}function hr(o){return o==null?o===t?V:Ut:hi&&hi in dt(o)?dE(o):CE(o)}function B0(o,l){return o>l}function Ob(o,l){return o!=null&&lt.call(o,l)}function Ib(o,l){return o!=null&&l in dt(o)}function Tb(o,l,g){return o>=ir(l,g)&&o<Ht(l,g)}function M0(o,l,g){for(var E=g?c0:ko,S=o[0].length,$=o.length,q=$,W=re($),K=1/0,oe=[];q--;){var ae=o[q];q&&l&&(ae=At(ae,Fr(l))),K=ir(ae.length,K),W[q]=!g&&(l||S>=120&&ae.length>=120)?new pi(q&&ae):t}ae=o[0];var fe=-1,ge=W[0];e:for(;++fe<S&&oe.length<K;){var Ae=ae[fe],Ne=l?l(Ae):Ae;if(Ae=g||Ae!==0?Ae:0,!(ge?ws(ge,Ne):E(oe,Ne,g))){for(q=$;--q;){var qe=W[q];if(!(qe?ws(qe,Ne):E(o[q],Ne,g)))continue e}ge&&ge.push(Ne),oe.push(Ae)}}return oe}function $b(o,l,g,E){return cn(o,function(S,$,q){l(E,g(S),$,q)}),E}function Ns(o,l,g){l=Vn(l,o),o=bp(o,l);var E=o==null?o:o[dn(Hr(l))];return E==null?t:Cr(E,o,g)}function Rd(o){return Nt(o)&&hr(o)==pe}function Lb(o){return Nt(o)&&hr(o)==ue}function Rb(o){return Nt(o)&&hr(o)==Oe}function Ss(o,l,g,E,S){return o===l?!0:o==null||l==null||!Nt(o)&&!Nt(l)?o!==o&&l!==l:Pb(o,l,g,E,Ss,S)}function Pb(o,l,g,E,S,$){var q=Pe(o),W=Pe(l),K=q?De:sr(o),oe=W?De:sr(l);K=K==pe?Et:K,oe=oe==pe?Et:oe;var ae=K==Et,fe=oe==Et,ge=K==oe;if(ge&&Kn(o)){if(!Kn(l))return!1;q=!0,ae=!1}if(ge&&!ae)return $||($=new rn),q||ts(o)?vp(o,l,g,E,S,$):cE(o,l,K,g,E,S,$);if(!(g&x)){var Ae=ae&&lt.call(o,"__wrapped__"),Ne=fe&&lt.call(l,"__wrapped__");if(Ae||Ne){var qe=Ae?o.value():o,Se=Ne?l.value():l;return $||($=new rn),S(qe,Se,g,E,$)}}return ge?($||($=new rn),hE(o,l,g,E,S,$)):!1}function kb(o){return Nt(o)&&sr(o)==Le}function N0(o,l,g,E){var S=g.length,$=S,q=!E;if(o==null)return!$;for(o=dt(o);S--;){var W=g[S];if(q&&W[2]?W[1]!==o[W[0]]:!(W[0]in o))return!1}for(;++S<$;){W=g[S];var K=W[0],oe=o[K],ae=W[1];if(q&&W[2]){if(oe===t&&!(K in o))return!1}else{var fe=new rn;if(E)var ge=E(oe,ae,K,o,l,fe);if(!(ge===t?Ss(ae,oe,x|_,E,fe):ge))return!1}}return!0}function Pd(o){if(!Bt(o)||DE(o))return!1;var l=Bn(o)?k2:Ju;return l.test(mi(o))}function zb(o){return Nt(o)&&hr(o)==fr}function qb(o){return Nt(o)&&sr(o)==yt}function Ub(o){return Nt(o)&&Da(o.length)&&!!Dt[hr(o)]}function kd(o){return typeof o=="function"?o:o==null?wr:typeof o=="object"?Pe(o)?Ud(o[0],o[1]):qd(o):a1(o)}function S0(o){if(!Ts(o))return j2(o);var l=[];for(var g in dt(o))lt.call(o,g)&&g!="constructor"&&l.push(g);return l}function Wb(o){if(!Bt(o))return AE(o);var l=Ts(o),g=[];for(var E in o)E=="constructor"&&(l||!lt.call(o,E))||g.push(E);return g}function O0(o,l){return o<l}function zd(o,l){var g=-1,E=yr(o)?re(o.length):[];return Yn(o,function(S,$,q){E[++g]=l(S,$,q)}),E}function qd(o){var l=Z0(o);return l.length==1&&l[0][2]?Dp(l[0][0],l[0][1]):function(g){return g===o||N0(g,o,l)}}function Ud(o,l){return G0(o)&&yp(l)?Dp(dn(o),l):function(g){var E=sl(g,o);return E===t&&E===l?ol(g,o):Ss(l,E,x|_)}}function sa(o,l,g,E,S){o!==l&&C0(l,function($,q){if(S||(S=new rn),Bt($))Hb(o,l,q,g,sa,E,S);else{var W=E?E(X0(o,q),$,q+"",o,l,S):t;W===t&&(W=$),E0(o,q,W)}},Dr)}function Hb(o,l,g,E,S,$,q){var W=X0(o,g),K=X0(l,g),oe=q.get(K);if(oe){E0(o,g,oe);return}var ae=$?$(W,K,g+"",o,l,q):t,fe=ae===t;if(fe){var ge=Pe(K),Ae=!ge&&Kn(K),Ne=!ge&&!Ae&&ts(K);ae=K,ge||Ae||Ne?Pe(W)?ae=W:Tt(W)?ae=xr(W):Ae?(fe=!1,ae=ep(K,!0)):Ne?(fe=!1,ae=tp(K,!0)):ae=[]:Ls(K)||xi(K)?(ae=W,xi(W)?ae=Xp(W):(!Bt(W)||Bn(W))&&(ae=xp(K))):fe=!1}fe&&(q.set(K,ae),S(ae,K,E,$,q),q.delete(K)),E0(o,g,ae)}function Wd(o,l){var g=o.length;if(g)return l+=l<0?g:0,Fn(l,g)?o[l]:t}function Hd(o,l,g){l.length?l=At(l,function($){return Pe($)?function(q){return vi(q,$.length===1?$[0]:$)}:$}):l=[wr];var E=-1;l=At(l,Fr(Me()));var S=zd(o,function($,q,W){var K=At(l,function(oe){return oe($)});return{criteria:K,index:++E,value:$}});return g2(S,function($,q){return nE($,q,g)})}function jb(o,l){return jd(o,l,function(g,E){return ol(o,E)})}function jd(o,l,g){for(var E=-1,S=l.length,$={};++E<S;){var q=l[E],W=vi(o,q);g(W,q)&&Os($,Vn(q,o),W)}return $}function Yb(o){return function(l){return vi(l,o)}}function I0(o,l,g,E){var S=E?v2:Hi,$=-1,q=l.length,W=o;for(o===l&&(l=xr(l)),g&&(W=At(o,Fr(g)));++$<q;)for(var K=0,oe=l[$],ae=g?g(oe):oe;(K=S(W,ae,K,E))>-1;)W!==o&&Go.call(W,K,1),Go.call(o,K,1);return o}function Yd(o,l){for(var g=o?l.length:0,E=g-1;g--;){var S=l[g];if(g==E||S!==$){var $=S;Fn(S)?Go.call(o,S,1):R0(o,S)}}return o}function T0(o,l){return o+Qo(Cd()*(l-o+1))}function Zb(o,l,g,E){for(var S=-1,$=Ht(Xo((l-o)/(g||1)),0),q=re($);$--;)q[E?$:++S]=o,o+=g;return q}function $0(o,l){var g="";if(!o||l<1||l>H)return g;do l%2&&(g+=o),l=Qo(l/2),l&&(o+=o);while(l);return g}function Ue(o,l){return Q0(wp(o,l,wr),o+"")}function Vb(o){return Md(rs(o))}function Gb(o,l){var g=rs(o);return _a(g,_i(l,0,g.length))}function Os(o,l,g,E){if(!Bt(o))return o;l=Vn(l,o);for(var S=-1,$=l.length,q=$-1,W=o;W!=null&&++S<$;){var K=dn(l[S]),oe=g;if(K==="__proto__"||K==="constructor"||K==="prototype")return o;if(S!=q){var ae=W[K];oe=E?E(ae,K,W):t,oe===t&&(oe=Bt(ae)?ae:Fn(l[S+1])?[]:{})}Bs(W,K,oe),W=W[K]}return o}var Zd=Jo?function(o,l){return Jo.set(o,l),o}:wr,Kb=Ko?function(o,l){return Ko(o,"toString",{configurable:!0,enumerable:!1,value:ul(l),writable:!0})}:wr;function Xb(o){return _a(rs(o))}function Wr(o,l,g){var E=-1,S=o.length;l<0&&(l=-l>S?0:S+l),g=g>S?S:g,g<0&&(g+=S),S=l>g?0:g-l>>>0,l>>>=0;for(var $=re(S);++E<S;)$[E]=o[E+l];return $}function Qb(o,l){var g;return Yn(o,function(E,S,$){return g=l(E,S,$),!g}),!!g}function oa(o,l,g){var E=0,S=o==null?E:o.length;if(typeof l=="number"&&l===l&&S<=Y){for(;E<S;){var $=E+S>>>1,q=o[$];q!==null&&!Mr(q)&&(g?q<=l:q<l)?E=$+1:S=$}return S}return L0(o,l,wr,g)}function L0(o,l,g,E){var S=0,$=o==null?0:o.length;if($===0)return 0;l=g(l);for(var q=l!==l,W=l===null,K=Mr(l),oe=l===t;S<$;){var ae=Qo((S+$)/2),fe=g(o[ae]),ge=fe!==t,Ae=fe===null,Ne=fe===fe,qe=Mr(fe);if(q)var Se=E||Ne;else oe?Se=Ne&&(E||ge):W?Se=Ne&&ge&&(E||!Ae):K?Se=Ne&&ge&&!Ae&&(E||!qe):Ae||qe?Se=!1:Se=E?fe<=l:fe<l;Se?S=ae+1:$=ae}return ir($,X)}function Vd(o,l){for(var g=-1,E=o.length,S=0,$=[];++g<E;){var q=o[g],W=l?l(q):q;if(!g||!nn(W,K)){var K=W;$[S++]=q===0?0:q}}return $}function Gd(o){return typeof o=="number"?o:Mr(o)?te:+o}function Br(o){if(typeof o=="string")return o;if(Pe(o))return At(o,Br)+"";if(Mr(o))return Fd?Fd.call(o):"";var l=o+"";return l=="0"&&1/o==-G?"-0":l}function Zn(o,l,g){var E=-1,S=ko,$=o.length,q=!0,W=[],K=W;if(g)q=!1,S=c0;else if($>=n){var oe=l?null:lE(o);if(oe)return qo(oe);q=!1,S=ws,K=new pi}else K=l?[]:W;e:for(;++E<$;){var ae=o[E],fe=l?l(ae):ae;if(ae=g||ae!==0?ae:0,q&&fe===fe){for(var ge=K.length;ge--;)if(K[ge]===fe)continue e;l&&K.push(fe),W.push(ae)}else S(K,fe,g)||(K!==W&&K.push(fe),W.push(ae))}return W}function R0(o,l){return l=Vn(l,o),o=bp(o,l),o==null||delete o[dn(Hr(l))]}function Kd(o,l,g,E){return Os(o,l,g(vi(o,l)),E)}function aa(o,l,g,E){for(var S=o.length,$=E?S:-1;(E?$--:++$<S)&&l(o[$],$,o););return g?Wr(o,E?0:$,E?$+1:S):Wr(o,E?$+1:0,E?S:$)}function Xd(o,l){var g=o;return g instanceof Ze&&(g=g.value()),h0(l,function(E,S){return S.func.apply(S.thisArg,Wn([E],S.args))},g)}function P0(o,l,g){var E=o.length;if(E<2)return E?Zn(o[0]):[];for(var S=-1,$=re(E);++S<E;)for(var q=o[S],W=-1;++W<E;)W!=S&&($[S]=Ms($[S]||q,o[W],l,g));return Zn(Jt($,1),l,g)}function Qd(o,l,g){for(var E=-1,S=o.length,$=l.length,q={};++E<S;){var W=E<$?l[E]:t;g(q,o[E],W)}return q}function k0(o){return Tt(o)?o:[]}function z0(o){return typeof o=="function"?o:wr}function Vn(o,l){return Pe(o)?o:G0(o,l)?[o]:Fp(at(o))}var Jb=Ue;function Gn(o,l,g){var E=o.length;return g=g===t?E:g,!l&&g>=E?o:Wr(o,l,g)}var Jd=z2||function(o){return Qt.clearTimeout(o)};function ep(o,l){if(l)return o.slice();var g=o.length,E=Dd?Dd(g):new o.constructor(g);return o.copy(E),E}function q0(o){var l=new o.constructor(o.byteLength);return new Zo(l).set(new Zo(o)),l}function eE(o,l){var g=l?q0(o.buffer):o.buffer;return new o.constructor(g,o.byteOffset,o.byteLength)}function tE(o){var l=new o.constructor(o.source,Lo.exec(o));return l.lastIndex=o.lastIndex,l}function rE(o){return Fs?dt(Fs.call(o)):{}}function tp(o,l){var g=l?q0(o.buffer):o.buffer;return new o.constructor(g,o.byteOffset,o.length)}function rp(o,l){if(o!==l){var g=o!==t,E=o===null,S=o===o,$=Mr(o),q=l!==t,W=l===null,K=l===l,oe=Mr(l);if(!W&&!oe&&!$&&o>l||$&&q&&K&&!W&&!oe||E&&q&&K||!g&&K||!S)return 1;if(!E&&!$&&!oe&&o<l||oe&&g&&S&&!E&&!$||W&&g&&S||!q&&S||!K)return-1}return 0}function nE(o,l,g){for(var E=-1,S=o.criteria,$=l.criteria,q=S.length,W=g.length;++E<q;){var K=rp(S[E],$[E]);if(K){if(E>=W)return K;var oe=g[E];return K*(oe=="desc"?-1:1)}}return o.index-l.index}function np(o,l,g,E){for(var S=-1,$=o.length,q=g.length,W=-1,K=l.length,oe=Ht($-q,0),ae=re(K+oe),fe=!E;++W<K;)ae[W]=l[W];for(;++S<q;)(fe||S<$)&&(ae[g[S]]=o[S]);for(;oe--;)ae[W++]=o[S++];return ae}function ip(o,l,g,E){for(var S=-1,$=o.length,q=-1,W=g.length,K=-1,oe=l.length,ae=Ht($-W,0),fe=re(ae+oe),ge=!E;++S<ae;)fe[S]=o[S];for(var Ae=S;++K<oe;)fe[Ae+K]=l[K];for(;++q<W;)(ge||S<$)&&(fe[Ae+g[q]]=o[S++]);return fe}function xr(o,l){var g=-1,E=o.length;for(l||(l=re(E));++g<E;)l[g]=o[g];return l}function hn(o,l,g,E){var S=!g;g||(g={});for(var $=-1,q=l.length;++$<q;){var W=l[$],K=E?E(g[W],o[W],W,g,o):t;K===t&&(K=o[W]),S?En(g,W,K):Bs(g,W,K)}return g}function iE(o,l){return hn(o,V0(o),l)}function sE(o,l){return hn(o,gp(o),l)}function ua(o,l){return function(g,E){var S=Pe(g)?f2:Fb,$=l?l():{};return S(g,o,Me(E,2),$)}}function Qi(o){return Ue(function(l,g){var E=-1,S=g.length,$=S>1?g[S-1]:t,q=S>2?g[2]:t;for($=o.length>3&&typeof $=="function"?(S--,$):t,q&&dr(g[0],g[1],q)&&($=S<3?t:$,S=1),l=dt(l);++E<S;){var W=g[E];W&&o(l,W,E,$)}return l})}function sp(o,l){return function(g,E){if(g==null)return g;if(!yr(g))return o(g,E);for(var S=g.length,$=l?S:-1,q=dt(g);(l?$--:++$<S)&&E(q[$],$,q)!==!1;);return g}}function op(o){return function(l,g,E){for(var S=-1,$=dt(l),q=E(l),W=q.length;W--;){var K=q[o?W:++S];if(g($[K],K,$)===!1)break}return l}}function oE(o,l,g){var E=l&y,S=Is(o);function $(){var q=this&&this!==Qt&&this instanceof $?S:o;return q.apply(E?g:this,arguments)}return $}function ap(o){return function(l){l=at(l);var g=ji(l)?tn(l):t,E=g?g[0]:l.charAt(0),S=g?Gn(g,1).join(""):l.slice(1);return E[o]()+S}}function Ji(o){return function(l){return h0(s1(i1(l).replace(Kw,"")),o,"")}}function Is(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var g=Xi(o.prototype),E=o.apply(g,l);return Bt(E)?E:g}}function aE(o,l,g){var E=Is(o);function S(){for(var $=arguments.length,q=re($),W=$,K=es(S);W--;)q[W]=arguments[W];var oe=$<3&&q[0]!==K&&q[$-1]!==K?[]:Hn(q,K);if($-=oe.length,$<g)return hp(o,l,la,S.placeholder,t,q,oe,t,t,g-$);var ae=this&&this!==Qt&&this instanceof S?E:o;return Cr(ae,this,q)}return S}function up(o){return function(l,g,E){var S=dt(l);if(!yr(l)){var $=Me(g,3);l=Yt(l),g=function(W){return $(S[W],W,S)}}var q=o(l,g,E);return q>-1?S[$?l[q]:q]:t}}function lp(o){return Cn(function(l){var g=l.length,E=g,S=qr.prototype.thru;for(o&&l.reverse();E--;){var $=l[E];if(typeof $!="function")throw new zr(a);if(S&&!q&&da($)=="wrapper")var q=new qr([],!0)}for(E=q?E:g;++E<g;){$=l[E];var W=da($),K=W=="wrapper"?Y0($):t;K&&K0(K[0])&&K[1]==(B|D|b|M)&&!K[4].length&&K[9]==1?q=q[da(K[0])].apply(q,K[3]):q=$.length==1&&K0($)?q[W]():q.thru($)}return function(){var oe=arguments,ae=oe[0];if(q&&oe.length==1&&Pe(ae))return q.plant(ae).value();for(var fe=0,ge=g?l[fe].apply(this,oe):ae;++fe<g;)ge=l[fe].call(this,ge);return ge}})}function la(o,l,g,E,S,$,q,W,K,oe){var ae=l&B,fe=l&y,ge=l&m,Ae=l&(D|C),Ne=l&O,qe=ge?t:Is(o);function Se(){for(var He=arguments.length,Ke=re(He),Nr=He;Nr--;)Ke[Nr]=arguments[Nr];if(Ae)var pr=es(Se),Sr=x2(Ke,pr);if(E&&(Ke=np(Ke,E,S,Ae)),$&&(Ke=ip(Ke,$,q,Ae)),He-=Sr,Ae&&He<oe){var $t=Hn(Ke,pr);return hp(o,l,la,Se.placeholder,g,Ke,$t,W,K,oe-He)}var sn=fe?g:this,Nn=ge?sn[o]:o;return He=Ke.length,W?Ke=FE(Ke,W):Ne&&He>1&&Ke.reverse(),ae&&K<He&&(Ke.length=K),this&&this!==Qt&&this instanceof Se&&(Nn=qe||Is(Nn)),Nn.apply(sn,Ke)}return Se}function fp(o,l){return function(g,E){return $b(g,o,l(E),{})}}function fa(o,l){return function(g,E){var S;if(g===t&&E===t)return l;if(g!==t&&(S=g),E!==t){if(S===t)return E;typeof g=="string"||typeof E=="string"?(g=Br(g),E=Br(E)):(g=Gd(g),E=Gd(E)),S=o(g,E)}return S}}function U0(o){return Cn(function(l){return l=At(l,Fr(Me())),Ue(function(g){var E=this;return o(l,function(S){return Cr(S,E,g)})})})}function ca(o,l){l=l===t?" ":Br(l);var g=l.length;if(g<2)return g?$0(l,o):l;var E=$0(l,Xo(o/Yi(l)));return ji(l)?Gn(tn(E),0,o).join(""):E.slice(0,o)}function uE(o,l,g,E){var S=l&y,$=Is(o);function q(){for(var W=-1,K=arguments.length,oe=-1,ae=E.length,fe=re(ae+K),ge=this&&this!==Qt&&this instanceof q?$:o;++oe<ae;)fe[oe]=E[oe];for(;K--;)fe[oe++]=arguments[++W];return Cr(ge,S?g:this,fe)}return q}function cp(o){return function(l,g,E){return E&&typeof E!="number"&&dr(l,g,E)&&(g=E=t),l=Mn(l),g===t?(g=l,l=0):g=Mn(g),E=E===t?l<g?1:-1:Mn(E),Zb(l,g,E,o)}}function ha(o){return function(l,g){return typeof l=="string"&&typeof g=="string"||(l=jr(l),g=jr(g)),o(l,g)}}function hp(o,l,g,E,S,$,q,W,K,oe){var ae=l&D,fe=ae?q:t,ge=ae?t:q,Ae=ae?$:t,Ne=ae?t:$;l|=ae?b:F,l&=~(ae?F:b),l&w||(l&=~(y|m));var qe=[o,l,S,Ae,fe,Ne,ge,W,K,oe],Se=g.apply(t,qe);return K0(o)&&Ep(Se,qe),Se.placeholder=E,Ap(Se,o,l)}function W0(o){var l=Wt[o];return function(g,E){if(g=jr(g),E=E==null?0:ir(ze(E),292),E&&Ad(g)){var S=(at(g)+"e").split("e"),$=l(S[0]+"e"+(+S[1]+E));return S=(at($)+"e").split("e"),+(S[0]+"e"+(+S[1]-E))}return l(g)}}var lE=Gi&&1/qo(new Gi([,-0]))[1]==G?function(o){return new Gi(o)}:cl;function dp(o){return function(l){var g=sr(l);return g==Le?x0(l):g==yt?C2(l):m2(l,o(l))}}function An(o,l,g,E,S,$,q,W){var K=l&m;if(!K&&typeof o!="function")throw new zr(a);var oe=E?E.length:0;if(oe||(l&=~(b|F),E=S=t),q=q===t?q:Ht(ze(q),0),W=W===t?W:ze(W),oe-=S?S.length:0,l&F){var ae=E,fe=S;E=S=t}var ge=K?t:Y0(o),Ae=[o,l,g,E,S,ae,fe,$,q,W];if(ge&&EE(Ae,ge),o=Ae[0],l=Ae[1],g=Ae[2],E=Ae[3],S=Ae[4],W=Ae[9]=Ae[9]===t?K?0:o.length:Ht(Ae[9]-oe,0),!W&&l&(D|C)&&(l&=~(D|C)),!l||l==y)var Ne=oE(o,l,g);else l==D||l==C?Ne=aE(o,l,W):(l==b||l==(y|b))&&!S.length?Ne=uE(o,l,g,E):Ne=la.apply(t,Ae);var qe=ge?Zd:Ep;return Ap(qe(Ne,Ae),o,l)}function pp(o,l,g,E){return o===t||nn(o,Vi[g])&&!lt.call(E,g)?l:o}function _p(o,l,g,E,S,$){return Bt(o)&&Bt(l)&&($.set(l,o),sa(o,l,t,_p,$),$.delete(l)),o}function fE(o){return Ls(o)?t:o}function vp(o,l,g,E,S,$){var q=g&x,W=o.length,K=l.length;if(W!=K&&!(q&&K>W))return!1;var oe=$.get(o),ae=$.get(l);if(oe&&ae)return oe==l&&ae==o;var fe=-1,ge=!0,Ae=g&_?new pi:t;for($.set(o,l),$.set(l,o);++fe<W;){var Ne=o[fe],qe=l[fe];if(E)var Se=q?E(qe,Ne,fe,l,o,$):E(Ne,qe,fe,o,l,$);if(Se!==t){if(Se)continue;ge=!1;break}if(Ae){if(!d0(l,function(He,Ke){if(!ws(Ae,Ke)&&(Ne===He||S(Ne,He,g,E,$)))return Ae.push(Ke)})){ge=!1;break}}else if(!(Ne===qe||S(Ne,qe,g,E,$))){ge=!1;break}}return $.delete(o),$.delete(l),ge}function cE(o,l,g,E,S,$,q){switch(g){case se:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case ue:return!(o.byteLength!=l.byteLength||!$(new Zo(o),new Zo(l)));case be:case Oe:case xt:return nn(+o,+l);case nt:return o.name==l.name&&o.message==l.message;case fr:case Ot:return o==l+"";case Le:var W=x0;case yt:var K=E&x;if(W||(W=qo),o.size!=l.size&&!K)return!1;var oe=q.get(o);if(oe)return oe==l;E|=_,q.set(o,l);var ae=vp(W(o),W(l),E,S,$,q);return q.delete(o),ae;case P:if(Fs)return Fs.call(o)==Fs.call(l)}return!1}function hE(o,l,g,E,S,$){var q=g&x,W=H0(o),K=W.length,oe=H0(l),ae=oe.length;if(K!=ae&&!q)return!1;for(var fe=K;fe--;){var ge=W[fe];if(!(q?ge in l:lt.call(l,ge)))return!1}var Ae=$.get(o),Ne=$.get(l);if(Ae&&Ne)return Ae==l&&Ne==o;var qe=!0;$.set(o,l),$.set(l,o);for(var Se=q;++fe<K;){ge=W[fe];var He=o[ge],Ke=l[ge];if(E)var Nr=q?E(Ke,He,ge,l,o,$):E(He,Ke,ge,o,l,$);if(!(Nr===t?He===Ke||S(He,Ke,g,E,$):Nr)){qe=!1;break}Se||(Se=ge=="constructor")}if(qe&&!Se){var pr=o.constructor,Sr=l.constructor;pr!=Sr&&"constructor"in o&&"constructor"in l&&!(typeof pr=="function"&&pr instanceof pr&&typeof Sr=="function"&&Sr instanceof Sr)&&(qe=!1)}return $.delete(o),$.delete(l),qe}function Cn(o){return Q0(wp(o,t,Sp),o+"")}function H0(o){return Ld(o,Yt,V0)}function j0(o){return Ld(o,Dr,gp)}var Y0=Jo?function(o){return Jo.get(o)}:cl;function da(o){for(var l=o.name+"",g=Ki[l],E=lt.call(Ki,l)?g.length:0;E--;){var S=g[E],$=S.func;if($==null||$==o)return S.name}return l}function es(o){var l=lt.call(T,"placeholder")?T:o;return l.placeholder}function Me(){var o=T.iteratee||ll;return o=o===ll?kd:o,arguments.length?o(arguments[0],arguments[1]):o}function pa(o,l){var g=o.__data__;return yE(l)?g[typeof l=="string"?"string":"hash"]:g.map}function Z0(o){for(var l=Yt(o),g=l.length;g--;){var E=l[g],S=o[E];l[g]=[E,S,yp(S)]}return l}function gi(o,l){var g=b2(o,l);return Pd(g)?g:t}function dE(o){var l=lt.call(o,hi),g=o[hi];try{o[hi]=t;var E=!0}catch{}var S=jo.call(o);return E&&(l?o[hi]=g:delete o[hi]),S}var V0=D0?function(o){return o==null?[]:(o=dt(o),Un(D0(o),function(l){return bd.call(o,l)}))}:hl,gp=D0?function(o){for(var l=[];o;)Wn(l,V0(o)),o=Vo(o);return l}:hl,sr=hr;(w0&&sr(new w0(new ArrayBuffer(1)))!=se||Es&&sr(new Es)!=Le||b0&&sr(b0.resolve())!=lr||Gi&&sr(new Gi)!=yt||As&&sr(new As)!=J)&&(sr=function(o){var l=hr(o),g=l==Et?o.constructor:t,E=g?mi(g):"";if(E)switch(E){case G2:return se;case K2:return Le;case X2:return lr;case Q2:return yt;case J2:return J}return l});function pE(o,l,g){for(var E=-1,S=g.length;++E<S;){var $=g[E],q=$.size;switch($.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=ir(l,o+q);break;case"takeRight":o=Ht(o,l-q);break}}return{start:o,end:l}}function _E(o){var l=o.match(ju);return l?l[1].split(Yu):[]}function mp(o,l,g){l=Vn(l,o);for(var E=-1,S=l.length,$=!1;++E<S;){var q=dn(l[E]);if(!($=o!=null&&g(o,q)))break;o=o[q]}return $||++E!=S?$:(S=o==null?0:o.length,!!S&&Da(S)&&Fn(q,S)&&(Pe(o)||xi(o)))}function vE(o){var l=o.length,g=new o.constructor(l);return l&&typeof o[0]=="string"&&lt.call(o,"index")&&(g.index=o.index,g.input=o.input),g}function xp(o){return typeof o.constructor=="function"&&!Ts(o)?Xi(Vo(o)):{}}function gE(o,l,g){var E=o.constructor;switch(l){case ue:return q0(o);case be:case Oe:return new E(+o);case se:return eE(o,g);case _e:case he:case de:case ce:case Xe:case et:case ht:case kt:case It:return tp(o,g);case Le:return new E;case xt:case Ot:return new E(o);case fr:return tE(o);case yt:return new E;case P:return rE(o)}}function mE(o,l){var g=l.length;if(!g)return o;var E=g-1;return l[E]=(g>1?"& ":"")+l[E],l=l.join(g>2?", ":" "),o.replace(Ds,`{
9
9
  /* [wrapped with `+l+`] */
10
- `)}function xE(o){return Pe(o)||xi(o)||!!(Ed&&o&&o[Ed])}function Fn(o,l){var g=typeof o;return l=l??H,!!l&&(g=="number"||g!="symbol"&&t0.test(o))&&o>-1&&o%1==0&&o<l}function dr(o,l,g){if(!Bt(g))return!1;var E=typeof l;return(E=="number"?yr(g)&&Fn(l,g.length):E=="string"&&l in g)?nn(g[l],o):!1}function G0(o,l){if(Pe(o))return!1;var g=typeof o;return g=="number"||g=="symbol"||g=="boolean"||o==null||Mr(o)?!0:ki.test(o)||!xs.test(o)||l!=null&&o in dt(l)}function yE(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function K0(o){var l=da(o),g=T[l];if(typeof g!="function"||!(l in Ze.prototype))return!1;if(o===g)return!0;var E=Y0(g);return!!E&&o===E[0]}function DE(o){return!!yd&&yd in o}var wE=Wo?Bn:dl;function Ts(o){var l=o&&o.constructor,g=typeof l=="function"&&l.prototype||Vi;return o===g}function yp(o){return o===o&&!Bt(o)}function Dp(o,l){return function(g){return g==null?!1:g[o]===l&&(l!==t||o in dt(g))}}function bE(o){var l=xa(o,function(E){return g.size===c&&g.clear(),E}),g=l.cache;return l}function EE(o,l){var g=o[1],E=l[1],S=g|E,$=S<(y|m|B),q=E==B&&g==D||E==B&&g==M&&o[7].length<=l[8]||E==(B|M)&&l[7].length<=l[8]&&g==D;if(!($||q))return o;E&y&&(o[2]=l[2],S|=g&y?0:w);var W=l[3];if(W){var K=o[3];o[3]=K?np(K,W,l[4]):W,o[4]=K?Hn(o[3],h):l[4]}return W=l[5],W&&(K=o[5],o[5]=K?ip(K,W,l[6]):W,o[6]=K?Hn(o[5],h):l[6]),W=l[7],W&&(o[7]=W),E&B&&(o[8]=o[8]==null?l[8]:ir(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=S,o}function AE(o){var l=[];if(o!=null)for(var g in dt(o))l.push(g);return l}function CE(o){return jo.call(o)}function wp(o,l,g){return l=Ht(l===t?o.length-1:l,0),function(){for(var E=arguments,S=-1,$=Ht(E.length-l,0),q=re($);++S<$;)q[S]=E[l+S];S=-1;for(var W=re(l+1);++S<l;)W[S]=E[S];return W[l]=g(q),Cr(o,this,W)}}function bp(o,l){return l.length<2?o:vi(o,Wr(l,0,-1))}function FE(o,l){for(var g=o.length,E=ir(l.length,g),S=xr(o);E--;){var $=l[E];o[E]=Fn($,g)?S[$]:t}return o}function X0(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var Ep=Cp(Zd),$s=U2||function(o,l){return Qt.setTimeout(o,l)},Q0=Cp(Kb);function Ap(o,l,g){var E=l+"";return Q0(o,mE(E,BE(_E(E),g)))}function Cp(o){var l=0,g=0;return function(){var E=Y2(),S=R-(E-g);if(g=E,S>0){if(++l>=I)return arguments[0]}else l=0;return o.apply(t,arguments)}}function _a(o,l){var g=-1,E=o.length,S=E-1;for(l=l===t?E:l;++g<l;){var $=T0(g,S),q=o[$];o[$]=o[g],o[g]=q}return o.length=l,o}var Fp=bE(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(ys,function(g,E,S,$){l.push(S?$.replace(Gu,"$1"):E||g)}),l});function dn(o){if(typeof o=="string"||Mr(o))return o;var l=o+"";return l=="0"&&1/o==-G?"-0":l}function mi(o){if(o!=null){try{return Ho.call(o)}catch{}try{return o+""}catch{}}return""}function BE(o,l){return kr(Q,function(g){var E="_."+g[0];l&g[1]&&!ko(o,E)&&o.push(E)}),o.sort()}function Bp(o){if(o instanceof Ze)return o.clone();var l=new qr(o.__wrapped__,o.__chain__);return l.__actions__=xr(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function ME(o,l,g){(g?dr(o,l,g):l===t)?l=1:l=Ht(ze(l),0);var E=o==null?0:o.length;if(!E||l<1)return[];for(var S=0,$=0,q=re(Xo(E/l));S<E;)q[$++]=Wr(o,S,S+=l);return q}function NE(o){for(var l=-1,g=o==null?0:o.length,E=0,S=[];++l<g;){var $=o[l];$&&(S[E++]=$)}return S}function SE(){var o=arguments.length;if(!o)return[];for(var l=re(o-1),g=arguments[0],E=o;E--;)l[E-1]=arguments[E];return Wn(Pe(g)?xr(g):[g],Jt(l,1))}var OE=Ue(function(o,l){return Tt(o)?Ms(o,Jt(l,1,Tt,!0)):[]}),IE=Ue(function(o,l){var g=Hr(l);return Tt(g)&&(g=t),Tt(o)?Ms(o,Jt(l,1,Tt,!0),Me(g,2)):[]}),TE=Ue(function(o,l){var g=Hr(l);return Tt(g)&&(g=t),Tt(o)?Ms(o,Jt(l,1,Tt,!0),t,g):[]});function $E(o,l,g){var E=o==null?0:o.length;return E?(l=g||l===t?1:ze(l),Wr(o,l<0?0:l,E)):[]}function RE(o,l,g){var E=o==null?0:o.length;return E?(l=g||l===t?1:ze(l),l=E-l,Wr(o,0,l<0?0:l)):[]}function LE(o,l){return o&&o.length?aa(o,Me(l,3),!0,!0):[]}function PE(o,l){return o&&o.length?aa(o,Me(l,3),!0):[]}function kE(o,l,g,E){var S=o==null?0:o.length;return S?(g&&typeof g!="number"&&dr(o,l,g)&&(g=0,E=S),Sb(o,l,g,E)):[]}function Mp(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=g==null?0:ze(g);return S<0&&(S=Ht(E+S,0)),zo(o,Me(l,3),S)}function Np(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=E-1;return g!==t&&(S=ze(g),S=g<0?Ht(E+S,0):ir(S,E-1)),zo(o,Me(l,3),S,!0)}function Sp(o){var l=o==null?0:o.length;return l?Jt(o,1):[]}function zE(o){var l=o==null?0:o.length;return l?Jt(o,G):[]}function qE(o,l){var g=o==null?0:o.length;return g?(l=l===t?1:ze(l),Jt(o,l)):[]}function UE(o){for(var l=-1,g=o==null?0:o.length,E={};++l<g;){var S=o[l];E[S[0]]=S[1]}return E}function Op(o){return o&&o.length?o[0]:t}function WE(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=g==null?0:ze(g);return S<0&&(S=Ht(E+S,0)),Hi(o,l,S)}function HE(o){var l=o==null?0:o.length;return l?Wr(o,0,-1):[]}var jE=Ue(function(o){var l=At(o,k0);return l.length&&l[0]===o[0]?M0(l):[]}),YE=Ue(function(o){var l=Hr(o),g=At(o,k0);return l===Hr(g)?l=t:g.pop(),g.length&&g[0]===o[0]?M0(g,Me(l,2)):[]}),ZE=Ue(function(o){var l=Hr(o),g=At(o,k0);return l=typeof l=="function"?l:t,l&&g.pop(),g.length&&g[0]===o[0]?M0(g,t,l):[]});function VE(o,l){return o==null?"":H2.call(o,l)}function Hr(o){var l=o==null?0:o.length;return l?o[l-1]:t}function GE(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=E;return g!==t&&(S=ze(g),S=S<0?Ht(E+S,0):ir(S,E-1)),l===l?B2(o,l,S):zo(o,hd,S,!0)}function KE(o,l){return o&&o.length?Wd(o,ze(l)):t}var XE=Ue(Ip);function Ip(o,l){return o&&o.length&&l&&l.length?I0(o,l):o}function QE(o,l,g){return o&&o.length&&l&&l.length?I0(o,l,Me(g,2)):o}function JE(o,l,g){return o&&o.length&&l&&l.length?I0(o,l,t,g):o}var e8=Cn(function(o,l){var g=o==null?0:o.length,E=A0(o,l);return Yd(o,At(l,function(S){return Fn(S,g)?+S:S}).sort(rp)),E});function t8(o,l){var g=[];if(!(o&&o.length))return g;var E=-1,S=[],$=o.length;for(l=Me(l,3);++E<$;){var q=o[E];l(q,E,o)&&(g.push(q),S.push(E))}return Yd(o,S),g}function J0(o){return o==null?o:V2.call(o)}function r8(o,l,g){var E=o==null?0:o.length;return E?(g&&typeof g!="number"&&dr(o,l,g)?(l=0,g=E):(l=l==null?0:ze(l),g=g===t?E:ze(g)),Wr(o,l,g)):[]}function n8(o,l){return oa(o,l)}function i8(o,l,g){return R0(o,l,Me(g,2))}function s8(o,l){var g=o==null?0:o.length;if(g){var E=oa(o,l);if(E<g&&nn(o[E],l))return E}return-1}function o8(o,l){return oa(o,l,!0)}function a8(o,l,g){return R0(o,l,Me(g,2),!0)}function u8(o,l){var g=o==null?0:o.length;if(g){var E=oa(o,l,!0)-1;if(nn(o[E],l))return E}return-1}function l8(o){return o&&o.length?Vd(o):[]}function c8(o,l){return o&&o.length?Vd(o,Me(l,2)):[]}function f8(o){var l=o==null?0:o.length;return l?Wr(o,1,l):[]}function h8(o,l,g){return o&&o.length?(l=g||l===t?1:ze(l),Wr(o,0,l<0?0:l)):[]}function d8(o,l,g){var E=o==null?0:o.length;return E?(l=g||l===t?1:ze(l),l=E-l,Wr(o,l<0?0:l,E)):[]}function p8(o,l){return o&&o.length?aa(o,Me(l,3),!1,!0):[]}function _8(o,l){return o&&o.length?aa(o,Me(l,3)):[]}var v8=Ue(function(o){return Zn(Jt(o,1,Tt,!0))}),g8=Ue(function(o){var l=Hr(o);return Tt(l)&&(l=t),Zn(Jt(o,1,Tt,!0),Me(l,2))}),m8=Ue(function(o){var l=Hr(o);return l=typeof l=="function"?l:t,Zn(Jt(o,1,Tt,!0),t,l)});function x8(o){return o&&o.length?Zn(o):[]}function y8(o,l){return o&&o.length?Zn(o,Me(l,2)):[]}function D8(o,l){return l=typeof l=="function"?l:t,o&&o.length?Zn(o,t,l):[]}function el(o){if(!(o&&o.length))return[];var l=0;return o=Un(o,function(g){if(Tt(g))return l=Ht(g.length,l),!0}),g0(l,function(g){return At(o,p0(g))})}function Tp(o,l){if(!(o&&o.length))return[];var g=el(o);return l==null?g:At(g,function(E){return Cr(l,t,E)})}var w8=Ue(function(o,l){return Tt(o)?Ms(o,l):[]}),b8=Ue(function(o){return P0(Un(o,Tt))}),E8=Ue(function(o){var l=Hr(o);return Tt(l)&&(l=t),P0(Un(o,Tt),Me(l,2))}),A8=Ue(function(o){var l=Hr(o);return l=typeof l=="function"?l:t,P0(Un(o,Tt),t,l)}),C8=Ue(el);function F8(o,l){return Qd(o||[],l||[],Bs)}function B8(o,l){return Qd(o||[],l||[],Os)}var M8=Ue(function(o){var l=o.length,g=l>1?o[l-1]:t;return g=typeof g=="function"?(o.pop(),g):t,Tp(o,g)});function $p(o){var l=T(o);return l.__chain__=!0,l}function N8(o,l){return l(o),o}function va(o,l){return l(o)}var S8=Cn(function(o){var l=o.length,g=l?o[0]:0,E=this.__wrapped__,S=function($){return A0($,o)};return l>1||this.__actions__.length||!(E instanceof Ze)||!Fn(g)?this.thru(S):(E=E.slice(g,+g+(l?1:0)),E.__actions__.push({func:va,args:[S],thisArg:t}),new qr(E,this.__chain__).thru(function($){return l&&!$.length&&$.push(t),$}))});function O8(){return $p(this)}function I8(){return new qr(this.value(),this.__chain__)}function T8(){this.__values__===t&&(this.__values__=Gp(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function $8(){return this}function R8(o){for(var l,g=this;g instanceof ta;){var E=Bp(g);E.__index__=0,E.__values__=t,l?S.__wrapped__=E:l=E;var S=E;g=g.__wrapped__}return S.__wrapped__=o,l}function L8(){var o=this.__wrapped__;if(o instanceof Ze){var l=o;return this.__actions__.length&&(l=new Ze(this)),l=l.reverse(),l.__actions__.push({func:va,args:[J0],thisArg:t}),new qr(l,this.__chain__)}return this.thru(J0)}function P8(){return Xd(this.__wrapped__,this.__actions__)}var k8=ua(function(o,l,g){lt.call(o,g)?++o[g]:En(o,g,1)});function z8(o,l,g){var E=Pe(o)?cd:Nb;return g&&dr(o,l,g)&&(l=t),E(o,Me(l,3))}function q8(o,l){var g=Pe(o)?Un:Td;return g(o,Me(l,3))}var U8=up(Mp),W8=up(Np);function H8(o,l){return Jt(ga(o,l),1)}function j8(o,l){return Jt(ga(o,l),G)}function Y8(o,l,g){return g=g===t?1:ze(g),Jt(ga(o,l),g)}function Rp(o,l){var g=Pe(o)?kr:Yn;return g(o,Me(l,3))}function Lp(o,l){var g=Pe(o)?f2:Id;return g(o,Me(l,3))}var Z8=ua(function(o,l,g){lt.call(o,g)?o[g].push(l):En(o,g,[l])});function V8(o,l,g,E){o=yr(o)?o:rs(o),g=g&&!E?ze(g):0;var S=o.length;return g<0&&(g=Ht(S+g,0)),wa(o)?g<=S&&o.indexOf(l,g)>-1:!!S&&Hi(o,l,g)>-1}var G8=Ue(function(o,l,g){var E=-1,S=typeof l=="function",$=yr(o)?re(o.length):[];return Yn(o,function(q){$[++E]=S?Cr(l,q,g):Ns(q,l,g)}),$}),K8=ua(function(o,l,g){En(o,g,l)});function ga(o,l){var g=Pe(o)?At:zd;return g(o,Me(l,3))}function X8(o,l,g,E){return o==null?[]:(Pe(l)||(l=l==null?[]:[l]),g=E?t:g,Pe(g)||(g=g==null?[]:[g]),Hd(o,l,g))}var Q8=ua(function(o,l,g){o[g?0:1].push(l)},function(){return[[],[]]});function J8(o,l,g){var E=Pe(o)?h0:pd,S=arguments.length<3;return E(o,Me(l,4),g,S,Yn)}function e4(o,l,g){var E=Pe(o)?h2:pd,S=arguments.length<3;return E(o,Me(l,4),g,S,Id)}function t4(o,l){var g=Pe(o)?Un:Td;return g(o,ya(Me(l,3)))}function r4(o){var l=Pe(o)?Md:Vb;return l(o)}function n4(o,l,g){(g?dr(o,l,g):l===t)?l=1:l=ze(l);var E=Pe(o)?Ab:Gb;return E(o,l)}function i4(o){var l=Pe(o)?Cb:Xb;return l(o)}function s4(o){if(o==null)return 0;if(yr(o))return wa(o)?Yi(o):o.length;var l=sr(o);return l==Re||l==yt?o.size:S0(o).length}function o4(o,l,g){var E=Pe(o)?d0:Qb;return g&&dr(o,l,g)&&(l=t),E(o,Me(l,3))}var a4=Ue(function(o,l){if(o==null)return[];var g=l.length;return g>1&&dr(o,l[0],l[1])?l=[]:g>2&&dr(l[0],l[1],l[2])&&(l=[l[0]]),Hd(o,Jt(l,1),[])}),ma=q2||function(){return Qt.Date.now()};function u4(o,l){if(typeof l!="function")throw new zr(a);return o=ze(o),function(){if(--o<1)return l.apply(this,arguments)}}function Pp(o,l,g){return l=g?t:l,l=o&&l==null?o.length:l,An(o,B,t,t,t,t,l)}function kp(o,l){var g;if(typeof l!="function")throw new zr(a);return o=ze(o),function(){return--o>0&&(g=l.apply(this,arguments)),o<=1&&(l=t),g}}var tl=Ue(function(o,l,g){var E=y;if(g.length){var S=Hn(g,es(tl));E|=b}return An(o,E,l,g,S)}),zp=Ue(function(o,l,g){var E=y|m;if(g.length){var S=Hn(g,es(zp));E|=b}return An(l,E,o,g,S)});function qp(o,l,g){l=g?t:l;var E=An(o,D,t,t,t,t,t,l);return E.placeholder=qp.placeholder,E}function Up(o,l,g){l=g?t:l;var E=An(o,C,t,t,t,t,t,l);return E.placeholder=Up.placeholder,E}function Wp(o,l,g){var E,S,$,q,W,K,oe=0,ae=!1,ce=!1,ge=!0;if(typeof o!="function")throw new zr(a);l=jr(l)||0,Bt(g)&&(ae=!!g.leading,ce="maxWait"in g,$=ce?Ht(jr(g.maxWait)||0,l):$,ge="trailing"in g?!!g.trailing:ge);function Ae($t){var sn=E,Nn=S;return E=S=t,oe=$t,q=o.apply(Nn,sn),q}function Ne($t){return oe=$t,W=$s(He,l),ae?Ae($t):q}function qe($t){var sn=$t-K,Nn=$t-oe,u1=l-sn;return ce?ir(u1,$-Nn):u1}function Se($t){var sn=$t-K,Nn=$t-oe;return K===t||sn>=l||sn<0||ce&&Nn>=$}function He(){var $t=ma();if(Se($t))return Ke($t);W=$s(He,qe($t))}function Ke($t){return W=t,ge&&E?Ae($t):(E=S=t,q)}function Nr(){W!==t&&Jd(W),oe=0,E=K=S=W=t}function pr(){return W===t?q:Ke(ma())}function Sr(){var $t=ma(),sn=Se($t);if(E=arguments,S=this,K=$t,sn){if(W===t)return Ne(K);if(ce)return Jd(W),W=$s(He,l),Ae(K)}return W===t&&(W=$s(He,l)),q}return Sr.cancel=Nr,Sr.flush=pr,Sr}var l4=Ue(function(o,l){return Od(o,1,l)}),c4=Ue(function(o,l,g){return Od(o,jr(l)||0,g)});function f4(o){return An(o,O)}function xa(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new zr(a);var g=function(){var E=arguments,S=l?l.apply(this,E):E[0],$=g.cache;if($.has(S))return $.get(S);var q=o.apply(this,E);return g.cache=$.set(S,q)||$,q};return g.cache=new(xa.Cache||bn),g}xa.Cache=bn;function ya(o){if(typeof o!="function")throw new zr(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function h4(o){return kp(2,o)}var d4=Jb(function(o,l){l=l.length==1&&Pe(l[0])?At(l[0],Fr(Me())):At(Jt(l,1),Fr(Me()));var g=l.length;return Ue(function(E){for(var S=-1,$=ir(E.length,g);++S<$;)E[S]=l[S].call(this,E[S]);return Cr(o,this,E)})}),rl=Ue(function(o,l){var g=Hn(l,es(rl));return An(o,b,t,l,g)}),Hp=Ue(function(o,l){var g=Hn(l,es(Hp));return An(o,F,t,l,g)}),p4=Cn(function(o,l){return An(o,M,t,t,t,l)});function _4(o,l){if(typeof o!="function")throw new zr(a);return l=l===t?l:ze(l),Ue(o,l)}function v4(o,l){if(typeof o!="function")throw new zr(a);return l=l==null?0:Ht(ze(l),0),Ue(function(g){var E=g[l],S=Gn(g,0,l);return E&&Wn(S,E),Cr(o,this,S)})}function g4(o,l,g){var E=!0,S=!0;if(typeof o!="function")throw new zr(a);return Bt(g)&&(E="leading"in g?!!g.leading:E,S="trailing"in g?!!g.trailing:S),Wp(o,l,{leading:E,maxWait:l,trailing:S})}function m4(o){return Pp(o,1)}function x4(o,l){return rl(z0(l),o)}function y4(){if(!arguments.length)return[];var o=arguments[0];return Pe(o)?o:[o]}function D4(o){return Ur(o,v)}function w4(o,l){return l=typeof l=="function"?l:t,Ur(o,v,l)}function b4(o){return Ur(o,d|v)}function E4(o,l){return l=typeof l=="function"?l:t,Ur(o,d|v,l)}function A4(o,l){return l==null||Sd(o,l,Yt(l))}function nn(o,l){return o===l||o!==o&&l!==l}var C4=ha(B0),F4=ha(function(o,l){return o>=l}),xi=Ld(function(){return arguments}())?Ld:function(o){return Nt(o)&&lt.call(o,"callee")&&!bd.call(o,"callee")},Pe=re.isArray,B4=id?Fr(id):Rb;function yr(o){return o!=null&&Da(o.length)&&!Bn(o)}function Tt(o){return Nt(o)&&yr(o)}function M4(o){return o===!0||o===!1||Nt(o)&&hr(o)==be}var Kn=W2||dl,N4=sd?Fr(sd):Lb;function S4(o){return Nt(o)&&o.nodeType===1&&!Rs(o)}function O4(o){if(o==null)return!0;if(yr(o)&&(Pe(o)||typeof o=="string"||typeof o.splice=="function"||Kn(o)||ts(o)||xi(o)))return!o.length;var l=sr(o);if(l==Re||l==yt)return!o.size;if(Ts(o))return!S0(o).length;for(var g in o)if(lt.call(o,g))return!1;return!0}function I4(o,l){return Ss(o,l)}function T4(o,l,g){g=typeof g=="function"?g:t;var E=g?g(o,l):t;return E===t?Ss(o,l,t,g):!!E}function nl(o){if(!Nt(o))return!1;var l=hr(o);return l==nt||l==Fe||typeof o.message=="string"&&typeof o.name=="string"&&!Rs(o)}function $4(o){return typeof o=="number"&&Ad(o)}function Bn(o){if(!Bt(o))return!1;var l=hr(o);return l==Ye||l==Ie||l==we||l==Lr}function jp(o){return typeof o=="number"&&o==ze(o)}function Da(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=H}function Bt(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Nt(o){return o!=null&&typeof o=="object"}var Yp=od?Fr(od):kb;function R4(o,l){return o===l||N0(o,l,Z0(l))}function L4(o,l,g){return g=typeof g=="function"?g:t,N0(o,l,Z0(l),g)}function P4(o){return Zp(o)&&o!=+o}function k4(o){if(wE(o))throw new Le(i);return Pd(o)}function z4(o){return o===null}function q4(o){return o==null}function Zp(o){return typeof o=="number"||Nt(o)&&hr(o)==xt}function Rs(o){if(!Nt(o)||hr(o)!=Et)return!1;var l=Vo(o);if(l===null)return!0;var g=lt.call(l,"constructor")&&l.constructor;return typeof g=="function"&&g instanceof g&&Ho.call(g)==L2}var il=ad?Fr(ad):zb;function U4(o){return jp(o)&&o>=-H&&o<=H}var Vp=ud?Fr(ud):qb;function wa(o){return typeof o=="string"||!Pe(o)&&Nt(o)&&hr(o)==Ot}function Mr(o){return typeof o=="symbol"||Nt(o)&&hr(o)==P}var ts=ld?Fr(ld):Ub;function W4(o){return o===t}function H4(o){return Nt(o)&&sr(o)==J}function j4(o){return Nt(o)&&hr(o)==ie}var Y4=ha(O0),Z4=ha(function(o,l){return o<=l});function Gp(o){if(!o)return[];if(yr(o))return wa(o)?tn(o):xr(o);if(bs&&o[bs])return A2(o[bs]());var l=sr(o),g=l==Re?x0:l==yt?qo:rs;return g(o)}function Mn(o){if(!o)return o===0?o:0;if(o=jr(o),o===G||o===-G){var l=o<0?-1:1;return l*ee}return o===o?o:0}function ze(o){var l=Mn(o),g=l%1;return l===l?g?l-g:l:0}function Kp(o){return o?_i(ze(o),0,j):0}function jr(o){if(typeof o=="number")return o;if(Mr(o))return te;if(Bt(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Bt(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=_d(o);var g=Qu.test(o);return g||e0.test(o)?u2(o.slice(2),g?2:8):Xu.test(o)?te:+o}function Xp(o){return hn(o,Dr(o))}function V4(o){return o?_i(ze(o),-H,H):o===0?o:0}function at(o){return o==null?"":Br(o)}var G4=Qi(function(o,l){if(Ts(l)||yr(l)){hn(l,Yt(l),o);return}for(var g in l)lt.call(l,g)&&Bs(o,g,l[g])}),Qp=Qi(function(o,l){hn(l,Dr(l),o)}),ba=Qi(function(o,l,g,E){hn(l,Dr(l),o,E)}),K4=Qi(function(o,l,g,E){hn(l,Yt(l),o,E)}),X4=Cn(A0);function Q4(o,l){var g=Xi(o);return l==null?g:Nd(g,l)}var J4=Ue(function(o,l){o=dt(o);var g=-1,E=l.length,S=E>2?l[2]:t;for(S&&dr(l[0],l[1],S)&&(E=1);++g<E;)for(var $=l[g],q=Dr($),W=-1,K=q.length;++W<K;){var oe=q[W],ae=o[oe];(ae===t||nn(ae,Vi[oe])&&!lt.call(o,oe))&&(o[oe]=$[oe])}return o}),eA=Ue(function(o){return o.push(t,_p),Cr(Jp,t,o)});function tA(o,l){return fd(o,Me(l,3),fn)}function rA(o,l){return fd(o,Me(l,3),F0)}function nA(o,l){return o==null?o:C0(o,Me(l,3),Dr)}function iA(o,l){return o==null?o:$d(o,Me(l,3),Dr)}function sA(o,l){return o&&fn(o,Me(l,3))}function oA(o,l){return o&&F0(o,Me(l,3))}function aA(o){return o==null?[]:ia(o,Yt(o))}function uA(o){return o==null?[]:ia(o,Dr(o))}function sl(o,l,g){var E=o==null?t:vi(o,l);return E===t?g:E}function lA(o,l){return o!=null&&mp(o,l,Ob)}function ol(o,l){return o!=null&&mp(o,l,Ib)}var cA=cp(function(o,l,g){l!=null&&typeof l.toString!="function"&&(l=jo.call(l)),o[l]=g},ul(wr)),fA=cp(function(o,l,g){l!=null&&typeof l.toString!="function"&&(l=jo.call(l)),lt.call(o,l)?o[l].push(g):o[l]=[g]},Me),hA=Ue(Ns);function Yt(o){return yr(o)?Bd(o):S0(o)}function Dr(o){return yr(o)?Bd(o,!0):Wb(o)}function dA(o,l){var g={};return l=Me(l,3),fn(o,function(E,S,$){En(g,l(E,S,$),E)}),g}function pA(o,l){var g={};return l=Me(l,3),fn(o,function(E,S,$){En(g,S,l(E,S,$))}),g}var _A=Qi(function(o,l,g){sa(o,l,g)}),Jp=Qi(function(o,l,g,E){sa(o,l,g,E)}),vA=Cn(function(o,l){var g={};if(o==null)return g;var E=!1;l=At(l,function($){return $=Vn($,o),E||(E=$.length>1),$}),hn(o,j0(o),g),E&&(g=Ur(g,d|p|v,cE));for(var S=l.length;S--;)L0(g,l[S]);return g});function gA(o,l){return e1(o,ya(Me(l)))}var mA=Cn(function(o,l){return o==null?{}:jb(o,l)});function e1(o,l){if(o==null)return{};var g=At(j0(o),function(E){return[E]});return l=Me(l),jd(o,g,function(E,S){return l(E,S[0])})}function xA(o,l,g){l=Vn(l,o);var E=-1,S=l.length;for(S||(S=1,o=t);++E<S;){var $=o==null?t:o[dn(l[E])];$===t&&(E=S,$=g),o=Bn($)?$.call(o):$}return o}function yA(o,l,g){return o==null?o:Os(o,l,g)}function DA(o,l,g,E){return E=typeof E=="function"?E:t,o==null?o:Os(o,l,g,E)}var t1=dp(Yt),r1=dp(Dr);function wA(o,l,g){var E=Pe(o),S=E||Kn(o)||ts(o);if(l=Me(l,4),g==null){var $=o&&o.constructor;S?g=E?new $:[]:Bt(o)?g=Bn($)?Xi(Vo(o)):{}:g={}}return(S?kr:fn)(o,function(q,W,K){return l(g,q,W,K)}),g}function bA(o,l){return o==null?!0:L0(o,l)}function EA(o,l,g){return o==null?o:Kd(o,l,z0(g))}function AA(o,l,g,E){return E=typeof E=="function"?E:t,o==null?o:Kd(o,l,z0(g),E)}function rs(o){return o==null?[]:m0(o,Yt(o))}function CA(o){return o==null?[]:m0(o,Dr(o))}function FA(o,l,g){return g===t&&(g=l,l=t),g!==t&&(g=jr(g),g=g===g?g:0),l!==t&&(l=jr(l),l=l===l?l:0),_i(jr(o),l,g)}function BA(o,l,g){return l=Mn(l),g===t?(g=l,l=0):g=Mn(g),o=jr(o),Tb(o,l,g)}function MA(o,l,g){if(g&&typeof g!="boolean"&&dr(o,l,g)&&(l=g=t),g===t&&(typeof l=="boolean"?(g=l,l=t):typeof o=="boolean"&&(g=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Mn(o),l===t?(l=o,o=0):l=Mn(l)),o>l){var E=o;o=l,l=E}if(g||o%1||l%1){var S=Cd();return ir(o+S*(l-o+a2("1e-"+((S+"").length-1))),l)}return T0(o,l)}var NA=Ji(function(o,l,g){return l=l.toLowerCase(),o+(g?n1(l):l)});function n1(o){return al(at(o).toLowerCase())}function i1(o){return o=at(o),o&&o.replace(r0,y2).replace(Xw,"")}function SA(o,l,g){o=at(o),l=Br(l);var E=o.length;g=g===t?E:_i(ze(g),0,E);var S=g;return g-=l.length,g>=0&&o.slice(g,S)==l}function OA(o){return o=at(o),o&&gs.test(o)?o.replace(li,D2):o}function IA(o){return o=at(o),o&&Xt.test(o)?o.replace(zn,"\\$&"):o}var TA=Ji(function(o,l,g){return o+(g?"-":"")+l.toLowerCase()}),$A=Ji(function(o,l,g){return o+(g?" ":"")+l.toLowerCase()}),RA=ap("toLowerCase");function LA(o,l,g){o=at(o),l=ze(l);var E=l?Yi(o):0;if(!l||E>=l)return o;var S=(l-E)/2;return fa(Qo(S),g)+o+fa(Xo(S),g)}function PA(o,l,g){o=at(o),l=ze(l);var E=l?Yi(o):0;return l&&E<l?o+fa(l-E,g):o}function kA(o,l,g){o=at(o),l=ze(l);var E=l?Yi(o):0;return l&&E<l?fa(l-E,g)+o:o}function zA(o,l,g){return g||l==null?l=0:l&&(l=+l),Z2(at(o).replace(mr,""),l||0)}function qA(o,l,g){return(g?dr(o,l,g):l===t)?l=1:l=ze(l),$0(at(o),l)}function UA(){var o=arguments,l=at(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var WA=Ji(function(o,l,g){return o+(g?"_":"")+l.toLowerCase()});function HA(o,l,g){return g&&typeof g!="number"&&dr(o,l,g)&&(l=g=t),g=g===t?j:g>>>0,g?(o=at(o),o&&(typeof l=="string"||l!=null&&!il(l))&&(l=Br(l),!l&&ji(o))?Gn(tn(o),0,g):o.split(l,g)):[]}var jA=Ji(function(o,l,g){return o+(g?" ":"")+al(l)});function YA(o,l,g){return o=at(o),g=g==null?0:_i(ze(g),0,o.length),l=Br(l),o.slice(g,g+l.length)==l}function ZA(o,l,g){var E=T.templateSettings;g&&dr(o,l,g)&&(l=t),o=at(o),l=ba({},l,E,pp);var S=ba({},l.imports,E.imports,pp),$=Yt(S),q=m0(S,$),W,K,oe=0,ae=l.interpolate||qi,ce="__p += '",ge=y0((l.escape||qi).source+"|"+ae.source+"|"+(ae===Pi?Ku:qi).source+"|"+(l.evaluate||qi).source+"|$","g"),Ae="//# sourceURL="+(lt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++r2+"]")+`
11
- `;o.replace(ge,function(Se,He,Ke,Nr,pr,Sr){return Ke||(Ke=Nr),ce+=o.slice(oe,Sr).replace(ci,w2),He&&(W=!0,ce+=`' +
10
+ `)}function xE(o){return Pe(o)||xi(o)||!!(Ed&&o&&o[Ed])}function Fn(o,l){var g=typeof o;return l=l??H,!!l&&(g=="number"||g!="symbol"&&t0.test(o))&&o>-1&&o%1==0&&o<l}function dr(o,l,g){if(!Bt(g))return!1;var E=typeof l;return(E=="number"?yr(g)&&Fn(l,g.length):E=="string"&&l in g)?nn(g[l],o):!1}function G0(o,l){if(Pe(o))return!1;var g=typeof o;return g=="number"||g=="symbol"||g=="boolean"||o==null||Mr(o)?!0:ki.test(o)||!xs.test(o)||l!=null&&o in dt(l)}function yE(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function K0(o){var l=da(o),g=T[l];if(typeof g!="function"||!(l in Ze.prototype))return!1;if(o===g)return!0;var E=Y0(g);return!!E&&o===E[0]}function DE(o){return!!yd&&yd in o}var wE=Wo?Bn:dl;function Ts(o){var l=o&&o.constructor,g=typeof l=="function"&&l.prototype||Vi;return o===g}function yp(o){return o===o&&!Bt(o)}function Dp(o,l){return function(g){return g==null?!1:g[o]===l&&(l!==t||o in dt(g))}}function bE(o){var l=xa(o,function(E){return g.size===f&&g.clear(),E}),g=l.cache;return l}function EE(o,l){var g=o[1],E=l[1],S=g|E,$=S<(y|m|B),q=E==B&&g==D||E==B&&g==M&&o[7].length<=l[8]||E==(B|M)&&l[7].length<=l[8]&&g==D;if(!($||q))return o;E&y&&(o[2]=l[2],S|=g&y?0:w);var W=l[3];if(W){var K=o[3];o[3]=K?np(K,W,l[4]):W,o[4]=K?Hn(o[3],h):l[4]}return W=l[5],W&&(K=o[5],o[5]=K?ip(K,W,l[6]):W,o[6]=K?Hn(o[5],h):l[6]),W=l[7],W&&(o[7]=W),E&B&&(o[8]=o[8]==null?l[8]:ir(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=S,o}function AE(o){var l=[];if(o!=null)for(var g in dt(o))l.push(g);return l}function CE(o){return jo.call(o)}function wp(o,l,g){return l=Ht(l===t?o.length-1:l,0),function(){for(var E=arguments,S=-1,$=Ht(E.length-l,0),q=re($);++S<$;)q[S]=E[l+S];S=-1;for(var W=re(l+1);++S<l;)W[S]=E[S];return W[l]=g(q),Cr(o,this,W)}}function bp(o,l){return l.length<2?o:vi(o,Wr(l,0,-1))}function FE(o,l){for(var g=o.length,E=ir(l.length,g),S=xr(o);E--;){var $=l[E];o[E]=Fn($,g)?S[$]:t}return o}function X0(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var Ep=Cp(Zd),$s=U2||function(o,l){return Qt.setTimeout(o,l)},Q0=Cp(Kb);function Ap(o,l,g){var E=l+"";return Q0(o,mE(E,BE(_E(E),g)))}function Cp(o){var l=0,g=0;return function(){var E=Y2(),S=L-(E-g);if(g=E,S>0){if(++l>=I)return arguments[0]}else l=0;return o.apply(t,arguments)}}function _a(o,l){var g=-1,E=o.length,S=E-1;for(l=l===t?E:l;++g<l;){var $=T0(g,S),q=o[$];o[$]=o[g],o[g]=q}return o.length=l,o}var Fp=bE(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(ys,function(g,E,S,$){l.push(S?$.replace(Gu,"$1"):E||g)}),l});function dn(o){if(typeof o=="string"||Mr(o))return o;var l=o+"";return l=="0"&&1/o==-G?"-0":l}function mi(o){if(o!=null){try{return Ho.call(o)}catch{}try{return o+""}catch{}}return""}function BE(o,l){return kr(Q,function(g){var E="_."+g[0];l&g[1]&&!ko(o,E)&&o.push(E)}),o.sort()}function Bp(o){if(o instanceof Ze)return o.clone();var l=new qr(o.__wrapped__,o.__chain__);return l.__actions__=xr(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function ME(o,l,g){(g?dr(o,l,g):l===t)?l=1:l=Ht(ze(l),0);var E=o==null?0:o.length;if(!E||l<1)return[];for(var S=0,$=0,q=re(Xo(E/l));S<E;)q[$++]=Wr(o,S,S+=l);return q}function NE(o){for(var l=-1,g=o==null?0:o.length,E=0,S=[];++l<g;){var $=o[l];$&&(S[E++]=$)}return S}function SE(){var o=arguments.length;if(!o)return[];for(var l=re(o-1),g=arguments[0],E=o;E--;)l[E-1]=arguments[E];return Wn(Pe(g)?xr(g):[g],Jt(l,1))}var OE=Ue(function(o,l){return Tt(o)?Ms(o,Jt(l,1,Tt,!0)):[]}),IE=Ue(function(o,l){var g=Hr(l);return Tt(g)&&(g=t),Tt(o)?Ms(o,Jt(l,1,Tt,!0),Me(g,2)):[]}),TE=Ue(function(o,l){var g=Hr(l);return Tt(g)&&(g=t),Tt(o)?Ms(o,Jt(l,1,Tt,!0),t,g):[]});function $E(o,l,g){var E=o==null?0:o.length;return E?(l=g||l===t?1:ze(l),Wr(o,l<0?0:l,E)):[]}function LE(o,l,g){var E=o==null?0:o.length;return E?(l=g||l===t?1:ze(l),l=E-l,Wr(o,0,l<0?0:l)):[]}function RE(o,l){return o&&o.length?aa(o,Me(l,3),!0,!0):[]}function PE(o,l){return o&&o.length?aa(o,Me(l,3),!0):[]}function kE(o,l,g,E){var S=o==null?0:o.length;return S?(g&&typeof g!="number"&&dr(o,l,g)&&(g=0,E=S),Sb(o,l,g,E)):[]}function Mp(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=g==null?0:ze(g);return S<0&&(S=Ht(E+S,0)),zo(o,Me(l,3),S)}function Np(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=E-1;return g!==t&&(S=ze(g),S=g<0?Ht(E+S,0):ir(S,E-1)),zo(o,Me(l,3),S,!0)}function Sp(o){var l=o==null?0:o.length;return l?Jt(o,1):[]}function zE(o){var l=o==null?0:o.length;return l?Jt(o,G):[]}function qE(o,l){var g=o==null?0:o.length;return g?(l=l===t?1:ze(l),Jt(o,l)):[]}function UE(o){for(var l=-1,g=o==null?0:o.length,E={};++l<g;){var S=o[l];E[S[0]]=S[1]}return E}function Op(o){return o&&o.length?o[0]:t}function WE(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=g==null?0:ze(g);return S<0&&(S=Ht(E+S,0)),Hi(o,l,S)}function HE(o){var l=o==null?0:o.length;return l?Wr(o,0,-1):[]}var jE=Ue(function(o){var l=At(o,k0);return l.length&&l[0]===o[0]?M0(l):[]}),YE=Ue(function(o){var l=Hr(o),g=At(o,k0);return l===Hr(g)?l=t:g.pop(),g.length&&g[0]===o[0]?M0(g,Me(l,2)):[]}),ZE=Ue(function(o){var l=Hr(o),g=At(o,k0);return l=typeof l=="function"?l:t,l&&g.pop(),g.length&&g[0]===o[0]?M0(g,t,l):[]});function VE(o,l){return o==null?"":H2.call(o,l)}function Hr(o){var l=o==null?0:o.length;return l?o[l-1]:t}function GE(o,l,g){var E=o==null?0:o.length;if(!E)return-1;var S=E;return g!==t&&(S=ze(g),S=S<0?Ht(E+S,0):ir(S,E-1)),l===l?B2(o,l,S):zo(o,hd,S,!0)}function KE(o,l){return o&&o.length?Wd(o,ze(l)):t}var XE=Ue(Ip);function Ip(o,l){return o&&o.length&&l&&l.length?I0(o,l):o}function QE(o,l,g){return o&&o.length&&l&&l.length?I0(o,l,Me(g,2)):o}function JE(o,l,g){return o&&o.length&&l&&l.length?I0(o,l,t,g):o}var e8=Cn(function(o,l){var g=o==null?0:o.length,E=A0(o,l);return Yd(o,At(l,function(S){return Fn(S,g)?+S:S}).sort(rp)),E});function t8(o,l){var g=[];if(!(o&&o.length))return g;var E=-1,S=[],$=o.length;for(l=Me(l,3);++E<$;){var q=o[E];l(q,E,o)&&(g.push(q),S.push(E))}return Yd(o,S),g}function J0(o){return o==null?o:V2.call(o)}function r8(o,l,g){var E=o==null?0:o.length;return E?(g&&typeof g!="number"&&dr(o,l,g)?(l=0,g=E):(l=l==null?0:ze(l),g=g===t?E:ze(g)),Wr(o,l,g)):[]}function n8(o,l){return oa(o,l)}function i8(o,l,g){return L0(o,l,Me(g,2))}function s8(o,l){var g=o==null?0:o.length;if(g){var E=oa(o,l);if(E<g&&nn(o[E],l))return E}return-1}function o8(o,l){return oa(o,l,!0)}function a8(o,l,g){return L0(o,l,Me(g,2),!0)}function u8(o,l){var g=o==null?0:o.length;if(g){var E=oa(o,l,!0)-1;if(nn(o[E],l))return E}return-1}function l8(o){return o&&o.length?Vd(o):[]}function f8(o,l){return o&&o.length?Vd(o,Me(l,2)):[]}function c8(o){var l=o==null?0:o.length;return l?Wr(o,1,l):[]}function h8(o,l,g){return o&&o.length?(l=g||l===t?1:ze(l),Wr(o,0,l<0?0:l)):[]}function d8(o,l,g){var E=o==null?0:o.length;return E?(l=g||l===t?1:ze(l),l=E-l,Wr(o,l<0?0:l,E)):[]}function p8(o,l){return o&&o.length?aa(o,Me(l,3),!1,!0):[]}function _8(o,l){return o&&o.length?aa(o,Me(l,3)):[]}var v8=Ue(function(o){return Zn(Jt(o,1,Tt,!0))}),g8=Ue(function(o){var l=Hr(o);return Tt(l)&&(l=t),Zn(Jt(o,1,Tt,!0),Me(l,2))}),m8=Ue(function(o){var l=Hr(o);return l=typeof l=="function"?l:t,Zn(Jt(o,1,Tt,!0),t,l)});function x8(o){return o&&o.length?Zn(o):[]}function y8(o,l){return o&&o.length?Zn(o,Me(l,2)):[]}function D8(o,l){return l=typeof l=="function"?l:t,o&&o.length?Zn(o,t,l):[]}function el(o){if(!(o&&o.length))return[];var l=0;return o=Un(o,function(g){if(Tt(g))return l=Ht(g.length,l),!0}),g0(l,function(g){return At(o,p0(g))})}function Tp(o,l){if(!(o&&o.length))return[];var g=el(o);return l==null?g:At(g,function(E){return Cr(l,t,E)})}var w8=Ue(function(o,l){return Tt(o)?Ms(o,l):[]}),b8=Ue(function(o){return P0(Un(o,Tt))}),E8=Ue(function(o){var l=Hr(o);return Tt(l)&&(l=t),P0(Un(o,Tt),Me(l,2))}),A8=Ue(function(o){var l=Hr(o);return l=typeof l=="function"?l:t,P0(Un(o,Tt),t,l)}),C8=Ue(el);function F8(o,l){return Qd(o||[],l||[],Bs)}function B8(o,l){return Qd(o||[],l||[],Os)}var M8=Ue(function(o){var l=o.length,g=l>1?o[l-1]:t;return g=typeof g=="function"?(o.pop(),g):t,Tp(o,g)});function $p(o){var l=T(o);return l.__chain__=!0,l}function N8(o,l){return l(o),o}function va(o,l){return l(o)}var S8=Cn(function(o){var l=o.length,g=l?o[0]:0,E=this.__wrapped__,S=function($){return A0($,o)};return l>1||this.__actions__.length||!(E instanceof Ze)||!Fn(g)?this.thru(S):(E=E.slice(g,+g+(l?1:0)),E.__actions__.push({func:va,args:[S],thisArg:t}),new qr(E,this.__chain__).thru(function($){return l&&!$.length&&$.push(t),$}))});function O8(){return $p(this)}function I8(){return new qr(this.value(),this.__chain__)}function T8(){this.__values__===t&&(this.__values__=Gp(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function $8(){return this}function L8(o){for(var l,g=this;g instanceof ta;){var E=Bp(g);E.__index__=0,E.__values__=t,l?S.__wrapped__=E:l=E;var S=E;g=g.__wrapped__}return S.__wrapped__=o,l}function R8(){var o=this.__wrapped__;if(o instanceof Ze){var l=o;return this.__actions__.length&&(l=new Ze(this)),l=l.reverse(),l.__actions__.push({func:va,args:[J0],thisArg:t}),new qr(l,this.__chain__)}return this.thru(J0)}function P8(){return Xd(this.__wrapped__,this.__actions__)}var k8=ua(function(o,l,g){lt.call(o,g)?++o[g]:En(o,g,1)});function z8(o,l,g){var E=Pe(o)?fd:Nb;return g&&dr(o,l,g)&&(l=t),E(o,Me(l,3))}function q8(o,l){var g=Pe(o)?Un:Td;return g(o,Me(l,3))}var U8=up(Mp),W8=up(Np);function H8(o,l){return Jt(ga(o,l),1)}function j8(o,l){return Jt(ga(o,l),G)}function Y8(o,l,g){return g=g===t?1:ze(g),Jt(ga(o,l),g)}function Lp(o,l){var g=Pe(o)?kr:Yn;return g(o,Me(l,3))}function Rp(o,l){var g=Pe(o)?c2:Id;return g(o,Me(l,3))}var Z8=ua(function(o,l,g){lt.call(o,g)?o[g].push(l):En(o,g,[l])});function V8(o,l,g,E){o=yr(o)?o:rs(o),g=g&&!E?ze(g):0;var S=o.length;return g<0&&(g=Ht(S+g,0)),wa(o)?g<=S&&o.indexOf(l,g)>-1:!!S&&Hi(o,l,g)>-1}var G8=Ue(function(o,l,g){var E=-1,S=typeof l=="function",$=yr(o)?re(o.length):[];return Yn(o,function(q){$[++E]=S?Cr(l,q,g):Ns(q,l,g)}),$}),K8=ua(function(o,l,g){En(o,g,l)});function ga(o,l){var g=Pe(o)?At:zd;return g(o,Me(l,3))}function X8(o,l,g,E){return o==null?[]:(Pe(l)||(l=l==null?[]:[l]),g=E?t:g,Pe(g)||(g=g==null?[]:[g]),Hd(o,l,g))}var Q8=ua(function(o,l,g){o[g?0:1].push(l)},function(){return[[],[]]});function J8(o,l,g){var E=Pe(o)?h0:pd,S=arguments.length<3;return E(o,Me(l,4),g,S,Yn)}function e4(o,l,g){var E=Pe(o)?h2:pd,S=arguments.length<3;return E(o,Me(l,4),g,S,Id)}function t4(o,l){var g=Pe(o)?Un:Td;return g(o,ya(Me(l,3)))}function r4(o){var l=Pe(o)?Md:Vb;return l(o)}function n4(o,l,g){(g?dr(o,l,g):l===t)?l=1:l=ze(l);var E=Pe(o)?Ab:Gb;return E(o,l)}function i4(o){var l=Pe(o)?Cb:Xb;return l(o)}function s4(o){if(o==null)return 0;if(yr(o))return wa(o)?Yi(o):o.length;var l=sr(o);return l==Le||l==yt?o.size:S0(o).length}function o4(o,l,g){var E=Pe(o)?d0:Qb;return g&&dr(o,l,g)&&(l=t),E(o,Me(l,3))}var a4=Ue(function(o,l){if(o==null)return[];var g=l.length;return g>1&&dr(o,l[0],l[1])?l=[]:g>2&&dr(l[0],l[1],l[2])&&(l=[l[0]]),Hd(o,Jt(l,1),[])}),ma=q2||function(){return Qt.Date.now()};function u4(o,l){if(typeof l!="function")throw new zr(a);return o=ze(o),function(){if(--o<1)return l.apply(this,arguments)}}function Pp(o,l,g){return l=g?t:l,l=o&&l==null?o.length:l,An(o,B,t,t,t,t,l)}function kp(o,l){var g;if(typeof l!="function")throw new zr(a);return o=ze(o),function(){return--o>0&&(g=l.apply(this,arguments)),o<=1&&(l=t),g}}var tl=Ue(function(o,l,g){var E=y;if(g.length){var S=Hn(g,es(tl));E|=b}return An(o,E,l,g,S)}),zp=Ue(function(o,l,g){var E=y|m;if(g.length){var S=Hn(g,es(zp));E|=b}return An(l,E,o,g,S)});function qp(o,l,g){l=g?t:l;var E=An(o,D,t,t,t,t,t,l);return E.placeholder=qp.placeholder,E}function Up(o,l,g){l=g?t:l;var E=An(o,C,t,t,t,t,t,l);return E.placeholder=Up.placeholder,E}function Wp(o,l,g){var E,S,$,q,W,K,oe=0,ae=!1,fe=!1,ge=!0;if(typeof o!="function")throw new zr(a);l=jr(l)||0,Bt(g)&&(ae=!!g.leading,fe="maxWait"in g,$=fe?Ht(jr(g.maxWait)||0,l):$,ge="trailing"in g?!!g.trailing:ge);function Ae($t){var sn=E,Nn=S;return E=S=t,oe=$t,q=o.apply(Nn,sn),q}function Ne($t){return oe=$t,W=$s(He,l),ae?Ae($t):q}function qe($t){var sn=$t-K,Nn=$t-oe,u1=l-sn;return fe?ir(u1,$-Nn):u1}function Se($t){var sn=$t-K,Nn=$t-oe;return K===t||sn>=l||sn<0||fe&&Nn>=$}function He(){var $t=ma();if(Se($t))return Ke($t);W=$s(He,qe($t))}function Ke($t){return W=t,ge&&E?Ae($t):(E=S=t,q)}function Nr(){W!==t&&Jd(W),oe=0,E=K=S=W=t}function pr(){return W===t?q:Ke(ma())}function Sr(){var $t=ma(),sn=Se($t);if(E=arguments,S=this,K=$t,sn){if(W===t)return Ne(K);if(fe)return Jd(W),W=$s(He,l),Ae(K)}return W===t&&(W=$s(He,l)),q}return Sr.cancel=Nr,Sr.flush=pr,Sr}var l4=Ue(function(o,l){return Od(o,1,l)}),f4=Ue(function(o,l,g){return Od(o,jr(l)||0,g)});function c4(o){return An(o,O)}function xa(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new zr(a);var g=function(){var E=arguments,S=l?l.apply(this,E):E[0],$=g.cache;if($.has(S))return $.get(S);var q=o.apply(this,E);return g.cache=$.set(S,q)||$,q};return g.cache=new(xa.Cache||bn),g}xa.Cache=bn;function ya(o){if(typeof o!="function")throw new zr(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function h4(o){return kp(2,o)}var d4=Jb(function(o,l){l=l.length==1&&Pe(l[0])?At(l[0],Fr(Me())):At(Jt(l,1),Fr(Me()));var g=l.length;return Ue(function(E){for(var S=-1,$=ir(E.length,g);++S<$;)E[S]=l[S].call(this,E[S]);return Cr(o,this,E)})}),rl=Ue(function(o,l){var g=Hn(l,es(rl));return An(o,b,t,l,g)}),Hp=Ue(function(o,l){var g=Hn(l,es(Hp));return An(o,F,t,l,g)}),p4=Cn(function(o,l){return An(o,M,t,t,t,l)});function _4(o,l){if(typeof o!="function")throw new zr(a);return l=l===t?l:ze(l),Ue(o,l)}function v4(o,l){if(typeof o!="function")throw new zr(a);return l=l==null?0:Ht(ze(l),0),Ue(function(g){var E=g[l],S=Gn(g,0,l);return E&&Wn(S,E),Cr(o,this,S)})}function g4(o,l,g){var E=!0,S=!0;if(typeof o!="function")throw new zr(a);return Bt(g)&&(E="leading"in g?!!g.leading:E,S="trailing"in g?!!g.trailing:S),Wp(o,l,{leading:E,maxWait:l,trailing:S})}function m4(o){return Pp(o,1)}function x4(o,l){return rl(z0(l),o)}function y4(){if(!arguments.length)return[];var o=arguments[0];return Pe(o)?o:[o]}function D4(o){return Ur(o,v)}function w4(o,l){return l=typeof l=="function"?l:t,Ur(o,v,l)}function b4(o){return Ur(o,d|v)}function E4(o,l){return l=typeof l=="function"?l:t,Ur(o,d|v,l)}function A4(o,l){return l==null||Sd(o,l,Yt(l))}function nn(o,l){return o===l||o!==o&&l!==l}var C4=ha(B0),F4=ha(function(o,l){return o>=l}),xi=Rd(function(){return arguments}())?Rd:function(o){return Nt(o)&&lt.call(o,"callee")&&!bd.call(o,"callee")},Pe=re.isArray,B4=id?Fr(id):Lb;function yr(o){return o!=null&&Da(o.length)&&!Bn(o)}function Tt(o){return Nt(o)&&yr(o)}function M4(o){return o===!0||o===!1||Nt(o)&&hr(o)==be}var Kn=W2||dl,N4=sd?Fr(sd):Rb;function S4(o){return Nt(o)&&o.nodeType===1&&!Ls(o)}function O4(o){if(o==null)return!0;if(yr(o)&&(Pe(o)||typeof o=="string"||typeof o.splice=="function"||Kn(o)||ts(o)||xi(o)))return!o.length;var l=sr(o);if(l==Le||l==yt)return!o.size;if(Ts(o))return!S0(o).length;for(var g in o)if(lt.call(o,g))return!1;return!0}function I4(o,l){return Ss(o,l)}function T4(o,l,g){g=typeof g=="function"?g:t;var E=g?g(o,l):t;return E===t?Ss(o,l,t,g):!!E}function nl(o){if(!Nt(o))return!1;var l=hr(o);return l==nt||l==Fe||typeof o.message=="string"&&typeof o.name=="string"&&!Ls(o)}function $4(o){return typeof o=="number"&&Ad(o)}function Bn(o){if(!Bt(o))return!1;var l=hr(o);return l==Ye||l==Ie||l==we||l==Rr}function jp(o){return typeof o=="number"&&o==ze(o)}function Da(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=H}function Bt(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Nt(o){return o!=null&&typeof o=="object"}var Yp=od?Fr(od):kb;function L4(o,l){return o===l||N0(o,l,Z0(l))}function R4(o,l,g){return g=typeof g=="function"?g:t,N0(o,l,Z0(l),g)}function P4(o){return Zp(o)&&o!=+o}function k4(o){if(wE(o))throw new Re(i);return Pd(o)}function z4(o){return o===null}function q4(o){return o==null}function Zp(o){return typeof o=="number"||Nt(o)&&hr(o)==xt}function Ls(o){if(!Nt(o)||hr(o)!=Et)return!1;var l=Vo(o);if(l===null)return!0;var g=lt.call(l,"constructor")&&l.constructor;return typeof g=="function"&&g instanceof g&&Ho.call(g)==R2}var il=ad?Fr(ad):zb;function U4(o){return jp(o)&&o>=-H&&o<=H}var Vp=ud?Fr(ud):qb;function wa(o){return typeof o=="string"||!Pe(o)&&Nt(o)&&hr(o)==Ot}function Mr(o){return typeof o=="symbol"||Nt(o)&&hr(o)==P}var ts=ld?Fr(ld):Ub;function W4(o){return o===t}function H4(o){return Nt(o)&&sr(o)==J}function j4(o){return Nt(o)&&hr(o)==ie}var Y4=ha(O0),Z4=ha(function(o,l){return o<=l});function Gp(o){if(!o)return[];if(yr(o))return wa(o)?tn(o):xr(o);if(bs&&o[bs])return A2(o[bs]());var l=sr(o),g=l==Le?x0:l==yt?qo:rs;return g(o)}function Mn(o){if(!o)return o===0?o:0;if(o=jr(o),o===G||o===-G){var l=o<0?-1:1;return l*ee}return o===o?o:0}function ze(o){var l=Mn(o),g=l%1;return l===l?g?l-g:l:0}function Kp(o){return o?_i(ze(o),0,j):0}function jr(o){if(typeof o=="number")return o;if(Mr(o))return te;if(Bt(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Bt(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=_d(o);var g=Qu.test(o);return g||e0.test(o)?u2(o.slice(2),g?2:8):Xu.test(o)?te:+o}function Xp(o){return hn(o,Dr(o))}function V4(o){return o?_i(ze(o),-H,H):o===0?o:0}function at(o){return o==null?"":Br(o)}var G4=Qi(function(o,l){if(Ts(l)||yr(l)){hn(l,Yt(l),o);return}for(var g in l)lt.call(l,g)&&Bs(o,g,l[g])}),Qp=Qi(function(o,l){hn(l,Dr(l),o)}),ba=Qi(function(o,l,g,E){hn(l,Dr(l),o,E)}),K4=Qi(function(o,l,g,E){hn(l,Yt(l),o,E)}),X4=Cn(A0);function Q4(o,l){var g=Xi(o);return l==null?g:Nd(g,l)}var J4=Ue(function(o,l){o=dt(o);var g=-1,E=l.length,S=E>2?l[2]:t;for(S&&dr(l[0],l[1],S)&&(E=1);++g<E;)for(var $=l[g],q=Dr($),W=-1,K=q.length;++W<K;){var oe=q[W],ae=o[oe];(ae===t||nn(ae,Vi[oe])&&!lt.call(o,oe))&&(o[oe]=$[oe])}return o}),eA=Ue(function(o){return o.push(t,_p),Cr(Jp,t,o)});function tA(o,l){return cd(o,Me(l,3),cn)}function rA(o,l){return cd(o,Me(l,3),F0)}function nA(o,l){return o==null?o:C0(o,Me(l,3),Dr)}function iA(o,l){return o==null?o:$d(o,Me(l,3),Dr)}function sA(o,l){return o&&cn(o,Me(l,3))}function oA(o,l){return o&&F0(o,Me(l,3))}function aA(o){return o==null?[]:ia(o,Yt(o))}function uA(o){return o==null?[]:ia(o,Dr(o))}function sl(o,l,g){var E=o==null?t:vi(o,l);return E===t?g:E}function lA(o,l){return o!=null&&mp(o,l,Ob)}function ol(o,l){return o!=null&&mp(o,l,Ib)}var fA=fp(function(o,l,g){l!=null&&typeof l.toString!="function"&&(l=jo.call(l)),o[l]=g},ul(wr)),cA=fp(function(o,l,g){l!=null&&typeof l.toString!="function"&&(l=jo.call(l)),lt.call(o,l)?o[l].push(g):o[l]=[g]},Me),hA=Ue(Ns);function Yt(o){return yr(o)?Bd(o):S0(o)}function Dr(o){return yr(o)?Bd(o,!0):Wb(o)}function dA(o,l){var g={};return l=Me(l,3),cn(o,function(E,S,$){En(g,l(E,S,$),E)}),g}function pA(o,l){var g={};return l=Me(l,3),cn(o,function(E,S,$){En(g,S,l(E,S,$))}),g}var _A=Qi(function(o,l,g){sa(o,l,g)}),Jp=Qi(function(o,l,g,E){sa(o,l,g,E)}),vA=Cn(function(o,l){var g={};if(o==null)return g;var E=!1;l=At(l,function($){return $=Vn($,o),E||(E=$.length>1),$}),hn(o,j0(o),g),E&&(g=Ur(g,d|p|v,fE));for(var S=l.length;S--;)R0(g,l[S]);return g});function gA(o,l){return e1(o,ya(Me(l)))}var mA=Cn(function(o,l){return o==null?{}:jb(o,l)});function e1(o,l){if(o==null)return{};var g=At(j0(o),function(E){return[E]});return l=Me(l),jd(o,g,function(E,S){return l(E,S[0])})}function xA(o,l,g){l=Vn(l,o);var E=-1,S=l.length;for(S||(S=1,o=t);++E<S;){var $=o==null?t:o[dn(l[E])];$===t&&(E=S,$=g),o=Bn($)?$.call(o):$}return o}function yA(o,l,g){return o==null?o:Os(o,l,g)}function DA(o,l,g,E){return E=typeof E=="function"?E:t,o==null?o:Os(o,l,g,E)}var t1=dp(Yt),r1=dp(Dr);function wA(o,l,g){var E=Pe(o),S=E||Kn(o)||ts(o);if(l=Me(l,4),g==null){var $=o&&o.constructor;S?g=E?new $:[]:Bt(o)?g=Bn($)?Xi(Vo(o)):{}:g={}}return(S?kr:cn)(o,function(q,W,K){return l(g,q,W,K)}),g}function bA(o,l){return o==null?!0:R0(o,l)}function EA(o,l,g){return o==null?o:Kd(o,l,z0(g))}function AA(o,l,g,E){return E=typeof E=="function"?E:t,o==null?o:Kd(o,l,z0(g),E)}function rs(o){return o==null?[]:m0(o,Yt(o))}function CA(o){return o==null?[]:m0(o,Dr(o))}function FA(o,l,g){return g===t&&(g=l,l=t),g!==t&&(g=jr(g),g=g===g?g:0),l!==t&&(l=jr(l),l=l===l?l:0),_i(jr(o),l,g)}function BA(o,l,g){return l=Mn(l),g===t?(g=l,l=0):g=Mn(g),o=jr(o),Tb(o,l,g)}function MA(o,l,g){if(g&&typeof g!="boolean"&&dr(o,l,g)&&(l=g=t),g===t&&(typeof l=="boolean"?(g=l,l=t):typeof o=="boolean"&&(g=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Mn(o),l===t?(l=o,o=0):l=Mn(l)),o>l){var E=o;o=l,l=E}if(g||o%1||l%1){var S=Cd();return ir(o+S*(l-o+a2("1e-"+((S+"").length-1))),l)}return T0(o,l)}var NA=Ji(function(o,l,g){return l=l.toLowerCase(),o+(g?n1(l):l)});function n1(o){return al(at(o).toLowerCase())}function i1(o){return o=at(o),o&&o.replace(r0,y2).replace(Xw,"")}function SA(o,l,g){o=at(o),l=Br(l);var E=o.length;g=g===t?E:_i(ze(g),0,E);var S=g;return g-=l.length,g>=0&&o.slice(g,S)==l}function OA(o){return o=at(o),o&&gs.test(o)?o.replace(li,D2):o}function IA(o){return o=at(o),o&&Xt.test(o)?o.replace(zn,"\\$&"):o}var TA=Ji(function(o,l,g){return o+(g?"-":"")+l.toLowerCase()}),$A=Ji(function(o,l,g){return o+(g?" ":"")+l.toLowerCase()}),LA=ap("toLowerCase");function RA(o,l,g){o=at(o),l=ze(l);var E=l?Yi(o):0;if(!l||E>=l)return o;var S=(l-E)/2;return ca(Qo(S),g)+o+ca(Xo(S),g)}function PA(o,l,g){o=at(o),l=ze(l);var E=l?Yi(o):0;return l&&E<l?o+ca(l-E,g):o}function kA(o,l,g){o=at(o),l=ze(l);var E=l?Yi(o):0;return l&&E<l?ca(l-E,g)+o:o}function zA(o,l,g){return g||l==null?l=0:l&&(l=+l),Z2(at(o).replace(mr,""),l||0)}function qA(o,l,g){return(g?dr(o,l,g):l===t)?l=1:l=ze(l),$0(at(o),l)}function UA(){var o=arguments,l=at(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var WA=Ji(function(o,l,g){return o+(g?"_":"")+l.toLowerCase()});function HA(o,l,g){return g&&typeof g!="number"&&dr(o,l,g)&&(l=g=t),g=g===t?j:g>>>0,g?(o=at(o),o&&(typeof l=="string"||l!=null&&!il(l))&&(l=Br(l),!l&&ji(o))?Gn(tn(o),0,g):o.split(l,g)):[]}var jA=Ji(function(o,l,g){return o+(g?" ":"")+al(l)});function YA(o,l,g){return o=at(o),g=g==null?0:_i(ze(g),0,o.length),l=Br(l),o.slice(g,g+l.length)==l}function ZA(o,l,g){var E=T.templateSettings;g&&dr(o,l,g)&&(l=t),o=at(o),l=ba({},l,E,pp);var S=ba({},l.imports,E.imports,pp),$=Yt(S),q=m0(S,$),W,K,oe=0,ae=l.interpolate||qi,fe="__p += '",ge=y0((l.escape||qi).source+"|"+ae.source+"|"+(ae===Pi?Ku:qi).source+"|"+(l.evaluate||qi).source+"|$","g"),Ae="//# sourceURL="+(lt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++r2+"]")+`
11
+ `;o.replace(ge,function(Se,He,Ke,Nr,pr,Sr){return Ke||(Ke=Nr),fe+=o.slice(oe,Sr).replace(fi,w2),He&&(W=!0,fe+=`' +
12
12
  __e(`+He+`) +
13
- '`),pr&&(K=!0,ce+=`';
13
+ '`),pr&&(K=!0,fe+=`';
14
14
  `+pr+`;
15
- __p += '`),Ke&&(ce+=`' +
15
+ __p += '`),Ke&&(fe+=`' +
16
16
  ((__t = (`+Ke+`)) == null ? '' : __t) +
17
- '`),oe=Sr+Se.length,Se}),ce+=`';
18
- `;var Ne=lt.call(l,"variable")&&l.variable;if(!Ne)ce=`with (obj) {
19
- `+ce+`
17
+ '`),oe=Sr+Se.length,Se}),fe+=`';
18
+ `;var Ne=lt.call(l,"variable")&&l.variable;if(!Ne)fe=`with (obj) {
19
+ `+fe+`
20
20
  }
21
- `;else if(Vu.test(Ne))throw new Le(u);ce=(K?ce.replace(rr,""):ce).replace(fr,"$1").replace(en,"$1;"),ce="function("+(Ne||"obj")+`) {
21
+ `;else if(Vu.test(Ne))throw new Re(u);fe=(K?fe.replace(rr,""):fe).replace(cr,"$1").replace(en,"$1;"),fe="function("+(Ne||"obj")+`) {
22
22
  `+(Ne?"":`obj || (obj = {});
23
23
  `)+"var __t, __p = ''"+(W?", __e = _.escape":"")+(K?`, __j = Array.prototype.join;
24
24
  function print() { __p += __j.call(arguments, '') }
25
25
  `:`;
26
- `)+ce+`return __p
27
- }`;var qe=o1(function(){return st($,Ae+"return "+ce).apply(t,q)});if(qe.source=ce,nl(qe))throw qe;return qe}function VA(o){return at(o).toLowerCase()}function GA(o){return at(o).toUpperCase()}function KA(o,l,g){if(o=at(o),o&&(g||l===t))return _d(o);if(!o||!(l=Br(l)))return o;var E=tn(o),S=tn(l),$=vd(E,S),q=gd(E,S)+1;return Gn(E,$,q).join("")}function XA(o,l,g){if(o=at(o),o&&(g||l===t))return o.slice(0,xd(o)+1);if(!o||!(l=Br(l)))return o;var E=tn(o),S=gd(E,tn(l))+1;return Gn(E,0,S).join("")}function QA(o,l,g){if(o=at(o),o&&(g||l===t))return o.replace(mr,"");if(!o||!(l=Br(l)))return o;var E=tn(o),S=vd(E,tn(l));return Gn(E,S).join("")}function JA(o,l){var g=A,E=N;if(Bt(l)){var S="separator"in l?l.separator:S;g="length"in l?ze(l.length):g,E="omission"in l?Br(l.omission):E}o=at(o);var $=o.length;if(ji(o)){var q=tn(o);$=q.length}if(g>=$)return o;var W=g-Yi(E);if(W<1)return E;var K=q?Gn(q,0,W).join(""):o.slice(0,W);if(S===t)return K+E;if(q&&(W+=K.length-W),il(S)){if(o.slice(W).search(S)){var oe,ae=K;for(S.global||(S=y0(S.source,at(Ro.exec(S))+"g")),S.lastIndex=0;oe=S.exec(ae);)var ce=oe.index;K=K.slice(0,ce===t?W:ce)}}else if(o.indexOf(Br(S),W)!=W){var ge=K.lastIndexOf(S);ge>-1&&(K=K.slice(0,ge))}return K+E}function eC(o){return o=at(o),o&&vs.test(o)?o.replace(Dn,M2):o}var tC=Ji(function(o,l,g){return o+(g?" ":"")+l.toUpperCase()}),al=ap("toUpperCase");function s1(o,l,g){return o=at(o),l=g?t:l,l===t?E2(o)?O2(o):_2(o):o.match(l)||[]}var o1=Ue(function(o,l){try{return Cr(o,t,l)}catch(g){return nl(g)?g:new Le(g)}}),rC=Cn(function(o,l){return kr(l,function(g){g=dn(g),En(o,g,tl(o[g],o))}),o});function nC(o){var l=o==null?0:o.length,g=Me();return o=l?At(o,function(E){if(typeof E[1]!="function")throw new zr(a);return[g(E[0]),E[1]]}):[],Ue(function(E){for(var S=-1;++S<l;){var $=o[S];if(Cr($[0],this,E))return Cr($[1],this,E)}})}function iC(o){return Mb(Ur(o,d))}function ul(o){return function(){return o}}function sC(o,l){return o==null||o!==o?l:o}var oC=lp(),aC=lp(!0);function wr(o){return o}function ll(o){return kd(typeof o=="function"?o:Ur(o,d))}function uC(o){return qd(Ur(o,d))}function lC(o,l){return Ud(o,Ur(l,d))}var cC=Ue(function(o,l){return function(g){return Ns(g,o,l)}}),fC=Ue(function(o,l){return function(g){return Ns(o,g,l)}});function cl(o,l,g){var E=Yt(l),S=ia(l,E);g==null&&!(Bt(l)&&(S.length||!E.length))&&(g=l,l=o,o=this,S=ia(l,Yt(l)));var $=!(Bt(g)&&"chain"in g)||!!g.chain,q=Bn(o);return kr(S,function(W){var K=l[W];o[W]=K,q&&(o.prototype[W]=function(){var oe=this.__chain__;if($||oe){var ae=o(this.__wrapped__),ce=ae.__actions__=xr(this.__actions__);return ce.push({func:K,args:arguments,thisArg:o}),ae.__chain__=oe,ae}return K.apply(o,Wn([this.value()],arguments))})}),o}function hC(){return Qt._===this&&(Qt._=P2),this}function fl(){}function dC(o){return o=ze(o),Ue(function(l){return Wd(l,o)})}var pC=U0(At),_C=U0(cd),vC=U0(d0);function a1(o){return G0(o)?p0(dn(o)):Yb(o)}function gC(o){return function(l){return o==null?t:vi(o,l)}}var mC=fp(),xC=fp(!0);function hl(){return[]}function dl(){return!1}function yC(){return{}}function DC(){return""}function wC(){return!0}function bC(o,l){if(o=ze(o),o<1||o>H)return[];var g=j,E=ir(o,j);l=Me(l),o-=j;for(var S=g0(E,l);++g<o;)l(g);return S}function EC(o){return Pe(o)?At(o,dn):Mr(o)?[o]:xr(Fp(at(o)))}function AC(o){var l=++R2;return at(o)+l}var CC=ca(function(o,l){return o+l},0),FC=W0("ceil"),BC=ca(function(o,l){return o/l},1),MC=W0("floor");function NC(o){return o&&o.length?na(o,wr,B0):t}function SC(o,l){return o&&o.length?na(o,Me(l,2),B0):t}function OC(o){return dd(o,wr)}function IC(o,l){return dd(o,Me(l,2))}function TC(o){return o&&o.length?na(o,wr,O0):t}function $C(o,l){return o&&o.length?na(o,Me(l,2),O0):t}var RC=ca(function(o,l){return o*l},1),LC=W0("round"),PC=ca(function(o,l){return o-l},0);function kC(o){return o&&o.length?v0(o,wr):0}function zC(o,l){return o&&o.length?v0(o,Me(l,2)):0}return T.after=u4,T.ary=Pp,T.assign=G4,T.assignIn=Qp,T.assignInWith=ba,T.assignWith=K4,T.at=X4,T.before=kp,T.bind=tl,T.bindAll=rC,T.bindKey=zp,T.castArray=y4,T.chain=$p,T.chunk=ME,T.compact=NE,T.concat=SE,T.cond=nC,T.conforms=iC,T.constant=ul,T.countBy=k8,T.create=Q4,T.curry=qp,T.curryRight=Up,T.debounce=Wp,T.defaults=J4,T.defaultsDeep=eA,T.defer=l4,T.delay=c4,T.difference=OE,T.differenceBy=IE,T.differenceWith=TE,T.drop=$E,T.dropRight=RE,T.dropRightWhile=LE,T.dropWhile=PE,T.fill=kE,T.filter=q8,T.flatMap=H8,T.flatMapDeep=j8,T.flatMapDepth=Y8,T.flatten=Sp,T.flattenDeep=zE,T.flattenDepth=qE,T.flip=f4,T.flow=oC,T.flowRight=aC,T.fromPairs=UE,T.functions=aA,T.functionsIn=uA,T.groupBy=Z8,T.initial=HE,T.intersection=jE,T.intersectionBy=YE,T.intersectionWith=ZE,T.invert=cA,T.invertBy=fA,T.invokeMap=G8,T.iteratee=ll,T.keyBy=K8,T.keys=Yt,T.keysIn=Dr,T.map=ga,T.mapKeys=dA,T.mapValues=pA,T.matches=uC,T.matchesProperty=lC,T.memoize=xa,T.merge=_A,T.mergeWith=Jp,T.method=cC,T.methodOf=fC,T.mixin=cl,T.negate=ya,T.nthArg=dC,T.omit=vA,T.omitBy=gA,T.once=h4,T.orderBy=X8,T.over=pC,T.overArgs=d4,T.overEvery=_C,T.overSome=vC,T.partial=rl,T.partialRight=Hp,T.partition=Q8,T.pick=mA,T.pickBy=e1,T.property=a1,T.propertyOf=gC,T.pull=XE,T.pullAll=Ip,T.pullAllBy=QE,T.pullAllWith=JE,T.pullAt=e8,T.range=mC,T.rangeRight=xC,T.rearg=p4,T.reject=t4,T.remove=t8,T.rest=_4,T.reverse=J0,T.sampleSize=n4,T.set=yA,T.setWith=DA,T.shuffle=i4,T.slice=r8,T.sortBy=a4,T.sortedUniq=l8,T.sortedUniqBy=c8,T.split=HA,T.spread=v4,T.tail=f8,T.take=h8,T.takeRight=d8,T.takeRightWhile=p8,T.takeWhile=_8,T.tap=N8,T.throttle=g4,T.thru=va,T.toArray=Gp,T.toPairs=t1,T.toPairsIn=r1,T.toPath=EC,T.toPlainObject=Xp,T.transform=wA,T.unary=m4,T.union=v8,T.unionBy=g8,T.unionWith=m8,T.uniq=x8,T.uniqBy=y8,T.uniqWith=D8,T.unset=bA,T.unzip=el,T.unzipWith=Tp,T.update=EA,T.updateWith=AA,T.values=rs,T.valuesIn=CA,T.without=w8,T.words=s1,T.wrap=x4,T.xor=b8,T.xorBy=E8,T.xorWith=A8,T.zip=C8,T.zipObject=F8,T.zipObjectDeep=B8,T.zipWith=M8,T.entries=t1,T.entriesIn=r1,T.extend=Qp,T.extendWith=ba,cl(T,T),T.add=CC,T.attempt=o1,T.camelCase=NA,T.capitalize=n1,T.ceil=FC,T.clamp=FA,T.clone=D4,T.cloneDeep=b4,T.cloneDeepWith=E4,T.cloneWith=w4,T.conformsTo=A4,T.deburr=i1,T.defaultTo=sC,T.divide=BC,T.endsWith=SA,T.eq=nn,T.escape=OA,T.escapeRegExp=IA,T.every=z8,T.find=U8,T.findIndex=Mp,T.findKey=tA,T.findLast=W8,T.findLastIndex=Np,T.findLastKey=rA,T.floor=MC,T.forEach=Rp,T.forEachRight=Lp,T.forIn=nA,T.forInRight=iA,T.forOwn=sA,T.forOwnRight=oA,T.get=sl,T.gt=C4,T.gte=F4,T.has=lA,T.hasIn=ol,T.head=Op,T.identity=wr,T.includes=V8,T.indexOf=WE,T.inRange=BA,T.invoke=hA,T.isArguments=xi,T.isArray=Pe,T.isArrayBuffer=B4,T.isArrayLike=yr,T.isArrayLikeObject=Tt,T.isBoolean=M4,T.isBuffer=Kn,T.isDate=N4,T.isElement=S4,T.isEmpty=O4,T.isEqual=I4,T.isEqualWith=T4,T.isError=nl,T.isFinite=$4,T.isFunction=Bn,T.isInteger=jp,T.isLength=Da,T.isMap=Yp,T.isMatch=R4,T.isMatchWith=L4,T.isNaN=P4,T.isNative=k4,T.isNil=q4,T.isNull=z4,T.isNumber=Zp,T.isObject=Bt,T.isObjectLike=Nt,T.isPlainObject=Rs,T.isRegExp=il,T.isSafeInteger=U4,T.isSet=Vp,T.isString=wa,T.isSymbol=Mr,T.isTypedArray=ts,T.isUndefined=W4,T.isWeakMap=H4,T.isWeakSet=j4,T.join=VE,T.kebabCase=TA,T.last=Hr,T.lastIndexOf=GE,T.lowerCase=$A,T.lowerFirst=RA,T.lt=Y4,T.lte=Z4,T.max=NC,T.maxBy=SC,T.mean=OC,T.meanBy=IC,T.min=TC,T.minBy=$C,T.stubArray=hl,T.stubFalse=dl,T.stubObject=yC,T.stubString=DC,T.stubTrue=wC,T.multiply=RC,T.nth=KE,T.noConflict=hC,T.noop=fl,T.now=ma,T.pad=LA,T.padEnd=PA,T.padStart=kA,T.parseInt=zA,T.random=MA,T.reduce=J8,T.reduceRight=e4,T.repeat=qA,T.replace=UA,T.result=xA,T.round=LC,T.runInContext=Z,T.sample=r4,T.size=s4,T.snakeCase=WA,T.some=o4,T.sortedIndex=n8,T.sortedIndexBy=i8,T.sortedIndexOf=s8,T.sortedLastIndex=o8,T.sortedLastIndexBy=a8,T.sortedLastIndexOf=u8,T.startCase=jA,T.startsWith=YA,T.subtract=PC,T.sum=kC,T.sumBy=zC,T.template=ZA,T.times=bC,T.toFinite=Mn,T.toInteger=ze,T.toLength=Kp,T.toLower=VA,T.toNumber=jr,T.toSafeInteger=V4,T.toString=at,T.toUpper=GA,T.trim=KA,T.trimEnd=XA,T.trimStart=QA,T.truncate=JA,T.unescape=eC,T.uniqueId=AC,T.upperCase=tC,T.upperFirst=al,T.each=Rp,T.eachRight=Lp,T.first=Op,cl(T,function(){var o={};return fn(T,function(l,g){lt.call(T.prototype,g)||(o[g]=l)}),o}(),{chain:!1}),T.VERSION=r,kr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),kr(["drop","take"],function(o,l){Ze.prototype[o]=function(g){g=g===t?1:Ht(ze(g),0);var E=this.__filtered__&&!l?new Ze(this):this.clone();return E.__filtered__?E.__takeCount__=ir(g,E.__takeCount__):E.__views__.push({size:ir(g,j),type:o+(E.__dir__<0?"Right":"")}),E},Ze.prototype[o+"Right"]=function(g){return this.reverse()[o](g).reverse()}}),kr(["filter","map","takeWhile"],function(o,l){var g=l+1,E=g==k||g==L;Ze.prototype[o]=function(S){var $=this.clone();return $.__iteratees__.push({iteratee:Me(S,3),type:g}),$.__filtered__=$.__filtered__||E,$}}),kr(["head","last"],function(o,l){var g="take"+(l?"Right":"");Ze.prototype[o]=function(){return this[g](1).value()[0]}}),kr(["initial","tail"],function(o,l){var g="drop"+(l?"":"Right");Ze.prototype[o]=function(){return this.__filtered__?new Ze(this):this[g](1)}}),Ze.prototype.compact=function(){return this.filter(wr)},Ze.prototype.find=function(o){return this.filter(o).head()},Ze.prototype.findLast=function(o){return this.reverse().find(o)},Ze.prototype.invokeMap=Ue(function(o,l){return typeof o=="function"?new Ze(this):this.map(function(g){return Ns(g,o,l)})}),Ze.prototype.reject=function(o){return this.filter(ya(Me(o)))},Ze.prototype.slice=function(o,l){o=ze(o);var g=this;return g.__filtered__&&(o>0||l<0)?new Ze(g):(o<0?g=g.takeRight(-o):o&&(g=g.drop(o)),l!==t&&(l=ze(l),g=l<0?g.dropRight(-l):g.take(l-o)),g)},Ze.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ze.prototype.toArray=function(){return this.take(j)},fn(Ze.prototype,function(o,l){var g=/^(?:filter|find|map|reject)|While$/.test(l),E=/^(?:head|last)$/.test(l),S=T[E?"take"+(l=="last"?"Right":""):l],$=E||/^find/.test(l);S&&(T.prototype[l]=function(){var q=this.__wrapped__,W=E?[1]:arguments,K=q instanceof Ze,oe=W[0],ae=K||Pe(q),ce=function(He){var Ke=S.apply(T,Wn([He],W));return E&&ge?Ke[0]:Ke};ae&&g&&typeof oe=="function"&&oe.length!=1&&(K=ae=!1);var ge=this.__chain__,Ae=!!this.__actions__.length,Ne=$&&!ge,qe=K&&!Ae;if(!$&&ae){q=qe?q:new Ze(this);var Se=o.apply(q,W);return Se.__actions__.push({func:va,args:[ce],thisArg:t}),new qr(Se,ge)}return Ne&&qe?o.apply(this,W):(Se=this.thru(ce),Ne?E?Se.value()[0]:Se.value():Se)})}),kr(["pop","push","shift","sort","splice","unshift"],function(o){var l=Uo[o],g=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",E=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var S=arguments;if(E&&!this.__chain__){var $=this.value();return l.apply(Pe($)?$:[],S)}return this[g](function(q){return l.apply(Pe(q)?q:[],S)})}}),fn(Ze.prototype,function(o,l){var g=T[l];if(g){var E=g.name+"";lt.call(Ki,E)||(Ki[E]=[]),Ki[E].push({name:l,func:g})}}),Ki[la(t,m).name]=[{name:"wrapper",func:t}],Ze.prototype.clone=eb,Ze.prototype.reverse=tb,Ze.prototype.value=rb,T.prototype.at=S8,T.prototype.chain=O8,T.prototype.commit=I8,T.prototype.next=T8,T.prototype.plant=R8,T.prototype.reverse=L8,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=P8,T.prototype.first=T.prototype.head,bs&&(T.prototype[bs]=$8),T},Zi=I2();fi?((fi.exports=Zi)._=Zi,l0._=Zi):Qt._=Zi}).call(ye)}(Xn,Xn.exports);var Yr=Xn.exports;class l1{constructor(e,t){U(this,"_defaultParams");U(this,"_UserTypeFileds");U(this,"_varipKeys");this._defaultParams=e,this._UserTypeFileds=this._createDynamicClass(),this._varipKeys=t}copy(e){return Yr.cloneDeep(e)}new(e={}){return new this._UserTypeFileds(Object.assign(Yr.cloneDeep(this._defaultParams),e),this._varipKeys)}addNewMethod(e,t){this._UserTypeFileds.prototype[e]=t}_createDynamicClass(){return class{constructor(e,t){U(this,"_varipKeys");Object.assign(this,e),this._varipKeys=t}get varipKeys(){return[...this._varipKeys]}copy(){return Yr.cloneDeep(this)}}}}var ml={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t=1e3,r=6e4,n=36e5,i="millisecond",a="second",u="minute",f="hour",c="day",h="week",d="month",p="quarter",v="year",x="date",_="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var z=["th","st","nd","rd"],L=k%100;return"["+k+(z[(L-20)%10]||z[L]||z[0])+"]"}},D=function(k,z,L){var G=String(k);return!G||G.length>=z?k:""+Array(z+1-G.length).join(L)+k},C={s:D,z:function(k){var z=-k.utcOffset(),L=Math.abs(z),G=Math.floor(L/60),H=L%60;return(z<=0?"+":"-")+D(G,2,"0")+":"+D(H,2,"0")},m:function k(z,L){if(z.date()<L.date())return-k(L,z);var G=12*(L.year()-z.year())+(L.month()-z.month()),H=z.clone().add(G,d),ee=L-H<0,te=z.clone().add(G+(ee?-1:1),d);return+(-(G+(L-H)/(ee?H-te:te-H))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:d,y:v,w:h,d:c,D:x,h:f,m:u,s:a,ms:i,Q:p}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},b="en",F={};F[b]=w;var B="$isDayjsObject",M=function(k){return k instanceof I||!(!k||!k[B])},O=function k(z,L,G){var H;if(!z)return b;if(typeof z=="string"){var ee=z.toLowerCase();F[ee]&&(H=ee),L&&(F[ee]=L,H=ee);var te=z.split("-");if(!H&&te.length>1)return k(te[0])}else{var j=z.name;F[j]=z,H=j}return!G&&H&&(b=H),H||!G&&b},A=function(k,z){if(M(k))return k.clone();var L=typeof z=="object"?z:{};return L.date=k,L.args=arguments,new I(L)},N=C;N.l=O,N.i=M,N.w=function(k,z){return A(k,{locale:z.$L,utc:z.$u,x:z.$x,$offset:z.$offset})};var I=function(){function k(L){this.$L=O(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[B]=!0}var z=k.prototype;return z.parse=function(L){this.$d=function(G){var H=G.date,ee=G.utc;if(H===null)return new Date(NaN);if(N.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var te=H.match(y);if(te){var j=te[2]-1||0,X=(te[7]||"0").substring(0,3);return ee?new Date(Date.UTC(te[1],j,te[3]||1,te[4]||0,te[5]||0,te[6]||0,X)):new Date(te[1],j,te[3]||1,te[4]||0,te[5]||0,te[6]||0,X)}}return new Date(H)}(L),this.init()},z.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},z.$utils=function(){return N},z.isValid=function(){return this.$d.toString()!==_},z.isSame=function(L,G){var H=A(L);return this.startOf(G)<=H&&H<=this.endOf(G)},z.isAfter=function(L,G){return A(L)<this.startOf(G)},z.isBefore=function(L,G){return this.endOf(G)<A(L)},z.$g=function(L,G,H){return N.u(L)?this[G]:this.set(H,L)},z.unix=function(){return Math.floor(this.valueOf()/1e3)},z.valueOf=function(){return this.$d.getTime()},z.startOf=function(L,G){var H=this,ee=!!N.u(G)||G,te=N.p(L),j=function(Oe,Fe){var nt=N.w(H.$u?Date.UTC(H.$y,Fe,Oe):new Date(H.$y,Fe,Oe),H);return ee?nt:nt.endOf(c)},X=function(Oe,Fe){return N.w(H.toDate()[Oe].apply(H.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(Fe)),H)},Y=this.$W,Q=this.$M,pe=this.$D,De="set"+(this.$u?"UTC":"");switch(te){case v:return ee?j(1,0):j(31,11);case d:return ee?j(1,Q):j(0,Q+1);case h:var we=this.$locale().weekStart||0,be=(Y<we?Y+7:Y)-we;return j(ee?pe-be:pe+(6-be),Q);case c:case x:return X(De+"Hours",0);case f:return X(De+"Minutes",1);case u:return X(De+"Seconds",2);case a:return X(De+"Milliseconds",3);default:return this.clone()}},z.endOf=function(L){return this.startOf(L,!1)},z.$set=function(L,G){var H,ee=N.p(L),te="set"+(this.$u?"UTC":""),j=(H={},H[c]=te+"Date",H[x]=te+"Date",H[d]=te+"Month",H[v]=te+"FullYear",H[f]=te+"Hours",H[u]=te+"Minutes",H[a]=te+"Seconds",H[i]=te+"Milliseconds",H)[ee],X=ee===c?this.$D+(G-this.$W):G;if(ee===d||ee===v){var Y=this.clone().set(x,1);Y.$d[j](X),Y.init(),this.$d=Y.set(x,Math.min(this.$D,Y.daysInMonth())).$d}else j&&this.$d[j](X);return this.init(),this},z.set=function(L,G){return this.clone().$set(L,G)},z.get=function(L){return this[N.p(L)]()},z.add=function(L,G){var H,ee=this;L=Number(L);var te=N.p(G),j=function(Q){var pe=A(ee);return N.w(pe.date(pe.date()+Math.round(Q*L)),ee)};if(te===d)return this.set(d,this.$M+L);if(te===v)return this.set(v,this.$y+L);if(te===c)return j(1);if(te===h)return j(7);var X=(H={},H[u]=r,H[f]=n,H[a]=t,H)[te]||1,Y=this.$d.getTime()+L*X;return N.w(Y,this)},z.subtract=function(L,G){return this.add(-1*L,G)},z.format=function(L){var G=this,H=this.$locale();if(!this.isValid())return H.invalidDate||_;var ee=L||"YYYY-MM-DDTHH:mm:ssZ",te=N.z(this),j=this.$H,X=this.$m,Y=this.$M,Q=H.weekdays,pe=H.months,De=H.meridiem,we=function(Fe,nt,Ye,Ie){return Fe&&(Fe[nt]||Fe(G,ee))||Ye[nt].slice(0,Ie)},be=function(Fe){return N.s(j%12||12,Fe,"0")},Oe=De||function(Fe,nt,Ye){var Ie=Fe<12?"AM":"PM";return Ye?Ie.toLowerCase():Ie};return ee.replace(m,function(Fe,nt){return nt||function(Ye){switch(Ye){case"YY":return String(G.$y).slice(-2);case"YYYY":return N.s(G.$y,4,"0");case"M":return Y+1;case"MM":return N.s(Y+1,2,"0");case"MMM":return we(H.monthsShort,Y,pe,3);case"MMMM":return we(pe,Y);case"D":return G.$D;case"DD":return N.s(G.$D,2,"0");case"d":return String(G.$W);case"dd":return we(H.weekdaysMin,G.$W,Q,2);case"ddd":return we(H.weekdaysShort,G.$W,Q,3);case"dddd":return Q[G.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return be(1);case"hh":return be(2);case"a":return Oe(j,X,!0);case"A":return Oe(j,X,!1);case"m":return String(X);case"mm":return N.s(X,2,"0");case"s":return String(G.$s);case"ss":return N.s(G.$s,2,"0");case"SSS":return N.s(G.$ms,3,"0");case"Z":return te}return null}(Fe)||te.replace(":","")})},z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},z.diff=function(L,G,H){var ee,te=this,j=N.p(G),X=A(L),Y=(X.utcOffset()-this.utcOffset())*r,Q=this-X,pe=function(){return N.m(te,X)};switch(j){case v:ee=pe()/12;break;case d:ee=pe();break;case p:ee=pe()/3;break;case h:ee=(Q-Y)/6048e5;break;case c:ee=(Q-Y)/864e5;break;case f:ee=Q/n;break;case u:ee=Q/r;break;case a:ee=Q/t;break;default:ee=Q}return H?ee:N.a(ee)},z.daysInMonth=function(){return this.endOf(d).$D},z.$locale=function(){return F[this.$L]},z.locale=function(L,G){if(!L)return this.$L;var H=this.clone(),ee=O(L,G,!0);return ee&&(H.$L=ee),H},z.clone=function(){return N.w(this.$d,this)},z.toDate=function(){return new Date(this.valueOf())},z.toJSON=function(){return this.isValid()?this.toISOString():null},z.toISOString=function(){return this.$d.toISOString()},z.toString=function(){return this.$d.toUTCString()},k}(),R=I.prototype;return A.prototype=R,[["$ms",i],["$s",a],["$m",u],["$H",f],["$W",c],["$M",d],["$y",v],["$D",x]].forEach(function(k){R[k[1]]=function(z){return this.$g(z,k[0],k[1])}}),A.extend=function(k,z){return k.$i||(k(z,I,A),k.$i=!0),A},A.locale=O,A.isDayjs=M,A.unix=function(k){return A(1e3*k)},A.en=F[b],A.Ls=F,A.p={},A})})(ml);var c1=ml.exports,ot=tt(c1),xl={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t="minute",r=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(i,a,u){var f=a.prototype;u.utc=function(_){var y={date:_,utc:!0,args:arguments};return new a(y)},f.utc=function(_){var y=u(this.toDate(),{locale:this.$L,utc:!0});return _?y.add(this.utcOffset(),t):y},f.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var c=f.parse;f.parse=function(_){_.utc&&(this.$u=!0),this.$utils().u(_.$offset)||(this.$offset=_.$offset),c.call(this,_)};var h=f.init;f.init=function(){if(this.$u){var _=this.$d;this.$y=_.getUTCFullYear(),this.$M=_.getUTCMonth(),this.$D=_.getUTCDate(),this.$W=_.getUTCDay(),this.$H=_.getUTCHours(),this.$m=_.getUTCMinutes(),this.$s=_.getUTCSeconds(),this.$ms=_.getUTCMilliseconds()}else h.call(this)};var d=f.utcOffset;f.utcOffset=function(_,y){var m=this.$utils().u;if(m(_))return this.$u?0:m(this.$offset)?d.call(this):this.$offset;if(typeof _=="string"&&(_=function(b){b===void 0&&(b="");var F=b.match(r);if(!F)return null;var B=(""+F[0]).match(n)||["-",0,0],M=B[0],O=60*+B[1]+ +B[2];return O===0?0:M==="+"?O:-O}(_),_===null))return this;var w=Math.abs(_)<=16?60*_:_,D=this;if(y)return D.$offset=w,D.$u=_===0,D;if(_!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(D=this.local().add(w+C,t)).$offset=w,D.$x.$localOffset=C}else D=this.utc();return D};var p=f.format;f.format=function(_){var y=_||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,y)},f.valueOf=function(){var _=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*_},f.isUTC=function(){return!!this.$u},f.toISOString=function(){return this.toDate().toISOString()},f.toString=function(){return this.toDate().toUTCString()};var v=f.toDate;f.toDate=function(_){return _==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var x=f.diff;f.diff=function(_,y,m){if(_&&this.$u===_.$u)return x.call(this,_,y,m);var w=this.local(),D=u(_).local();return x.call(w,D,y,m)}}})})(xl);var f1=xl.exports,yl=tt(f1),Dl={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(n,i,a){var u,f=function(p,v,x){x===void 0&&(x={});var _=new Date(p),y=function(m,w){w===void 0&&(w={});var D=w.timeZoneName||"short",C=m+"|"+D,b=r[C];return b||(b=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:m,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:D}),r[C]=b),b}(v,x);return y.formatToParts(_)},c=function(p,v){for(var x=f(p,v),_=[],y=0;y<x.length;y+=1){var m=x[y],w=m.type,D=m.value,C=t[w];C>=0&&(_[C]=parseInt(D,10))}var b=_[3],F=b===24?0:b,B=_[0]+"-"+_[1]+"-"+_[2]+" "+F+":"+_[4]+":"+_[5]+":000",M=+p;return(a.utc(B).valueOf()-(M-=M%1e3))/6e4},h=i.prototype;h.tz=function(p,v){p===void 0&&(p=u);var x=this.utcOffset(),_=this.toDate(),y=_.toLocaleString("en-US",{timeZone:p}),m=Math.round((_-new Date(y))/1e3/60),w=a(y,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(_.getTimezoneOffset()/15)-m,!0);if(v){var D=w.utcOffset();w=w.add(x-D,"minute")}return w.$x.$timezone=p,w},h.offsetName=function(p){var v=this.$x.$timezone||a.tz.guess(),x=f(this.valueOf(),v,{timeZoneName:p}).find(function(_){return _.type.toLowerCase()==="timezonename"});return x&&x.value};var d=h.startOf;h.startOf=function(p,v){if(!this.$x||!this.$x.$timezone)return d.call(this,p,v);var x=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(x,p,v).tz(this.$x.$timezone,!0)},a.tz=function(p,v,x){var _=x&&v,y=x||v||u,m=c(+a(),y);if(typeof p!="string")return a(p).tz(y);var w=function(F,B,M){var O=F-60*B*1e3,A=c(O,M);if(B===A)return[O,B];var N=c(O-=60*(A-B)*1e3,M);return A===N?[O,A]:[F-60*Math.min(A,N)*1e3,Math.max(A,N)]}(a.utc(p,_).valueOf(),m,y),D=w[0],C=w[1],b=a(D).utcOffset(C);return b.$x.$timezone=y,b},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(p){u=p}}})})(Dl);var h1=Dl.exports,d1=tt(h1),wl={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t="week",r="year";return function(n,i,a){var u=i.prototype;u.week=function(f){if(f===void 0&&(f=null),f!==null)return this.add(7*(f-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=a(this).startOf(r).add(1,r).date(c),d=a(this).endOf(t);if(h.isBefore(d))return 1}var p=a(this).startOf(r).date(c).startOf(t).subtract(1,"millisecond"),v=this.diff(p,t,!0);return v<0?a(this).startOf("week").week():Math.ceil(v)},u.weeks=function(f){return f===void 0&&(f=null),this.week(f)}}})})(wl);var p1=wl.exports,_1=tt(p1);function or(s,e){return s.replace(/\$(\w+)/g,(t,r)=>String(e[r])||t)}function Ls(s){const e=parseInt(s)||1;let t=s.replace(/\d+/,"");return t==="m"||t==="M"?t="M":t?t=t.toLocaleLowerCase():t="m",[e,t]}function v1(s){const e=/([+-])(\d{1,2})(\d{0,2})/,t=s.replace(/GMT|UTC/,"").match(e);if(!t)throw new Error("Invalid timezone string");const[,r,n,i]=t,a=parseInt(n,10)*60||0,u=parseInt(i,10)||0;return(r==="+"?-1:1)*(a+u)}function Zr(s,e){return e&&(e.startsWith("UTC")||e.startsWith("GMT"))?ot(s).utcOffset(v1(e)):ot(s).tz(e)}function pn(s){const[e,t]=Ls(s);let r=0;switch(t){case"m":r=60;break;case"s":r=1;break;case"M":r=31*24*60*60;break;case"d":r=24*60*60;break;case"w":r=7*24*60*60;break;default:r=60*60;break}return Math.round(Number(e)*r)}function me(s){return typeof s!="number"||isNaN(s)}var an=(s=>(s.BOOL="bool",s.INT="int",s.FLOAT="float",s.ARRAY="array",s.BOX="box",s.CHART_POINT="chart.point",s.COLOR="color",s.CONST="const",s.LABEL="label",s.LINE="line",s.LINEFILL="linefill",s.MAP="map",s.MATRIX="matrix",s.POLYLINE="polyline",s.SERIES="series",s.SIMPLE="simple",s.STRING="string",s.TABLE="table",s.UNDETERMINED="undetermined type",s.INPUT="input",s.NA="na",s.VOID="void",s.ENUM="enum",s))(an||{}),Ps=(s=>(s.dividends="dividends",s.none="none",s.splits="splits",s))(Ps||{}),Vr=(s=>(s.freqAll="freq_all",s.freqOncePerBar="freq_once_per_bar",s.freqOncePerBarClose="freq_once_per_bar_close",s))(Vr||{}),ns=(s=>(s.gapsOff="gaps_off",s.gapsOn="gaps_on",s.lookaheadOff="lookahead_off",s.lookaheadOn="lookahead_on",s))(ns||{}),Zt=(s=>(s.all="all",s.dataWindow="data_window",s.none="none",s.pane="pane",s.priceScale="price_scale",s.statusLine="status_line",s))(Zt||{}),Gr=(s=>(s.both="both",s.left="left",s.none="none",s.right="right",s))(Gr||{}),Je=(s=>(s.inherit="inherit",s.mintick="mintick",s.percent="percent",s.price="price",s.volume="volume",s))(Je||{}),ks=(s=>(s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid",s))(ks||{}),vt=(s=>(s.styleArrowdown="style_arrowdown",s.styleArrowup="style_arrowup",s.styleCircle="style_circle",s.styleCross="style_cross",s.styleDiamond="style_diamond",s.styleFlag="style_flag",s.styleLabelCenter="style_label_center",s.styleLabelDown="style_label_down",s.styleLabelLeft="style_label_left",s.styleLabelLowerLeft="style_label_lower_left",s.styleLabelLowerRight="style_label_lower_right",s.styleLabelRight="style_label_right",s.styleLabelUp="style_label_up",s.styleLabelUpperLeft="style_label_upper_left",s.styleLabelUpperRight="style_label_upper_right",s.styleNone="style_none",s.styleSquare="style_square",s.styleTextOutline="style_text_outline",s.styleTriangledown="style_triangledown",s.styleTriangleup="style_triangleup",s.styleXcross="style_xcross",s))(vt||{}),zt=(s=>(s.styleArrowBoth="style_arrow_both",s.styleArrowLeft="style_arrow_left",s.styleArrowRight="style_arrow_right",s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid",s))(zt||{}),_n=(s=>(s.abovebar="abovebar",s.absolute="absolute",s.belowbar="belowbar",s.bottom="bottom",s.top="top",s))(_n||{}),Qn=(s=>(s.ascending="ascending",s.descending="descending",s))(Qn||{}),Or=(s=>(s.styleArea="Area",s.styleAreabr="Area With Breaks",s.styleCircles="Circles",s.styleColumns="Columns",s.styleCross="Cross",s.styleHistogram="Histogram",s.styleLine="Line",s.styleLinebr="Line With Breaks",s.styleStepline="Step Line",s.styleSteplineDiamond="Step Line With Diamonds",s.styleSteplinebr="Step line with Breaks",s))(Or||{}),br=(s=>(s.bottomCenter="bottom_center",s.bottomLeft="bottom_left",s.bottomRight="bottom_right",s.middleCenter="middle_center",s.middleLeft="middle_left",s.middleRight="middle_right",s.topCenter="top_center",s.topLeft="top_left",s.topRight="top_right",s))(br||{}),zs=(s=>(s.left="left",s.none="none",s.right="right",s))(zs||{}),qs=(s=>(s.extended="extended",s.regular="regular",s))(qs||{}),_r=(s=>(s.arrowdown="arrowdown",s.arrowup="arrowup",s.circle="circle",s.cross="cross",s.diamond="diamond",s.flag="flag",s.labeldown="labeldown",s.labelup="labelup",s.square="square",s.triangledown="triangledown",s.triangleup="triangleup",s.xcross="xcross",s))(_r||{}),ar=(s=>(s.auto="auto",s.huge="huge",s.large="large",s.normal="normal",s.small="small",s.tiny="tiny",s))(ar||{}),Jn=(s=>(s.familyDefault="default",s.familyMonospace="monospace",s))(Jn||{}),Rt=(s=>(s.cash="cash",s.fixed="fixed",s.percentOfEquity="percent_of_equity",s))(Rt||{}),Ir=(s=>(s.cashPerContract="cash_per_contract",s.cashPerOrder="cash_per_order",s.percent="percent",s))(Ir||{}),gt=(s=>(s.all="all",s.long="long",s.short="short",s))(gt||{}),vn=(s=>(s.cancel="cancel",s.none="none",s.reduce="reduce",s))(vn||{}),je=(s=>(s.alignBottom="align_bottom",s.alignCenter="align_center",s.alignLeft="align_left",s.alignRight="align_right",s.alignTop="align_top",s.wrapAuto="wrap_auto",s.wrapNone="wrap_none",s))(je||{}),wt=(s=>(s.bar_index="bar_index",s.bar_time="bar_time",s))(wt||{}),Kr=(s=>(s.abovebar="abovebar",s.belowbar="belowbar",s.price="price",s))(Kr||{}),Us=(s=>(s.actual="actual",s.estimate="estimate",s.standardized="standardized",s))(Us||{}),ei=(s=>(s.traditional="Traditional",s.fibonacci="Fibonacci",s.woodie="Woodie",s.classic="Classic",s.dm="DM",s.camarilla="Camarilla",s))(ei||{}),ur=(s=>(s.INT="int",s.BOOL="bool",s.TIME="time",s.COLOR="color",s.FLOAT="float",s.PRICE="price",s.SOURCE="source",s.STRING="string",s.SYMBOL="symbol",s.SESSION="session",s.TEXT_AREA="text_area",s.TIMEFRAME="timeframe",s.ENUM="enum",s))(ur||{}),Ve=(s=>(s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error",s))(Ve||{});class g1{constructor(e){U(this,"_errorListener");this._errorListener=e}new({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_float({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_int({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_color({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_bool({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_string({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_line({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_box({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_table({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_linefill({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_label({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}copy({id:e}){return e==null?void 0:e.copy()}slice({id:e,index_from:t,index_to:r}){return e==null?void 0:e.slice({index_from:t,index_to:r})}size({id:e}){return e==null?void 0:e.size()}first({id:e}){return e==null?void 0:e.first()}abs({id:e},t){return e==null?void 0:e.abs(t)}avg({id:e},t){return e==null?void 0:e.avg(t)}binary_search({id:e,val:t},r){return e==null?void 0:e.binary_search({val:t},r)}binary_search_leftmost({id:e,val:t},r){return e==null?void 0:e.binary_search_leftmost({val:t},r)}binary_search_rightmost({id:e,val:t},r){return e==null?void 0:e.binary_search_rightmost({val:t},r)}clear({id:e}){e==null||e.clear()}concat({id1:e,id2:t}){return e==null?void 0:e.concat({id2:t})}covariance({id1:e,id2:t,biased:r},n){return e==null?void 0:e.covariance({id2:t,biased:r},n)}every({id:e},t){return e==null?void 0:e.every(t)}from(e,t){const r=new it(0,void 0,this._errorListener);return r._value=t,r}fill({id:e,value:t,index_from:r,index_to:n}){e==null||e.fill({value:t,index_from:r,index_to:n})}get({id:e,index:t}){return e==null?void 0:e.get({index:t})}includes({id:e,value:t}){return e==null?void 0:e.includes({value:t})}indexof({id:e,value:t}){return e==null?void 0:e.indexof({value:t})}insert({id:e,index:t,value:r}){e==null||e.insert({index:t,value:r})}join({id:e,separator:t},r){return e==null?void 0:e.join({separator:t},r)}last({id:e}){return e==null?void 0:e.last()}lastindexof({id:e,value:t}){return e==null?void 0:e.lastindexof({value:t})}max({id:e,nth:t},r){return e==null?void 0:e.max({nth:t},r)}median({id:e},t){return e==null?void 0:e.median(t)}min({id:e,nth:t},r){return e==null?void 0:e.min({nth:t},r)}mode({id:e},t){return e==null?void 0:e.mode(t)}percentile_linear_interpolation({id:e,percentage:t},r){return e==null?void 0:e.percentile_linear_interpolation({percentage:t},r)}percentile_nearest_rank({id:e,percentage:t},r){return e==null?void 0:e.percentile_nearest_rank({percentage:t},r)}percentrank({id:e,index:t},r){return e==null?void 0:e.percentrank({index:t},r)}pop({id:e}){return e==null?void 0:e.pop()}push({id:e,value:t}){e==null||e.push({value:t})}range({id:e},t){return e==null?void 0:e.range(t)}remove({id:e,index:t}){return e==null?void 0:e.remove({index:t})}reverse({id:e}){return e==null?void 0:e.reverse()}set({id:e,index:t,value:r}){e==null||e.set({index:t,value:r})}shift({id:e}){return e==null?void 0:e.shift()}some({id:e},t){return e==null?void 0:e.some(t)}sort({id:e,order:t},r){e==null||e.sort({order:t},r)}sort_indices({id:e,order:t},r){return e==null?void 0:e.sort_indices({order:t},r)}standardize({id:e},t){return e==null?void 0:e.standardize(t)}stdev({id:e,biased:t},r){return e==null?void 0:e.stdev({biased:t},r)}sum({id:e},t){return e==null?void 0:e.sum(t)}unshift({id:e,value:t}){e==null||e.unshift({value:t})}variance({id:e,biased:t},r){return e==null?void 0:e.variance({biased:t},r)}}class it{constructor(e=0,t,r){U(this,"_arrInstance");U(this,"_errorListener");this._errorListener=r,this._arrInstance=Array.from(new Array(e||0),()=>Yr.cloneDeep(t))}get isArray(){return!0}get _value(){return[...this._arrInstance]}set _value(e){this._arrInstance=[...e]}_deepCopyData(e){this._arrInstance=Yr.cloneDeep(e)}_copyData(e){this._arrInstance=e}copy(){const e=new it(0,void 0,this._errorListener);return e._deepCopyData(this._arrInstance),e}slice({index_from:e,index_to:t}){const r=new it(0,void 0,this._errorListener);return r._copyData(this._arrInstance.slice(e,t)),r}size(){return this._arrInstance.length}first(){return this._arrInstance[0]}abs(e){const t=new it(0,void 0,this._errorListener);this._verifySimpleType("number","abs","int/float",e);const r=this._arrInstance.map(n=>Math.abs(n));return t._copyData(r),t}avg(e){return this._verifySimpleType("number","avg","int/float",e),Yr.mean(this._arrInstance)}binary_search({val:e},t){return this._verifySimpleType("number","binary_search","int/float",t),me(e)?-1:this._binarySearch(this._arrInstance,e)}binary_search_leftmost({val:e},t){return this._verifySimpleType("number","binary_search_leftmost","int/float",t),me(e)?this._arrInstance.length-1:this._binarySearchLeftMost(this._arrInstance,e)}binary_search_rightmost({val:e},t){return this._verifySimpleType("number","binary_search_rightmost","int/float",t),me(e)?this._arrInstance.length:this._binarySearchRightMost(this._arrInstance,e)}clear(){this._arrInstance=[]}concat({id2:e}){return this._arrInstance=this._arrInstance.concat(e==null?void 0:e._value),this}covariance({id2:e,biased:t},r){return this._verifySimpleType("number","covariance","int/float",r),this._verifySimpleType("number","covariance","int/float",r,e==null?void 0:e._value),this._covariance(this._arrInstance,e._value,t,r)}every(e){return this._verifySimpleType("number|boolean","every","int/float/bool",e),this._arrInstance.every(t=>!!t)}fill({value:e,index_from:t=0,index_to:r}){this._arrInstance=this._setElements(this._arrInstance,e,t,r)}get({index:e}){if(!me(e))return this._arrInstance[e]}includes({value:e}){return this._arrInstance.includes(e)}indexof({value:e}){return this._arrInstance.indexOf(e)}insert({index:e,value:t}){me(e)||this._arrInstance.splice(e,0,t)}join({separator:e}={},t){return this._verifySimpleType("number|string","join","int/float/string",t),this._arrInstance.join(e)}last(){return this._arrInstance[this._arrInstance.length-1]}lastindexof({value:e}){return this._arrInstance.lastIndexOf(e)}max({nth:e}={},t){return this._verifySimpleType("number","max","int/float",t),this._maxNth([...this._arrInstance],e)}median(e){return this._verifySimpleType("number","median","int/float",e),this._median([...this._arrInstance])}min({nth:e}={},t){return this._verifySimpleType("number","min","int/float",t),this._minNth([...this._arrInstance],e)}mode(e){return this._verifySimpleType("number","mode","int/float",e),this._mode([...this._arrInstance])}percentile_linear_interpolation({percentage:e},t){return this._verifySimpleType("number","percentile_linear_interpolation","int/float",t),this._percentileLinearInterpolation([...this._arrInstance],e)}percentile_nearest_rank({percentage:e=0},t){var r;if(this._arrInstance.length===0||e<0||e>100||me(e)){(r=this._errorListener)==null||r.addError("Invalid percentile or empty array",t,Ve.Error);return}return this._verifySimpleType("number","percentile_nearest_rank","int/float",t),this._getNearestRankPercentile([...this._arrInstance],e)}percentrank({index:e},t){return this._verifySimpleType("number","percentrank","int/float",t),this._getPercentileRank([...this._arrInstance],e)}pop(){return this._arrInstance.pop()}push({value:e}){this._arrInstance.push(e)}range(e){var i;if(this._arrInstance.length===0){(i=this._errorListener)==null||i.addError("Array must not be empty",e,Ve.Error);return}this._verifySimpleType("number","range","int/float",e);const t=Math.min(...this._arrInstance);return Math.max(...this._arrInstance)-t}remove({index:e}){if(!me(e))return this._arrInstance.splice(e,1)[0]}reverse(){this._arrInstance.reverse()}set({index:e,value:t}){me(e)||(this._arrInstance[e]=t)}shift(){return this._arrInstance.shift()}some(e){return this._verifySimpleType("number|boolean","some","int/float/bool",e),this._arrInstance.some(t=>!!t)}sort({order:e}={},t){this._verifySimpleType("number","sort","int/float",t),this._arrInstance.sort((r,n)=>e!==Qn.descending?r-n:n-r)}sort_indices({order:e}={},t){this._verifySimpleType("number","sort_indices","int/float",t);const r=this._arrInstance.map((i,a)=>a);r.sort((i,a)=>e!==Qn.descending?this._arrInstance[i]-this._arrInstance[a]:this._arrInstance[a]-this._arrInstance[i]);const n=new it(0,void 0,this._errorListener);return n._copyData(r),n}standardize(e){this._verifySimpleType("number","standardize","int/float",e);const t=new it(0,void 0,this._errorListener);return t._copyData(this._standardizeArray([...this._arrInstance])),t}stdev({biased:e}={},t){var r;if(this._arrInstance.length===0){(r=this._errorListener)==null||r.addError("Array must not be empty",t,Ve.Error);return}return this._verifySimpleType("number","stdev","int/float",t),this._calculateStandardDeviations([...this._arrInstance],e)}sum(e){return this._verifySimpleType("number","sum","int/float",e),this._arrInstance.reduce((r,n)=>r+(n||0),0)}unshift({value:e}){this._arrInstance.unshift(e)}variance({biased:e}={},t){var r;if(this._arrInstance.length===0){(r=this._errorListener)==null||r.addError("Array must not be empty",t,Ve.Error);return}return this._verifySimpleType("number","variance","int/float",t),this._calculateVariances([...this._arrInstance],e)}_calculateVariances(e,t=!0){const r=e.reduce((a,u)=>a+(u||0),0)/e.length,n=e.reduce((a,u)=>a+((u||0)-r)**2,0),i=n/e.length;return t?i:e.length>1?n/(e.length-1):i}_calculateStandardDeviations(e,t=!0){const r=e.reduce((a,u)=>a+(u||0),0)/e.length,n=e.reduce((a,u)=>{const f=(u||0)-r;return a+f*f},0),i=Math.sqrt(n/e.length);return t?i:e.length>1?Math.sqrt(n/(e.length-1)):i}_standardizeArray(e){const t=e.reduce((i,a)=>i+(a||0),0)/e.length,r=Math.sqrt(e.reduce((i,a)=>i+Math.pow((a||0)-t,2),0)/e.length);return e.map(i=>((i||0)-t)/r)}_getPercentileRank(e,t=0){if(me(t))return;const r=e[t];let n=0;for(let a=0;a<e.length;a++)(e[a]<r||e[a]===r&&a!=t)&&n++;return n/(e.length-1)*100}_getNearestRankPercentile(e,t=0){const r=e.slice().sort((a,u)=>a-u),n=t/100*r.length,i=Math.ceil(n)-1;return r[i>=r.length?r.length-1:i]}_percentileLinearInterpolation(e,t=0){if(t<0||t>100||me(t))return;e.sort(function(i,a){return i-a});const r=e.length;t/=100;const n=1/(r*2);if(t<=n)return e[0];if(t>=1-1/(r*2))return e[r-1];for(const[i,a]of e.entries()){const u=e[i-1];if(t<(i+.5)/r)return u+(a-u)*(t-(i-.5)/r)/(1/r)}}_mode(e){const t={};let r=0;const n=[];for(const i of e)t[i]=(t[i]||0)+1,r=Math.max(r,t[i]);for(const i in t)t[i]===r&&n.push(Number(i));return Math.min(...r===1?e:n)}_median(e){e.sort(function(r,n){return r-n});const t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}_minNth(e,t=0){return e.sort(function(r,n){return r-n}),e[t]}_maxNth(e,t=0){return e.sort(function(r,n){return n-r}),e[t]}_setElements(e,t,r=0,n){n===void 0&&(n=e.length);for(let i=r;i<n;i++)e[i]=t;return e}_covariance(e,t,r=!0,n){var f;if(e.length!=t.length){(f=this._errorListener)==null||f.addError("Arrays have different lengths",n,Ve.Error);return}e=e.filter(c=>c!==void 0),t=t.filter(c=>c!==void 0);const i=e.reduce((c,h)=>c+h,0)/e.length,a=t.reduce((c,h)=>c+h,0)/t.length;let u=0;for(let c=0;c<e.length;c++)u+=(e[c]-i)*(t[c]-a);return r?u/e.length:u/(e.length-1)}_verifySimpleType(e,t,r,n,i=this._arrInstance){var u;i.filter(f=>f!==void 0).some(f=>!e.split("|").includes(typeof f))&&((u=this._errorListener)==null||u.addError(`数组类型错误,array.${t}方法只能使用${r}类型数组!`,n,Ve.Error))}_binarySearch(e,t){let r=0,n=e.length-1;for(;r<=n;){const i=Math.floor((r+n)/2);if(e[i]===t)return i;e[i]<t?r=i+1:n=i-1}return-1}_binarySearchLeftMost(e,t){let r=0,n=e.length-1;const i=[];for(;r<=n;){const a=Math.floor((r+n)/2);e[a]===t&&i.push(a),e[a]<t?r=a+1:n=a-1}return i.length?Math.min(...i):r-1}_binarySearchRightMost(e,t){let r=0,n=e.length-1;const i=[];for(;r<=n;){const a=Math.floor((r+n)/2);e[a]===t&&i.push(a),e[a]<=t?r=a+1:n=a-1}return i.length?Math.max(...i):r}}class m1{constructor(e,t){U(this,"_randomNums");U(this,"_mintick");U(this,"_cacheData");U(this,"_barIndex");U(this,"_errorListener");this._mintick=e,this._randomNums={},this._cacheData={},this._barIndex=0,this._errorListener=t}update(e){this._barIndex=e,this._randomNums={}}abs({number:e}){if(!me(e))return Math.abs(e)}acos({angle:e}){if(me(e))return;const t=Math.acos(e);return isNaN(t)?void 0:t}asin({angle:e}){if(me(e))return;const t=Math.asin(e);return isNaN(t)?void 0:t}atan({angle:e}){if(me(e))return;const t=Math.atan(e);return isNaN(t)?void 0:t}avg(e,t){return Yr.mean(t)}ceil({number:e}){if(!me(e))return Math.ceil(e)}floor({number:e}){if(!me(e))return Math.floor(e)}cos({angle:e}){if(me(e))return;const t=Math.cos(e);return isNaN(t)?void 0:t}sin({angle:e}){if(me(e))return;const t=Math.sin(e);return isNaN(t)?void 0:t}tan({angle:e}){if(me(e))return;const t=Math.tan(e);return isNaN(t)?void 0:t}exp({number:e}){if(!me(e))return Math.exp(e)}log({number:e}){if(!me(e))return Math.log(e)}log10({number:e}){if(!me(e))return Math.log10(e)}max(e,t){return t=t.filter(r=>!me(r)),Math.max(...t)}min(e,t){return t=t.filter(r=>!me(r)),Math.min(...t)}pow({base:e,exponent:t}){if(!(me(e)||me(t)))return Math.pow(e,t)}random({min:e=0,max:t=1,seed:r},n){if(me(e)&&(e=0),me(t)&&(t=1),r&&this._randomNums[r])return this._randomNums[r];if(e>=t){this._errorListener.addError("min must be less than max",n,Ve.Error);return}let i;do i=Math.random()*(t-e)+e;while(i===e||i===t);return r&&(this._randomNums[r]=i),i}round({number:e,precision:t}){if(!me(e))return me(t)?Math.round(e):Number(e==null?void 0:e.toFixed(t))}round_to_mintick({number:e}){if(!me(e))return Number(e==null?void 0:e.toFixed(this._mintick))}sign({number:e}){if(!me(e))return e&&Math.sign(e)}sqrt({number:e}){if(!me(e))return Math.sqrt(e)}sum({source:e,length:t=1},r){let n=this._cacheData[`sum_${r}`];n||(n=[]),n[this._barIndex]=e,this._cacheData[`sum_${r}`]=n;const i=n.filter(a=>!me(a));if(!(i.length<t))return Yr.sum(i.slice(-t))}todegrees({radians:e}){if(!me(e))return e*(180/Math.PI)}toradians({degrees:e}){if(!me(e))return e*(Math.PI/180)}}function Ws(){return Ws=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(s[r]=t[r])}return s},Ws.apply(this,arguments)}var bl={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function pt(s){return typeof s=="number"}function St(s){return!s||typeof s!="object"||typeof s.constructor!="function"?!1:s.isBigNumber===!0&&typeof s.constructor.prototype=="object"&&s.constructor.prototype.isBigNumber===!0||typeof s.constructor.isDecimal=="function"&&s.constructor.isDecimal(s)===!0}function El(s){return s&&typeof s=="object"&&Object.getPrototypeOf(s).isComplex===!0||!1}function Al(s){return s&&typeof s=="object"&&Object.getPrototypeOf(s).isFraction===!0||!1}function Cl(s){return s&&s.constructor.prototype.isUnit===!0||!1}function un(s){return typeof s=="string"}var Ct=Array.isArray;function mt(s){return s&&s.constructor.prototype.isMatrix===!0||!1}function is(s){return Array.isArray(s)||mt(s)}function x1(s){return s&&s.isDenseMatrix&&s.constructor.prototype.isMatrix===!0||!1}function y1(s){return s&&s.isSparseMatrix&&s.constructor.prototype.isMatrix===!0||!1}function D1(s){return s&&s.constructor.prototype.isRange===!0||!1}function Aa(s){return s&&s.constructor.prototype.isIndex===!0||!1}function w1(s){return typeof s=="boolean"}function b1(s){return s&&s.constructor.prototype.isResultSet===!0||!1}function E1(s){return s&&s.constructor.prototype.isHelp===!0||!1}function A1(s){return typeof s=="function"}function C1(s){return s instanceof Date}function F1(s){return s instanceof RegExp}function Ca(s){return!!(s&&typeof s=="object"&&s.constructor===Object&&!El(s)&&!Al(s))}function B1(s){return s===null}function M1(s){return s===void 0}function N1(s){return s&&s.isAccessorNode===!0&&s.constructor.prototype.isNode===!0||!1}function S1(s){return s&&s.isArrayNode===!0&&s.constructor.prototype.isNode===!0||!1}function O1(s){return s&&s.isAssignmentNode===!0&&s.constructor.prototype.isNode===!0||!1}function I1(s){return s&&s.isBlockNode===!0&&s.constructor.prototype.isNode===!0||!1}function T1(s){return s&&s.isConditionalNode===!0&&s.constructor.prototype.isNode===!0||!1}function $1(s){return s&&s.isConstantNode===!0&&s.constructor.prototype.isNode===!0||!1}function R1(s){return s&&s.isFunctionAssignmentNode===!0&&s.constructor.prototype.isNode===!0||!1}function L1(s){return s&&s.isFunctionNode===!0&&s.constructor.prototype.isNode===!0||!1}function P1(s){return s&&s.isIndexNode===!0&&s.constructor.prototype.isNode===!0||!1}function k1(s){return s&&s.isNode===!0&&s.constructor.prototype.isNode===!0||!1}function z1(s){return s&&s.isObjectNode===!0&&s.constructor.prototype.isNode===!0||!1}function q1(s){return s&&s.isOperatorNode===!0&&s.constructor.prototype.isNode===!0||!1}function U1(s){return s&&s.isParenthesisNode===!0&&s.constructor.prototype.isNode===!0||!1}function W1(s){return s&&s.isRangeNode===!0&&s.constructor.prototype.isNode===!0||!1}function H1(s){return s&&s.isRelationalNode===!0&&s.constructor.prototype.isNode===!0||!1}function j1(s){return s&&s.isSymbolNode===!0&&s.constructor.prototype.isNode===!0||!1}function Y1(s){return s&&s.constructor.prototype.isChain===!0||!1}function Sn(s){var e=typeof s;return e==="object"?s===null?"null":St(s)?"BigNumber":s.constructor&&s.constructor.name?s.constructor.name:"Object":e}function ut(s){var e=typeof s;if(e==="number"||e==="string"||e==="boolean"||s===null||s===void 0)return s;if(typeof s.clone=="function")return s.clone();if(Array.isArray(s))return s.map(function(t){return ut(t)});if(s instanceof Date)return new Date(s.valueOf());if(St(s))return s;if(Ca(s))return Z1(s,ut);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(s,")"))}function Z1(s,e){var t={};for(var r in s)ss(s,r)&&(t[r]=e(s[r]));return t}function Fl(s,e){for(var t in e)ss(e,t)&&(s[t]=e[t]);return s}function yi(s,e){var t,r,n;if(Array.isArray(s)){if(!Array.isArray(e)||s.length!==e.length)return!1;for(r=0,n=s.length;r<n;r++)if(!yi(s[r],e[r]))return!1;return!0}else{if(typeof s=="function")return s===e;if(s instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in s)if(!(t in e)||!yi(s[t],e[t]))return!1;for(t in e)if(!(t in s))return!1;return!0}else return s===e}}function ss(s,e){return s&&Object.hasOwnProperty.call(s,e)}function V1(s,e){for(var t={},r=0;r<e.length;r++){var n=e[r],i=s[n];i!==void 0&&(t[n]=i)}return t}var G1=["Matrix","Array"],K1=["number","BigNumber","Fraction"],Er=function(e){if(e)throw new Error(`The global config is readonly.
26
+ `)+fe+`return __p
27
+ }`;var qe=o1(function(){return st($,Ae+"return "+fe).apply(t,q)});if(qe.source=fe,nl(qe))throw qe;return qe}function VA(o){return at(o).toLowerCase()}function GA(o){return at(o).toUpperCase()}function KA(o,l,g){if(o=at(o),o&&(g||l===t))return _d(o);if(!o||!(l=Br(l)))return o;var E=tn(o),S=tn(l),$=vd(E,S),q=gd(E,S)+1;return Gn(E,$,q).join("")}function XA(o,l,g){if(o=at(o),o&&(g||l===t))return o.slice(0,xd(o)+1);if(!o||!(l=Br(l)))return o;var E=tn(o),S=gd(E,tn(l))+1;return Gn(E,0,S).join("")}function QA(o,l,g){if(o=at(o),o&&(g||l===t))return o.replace(mr,"");if(!o||!(l=Br(l)))return o;var E=tn(o),S=vd(E,tn(l));return Gn(E,S).join("")}function JA(o,l){var g=A,E=N;if(Bt(l)){var S="separator"in l?l.separator:S;g="length"in l?ze(l.length):g,E="omission"in l?Br(l.omission):E}o=at(o);var $=o.length;if(ji(o)){var q=tn(o);$=q.length}if(g>=$)return o;var W=g-Yi(E);if(W<1)return E;var K=q?Gn(q,0,W).join(""):o.slice(0,W);if(S===t)return K+E;if(q&&(W+=K.length-W),il(S)){if(o.slice(W).search(S)){var oe,ae=K;for(S.global||(S=y0(S.source,at(Lo.exec(S))+"g")),S.lastIndex=0;oe=S.exec(ae);)var fe=oe.index;K=K.slice(0,fe===t?W:fe)}}else if(o.indexOf(Br(S),W)!=W){var ge=K.lastIndexOf(S);ge>-1&&(K=K.slice(0,ge))}return K+E}function eC(o){return o=at(o),o&&vs.test(o)?o.replace(Dn,M2):o}var tC=Ji(function(o,l,g){return o+(g?" ":"")+l.toUpperCase()}),al=ap("toUpperCase");function s1(o,l,g){return o=at(o),l=g?t:l,l===t?E2(o)?O2(o):_2(o):o.match(l)||[]}var o1=Ue(function(o,l){try{return Cr(o,t,l)}catch(g){return nl(g)?g:new Re(g)}}),rC=Cn(function(o,l){return kr(l,function(g){g=dn(g),En(o,g,tl(o[g],o))}),o});function nC(o){var l=o==null?0:o.length,g=Me();return o=l?At(o,function(E){if(typeof E[1]!="function")throw new zr(a);return[g(E[0]),E[1]]}):[],Ue(function(E){for(var S=-1;++S<l;){var $=o[S];if(Cr($[0],this,E))return Cr($[1],this,E)}})}function iC(o){return Mb(Ur(o,d))}function ul(o){return function(){return o}}function sC(o,l){return o==null||o!==o?l:o}var oC=lp(),aC=lp(!0);function wr(o){return o}function ll(o){return kd(typeof o=="function"?o:Ur(o,d))}function uC(o){return qd(Ur(o,d))}function lC(o,l){return Ud(o,Ur(l,d))}var fC=Ue(function(o,l){return function(g){return Ns(g,o,l)}}),cC=Ue(function(o,l){return function(g){return Ns(o,g,l)}});function fl(o,l,g){var E=Yt(l),S=ia(l,E);g==null&&!(Bt(l)&&(S.length||!E.length))&&(g=l,l=o,o=this,S=ia(l,Yt(l)));var $=!(Bt(g)&&"chain"in g)||!!g.chain,q=Bn(o);return kr(S,function(W){var K=l[W];o[W]=K,q&&(o.prototype[W]=function(){var oe=this.__chain__;if($||oe){var ae=o(this.__wrapped__),fe=ae.__actions__=xr(this.__actions__);return fe.push({func:K,args:arguments,thisArg:o}),ae.__chain__=oe,ae}return K.apply(o,Wn([this.value()],arguments))})}),o}function hC(){return Qt._===this&&(Qt._=P2),this}function cl(){}function dC(o){return o=ze(o),Ue(function(l){return Wd(l,o)})}var pC=U0(At),_C=U0(fd),vC=U0(d0);function a1(o){return G0(o)?p0(dn(o)):Yb(o)}function gC(o){return function(l){return o==null?t:vi(o,l)}}var mC=cp(),xC=cp(!0);function hl(){return[]}function dl(){return!1}function yC(){return{}}function DC(){return""}function wC(){return!0}function bC(o,l){if(o=ze(o),o<1||o>H)return[];var g=j,E=ir(o,j);l=Me(l),o-=j;for(var S=g0(E,l);++g<o;)l(g);return S}function EC(o){return Pe(o)?At(o,dn):Mr(o)?[o]:xr(Fp(at(o)))}function AC(o){var l=++L2;return at(o)+l}var CC=fa(function(o,l){return o+l},0),FC=W0("ceil"),BC=fa(function(o,l){return o/l},1),MC=W0("floor");function NC(o){return o&&o.length?na(o,wr,B0):t}function SC(o,l){return o&&o.length?na(o,Me(l,2),B0):t}function OC(o){return dd(o,wr)}function IC(o,l){return dd(o,Me(l,2))}function TC(o){return o&&o.length?na(o,wr,O0):t}function $C(o,l){return o&&o.length?na(o,Me(l,2),O0):t}var LC=fa(function(o,l){return o*l},1),RC=W0("round"),PC=fa(function(o,l){return o-l},0);function kC(o){return o&&o.length?v0(o,wr):0}function zC(o,l){return o&&o.length?v0(o,Me(l,2)):0}return T.after=u4,T.ary=Pp,T.assign=G4,T.assignIn=Qp,T.assignInWith=ba,T.assignWith=K4,T.at=X4,T.before=kp,T.bind=tl,T.bindAll=rC,T.bindKey=zp,T.castArray=y4,T.chain=$p,T.chunk=ME,T.compact=NE,T.concat=SE,T.cond=nC,T.conforms=iC,T.constant=ul,T.countBy=k8,T.create=Q4,T.curry=qp,T.curryRight=Up,T.debounce=Wp,T.defaults=J4,T.defaultsDeep=eA,T.defer=l4,T.delay=f4,T.difference=OE,T.differenceBy=IE,T.differenceWith=TE,T.drop=$E,T.dropRight=LE,T.dropRightWhile=RE,T.dropWhile=PE,T.fill=kE,T.filter=q8,T.flatMap=H8,T.flatMapDeep=j8,T.flatMapDepth=Y8,T.flatten=Sp,T.flattenDeep=zE,T.flattenDepth=qE,T.flip=c4,T.flow=oC,T.flowRight=aC,T.fromPairs=UE,T.functions=aA,T.functionsIn=uA,T.groupBy=Z8,T.initial=HE,T.intersection=jE,T.intersectionBy=YE,T.intersectionWith=ZE,T.invert=fA,T.invertBy=cA,T.invokeMap=G8,T.iteratee=ll,T.keyBy=K8,T.keys=Yt,T.keysIn=Dr,T.map=ga,T.mapKeys=dA,T.mapValues=pA,T.matches=uC,T.matchesProperty=lC,T.memoize=xa,T.merge=_A,T.mergeWith=Jp,T.method=fC,T.methodOf=cC,T.mixin=fl,T.negate=ya,T.nthArg=dC,T.omit=vA,T.omitBy=gA,T.once=h4,T.orderBy=X8,T.over=pC,T.overArgs=d4,T.overEvery=_C,T.overSome=vC,T.partial=rl,T.partialRight=Hp,T.partition=Q8,T.pick=mA,T.pickBy=e1,T.property=a1,T.propertyOf=gC,T.pull=XE,T.pullAll=Ip,T.pullAllBy=QE,T.pullAllWith=JE,T.pullAt=e8,T.range=mC,T.rangeRight=xC,T.rearg=p4,T.reject=t4,T.remove=t8,T.rest=_4,T.reverse=J0,T.sampleSize=n4,T.set=yA,T.setWith=DA,T.shuffle=i4,T.slice=r8,T.sortBy=a4,T.sortedUniq=l8,T.sortedUniqBy=f8,T.split=HA,T.spread=v4,T.tail=c8,T.take=h8,T.takeRight=d8,T.takeRightWhile=p8,T.takeWhile=_8,T.tap=N8,T.throttle=g4,T.thru=va,T.toArray=Gp,T.toPairs=t1,T.toPairsIn=r1,T.toPath=EC,T.toPlainObject=Xp,T.transform=wA,T.unary=m4,T.union=v8,T.unionBy=g8,T.unionWith=m8,T.uniq=x8,T.uniqBy=y8,T.uniqWith=D8,T.unset=bA,T.unzip=el,T.unzipWith=Tp,T.update=EA,T.updateWith=AA,T.values=rs,T.valuesIn=CA,T.without=w8,T.words=s1,T.wrap=x4,T.xor=b8,T.xorBy=E8,T.xorWith=A8,T.zip=C8,T.zipObject=F8,T.zipObjectDeep=B8,T.zipWith=M8,T.entries=t1,T.entriesIn=r1,T.extend=Qp,T.extendWith=ba,fl(T,T),T.add=CC,T.attempt=o1,T.camelCase=NA,T.capitalize=n1,T.ceil=FC,T.clamp=FA,T.clone=D4,T.cloneDeep=b4,T.cloneDeepWith=E4,T.cloneWith=w4,T.conformsTo=A4,T.deburr=i1,T.defaultTo=sC,T.divide=BC,T.endsWith=SA,T.eq=nn,T.escape=OA,T.escapeRegExp=IA,T.every=z8,T.find=U8,T.findIndex=Mp,T.findKey=tA,T.findLast=W8,T.findLastIndex=Np,T.findLastKey=rA,T.floor=MC,T.forEach=Lp,T.forEachRight=Rp,T.forIn=nA,T.forInRight=iA,T.forOwn=sA,T.forOwnRight=oA,T.get=sl,T.gt=C4,T.gte=F4,T.has=lA,T.hasIn=ol,T.head=Op,T.identity=wr,T.includes=V8,T.indexOf=WE,T.inRange=BA,T.invoke=hA,T.isArguments=xi,T.isArray=Pe,T.isArrayBuffer=B4,T.isArrayLike=yr,T.isArrayLikeObject=Tt,T.isBoolean=M4,T.isBuffer=Kn,T.isDate=N4,T.isElement=S4,T.isEmpty=O4,T.isEqual=I4,T.isEqualWith=T4,T.isError=nl,T.isFinite=$4,T.isFunction=Bn,T.isInteger=jp,T.isLength=Da,T.isMap=Yp,T.isMatch=L4,T.isMatchWith=R4,T.isNaN=P4,T.isNative=k4,T.isNil=q4,T.isNull=z4,T.isNumber=Zp,T.isObject=Bt,T.isObjectLike=Nt,T.isPlainObject=Ls,T.isRegExp=il,T.isSafeInteger=U4,T.isSet=Vp,T.isString=wa,T.isSymbol=Mr,T.isTypedArray=ts,T.isUndefined=W4,T.isWeakMap=H4,T.isWeakSet=j4,T.join=VE,T.kebabCase=TA,T.last=Hr,T.lastIndexOf=GE,T.lowerCase=$A,T.lowerFirst=LA,T.lt=Y4,T.lte=Z4,T.max=NC,T.maxBy=SC,T.mean=OC,T.meanBy=IC,T.min=TC,T.minBy=$C,T.stubArray=hl,T.stubFalse=dl,T.stubObject=yC,T.stubString=DC,T.stubTrue=wC,T.multiply=LC,T.nth=KE,T.noConflict=hC,T.noop=cl,T.now=ma,T.pad=RA,T.padEnd=PA,T.padStart=kA,T.parseInt=zA,T.random=MA,T.reduce=J8,T.reduceRight=e4,T.repeat=qA,T.replace=UA,T.result=xA,T.round=RC,T.runInContext=Z,T.sample=r4,T.size=s4,T.snakeCase=WA,T.some=o4,T.sortedIndex=n8,T.sortedIndexBy=i8,T.sortedIndexOf=s8,T.sortedLastIndex=o8,T.sortedLastIndexBy=a8,T.sortedLastIndexOf=u8,T.startCase=jA,T.startsWith=YA,T.subtract=PC,T.sum=kC,T.sumBy=zC,T.template=ZA,T.times=bC,T.toFinite=Mn,T.toInteger=ze,T.toLength=Kp,T.toLower=VA,T.toNumber=jr,T.toSafeInteger=V4,T.toString=at,T.toUpper=GA,T.trim=KA,T.trimEnd=XA,T.trimStart=QA,T.truncate=JA,T.unescape=eC,T.uniqueId=AC,T.upperCase=tC,T.upperFirst=al,T.each=Lp,T.eachRight=Rp,T.first=Op,fl(T,function(){var o={};return cn(T,function(l,g){lt.call(T.prototype,g)||(o[g]=l)}),o}(),{chain:!1}),T.VERSION=r,kr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){T[o].placeholder=T}),kr(["drop","take"],function(o,l){Ze.prototype[o]=function(g){g=g===t?1:Ht(ze(g),0);var E=this.__filtered__&&!l?new Ze(this):this.clone();return E.__filtered__?E.__takeCount__=ir(g,E.__takeCount__):E.__views__.push({size:ir(g,j),type:o+(E.__dir__<0?"Right":"")}),E},Ze.prototype[o+"Right"]=function(g){return this.reverse()[o](g).reverse()}}),kr(["filter","map","takeWhile"],function(o,l){var g=l+1,E=g==k||g==R;Ze.prototype[o]=function(S){var $=this.clone();return $.__iteratees__.push({iteratee:Me(S,3),type:g}),$.__filtered__=$.__filtered__||E,$}}),kr(["head","last"],function(o,l){var g="take"+(l?"Right":"");Ze.prototype[o]=function(){return this[g](1).value()[0]}}),kr(["initial","tail"],function(o,l){var g="drop"+(l?"":"Right");Ze.prototype[o]=function(){return this.__filtered__?new Ze(this):this[g](1)}}),Ze.prototype.compact=function(){return this.filter(wr)},Ze.prototype.find=function(o){return this.filter(o).head()},Ze.prototype.findLast=function(o){return this.reverse().find(o)},Ze.prototype.invokeMap=Ue(function(o,l){return typeof o=="function"?new Ze(this):this.map(function(g){return Ns(g,o,l)})}),Ze.prototype.reject=function(o){return this.filter(ya(Me(o)))},Ze.prototype.slice=function(o,l){o=ze(o);var g=this;return g.__filtered__&&(o>0||l<0)?new Ze(g):(o<0?g=g.takeRight(-o):o&&(g=g.drop(o)),l!==t&&(l=ze(l),g=l<0?g.dropRight(-l):g.take(l-o)),g)},Ze.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ze.prototype.toArray=function(){return this.take(j)},cn(Ze.prototype,function(o,l){var g=/^(?:filter|find|map|reject)|While$/.test(l),E=/^(?:head|last)$/.test(l),S=T[E?"take"+(l=="last"?"Right":""):l],$=E||/^find/.test(l);S&&(T.prototype[l]=function(){var q=this.__wrapped__,W=E?[1]:arguments,K=q instanceof Ze,oe=W[0],ae=K||Pe(q),fe=function(He){var Ke=S.apply(T,Wn([He],W));return E&&ge?Ke[0]:Ke};ae&&g&&typeof oe=="function"&&oe.length!=1&&(K=ae=!1);var ge=this.__chain__,Ae=!!this.__actions__.length,Ne=$&&!ge,qe=K&&!Ae;if(!$&&ae){q=qe?q:new Ze(this);var Se=o.apply(q,W);return Se.__actions__.push({func:va,args:[fe],thisArg:t}),new qr(Se,ge)}return Ne&&qe?o.apply(this,W):(Se=this.thru(fe),Ne?E?Se.value()[0]:Se.value():Se)})}),kr(["pop","push","shift","sort","splice","unshift"],function(o){var l=Uo[o],g=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",E=/^(?:pop|shift)$/.test(o);T.prototype[o]=function(){var S=arguments;if(E&&!this.__chain__){var $=this.value();return l.apply(Pe($)?$:[],S)}return this[g](function(q){return l.apply(Pe(q)?q:[],S)})}}),cn(Ze.prototype,function(o,l){var g=T[l];if(g){var E=g.name+"";lt.call(Ki,E)||(Ki[E]=[]),Ki[E].push({name:l,func:g})}}),Ki[la(t,m).name]=[{name:"wrapper",func:t}],Ze.prototype.clone=eb,Ze.prototype.reverse=tb,Ze.prototype.value=rb,T.prototype.at=S8,T.prototype.chain=O8,T.prototype.commit=I8,T.prototype.next=T8,T.prototype.plant=L8,T.prototype.reverse=R8,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=P8,T.prototype.first=T.prototype.head,bs&&(T.prototype[bs]=$8),T},Zi=I2();ci?((ci.exports=Zi)._=Zi,l0._=Zi):Qt._=Zi}).call(ye)}(Xn,Xn.exports);var Yr=Xn.exports;class l1{constructor(e,t){U(this,"_defaultParams");U(this,"_UserTypeFileds");U(this,"_varipKeys");this._defaultParams=e,this._UserTypeFileds=this._createDynamicClass(),this._varipKeys=t}copy(e){return Yr.cloneDeep(e)}new(e={}){return new this._UserTypeFileds(Object.assign(Yr.cloneDeep(this._defaultParams),e),this._varipKeys)}addNewMethod(e,t){this._UserTypeFileds.prototype[e]=t}_createDynamicClass(){return class{constructor(e,t){U(this,"_varipKeys");Object.assign(this,e),this._varipKeys=t}get varipKeys(){return[...this._varipKeys]}copy(){return Yr.cloneDeep(this)}}}}var ml={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t=1e3,r=6e4,n=36e5,i="millisecond",a="second",u="minute",c="hour",f="day",h="week",d="month",p="quarter",v="year",x="date",_="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var z=["th","st","nd","rd"],R=k%100;return"["+k+(z[(R-20)%10]||z[R]||z[0])+"]"}},D=function(k,z,R){var G=String(k);return!G||G.length>=z?k:""+Array(z+1-G.length).join(R)+k},C={s:D,z:function(k){var z=-k.utcOffset(),R=Math.abs(z),G=Math.floor(R/60),H=R%60;return(z<=0?"+":"-")+D(G,2,"0")+":"+D(H,2,"0")},m:function k(z,R){if(z.date()<R.date())return-k(R,z);var G=12*(R.year()-z.year())+(R.month()-z.month()),H=z.clone().add(G,d),ee=R-H<0,te=z.clone().add(G+(ee?-1:1),d);return+(-(G+(R-H)/(ee?H-te:te-H))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:d,y:v,w:h,d:f,D:x,h:c,m:u,s:a,ms:i,Q:p}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},b="en",F={};F[b]=w;var B="$isDayjsObject",M=function(k){return k instanceof I||!(!k||!k[B])},O=function k(z,R,G){var H;if(!z)return b;if(typeof z=="string"){var ee=z.toLowerCase();F[ee]&&(H=ee),R&&(F[ee]=R,H=ee);var te=z.split("-");if(!H&&te.length>1)return k(te[0])}else{var j=z.name;F[j]=z,H=j}return!G&&H&&(b=H),H||!G&&b},A=function(k,z){if(M(k))return k.clone();var R=typeof z=="object"?z:{};return R.date=k,R.args=arguments,new I(R)},N=C;N.l=O,N.i=M,N.w=function(k,z){return A(k,{locale:z.$L,utc:z.$u,x:z.$x,$offset:z.$offset})};var I=function(){function k(R){this.$L=O(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[B]=!0}var z=k.prototype;return z.parse=function(R){this.$d=function(G){var H=G.date,ee=G.utc;if(H===null)return new Date(NaN);if(N.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var te=H.match(y);if(te){var j=te[2]-1||0,X=(te[7]||"0").substring(0,3);return ee?new Date(Date.UTC(te[1],j,te[3]||1,te[4]||0,te[5]||0,te[6]||0,X)):new Date(te[1],j,te[3]||1,te[4]||0,te[5]||0,te[6]||0,X)}}return new Date(H)}(R),this.init()},z.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},z.$utils=function(){return N},z.isValid=function(){return this.$d.toString()!==_},z.isSame=function(R,G){var H=A(R);return this.startOf(G)<=H&&H<=this.endOf(G)},z.isAfter=function(R,G){return A(R)<this.startOf(G)},z.isBefore=function(R,G){return this.endOf(G)<A(R)},z.$g=function(R,G,H){return N.u(R)?this[G]:this.set(H,R)},z.unix=function(){return Math.floor(this.valueOf()/1e3)},z.valueOf=function(){return this.$d.getTime()},z.startOf=function(R,G){var H=this,ee=!!N.u(G)||G,te=N.p(R),j=function(Oe,Fe){var nt=N.w(H.$u?Date.UTC(H.$y,Fe,Oe):new Date(H.$y,Fe,Oe),H);return ee?nt:nt.endOf(f)},X=function(Oe,Fe){return N.w(H.toDate()[Oe].apply(H.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(Fe)),H)},Y=this.$W,Q=this.$M,pe=this.$D,De="set"+(this.$u?"UTC":"");switch(te){case v:return ee?j(1,0):j(31,11);case d:return ee?j(1,Q):j(0,Q+1);case h:var we=this.$locale().weekStart||0,be=(Y<we?Y+7:Y)-we;return j(ee?pe-be:pe+(6-be),Q);case f:case x:return X(De+"Hours",0);case c:return X(De+"Minutes",1);case u:return X(De+"Seconds",2);case a:return X(De+"Milliseconds",3);default:return this.clone()}},z.endOf=function(R){return this.startOf(R,!1)},z.$set=function(R,G){var H,ee=N.p(R),te="set"+(this.$u?"UTC":""),j=(H={},H[f]=te+"Date",H[x]=te+"Date",H[d]=te+"Month",H[v]=te+"FullYear",H[c]=te+"Hours",H[u]=te+"Minutes",H[a]=te+"Seconds",H[i]=te+"Milliseconds",H)[ee],X=ee===f?this.$D+(G-this.$W):G;if(ee===d||ee===v){var Y=this.clone().set(x,1);Y.$d[j](X),Y.init(),this.$d=Y.set(x,Math.min(this.$D,Y.daysInMonth())).$d}else j&&this.$d[j](X);return this.init(),this},z.set=function(R,G){return this.clone().$set(R,G)},z.get=function(R){return this[N.p(R)]()},z.add=function(R,G){var H,ee=this;R=Number(R);var te=N.p(G),j=function(Q){var pe=A(ee);return N.w(pe.date(pe.date()+Math.round(Q*R)),ee)};if(te===d)return this.set(d,this.$M+R);if(te===v)return this.set(v,this.$y+R);if(te===f)return j(1);if(te===h)return j(7);var X=(H={},H[u]=r,H[c]=n,H[a]=t,H)[te]||1,Y=this.$d.getTime()+R*X;return N.w(Y,this)},z.subtract=function(R,G){return this.add(-1*R,G)},z.format=function(R){var G=this,H=this.$locale();if(!this.isValid())return H.invalidDate||_;var ee=R||"YYYY-MM-DDTHH:mm:ssZ",te=N.z(this),j=this.$H,X=this.$m,Y=this.$M,Q=H.weekdays,pe=H.months,De=H.meridiem,we=function(Fe,nt,Ye,Ie){return Fe&&(Fe[nt]||Fe(G,ee))||Ye[nt].slice(0,Ie)},be=function(Fe){return N.s(j%12||12,Fe,"0")},Oe=De||function(Fe,nt,Ye){var Ie=Fe<12?"AM":"PM";return Ye?Ie.toLowerCase():Ie};return ee.replace(m,function(Fe,nt){return nt||function(Ye){switch(Ye){case"YY":return String(G.$y).slice(-2);case"YYYY":return N.s(G.$y,4,"0");case"M":return Y+1;case"MM":return N.s(Y+1,2,"0");case"MMM":return we(H.monthsShort,Y,pe,3);case"MMMM":return we(pe,Y);case"D":return G.$D;case"DD":return N.s(G.$D,2,"0");case"d":return String(G.$W);case"dd":return we(H.weekdaysMin,G.$W,Q,2);case"ddd":return we(H.weekdaysShort,G.$W,Q,3);case"dddd":return Q[G.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return be(1);case"hh":return be(2);case"a":return Oe(j,X,!0);case"A":return Oe(j,X,!1);case"m":return String(X);case"mm":return N.s(X,2,"0");case"s":return String(G.$s);case"ss":return N.s(G.$s,2,"0");case"SSS":return N.s(G.$ms,3,"0");case"Z":return te}return null}(Fe)||te.replace(":","")})},z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},z.diff=function(R,G,H){var ee,te=this,j=N.p(G),X=A(R),Y=(X.utcOffset()-this.utcOffset())*r,Q=this-X,pe=function(){return N.m(te,X)};switch(j){case v:ee=pe()/12;break;case d:ee=pe();break;case p:ee=pe()/3;break;case h:ee=(Q-Y)/6048e5;break;case f:ee=(Q-Y)/864e5;break;case c:ee=Q/n;break;case u:ee=Q/r;break;case a:ee=Q/t;break;default:ee=Q}return H?ee:N.a(ee)},z.daysInMonth=function(){return this.endOf(d).$D},z.$locale=function(){return F[this.$L]},z.locale=function(R,G){if(!R)return this.$L;var H=this.clone(),ee=O(R,G,!0);return ee&&(H.$L=ee),H},z.clone=function(){return N.w(this.$d,this)},z.toDate=function(){return new Date(this.valueOf())},z.toJSON=function(){return this.isValid()?this.toISOString():null},z.toISOString=function(){return this.$d.toISOString()},z.toString=function(){return this.$d.toUTCString()},k}(),L=I.prototype;return A.prototype=L,[["$ms",i],["$s",a],["$m",u],["$H",c],["$W",f],["$M",d],["$y",v],["$D",x]].forEach(function(k){L[k[1]]=function(z){return this.$g(z,k[0],k[1])}}),A.extend=function(k,z){return k.$i||(k(z,I,A),k.$i=!0),A},A.locale=O,A.isDayjs=M,A.unix=function(k){return A(1e3*k)},A.en=F[b],A.Ls=F,A.p={},A})})(ml);var f1=ml.exports,ot=tt(f1),xl={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t="minute",r=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(i,a,u){var c=a.prototype;u.utc=function(_){var y={date:_,utc:!0,args:arguments};return new a(y)},c.utc=function(_){var y=u(this.toDate(),{locale:this.$L,utc:!0});return _?y.add(this.utcOffset(),t):y},c.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var f=c.parse;c.parse=function(_){_.utc&&(this.$u=!0),this.$utils().u(_.$offset)||(this.$offset=_.$offset),f.call(this,_)};var h=c.init;c.init=function(){if(this.$u){var _=this.$d;this.$y=_.getUTCFullYear(),this.$M=_.getUTCMonth(),this.$D=_.getUTCDate(),this.$W=_.getUTCDay(),this.$H=_.getUTCHours(),this.$m=_.getUTCMinutes(),this.$s=_.getUTCSeconds(),this.$ms=_.getUTCMilliseconds()}else h.call(this)};var d=c.utcOffset;c.utcOffset=function(_,y){var m=this.$utils().u;if(m(_))return this.$u?0:m(this.$offset)?d.call(this):this.$offset;if(typeof _=="string"&&(_=function(b){b===void 0&&(b="");var F=b.match(r);if(!F)return null;var B=(""+F[0]).match(n)||["-",0,0],M=B[0],O=60*+B[1]+ +B[2];return O===0?0:M==="+"?O:-O}(_),_===null))return this;var w=Math.abs(_)<=16?60*_:_,D=this;if(y)return D.$offset=w,D.$u=_===0,D;if(_!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(D=this.local().add(w+C,t)).$offset=w,D.$x.$localOffset=C}else D=this.utc();return D};var p=c.format;c.format=function(_){var y=_||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,y)},c.valueOf=function(){var _=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*_},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var v=c.toDate;c.toDate=function(_){return _==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var x=c.diff;c.diff=function(_,y,m){if(_&&this.$u===_.$u)return x.call(this,_,y,m);var w=this.local(),D=u(_).local();return x.call(w,D,y,m)}}})})(xl);var c1=xl.exports,yl=tt(c1),Dl={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(n,i,a){var u,c=function(p,v,x){x===void 0&&(x={});var _=new Date(p),y=function(m,w){w===void 0&&(w={});var D=w.timeZoneName||"short",C=m+"|"+D,b=r[C];return b||(b=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:m,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:D}),r[C]=b),b}(v,x);return y.formatToParts(_)},f=function(p,v){for(var x=c(p,v),_=[],y=0;y<x.length;y+=1){var m=x[y],w=m.type,D=m.value,C=t[w];C>=0&&(_[C]=parseInt(D,10))}var b=_[3],F=b===24?0:b,B=_[0]+"-"+_[1]+"-"+_[2]+" "+F+":"+_[4]+":"+_[5]+":000",M=+p;return(a.utc(B).valueOf()-(M-=M%1e3))/6e4},h=i.prototype;h.tz=function(p,v){p===void 0&&(p=u);var x=this.utcOffset(),_=this.toDate(),y=_.toLocaleString("en-US",{timeZone:p}),m=Math.round((_-new Date(y))/1e3/60),w=a(y,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(_.getTimezoneOffset()/15)-m,!0);if(v){var D=w.utcOffset();w=w.add(x-D,"minute")}return w.$x.$timezone=p,w},h.offsetName=function(p){var v=this.$x.$timezone||a.tz.guess(),x=c(this.valueOf(),v,{timeZoneName:p}).find(function(_){return _.type.toLowerCase()==="timezonename"});return x&&x.value};var d=h.startOf;h.startOf=function(p,v){if(!this.$x||!this.$x.$timezone)return d.call(this,p,v);var x=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(x,p,v).tz(this.$x.$timezone,!0)},a.tz=function(p,v,x){var _=x&&v,y=x||v||u,m=f(+a(),y);if(typeof p!="string")return a(p).tz(y);var w=function(F,B,M){var O=F-60*B*1e3,A=f(O,M);if(B===A)return[O,B];var N=f(O-=60*(A-B)*1e3,M);return A===N?[O,A]:[F-60*Math.min(A,N)*1e3,Math.max(A,N)]}(a.utc(p,_).valueOf(),m,y),D=w[0],C=w[1],b=a(D).utcOffset(C);return b.$x.$timezone=y,b},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(p){u=p}}})})(Dl);var h1=Dl.exports,d1=tt(h1),wl={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t="week",r="year";return function(n,i,a){var u=i.prototype;u.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var f=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=a(this).startOf(r).add(1,r).date(f),d=a(this).endOf(t);if(h.isBefore(d))return 1}var p=a(this).startOf(r).date(f).startOf(t).subtract(1,"millisecond"),v=this.diff(p,t,!0);return v<0?a(this).startOf("week").week():Math.ceil(v)},u.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(wl);var p1=wl.exports,_1=tt(p1);function or(s,e){return s.replace(/\$(\w+)/g,(t,r)=>String(e[r])||t)}function Rs(s){const e=parseInt(s)||1;let t=s.replace(/\d+/,"");return t==="m"||t==="M"?t="M":t?t=t.toLocaleLowerCase():t="m",[e,t]}function v1(s){const e=/([+-])(\d{1,2})(\d{0,2})/,t=s.replace(/GMT|UTC/,"").match(e);if(!t)throw new Error("Invalid timezone string");const[,r,n,i]=t,a=parseInt(n,10)*60||0,u=parseInt(i,10)||0;return(r==="+"?-1:1)*(a+u)}function Zr(s,e){return e&&(e.startsWith("UTC")||e.startsWith("GMT"))?ot(s).utcOffset(v1(e)):ot(s).tz(e)}function pn(s){const[e,t]=Rs(s);let r=0;switch(t){case"m":r=60;break;case"s":r=1;break;case"M":r=31*24*60*60;break;case"d":r=24*60*60;break;case"w":r=7*24*60*60;break;default:r=60*60;break}return Math.round(Number(e)*r)}function me(s){return typeof s!="number"||isNaN(s)}var an=(s=>(s.BOOL="bool",s.INT="int",s.FLOAT="float",s.ARRAY="array",s.BOX="box",s.CHART_POINT="chart.point",s.COLOR="color",s.CONST="const",s.LABEL="label",s.LINE="line",s.LINEFILL="linefill",s.MAP="map",s.MATRIX="matrix",s.POLYLINE="polyline",s.SERIES="series",s.SIMPLE="simple",s.STRING="string",s.TABLE="table",s.UNDETERMINED="undetermined type",s.INPUT="input",s.NA="na",s.VOID="void",s.ENUM="enum",s))(an||{}),Ps=(s=>(s.dividends="dividends",s.none="none",s.splits="splits",s))(Ps||{}),Vr=(s=>(s.freqAll="freq_all",s.freqOncePerBar="freq_once_per_bar",s.freqOncePerBarClose="freq_once_per_bar_close",s))(Vr||{}),ns=(s=>(s.gapsOff="gaps_off",s.gapsOn="gaps_on",s.lookaheadOff="lookahead_off",s.lookaheadOn="lookahead_on",s))(ns||{}),Zt=(s=>(s.all="all",s.dataWindow="data_window",s.none="none",s.pane="pane",s.priceScale="price_scale",s.statusLine="status_line",s))(Zt||{}),Gr=(s=>(s.both="both",s.left="left",s.none="none",s.right="right",s))(Gr||{}),Je=(s=>(s.inherit="inherit",s.mintick="mintick",s.percent="percent",s.price="price",s.volume="volume",s))(Je||{}),ks=(s=>(s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid",s))(ks||{}),vt=(s=>(s.styleArrowdown="style_arrowdown",s.styleArrowup="style_arrowup",s.styleCircle="style_circle",s.styleCross="style_cross",s.styleDiamond="style_diamond",s.styleFlag="style_flag",s.styleLabelCenter="style_label_center",s.styleLabelDown="style_label_down",s.styleLabelLeft="style_label_left",s.styleLabelLowerLeft="style_label_lower_left",s.styleLabelLowerRight="style_label_lower_right",s.styleLabelRight="style_label_right",s.styleLabelUp="style_label_up",s.styleLabelUpperLeft="style_label_upper_left",s.styleLabelUpperRight="style_label_upper_right",s.styleNone="style_none",s.styleSquare="style_square",s.styleTextOutline="style_text_outline",s.styleTriangledown="style_triangledown",s.styleTriangleup="style_triangleup",s.styleXcross="style_xcross",s))(vt||{}),zt=(s=>(s.styleArrowBoth="style_arrow_both",s.styleArrowLeft="style_arrow_left",s.styleArrowRight="style_arrow_right",s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid",s))(zt||{}),_n=(s=>(s.abovebar="abovebar",s.absolute="absolute",s.belowbar="belowbar",s.bottom="bottom",s.top="top",s))(_n||{}),Qn=(s=>(s.ascending="ascending",s.descending="descending",s))(Qn||{}),Or=(s=>(s.styleArea="Area",s.styleAreabr="Area With Breaks",s.styleCircles="Circles",s.styleColumns="Columns",s.styleCross="Cross",s.styleHistogram="Histogram",s.styleLine="Line",s.styleLinebr="Line With Breaks",s.styleStepline="Step Line",s.styleSteplineDiamond="Step Line With Diamonds",s.styleSteplinebr="Step line with Breaks",s))(Or||{}),br=(s=>(s.bottomCenter="bottom_center",s.bottomLeft="bottom_left",s.bottomRight="bottom_right",s.middleCenter="middle_center",s.middleLeft="middle_left",s.middleRight="middle_right",s.topCenter="top_center",s.topLeft="top_left",s.topRight="top_right",s))(br||{}),zs=(s=>(s.left="left",s.none="none",s.right="right",s))(zs||{}),qs=(s=>(s.extended="extended",s.regular="regular",s))(qs||{}),_r=(s=>(s.arrowdown="arrowdown",s.arrowup="arrowup",s.circle="circle",s.cross="cross",s.diamond="diamond",s.flag="flag",s.labeldown="labeldown",s.labelup="labelup",s.square="square",s.triangledown="triangledown",s.triangleup="triangleup",s.xcross="xcross",s))(_r||{}),ar=(s=>(s.auto="auto",s.huge="huge",s.large="large",s.normal="normal",s.small="small",s.tiny="tiny",s))(ar||{}),Jn=(s=>(s.familyDefault="default",s.familyMonospace="monospace",s))(Jn||{}),Lt=(s=>(s.cash="cash",s.fixed="fixed",s.percentOfEquity="percent_of_equity",s))(Lt||{}),Ir=(s=>(s.cashPerContract="cash_per_contract",s.cashPerOrder="cash_per_order",s.percent="percent",s))(Ir||{}),gt=(s=>(s.all="all",s.long="long",s.short="short",s))(gt||{}),vn=(s=>(s.cancel="cancel",s.none="none",s.reduce="reduce",s))(vn||{}),je=(s=>(s.alignBottom="align_bottom",s.alignCenter="align_center",s.alignLeft="align_left",s.alignRight="align_right",s.alignTop="align_top",s.wrapAuto="wrap_auto",s.wrapNone="wrap_none",s))(je||{}),wt=(s=>(s.bar_index="bar_index",s.bar_time="bar_time",s))(wt||{}),Kr=(s=>(s.abovebar="abovebar",s.belowbar="belowbar",s.price="price",s))(Kr||{}),Us=(s=>(s.actual="actual",s.estimate="estimate",s.standardized="standardized",s))(Us||{}),ei=(s=>(s.traditional="Traditional",s.fibonacci="Fibonacci",s.woodie="Woodie",s.classic="Classic",s.dm="DM",s.camarilla="Camarilla",s))(ei||{}),ur=(s=>(s.INT="int",s.BOOL="bool",s.TIME="time",s.COLOR="color",s.FLOAT="float",s.PRICE="price",s.SOURCE="source",s.STRING="string",s.SYMBOL="symbol",s.SESSION="session",s.TEXT_AREA="text_area",s.TIMEFRAME="timeframe",s.ENUM="enum",s))(ur||{}),Ve=(s=>(s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error",s))(Ve||{});class g1{constructor(e){U(this,"_errorListener");this._errorListener=e}new({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_float({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_int({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_color({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_bool({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_string({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_line({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_box({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_table({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_linefill({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}new_label({size:e,initial_value:t}={}){return new it(e,t,this._errorListener)}copy({id:e}){return e==null?void 0:e.copy()}slice({id:e,index_from:t,index_to:r}){return e==null?void 0:e.slice({index_from:t,index_to:r})}size({id:e}){return e==null?void 0:e.size()}first({id:e}){return e==null?void 0:e.first()}abs({id:e},t){return e==null?void 0:e.abs(t)}avg({id:e},t){return e==null?void 0:e.avg(t)}binary_search({id:e,val:t},r){return e==null?void 0:e.binary_search({val:t},r)}binary_search_leftmost({id:e,val:t},r){return e==null?void 0:e.binary_search_leftmost({val:t},r)}binary_search_rightmost({id:e,val:t},r){return e==null?void 0:e.binary_search_rightmost({val:t},r)}clear({id:e}){e==null||e.clear()}concat({id1:e,id2:t}){return e==null?void 0:e.concat({id2:t})}covariance({id1:e,id2:t,biased:r},n){return e==null?void 0:e.covariance({id2:t,biased:r},n)}every({id:e},t){return e==null?void 0:e.every(t)}from(e,t){const r=new it(0,void 0,this._errorListener);return r._value=t,r}fill({id:e,value:t,index_from:r,index_to:n}){e==null||e.fill({value:t,index_from:r,index_to:n})}get({id:e,index:t}){return e==null?void 0:e.get({index:t})}includes({id:e,value:t}){return e==null?void 0:e.includes({value:t})}indexof({id:e,value:t}){return e==null?void 0:e.indexof({value:t})}insert({id:e,index:t,value:r}){e==null||e.insert({index:t,value:r})}join({id:e,separator:t},r){return e==null?void 0:e.join({separator:t},r)}last({id:e}){return e==null?void 0:e.last()}lastindexof({id:e,value:t}){return e==null?void 0:e.lastindexof({value:t})}max({id:e,nth:t},r){return e==null?void 0:e.max({nth:t},r)}median({id:e},t){return e==null?void 0:e.median(t)}min({id:e,nth:t},r){return e==null?void 0:e.min({nth:t},r)}mode({id:e},t){return e==null?void 0:e.mode(t)}percentile_linear_interpolation({id:e,percentage:t},r){return e==null?void 0:e.percentile_linear_interpolation({percentage:t},r)}percentile_nearest_rank({id:e,percentage:t},r){return e==null?void 0:e.percentile_nearest_rank({percentage:t},r)}percentrank({id:e,index:t},r){return e==null?void 0:e.percentrank({index:t},r)}pop({id:e}){return e==null?void 0:e.pop()}push({id:e,value:t}){e==null||e.push({value:t})}range({id:e},t){return e==null?void 0:e.range(t)}remove({id:e,index:t}){return e==null?void 0:e.remove({index:t})}reverse({id:e}){return e==null?void 0:e.reverse()}set({id:e,index:t,value:r}){e==null||e.set({index:t,value:r})}shift({id:e}){return e==null?void 0:e.shift()}some({id:e},t){return e==null?void 0:e.some(t)}sort({id:e,order:t},r){e==null||e.sort({order:t},r)}sort_indices({id:e,order:t},r){return e==null?void 0:e.sort_indices({order:t},r)}standardize({id:e},t){return e==null?void 0:e.standardize(t)}stdev({id:e,biased:t},r){return e==null?void 0:e.stdev({biased:t},r)}sum({id:e},t){return e==null?void 0:e.sum(t)}unshift({id:e,value:t}){e==null||e.unshift({value:t})}variance({id:e,biased:t},r){return e==null?void 0:e.variance({biased:t},r)}}class it{constructor(e=0,t,r){U(this,"_arrInstance");U(this,"_errorListener");this._errorListener=r,this._arrInstance=Array.from(new Array(e||0),()=>Yr.cloneDeep(t))}get isArray(){return!0}get _value(){return[...this._arrInstance]}set _value(e){this._arrInstance=[...e]}_deepCopyData(e){this._arrInstance=Yr.cloneDeep(e)}_copyData(e){this._arrInstance=e}copy(){const e=new it(0,void 0,this._errorListener);return e._deepCopyData(this._arrInstance),e}slice({index_from:e,index_to:t}){const r=new it(0,void 0,this._errorListener);return r._copyData(this._arrInstance.slice(e,t)),r}size(){return this._arrInstance.length}first(){return this._arrInstance[0]}abs(e){const t=new it(0,void 0,this._errorListener);this._verifySimpleType("number","abs","int/float",e);const r=this._arrInstance.map(n=>Math.abs(n));return t._copyData(r),t}avg(e){return this._verifySimpleType("number","avg","int/float",e),Yr.mean(this._arrInstance)}binary_search({val:e},t){return this._verifySimpleType("number","binary_search","int/float",t),me(e)?-1:this._binarySearch(this._arrInstance,e)}binary_search_leftmost({val:e},t){return this._verifySimpleType("number","binary_search_leftmost","int/float",t),me(e)?this._arrInstance.length-1:this._binarySearchLeftMost(this._arrInstance,e)}binary_search_rightmost({val:e},t){return this._verifySimpleType("number","binary_search_rightmost","int/float",t),me(e)?this._arrInstance.length:this._binarySearchRightMost(this._arrInstance,e)}clear(){this._arrInstance=[]}concat({id2:e}){return this._arrInstance=this._arrInstance.concat(e==null?void 0:e._value),this}covariance({id2:e,biased:t},r){return this._verifySimpleType("number","covariance","int/float",r),this._verifySimpleType("number","covariance","int/float",r,e==null?void 0:e._value),this._covariance(this._arrInstance,e._value,t,r)}every(e){return this._verifySimpleType("number|boolean","every","int/float/bool",e),this._arrInstance.every(t=>!!t)}fill({value:e,index_from:t=0,index_to:r}){this._arrInstance=this._setElements(this._arrInstance,e,t,r)}get({index:e}){if(!me(e))return this._arrInstance[e]}includes({value:e}){return this._arrInstance.includes(e)}indexof({value:e}){return this._arrInstance.indexOf(e)}insert({index:e,value:t}){me(e)||this._arrInstance.splice(e,0,t)}join({separator:e}={},t){return this._verifySimpleType("number|string","join","int/float/string",t),this._arrInstance.join(e)}last(){return this._arrInstance[this._arrInstance.length-1]}lastindexof({value:e}){return this._arrInstance.lastIndexOf(e)}max({nth:e}={},t){return this._verifySimpleType("number","max","int/float",t),this._maxNth([...this._arrInstance],e)}median(e){return this._verifySimpleType("number","median","int/float",e),this._median([...this._arrInstance])}min({nth:e}={},t){return this._verifySimpleType("number","min","int/float",t),this._minNth([...this._arrInstance],e)}mode(e){return this._verifySimpleType("number","mode","int/float",e),this._mode([...this._arrInstance])}percentile_linear_interpolation({percentage:e},t){return this._verifySimpleType("number","percentile_linear_interpolation","int/float",t),this._percentileLinearInterpolation([...this._arrInstance],e)}percentile_nearest_rank({percentage:e=0},t){var r;if(this._arrInstance.length===0||e<0||e>100||me(e)){(r=this._errorListener)==null||r.addError("Invalid percentile or empty array",t,Ve.Error);return}return this._verifySimpleType("number","percentile_nearest_rank","int/float",t),this._getNearestRankPercentile([...this._arrInstance],e)}percentrank({index:e},t){return this._verifySimpleType("number","percentrank","int/float",t),this._getPercentileRank([...this._arrInstance],e)}pop(){return this._arrInstance.pop()}push({value:e}){this._arrInstance.push(e)}range(e){var i;if(this._arrInstance.length===0){(i=this._errorListener)==null||i.addError("Array must not be empty",e,Ve.Error);return}this._verifySimpleType("number","range","int/float",e);const t=Math.min(...this._arrInstance);return Math.max(...this._arrInstance)-t}remove({index:e}){if(!me(e))return this._arrInstance.splice(e,1)[0]}reverse(){this._arrInstance.reverse()}set({index:e,value:t}){me(e)||(this._arrInstance[e]=t)}shift(){return this._arrInstance.shift()}some(e){return this._verifySimpleType("number|boolean","some","int/float/bool",e),this._arrInstance.some(t=>!!t)}sort({order:e}={},t){this._verifySimpleType("number","sort","int/float",t),this._arrInstance.sort((r,n)=>e!==Qn.descending?r-n:n-r)}sort_indices({order:e}={},t){this._verifySimpleType("number","sort_indices","int/float",t);const r=this._arrInstance.map((i,a)=>a);r.sort((i,a)=>e!==Qn.descending?this._arrInstance[i]-this._arrInstance[a]:this._arrInstance[a]-this._arrInstance[i]);const n=new it(0,void 0,this._errorListener);return n._copyData(r),n}standardize(e){this._verifySimpleType("number","standardize","int/float",e);const t=new it(0,void 0,this._errorListener);return t._copyData(this._standardizeArray([...this._arrInstance])),t}stdev({biased:e}={},t){var r;if(this._arrInstance.length===0){(r=this._errorListener)==null||r.addError("Array must not be empty",t,Ve.Error);return}return this._verifySimpleType("number","stdev","int/float",t),this._calculateStandardDeviations([...this._arrInstance],e)}sum(e){return this._verifySimpleType("number","sum","int/float",e),this._arrInstance.reduce((r,n)=>r+(n||0),0)}unshift({value:e}){this._arrInstance.unshift(e)}variance({biased:e}={},t){var r;if(this._arrInstance.length===0){(r=this._errorListener)==null||r.addError("Array must not be empty",t,Ve.Error);return}return this._verifySimpleType("number","variance","int/float",t),this._calculateVariances([...this._arrInstance],e)}_calculateVariances(e,t=!0){const r=e.reduce((a,u)=>a+(u||0),0)/e.length,n=e.reduce((a,u)=>a+((u||0)-r)**2,0),i=n/e.length;return t?i:e.length>1?n/(e.length-1):i}_calculateStandardDeviations(e,t=!0){const r=e.reduce((a,u)=>a+(u||0),0)/e.length,n=e.reduce((a,u)=>{const c=(u||0)-r;return a+c*c},0),i=Math.sqrt(n/e.length);return t?i:e.length>1?Math.sqrt(n/(e.length-1)):i}_standardizeArray(e){const t=e.reduce((i,a)=>i+(a||0),0)/e.length,r=Math.sqrt(e.reduce((i,a)=>i+Math.pow((a||0)-t,2),0)/e.length);return e.map(i=>((i||0)-t)/r)}_getPercentileRank(e,t=0){if(me(t))return;const r=e[t];let n=0;for(let a=0;a<e.length;a++)(e[a]<r||e[a]===r&&a!=t)&&n++;return n/(e.length-1)*100}_getNearestRankPercentile(e,t=0){const r=e.slice().sort((a,u)=>a-u),n=t/100*r.length,i=Math.ceil(n)-1;return r[i>=r.length?r.length-1:i]}_percentileLinearInterpolation(e,t=0){if(t<0||t>100||me(t))return;e.sort(function(i,a){return i-a});const r=e.length;t/=100;const n=1/(r*2);if(t<=n)return e[0];if(t>=1-1/(r*2))return e[r-1];for(const[i,a]of e.entries()){const u=e[i-1];if(t<(i+.5)/r)return u+(a-u)*(t-(i-.5)/r)/(1/r)}}_mode(e){const t={};let r=0;const n=[];for(const i of e)t[i]=(t[i]||0)+1,r=Math.max(r,t[i]);for(const i in t)t[i]===r&&n.push(Number(i));return Math.min(...r===1?e:n)}_median(e){e.sort(function(r,n){return r-n});const t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}_minNth(e,t=0){return e.sort(function(r,n){return r-n}),e[t]}_maxNth(e,t=0){return e.sort(function(r,n){return n-r}),e[t]}_setElements(e,t,r=0,n){n===void 0&&(n=e.length);for(let i=r;i<n;i++)e[i]=t;return e}_covariance(e,t,r=!0,n){var c;if(e.length!=t.length){(c=this._errorListener)==null||c.addError("Arrays have different lengths",n,Ve.Error);return}e=e.filter(f=>f!==void 0),t=t.filter(f=>f!==void 0);const i=e.reduce((f,h)=>f+h,0)/e.length,a=t.reduce((f,h)=>f+h,0)/t.length;let u=0;for(let f=0;f<e.length;f++)u+=(e[f]-i)*(t[f]-a);return r?u/e.length:u/(e.length-1)}_verifySimpleType(e,t,r,n,i=this._arrInstance){var u;i.filter(c=>c!==void 0).some(c=>!e.split("|").includes(typeof c))&&((u=this._errorListener)==null||u.addError(`数组类型错误,array.${t}方法只能使用${r}类型数组!`,n,Ve.Error))}_binarySearch(e,t){let r=0,n=e.length-1;for(;r<=n;){const i=Math.floor((r+n)/2);if(e[i]===t)return i;e[i]<t?r=i+1:n=i-1}return-1}_binarySearchLeftMost(e,t){let r=0,n=e.length-1;const i=[];for(;r<=n;){const a=Math.floor((r+n)/2);e[a]===t&&i.push(a),e[a]<t?r=a+1:n=a-1}return i.length?Math.min(...i):r-1}_binarySearchRightMost(e,t){let r=0,n=e.length-1;const i=[];for(;r<=n;){const a=Math.floor((r+n)/2);e[a]===t&&i.push(a),e[a]<=t?r=a+1:n=a-1}return i.length?Math.max(...i):r}}class m1{constructor(e,t){U(this,"_randomNums");U(this,"_mintick");U(this,"_cacheData");U(this,"_barIndex");U(this,"_errorListener");this._mintick=e,this._randomNums={},this._cacheData={},this._barIndex=0,this._errorListener=t}update(e){this._barIndex=e,this._randomNums={}}abs({number:e}){if(!me(e))return Math.abs(e)}acos({angle:e}){if(me(e))return;const t=Math.acos(e);return isNaN(t)?void 0:t}asin({angle:e}){if(me(e))return;const t=Math.asin(e);return isNaN(t)?void 0:t}atan({angle:e}){if(me(e))return;const t=Math.atan(e);return isNaN(t)?void 0:t}avg(e,t){return Yr.mean(t)}ceil({number:e}){if(!me(e))return Math.ceil(e)}floor({number:e}){if(!me(e))return Math.floor(e)}cos({angle:e}){if(me(e))return;const t=Math.cos(e);return isNaN(t)?void 0:t}sin({angle:e}){if(me(e))return;const t=Math.sin(e);return isNaN(t)?void 0:t}tan({angle:e}){if(me(e))return;const t=Math.tan(e);return isNaN(t)?void 0:t}exp({number:e}){if(!me(e))return Math.exp(e)}log({number:e}){if(!me(e))return Math.log(e)}log10({number:e}){if(!me(e))return Math.log10(e)}max(e,t){return t=t.filter(r=>!me(r)),Math.max(...t)}min(e,t){return t=t.filter(r=>!me(r)),Math.min(...t)}pow({base:e,exponent:t}){if(!(me(e)||me(t)))return Math.pow(e,t)}random({min:e=0,max:t=1,seed:r},n){if(me(e)&&(e=0),me(t)&&(t=1),r&&this._randomNums[r])return this._randomNums[r];if(e>=t){this._errorListener.addError("min must be less than max",n,Ve.Error);return}let i;do i=Math.random()*(t-e)+e;while(i===e||i===t);return r&&(this._randomNums[r]=i),i}round({number:e,precision:t}){if(!me(e))return me(t)?Math.round(e):Number(e==null?void 0:e.toFixed(t))}round_to_mintick({number:e}){if(!me(e))return Number(e==null?void 0:e.toFixed(this._mintick))}sign({number:e}){if(!me(e))return e&&Math.sign(e)}sqrt({number:e}){if(!me(e))return Math.sqrt(e)}sum({source:e,length:t=1},r){let n=this._cacheData[`sum_${r}`];n||(n=[]),n[this._barIndex]=e,this._cacheData[`sum_${r}`]=n;const i=n.filter(a=>!me(a));if(!(i.length<t))return Yr.sum(i.slice(-t))}todegrees({radians:e}){if(!me(e))return e*(180/Math.PI)}toradians({degrees:e}){if(!me(e))return e*(Math.PI/180)}}function Ws(){return Ws=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(s[r]=t[r])}return s},Ws.apply(this,arguments)}var bl={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function pt(s){return typeof s=="number"}function St(s){return!s||typeof s!="object"||typeof s.constructor!="function"?!1:s.isBigNumber===!0&&typeof s.constructor.prototype=="object"&&s.constructor.prototype.isBigNumber===!0||typeof s.constructor.isDecimal=="function"&&s.constructor.isDecimal(s)===!0}function El(s){return s&&typeof s=="object"&&Object.getPrototypeOf(s).isComplex===!0||!1}function Al(s){return s&&typeof s=="object"&&Object.getPrototypeOf(s).isFraction===!0||!1}function Cl(s){return s&&s.constructor.prototype.isUnit===!0||!1}function un(s){return typeof s=="string"}var Ct=Array.isArray;function mt(s){return s&&s.constructor.prototype.isMatrix===!0||!1}function is(s){return Array.isArray(s)||mt(s)}function x1(s){return s&&s.isDenseMatrix&&s.constructor.prototype.isMatrix===!0||!1}function y1(s){return s&&s.isSparseMatrix&&s.constructor.prototype.isMatrix===!0||!1}function D1(s){return s&&s.constructor.prototype.isRange===!0||!1}function Aa(s){return s&&s.constructor.prototype.isIndex===!0||!1}function w1(s){return typeof s=="boolean"}function b1(s){return s&&s.constructor.prototype.isResultSet===!0||!1}function E1(s){return s&&s.constructor.prototype.isHelp===!0||!1}function A1(s){return typeof s=="function"}function C1(s){return s instanceof Date}function F1(s){return s instanceof RegExp}function Ca(s){return!!(s&&typeof s=="object"&&s.constructor===Object&&!El(s)&&!Al(s))}function B1(s){return s===null}function M1(s){return s===void 0}function N1(s){return s&&s.isAccessorNode===!0&&s.constructor.prototype.isNode===!0||!1}function S1(s){return s&&s.isArrayNode===!0&&s.constructor.prototype.isNode===!0||!1}function O1(s){return s&&s.isAssignmentNode===!0&&s.constructor.prototype.isNode===!0||!1}function I1(s){return s&&s.isBlockNode===!0&&s.constructor.prototype.isNode===!0||!1}function T1(s){return s&&s.isConditionalNode===!0&&s.constructor.prototype.isNode===!0||!1}function $1(s){return s&&s.isConstantNode===!0&&s.constructor.prototype.isNode===!0||!1}function L1(s){return s&&s.isFunctionAssignmentNode===!0&&s.constructor.prototype.isNode===!0||!1}function R1(s){return s&&s.isFunctionNode===!0&&s.constructor.prototype.isNode===!0||!1}function P1(s){return s&&s.isIndexNode===!0&&s.constructor.prototype.isNode===!0||!1}function k1(s){return s&&s.isNode===!0&&s.constructor.prototype.isNode===!0||!1}function z1(s){return s&&s.isObjectNode===!0&&s.constructor.prototype.isNode===!0||!1}function q1(s){return s&&s.isOperatorNode===!0&&s.constructor.prototype.isNode===!0||!1}function U1(s){return s&&s.isParenthesisNode===!0&&s.constructor.prototype.isNode===!0||!1}function W1(s){return s&&s.isRangeNode===!0&&s.constructor.prototype.isNode===!0||!1}function H1(s){return s&&s.isRelationalNode===!0&&s.constructor.prototype.isNode===!0||!1}function j1(s){return s&&s.isSymbolNode===!0&&s.constructor.prototype.isNode===!0||!1}function Y1(s){return s&&s.constructor.prototype.isChain===!0||!1}function Sn(s){var e=typeof s;return e==="object"?s===null?"null":St(s)?"BigNumber":s.constructor&&s.constructor.name?s.constructor.name:"Object":e}function ut(s){var e=typeof s;if(e==="number"||e==="string"||e==="boolean"||s===null||s===void 0)return s;if(typeof s.clone=="function")return s.clone();if(Array.isArray(s))return s.map(function(t){return ut(t)});if(s instanceof Date)return new Date(s.valueOf());if(St(s))return s;if(Ca(s))return Z1(s,ut);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(s,")"))}function Z1(s,e){var t={};for(var r in s)ss(s,r)&&(t[r]=e(s[r]));return t}function Fl(s,e){for(var t in e)ss(e,t)&&(s[t]=e[t]);return s}function yi(s,e){var t,r,n;if(Array.isArray(s)){if(!Array.isArray(e)||s.length!==e.length)return!1;for(r=0,n=s.length;r<n;r++)if(!yi(s[r],e[r]))return!1;return!0}else{if(typeof s=="function")return s===e;if(s instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(t in s)if(!(t in e)||!yi(s[t],e[t]))return!1;for(t in e)if(!(t in s))return!1;return!0}else return s===e}}function ss(s,e){return s&&Object.hasOwnProperty.call(s,e)}function V1(s,e){for(var t={},r=0;r<e.length;r++){var n=e[r],i=s[n];i!==void 0&&(t[n]=i)}return t}var G1=["Matrix","Array"],K1=["number","BigNumber","Fraction"],Er=function(e){if(e)throw new Error(`The global config is readonly.
28
28
  Please create a mathjs instance if you want to change the default configuration.
29
29
  Example:
30
30
 
31
31
  import { create, all } from 'mathjs';
32
32
  const mathjs = create(all);
33
33
  mathjs.config({ number: 'BigNumber' });
34
- `);return Object.freeze(bl)};Ws(Er,bl,{MATRIX_OPTIONS:G1,NUMBER_OPTIONS:K1});function Bl(){return!0}function Tr(){return!1}function Di(){}const Ml="Argument is not a typed-function.";function Nl(){function s(P){return typeof P=="object"&&P!==null&&P.constructor===Object}const e=[{name:"number",test:function(P){return typeof P=="number"}},{name:"string",test:function(P){return typeof P=="string"}},{name:"boolean",test:function(P){return typeof P=="boolean"}},{name:"Function",test:function(P){return typeof P=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(P){return P instanceof Date}},{name:"RegExp",test:function(P){return P instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(P){return P===null}},{name:"undefined",test:function(P){return P===void 0}}],t={name:"any",test:Bl,isAny:!0};let r,n,i=0,a={createCount:0};function u(P){const V=r.get(P);if(V)return V;let J='Unknown type "'+P+'"';const ie=P.toLowerCase();let ue;for(ue of n)if(ue.toLowerCase()===ie){J+='. Did you mean "'+ue+'" ?';break}throw new TypeError(J)}function f(P){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const J=V?u(V).index:n.length,ie=[];for(let se=0;se<P.length;++se){if(!P[se]||typeof P[se].name!="string"||typeof P[se].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const _e=P[se].name;if(r.has(_e))throw new TypeError('Duplicate type name "'+_e+'"');ie.push(_e),r.set(_e,{name:_e,test:P[se].test,isAny:P[se].isAny,index:J+se,conversionsTo:[]})}const ue=n.slice(J);n=n.slice(0,J).concat(ie).concat(ue);for(let se=J+ie.length;se<n.length;++se)r.get(n[se]).index=se}function c(){r=new Map,n=[],i=0,f([t],!1)}c(),f(e);function h(){let P;for(P of n)r.get(P).conversionsTo=[];i=0}function d(P){const V=n.filter(J=>{const ie=r.get(J);return!ie.isAny&&ie.test(P)});return V.length?V:["any"]}function p(P){return P&&typeof P=="function"&&"_typedFunctionData"in P}function v(P,V,J){if(!p(P))throw new TypeError(Ml);const ie=J&&J.exact,ue=Array.isArray(V)?V.join(","):V,se=C(ue),_e=y(se);if(!ie||_e in P.signatures){const Xe=P._typedFunctionData.signatureMap.get(_e);if(Xe)return Xe}const he=se.length;let de;if(ie){de=[];let Xe;for(Xe in P.signatures)de.push(P._typedFunctionData.signatureMap.get(Xe))}else de=P._typedFunctionData.signatures;for(let Xe=0;Xe<he;++Xe){const et=se[Xe],ht=[];let kt;for(kt of de){const It=M(kt.params,Xe);if(!(!It||et.restParam&&!It.restParam)){if(!It.hasAny){const rr=D(It);if(et.types.some(fr=>!rr.has(fr.name)))continue}ht.push(kt)}}if(de=ht,de.length===0)break}let fe;for(fe of de)if(fe.params.length<=he)return fe;throw new TypeError("Signature not found (signature: "+(P.name||"unnamed")+"("+y(se,", ")+"))")}function x(P,V,J){return v(P,V,J).implementation}function _(P,V){const J=u(V);if(J.test(P))return P;const ie=J.conversionsTo;if(ie.length===0)throw new Error("There are no conversions to "+V+" defined.");for(let ue=0;ue<ie.length;ue++)if(u(ie[ue].from).test(P))return ie[ue].convert(P);throw new Error("Cannot convert "+P+" to "+V)}function y(P){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return P.map(J=>J.name).join(V)}function m(P){const V=P.indexOf("...")===0,ie=(V?P.length>3?P.slice(3):"any":P).split("|").map(he=>u(he.trim()));let ue=!1,se=V?"...":"";return{types:ie.map(function(he){return ue=he.isAny||ue,se+=he.name+"|",{name:he.name,typeIndex:he.index,test:he.test,isAny:he.isAny,conversion:null,conversionIndex:-1}}),name:se.slice(0,-1),hasAny:ue,hasConversion:!1,restParam:V}}function w(P){const V=P.types.map(_e=>_e.name),J=G(V);let ie=P.hasAny,ue=P.name;const se=J.map(function(_e){const he=u(_e.from);return ie=he.isAny||ie,ue+="|"+_e.from,{name:_e.from,typeIndex:he.index,test:he.test,isAny:he.isAny,conversion:_e,conversionIndex:_e.index}});return{types:P.types.concat(se),name:ue,hasAny:ie,hasConversion:se.length>0,restParam:P.restParam}}function D(P){return P.typeSet||(P.typeSet=new Set,P.types.forEach(V=>P.typeSet.add(V.name))),P.typeSet}function C(P){const V=[];if(typeof P!="string")throw new TypeError("Signatures must be strings");const J=P.trim();if(J==="")return V;const ie=J.split(",");for(let ue=0;ue<ie.length;++ue){const se=m(ie[ue].trim());if(se.restParam&&ue!==ie.length-1)throw new SyntaxError('Unexpected rest parameter "'+ie[ue]+'": only allowed for the last parameter');if(se.types.length===0)return null;V.push(se)}return V}function b(P){const V=Oe(P);return V?V.restParam:!1}function F(P){if(!P||P.types.length===0)return Bl;if(P.types.length===1)return u(P.types[0].name).test;if(P.types.length===2){const V=u(P.types[0].name).test,J=u(P.types[1].name).test;return function(ue){return V(ue)||J(ue)}}else{const V=P.types.map(function(J){return u(J.name).test});return function(ie){for(let ue=0;ue<V.length;ue++)if(V[ue](ie))return!0;return!1}}}function B(P){let V,J,ie;if(b(P)){V=be(P).map(F);const ue=V.length,se=F(Oe(P)),_e=function(he){for(let de=ue;de<he.length;de++)if(!se(he[de]))return!1;return!0};return function(de){for(let fe=0;fe<V.length;fe++)if(!V[fe](de[fe]))return!1;return _e(de)&&de.length>=ue+1}}else return P.length===0?function(se){return se.length===0}:P.length===1?(J=F(P[0]),function(se){return J(se[0])&&se.length===1}):P.length===2?(J=F(P[0]),ie=F(P[1]),function(se){return J(se[0])&&ie(se[1])&&se.length===2}):(V=P.map(F),function(se){for(let _e=0;_e<V.length;_e++)if(!V[_e](se[_e]))return!1;return se.length===V.length})}function M(P,V){return V<P.length?P[V]:b(P)?Oe(P):null}function O(P,V){const J=M(P,V);return J?D(J):new Set}function A(P){return P.conversion===null||P.conversion===void 0}function N(P,V){const J=new Set;return P.forEach(ie=>{const ue=O(ie.params,V);let se;for(se of ue)J.add(se)}),J.has("any")?["any"]:Array.from(J)}function I(P,V,J){let ie,ue;const se=P||"unnamed";let _e=J,he;for(he=0;he<V.length;he++){const et=[];if(_e.forEach(ht=>{const kt=M(ht.params,he),It=F(kt);(he<ht.params.length||b(ht.params))&&It(V[he])&&et.push(ht)}),et.length===0){if(ue=N(_e,he),ue.length>0){const ht=d(V[he]);return ie=new TypeError("Unexpected type of argument in function "+se+" (expected: "+ue.join(" or ")+", actual: "+ht.join(" | ")+", index: "+he+")"),ie.data={category:"wrongType",fn:se,index:he,actual:ht,expected:ue},ie}}else _e=et}const de=_e.map(function(et){return b(et.params)?1/0:et.params.length});if(V.length<Math.min.apply(null,de))return ue=N(_e,he),ie=new TypeError("Too few arguments in function "+se+" (expected: "+ue.join(" or ")+", index: "+V.length+")"),ie.data={category:"tooFewArgs",fn:se,index:V.length,expected:ue},ie;const fe=Math.max.apply(null,de);if(V.length>fe)return ie=new TypeError("Too many arguments in function "+se+" (expected: "+fe+", actual: "+V.length+")"),ie.data={category:"tooManyArgs",fn:se,index:V.length,expectedLength:fe},ie;const Xe=[];for(let et=0;et<V.length;++et)Xe.push(d(V[et]).join("|"));return ie=new TypeError('Arguments of type "'+Xe.join(", ")+'" do not match any of the defined signatures of function '+se+"."),ie.data={category:"mismatch",actual:Xe},ie}function R(P){let V=n.length+1;for(let J=0;J<P.types.length;J++)A(P.types[J])&&(V=Math.min(V,P.types[J].typeIndex));return V}function k(P){let V=i+1;for(let J=0;J<P.types.length;J++)A(P.types[J])||(V=Math.min(V,P.types[J].conversionIndex));return V}function z(P,V){if(P.hasAny){if(!V.hasAny)return 1}else if(V.hasAny)return-1;if(P.restParam){if(!V.restParam)return 1}else if(V.restParam)return-1;if(P.hasConversion){if(!V.hasConversion)return 1}else if(V.hasConversion)return-1;const J=R(P)-R(V);if(J<0)return-1;if(J>0)return 1;const ie=k(P)-k(V);return ie<0?-1:ie>0?1:0}function L(P,V){const J=P.params,ie=V.params,ue=Oe(J),se=Oe(ie),_e=b(J),he=b(ie);if(_e&&ue.hasAny){if(!he||!se.hasAny)return 1}else if(he&&se.hasAny)return-1;let de=0,fe=0,Xe;for(Xe of J)Xe.hasAny&&++de,Xe.hasConversion&&++fe;let et=0,ht=0;for(Xe of ie)Xe.hasAny&&++et,Xe.hasConversion&&++ht;if(de!==et)return de-et;if(_e&&ue.hasConversion){if(!he||!se.hasConversion)return 1}else if(he&&se.hasConversion)return-1;if(fe!==ht)return fe-ht;if(_e){if(!he)return 1}else if(he)return-1;const kt=(J.length-ie.length)*(_e?-1:1);if(kt!==0)return kt;const It=[];let rr=0;for(let en=0;en<J.length;++en){const Dn=z(J[en],ie[en]);It.push(Dn),rr+=Dn}if(rr!==0)return rr;let fr;for(fr of It)if(fr!==0)return fr;return 0}function G(P){if(P.length===0)return[];const V=P.map(u);P.length>1&&V.sort((ue,se)=>ue.index-se.index);let J=V[0].conversionsTo;if(P.length===1)return J;J=J.concat([]);const ie=new Set(P);for(let ue=1;ue<V.length;++ue){let se;for(se of V[ue].conversionsTo)ie.has(se.from)||(J.push(se),ie.add(se.from))}return J}function H(P,V){let J=V;if(P.some(ue=>ue.hasConversion)){const ue=b(P),se=P.map(ee);J=function(){const he=[],de=ue?arguments.length-1:arguments.length;for(let fe=0;fe<de;fe++)he[fe]=se[fe](arguments[fe]);return ue&&(he[de]=arguments[de].map(se[de])),V.apply(this,he)}}let ie=J;if(b(P)){const ue=P.length-1;ie=function(){return J.apply(this,Fe(arguments,0,ue).concat([Fe(arguments,ue)]))}}return ie}function ee(P){let V,J,ie,ue;const se=[],_e=[];switch(P.types.forEach(function(he){he.conversion&&(se.push(u(he.conversion.from).test),_e.push(he.conversion.convert))}),_e.length){case 0:return function(de){return de};case 1:return V=se[0],ie=_e[0],function(de){return V(de)?ie(de):de};case 2:return V=se[0],J=se[1],ie=_e[0],ue=_e[1],function(de){return V(de)?ie(de):J(de)?ue(de):de};default:return function(de){for(let fe=0;fe<_e.length;fe++)if(se[fe](de))return _e[fe](de);return de}}}function te(P){function V(J,ie,ue){if(ie<J.length){const se=J[ie];let _e=[];if(se.restParam){const he=se.types.filter(A);he.length<se.types.length&&_e.push({types:he,name:"..."+he.map(de=>de.name).join("|"),hasAny:he.some(de=>de.isAny),hasConversion:!1,restParam:!0}),_e.push(se)}else _e=se.types.map(function(he){return{types:[he],name:he.name,hasAny:he.isAny,hasConversion:he.conversion,restParam:!1}});return Ye(_e,function(he){return V(J,ie+1,ue.concat([he]))})}else return[ue]}return V(P,0,[])}function j(P,V){const J=Math.max(P.length,V.length);for(let he=0;he<J;he++){const de=O(P,he),fe=O(V,he);let Xe=!1,et;for(et of fe)if(de.has(et)){Xe=!0;break}if(!Xe)return!1}const ie=P.length,ue=V.length,se=b(P),_e=b(V);return se?_e?ie===ue:ue>=ie:_e?ie>=ue:ie===ue}function X(P){return P.map(V=>Et(V)?xt(V.referToSelf.callback):Ut(V)?Re(V.referTo.references,V.referTo.callback):V)}function Y(P,V,J){const ie=[];let ue;for(ue of P){let se=J[ue];if(typeof se!="number")throw new TypeError('No definition for referenced signature "'+ue+'"');if(se=V[se],typeof se!="function")return!1;ie.push(se)}return ie}function Q(P,V,J){const ie=X(P),ue=new Array(ie.length).fill(!1);let se=!0;for(;se;){se=!1;let _e=!0;for(let he=0;he<ie.length;++he){if(ue[he])continue;const de=ie[he];if(Et(de))ie[he]=de.referToSelf.callback(J),ie[he].referToSelf=de.referToSelf,ue[he]=!0,_e=!1;else if(Ut(de)){const fe=Y(de.referTo.references,ie,V);fe?(ie[he]=de.referTo.callback.apply(this,fe),ie[he].referTo=de.referTo,ue[he]=!0,_e=!1):se=!0}}if(_e&&se)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return ie}function pe(P){const V=/\bthis(\(|\.signatures\b)/;Object.keys(P).forEach(J=>{const ie=P[J];if(V.test(ie.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function De(P,V){if(a.createCount++,Object.keys(V).length===0)throw new SyntaxError("No signatures provided");a.warnAgainstDeprecatedThis&&pe(V);const J=[],ie=[],ue={},se=[];let _e;for(_e in V){if(!Object.prototype.hasOwnProperty.call(V,_e))continue;const Qe=C(_e);if(!Qe)continue;J.forEach(function(qn){if(j(qn,Qe))throw new TypeError('Conflicting signatures "'+y(qn)+'" and "'+y(Qe)+'".')}),J.push(Qe);const nr=ie.length;ie.push(V[_e]);const n0=Qe.map(w);let Ui;for(Ui of te(n0)){const qn=y(Ui);se.push({params:Ui,name:qn,fn:nr}),Ui.every(Lo=>!Lo.hasConversion)&&(ue[qn]=nr)}}se.sort(L);const he=Q(ie,ue,ci);let de;for(de in ue)Object.prototype.hasOwnProperty.call(ue,de)&&(ue[de]=he[ue[de]]);const fe=[],Xe=new Map;for(de of se)Xe.has(de.name)||(de.fn=he[de.fn],fe.push(de),Xe.set(de.name,de));const et=fe[0]&&fe[0].params.length<=2&&!b(fe[0].params),ht=fe[1]&&fe[1].params.length<=2&&!b(fe[1].params),kt=fe[2]&&fe[2].params.length<=2&&!b(fe[2].params),It=fe[3]&&fe[3].params.length<=2&&!b(fe[3].params),rr=fe[4]&&fe[4].params.length<=2&&!b(fe[4].params),fr=fe[5]&&fe[5].params.length<=2&&!b(fe[5].params),en=et&&ht&&kt&&It&&rr&&fr;for(let Qe=0;Qe<fe.length;++Qe)fe[Qe].test=B(fe[Qe].params);const Dn=et?F(fe[0].params[0]):Tr,li=ht?F(fe[1].params[0]):Tr,vs=kt?F(fe[2].params[0]):Tr,gs=It?F(fe[3].params[0]):Tr,ms=rr?F(fe[4].params[0]):Tr,Li=fr?F(fe[5].params[0]):Tr,Pi=et?F(fe[0].params[1]):Tr,xs=ht?F(fe[1].params[1]):Tr,ki=kt?F(fe[2].params[1]):Tr,ys=It?F(fe[3].params[1]):Tr,zn=rr?F(fe[4].params[1]):Tr,Xt=fr?F(fe[5].params[1]):Tr;for(let Qe=0;Qe<fe.length;++Qe)fe[Qe].implementation=H(fe[Qe].params,fe[Qe].fn);const mr=et?fe[0].implementation:Di,zi=ht?fe[1].implementation:Di,Ds=kt?fe[2].implementation:Di,ju=It?fe[3].implementation:Di,Yu=rr?fe[4].implementation:Di,Zu=fr?fe[5].implementation:Di,Vu=et?fe[0].params.length:-1,Gu=ht?fe[1].params.length:-1,Ku=kt?fe[2].params.length:-1,Ro=It?fe[3].params.length:-1,Xu=rr?fe[4].params.length:-1,Qu=fr?fe[5].params.length:-1,Ju=en?6:0,e0=fe.length,t0=fe.map(Qe=>Qe.test),r0=fe.map(Qe=>Qe.implementation),qi=function(){for(let nr=Ju;nr<e0;nr++)if(t0[nr](arguments))return r0[nr].apply(this,arguments);return a.onMismatch(P,arguments,fe)};function ci(Qe,nr){return arguments.length===Vu&&Dn(Qe)&&Pi(nr)?mr.apply(this,arguments):arguments.length===Gu&&li(Qe)&&xs(nr)?zi.apply(this,arguments):arguments.length===Ku&&vs(Qe)&&ki(nr)?Ds.apply(this,arguments):arguments.length===Ro&&gs(Qe)&&ys(nr)?ju.apply(this,arguments):arguments.length===Xu&&ms(Qe)&&zn(nr)?Yu.apply(this,arguments):arguments.length===Qu&&Li(Qe)&&Xt(nr)?Zu.apply(this,arguments):qi.apply(this,arguments)}try{Object.defineProperty(ci,"name",{value:P})}catch{}return ci.signatures=ue,ci._typedFunctionData={signatures:fe,signatureMap:Xe},ci}function we(P,V,J){throw I(P,V,J)}function be(P){return Fe(P,0,P.length-1)}function Oe(P){return P[P.length-1]}function Fe(P,V,J){return Array.prototype.slice.call(P,V,J)}function nt(P,V){for(let J=0;J<P.length;J++)if(V(P[J]))return P[J]}function Ye(P,V){return Array.prototype.concat.apply([],P.map(V))}function Ie(){const P=be(arguments).map(J=>y(C(J))),V=Oe(arguments);if(typeof V!="function")throw new TypeError("Callback function expected as last argument");return Re(P,V)}function Re(P,V){return{referTo:{references:P,callback:V}}}function xt(P){if(typeof P!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:P}}}function Ut(P){return P&&typeof P.referTo=="object"&&Array.isArray(P.referTo.references)&&typeof P.referTo.callback=="function"}function Et(P){return P&&typeof P.referToSelf=="object"&&typeof P.referToSelf.callback=="function"}function lr(P,V){if(!P)return V;if(V&&V!==P){const J=new Error("Function names do not match (expected: "+P+", actual: "+V+")");throw J.data={actual:V,expected:P},J}return P}function Lr(P){let V;for(const J in P)Object.prototype.hasOwnProperty.call(P,J)&&(p(P[J])||typeof P[J].signature=="string")&&(V=lr(V,P[J].name));return V}function cr(P,V){let J;for(J in V)if(Object.prototype.hasOwnProperty.call(V,J)){if(J in P&&V[J]!==P[J]){const ie=new Error('Signature "'+J+'" is defined twice');throw ie.data={signature:J,sourceFunction:V[J],destFunction:P[J]},ie}P[J]=V[J]}}const yt=a;a=function(P){const V=typeof P=="string",J=V?1:0;let ie=V?P:"";const ue={};for(let se=J;se<arguments.length;++se){const _e=arguments[se];let he={},de;if(typeof _e=="function"?(de=_e.name,typeof _e.signature=="string"?he[_e.signature]=_e:p(_e)&&(he=_e.signatures)):s(_e)&&(he=_e,V||(de=Lr(_e))),Object.keys(he).length===0){const fe=new TypeError("Argument to 'typed' at index "+se+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw fe.data={index:se,argument:_e},fe}V||(ie=lr(ie,de)),cr(ue,he)}return De(ie||"",ue)},a.create=Nl,a.createCount=yt.createCount,a.onMismatch=we,a.throwMismatchError=we,a.createError=I,a.clear=c,a.clearConversions=h,a.addTypes=f,a._findType=u,a.referTo=Ie,a.referToSelf=xt,a.convert=_,a.findSignature=v,a.find=x,a.isTypedFunction=p,a.warnAgainstDeprecatedThis=!0,a.addType=function(P,V){let J="any";V!==!1&&r.has("Object")&&(J="Object"),a.addTypes([P],J)};function Ot(P){if(!P||typeof P.from!="string"||typeof P.to!="string"||typeof P.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(P.to===P.from)throw new SyntaxError('Illegal to define conversion from "'+P.from+'" to itself.')}return a.addConversion=function(P){Ot(P);const V=u(P.to);if(V.conversionsTo.every(function(J){return J.from!==P.from}))V.conversionsTo.push({from:P.from,convert:P.convert,index:i++});else throw new Error('There is already a conversion from "'+P.from+'" to "'+V.name+'"')},a.addConversions=function(P){P.forEach(a.addConversion)},a.removeConversion=function(P){Ot(P);const V=u(P.to),J=nt(V.conversionsTo,ue=>ue.from===P.from);if(!J)throw new Error("Attempt to remove nonexistent conversion from "+P.from+" to "+P.to);if(J.convert!==P.convert)throw new Error("Conversion to remove does not match existing conversion");const ie=V.conversionsTo.indexOf(J);V.conversionsTo.splice(ie,1)},a.resolve=function(P,V){if(!p(P))throw new TypeError(Ml);const J=P._typedFunctionData.signatures;for(let ie=0;ie<J.length;++ie)if(J[ie].test(V))return J[ie];return null},a}var Sl=Nl();function bt(s){return typeof s=="boolean"?!0:isFinite(s)?s===Math.round(s):!1}function Fa(s,e,t){var r={2:"0b",8:"0o",16:"0x"},n=r[e],i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!bt(t))throw new Error("size must be an integer");if(s>2**(t-1)-1||s<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!bt(s))throw new Error("Value must be an integer");s<0&&(s=s+2**t),i="i".concat(t)}var a="";return s<0&&(s=-s,a="-"),"".concat(a).concat(n).concat(s.toString(e)).concat(i)}function Ba(s,e){if(typeof e=="function")return e(s);if(s===1/0)return"Infinity";if(s===-1/0)return"-Infinity";if(isNaN(s))return"NaN";var{notation:t,precision:r,wordSize:n}=Ol(e);switch(t){case"fixed":return Q1(s,r);case"exponential":return Il(s,r);case"engineering":return X1(s,r);case"bin":return Fa(s,2,n);case"oct":return Fa(s,8,n);case"hex":return Fa(s,16,n);case"auto":return J1(s,r,e).replace(/((\.\d*?)(0+))($|e)/,function(){var i=arguments[2],a=arguments[4];return i!=="."?i+a:a});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Ol(s){var e="auto",t,r;if(s!==void 0)if(pt(s))t=s;else if(St(s))t=s.toNumber();else if(Ca(s))s.precision!==void 0&&(t=Tl(s.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),s.wordSize!==void 0&&(r=Tl(s.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),s.notation&&(e=s.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:t,wordSize:r}}function Hs(s){var e=String(s).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+s);var t=e[1],r=e[2],n=parseFloat(e[4]||"0"),i=r.indexOf(".");n+=i!==-1?i-1:r.length-1;var a=r.replace(".","").replace(/^0*/,function(u){return n-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return a.length===0&&(a.push(0),n++),{sign:t,coefficients:a,exponent:n}}function X1(s,e){if(isNaN(s)||!isFinite(s))return String(s);var t=Hs(s),r=js(t,e),n=r.exponent,i=r.coefficients,a=n%3===0?n:n<0?n-3-n%3:n-n%3;if(pt(e))for(;e>i.length||n-a+1>i.length;)i.push(0);else for(var u=Math.abs(n-a)-(i.length-1),f=0;f<u;f++)i.push(0);for(var c=Math.abs(n-a),h=1;c>0;)h++,c--;var d=i.slice(h).join(""),p=pt(e)&&d.length||d.match(/[1-9]/)?"."+d:"",v=i.slice(0,h).join("")+p+"e"+(n>=0?"+":"")+a.toString();return r.sign+v}function Q1(s,e){if(isNaN(s)||!isFinite(s))return String(s);var t=Hs(s),r=typeof e=="number"?js(t,t.exponent+1+e):t,n=r.coefficients,i=r.exponent+1,a=i+(e||0);return n.length<a&&(n=n.concat(wi(a-n.length))),i<0&&(n=wi(-i+1).concat(n),i=1),i<n.length&&n.splice(i,0,i===0?"0.":"."),r.sign+n.join("")}function Il(s,e){if(isNaN(s)||!isFinite(s))return String(s);var t=Hs(s),r=e?js(t,e):t,n=r.coefficients,i=r.exponent;n.length<e&&(n=n.concat(wi(e-n.length)));var a=n.shift();return r.sign+a+(n.length>0?"."+n.join(""):"")+"e"+(i>=0?"+":"")+i}function J1(s,e,t){if(isNaN(s)||!isFinite(s))return String(s);var r=$l(t==null?void 0:t.lowerExp,-3),n=$l(t==null?void 0:t.upperExp,5),i=Hs(s),a=e?js(i,e):i;if(a.exponent<r||a.exponent>=n)return Il(s,e);var u=a.coefficients,f=a.exponent;u.length<e&&(u=u.concat(wi(e-u.length))),u=u.concat(wi(f-u.length+1+(u.length<e?e-u.length:0))),u=wi(-f).concat(u);var c=f>0?f:0;return c<u.length-1&&u.splice(c+1,0,"."),a.sign+u.join("")}function js(s,e){for(var t={sign:s.sign,coefficients:s.coefficients,exponent:s.exponent},r=t.coefficients;e<=0;)r.unshift(0),t.exponent++,e++;if(r.length>e){var n=r.splice(e,r.length-e);if(n[0]>=5){var i=e-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),t.exponent++,i++),i--,r[i]++}}return t}function wi(s){for(var e=[],t=0;t<s;t++)e.push(0);return e}function e_(s){return s.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var t_=Number.EPSILON||2220446049250313e-31;function ti(s,e,t){if(t==null)return s===e;if(s===e)return!0;if(isNaN(s)||isNaN(e))return!1;if(isFinite(s)&&isFinite(e)){var r=Math.abs(s-e);return r<=t_?!0:r<=Math.max(Math.abs(s),Math.abs(e))*t}return!1}function Tl(s,e){if(pt(s))return s;if(St(s))return s.toNumber();e()}function $l(s,e){return pt(s)?s:St(s)?s.toNumber():e}function Ma(s,e,t){var r=s.constructor,n=new r(2),i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!bt(t))throw new Error("size must be an integer");if(s.greaterThan(n.pow(t-1).sub(1))||s.lessThan(n.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!s.isInteger())throw new Error("Value must be an integer");s.lessThan(0)&&(s=s.add(n.pow(t))),i="i".concat(t)}switch(e){case 2:return"".concat(s.toBinary()).concat(i);case 8:return"".concat(s.toOctal()).concat(i);case 16:return"".concat(s.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(e," not supported "))}}function r_(s,e){if(typeof e=="function")return e(s);if(!s.isFinite())return s.isNaN()?"NaN":s.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:r,wordSize:n}=Ol(e);switch(t){case"fixed":return i_(s,r);case"exponential":return Rl(s,r);case"engineering":return n_(s,r);case"bin":return Ma(s,2,n);case"oct":return Ma(s,8,n);case"hex":return Ma(s,16,n);case"auto":{var i=Ll(e==null?void 0:e.lowerExp,-3),a=Ll(e==null?void 0:e.upperExp,5);if(s.isZero())return"0";var u,f=s.toSignificantDigits(r),c=f.e;return c>=i&&c<a?u=f.toFixed():u=Rl(s,r),u.replace(/((\.\d*?)(0+))($|e)/,function(){var h=arguments[2],d=arguments[4];return h!=="."?h+d:d})}default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function n_(s,e){var t=s.e,r=t%3===0?t:t<0?t-3-t%3:t-t%3,n=s.mul(Math.pow(10,-r)),i=n.toPrecision(e);if(i.indexOf("e")!==-1){var a=s.constructor;i=new a(i).toFixed()}return i+"e"+(t>=0?"+":"")+r.toString()}function Rl(s,e){return e!==void 0?s.toExponential(e-1):s.toExponential()}function i_(s,e){return s.toFixed(e)}function Ll(s,e){return pt(s)?s:St(s)?s.toNumber():e}function ct(s,e){var t=s_(s,e);return e&&typeof e=="object"&&"truncate"in e&&t.length>e.truncate?t.substring(0,e.truncate-3)+"...":t}function s_(s,e){if(typeof s=="number")return Ba(s,e);if(St(s))return r_(s,e);if(o_(s))return!e||e.fraction!=="decimal"?s.s*s.n+"/"+s.d:s.toString();if(Array.isArray(s))return zl(s,e);if(un(s))return Pl(s);if(typeof s=="function")return s.syntax?String(s.syntax):"function";if(s&&typeof s=="object"){if(typeof s.format=="function")return s.format(e);if(s&&s.toString(e)!=={}.toString())return s.toString(e);var t=Object.keys(s).map(r=>Pl(r)+": "+ct(s[r],e));return"{"+t.join(", ")+"}"}return String(s)}function Pl(s){for(var e=String(s),t="",r=0;r<e.length;){var n=e.charAt(r);t+=n in kl?kl[n]:n,r++}return'"'+t+'"'}var kl={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function zl(s,e){if(Array.isArray(s)){for(var t="[",r=s.length,n=0;n<r;n++)n!==0&&(t+=", "),t+=zl(s[n],e);return t+="]",t}else return ct(s,e)}function o_(s){return s&&typeof s=="object"&&typeof s.s=="number"&&typeof s.n=="number"&&typeof s.d=="number"||!1}function rt(s,e,t){if(!(this instanceof rt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=s,this.expected=e,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(s)?"["+s.join(", ")+"]":s)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}rt.prototype=new RangeError,rt.prototype.constructor=RangeError,rt.prototype.name="DimensionError",rt.prototype.isDimensionError=!0;function On(s,e,t){if(!(this instanceof On))throw new SyntaxError("Constructor must be called with the new operator");this.index=s,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=t),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}On.prototype=new RangeError,On.prototype.constructor=RangeError,On.prototype.name="IndexError",On.prototype.isIndexError=!0;function Lt(s){for(var e=[];Array.isArray(s);)e.push(s.length),s=s[0];return e}function ql(s,e,t){var r,n=s.length;if(n!==e[t])throw new rt(n,e[t]);if(t<e.length-1){var i=t+1;for(r=0;r<n;r++){var a=s[r];if(!Array.isArray(a))throw new rt(e.length-1,e.length,"<");ql(s[r],e,i)}}else for(r=0;r<n;r++)if(Array.isArray(s[r]))throw new rt(e.length+1,e.length,">")}function Ul(s,e){var t=e.length===0;if(t){if(Array.isArray(s))throw new rt(s.length,0)}else ql(s,e,0)}function Ft(s,e){if(s!==void 0){if(!pt(s)||!bt(s))throw new TypeError("Index must be an integer (value: "+s+")");if(s<0||typeof e=="number"&&s>=e)throw new On(s,e)}}function Na(s,e,t){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(n){if(!pt(n)||!bt(n)||n<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ct(e)+")")}),(pt(s)||St(s))&&(s=[s]);var r=t!==void 0?t:0;return Sa(s,e,0,r),s}function Sa(s,e,t,r){var n,i,a=s.length,u=e[t],f=Math.min(a,u);if(s.length=u,t<e.length-1){var c=t+1;for(n=0;n<f;n++)i=s[n],Array.isArray(i)||(i=[i],s[n]=i),Sa(i,e,c,r);for(n=f;n<u;n++)i=[],s[n]=i,Sa(i,e,c,r)}else{for(n=0;n<f;n++)for(;Array.isArray(s[n]);)s[n]=s[n][0];for(n=f;n<u;n++)s[n]=r}}function Oa(s,e){var t=Ta(s),r=t.length;if(!Array.isArray(s)||!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new rt(0,r,"!=");e=Ia(e,r);var n=Wl(e);if(r!==n)throw new rt(n,r,"!=");try{return a_(t,e)}catch(i){throw i instanceof rt?new rt(n,r,"!="):i}}function Ia(s,e){var t=Wl(s),r=s.slice(),n=-1,i=s.indexOf(n),a=s.indexOf(n,i+1)>=0;if(a)throw new Error("More than one wildcard in sizes");var u=i>=0,f=e%t===0;if(u)if(f)r[i]=-e/t;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-t);return r}function Wl(s){return s.reduce((e,t)=>e*t,1)}function a_(s,e){for(var t=s,r,n=e.length-1;n>0;n--){var i=e[n];r=[];for(var a=t.length/i,u=0;u<a;u++)r.push(t.slice(u*i,(u+1)*i));t=r}return t}function Hl(s,e,t,r){var n=r||Lt(s);if(t)for(var i=0;i<t;i++)s=[s],n.unshift(1);for(s=jl(s,e,0);n.length<e;)n.push(1);return s}function jl(s,e,t){var r,n;if(Array.isArray(s)){var i=t+1;for(r=0,n=s.length;r<n;r++)s[r]=jl(s[r],e,i)}else for(var a=t;a<e;a++)s=[s];return s}function Ta(s){if(!Array.isArray(s))return s;var e=[];return s.forEach(function t(r){Array.isArray(r)?r.forEach(t):e.push(r)}),e}function Ys(s,e){for(var t,r=0,n=0;n<s.length;n++){var i=s[n],a=Array.isArray(i);if(n===0&&a&&(r=i.length),a&&i.length!==r)return;var u=a?Ys(i,e):e(i);if(t===void 0)t=u;else if(t!==u)return"mixed"}return t}function Yl(s,e,t,r){if(r<t){if(s.length!==e.length)throw new rt(s.length,e.length);for(var n=[],i=0;i<s.length;i++)n[i]=Yl(s[i],e[i],t,r+1);return n}else return s.concat(e)}function Zl(){var s=Array.prototype.slice.call(arguments,0,-1),e=Array.prototype.slice.call(arguments,-1);if(s.length===1)return s[0];if(s.length>1)return s.slice(1).reduce(function(t,r){return Yl(t,r,e,0)},s[0]);throw new Error("Wrong number of arguments in function concat")}function u_(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];for(var r=e.map(p=>p.length),n=Math.max(...r),i=new Array(n).fill(null),a=0;a<e.length;a++)for(var u=e[a],f=r[a],c=0;c<f;c++){var h=n-f+c;u[c]>i[h]&&(i[h]=u[c])}for(var d=0;d<e.length;d++)Zs(e[d],i);return i}function Zs(s,e){for(var t=e.length,r=s.length,n=0;n<r;n++){var i=t-r+n;if(s[n]<e[i]&&s[n]>1||s[n]>e[i])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(s,") not possible to broadcast dimension ").concat(r," with size ").concat(s[n]," to size ").concat(e[i]))}}function Vl(s,e){var t=Lt(s);if(yi(t,e))return s;Zs(t,e);var r=u_(t,e),n=r.length,i=[...Array(n-t.length).fill(1),...t],a=c_(s);t.length<n&&(a=Oa(a,i),t=Lt(a));for(var u=0;u<n;u++)t[u]<r[u]&&(a=l_(a,r[u],u),t=Lt(a));return a}function l_(s,e,t){return Zl(...Array(e).fill(s),t)}function c_(s){return Ws([],s)}function xe(s,e,t,r){function n(i){var a=V1(i,e.map(d_));return f_(s,e,i),t(a)}return n.isFactory=!0,n.fn=s,n.dependencies=e.slice().sort(),r&&(n.meta=r),n}function f_(s,e,t){var r=e.filter(i=>!h_(i)).every(i=>t[i]!==void 0);if(!r){var n=e.filter(i=>t[i]===void 0);throw new Error('Cannot create function "'.concat(s,'", ')+"some dependencies are missing: ".concat(n.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function h_(s){return s&&s[0]==="?"}function d_(s){return s&&s[0]==="?"?s.slice(1):s}function p_(s,e){if(Kl(s)&&Gl(s,e))return s[e];throw typeof s[e]=="function"&&g_(s,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function __(s,e,t){if(Kl(s)&&Gl(s,e))return s[e]=t,t;throw new Error('No access to property "'+e+'"')}function v_(s,e){return e in s}function Gl(s,e){return!s||typeof s!="object"?!1:ss(m_,e)?!0:!(e in Object.prototype||e in Function.prototype)}function g_(s,e){return s==null||typeof s[e]!="function"||ss(s,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(s)?!1:ss(x_,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Kl(s){return typeof s=="object"&&s&&s.constructor===Object}var m_={length:!0,name:!0},x_={toString:!0,valueOf:!0,toLocaleString:!0};class y_{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return p_(this.wrappedObject,e)}set(e,t){return __(this.wrappedObject,e,t),this}has(e){return v_(this.wrappedObject,e)}entries(){return D_(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}function D_(s,e){return{next:()=>{var t=s.next();return t.done?t:{value:e(t.value),done:!1}}}}function w_(s){return s?s instanceof Map||s instanceof y_||typeof s.set=="function"&&typeof s.get=="function"&&typeof s.keys=="function"&&typeof s.has=="function":!1}var Xl=function(){return Xl=Sl.create,Sl},b_=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],E_=xe("typed",b_,function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=Xl();return a.clear(),a.addTypes([{name:"number",test:pt},{name:"Complex",test:El},{name:"BigNumber",test:St},{name:"Fraction",test:Al},{name:"Unit",test:Cl},{name:"identifier",test:u=>un&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:un},{name:"Chain",test:Y1},{name:"Array",test:Ct},{name:"Matrix",test:mt},{name:"DenseMatrix",test:x1},{name:"SparseMatrix",test:y1},{name:"Range",test:D1},{name:"Index",test:Aa},{name:"boolean",test:w1},{name:"ResultSet",test:b1},{name:"Help",test:E1},{name:"function",test:A1},{name:"Date",test:C1},{name:"RegExp",test:F1},{name:"null",test:B1},{name:"undefined",test:M1},{name:"AccessorNode",test:N1},{name:"ArrayNode",test:S1},{name:"AssignmentNode",test:O1},{name:"BlockNode",test:I1},{name:"ConditionalNode",test:T1},{name:"ConstantNode",test:$1},{name:"FunctionNode",test:L1},{name:"FunctionAssignmentNode",test:R1},{name:"IndexNode",test:P1},{name:"Node",test:k1},{name:"ObjectNode",test:z1},{name:"OperatorNode",test:q1},{name:"ParenthesisNode",test:U1},{name:"RangeNode",test:W1},{name:"RelationalNode",test:H1},{name:"SymbolNode",test:j1},{name:"Map",test:w_},{name:"Object",test:Ca}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(t||$a(f),e_(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new t(f)}},{from:"number",to:"Complex",convert:function(f){return r||Vs(f),new r(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return r||Vs(f),new r(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return r||Vs(f),new r(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){i||Ra(f);var c=new i(f);if(c.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return c}},{from:"string",to:"number",convert:function(f){var c=Number(f);if(isNaN(c))throw new Error('Cannot convert "'+f+'" to a number');return c}},{from:"string",to:"BigNumber",convert:function(f){t||$a(f);try{return new t(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){i||Ra(f);try{return new i(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){r||Vs(f);try{return new r(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return t||$a(f),new t(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return i||Ra(f),new i(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return n||A_(),new n(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),a.onMismatch=(u,f,c)=>{var h=a.createError(u,f,c);if(["wrongType","mismatch"].includes(h.data.category)&&f.length===1&&is(f[0])&&c.some(p=>!p.params.includes(","))){var d=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw d.data=h.data,d}throw h},a.onMismatch=(u,f,c)=>{var h=a.createError(u,f,c);if(["wrongType","mismatch"].includes(h.data.category)&&f.length===1&&is(f[0])&&c.some(p=>!p.params.includes(","))){var d=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw d.data=h.data,d}throw h},a});function $a(s){throw new Error("Cannot convert value ".concat(s," into a BigNumber: no class 'BigNumber' provided"))}function Vs(s){throw new Error("Cannot convert value ".concat(s," into a Complex number: no class 'Complex' provided"))}function A_(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Ra(s){throw new Error("Cannot convert value ".concat(s," into a Fraction, no class 'Fraction' provided."))}/*!
34
+ `);return Object.freeze(bl)};Ws(Er,bl,{MATRIX_OPTIONS:G1,NUMBER_OPTIONS:K1});function Bl(){return!0}function Tr(){return!1}function Di(){}const Ml="Argument is not a typed-function.";function Nl(){function s(P){return typeof P=="object"&&P!==null&&P.constructor===Object}const e=[{name:"number",test:function(P){return typeof P=="number"}},{name:"string",test:function(P){return typeof P=="string"}},{name:"boolean",test:function(P){return typeof P=="boolean"}},{name:"Function",test:function(P){return typeof P=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(P){return P instanceof Date}},{name:"RegExp",test:function(P){return P instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(P){return P===null}},{name:"undefined",test:function(P){return P===void 0}}],t={name:"any",test:Bl,isAny:!0};let r,n,i=0,a={createCount:0};function u(P){const V=r.get(P);if(V)return V;let J='Unknown type "'+P+'"';const ie=P.toLowerCase();let ue;for(ue of n)if(ue.toLowerCase()===ie){J+='. Did you mean "'+ue+'" ?';break}throw new TypeError(J)}function c(P){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const J=V?u(V).index:n.length,ie=[];for(let se=0;se<P.length;++se){if(!P[se]||typeof P[se].name!="string"||typeof P[se].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const _e=P[se].name;if(r.has(_e))throw new TypeError('Duplicate type name "'+_e+'"');ie.push(_e),r.set(_e,{name:_e,test:P[se].test,isAny:P[se].isAny,index:J+se,conversionsTo:[]})}const ue=n.slice(J);n=n.slice(0,J).concat(ie).concat(ue);for(let se=J+ie.length;se<n.length;++se)r.get(n[se]).index=se}function f(){r=new Map,n=[],i=0,c([t],!1)}f(),c(e);function h(){let P;for(P of n)r.get(P).conversionsTo=[];i=0}function d(P){const V=n.filter(J=>{const ie=r.get(J);return!ie.isAny&&ie.test(P)});return V.length?V:["any"]}function p(P){return P&&typeof P=="function"&&"_typedFunctionData"in P}function v(P,V,J){if(!p(P))throw new TypeError(Ml);const ie=J&&J.exact,ue=Array.isArray(V)?V.join(","):V,se=C(ue),_e=y(se);if(!ie||_e in P.signatures){const Xe=P._typedFunctionData.signatureMap.get(_e);if(Xe)return Xe}const he=se.length;let de;if(ie){de=[];let Xe;for(Xe in P.signatures)de.push(P._typedFunctionData.signatureMap.get(Xe))}else de=P._typedFunctionData.signatures;for(let Xe=0;Xe<he;++Xe){const et=se[Xe],ht=[];let kt;for(kt of de){const It=M(kt.params,Xe);if(!(!It||et.restParam&&!It.restParam)){if(!It.hasAny){const rr=D(It);if(et.types.some(cr=>!rr.has(cr.name)))continue}ht.push(kt)}}if(de=ht,de.length===0)break}let ce;for(ce of de)if(ce.params.length<=he)return ce;throw new TypeError("Signature not found (signature: "+(P.name||"unnamed")+"("+y(se,", ")+"))")}function x(P,V,J){return v(P,V,J).implementation}function _(P,V){const J=u(V);if(J.test(P))return P;const ie=J.conversionsTo;if(ie.length===0)throw new Error("There are no conversions to "+V+" defined.");for(let ue=0;ue<ie.length;ue++)if(u(ie[ue].from).test(P))return ie[ue].convert(P);throw new Error("Cannot convert "+P+" to "+V)}function y(P){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return P.map(J=>J.name).join(V)}function m(P){const V=P.indexOf("...")===0,ie=(V?P.length>3?P.slice(3):"any":P).split("|").map(he=>u(he.trim()));let ue=!1,se=V?"...":"";return{types:ie.map(function(he){return ue=he.isAny||ue,se+=he.name+"|",{name:he.name,typeIndex:he.index,test:he.test,isAny:he.isAny,conversion:null,conversionIndex:-1}}),name:se.slice(0,-1),hasAny:ue,hasConversion:!1,restParam:V}}function w(P){const V=P.types.map(_e=>_e.name),J=G(V);let ie=P.hasAny,ue=P.name;const se=J.map(function(_e){const he=u(_e.from);return ie=he.isAny||ie,ue+="|"+_e.from,{name:_e.from,typeIndex:he.index,test:he.test,isAny:he.isAny,conversion:_e,conversionIndex:_e.index}});return{types:P.types.concat(se),name:ue,hasAny:ie,hasConversion:se.length>0,restParam:P.restParam}}function D(P){return P.typeSet||(P.typeSet=new Set,P.types.forEach(V=>P.typeSet.add(V.name))),P.typeSet}function C(P){const V=[];if(typeof P!="string")throw new TypeError("Signatures must be strings");const J=P.trim();if(J==="")return V;const ie=J.split(",");for(let ue=0;ue<ie.length;++ue){const se=m(ie[ue].trim());if(se.restParam&&ue!==ie.length-1)throw new SyntaxError('Unexpected rest parameter "'+ie[ue]+'": only allowed for the last parameter');if(se.types.length===0)return null;V.push(se)}return V}function b(P){const V=Oe(P);return V?V.restParam:!1}function F(P){if(!P||P.types.length===0)return Bl;if(P.types.length===1)return u(P.types[0].name).test;if(P.types.length===2){const V=u(P.types[0].name).test,J=u(P.types[1].name).test;return function(ue){return V(ue)||J(ue)}}else{const V=P.types.map(function(J){return u(J.name).test});return function(ie){for(let ue=0;ue<V.length;ue++)if(V[ue](ie))return!0;return!1}}}function B(P){let V,J,ie;if(b(P)){V=be(P).map(F);const ue=V.length,se=F(Oe(P)),_e=function(he){for(let de=ue;de<he.length;de++)if(!se(he[de]))return!1;return!0};return function(de){for(let ce=0;ce<V.length;ce++)if(!V[ce](de[ce]))return!1;return _e(de)&&de.length>=ue+1}}else return P.length===0?function(se){return se.length===0}:P.length===1?(J=F(P[0]),function(se){return J(se[0])&&se.length===1}):P.length===2?(J=F(P[0]),ie=F(P[1]),function(se){return J(se[0])&&ie(se[1])&&se.length===2}):(V=P.map(F),function(se){for(let _e=0;_e<V.length;_e++)if(!V[_e](se[_e]))return!1;return se.length===V.length})}function M(P,V){return V<P.length?P[V]:b(P)?Oe(P):null}function O(P,V){const J=M(P,V);return J?D(J):new Set}function A(P){return P.conversion===null||P.conversion===void 0}function N(P,V){const J=new Set;return P.forEach(ie=>{const ue=O(ie.params,V);let se;for(se of ue)J.add(se)}),J.has("any")?["any"]:Array.from(J)}function I(P,V,J){let ie,ue;const se=P||"unnamed";let _e=J,he;for(he=0;he<V.length;he++){const et=[];if(_e.forEach(ht=>{const kt=M(ht.params,he),It=F(kt);(he<ht.params.length||b(ht.params))&&It(V[he])&&et.push(ht)}),et.length===0){if(ue=N(_e,he),ue.length>0){const ht=d(V[he]);return ie=new TypeError("Unexpected type of argument in function "+se+" (expected: "+ue.join(" or ")+", actual: "+ht.join(" | ")+", index: "+he+")"),ie.data={category:"wrongType",fn:se,index:he,actual:ht,expected:ue},ie}}else _e=et}const de=_e.map(function(et){return b(et.params)?1/0:et.params.length});if(V.length<Math.min.apply(null,de))return ue=N(_e,he),ie=new TypeError("Too few arguments in function "+se+" (expected: "+ue.join(" or ")+", index: "+V.length+")"),ie.data={category:"tooFewArgs",fn:se,index:V.length,expected:ue},ie;const ce=Math.max.apply(null,de);if(V.length>ce)return ie=new TypeError("Too many arguments in function "+se+" (expected: "+ce+", actual: "+V.length+")"),ie.data={category:"tooManyArgs",fn:se,index:V.length,expectedLength:ce},ie;const Xe=[];for(let et=0;et<V.length;++et)Xe.push(d(V[et]).join("|"));return ie=new TypeError('Arguments of type "'+Xe.join(", ")+'" do not match any of the defined signatures of function '+se+"."),ie.data={category:"mismatch",actual:Xe},ie}function L(P){let V=n.length+1;for(let J=0;J<P.types.length;J++)A(P.types[J])&&(V=Math.min(V,P.types[J].typeIndex));return V}function k(P){let V=i+1;for(let J=0;J<P.types.length;J++)A(P.types[J])||(V=Math.min(V,P.types[J].conversionIndex));return V}function z(P,V){if(P.hasAny){if(!V.hasAny)return 1}else if(V.hasAny)return-1;if(P.restParam){if(!V.restParam)return 1}else if(V.restParam)return-1;if(P.hasConversion){if(!V.hasConversion)return 1}else if(V.hasConversion)return-1;const J=L(P)-L(V);if(J<0)return-1;if(J>0)return 1;const ie=k(P)-k(V);return ie<0?-1:ie>0?1:0}function R(P,V){const J=P.params,ie=V.params,ue=Oe(J),se=Oe(ie),_e=b(J),he=b(ie);if(_e&&ue.hasAny){if(!he||!se.hasAny)return 1}else if(he&&se.hasAny)return-1;let de=0,ce=0,Xe;for(Xe of J)Xe.hasAny&&++de,Xe.hasConversion&&++ce;let et=0,ht=0;for(Xe of ie)Xe.hasAny&&++et,Xe.hasConversion&&++ht;if(de!==et)return de-et;if(_e&&ue.hasConversion){if(!he||!se.hasConversion)return 1}else if(he&&se.hasConversion)return-1;if(ce!==ht)return ce-ht;if(_e){if(!he)return 1}else if(he)return-1;const kt=(J.length-ie.length)*(_e?-1:1);if(kt!==0)return kt;const It=[];let rr=0;for(let en=0;en<J.length;++en){const Dn=z(J[en],ie[en]);It.push(Dn),rr+=Dn}if(rr!==0)return rr;let cr;for(cr of It)if(cr!==0)return cr;return 0}function G(P){if(P.length===0)return[];const V=P.map(u);P.length>1&&V.sort((ue,se)=>ue.index-se.index);let J=V[0].conversionsTo;if(P.length===1)return J;J=J.concat([]);const ie=new Set(P);for(let ue=1;ue<V.length;++ue){let se;for(se of V[ue].conversionsTo)ie.has(se.from)||(J.push(se),ie.add(se.from))}return J}function H(P,V){let J=V;if(P.some(ue=>ue.hasConversion)){const ue=b(P),se=P.map(ee);J=function(){const he=[],de=ue?arguments.length-1:arguments.length;for(let ce=0;ce<de;ce++)he[ce]=se[ce](arguments[ce]);return ue&&(he[de]=arguments[de].map(se[de])),V.apply(this,he)}}let ie=J;if(b(P)){const ue=P.length-1;ie=function(){return J.apply(this,Fe(arguments,0,ue).concat([Fe(arguments,ue)]))}}return ie}function ee(P){let V,J,ie,ue;const se=[],_e=[];switch(P.types.forEach(function(he){he.conversion&&(se.push(u(he.conversion.from).test),_e.push(he.conversion.convert))}),_e.length){case 0:return function(de){return de};case 1:return V=se[0],ie=_e[0],function(de){return V(de)?ie(de):de};case 2:return V=se[0],J=se[1],ie=_e[0],ue=_e[1],function(de){return V(de)?ie(de):J(de)?ue(de):de};default:return function(de){for(let ce=0;ce<_e.length;ce++)if(se[ce](de))return _e[ce](de);return de}}}function te(P){function V(J,ie,ue){if(ie<J.length){const se=J[ie];let _e=[];if(se.restParam){const he=se.types.filter(A);he.length<se.types.length&&_e.push({types:he,name:"..."+he.map(de=>de.name).join("|"),hasAny:he.some(de=>de.isAny),hasConversion:!1,restParam:!0}),_e.push(se)}else _e=se.types.map(function(he){return{types:[he],name:he.name,hasAny:he.isAny,hasConversion:he.conversion,restParam:!1}});return Ye(_e,function(he){return V(J,ie+1,ue.concat([he]))})}else return[ue]}return V(P,0,[])}function j(P,V){const J=Math.max(P.length,V.length);for(let he=0;he<J;he++){const de=O(P,he),ce=O(V,he);let Xe=!1,et;for(et of ce)if(de.has(et)){Xe=!0;break}if(!Xe)return!1}const ie=P.length,ue=V.length,se=b(P),_e=b(V);return se?_e?ie===ue:ue>=ie:_e?ie>=ue:ie===ue}function X(P){return P.map(V=>Et(V)?xt(V.referToSelf.callback):Ut(V)?Le(V.referTo.references,V.referTo.callback):V)}function Y(P,V,J){const ie=[];let ue;for(ue of P){let se=J[ue];if(typeof se!="number")throw new TypeError('No definition for referenced signature "'+ue+'"');if(se=V[se],typeof se!="function")return!1;ie.push(se)}return ie}function Q(P,V,J){const ie=X(P),ue=new Array(ie.length).fill(!1);let se=!0;for(;se;){se=!1;let _e=!0;for(let he=0;he<ie.length;++he){if(ue[he])continue;const de=ie[he];if(Et(de))ie[he]=de.referToSelf.callback(J),ie[he].referToSelf=de.referToSelf,ue[he]=!0,_e=!1;else if(Ut(de)){const ce=Y(de.referTo.references,ie,V);ce?(ie[he]=de.referTo.callback.apply(this,ce),ie[he].referTo=de.referTo,ue[he]=!0,_e=!1):se=!0}}if(_e&&se)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return ie}function pe(P){const V=/\bthis(\(|\.signatures\b)/;Object.keys(P).forEach(J=>{const ie=P[J];if(V.test(ie.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function De(P,V){if(a.createCount++,Object.keys(V).length===0)throw new SyntaxError("No signatures provided");a.warnAgainstDeprecatedThis&&pe(V);const J=[],ie=[],ue={},se=[];let _e;for(_e in V){if(!Object.prototype.hasOwnProperty.call(V,_e))continue;const Qe=C(_e);if(!Qe)continue;J.forEach(function(qn){if(j(qn,Qe))throw new TypeError('Conflicting signatures "'+y(qn)+'" and "'+y(Qe)+'".')}),J.push(Qe);const nr=ie.length;ie.push(V[_e]);const n0=Qe.map(w);let Ui;for(Ui of te(n0)){const qn=y(Ui);se.push({params:Ui,name:qn,fn:nr}),Ui.every(Ro=>!Ro.hasConversion)&&(ue[qn]=nr)}}se.sort(R);const he=Q(ie,ue,fi);let de;for(de in ue)Object.prototype.hasOwnProperty.call(ue,de)&&(ue[de]=he[ue[de]]);const ce=[],Xe=new Map;for(de of se)Xe.has(de.name)||(de.fn=he[de.fn],ce.push(de),Xe.set(de.name,de));const et=ce[0]&&ce[0].params.length<=2&&!b(ce[0].params),ht=ce[1]&&ce[1].params.length<=2&&!b(ce[1].params),kt=ce[2]&&ce[2].params.length<=2&&!b(ce[2].params),It=ce[3]&&ce[3].params.length<=2&&!b(ce[3].params),rr=ce[4]&&ce[4].params.length<=2&&!b(ce[4].params),cr=ce[5]&&ce[5].params.length<=2&&!b(ce[5].params),en=et&&ht&&kt&&It&&rr&&cr;for(let Qe=0;Qe<ce.length;++Qe)ce[Qe].test=B(ce[Qe].params);const Dn=et?F(ce[0].params[0]):Tr,li=ht?F(ce[1].params[0]):Tr,vs=kt?F(ce[2].params[0]):Tr,gs=It?F(ce[3].params[0]):Tr,ms=rr?F(ce[4].params[0]):Tr,Ri=cr?F(ce[5].params[0]):Tr,Pi=et?F(ce[0].params[1]):Tr,xs=ht?F(ce[1].params[1]):Tr,ki=kt?F(ce[2].params[1]):Tr,ys=It?F(ce[3].params[1]):Tr,zn=rr?F(ce[4].params[1]):Tr,Xt=cr?F(ce[5].params[1]):Tr;for(let Qe=0;Qe<ce.length;++Qe)ce[Qe].implementation=H(ce[Qe].params,ce[Qe].fn);const mr=et?ce[0].implementation:Di,zi=ht?ce[1].implementation:Di,Ds=kt?ce[2].implementation:Di,ju=It?ce[3].implementation:Di,Yu=rr?ce[4].implementation:Di,Zu=cr?ce[5].implementation:Di,Vu=et?ce[0].params.length:-1,Gu=ht?ce[1].params.length:-1,Ku=kt?ce[2].params.length:-1,Lo=It?ce[3].params.length:-1,Xu=rr?ce[4].params.length:-1,Qu=cr?ce[5].params.length:-1,Ju=en?6:0,e0=ce.length,t0=ce.map(Qe=>Qe.test),r0=ce.map(Qe=>Qe.implementation),qi=function(){for(let nr=Ju;nr<e0;nr++)if(t0[nr](arguments))return r0[nr].apply(this,arguments);return a.onMismatch(P,arguments,ce)};function fi(Qe,nr){return arguments.length===Vu&&Dn(Qe)&&Pi(nr)?mr.apply(this,arguments):arguments.length===Gu&&li(Qe)&&xs(nr)?zi.apply(this,arguments):arguments.length===Ku&&vs(Qe)&&ki(nr)?Ds.apply(this,arguments):arguments.length===Lo&&gs(Qe)&&ys(nr)?ju.apply(this,arguments):arguments.length===Xu&&ms(Qe)&&zn(nr)?Yu.apply(this,arguments):arguments.length===Qu&&Ri(Qe)&&Xt(nr)?Zu.apply(this,arguments):qi.apply(this,arguments)}try{Object.defineProperty(fi,"name",{value:P})}catch{}return fi.signatures=ue,fi._typedFunctionData={signatures:ce,signatureMap:Xe},fi}function we(P,V,J){throw I(P,V,J)}function be(P){return Fe(P,0,P.length-1)}function Oe(P){return P[P.length-1]}function Fe(P,V,J){return Array.prototype.slice.call(P,V,J)}function nt(P,V){for(let J=0;J<P.length;J++)if(V(P[J]))return P[J]}function Ye(P,V){return Array.prototype.concat.apply([],P.map(V))}function Ie(){const P=be(arguments).map(J=>y(C(J))),V=Oe(arguments);if(typeof V!="function")throw new TypeError("Callback function expected as last argument");return Le(P,V)}function Le(P,V){return{referTo:{references:P,callback:V}}}function xt(P){if(typeof P!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:P}}}function Ut(P){return P&&typeof P.referTo=="object"&&Array.isArray(P.referTo.references)&&typeof P.referTo.callback=="function"}function Et(P){return P&&typeof P.referToSelf=="object"&&typeof P.referToSelf.callback=="function"}function lr(P,V){if(!P)return V;if(V&&V!==P){const J=new Error("Function names do not match (expected: "+P+", actual: "+V+")");throw J.data={actual:V,expected:P},J}return P}function Rr(P){let V;for(const J in P)Object.prototype.hasOwnProperty.call(P,J)&&(p(P[J])||typeof P[J].signature=="string")&&(V=lr(V,P[J].name));return V}function fr(P,V){let J;for(J in V)if(Object.prototype.hasOwnProperty.call(V,J)){if(J in P&&V[J]!==P[J]){const ie=new Error('Signature "'+J+'" is defined twice');throw ie.data={signature:J,sourceFunction:V[J],destFunction:P[J]},ie}P[J]=V[J]}}const yt=a;a=function(P){const V=typeof P=="string",J=V?1:0;let ie=V?P:"";const ue={};for(let se=J;se<arguments.length;++se){const _e=arguments[se];let he={},de;if(typeof _e=="function"?(de=_e.name,typeof _e.signature=="string"?he[_e.signature]=_e:p(_e)&&(he=_e.signatures)):s(_e)&&(he=_e,V||(de=Rr(_e))),Object.keys(he).length===0){const ce=new TypeError("Argument to 'typed' at index "+se+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw ce.data={index:se,argument:_e},ce}V||(ie=lr(ie,de)),fr(ue,he)}return De(ie||"",ue)},a.create=Nl,a.createCount=yt.createCount,a.onMismatch=we,a.throwMismatchError=we,a.createError=I,a.clear=f,a.clearConversions=h,a.addTypes=c,a._findType=u,a.referTo=Ie,a.referToSelf=xt,a.convert=_,a.findSignature=v,a.find=x,a.isTypedFunction=p,a.warnAgainstDeprecatedThis=!0,a.addType=function(P,V){let J="any";V!==!1&&r.has("Object")&&(J="Object"),a.addTypes([P],J)};function Ot(P){if(!P||typeof P.from!="string"||typeof P.to!="string"||typeof P.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(P.to===P.from)throw new SyntaxError('Illegal to define conversion from "'+P.from+'" to itself.')}return a.addConversion=function(P){Ot(P);const V=u(P.to);if(V.conversionsTo.every(function(J){return J.from!==P.from}))V.conversionsTo.push({from:P.from,convert:P.convert,index:i++});else throw new Error('There is already a conversion from "'+P.from+'" to "'+V.name+'"')},a.addConversions=function(P){P.forEach(a.addConversion)},a.removeConversion=function(P){Ot(P);const V=u(P.to),J=nt(V.conversionsTo,ue=>ue.from===P.from);if(!J)throw new Error("Attempt to remove nonexistent conversion from "+P.from+" to "+P.to);if(J.convert!==P.convert)throw new Error("Conversion to remove does not match existing conversion");const ie=V.conversionsTo.indexOf(J);V.conversionsTo.splice(ie,1)},a.resolve=function(P,V){if(!p(P))throw new TypeError(Ml);const J=P._typedFunctionData.signatures;for(let ie=0;ie<J.length;++ie)if(J[ie].test(V))return J[ie];return null},a}var Sl=Nl();function bt(s){return typeof s=="boolean"?!0:isFinite(s)?s===Math.round(s):!1}function Fa(s,e,t){var r={2:"0b",8:"0o",16:"0x"},n=r[e],i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!bt(t))throw new Error("size must be an integer");if(s>2**(t-1)-1||s<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!bt(s))throw new Error("Value must be an integer");s<0&&(s=s+2**t),i="i".concat(t)}var a="";return s<0&&(s=-s,a="-"),"".concat(a).concat(n).concat(s.toString(e)).concat(i)}function Ba(s,e){if(typeof e=="function")return e(s);if(s===1/0)return"Infinity";if(s===-1/0)return"-Infinity";if(isNaN(s))return"NaN";var{notation:t,precision:r,wordSize:n}=Ol(e);switch(t){case"fixed":return Q1(s,r);case"exponential":return Il(s,r);case"engineering":return X1(s,r);case"bin":return Fa(s,2,n);case"oct":return Fa(s,8,n);case"hex":return Fa(s,16,n);case"auto":return J1(s,r,e).replace(/((\.\d*?)(0+))($|e)/,function(){var i=arguments[2],a=arguments[4];return i!=="."?i+a:a});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Ol(s){var e="auto",t,r;if(s!==void 0)if(pt(s))t=s;else if(St(s))t=s.toNumber();else if(Ca(s))s.precision!==void 0&&(t=Tl(s.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),s.wordSize!==void 0&&(r=Tl(s.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),s.notation&&(e=s.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:t,wordSize:r}}function Hs(s){var e=String(s).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+s);var t=e[1],r=e[2],n=parseFloat(e[4]||"0"),i=r.indexOf(".");n+=i!==-1?i-1:r.length-1;var a=r.replace(".","").replace(/^0*/,function(u){return n-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return a.length===0&&(a.push(0),n++),{sign:t,coefficients:a,exponent:n}}function X1(s,e){if(isNaN(s)||!isFinite(s))return String(s);var t=Hs(s),r=js(t,e),n=r.exponent,i=r.coefficients,a=n%3===0?n:n<0?n-3-n%3:n-n%3;if(pt(e))for(;e>i.length||n-a+1>i.length;)i.push(0);else for(var u=Math.abs(n-a)-(i.length-1),c=0;c<u;c++)i.push(0);for(var f=Math.abs(n-a),h=1;f>0;)h++,f--;var d=i.slice(h).join(""),p=pt(e)&&d.length||d.match(/[1-9]/)?"."+d:"",v=i.slice(0,h).join("")+p+"e"+(n>=0?"+":"")+a.toString();return r.sign+v}function Q1(s,e){if(isNaN(s)||!isFinite(s))return String(s);var t=Hs(s),r=typeof e=="number"?js(t,t.exponent+1+e):t,n=r.coefficients,i=r.exponent+1,a=i+(e||0);return n.length<a&&(n=n.concat(wi(a-n.length))),i<0&&(n=wi(-i+1).concat(n),i=1),i<n.length&&n.splice(i,0,i===0?"0.":"."),r.sign+n.join("")}function Il(s,e){if(isNaN(s)||!isFinite(s))return String(s);var t=Hs(s),r=e?js(t,e):t,n=r.coefficients,i=r.exponent;n.length<e&&(n=n.concat(wi(e-n.length)));var a=n.shift();return r.sign+a+(n.length>0?"."+n.join(""):"")+"e"+(i>=0?"+":"")+i}function J1(s,e,t){if(isNaN(s)||!isFinite(s))return String(s);var r=$l(t==null?void 0:t.lowerExp,-3),n=$l(t==null?void 0:t.upperExp,5),i=Hs(s),a=e?js(i,e):i;if(a.exponent<r||a.exponent>=n)return Il(s,e);var u=a.coefficients,c=a.exponent;u.length<e&&(u=u.concat(wi(e-u.length))),u=u.concat(wi(c-u.length+1+(u.length<e?e-u.length:0))),u=wi(-c).concat(u);var f=c>0?c:0;return f<u.length-1&&u.splice(f+1,0,"."),a.sign+u.join("")}function js(s,e){for(var t={sign:s.sign,coefficients:s.coefficients,exponent:s.exponent},r=t.coefficients;e<=0;)r.unshift(0),t.exponent++,e++;if(r.length>e){var n=r.splice(e,r.length-e);if(n[0]>=5){var i=e-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),t.exponent++,i++),i--,r[i]++}}return t}function wi(s){for(var e=[],t=0;t<s;t++)e.push(0);return e}function e_(s){return s.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var t_=Number.EPSILON||2220446049250313e-31;function ti(s,e,t){if(t==null)return s===e;if(s===e)return!0;if(isNaN(s)||isNaN(e))return!1;if(isFinite(s)&&isFinite(e)){var r=Math.abs(s-e);return r<=t_?!0:r<=Math.max(Math.abs(s),Math.abs(e))*t}return!1}function Tl(s,e){if(pt(s))return s;if(St(s))return s.toNumber();e()}function $l(s,e){return pt(s)?s:St(s)?s.toNumber():e}function Ma(s,e,t){var r=s.constructor,n=new r(2),i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!bt(t))throw new Error("size must be an integer");if(s.greaterThan(n.pow(t-1).sub(1))||s.lessThan(n.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!s.isInteger())throw new Error("Value must be an integer");s.lessThan(0)&&(s=s.add(n.pow(t))),i="i".concat(t)}switch(e){case 2:return"".concat(s.toBinary()).concat(i);case 8:return"".concat(s.toOctal()).concat(i);case 16:return"".concat(s.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(e," not supported "))}}function r_(s,e){if(typeof e=="function")return e(s);if(!s.isFinite())return s.isNaN()?"NaN":s.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:r,wordSize:n}=Ol(e);switch(t){case"fixed":return i_(s,r);case"exponential":return Ll(s,r);case"engineering":return n_(s,r);case"bin":return Ma(s,2,n);case"oct":return Ma(s,8,n);case"hex":return Ma(s,16,n);case"auto":{var i=Rl(e==null?void 0:e.lowerExp,-3),a=Rl(e==null?void 0:e.upperExp,5);if(s.isZero())return"0";var u,c=s.toSignificantDigits(r),f=c.e;return f>=i&&f<a?u=c.toFixed():u=Ll(s,r),u.replace(/((\.\d*?)(0+))($|e)/,function(){var h=arguments[2],d=arguments[4];return h!=="."?h+d:d})}default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function n_(s,e){var t=s.e,r=t%3===0?t:t<0?t-3-t%3:t-t%3,n=s.mul(Math.pow(10,-r)),i=n.toPrecision(e);if(i.indexOf("e")!==-1){var a=s.constructor;i=new a(i).toFixed()}return i+"e"+(t>=0?"+":"")+r.toString()}function Ll(s,e){return e!==void 0?s.toExponential(e-1):s.toExponential()}function i_(s,e){return s.toFixed(e)}function Rl(s,e){return pt(s)?s:St(s)?s.toNumber():e}function ft(s,e){var t=s_(s,e);return e&&typeof e=="object"&&"truncate"in e&&t.length>e.truncate?t.substring(0,e.truncate-3)+"...":t}function s_(s,e){if(typeof s=="number")return Ba(s,e);if(St(s))return r_(s,e);if(o_(s))return!e||e.fraction!=="decimal"?s.s*s.n+"/"+s.d:s.toString();if(Array.isArray(s))return zl(s,e);if(un(s))return Pl(s);if(typeof s=="function")return s.syntax?String(s.syntax):"function";if(s&&typeof s=="object"){if(typeof s.format=="function")return s.format(e);if(s&&s.toString(e)!=={}.toString())return s.toString(e);var t=Object.keys(s).map(r=>Pl(r)+": "+ft(s[r],e));return"{"+t.join(", ")+"}"}return String(s)}function Pl(s){for(var e=String(s),t="",r=0;r<e.length;){var n=e.charAt(r);t+=n in kl?kl[n]:n,r++}return'"'+t+'"'}var kl={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function zl(s,e){if(Array.isArray(s)){for(var t="[",r=s.length,n=0;n<r;n++)n!==0&&(t+=", "),t+=zl(s[n],e);return t+="]",t}else return ft(s,e)}function o_(s){return s&&typeof s=="object"&&typeof s.s=="number"&&typeof s.n=="number"&&typeof s.d=="number"||!1}function rt(s,e,t){if(!(this instanceof rt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=s,this.expected=e,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(s)?"["+s.join(", ")+"]":s)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}rt.prototype=new RangeError,rt.prototype.constructor=RangeError,rt.prototype.name="DimensionError",rt.prototype.isDimensionError=!0;function On(s,e,t){if(!(this instanceof On))throw new SyntaxError("Constructor must be called with the new operator");this.index=s,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=t),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}On.prototype=new RangeError,On.prototype.constructor=RangeError,On.prototype.name="IndexError",On.prototype.isIndexError=!0;function Rt(s){for(var e=[];Array.isArray(s);)e.push(s.length),s=s[0];return e}function ql(s,e,t){var r,n=s.length;if(n!==e[t])throw new rt(n,e[t]);if(t<e.length-1){var i=t+1;for(r=0;r<n;r++){var a=s[r];if(!Array.isArray(a))throw new rt(e.length-1,e.length,"<");ql(s[r],e,i)}}else for(r=0;r<n;r++)if(Array.isArray(s[r]))throw new rt(e.length+1,e.length,">")}function Ul(s,e){var t=e.length===0;if(t){if(Array.isArray(s))throw new rt(s.length,0)}else ql(s,e,0)}function Ft(s,e){if(s!==void 0){if(!pt(s)||!bt(s))throw new TypeError("Index must be an integer (value: "+s+")");if(s<0||typeof e=="number"&&s>=e)throw new On(s,e)}}function Na(s,e,t){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(n){if(!pt(n)||!bt(n)||n<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ft(e)+")")}),(pt(s)||St(s))&&(s=[s]);var r=t!==void 0?t:0;return Sa(s,e,0,r),s}function Sa(s,e,t,r){var n,i,a=s.length,u=e[t],c=Math.min(a,u);if(s.length=u,t<e.length-1){var f=t+1;for(n=0;n<c;n++)i=s[n],Array.isArray(i)||(i=[i],s[n]=i),Sa(i,e,f,r);for(n=c;n<u;n++)i=[],s[n]=i,Sa(i,e,f,r)}else{for(n=0;n<c;n++)for(;Array.isArray(s[n]);)s[n]=s[n][0];for(n=c;n<u;n++)s[n]=r}}function Oa(s,e){var t=Ta(s),r=t.length;if(!Array.isArray(s)||!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new rt(0,r,"!=");e=Ia(e,r);var n=Wl(e);if(r!==n)throw new rt(n,r,"!=");try{return a_(t,e)}catch(i){throw i instanceof rt?new rt(n,r,"!="):i}}function Ia(s,e){var t=Wl(s),r=s.slice(),n=-1,i=s.indexOf(n),a=s.indexOf(n,i+1)>=0;if(a)throw new Error("More than one wildcard in sizes");var u=i>=0,c=e%t===0;if(u)if(c)r[i]=-e/t;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-t);return r}function Wl(s){return s.reduce((e,t)=>e*t,1)}function a_(s,e){for(var t=s,r,n=e.length-1;n>0;n--){var i=e[n];r=[];for(var a=t.length/i,u=0;u<a;u++)r.push(t.slice(u*i,(u+1)*i));t=r}return t}function Hl(s,e,t,r){var n=r||Rt(s);if(t)for(var i=0;i<t;i++)s=[s],n.unshift(1);for(s=jl(s,e,0);n.length<e;)n.push(1);return s}function jl(s,e,t){var r,n;if(Array.isArray(s)){var i=t+1;for(r=0,n=s.length;r<n;r++)s[r]=jl(s[r],e,i)}else for(var a=t;a<e;a++)s=[s];return s}function Ta(s){if(!Array.isArray(s))return s;var e=[];return s.forEach(function t(r){Array.isArray(r)?r.forEach(t):e.push(r)}),e}function Ys(s,e){for(var t,r=0,n=0;n<s.length;n++){var i=s[n],a=Array.isArray(i);if(n===0&&a&&(r=i.length),a&&i.length!==r)return;var u=a?Ys(i,e):e(i);if(t===void 0)t=u;else if(t!==u)return"mixed"}return t}function Yl(s,e,t,r){if(r<t){if(s.length!==e.length)throw new rt(s.length,e.length);for(var n=[],i=0;i<s.length;i++)n[i]=Yl(s[i],e[i],t,r+1);return n}else return s.concat(e)}function Zl(){var s=Array.prototype.slice.call(arguments,0,-1),e=Array.prototype.slice.call(arguments,-1);if(s.length===1)return s[0];if(s.length>1)return s.slice(1).reduce(function(t,r){return Yl(t,r,e,0)},s[0]);throw new Error("Wrong number of arguments in function concat")}function u_(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];for(var r=e.map(p=>p.length),n=Math.max(...r),i=new Array(n).fill(null),a=0;a<e.length;a++)for(var u=e[a],c=r[a],f=0;f<c;f++){var h=n-c+f;u[f]>i[h]&&(i[h]=u[f])}for(var d=0;d<e.length;d++)Zs(e[d],i);return i}function Zs(s,e){for(var t=e.length,r=s.length,n=0;n<r;n++){var i=t-r+n;if(s[n]<e[i]&&s[n]>1||s[n]>e[i])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(s,") not possible to broadcast dimension ").concat(r," with size ").concat(s[n]," to size ").concat(e[i]))}}function Vl(s,e){var t=Rt(s);if(yi(t,e))return s;Zs(t,e);var r=u_(t,e),n=r.length,i=[...Array(n-t.length).fill(1),...t],a=f_(s);t.length<n&&(a=Oa(a,i),t=Rt(a));for(var u=0;u<n;u++)t[u]<r[u]&&(a=l_(a,r[u],u),t=Rt(a));return a}function l_(s,e,t){return Zl(...Array(e).fill(s),t)}function f_(s){return Ws([],s)}function xe(s,e,t,r){function n(i){var a=V1(i,e.map(d_));return c_(s,e,i),t(a)}return n.isFactory=!0,n.fn=s,n.dependencies=e.slice().sort(),r&&(n.meta=r),n}function c_(s,e,t){var r=e.filter(i=>!h_(i)).every(i=>t[i]!==void 0);if(!r){var n=e.filter(i=>t[i]===void 0);throw new Error('Cannot create function "'.concat(s,'", ')+"some dependencies are missing: ".concat(n.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function h_(s){return s&&s[0]==="?"}function d_(s){return s&&s[0]==="?"?s.slice(1):s}function p_(s,e){if(Kl(s)&&Gl(s,e))return s[e];throw typeof s[e]=="function"&&g_(s,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function __(s,e,t){if(Kl(s)&&Gl(s,e))return s[e]=t,t;throw new Error('No access to property "'+e+'"')}function v_(s,e){return e in s}function Gl(s,e){return!s||typeof s!="object"?!1:ss(m_,e)?!0:!(e in Object.prototype||e in Function.prototype)}function g_(s,e){return s==null||typeof s[e]!="function"||ss(s,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(s)?!1:ss(x_,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Kl(s){return typeof s=="object"&&s&&s.constructor===Object}var m_={length:!0,name:!0},x_={toString:!0,valueOf:!0,toLocaleString:!0};class y_{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return p_(this.wrappedObject,e)}set(e,t){return __(this.wrappedObject,e,t),this}has(e){return v_(this.wrappedObject,e)}entries(){return D_(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}function D_(s,e){return{next:()=>{var t=s.next();return t.done?t:{value:e(t.value),done:!1}}}}function w_(s){return s?s instanceof Map||s instanceof y_||typeof s.set=="function"&&typeof s.get=="function"&&typeof s.keys=="function"&&typeof s.has=="function":!1}var Xl=function(){return Xl=Sl.create,Sl},b_=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],E_=xe("typed",b_,function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=Xl();return a.clear(),a.addTypes([{name:"number",test:pt},{name:"Complex",test:El},{name:"BigNumber",test:St},{name:"Fraction",test:Al},{name:"Unit",test:Cl},{name:"identifier",test:u=>un&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:un},{name:"Chain",test:Y1},{name:"Array",test:Ct},{name:"Matrix",test:mt},{name:"DenseMatrix",test:x1},{name:"SparseMatrix",test:y1},{name:"Range",test:D1},{name:"Index",test:Aa},{name:"boolean",test:w1},{name:"ResultSet",test:b1},{name:"Help",test:E1},{name:"function",test:A1},{name:"Date",test:C1},{name:"RegExp",test:F1},{name:"null",test:B1},{name:"undefined",test:M1},{name:"AccessorNode",test:N1},{name:"ArrayNode",test:S1},{name:"AssignmentNode",test:O1},{name:"BlockNode",test:I1},{name:"ConditionalNode",test:T1},{name:"ConstantNode",test:$1},{name:"FunctionNode",test:R1},{name:"FunctionAssignmentNode",test:L1},{name:"IndexNode",test:P1},{name:"Node",test:k1},{name:"ObjectNode",test:z1},{name:"OperatorNode",test:q1},{name:"ParenthesisNode",test:U1},{name:"RangeNode",test:W1},{name:"RelationalNode",test:H1},{name:"SymbolNode",test:j1},{name:"Map",test:w_},{name:"Object",test:Ca}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(c){if(t||$a(c),e_(c)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+c+"). Use function bignumber(x) to convert to BigNumber.");return new t(c)}},{from:"number",to:"Complex",convert:function(c){return r||Vs(c),new r(c,0)}},{from:"BigNumber",to:"Complex",convert:function(c){return r||Vs(c),new r(c.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(c){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(c){return r||Vs(c),new r(c.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(c){i||La(c);var f=new i(c);if(f.valueOf()!==c)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+c+"). Use function fraction(x) to convert to Fraction.");return f}},{from:"string",to:"number",convert:function(c){var f=Number(c);if(isNaN(f))throw new Error('Cannot convert "'+c+'" to a number');return f}},{from:"string",to:"BigNumber",convert:function(c){t||$a(c);try{return new t(c)}catch{throw new Error('Cannot convert "'+c+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(c){i||La(c);try{return new i(c)}catch{throw new Error('Cannot convert "'+c+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(c){r||Vs(c);try{return new r(c)}catch{throw new Error('Cannot convert "'+c+'" to Complex')}}},{from:"boolean",to:"number",convert:function(c){return+c}},{from:"boolean",to:"BigNumber",convert:function(c){return t||$a(c),new t(+c)}},{from:"boolean",to:"Fraction",convert:function(c){return i||La(c),new i(+c)}},{from:"boolean",to:"string",convert:function(c){return String(c)}},{from:"Array",to:"Matrix",convert:function(c){return n||A_(),new n(c)}},{from:"Matrix",to:"Array",convert:function(c){return c.valueOf()}}]),a.onMismatch=(u,c,f)=>{var h=a.createError(u,c,f);if(["wrongType","mismatch"].includes(h.data.category)&&c.length===1&&is(c[0])&&f.some(p=>!p.params.includes(","))){var d=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw d.data=h.data,d}throw h},a.onMismatch=(u,c,f)=>{var h=a.createError(u,c,f);if(["wrongType","mismatch"].includes(h.data.category)&&c.length===1&&is(c[0])&&f.some(p=>!p.params.includes(","))){var d=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw d.data=h.data,d}throw h},a});function $a(s){throw new Error("Cannot convert value ".concat(s," into a BigNumber: no class 'BigNumber' provided"))}function Vs(s){throw new Error("Cannot convert value ".concat(s," into a Complex number: no class 'Complex' provided"))}function A_(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function La(s){throw new Error("Cannot convert value ".concat(s," into a Fraction, no class 'Fraction' provided."))}/*!
35
35
  * decimal.js v10.4.3
36
36
  * An arbitrary-precision Decimal type for JavaScript.
37
37
  * https://github.com/MikeMcl/decimal.js
38
38
  * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
39
39
  * MIT Licence
40
- */var bi=9e15,In=1e9,La="0123456789abcdef",Gs="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ks="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pa={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-bi,maxE:bi,crypto:!1},Ql,gn,$e=!0,Xs="[DecimalError] ",Tn=Xs+"Invalid argument: ",Jl=Xs+"Precision limit exceeded",ec=Xs+"crypto unavailable",tc="[object Decimal]",er=Math.floor,qt=Math.pow,C_=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,F_=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,B_=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rc=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Xr=1e7,Be=7,M_=9007199254740991,N_=Gs.length-1,ka=Ks.length-1,le={toStringTag:tc};le.absoluteValue=le.abs=function(){var s=new this.constructor(this);return s.s<0&&(s.s=1),Ce(s)},le.ceil=function(){return Ce(new this.constructor(this),this.e+1,2)},le.clampedTo=le.clamp=function(s,e){var t,r=this,n=r.constructor;if(s=new n(s),e=new n(e),!s.s||!e.s)return new n(NaN);if(s.gt(e))throw Error(Tn+e);return t=r.cmp(s),t<0?s:r.cmp(e)>0?e:new n(r)},le.comparedTo=le.cmp=function(s){var e,t,r,n,i=this,a=i.d,u=(s=new i.constructor(s)).d,f=i.s,c=s.s;if(!a||!u)return!f||!c?NaN:f!==c?f:a===u?0:!a^f<0?1:-1;if(!a[0]||!u[0])return a[0]?f:u[0]?-c:0;if(f!==c)return f;if(i.e!==s.e)return i.e>s.e^f<0?1:-1;for(r=a.length,n=u.length,e=0,t=r<n?r:n;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^f<0?1:-1;return r===n?0:r>n^f<0?1:-1},le.cosine=le.cos=function(){var s,e,t=this,r=t.constructor;return t.d?t.d[0]?(s=r.precision,e=r.rounding,r.precision=s+Math.max(t.e,t.sd())+Be,r.rounding=1,t=S_(r,uc(r,t)),r.precision=s,r.rounding=e,Ce(gn==2||gn==3?t.neg():t,s,e,!0)):new r(1):new r(NaN)},le.cubeRoot=le.cbrt=function(){var s,e,t,r,n,i,a,u,f,c,h=this,d=h.constructor;if(!h.isFinite()||h.isZero())return new d(h);for($e=!1,i=h.s*qt(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=Vt(h.d),s=h.e,(i=(s-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=qt(t,1/3),s=er((s+1)/3)-(s%3==(s<0?-1:2)),i==1/0?t="5e"+s:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+s),r=new d(t),r.s=h.s):r=new d(i.toString()),a=(s=d.precision)+3;;)if(u=r,f=u.times(u).times(u),c=f.plus(h),r=ft(c.plus(h).times(u),c.plus(f),a+2,1),Vt(u.d).slice(0,a)===(t=Vt(r.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!n&&t=="4999"){if(!n&&(Ce(u,s+1,0),u.times(u).times(u).eq(h))){r=u;break}a+=4,n=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Ce(r,s+1,1),e=!r.times(r).times(r).eq(h));break}return $e=!0,Ce(r,s,d.rounding,e)},le.decimalPlaces=le.dp=function(){var s,e=this.d,t=NaN;if(e){if(s=e.length-1,t=(s-er(this.e/Be))*Be,s=e[s],s)for(;s%10==0;s/=10)t--;t<0&&(t=0)}return t},le.dividedBy=le.div=function(s){return ft(this,new this.constructor(s))},le.dividedToIntegerBy=le.divToInt=function(s){var e=this,t=e.constructor;return Ce(ft(e,new t(s),0,1,1),t.precision,t.rounding)},le.equals=le.eq=function(s){return this.cmp(s)===0},le.floor=function(){return Ce(new this.constructor(this),this.e+1,3)},le.greaterThan=le.gt=function(s){return this.cmp(s)>0},le.greaterThanOrEqualTo=le.gte=function(s){var e=this.cmp(s);return e==1||e===0},le.hyperbolicCosine=le.cosh=function(){var s,e,t,r,n,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<32?(s=Math.ceil(n/3),e=(1/to(4,s)).toString()):(s=16,e="2.3283064365386962890625e-10"),i=Ei(a,1,i.times(e),new a(1),!0);for(var f,c=s,h=new a(8);c--;)f=i.times(i),i=u.minus(f.times(h.minus(f.times(h))));return Ce(i,a.precision=t,a.rounding=r,!0)},le.hyperbolicSine=le.sinh=function(){var s,e,t,r,n=this,i=n.constructor;if(!n.isFinite()||n.isZero())return new i(n);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+4,i.rounding=1,r=n.d.length,r<3)n=Ei(i,2,n,n,!0);else{s=1.4*Math.sqrt(r),s=s>16?16:s|0,n=n.times(1/to(5,s)),n=Ei(i,2,n,n,!0);for(var a,u=new i(5),f=new i(16),c=new i(20);s--;)a=n.times(n),n=n.times(u.plus(a.times(f.times(a).plus(c))))}return i.precision=e,i.rounding=t,Ce(n,e,t,!0)},le.hyperbolicTangent=le.tanh=function(){var s,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+7,r.rounding=1,ft(t.sinh(),t.cosh(),r.precision=s,r.rounding=e)):new r(t.s)},le.inverseCosine=le.acos=function(){var s,e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Qr(t,n,i):new t(0):new t(NaN):e.isZero()?Qr(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=e.asin(),s=Qr(t,n+4,i).times(.5),t.precision=n,t.rounding=i,s.minus(e))},le.inverseHyperbolicCosine=le.acosh=function(){var s,e,t=this,r=t.constructor;return t.lte(1)?new r(t.eq(1)?0:NaN):t.isFinite()?(s=r.precision,e=r.rounding,r.precision=s+Math.max(Math.abs(t.e),t.sd())+4,r.rounding=1,$e=!1,t=t.times(t).minus(1).sqrt().plus(t),$e=!0,r.precision=s,r.rounding=e,t.ln()):new r(t)},le.inverseHyperbolicSine=le.asinh=function(){var s,e,t=this,r=t.constructor;return!t.isFinite()||t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+2*Math.max(Math.abs(t.e),t.sd())+6,r.rounding=1,$e=!1,t=t.times(t).plus(1).sqrt().plus(t),$e=!0,r.precision=s,r.rounding=e,t.ln())},le.inverseHyperbolicTangent=le.atanh=function(){var s,e,t,r,n=this,i=n.constructor;return n.isFinite()?n.e>=0?new i(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(s=i.precision,e=i.rounding,r=n.sd(),Math.max(r,s)<2*-n.e-1?Ce(new i(n),s,e,!0):(i.precision=t=r-n.e,n=ft(n.plus(1),new i(1).minus(n),t+s,1),i.precision=s+4,i.rounding=1,n=n.ln(),i.precision=s,i.rounding=e,n.times(.5))):new i(NaN)},le.inverseSine=le.asin=function(){var s,e,t,r,n=this,i=n.constructor;return n.isZero()?new i(n):(e=n.abs().cmp(1),t=i.precision,r=i.rounding,e!==-1?e===0?(s=Qr(i,t+4,r).times(.5),s.s=n.s,s):new i(NaN):(i.precision=t+6,i.rounding=1,n=n.div(new i(1).minus(n.times(n)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=r,n.times(2)))},le.inverseTangent=le.atan=function(){var s,e,t,r,n,i,a,u,f,c=this,h=c.constructor,d=h.precision,p=h.rounding;if(c.isFinite()){if(c.isZero())return new h(c);if(c.abs().eq(1)&&d+4<=ka)return a=Qr(h,d+4,p).times(.25),a.s=c.s,a}else{if(!c.s)return new h(NaN);if(d+4<=ka)return a=Qr(h,d+4,p).times(.5),a.s=c.s,a}for(h.precision=u=d+10,h.rounding=1,t=Math.min(28,u/Be+2|0),s=t;s;--s)c=c.div(c.times(c).plus(1).sqrt().plus(1));for($e=!1,e=Math.ceil(u/Be),r=1,f=c.times(c),a=new h(c),n=c;s!==-1;)if(n=n.times(f),i=a.minus(n.div(r+=2)),n=n.times(f),a=i.plus(n.div(r+=2)),a.d[e]!==void 0)for(s=e;a.d[s]===i.d[s]&&s--;);return t&&(a=a.times(2<<t-1)),$e=!0,Ce(a,h.precision=d,h.rounding=p,!0)},le.isFinite=function(){return!!this.d},le.isInteger=le.isInt=function(){return!!this.d&&er(this.e/Be)>this.d.length-2},le.isNaN=function(){return!this.s},le.isNegative=le.isNeg=function(){return this.s<0},le.isPositive=le.isPos=function(){return this.s>0},le.isZero=function(){return!!this.d&&this.d[0]===0},le.lessThan=le.lt=function(s){return this.cmp(s)<0},le.lessThanOrEqualTo=le.lte=function(s){return this.cmp(s)<1},le.logarithm=le.log=function(s){var e,t,r,n,i,a,u,f,c=this,h=c.constructor,d=h.precision,p=h.rounding,v=5;if(s==null)s=new h(10),e=!0;else{if(s=new h(s),t=s.d,s.s<0||!t||!t[0]||s.eq(1))return new h(NaN);e=s.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new h(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(n=t[0];n%10===0;)n/=10;i=n!==1}if($e=!1,u=d+v,a=Rn(c,u),r=e?eo(h,u+10):Rn(s,u),f=ft(a,r,u,1),os(f.d,n=d,p))do if(u+=10,a=Rn(c,u),r=e?eo(h,u+10):Rn(s,u),f=ft(a,r,u,1),!i){+Vt(f.d).slice(n+1,n+15)+1==1e14&&(f=Ce(f,d+1,0));break}while(os(f.d,n+=10,p));return $e=!0,Ce(f,d,p)},le.minus=le.sub=function(s){var e,t,r,n,i,a,u,f,c,h,d,p,v=this,x=v.constructor;if(s=new x(s),!v.d||!s.d)return!v.s||!s.s?s=new x(NaN):v.d?s.s=-s.s:s=new x(s.d||v.s!==s.s?v:NaN),s;if(v.s!=s.s)return s.s=-s.s,v.plus(s);if(c=v.d,p=s.d,u=x.precision,f=x.rounding,!c[0]||!p[0]){if(p[0])s.s=-s.s;else if(c[0])s=new x(v);else return new x(f===3?-0:0);return $e?Ce(s,u,f):s}if(t=er(s.e/Be),h=er(v.e/Be),c=c.slice(),i=h-t,i){for(d=i<0,d?(e=c,i=-i,a=p.length):(e=p,t=h,a=c.length),r=Math.max(Math.ceil(u/Be),a)+2,i>r&&(i=r,e.length=1),e.reverse(),r=i;r--;)e.push(0);e.reverse()}else{for(r=c.length,a=p.length,d=r<a,d&&(a=r),r=0;r<a;r++)if(c[r]!=p[r]){d=c[r]<p[r];break}i=0}for(d&&(e=c,c=p,p=e,s.s=-s.s),a=c.length,r=p.length-a;r>0;--r)c[a++]=0;for(r=p.length;r>i;){if(c[--r]<p[r]){for(n=r;n&&c[--n]===0;)c[n]=Xr-1;--c[n],c[r]+=Xr}c[r]-=p[r]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(s.d=c,s.e=Js(c,t),$e?Ce(s,u,f):s):new x(f===3?-0:0)},le.modulo=le.mod=function(s){var e,t=this,r=t.constructor;return s=new r(s),!t.d||!s.s||s.d&&!s.d[0]?new r(NaN):!s.d||t.d&&!t.d[0]?Ce(new r(t),r.precision,r.rounding):($e=!1,r.modulo==9?(e=ft(t,s.abs(),0,3,1),e.s*=s.s):e=ft(t,s,0,r.modulo,1),e=e.times(s),$e=!0,t.minus(e))},le.naturalExponential=le.exp=function(){return za(this)},le.naturalLogarithm=le.ln=function(){return Rn(this)},le.negated=le.neg=function(){var s=new this.constructor(this);return s.s=-s.s,Ce(s)},le.plus=le.add=function(s){var e,t,r,n,i,a,u,f,c,h,d=this,p=d.constructor;if(s=new p(s),!d.d||!s.d)return!d.s||!s.s?s=new p(NaN):d.d||(s=new p(s.d||d.s===s.s?d:NaN)),s;if(d.s!=s.s)return s.s=-s.s,d.minus(s);if(c=d.d,h=s.d,u=p.precision,f=p.rounding,!c[0]||!h[0])return h[0]||(s=new p(d)),$e?Ce(s,u,f):s;if(i=er(d.e/Be),r=er(s.e/Be),c=c.slice(),n=i-r,n){for(n<0?(t=c,n=-n,a=h.length):(t=h,r=i,a=c.length),i=Math.ceil(u/Be),a=i>a?i+1:a+1,n>a&&(n=a,t.length=1),t.reverse();n--;)t.push(0);t.reverse()}for(a=c.length,n=h.length,a-n<0&&(n=a,t=h,h=c,c=t),e=0;n;)e=(c[--n]=c[n]+h[n]+e)/Xr|0,c[n]%=Xr;for(e&&(c.unshift(e),++r),a=c.length;c[--a]==0;)c.pop();return s.d=c,s.e=Js(c,r),$e?Ce(s,u,f):s},le.precision=le.sd=function(s){var e,t=this;if(s!==void 0&&s!==!!s&&s!==1&&s!==0)throw Error(Tn+s);return t.d?(e=nc(t.d),s&&t.e+1>e&&(e=t.e+1)):e=NaN,e},le.round=function(){var s=this,e=s.constructor;return Ce(new e(s),s.e+1,e.rounding)},le.sine=le.sin=function(){var s,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+Math.max(t.e,t.sd())+Be,r.rounding=1,t=I_(r,uc(r,t)),r.precision=s,r.rounding=e,Ce(gn>2?t.neg():t,s,e,!0)):new r(NaN)},le.squareRoot=le.sqrt=function(){var s,e,t,r,n,i,a=this,u=a.d,f=a.e,c=a.s,h=a.constructor;if(c!==1||!u||!u[0])return new h(!c||c<0&&(!u||u[0])?NaN:u?a:1/0);for($e=!1,c=Math.sqrt(+a),c==0||c==1/0?(e=Vt(u),(e.length+f)%2==0&&(e+="0"),c=Math.sqrt(e),f=er((f+1)/2)-(f<0||f%2),c==1/0?e="5e"+f:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+f),r=new h(e)):r=new h(c.toString()),t=(f=h.precision)+3;;)if(i=r,r=i.plus(ft(a,i,t+2,1)).times(.5),Vt(i.d).slice(0,t)===(e=Vt(r.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!n&&e=="4999"){if(!n&&(Ce(i,f+1,0),i.times(i).eq(a))){r=i;break}t+=4,n=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ce(r,f+1,1),s=!r.times(r).eq(a));break}return $e=!0,Ce(r,f,h.rounding,s)},le.tangent=le.tan=function(){var s,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+10,r.rounding=1,t=t.sin(),t.s=1,t=ft(t,new r(1).minus(t.times(t)).sqrt(),s+10,0),r.precision=s,r.rounding=e,Ce(gn==2||gn==4?t.neg():t,s,e,!0)):new r(NaN)},le.times=le.mul=function(s){var e,t,r,n,i,a,u,f,c,h=this,d=h.constructor,p=h.d,v=(s=new d(s)).d;if(s.s*=h.s,!p||!p[0]||!v||!v[0])return new d(!s.s||p&&!p[0]&&!v||v&&!v[0]&&!p?NaN:!p||!v?s.s/0:s.s*0);for(t=er(h.e/Be)+er(s.e/Be),f=p.length,c=v.length,f<c&&(i=p,p=v,v=i,a=f,f=c,c=a),i=[],a=f+c,r=a;r--;)i.push(0);for(r=c;--r>=0;){for(e=0,n=f+r;n>r;)u=i[n]+v[r]*p[n-r-1]+e,i[n--]=u%Xr|0,e=u/Xr|0;i[n]=(i[n]+e)%Xr|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),s.d=i,s.e=Js(i,t),$e?Ce(s,d.precision,d.rounding):s},le.toBinary=function(s,e){return Ua(this,2,s,e)},le.toDecimalPlaces=le.toDP=function(s,e){var t=this,r=t.constructor;return t=new r(t),s===void 0?t:(vr(s,0,In),e===void 0?e=r.rounding:vr(e,0,8),Ce(t,s+t.e+1,e))},le.toExponential=function(s,e){var t,r=this,n=r.constructor;return s===void 0?t=ln(r,!0):(vr(s,0,In),e===void 0?e=n.rounding:vr(e,0,8),r=Ce(new n(r),s+1,e),t=ln(r,!0,s+1)),r.isNeg()&&!r.isZero()?"-"+t:t},le.toFixed=function(s,e){var t,r,n=this,i=n.constructor;return s===void 0?t=ln(n):(vr(s,0,In),e===void 0?e=i.rounding:vr(e,0,8),r=Ce(new i(n),s+n.e+1,e),t=ln(r,!1,s+r.e+1)),n.isNeg()&&!n.isZero()?"-"+t:t},le.toFraction=function(s){var e,t,r,n,i,a,u,f,c,h,d,p,v=this,x=v.d,_=v.constructor;if(!x)return new _(v);if(c=t=new _(1),r=f=new _(0),e=new _(r),i=e.e=nc(x)-v.e-1,a=i%Be,e.d[0]=qt(10,a<0?Be+a:a),s==null)s=i>0?e:c;else{if(u=new _(s),!u.isInt()||u.lt(c))throw Error(Tn+u);s=u.gt(e)?i>0?e:c:u}for($e=!1,u=new _(Vt(x)),h=_.precision,_.precision=i=x.length*Be*2;d=ft(u,e,0,1,1),n=t.plus(d.times(r)),n.cmp(s)!=1;)t=r,r=n,n=c,c=f.plus(d.times(n)),f=n,n=e,e=u.minus(d.times(n)),u=n;return n=ft(s.minus(t),r,0,1,1),f=f.plus(n.times(c)),t=t.plus(n.times(r)),f.s=c.s=v.s,p=ft(c,r,i,1).minus(v).abs().cmp(ft(f,t,i,1).minus(v).abs())<1?[c,r]:[f,t],_.precision=h,$e=!0,p},le.toHexadecimal=le.toHex=function(s,e){return Ua(this,16,s,e)},le.toNearest=function(s,e){var t=this,r=t.constructor;if(t=new r(t),s==null){if(!t.d)return t;s=new r(1),e=r.rounding}else{if(s=new r(s),e===void 0?e=r.rounding:vr(e,0,8),!t.d)return s.s?t:s;if(!s.d)return s.s&&(s.s=t.s),s}return s.d[0]?($e=!1,t=ft(t,s,0,e,1).times(s),$e=!0,Ce(t)):(s.s=t.s,t=s),t},le.toNumber=function(){return+this},le.toOctal=function(s,e){return Ua(this,8,s,e)},le.toPower=le.pow=function(s){var e,t,r,n,i,a,u=this,f=u.constructor,c=+(s=new f(s));if(!u.d||!s.d||!u.d[0]||!s.d[0])return new f(qt(+u,c));if(u=new f(u),u.eq(1))return u;if(r=f.precision,i=f.rounding,s.eq(1))return Ce(u,r,i);if(e=er(s.e/Be),e>=s.d.length-1&&(t=c<0?-c:c)<=M_)return n=ic(f,u,t,r),s.s<0?new f(1).div(n):Ce(n,r,i);if(a=u.s,a<0){if(e<s.d.length-1)return new f(NaN);if(s.d[e]&1||(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=qt(+u,c),e=t==0||!isFinite(t)?er(c*(Math.log("0."+Vt(u.d))/Math.LN10+u.e+1)):new f(t+"").e,e>f.maxE+1||e<f.minE-1?new f(e>0?a/0:0):($e=!1,f.rounding=u.s=1,t=Math.min(12,(e+"").length),n=za(s.times(Rn(u,r+t)),r),n.d&&(n=Ce(n,r+5,1),os(n.d,r,i)&&(e=r+10,n=Ce(za(s.times(Rn(u,e+t)),e),e+5,1),+Vt(n.d).slice(r+1,r+15)+1==1e14&&(n=Ce(n,r+1,0)))),n.s=a,$e=!0,f.rounding=i,Ce(n,r,i))},le.toPrecision=function(s,e){var t,r=this,n=r.constructor;return s===void 0?t=ln(r,r.e<=n.toExpNeg||r.e>=n.toExpPos):(vr(s,1,In),e===void 0?e=n.rounding:vr(e,0,8),r=Ce(new n(r),s,e),t=ln(r,s<=r.e||r.e<=n.toExpNeg,s)),r.isNeg()&&!r.isZero()?"-"+t:t},le.toSignificantDigits=le.toSD=function(s,e){var t=this,r=t.constructor;return s===void 0?(s=r.precision,e=r.rounding):(vr(s,1,In),e===void 0?e=r.rounding:vr(e,0,8)),Ce(new r(t),s,e)},le.toString=function(){var s=this,e=s.constructor,t=ln(s,s.e<=e.toExpNeg||s.e>=e.toExpPos);return s.isNeg()&&!s.isZero()?"-"+t:t},le.truncated=le.trunc=function(){return Ce(new this.constructor(this),this.e+1,1)},le.valueOf=le.toJSON=function(){var s=this,e=s.constructor,t=ln(s,s.e<=e.toExpNeg||s.e>=e.toExpPos);return s.isNeg()?"-"+t:t};function Vt(s){var e,t,r,n=s.length-1,i="",a=s[0];if(n>0){for(i+=a,e=1;e<n;e++)r=s[e]+"",t=Be-r.length,t&&(i+=$n(t)),i+=r;a=s[e],r=a+"",t=Be-r.length,t&&(i+=$n(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}function vr(s,e,t){if(s!==~~s||s<e||s>t)throw Error(Tn+s)}function os(s,e,t,r){var n,i,a,u;for(i=s[0];i>=10;i/=10)--e;return--e<0?(e+=Be,n=0):(n=Math.ceil((e+1)/Be),e%=Be),i=qt(10,Be-e),u=s[n]%i|0,r==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(s[n+1]/i/100|0)==qt(10,e-2)-1||(u==i/2||u==0)&&(s[n+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(r||t<4)&&u==9999||!r&&t>3&&u==4999):a=((r||t<4)&&u+1==i||!r&&t>3&&u+1==i/2)&&(s[n+1]/i/1e3|0)==qt(10,e-3)-1,a}function Qs(s,e,t){for(var r,n=[0],i,a=0,u=s.length;a<u;){for(i=n.length;i--;)n[i]*=e;for(n[0]+=La.indexOf(s.charAt(a++)),r=0;r<n.length;r++)n[r]>t-1&&(n[r+1]===void 0&&(n[r+1]=0),n[r+1]+=n[r]/t|0,n[r]%=t)}return n.reverse()}function S_(s,e){var t,r,n;if(e.isZero())return e;r=e.d.length,r<32?(t=Math.ceil(r/3),n=(1/to(4,t)).toString()):(t=16,n="2.3283064365386962890625e-10"),s.precision+=t,e=Ei(s,1,e.times(n),new s(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return s.precision-=t,e}var ft=function(){function s(r,n,i){var a,u=0,f=r.length;for(r=r.slice();f--;)a=r[f]*n+u,r[f]=a%i|0,u=a/i|0;return u&&r.unshift(u),r}function e(r,n,i,a){var u,f;if(i!=a)f=i>a?1:-1;else for(u=f=0;u<i;u++)if(r[u]!=n[u]){f=r[u]>n[u]?1:-1;break}return f}function t(r,n,i,a){for(var u=0;i--;)r[i]-=u,u=r[i]<n[i]?1:0,r[i]=u*a+r[i]-n[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,n,i,a,u,f){var c,h,d,p,v,x,_,y,m,w,D,C,b,F,B,M,O,A,N,I,R=r.constructor,k=r.s==n.s?1:-1,z=r.d,L=n.d;if(!z||!z[0]||!L||!L[0])return new R(!r.s||!n.s||(z?L&&z[0]==L[0]:!L)?NaN:z&&z[0]==0||!L?k*0:k/0);for(f?(v=1,h=r.e-n.e):(f=Xr,v=Be,h=er(r.e/v)-er(n.e/v)),N=L.length,O=z.length,m=new R(k),w=m.d=[],d=0;L[d]==(z[d]||0);d++);if(L[d]>(z[d]||0)&&h--,i==null?(F=i=R.precision,a=R.rounding):u?F=i+(r.e-n.e)+1:F=i,F<0)w.push(1),x=!0;else{if(F=F/v+2|0,d=0,N==1){for(p=0,L=L[0],F++;(d<O||p)&&F--;d++)B=p*f+(z[d]||0),w[d]=B/L|0,p=B%L|0;x=p||d<O}else{for(p=f/(L[0]+1)|0,p>1&&(L=s(L,p,f),z=s(z,p,f),N=L.length,O=z.length),M=N,D=z.slice(0,N),C=D.length;C<N;)D[C++]=0;I=L.slice(),I.unshift(0),A=L[0],L[1]>=f/2&&++A;do p=0,c=e(L,D,N,C),c<0?(b=D[0],N!=C&&(b=b*f+(D[1]||0)),p=b/A|0,p>1?(p>=f&&(p=f-1),_=s(L,p,f),y=_.length,C=D.length,c=e(_,D,y,C),c==1&&(p--,t(_,N<y?I:L,y,f))):(p==0&&(c=p=1),_=L.slice()),y=_.length,y<C&&_.unshift(0),t(D,_,C,f),c==-1&&(C=D.length,c=e(L,D,N,C),c<1&&(p++,t(D,N<C?I:L,C,f))),C=D.length):c===0&&(p++,D=[0]),w[d++]=p,c&&D[0]?D[C++]=z[M]||0:(D=[z[M]],C=1);while((M++<O||D[0]!==void 0)&&F--);x=D[0]!==void 0}w[0]||w.shift()}if(v==1)m.e=h,Ql=x;else{for(d=1,p=w[0];p>=10;p/=10)d++;m.e=d+h*v-1,Ce(m,u?i+m.e+1:i,a,x)}return m}}();function Ce(s,e,t,r){var n,i,a,u,f,c,h,d,p,v=s.constructor;e:if(e!=null){if(d=s.d,!d)return s;for(n=1,u=d[0];u>=10;u/=10)n++;if(i=e-n,i<0)i+=Be,a=e,h=d[p=0],f=h/qt(10,n-a-1)%10|0;else if(p=Math.ceil((i+1)/Be),u=d.length,p>=u)if(r){for(;u++<=p;)d.push(0);h=f=0,n=1,i%=Be,a=i-Be+1}else break e;else{for(h=u=d[p],n=1;u>=10;u/=10)n++;i%=Be,a=i-Be+n,f=a<0?0:h/qt(10,n-a-1)%10|0}if(r=r||e<0||d[p+1]!==void 0||(a<0?h:h%qt(10,n-a-1)),c=t<4?(f||r)&&(t==0||t==(s.s<0?3:2)):f>5||f==5&&(t==4||r||t==6&&(i>0?a>0?h/qt(10,n-a):0:d[p-1])%10&1||t==(s.s<0?8:7)),e<1||!d[0])return d.length=0,c?(e-=s.e+1,d[0]=qt(10,(Be-e%Be)%Be),s.e=-e||0):d[0]=s.e=0,s;if(i==0?(d.length=p,u=1,p--):(d.length=p+1,u=qt(10,Be-i),d[p]=a>0?(h/qt(10,n-a)%qt(10,a)|0)*u:0),c)for(;;)if(p==0){for(i=1,a=d[0];a>=10;a/=10)i++;for(a=d[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(s.e++,d[0]==Xr&&(d[0]=1));break}else{if(d[p]+=u,d[p]!=Xr)break;d[p--]=0,u=1}for(i=d.length;d[--i]===0;)d.pop()}return $e&&(s.e>v.maxE?(s.d=null,s.e=NaN):s.e<v.minE&&(s.e=0,s.d=[0])),s}function ln(s,e,t){if(!s.isFinite())return ac(s);var r,n=s.e,i=Vt(s.d),a=i.length;return e?(t&&(r=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+$n(r):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s.e<0?"e":"e+")+s.e):n<0?(i="0."+$n(-n-1)+i,t&&(r=t-a)>0&&(i+=$n(r))):n>=a?(i+=$n(n+1-a),t&&(r=t-n-1)>0&&(i=i+"."+$n(r))):((r=n+1)<a&&(i=i.slice(0,r)+"."+i.slice(r)),t&&(r=t-a)>0&&(n+1===a&&(i+="."),i+=$n(r))),i}function Js(s,e){var t=s[0];for(e*=Be;t>=10;t/=10)e++;return e}function eo(s,e,t){if(e>N_)throw $e=!0,t&&(s.precision=t),Error(Jl);return Ce(new s(Gs),e,1,!0)}function Qr(s,e,t){if(e>ka)throw Error(Jl);return Ce(new s(Ks),e,t,!0)}function nc(s){var e=s.length-1,t=e*Be+1;if(e=s[e],e){for(;e%10==0;e/=10)t--;for(e=s[0];e>=10;e/=10)t++}return t}function $n(s){for(var e="";s--;)e+="0";return e}function ic(s,e,t,r){var n,i=new s(1),a=Math.ceil(r/Be+4);for($e=!1;;){if(t%2&&(i=i.times(e),lc(i.d,a)&&(n=!0)),t=er(t/2),t===0){t=i.d.length-1,n&&i.d[t]===0&&++i.d[t];break}e=e.times(e),lc(e.d,a)}return $e=!0,i}function sc(s){return s.d[s.d.length-1]&1}function oc(s,e,t){for(var r,n=new s(e[0]),i=0;++i<e.length;)if(r=new s(e[i]),r.s)n[t](r)&&(n=r);else{n=r;break}return n}function za(s,e){var t,r,n,i,a,u,f,c=0,h=0,d=0,p=s.constructor,v=p.rounding,x=p.precision;if(!s.d||!s.d[0]||s.e>17)return new p(s.d?s.d[0]?s.s<0?0:1/0:1:s.s?s.s<0?0:s:NaN);for(e==null?($e=!1,f=x):f=e,u=new p(.03125);s.e>-2;)s=s.times(u),d+=5;for(r=Math.log(qt(2,d))/Math.LN10*2+5|0,f+=r,t=i=a=new p(1),p.precision=f;;){if(i=Ce(i.times(s),f,1),t=t.times(++h),u=a.plus(ft(i,t,f,1)),Vt(u.d).slice(0,f)===Vt(a.d).slice(0,f)){for(n=d;n--;)a=Ce(a.times(a),f,1);if(e==null)if(c<3&&os(a.d,f-r,v,c))p.precision=f+=10,t=i=u=new p(1),h=0,c++;else return Ce(a,p.precision=x,v,$e=!0);else return p.precision=x,a}a=u}}function Rn(s,e){var t,r,n,i,a,u,f,c,h,d,p,v=1,x=10,_=s,y=_.d,m=_.constructor,w=m.rounding,D=m.precision;if(_.s<0||!y||!y[0]||!_.e&&y[0]==1&&y.length==1)return new m(y&&!y[0]?-1/0:_.s!=1?NaN:y?0:_);if(e==null?($e=!1,h=D):h=e,m.precision=h+=x,t=Vt(y),r=t.charAt(0),Math.abs(i=_.e)<15e14){for(;r<7&&r!=1||r==1&&t.charAt(1)>3;)_=_.times(s),t=Vt(_.d),r=t.charAt(0),v++;i=_.e,r>1?(_=new m("0."+t),i++):_=new m(r+"."+t.slice(1))}else return c=eo(m,h+2,D).times(i+""),_=Rn(new m(r+"."+t.slice(1)),h-x).plus(c),m.precision=D,e==null?Ce(_,D,w,$e=!0):_;for(d=_,f=a=_=ft(_.minus(1),_.plus(1),h,1),p=Ce(_.times(_),h,1),n=3;;){if(a=Ce(a.times(p),h,1),c=f.plus(ft(a,new m(n),h,1)),Vt(c.d).slice(0,h)===Vt(f.d).slice(0,h))if(f=f.times(2),i!==0&&(f=f.plus(eo(m,h+2,D).times(i+""))),f=ft(f,new m(v),h,1),e==null)if(os(f.d,h-x,w,u))m.precision=h+=x,c=a=_=ft(d.minus(1),d.plus(1),h,1),p=Ce(_.times(_),h,1),n=u=1;else return Ce(f,m.precision=D,w,$e=!0);else return m.precision=D,f;f=c,n+=2}}function ac(s){return String(s.s*s.s/0)}function qa(s,e){var t,r,n;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(t<0&&(t=r),t+=+e.slice(r+1),e=e.substring(0,r)):t<0&&(t=e.length),r=0;e.charCodeAt(r)===48;r++);for(n=e.length;e.charCodeAt(n-1)===48;--n);if(e=e.slice(r,n),e){if(n-=r,s.e=t=t-r-1,s.d=[],r=(t+1)%Be,t<0&&(r+=Be),r<n){for(r&&s.d.push(+e.slice(0,r)),n-=Be;r<n;)s.d.push(+e.slice(r,r+=Be));e=e.slice(r),r=Be-e.length}else r-=n;for(;r--;)e+="0";s.d.push(+e),$e&&(s.e>s.constructor.maxE?(s.d=null,s.e=NaN):s.e<s.constructor.minE&&(s.e=0,s.d=[0]))}else s.e=0,s.d=[0];return s}function O_(s,e){var t,r,n,i,a,u,f,c,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),rc.test(e))return qa(s,e)}else if(e==="Infinity"||e==="NaN")return+e||(s.s=NaN),s.e=NaN,s.d=null,s;if(F_.test(e))t=16,e=e.toLowerCase();else if(C_.test(e))t=2;else if(B_.test(e))t=8;else throw Error(Tn+e);for(i=e.search(/p/i),i>0?(f=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,r=s.constructor,a&&(e=e.replace(".",""),u=e.length,i=u-i,n=ic(r,new r(t),i,i*2)),c=Qs(e,t,Xr),h=c.length-1,i=h;c[i]===0;--i)c.pop();return i<0?new r(s.s*0):(s.e=Js(c,h),s.d=c,$e=!1,a&&(s=ft(s,n,u*4)),f&&(s=s.times(Math.abs(f)<54?qt(2,f):Ai.pow(2,f))),$e=!0,s)}function I_(s,e){var t,r=e.d.length;if(r<3)return e.isZero()?e:Ei(s,2,e,e);t=1.4*Math.sqrt(r),t=t>16?16:t|0,e=e.times(1/to(5,t)),e=Ei(s,2,e,e);for(var n,i=new s(5),a=new s(16),u=new s(20);t--;)n=e.times(e),e=e.times(i.plus(n.times(a.times(n).minus(u))));return e}function Ei(s,e,t,r,n){var i,a,u,f,c=s.precision,h=Math.ceil(c/Be);for($e=!1,f=t.times(t),u=new s(r);;){if(a=ft(u.times(f),new s(e++*e++),c,1),u=n?r.plus(a):r.minus(a),r=ft(a.times(f),new s(e++*e++),c,1),a=u.plus(r),a.d[h]!==void 0){for(i=h;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=r,r=a,a=i}return $e=!0,a.d.length=h+1,a}function to(s,e){for(var t=s;--e;)t*=s;return t}function uc(s,e){var t,r=e.s<0,n=Qr(s,s.precision,1),i=n.times(.5);if(e=e.abs(),e.lte(i))return gn=r?4:1,e;if(t=e.divToInt(n),t.isZero())gn=r?3:2;else{if(e=e.minus(t.times(n)),e.lte(i))return gn=sc(t)?r?2:3:r?4:1,e;gn=sc(t)?r?1:4:r?3:2}return e.minus(n).abs()}function Ua(s,e,t,r){var n,i,a,u,f,c,h,d,p,v=s.constructor,x=t!==void 0;if(x?(vr(t,1,In),r===void 0?r=v.rounding:vr(r,0,8)):(t=v.precision,r=v.rounding),!s.isFinite())h=ac(s);else{for(h=ln(s),a=h.indexOf("."),x?(n=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):n=e,a>=0&&(h=h.replace(".",""),p=new v(1),p.e=h.length-a,p.d=Qs(ln(p),10,n),p.e=p.d.length),d=Qs(h,10,n),i=f=d.length;d[--f]==0;)d.pop();if(!d[0])h=x?"0p+0":"0";else{if(a<0?i--:(s=new v(s),s.d=d,s.e=i,s=ft(s,p,t,r,0,n),d=s.d,i=s.e,c=Ql),a=d[t],u=n/2,c=c||d[t+1]!==void 0,c=r<4?(a!==void 0||c)&&(r===0||r===(s.s<0?3:2)):a>u||a===u&&(r===4||c||r===6&&d[t-1]&1||r===(s.s<0?8:7)),d.length=t,c)for(;++d[--t]>n-1;)d[t]=0,t||(++i,d.unshift(1));for(f=d.length;!d[f-1];--f);for(a=0,h="";a<f;a++)h+=La.charAt(d[a]);if(x){if(f>1)if(e==16||e==8){for(a=e==16?4:3,--f;f%a;f++)h+="0";for(d=Qs(h,n,e),f=d.length;!d[f-1];--f);for(a=1,h="1.";a<f;a++)h+=La.charAt(d[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>f)for(i-=f;i--;)h+="0";else i<f&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return s.s<0?"-"+h:h}function lc(s,e){if(s.length>e)return s.length=e,!0}function T_(s){return new this(s).abs()}function $_(s){return new this(s).acos()}function R_(s){return new this(s).acosh()}function L_(s,e){return new this(s).plus(e)}function P_(s){return new this(s).asin()}function k_(s){return new this(s).asinh()}function z_(s){return new this(s).atan()}function q_(s){return new this(s).atanh()}function U_(s,e){s=new this(s),e=new this(e);var t,r=this.precision,n=this.rounding,i=r+4;return!s.s||!e.s?t=new this(NaN):!s.d&&!e.d?(t=Qr(this,i,1).times(e.s>0?.25:.75),t.s=s.s):!e.d||s.isZero()?(t=e.s<0?Qr(this,r,n):new this(0),t.s=s.s):!s.d||e.isZero()?(t=Qr(this,i,1).times(.5),t.s=s.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(ft(s,e,i,1)),e=Qr(this,i,1),this.precision=r,this.rounding=n,t=s.s<0?t.minus(e):t.plus(e)):t=this.atan(ft(s,e,i,1)),t}function W_(s){return new this(s).cbrt()}function H_(s){return Ce(s=new this(s),s.e+1,2)}function j_(s,e,t){return new this(s).clamp(e,t)}function Y_(s){if(!s||typeof s!="object")throw Error(Xs+"Object expected");var e,t,r,n=s.defaults===!0,i=["precision",1,In,"rounding",0,8,"toExpNeg",-bi,0,"toExpPos",0,bi,"maxE",0,bi,"minE",-bi,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],n&&(this[t]=Pa[t]),(r=s[t])!==void 0)if(er(r)===r&&r>=i[e+1]&&r<=i[e+2])this[t]=r;else throw Error(Tn+t+": "+r);if(t="crypto",n&&(this[t]=Pa[t]),(r=s[t])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(ec);else this[t]=!1;else throw Error(Tn+t+": "+r);return this}function Z_(s){return new this(s).cos()}function V_(s){return new this(s).cosh()}function cc(s){var e,t,r;function n(i){var a,u,f,c=this;if(!(c instanceof n))return new n(i);if(c.constructor=n,fc(i)){c.s=i.s,$e?!i.d||i.e>n.maxE?(c.e=NaN,c.d=null):i.e<n.minE?(c.e=0,c.d=[0]):(c.e=i.e,c.d=i.d.slice()):(c.e=i.e,c.d=i.d?i.d.slice():i.d);return}if(f=typeof i,f==="number"){if(i===0){c.s=1/i<0?-1:1,c.e=0,c.d=[0];return}if(i<0?(i=-i,c.s=-1):c.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;$e?a>n.maxE?(c.e=NaN,c.d=null):a<n.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[i]):(c.e=a,c.d=[i]);return}else if(i*0!==0){i||(c.s=NaN),c.e=NaN,c.d=null;return}return qa(c,i.toString())}else if(f!=="string")throw Error(Tn+i);return(u=i.charCodeAt(0))===45?(i=i.slice(1),c.s=-1):(u===43&&(i=i.slice(1)),c.s=1),rc.test(i)?qa(c,i):O_(c,i)}if(n.prototype=le,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=Y_,n.clone=cc,n.isDecimal=fc,n.abs=T_,n.acos=$_,n.acosh=R_,n.add=L_,n.asin=P_,n.asinh=k_,n.atan=z_,n.atanh=q_,n.atan2=U_,n.cbrt=W_,n.ceil=H_,n.clamp=j_,n.cos=Z_,n.cosh=V_,n.div=G_,n.exp=K_,n.floor=X_,n.hypot=Q_,n.ln=J_,n.log=ev,n.log10=rv,n.log2=tv,n.max=nv,n.min=iv,n.mod=sv,n.mul=ov,n.pow=av,n.random=uv,n.round=lv,n.sign=cv,n.sin=fv,n.sinh=hv,n.sqrt=dv,n.sub=pv,n.sum=_v,n.tan=vv,n.tanh=gv,n.trunc=mv,s===void 0&&(s={}),s&&s.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<r.length;)s.hasOwnProperty(t=r[e++])||(s[t]=this[t]);return n.config(s),n}function G_(s,e){return new this(s).div(e)}function K_(s){return new this(s).exp()}function X_(s){return Ce(s=new this(s),s.e+1,3)}function Q_(){var s,e,t=new this(0);for($e=!1,s=0;s<arguments.length;)if(e=new this(arguments[s++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return $e=!0,new this(1/0);t=e}return $e=!0,t.sqrt()}function fc(s){return s instanceof Ai||s&&s.toStringTag===tc||!1}function J_(s){return new this(s).ln()}function ev(s,e){return new this(s).log(e)}function tv(s){return new this(s).log(2)}function rv(s){return new this(s).log(10)}function nv(){return oc(this,arguments,"lt")}function iv(){return oc(this,arguments,"gt")}function sv(s,e){return new this(s).mod(e)}function ov(s,e){return new this(s).mul(e)}function av(s,e){return new this(s).pow(e)}function uv(s){var e,t,r,n,i=0,a=new this(1),u=[];if(s===void 0?s=this.precision:vr(s,1,In),r=Math.ceil(s/Be),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));i<r;)n=e[i],n>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=n%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(r*=4);i<r;)n=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),n>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(n%1e7),i+=4);i=r/4}else throw Error(ec);else for(;i<r;)u[i++]=Math.random()*1e7|0;for(r=u[--i],s%=Be,r&&s&&(n=qt(10,Be-s),u[i]=(r/n|0)*n);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Be)u.shift();for(r=1,n=u[0];n>=10;n/=10)r++;r<Be&&(t-=Be-r)}return a.e=t,a.d=u,a}function lv(s){return Ce(s=new this(s),s.e+1,this.rounding)}function cv(s){return s=new this(s),s.d?s.d[0]?s.s:0*s.s:s.s||NaN}function fv(s){return new this(s).sin()}function hv(s){return new this(s).sinh()}function dv(s){return new this(s).sqrt()}function pv(s,e){return new this(s).sub(e)}function _v(){var s=0,e=arguments,t=new this(e[s]);for($e=!1;t.s&&++s<e.length;)t=t.plus(e[s]);return $e=!0,Ce(t,this.precision,this.rounding)}function vv(s){return new this(s).tan()}function gv(s){return new this(s).tanh()}function mv(s){return Ce(s=new this(s),s.e+1,1)}le[Symbol.for("nodejs.util.inspect.custom")]=le.toString,le[Symbol.toStringTag]="Decimal";var Ai=le.constructor=cc(Pa);Gs=new Ai(Gs),Ks=new Ai(Ks);var xv="BigNumber",yv=["?on","config"],Dv=xe(xv,yv,s=>{var{on:e,config:t}=s,r=Ai.clone({precision:t.precision,modulo:Ai.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(n){return new r(n.value)},e&&e("config",function(n,i){n.precision!==i.precision&&r.config({precision:n.precision})}),r},{isClass:!0}),hc={exports:{}};/**
40
+ */var bi=9e15,In=1e9,Ra="0123456789abcdef",Gs="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ks="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pa={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-bi,maxE:bi,crypto:!1},Ql,gn,$e=!0,Xs="[DecimalError] ",Tn=Xs+"Invalid argument: ",Jl=Xs+"Precision limit exceeded",ef=Xs+"crypto unavailable",tf="[object Decimal]",er=Math.floor,qt=Math.pow,C_=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,F_=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,B_=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rf=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Xr=1e7,Be=7,M_=9007199254740991,N_=Gs.length-1,ka=Ks.length-1,le={toStringTag:tf};le.absoluteValue=le.abs=function(){var s=new this.constructor(this);return s.s<0&&(s.s=1),Ce(s)},le.ceil=function(){return Ce(new this.constructor(this),this.e+1,2)},le.clampedTo=le.clamp=function(s,e){var t,r=this,n=r.constructor;if(s=new n(s),e=new n(e),!s.s||!e.s)return new n(NaN);if(s.gt(e))throw Error(Tn+e);return t=r.cmp(s),t<0?s:r.cmp(e)>0?e:new n(r)},le.comparedTo=le.cmp=function(s){var e,t,r,n,i=this,a=i.d,u=(s=new i.constructor(s)).d,c=i.s,f=s.s;if(!a||!u)return!c||!f?NaN:c!==f?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-f:0;if(c!==f)return c;if(i.e!==s.e)return i.e>s.e^c<0?1:-1;for(r=a.length,n=u.length,e=0,t=r<n?r:n;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return r===n?0:r>n^c<0?1:-1},le.cosine=le.cos=function(){var s,e,t=this,r=t.constructor;return t.d?t.d[0]?(s=r.precision,e=r.rounding,r.precision=s+Math.max(t.e,t.sd())+Be,r.rounding=1,t=S_(r,lf(r,t)),r.precision=s,r.rounding=e,Ce(gn==2||gn==3?t.neg():t,s,e,!0)):new r(1):new r(NaN)},le.cubeRoot=le.cbrt=function(){var s,e,t,r,n,i,a,u,c,f,h=this,d=h.constructor;if(!h.isFinite()||h.isZero())return new d(h);for($e=!1,i=h.s*qt(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=Vt(h.d),s=h.e,(i=(s-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=qt(t,1/3),s=er((s+1)/3)-(s%3==(s<0?-1:2)),i==1/0?t="5e"+s:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+s),r=new d(t),r.s=h.s):r=new d(i.toString()),a=(s=d.precision)+3;;)if(u=r,c=u.times(u).times(u),f=c.plus(h),r=ct(f.plus(h).times(u),f.plus(c),a+2,1),Vt(u.d).slice(0,a)===(t=Vt(r.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!n&&t=="4999"){if(!n&&(Ce(u,s+1,0),u.times(u).times(u).eq(h))){r=u;break}a+=4,n=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Ce(r,s+1,1),e=!r.times(r).times(r).eq(h));break}return $e=!0,Ce(r,s,d.rounding,e)},le.decimalPlaces=le.dp=function(){var s,e=this.d,t=NaN;if(e){if(s=e.length-1,t=(s-er(this.e/Be))*Be,s=e[s],s)for(;s%10==0;s/=10)t--;t<0&&(t=0)}return t},le.dividedBy=le.div=function(s){return ct(this,new this.constructor(s))},le.dividedToIntegerBy=le.divToInt=function(s){var e=this,t=e.constructor;return Ce(ct(e,new t(s),0,1,1),t.precision,t.rounding)},le.equals=le.eq=function(s){return this.cmp(s)===0},le.floor=function(){return Ce(new this.constructor(this),this.e+1,3)},le.greaterThan=le.gt=function(s){return this.cmp(s)>0},le.greaterThanOrEqualTo=le.gte=function(s){var e=this.cmp(s);return e==1||e===0},le.hyperbolicCosine=le.cosh=function(){var s,e,t,r,n,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<32?(s=Math.ceil(n/3),e=(1/to(4,s)).toString()):(s=16,e="2.3283064365386962890625e-10"),i=Ei(a,1,i.times(e),new a(1),!0);for(var c,f=s,h=new a(8);f--;)c=i.times(i),i=u.minus(c.times(h.minus(c.times(h))));return Ce(i,a.precision=t,a.rounding=r,!0)},le.hyperbolicSine=le.sinh=function(){var s,e,t,r,n=this,i=n.constructor;if(!n.isFinite()||n.isZero())return new i(n);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+4,i.rounding=1,r=n.d.length,r<3)n=Ei(i,2,n,n,!0);else{s=1.4*Math.sqrt(r),s=s>16?16:s|0,n=n.times(1/to(5,s)),n=Ei(i,2,n,n,!0);for(var a,u=new i(5),c=new i(16),f=new i(20);s--;)a=n.times(n),n=n.times(u.plus(a.times(c.times(a).plus(f))))}return i.precision=e,i.rounding=t,Ce(n,e,t,!0)},le.hyperbolicTangent=le.tanh=function(){var s,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+7,r.rounding=1,ct(t.sinh(),t.cosh(),r.precision=s,r.rounding=e)):new r(t.s)},le.inverseCosine=le.acos=function(){var s,e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Qr(t,n,i):new t(0):new t(NaN):e.isZero()?Qr(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=e.asin(),s=Qr(t,n+4,i).times(.5),t.precision=n,t.rounding=i,s.minus(e))},le.inverseHyperbolicCosine=le.acosh=function(){var s,e,t=this,r=t.constructor;return t.lte(1)?new r(t.eq(1)?0:NaN):t.isFinite()?(s=r.precision,e=r.rounding,r.precision=s+Math.max(Math.abs(t.e),t.sd())+4,r.rounding=1,$e=!1,t=t.times(t).minus(1).sqrt().plus(t),$e=!0,r.precision=s,r.rounding=e,t.ln()):new r(t)},le.inverseHyperbolicSine=le.asinh=function(){var s,e,t=this,r=t.constructor;return!t.isFinite()||t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+2*Math.max(Math.abs(t.e),t.sd())+6,r.rounding=1,$e=!1,t=t.times(t).plus(1).sqrt().plus(t),$e=!0,r.precision=s,r.rounding=e,t.ln())},le.inverseHyperbolicTangent=le.atanh=function(){var s,e,t,r,n=this,i=n.constructor;return n.isFinite()?n.e>=0?new i(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(s=i.precision,e=i.rounding,r=n.sd(),Math.max(r,s)<2*-n.e-1?Ce(new i(n),s,e,!0):(i.precision=t=r-n.e,n=ct(n.plus(1),new i(1).minus(n),t+s,1),i.precision=s+4,i.rounding=1,n=n.ln(),i.precision=s,i.rounding=e,n.times(.5))):new i(NaN)},le.inverseSine=le.asin=function(){var s,e,t,r,n=this,i=n.constructor;return n.isZero()?new i(n):(e=n.abs().cmp(1),t=i.precision,r=i.rounding,e!==-1?e===0?(s=Qr(i,t+4,r).times(.5),s.s=n.s,s):new i(NaN):(i.precision=t+6,i.rounding=1,n=n.div(new i(1).minus(n.times(n)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=r,n.times(2)))},le.inverseTangent=le.atan=function(){var s,e,t,r,n,i,a,u,c,f=this,h=f.constructor,d=h.precision,p=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&d+4<=ka)return a=Qr(h,d+4,p).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(d+4<=ka)return a=Qr(h,d+4,p).times(.5),a.s=f.s,a}for(h.precision=u=d+10,h.rounding=1,t=Math.min(28,u/Be+2|0),s=t;s;--s)f=f.div(f.times(f).plus(1).sqrt().plus(1));for($e=!1,e=Math.ceil(u/Be),r=1,c=f.times(f),a=new h(f),n=f;s!==-1;)if(n=n.times(c),i=a.minus(n.div(r+=2)),n=n.times(c),a=i.plus(n.div(r+=2)),a.d[e]!==void 0)for(s=e;a.d[s]===i.d[s]&&s--;);return t&&(a=a.times(2<<t-1)),$e=!0,Ce(a,h.precision=d,h.rounding=p,!0)},le.isFinite=function(){return!!this.d},le.isInteger=le.isInt=function(){return!!this.d&&er(this.e/Be)>this.d.length-2},le.isNaN=function(){return!this.s},le.isNegative=le.isNeg=function(){return this.s<0},le.isPositive=le.isPos=function(){return this.s>0},le.isZero=function(){return!!this.d&&this.d[0]===0},le.lessThan=le.lt=function(s){return this.cmp(s)<0},le.lessThanOrEqualTo=le.lte=function(s){return this.cmp(s)<1},le.logarithm=le.log=function(s){var e,t,r,n,i,a,u,c,f=this,h=f.constructor,d=h.precision,p=h.rounding,v=5;if(s==null)s=new h(10),e=!0;else{if(s=new h(s),t=s.d,s.s<0||!t||!t[0]||s.eq(1))return new h(NaN);e=s.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new h(t&&!t[0]?-1/0:f.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(n=t[0];n%10===0;)n/=10;i=n!==1}if($e=!1,u=d+v,a=Ln(f,u),r=e?eo(h,u+10):Ln(s,u),c=ct(a,r,u,1),os(c.d,n=d,p))do if(u+=10,a=Ln(f,u),r=e?eo(h,u+10):Ln(s,u),c=ct(a,r,u,1),!i){+Vt(c.d).slice(n+1,n+15)+1==1e14&&(c=Ce(c,d+1,0));break}while(os(c.d,n+=10,p));return $e=!0,Ce(c,d,p)},le.minus=le.sub=function(s){var e,t,r,n,i,a,u,c,f,h,d,p,v=this,x=v.constructor;if(s=new x(s),!v.d||!s.d)return!v.s||!s.s?s=new x(NaN):v.d?s.s=-s.s:s=new x(s.d||v.s!==s.s?v:NaN),s;if(v.s!=s.s)return s.s=-s.s,v.plus(s);if(f=v.d,p=s.d,u=x.precision,c=x.rounding,!f[0]||!p[0]){if(p[0])s.s=-s.s;else if(f[0])s=new x(v);else return new x(c===3?-0:0);return $e?Ce(s,u,c):s}if(t=er(s.e/Be),h=er(v.e/Be),f=f.slice(),i=h-t,i){for(d=i<0,d?(e=f,i=-i,a=p.length):(e=p,t=h,a=f.length),r=Math.max(Math.ceil(u/Be),a)+2,i>r&&(i=r,e.length=1),e.reverse(),r=i;r--;)e.push(0);e.reverse()}else{for(r=f.length,a=p.length,d=r<a,d&&(a=r),r=0;r<a;r++)if(f[r]!=p[r]){d=f[r]<p[r];break}i=0}for(d&&(e=f,f=p,p=e,s.s=-s.s),a=f.length,r=p.length-a;r>0;--r)f[a++]=0;for(r=p.length;r>i;){if(f[--r]<p[r]){for(n=r;n&&f[--n]===0;)f[n]=Xr-1;--f[n],f[r]+=Xr}f[r]-=p[r]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(s.d=f,s.e=Js(f,t),$e?Ce(s,u,c):s):new x(c===3?-0:0)},le.modulo=le.mod=function(s){var e,t=this,r=t.constructor;return s=new r(s),!t.d||!s.s||s.d&&!s.d[0]?new r(NaN):!s.d||t.d&&!t.d[0]?Ce(new r(t),r.precision,r.rounding):($e=!1,r.modulo==9?(e=ct(t,s.abs(),0,3,1),e.s*=s.s):e=ct(t,s,0,r.modulo,1),e=e.times(s),$e=!0,t.minus(e))},le.naturalExponential=le.exp=function(){return za(this)},le.naturalLogarithm=le.ln=function(){return Ln(this)},le.negated=le.neg=function(){var s=new this.constructor(this);return s.s=-s.s,Ce(s)},le.plus=le.add=function(s){var e,t,r,n,i,a,u,c,f,h,d=this,p=d.constructor;if(s=new p(s),!d.d||!s.d)return!d.s||!s.s?s=new p(NaN):d.d||(s=new p(s.d||d.s===s.s?d:NaN)),s;if(d.s!=s.s)return s.s=-s.s,d.minus(s);if(f=d.d,h=s.d,u=p.precision,c=p.rounding,!f[0]||!h[0])return h[0]||(s=new p(d)),$e?Ce(s,u,c):s;if(i=er(d.e/Be),r=er(s.e/Be),f=f.slice(),n=i-r,n){for(n<0?(t=f,n=-n,a=h.length):(t=h,r=i,a=f.length),i=Math.ceil(u/Be),a=i>a?i+1:a+1,n>a&&(n=a,t.length=1),t.reverse();n--;)t.push(0);t.reverse()}for(a=f.length,n=h.length,a-n<0&&(n=a,t=h,h=f,f=t),e=0;n;)e=(f[--n]=f[n]+h[n]+e)/Xr|0,f[n]%=Xr;for(e&&(f.unshift(e),++r),a=f.length;f[--a]==0;)f.pop();return s.d=f,s.e=Js(f,r),$e?Ce(s,u,c):s},le.precision=le.sd=function(s){var e,t=this;if(s!==void 0&&s!==!!s&&s!==1&&s!==0)throw Error(Tn+s);return t.d?(e=nf(t.d),s&&t.e+1>e&&(e=t.e+1)):e=NaN,e},le.round=function(){var s=this,e=s.constructor;return Ce(new e(s),s.e+1,e.rounding)},le.sine=le.sin=function(){var s,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+Math.max(t.e,t.sd())+Be,r.rounding=1,t=I_(r,lf(r,t)),r.precision=s,r.rounding=e,Ce(gn>2?t.neg():t,s,e,!0)):new r(NaN)},le.squareRoot=le.sqrt=function(){var s,e,t,r,n,i,a=this,u=a.d,c=a.e,f=a.s,h=a.constructor;if(f!==1||!u||!u[0])return new h(!f||f<0&&(!u||u[0])?NaN:u?a:1/0);for($e=!1,f=Math.sqrt(+a),f==0||f==1/0?(e=Vt(u),(e.length+c)%2==0&&(e+="0"),f=Math.sqrt(e),c=er((c+1)/2)-(c<0||c%2),f==1/0?e="5e"+c:(e=f.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),r=new h(e)):r=new h(f.toString()),t=(c=h.precision)+3;;)if(i=r,r=i.plus(ct(a,i,t+2,1)).times(.5),Vt(i.d).slice(0,t)===(e=Vt(r.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!n&&e=="4999"){if(!n&&(Ce(i,c+1,0),i.times(i).eq(a))){r=i;break}t+=4,n=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ce(r,c+1,1),s=!r.times(r).eq(a));break}return $e=!0,Ce(r,c,h.rounding,s)},le.tangent=le.tan=function(){var s,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(s=r.precision,e=r.rounding,r.precision=s+10,r.rounding=1,t=t.sin(),t.s=1,t=ct(t,new r(1).minus(t.times(t)).sqrt(),s+10,0),r.precision=s,r.rounding=e,Ce(gn==2||gn==4?t.neg():t,s,e,!0)):new r(NaN)},le.times=le.mul=function(s){var e,t,r,n,i,a,u,c,f,h=this,d=h.constructor,p=h.d,v=(s=new d(s)).d;if(s.s*=h.s,!p||!p[0]||!v||!v[0])return new d(!s.s||p&&!p[0]&&!v||v&&!v[0]&&!p?NaN:!p||!v?s.s/0:s.s*0);for(t=er(h.e/Be)+er(s.e/Be),c=p.length,f=v.length,c<f&&(i=p,p=v,v=i,a=c,c=f,f=a),i=[],a=c+f,r=a;r--;)i.push(0);for(r=f;--r>=0;){for(e=0,n=c+r;n>r;)u=i[n]+v[r]*p[n-r-1]+e,i[n--]=u%Xr|0,e=u/Xr|0;i[n]=(i[n]+e)%Xr|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),s.d=i,s.e=Js(i,t),$e?Ce(s,d.precision,d.rounding):s},le.toBinary=function(s,e){return Ua(this,2,s,e)},le.toDecimalPlaces=le.toDP=function(s,e){var t=this,r=t.constructor;return t=new r(t),s===void 0?t:(vr(s,0,In),e===void 0?e=r.rounding:vr(e,0,8),Ce(t,s+t.e+1,e))},le.toExponential=function(s,e){var t,r=this,n=r.constructor;return s===void 0?t=ln(r,!0):(vr(s,0,In),e===void 0?e=n.rounding:vr(e,0,8),r=Ce(new n(r),s+1,e),t=ln(r,!0,s+1)),r.isNeg()&&!r.isZero()?"-"+t:t},le.toFixed=function(s,e){var t,r,n=this,i=n.constructor;return s===void 0?t=ln(n):(vr(s,0,In),e===void 0?e=i.rounding:vr(e,0,8),r=Ce(new i(n),s+n.e+1,e),t=ln(r,!1,s+r.e+1)),n.isNeg()&&!n.isZero()?"-"+t:t},le.toFraction=function(s){var e,t,r,n,i,a,u,c,f,h,d,p,v=this,x=v.d,_=v.constructor;if(!x)return new _(v);if(f=t=new _(1),r=c=new _(0),e=new _(r),i=e.e=nf(x)-v.e-1,a=i%Be,e.d[0]=qt(10,a<0?Be+a:a),s==null)s=i>0?e:f;else{if(u=new _(s),!u.isInt()||u.lt(f))throw Error(Tn+u);s=u.gt(e)?i>0?e:f:u}for($e=!1,u=new _(Vt(x)),h=_.precision,_.precision=i=x.length*Be*2;d=ct(u,e,0,1,1),n=t.plus(d.times(r)),n.cmp(s)!=1;)t=r,r=n,n=f,f=c.plus(d.times(n)),c=n,n=e,e=u.minus(d.times(n)),u=n;return n=ct(s.minus(t),r,0,1,1),c=c.plus(n.times(f)),t=t.plus(n.times(r)),c.s=f.s=v.s,p=ct(f,r,i,1).minus(v).abs().cmp(ct(c,t,i,1).minus(v).abs())<1?[f,r]:[c,t],_.precision=h,$e=!0,p},le.toHexadecimal=le.toHex=function(s,e){return Ua(this,16,s,e)},le.toNearest=function(s,e){var t=this,r=t.constructor;if(t=new r(t),s==null){if(!t.d)return t;s=new r(1),e=r.rounding}else{if(s=new r(s),e===void 0?e=r.rounding:vr(e,0,8),!t.d)return s.s?t:s;if(!s.d)return s.s&&(s.s=t.s),s}return s.d[0]?($e=!1,t=ct(t,s,0,e,1).times(s),$e=!0,Ce(t)):(s.s=t.s,t=s),t},le.toNumber=function(){return+this},le.toOctal=function(s,e){return Ua(this,8,s,e)},le.toPower=le.pow=function(s){var e,t,r,n,i,a,u=this,c=u.constructor,f=+(s=new c(s));if(!u.d||!s.d||!u.d[0]||!s.d[0])return new c(qt(+u,f));if(u=new c(u),u.eq(1))return u;if(r=c.precision,i=c.rounding,s.eq(1))return Ce(u,r,i);if(e=er(s.e/Be),e>=s.d.length-1&&(t=f<0?-f:f)<=M_)return n=sf(c,u,t,r),s.s<0?new c(1).div(n):Ce(n,r,i);if(a=u.s,a<0){if(e<s.d.length-1)return new c(NaN);if(s.d[e]&1||(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=qt(+u,f),e=t==0||!isFinite(t)?er(f*(Math.log("0."+Vt(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):($e=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),n=za(s.times(Ln(u,r+t)),r),n.d&&(n=Ce(n,r+5,1),os(n.d,r,i)&&(e=r+10,n=Ce(za(s.times(Ln(u,e+t)),e),e+5,1),+Vt(n.d).slice(r+1,r+15)+1==1e14&&(n=Ce(n,r+1,0)))),n.s=a,$e=!0,c.rounding=i,Ce(n,r,i))},le.toPrecision=function(s,e){var t,r=this,n=r.constructor;return s===void 0?t=ln(r,r.e<=n.toExpNeg||r.e>=n.toExpPos):(vr(s,1,In),e===void 0?e=n.rounding:vr(e,0,8),r=Ce(new n(r),s,e),t=ln(r,s<=r.e||r.e<=n.toExpNeg,s)),r.isNeg()&&!r.isZero()?"-"+t:t},le.toSignificantDigits=le.toSD=function(s,e){var t=this,r=t.constructor;return s===void 0?(s=r.precision,e=r.rounding):(vr(s,1,In),e===void 0?e=r.rounding:vr(e,0,8)),Ce(new r(t),s,e)},le.toString=function(){var s=this,e=s.constructor,t=ln(s,s.e<=e.toExpNeg||s.e>=e.toExpPos);return s.isNeg()&&!s.isZero()?"-"+t:t},le.truncated=le.trunc=function(){return Ce(new this.constructor(this),this.e+1,1)},le.valueOf=le.toJSON=function(){var s=this,e=s.constructor,t=ln(s,s.e<=e.toExpNeg||s.e>=e.toExpPos);return s.isNeg()?"-"+t:t};function Vt(s){var e,t,r,n=s.length-1,i="",a=s[0];if(n>0){for(i+=a,e=1;e<n;e++)r=s[e]+"",t=Be-r.length,t&&(i+=$n(t)),i+=r;a=s[e],r=a+"",t=Be-r.length,t&&(i+=$n(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}function vr(s,e,t){if(s!==~~s||s<e||s>t)throw Error(Tn+s)}function os(s,e,t,r){var n,i,a,u;for(i=s[0];i>=10;i/=10)--e;return--e<0?(e+=Be,n=0):(n=Math.ceil((e+1)/Be),e%=Be),i=qt(10,Be-e),u=s[n]%i|0,r==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(s[n+1]/i/100|0)==qt(10,e-2)-1||(u==i/2||u==0)&&(s[n+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(r||t<4)&&u==9999||!r&&t>3&&u==4999):a=((r||t<4)&&u+1==i||!r&&t>3&&u+1==i/2)&&(s[n+1]/i/1e3|0)==qt(10,e-3)-1,a}function Qs(s,e,t){for(var r,n=[0],i,a=0,u=s.length;a<u;){for(i=n.length;i--;)n[i]*=e;for(n[0]+=Ra.indexOf(s.charAt(a++)),r=0;r<n.length;r++)n[r]>t-1&&(n[r+1]===void 0&&(n[r+1]=0),n[r+1]+=n[r]/t|0,n[r]%=t)}return n.reverse()}function S_(s,e){var t,r,n;if(e.isZero())return e;r=e.d.length,r<32?(t=Math.ceil(r/3),n=(1/to(4,t)).toString()):(t=16,n="2.3283064365386962890625e-10"),s.precision+=t,e=Ei(s,1,e.times(n),new s(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return s.precision-=t,e}var ct=function(){function s(r,n,i){var a,u=0,c=r.length;for(r=r.slice();c--;)a=r[c]*n+u,r[c]=a%i|0,u=a/i|0;return u&&r.unshift(u),r}function e(r,n,i,a){var u,c;if(i!=a)c=i>a?1:-1;else for(u=c=0;u<i;u++)if(r[u]!=n[u]){c=r[u]>n[u]?1:-1;break}return c}function t(r,n,i,a){for(var u=0;i--;)r[i]-=u,u=r[i]<n[i]?1:0,r[i]=u*a+r[i]-n[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,n,i,a,u,c){var f,h,d,p,v,x,_,y,m,w,D,C,b,F,B,M,O,A,N,I,L=r.constructor,k=r.s==n.s?1:-1,z=r.d,R=n.d;if(!z||!z[0]||!R||!R[0])return new L(!r.s||!n.s||(z?R&&z[0]==R[0]:!R)?NaN:z&&z[0]==0||!R?k*0:k/0);for(c?(v=1,h=r.e-n.e):(c=Xr,v=Be,h=er(r.e/v)-er(n.e/v)),N=R.length,O=z.length,m=new L(k),w=m.d=[],d=0;R[d]==(z[d]||0);d++);if(R[d]>(z[d]||0)&&h--,i==null?(F=i=L.precision,a=L.rounding):u?F=i+(r.e-n.e)+1:F=i,F<0)w.push(1),x=!0;else{if(F=F/v+2|0,d=0,N==1){for(p=0,R=R[0],F++;(d<O||p)&&F--;d++)B=p*c+(z[d]||0),w[d]=B/R|0,p=B%R|0;x=p||d<O}else{for(p=c/(R[0]+1)|0,p>1&&(R=s(R,p,c),z=s(z,p,c),N=R.length,O=z.length),M=N,D=z.slice(0,N),C=D.length;C<N;)D[C++]=0;I=R.slice(),I.unshift(0),A=R[0],R[1]>=c/2&&++A;do p=0,f=e(R,D,N,C),f<0?(b=D[0],N!=C&&(b=b*c+(D[1]||0)),p=b/A|0,p>1?(p>=c&&(p=c-1),_=s(R,p,c),y=_.length,C=D.length,f=e(_,D,y,C),f==1&&(p--,t(_,N<y?I:R,y,c))):(p==0&&(f=p=1),_=R.slice()),y=_.length,y<C&&_.unshift(0),t(D,_,C,c),f==-1&&(C=D.length,f=e(R,D,N,C),f<1&&(p++,t(D,N<C?I:R,C,c))),C=D.length):f===0&&(p++,D=[0]),w[d++]=p,f&&D[0]?D[C++]=z[M]||0:(D=[z[M]],C=1);while((M++<O||D[0]!==void 0)&&F--);x=D[0]!==void 0}w[0]||w.shift()}if(v==1)m.e=h,Ql=x;else{for(d=1,p=w[0];p>=10;p/=10)d++;m.e=d+h*v-1,Ce(m,u?i+m.e+1:i,a,x)}return m}}();function Ce(s,e,t,r){var n,i,a,u,c,f,h,d,p,v=s.constructor;e:if(e!=null){if(d=s.d,!d)return s;for(n=1,u=d[0];u>=10;u/=10)n++;if(i=e-n,i<0)i+=Be,a=e,h=d[p=0],c=h/qt(10,n-a-1)%10|0;else if(p=Math.ceil((i+1)/Be),u=d.length,p>=u)if(r){for(;u++<=p;)d.push(0);h=c=0,n=1,i%=Be,a=i-Be+1}else break e;else{for(h=u=d[p],n=1;u>=10;u/=10)n++;i%=Be,a=i-Be+n,c=a<0?0:h/qt(10,n-a-1)%10|0}if(r=r||e<0||d[p+1]!==void 0||(a<0?h:h%qt(10,n-a-1)),f=t<4?(c||r)&&(t==0||t==(s.s<0?3:2)):c>5||c==5&&(t==4||r||t==6&&(i>0?a>0?h/qt(10,n-a):0:d[p-1])%10&1||t==(s.s<0?8:7)),e<1||!d[0])return d.length=0,f?(e-=s.e+1,d[0]=qt(10,(Be-e%Be)%Be),s.e=-e||0):d[0]=s.e=0,s;if(i==0?(d.length=p,u=1,p--):(d.length=p+1,u=qt(10,Be-i),d[p]=a>0?(h/qt(10,n-a)%qt(10,a)|0)*u:0),f)for(;;)if(p==0){for(i=1,a=d[0];a>=10;a/=10)i++;for(a=d[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(s.e++,d[0]==Xr&&(d[0]=1));break}else{if(d[p]+=u,d[p]!=Xr)break;d[p--]=0,u=1}for(i=d.length;d[--i]===0;)d.pop()}return $e&&(s.e>v.maxE?(s.d=null,s.e=NaN):s.e<v.minE&&(s.e=0,s.d=[0])),s}function ln(s,e,t){if(!s.isFinite())return uf(s);var r,n=s.e,i=Vt(s.d),a=i.length;return e?(t&&(r=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+$n(r):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s.e<0?"e":"e+")+s.e):n<0?(i="0."+$n(-n-1)+i,t&&(r=t-a)>0&&(i+=$n(r))):n>=a?(i+=$n(n+1-a),t&&(r=t-n-1)>0&&(i=i+"."+$n(r))):((r=n+1)<a&&(i=i.slice(0,r)+"."+i.slice(r)),t&&(r=t-a)>0&&(n+1===a&&(i+="."),i+=$n(r))),i}function Js(s,e){var t=s[0];for(e*=Be;t>=10;t/=10)e++;return e}function eo(s,e,t){if(e>N_)throw $e=!0,t&&(s.precision=t),Error(Jl);return Ce(new s(Gs),e,1,!0)}function Qr(s,e,t){if(e>ka)throw Error(Jl);return Ce(new s(Ks),e,t,!0)}function nf(s){var e=s.length-1,t=e*Be+1;if(e=s[e],e){for(;e%10==0;e/=10)t--;for(e=s[0];e>=10;e/=10)t++}return t}function $n(s){for(var e="";s--;)e+="0";return e}function sf(s,e,t,r){var n,i=new s(1),a=Math.ceil(r/Be+4);for($e=!1;;){if(t%2&&(i=i.times(e),ff(i.d,a)&&(n=!0)),t=er(t/2),t===0){t=i.d.length-1,n&&i.d[t]===0&&++i.d[t];break}e=e.times(e),ff(e.d,a)}return $e=!0,i}function of(s){return s.d[s.d.length-1]&1}function af(s,e,t){for(var r,n=new s(e[0]),i=0;++i<e.length;)if(r=new s(e[i]),r.s)n[t](r)&&(n=r);else{n=r;break}return n}function za(s,e){var t,r,n,i,a,u,c,f=0,h=0,d=0,p=s.constructor,v=p.rounding,x=p.precision;if(!s.d||!s.d[0]||s.e>17)return new p(s.d?s.d[0]?s.s<0?0:1/0:1:s.s?s.s<0?0:s:NaN);for(e==null?($e=!1,c=x):c=e,u=new p(.03125);s.e>-2;)s=s.times(u),d+=5;for(r=Math.log(qt(2,d))/Math.LN10*2+5|0,c+=r,t=i=a=new p(1),p.precision=c;;){if(i=Ce(i.times(s),c,1),t=t.times(++h),u=a.plus(ct(i,t,c,1)),Vt(u.d).slice(0,c)===Vt(a.d).slice(0,c)){for(n=d;n--;)a=Ce(a.times(a),c,1);if(e==null)if(f<3&&os(a.d,c-r,v,f))p.precision=c+=10,t=i=u=new p(1),h=0,f++;else return Ce(a,p.precision=x,v,$e=!0);else return p.precision=x,a}a=u}}function Ln(s,e){var t,r,n,i,a,u,c,f,h,d,p,v=1,x=10,_=s,y=_.d,m=_.constructor,w=m.rounding,D=m.precision;if(_.s<0||!y||!y[0]||!_.e&&y[0]==1&&y.length==1)return new m(y&&!y[0]?-1/0:_.s!=1?NaN:y?0:_);if(e==null?($e=!1,h=D):h=e,m.precision=h+=x,t=Vt(y),r=t.charAt(0),Math.abs(i=_.e)<15e14){for(;r<7&&r!=1||r==1&&t.charAt(1)>3;)_=_.times(s),t=Vt(_.d),r=t.charAt(0),v++;i=_.e,r>1?(_=new m("0."+t),i++):_=new m(r+"."+t.slice(1))}else return f=eo(m,h+2,D).times(i+""),_=Ln(new m(r+"."+t.slice(1)),h-x).plus(f),m.precision=D,e==null?Ce(_,D,w,$e=!0):_;for(d=_,c=a=_=ct(_.minus(1),_.plus(1),h,1),p=Ce(_.times(_),h,1),n=3;;){if(a=Ce(a.times(p),h,1),f=c.plus(ct(a,new m(n),h,1)),Vt(f.d).slice(0,h)===Vt(c.d).slice(0,h))if(c=c.times(2),i!==0&&(c=c.plus(eo(m,h+2,D).times(i+""))),c=ct(c,new m(v),h,1),e==null)if(os(c.d,h-x,w,u))m.precision=h+=x,f=a=_=ct(d.minus(1),d.plus(1),h,1),p=Ce(_.times(_),h,1),n=u=1;else return Ce(c,m.precision=D,w,$e=!0);else return m.precision=D,c;c=f,n+=2}}function uf(s){return String(s.s*s.s/0)}function qa(s,e){var t,r,n;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(t<0&&(t=r),t+=+e.slice(r+1),e=e.substring(0,r)):t<0&&(t=e.length),r=0;e.charCodeAt(r)===48;r++);for(n=e.length;e.charCodeAt(n-1)===48;--n);if(e=e.slice(r,n),e){if(n-=r,s.e=t=t-r-1,s.d=[],r=(t+1)%Be,t<0&&(r+=Be),r<n){for(r&&s.d.push(+e.slice(0,r)),n-=Be;r<n;)s.d.push(+e.slice(r,r+=Be));e=e.slice(r),r=Be-e.length}else r-=n;for(;r--;)e+="0";s.d.push(+e),$e&&(s.e>s.constructor.maxE?(s.d=null,s.e=NaN):s.e<s.constructor.minE&&(s.e=0,s.d=[0]))}else s.e=0,s.d=[0];return s}function O_(s,e){var t,r,n,i,a,u,c,f,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),rf.test(e))return qa(s,e)}else if(e==="Infinity"||e==="NaN")return+e||(s.s=NaN),s.e=NaN,s.d=null,s;if(F_.test(e))t=16,e=e.toLowerCase();else if(C_.test(e))t=2;else if(B_.test(e))t=8;else throw Error(Tn+e);for(i=e.search(/p/i),i>0?(c=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,r=s.constructor,a&&(e=e.replace(".",""),u=e.length,i=u-i,n=sf(r,new r(t),i,i*2)),f=Qs(e,t,Xr),h=f.length-1,i=h;f[i]===0;--i)f.pop();return i<0?new r(s.s*0):(s.e=Js(f,h),s.d=f,$e=!1,a&&(s=ct(s,n,u*4)),c&&(s=s.times(Math.abs(c)<54?qt(2,c):Ai.pow(2,c))),$e=!0,s)}function I_(s,e){var t,r=e.d.length;if(r<3)return e.isZero()?e:Ei(s,2,e,e);t=1.4*Math.sqrt(r),t=t>16?16:t|0,e=e.times(1/to(5,t)),e=Ei(s,2,e,e);for(var n,i=new s(5),a=new s(16),u=new s(20);t--;)n=e.times(e),e=e.times(i.plus(n.times(a.times(n).minus(u))));return e}function Ei(s,e,t,r,n){var i,a,u,c,f=s.precision,h=Math.ceil(f/Be);for($e=!1,c=t.times(t),u=new s(r);;){if(a=ct(u.times(c),new s(e++*e++),f,1),u=n?r.plus(a):r.minus(a),r=ct(a.times(c),new s(e++*e++),f,1),a=u.plus(r),a.d[h]!==void 0){for(i=h;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=r,r=a,a=i}return $e=!0,a.d.length=h+1,a}function to(s,e){for(var t=s;--e;)t*=s;return t}function lf(s,e){var t,r=e.s<0,n=Qr(s,s.precision,1),i=n.times(.5);if(e=e.abs(),e.lte(i))return gn=r?4:1,e;if(t=e.divToInt(n),t.isZero())gn=r?3:2;else{if(e=e.minus(t.times(n)),e.lte(i))return gn=of(t)?r?2:3:r?4:1,e;gn=of(t)?r?1:4:r?3:2}return e.minus(n).abs()}function Ua(s,e,t,r){var n,i,a,u,c,f,h,d,p,v=s.constructor,x=t!==void 0;if(x?(vr(t,1,In),r===void 0?r=v.rounding:vr(r,0,8)):(t=v.precision,r=v.rounding),!s.isFinite())h=uf(s);else{for(h=ln(s),a=h.indexOf("."),x?(n=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):n=e,a>=0&&(h=h.replace(".",""),p=new v(1),p.e=h.length-a,p.d=Qs(ln(p),10,n),p.e=p.d.length),d=Qs(h,10,n),i=c=d.length;d[--c]==0;)d.pop();if(!d[0])h=x?"0p+0":"0";else{if(a<0?i--:(s=new v(s),s.d=d,s.e=i,s=ct(s,p,t,r,0,n),d=s.d,i=s.e,f=Ql),a=d[t],u=n/2,f=f||d[t+1]!==void 0,f=r<4?(a!==void 0||f)&&(r===0||r===(s.s<0?3:2)):a>u||a===u&&(r===4||f||r===6&&d[t-1]&1||r===(s.s<0?8:7)),d.length=t,f)for(;++d[--t]>n-1;)d[t]=0,t||(++i,d.unshift(1));for(c=d.length;!d[c-1];--c);for(a=0,h="";a<c;a++)h+=Ra.charAt(d[a]);if(x){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)h+="0";for(d=Qs(h,n,e),c=d.length;!d[c-1];--c);for(a=1,h="1.";a<c;a++)h+=Ra.charAt(d[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>c)for(i-=c;i--;)h+="0";else i<c&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return s.s<0?"-"+h:h}function ff(s,e){if(s.length>e)return s.length=e,!0}function T_(s){return new this(s).abs()}function $_(s){return new this(s).acos()}function L_(s){return new this(s).acosh()}function R_(s,e){return new this(s).plus(e)}function P_(s){return new this(s).asin()}function k_(s){return new this(s).asinh()}function z_(s){return new this(s).atan()}function q_(s){return new this(s).atanh()}function U_(s,e){s=new this(s),e=new this(e);var t,r=this.precision,n=this.rounding,i=r+4;return!s.s||!e.s?t=new this(NaN):!s.d&&!e.d?(t=Qr(this,i,1).times(e.s>0?.25:.75),t.s=s.s):!e.d||s.isZero()?(t=e.s<0?Qr(this,r,n):new this(0),t.s=s.s):!s.d||e.isZero()?(t=Qr(this,i,1).times(.5),t.s=s.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(ct(s,e,i,1)),e=Qr(this,i,1),this.precision=r,this.rounding=n,t=s.s<0?t.minus(e):t.plus(e)):t=this.atan(ct(s,e,i,1)),t}function W_(s){return new this(s).cbrt()}function H_(s){return Ce(s=new this(s),s.e+1,2)}function j_(s,e,t){return new this(s).clamp(e,t)}function Y_(s){if(!s||typeof s!="object")throw Error(Xs+"Object expected");var e,t,r,n=s.defaults===!0,i=["precision",1,In,"rounding",0,8,"toExpNeg",-bi,0,"toExpPos",0,bi,"maxE",0,bi,"minE",-bi,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],n&&(this[t]=Pa[t]),(r=s[t])!==void 0)if(er(r)===r&&r>=i[e+1]&&r<=i[e+2])this[t]=r;else throw Error(Tn+t+": "+r);if(t="crypto",n&&(this[t]=Pa[t]),(r=s[t])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(ef);else this[t]=!1;else throw Error(Tn+t+": "+r);return this}function Z_(s){return new this(s).cos()}function V_(s){return new this(s).cosh()}function cf(s){var e,t,r;function n(i){var a,u,c,f=this;if(!(f instanceof n))return new n(i);if(f.constructor=n,hf(i)){f.s=i.s,$e?!i.d||i.e>n.maxE?(f.e=NaN,f.d=null):i.e<n.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(c=typeof i,c==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;$e?a>n.maxE?(f.e=NaN,f.d=null):a<n.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[i]):(f.e=a,f.d=[i]);return}else if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return qa(f,i.toString())}else if(c!=="string")throw Error(Tn+i);return(u=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(u===43&&(i=i.slice(1)),f.s=1),rf.test(i)?qa(f,i):O_(f,i)}if(n.prototype=le,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=Y_,n.clone=cf,n.isDecimal=hf,n.abs=T_,n.acos=$_,n.acosh=L_,n.add=R_,n.asin=P_,n.asinh=k_,n.atan=z_,n.atanh=q_,n.atan2=U_,n.cbrt=W_,n.ceil=H_,n.clamp=j_,n.cos=Z_,n.cosh=V_,n.div=G_,n.exp=K_,n.floor=X_,n.hypot=Q_,n.ln=J_,n.log=ev,n.log10=rv,n.log2=tv,n.max=nv,n.min=iv,n.mod=sv,n.mul=ov,n.pow=av,n.random=uv,n.round=lv,n.sign=fv,n.sin=cv,n.sinh=hv,n.sqrt=dv,n.sub=pv,n.sum=_v,n.tan=vv,n.tanh=gv,n.trunc=mv,s===void 0&&(s={}),s&&s.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<r.length;)s.hasOwnProperty(t=r[e++])||(s[t]=this[t]);return n.config(s),n}function G_(s,e){return new this(s).div(e)}function K_(s){return new this(s).exp()}function X_(s){return Ce(s=new this(s),s.e+1,3)}function Q_(){var s,e,t=new this(0);for($e=!1,s=0;s<arguments.length;)if(e=new this(arguments[s++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return $e=!0,new this(1/0);t=e}return $e=!0,t.sqrt()}function hf(s){return s instanceof Ai||s&&s.toStringTag===tf||!1}function J_(s){return new this(s).ln()}function ev(s,e){return new this(s).log(e)}function tv(s){return new this(s).log(2)}function rv(s){return new this(s).log(10)}function nv(){return af(this,arguments,"lt")}function iv(){return af(this,arguments,"gt")}function sv(s,e){return new this(s).mod(e)}function ov(s,e){return new this(s).mul(e)}function av(s,e){return new this(s).pow(e)}function uv(s){var e,t,r,n,i=0,a=new this(1),u=[];if(s===void 0?s=this.precision:vr(s,1,In),r=Math.ceil(s/Be),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));i<r;)n=e[i],n>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=n%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(r*=4);i<r;)n=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),n>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(n%1e7),i+=4);i=r/4}else throw Error(ef);else for(;i<r;)u[i++]=Math.random()*1e7|0;for(r=u[--i],s%=Be,r&&s&&(n=qt(10,Be-s),u[i]=(r/n|0)*n);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=Be)u.shift();for(r=1,n=u[0];n>=10;n/=10)r++;r<Be&&(t-=Be-r)}return a.e=t,a.d=u,a}function lv(s){return Ce(s=new this(s),s.e+1,this.rounding)}function fv(s){return s=new this(s),s.d?s.d[0]?s.s:0*s.s:s.s||NaN}function cv(s){return new this(s).sin()}function hv(s){return new this(s).sinh()}function dv(s){return new this(s).sqrt()}function pv(s,e){return new this(s).sub(e)}function _v(){var s=0,e=arguments,t=new this(e[s]);for($e=!1;t.s&&++s<e.length;)t=t.plus(e[s]);return $e=!0,Ce(t,this.precision,this.rounding)}function vv(s){return new this(s).tan()}function gv(s){return new this(s).tanh()}function mv(s){return Ce(s=new this(s),s.e+1,1)}le[Symbol.for("nodejs.util.inspect.custom")]=le.toString,le[Symbol.toStringTag]="Decimal";var Ai=le.constructor=cf(Pa);Gs=new Ai(Gs),Ks=new Ai(Ks);var xv="BigNumber",yv=["?on","config"],Dv=xe(xv,yv,s=>{var{on:e,config:t}=s,r=Ai.clone({precision:t.precision,modulo:Ai.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(n){return new r(n.value)},e&&e("config",function(n,i){n.precision!==i.precision&&r.config({precision:n.precision})}),r},{isClass:!0}),df={exports:{}};/**
41
41
  * @license Complex.js v2.1.1 12/05/2020
42
42
  *
43
43
  * Copyright (c) 2020, Robert Eisele (robert@xarg.org)
44
44
  * Dual licensed under the MIT or GPL Version 2 licenses.
45
- **/(function(s,e){(function(t){var r=Math.cosh||function(d){return Math.abs(d)<1e-9?1-d:(Math.exp(d)+Math.exp(-d))*.5},n=Math.sinh||function(d){return Math.abs(d)<1e-9?d:(Math.exp(d)-Math.exp(-d))*.5},i=function(d){var p=Math.PI/4;if(-p>d||d>p)return Math.cos(d)-1;var v=d*d;return v*(v*(v*(v*(v*(v*(v*(v/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},a=function(d,p){var v=Math.abs(d),x=Math.abs(p);return v<3e3&&x<3e3?Math.sqrt(v*v+x*x):(v<x?(v=x,x=d/p):x=p/d,v*Math.sqrt(1+x*x))},u=function(){throw SyntaxError("Invalid Param")};function f(d,p){var v=Math.abs(d),x=Math.abs(p);return d===0?Math.log(x):p===0?Math.log(v):v<3e3&&x<3e3?Math.log(d*d+p*p)*.5:(d=d/2,p=p/2,.5*Math.log(d*d+p*p)+Math.LN2)}var c=function(d,p){var v={re:0,im:0};if(d==null)v.re=v.im=0;else if(p!==void 0)v.re=d,v.im=p;else switch(typeof d){case"object":if("im"in d&&"re"in d)v.re=d.re,v.im=d.im;else if("abs"in d&&"arg"in d){if(!Number.isFinite(d.abs)&&Number.isFinite(d.arg))return h.INFINITY;v.re=d.abs*Math.cos(d.arg),v.im=d.abs*Math.sin(d.arg)}else if("r"in d&&"phi"in d){if(!Number.isFinite(d.r)&&Number.isFinite(d.phi))return h.INFINITY;v.re=d.r*Math.cos(d.phi),v.im=d.r*Math.sin(d.phi)}else d.length===2?(v.re=d[0],v.im=d[1]):u();break;case"string":v.im=v.re=0;var x=d.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),_=1,y=0;x===null&&u();for(var m=0;m<x.length;m++){var w=x[m];w===" "||w===" "||w===`
46
- `||(w==="+"?_++:w==="-"?y++:w==="i"||w==="I"?(_+y===0&&u(),x[m+1]!==" "&&!isNaN(x[m+1])?(v.im+=parseFloat((y%2?"-":"")+x[m+1]),m++):v.im+=parseFloat((y%2?"-":"")+"1"),_=y=0):((_+y===0||isNaN(w))&&u(),x[m+1]==="i"||x[m+1]==="I"?(v.im+=parseFloat((y%2?"-":"")+w),m++):v.re+=parseFloat((y%2?"-":"")+w),_=y=0))}_+y>0&&u();break;case"number":v.im=0,v.re=d;break;default:u()}return isNaN(v.re)||isNaN(v.im),v};function h(d,p){if(!(this instanceof h))return new h(d,p);var v=c(d,p);this.re=v.re,this.im=v.im}h.prototype={re:0,im:0,sign:function(){var d=this.abs();return new h(this.re/d,this.im/d)},add:function(d,p){var v=new h(d,p);return this.isInfinite()&&v.isInfinite()?h.NAN:this.isInfinite()||v.isInfinite()?h.INFINITY:new h(this.re+v.re,this.im+v.im)},sub:function(d,p){var v=new h(d,p);return this.isInfinite()&&v.isInfinite()?h.NAN:this.isInfinite()||v.isInfinite()?h.INFINITY:new h(this.re-v.re,this.im-v.im)},mul:function(d,p){var v=new h(d,p);return this.isInfinite()&&v.isZero()||this.isZero()&&v.isInfinite()?h.NAN:this.isInfinite()||v.isInfinite()?h.INFINITY:v.im===0&&this.im===0?new h(this.re*v.re,0):new h(this.re*v.re-this.im*v.im,this.re*v.im+this.im*v.re)},div:function(d,p){var v=new h(d,p);if(this.isZero()&&v.isZero()||this.isInfinite()&&v.isInfinite())return h.NAN;if(this.isInfinite()||v.isZero())return h.INFINITY;if(this.isZero()||v.isInfinite())return h.ZERO;d=this.re,p=this.im;var x=v.re,_=v.im,y,m;return _===0?new h(d/x,p/x):Math.abs(x)<Math.abs(_)?(m=x/_,y=x*m+_,new h((d*m+p)/y,(p*m-d)/y)):(m=_/x,y=_*m+x,new h((d+p*m)/y,(p-d*m)/y))},pow:function(d,p){var v=new h(d,p);if(d=this.re,p=this.im,v.isZero())return h.ONE;if(v.im===0){if(p===0&&d>0)return new h(Math.pow(d,v.re),0);if(d===0)switch((v.re%4+4)%4){case 0:return new h(Math.pow(p,v.re),0);case 1:return new h(0,Math.pow(p,v.re));case 2:return new h(-Math.pow(p,v.re),0);case 3:return new h(0,-Math.pow(p,v.re))}}if(d===0&&p===0&&v.re>0&&v.im>=0)return h.ZERO;var x=Math.atan2(p,d),_=f(d,p);return d=Math.exp(v.re*_-v.im*x),p=v.im*_+v.re*x,new h(d*Math.cos(p),d*Math.sin(p))},sqrt:function(){var d=this.re,p=this.im,v=this.abs(),x,_;if(d>=0){if(p===0)return new h(Math.sqrt(d),0);x=.5*Math.sqrt(2*(v+d))}else x=Math.abs(p)/Math.sqrt(2*(v-d));return d<=0?_=.5*Math.sqrt(2*(v-d)):_=Math.abs(p)/Math.sqrt(2*(v+d)),new h(x,p<0?-_:_)},exp:function(){var d=Math.exp(this.re);return this.im,new h(d*Math.cos(this.im),d*Math.sin(this.im))},expm1:function(){var d=this.re,p=this.im;return new h(Math.expm1(d)*Math.cos(p)+i(p),Math.exp(d)*Math.sin(p))},log:function(){var d=this.re,p=this.im;return new h(f(d,p),Math.atan2(p,d))},abs:function(){return a(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var d=this.re,p=this.im;return new h(Math.sin(d)*r(p),Math.cos(d)*n(p))},cos:function(){var d=this.re,p=this.im;return new h(Math.cos(d)*r(p),-Math.sin(d)*n(p))},tan:function(){var d=2*this.re,p=2*this.im,v=Math.cos(d)+r(p);return new h(Math.sin(d)/v,n(p)/v)},cot:function(){var d=2*this.re,p=2*this.im,v=Math.cos(d)-r(p);return new h(-Math.sin(d)/v,n(p)/v)},sec:function(){var d=this.re,p=this.im,v=.5*r(2*p)+.5*Math.cos(2*d);return new h(Math.cos(d)*r(p)/v,Math.sin(d)*n(p)/v)},csc:function(){var d=this.re,p=this.im,v=.5*r(2*p)-.5*Math.cos(2*d);return new h(Math.sin(d)*r(p)/v,-Math.cos(d)*n(p)/v)},asin:function(){var d=this.re,p=this.im,v=new h(p*p-d*d+1,-2*d*p).sqrt(),x=new h(v.re-p,v.im+d).log();return new h(x.im,-x.re)},acos:function(){var d=this.re,p=this.im,v=new h(p*p-d*d+1,-2*d*p).sqrt(),x=new h(v.re-p,v.im+d).log();return new h(Math.PI/2-x.im,x.re)},atan:function(){var d=this.re,p=this.im;if(d===0){if(p===1)return new h(0,1/0);if(p===-1)return new h(0,-1/0)}var v=d*d+(1-p)*(1-p),x=new h((1-p*p-d*d)/v,-2*d/v).log();return new h(-.5*x.im,.5*x.re)},acot:function(){var d=this.re,p=this.im;if(p===0)return new h(Math.atan2(1,d),0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).atan():new h(d!==0?d/0:0,p!==0?-p/0:0).atan()},asec:function(){var d=this.re,p=this.im;if(d===0&&p===0)return new h(0,1/0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).acos():new h(d!==0?d/0:0,p!==0?-p/0:0).acos()},acsc:function(){var d=this.re,p=this.im;if(d===0&&p===0)return new h(Math.PI/2,1/0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).asin():new h(d!==0?d/0:0,p!==0?-p/0:0).asin()},sinh:function(){var d=this.re,p=this.im;return new h(n(d)*Math.cos(p),r(d)*Math.sin(p))},cosh:function(){var d=this.re,p=this.im;return new h(r(d)*Math.cos(p),n(d)*Math.sin(p))},tanh:function(){var d=2*this.re,p=2*this.im,v=r(d)+Math.cos(p);return new h(n(d)/v,Math.sin(p)/v)},coth:function(){var d=2*this.re,p=2*this.im,v=r(d)-Math.cos(p);return new h(n(d)/v,-Math.sin(p)/v)},csch:function(){var d=this.re,p=this.im,v=Math.cos(2*p)-r(2*d);return new h(-2*n(d)*Math.cos(p)/v,2*r(d)*Math.sin(p)/v)},sech:function(){var d=this.re,p=this.im,v=Math.cos(2*p)+r(2*d);return new h(2*r(d)*Math.cos(p)/v,-2*n(d)*Math.sin(p)/v)},asinh:function(){var d=this.im;this.im=-this.re,this.re=d;var p=this.asin();return this.re=-this.im,this.im=d,d=p.re,p.re=-p.im,p.im=d,p},acosh:function(){var d=this.acos();if(d.im<=0){var p=d.re;d.re=-d.im,d.im=p}else{var p=d.im;d.im=-d.re,d.re=p}return d},atanh:function(){var d=this.re,p=this.im,v=d>1&&p===0,x=1-d,_=1+d,y=x*x+p*p,m=y!==0?new h((_*x-p*p)/y,(p*x+_*p)/y):new h(d!==-1?d/0:0,p!==0?p/0:0),w=m.re;return m.re=f(m.re,m.im)/2,m.im=Math.atan2(m.im,w)/2,v&&(m.im=-m.im),m},acoth:function(){var d=this.re,p=this.im;if(d===0&&p===0)return new h(0,Math.PI/2);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).atanh():new h(d!==0?d/0:0,p!==0?-p/0:0).atanh()},acsch:function(){var d=this.re,p=this.im;if(p===0)return new h(d!==0?Math.log(d+Math.sqrt(d*d+1)):1/0,0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).asinh():new h(d!==0?d/0:0,p!==0?-p/0:0).asinh()},asech:function(){var d=this.re,p=this.im;if(this.isZero())return h.INFINITY;var v=d*d+p*p;return v!==0?new h(d/v,-p/v).acosh():new h(d!==0?d/0:0,p!==0?-p/0:0).acosh()},inverse:function(){if(this.isZero())return h.INFINITY;if(this.isInfinite())return h.ZERO;var d=this.re,p=this.im,v=d*d+p*p;return new h(d/v,-p/v)},conjugate:function(){return new h(this.re,-this.im)},neg:function(){return new h(-this.re,-this.im)},ceil:function(d){return d=Math.pow(10,d||0),new h(Math.ceil(this.re*d)/d,Math.ceil(this.im*d)/d)},floor:function(d){return d=Math.pow(10,d||0),new h(Math.floor(this.re*d)/d,Math.floor(this.im*d)/d)},round:function(d){return d=Math.pow(10,d||0),new h(Math.round(this.re*d)/d,Math.round(this.im*d)/d)},equals:function(d,p){var v=new h(d,p);return Math.abs(v.re-this.re)<=h.EPSILON&&Math.abs(v.im-this.im)<=h.EPSILON},clone:function(){return new h(this.re,this.im)},toString:function(){var d=this.re,p=this.im,v="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(d)<h.EPSILON&&(d=0),Math.abs(p)<h.EPSILON&&(p=0),p===0?v+d:(d!==0?(v+=d,v+=" ",p<0?(p=-p,v+="-"):v+="+",v+=" "):p<0&&(p=-p,v+="-"),p!==1&&(v+=p),v+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},h.ZERO=new h(0,0),h.ONE=new h(1,0),h.I=new h(0,1),h.PI=new h(Math.PI,0),h.E=new h(Math.E,0),h.INFINITY=new h(1/0,1/0),h.NAN=new h(NaN,NaN),h.EPSILON=1e-15,Object.defineProperty(h,"__esModule",{value:!0}),h.default=h,h.Complex=h,s.exports=h})()})(hc);var wv=hc.exports,Gt=tt(wv),bv="Complex",Ev=[],Av=xe(bv,Ev,()=>(Object.defineProperty(Gt,"name",{value:"Complex"}),Gt.prototype.constructor=Gt,Gt.prototype.type="Complex",Gt.prototype.isComplex=!0,Gt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Gt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Gt.prototype.format=function(s){var e="",t=this.im,r=this.re,n=Ba(this.re,s),i=Ba(this.im,s),a=pt(s)?s:s?s.precision:null;if(a!==null){var u=Math.pow(10,-a);Math.abs(r/t)<u&&(r=0),Math.abs(t/r)<u&&(t=0)}return t===0?e=n:r===0?t===1?e="i":t===-1?e="-i":e=i+"i":t<0?t===-1?e=n+" - i":e=n+" - "+i.substring(1)+"i":t===1?e=n+" + i":e=n+" + "+i+"i",e},Gt.fromPolar=function(s){switch(arguments.length){case 1:{var e=arguments[0];if(typeof e=="object")return Gt(e);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var t=arguments[0],r=arguments[1];if(pt(t)){if(Cl(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),pt(r))return new Gt({r:t,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Gt.prototype.valueOf=Gt.prototype.toString,Gt.fromJSON=function(s){return new Gt(s)},Gt.compare=function(s,e){return s.re>e.re?1:s.re<e.re?-1:s.im>e.im?1:s.im<e.im?-1:0},Gt),{isClass:!0}),dc={exports:{}};/**
45
+ **/(function(s,e){(function(t){var r=Math.cosh||function(d){return Math.abs(d)<1e-9?1-d:(Math.exp(d)+Math.exp(-d))*.5},n=Math.sinh||function(d){return Math.abs(d)<1e-9?d:(Math.exp(d)-Math.exp(-d))*.5},i=function(d){var p=Math.PI/4;if(-p>d||d>p)return Math.cos(d)-1;var v=d*d;return v*(v*(v*(v*(v*(v*(v*(v/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},a=function(d,p){var v=Math.abs(d),x=Math.abs(p);return v<3e3&&x<3e3?Math.sqrt(v*v+x*x):(v<x?(v=x,x=d/p):x=p/d,v*Math.sqrt(1+x*x))},u=function(){throw SyntaxError("Invalid Param")};function c(d,p){var v=Math.abs(d),x=Math.abs(p);return d===0?Math.log(x):p===0?Math.log(v):v<3e3&&x<3e3?Math.log(d*d+p*p)*.5:(d=d/2,p=p/2,.5*Math.log(d*d+p*p)+Math.LN2)}var f=function(d,p){var v={re:0,im:0};if(d==null)v.re=v.im=0;else if(p!==void 0)v.re=d,v.im=p;else switch(typeof d){case"object":if("im"in d&&"re"in d)v.re=d.re,v.im=d.im;else if("abs"in d&&"arg"in d){if(!Number.isFinite(d.abs)&&Number.isFinite(d.arg))return h.INFINITY;v.re=d.abs*Math.cos(d.arg),v.im=d.abs*Math.sin(d.arg)}else if("r"in d&&"phi"in d){if(!Number.isFinite(d.r)&&Number.isFinite(d.phi))return h.INFINITY;v.re=d.r*Math.cos(d.phi),v.im=d.r*Math.sin(d.phi)}else d.length===2?(v.re=d[0],v.im=d[1]):u();break;case"string":v.im=v.re=0;var x=d.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),_=1,y=0;x===null&&u();for(var m=0;m<x.length;m++){var w=x[m];w===" "||w===" "||w===`
46
+ `||(w==="+"?_++:w==="-"?y++:w==="i"||w==="I"?(_+y===0&&u(),x[m+1]!==" "&&!isNaN(x[m+1])?(v.im+=parseFloat((y%2?"-":"")+x[m+1]),m++):v.im+=parseFloat((y%2?"-":"")+"1"),_=y=0):((_+y===0||isNaN(w))&&u(),x[m+1]==="i"||x[m+1]==="I"?(v.im+=parseFloat((y%2?"-":"")+w),m++):v.re+=parseFloat((y%2?"-":"")+w),_=y=0))}_+y>0&&u();break;case"number":v.im=0,v.re=d;break;default:u()}return isNaN(v.re)||isNaN(v.im),v};function h(d,p){if(!(this instanceof h))return new h(d,p);var v=f(d,p);this.re=v.re,this.im=v.im}h.prototype={re:0,im:0,sign:function(){var d=this.abs();return new h(this.re/d,this.im/d)},add:function(d,p){var v=new h(d,p);return this.isInfinite()&&v.isInfinite()?h.NAN:this.isInfinite()||v.isInfinite()?h.INFINITY:new h(this.re+v.re,this.im+v.im)},sub:function(d,p){var v=new h(d,p);return this.isInfinite()&&v.isInfinite()?h.NAN:this.isInfinite()||v.isInfinite()?h.INFINITY:new h(this.re-v.re,this.im-v.im)},mul:function(d,p){var v=new h(d,p);return this.isInfinite()&&v.isZero()||this.isZero()&&v.isInfinite()?h.NAN:this.isInfinite()||v.isInfinite()?h.INFINITY:v.im===0&&this.im===0?new h(this.re*v.re,0):new h(this.re*v.re-this.im*v.im,this.re*v.im+this.im*v.re)},div:function(d,p){var v=new h(d,p);if(this.isZero()&&v.isZero()||this.isInfinite()&&v.isInfinite())return h.NAN;if(this.isInfinite()||v.isZero())return h.INFINITY;if(this.isZero()||v.isInfinite())return h.ZERO;d=this.re,p=this.im;var x=v.re,_=v.im,y,m;return _===0?new h(d/x,p/x):Math.abs(x)<Math.abs(_)?(m=x/_,y=x*m+_,new h((d*m+p)/y,(p*m-d)/y)):(m=_/x,y=_*m+x,new h((d+p*m)/y,(p-d*m)/y))},pow:function(d,p){var v=new h(d,p);if(d=this.re,p=this.im,v.isZero())return h.ONE;if(v.im===0){if(p===0&&d>0)return new h(Math.pow(d,v.re),0);if(d===0)switch((v.re%4+4)%4){case 0:return new h(Math.pow(p,v.re),0);case 1:return new h(0,Math.pow(p,v.re));case 2:return new h(-Math.pow(p,v.re),0);case 3:return new h(0,-Math.pow(p,v.re))}}if(d===0&&p===0&&v.re>0&&v.im>=0)return h.ZERO;var x=Math.atan2(p,d),_=c(d,p);return d=Math.exp(v.re*_-v.im*x),p=v.im*_+v.re*x,new h(d*Math.cos(p),d*Math.sin(p))},sqrt:function(){var d=this.re,p=this.im,v=this.abs(),x,_;if(d>=0){if(p===0)return new h(Math.sqrt(d),0);x=.5*Math.sqrt(2*(v+d))}else x=Math.abs(p)/Math.sqrt(2*(v-d));return d<=0?_=.5*Math.sqrt(2*(v-d)):_=Math.abs(p)/Math.sqrt(2*(v+d)),new h(x,p<0?-_:_)},exp:function(){var d=Math.exp(this.re);return this.im,new h(d*Math.cos(this.im),d*Math.sin(this.im))},expm1:function(){var d=this.re,p=this.im;return new h(Math.expm1(d)*Math.cos(p)+i(p),Math.exp(d)*Math.sin(p))},log:function(){var d=this.re,p=this.im;return new h(c(d,p),Math.atan2(p,d))},abs:function(){return a(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var d=this.re,p=this.im;return new h(Math.sin(d)*r(p),Math.cos(d)*n(p))},cos:function(){var d=this.re,p=this.im;return new h(Math.cos(d)*r(p),-Math.sin(d)*n(p))},tan:function(){var d=2*this.re,p=2*this.im,v=Math.cos(d)+r(p);return new h(Math.sin(d)/v,n(p)/v)},cot:function(){var d=2*this.re,p=2*this.im,v=Math.cos(d)-r(p);return new h(-Math.sin(d)/v,n(p)/v)},sec:function(){var d=this.re,p=this.im,v=.5*r(2*p)+.5*Math.cos(2*d);return new h(Math.cos(d)*r(p)/v,Math.sin(d)*n(p)/v)},csc:function(){var d=this.re,p=this.im,v=.5*r(2*p)-.5*Math.cos(2*d);return new h(Math.sin(d)*r(p)/v,-Math.cos(d)*n(p)/v)},asin:function(){var d=this.re,p=this.im,v=new h(p*p-d*d+1,-2*d*p).sqrt(),x=new h(v.re-p,v.im+d).log();return new h(x.im,-x.re)},acos:function(){var d=this.re,p=this.im,v=new h(p*p-d*d+1,-2*d*p).sqrt(),x=new h(v.re-p,v.im+d).log();return new h(Math.PI/2-x.im,x.re)},atan:function(){var d=this.re,p=this.im;if(d===0){if(p===1)return new h(0,1/0);if(p===-1)return new h(0,-1/0)}var v=d*d+(1-p)*(1-p),x=new h((1-p*p-d*d)/v,-2*d/v).log();return new h(-.5*x.im,.5*x.re)},acot:function(){var d=this.re,p=this.im;if(p===0)return new h(Math.atan2(1,d),0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).atan():new h(d!==0?d/0:0,p!==0?-p/0:0).atan()},asec:function(){var d=this.re,p=this.im;if(d===0&&p===0)return new h(0,1/0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).acos():new h(d!==0?d/0:0,p!==0?-p/0:0).acos()},acsc:function(){var d=this.re,p=this.im;if(d===0&&p===0)return new h(Math.PI/2,1/0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).asin():new h(d!==0?d/0:0,p!==0?-p/0:0).asin()},sinh:function(){var d=this.re,p=this.im;return new h(n(d)*Math.cos(p),r(d)*Math.sin(p))},cosh:function(){var d=this.re,p=this.im;return new h(r(d)*Math.cos(p),n(d)*Math.sin(p))},tanh:function(){var d=2*this.re,p=2*this.im,v=r(d)+Math.cos(p);return new h(n(d)/v,Math.sin(p)/v)},coth:function(){var d=2*this.re,p=2*this.im,v=r(d)-Math.cos(p);return new h(n(d)/v,-Math.sin(p)/v)},csch:function(){var d=this.re,p=this.im,v=Math.cos(2*p)-r(2*d);return new h(-2*n(d)*Math.cos(p)/v,2*r(d)*Math.sin(p)/v)},sech:function(){var d=this.re,p=this.im,v=Math.cos(2*p)+r(2*d);return new h(2*r(d)*Math.cos(p)/v,-2*n(d)*Math.sin(p)/v)},asinh:function(){var d=this.im;this.im=-this.re,this.re=d;var p=this.asin();return this.re=-this.im,this.im=d,d=p.re,p.re=-p.im,p.im=d,p},acosh:function(){var d=this.acos();if(d.im<=0){var p=d.re;d.re=-d.im,d.im=p}else{var p=d.im;d.im=-d.re,d.re=p}return d},atanh:function(){var d=this.re,p=this.im,v=d>1&&p===0,x=1-d,_=1+d,y=x*x+p*p,m=y!==0?new h((_*x-p*p)/y,(p*x+_*p)/y):new h(d!==-1?d/0:0,p!==0?p/0:0),w=m.re;return m.re=c(m.re,m.im)/2,m.im=Math.atan2(m.im,w)/2,v&&(m.im=-m.im),m},acoth:function(){var d=this.re,p=this.im;if(d===0&&p===0)return new h(0,Math.PI/2);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).atanh():new h(d!==0?d/0:0,p!==0?-p/0:0).atanh()},acsch:function(){var d=this.re,p=this.im;if(p===0)return new h(d!==0?Math.log(d+Math.sqrt(d*d+1)):1/0,0);var v=d*d+p*p;return v!==0?new h(d/v,-p/v).asinh():new h(d!==0?d/0:0,p!==0?-p/0:0).asinh()},asech:function(){var d=this.re,p=this.im;if(this.isZero())return h.INFINITY;var v=d*d+p*p;return v!==0?new h(d/v,-p/v).acosh():new h(d!==0?d/0:0,p!==0?-p/0:0).acosh()},inverse:function(){if(this.isZero())return h.INFINITY;if(this.isInfinite())return h.ZERO;var d=this.re,p=this.im,v=d*d+p*p;return new h(d/v,-p/v)},conjugate:function(){return new h(this.re,-this.im)},neg:function(){return new h(-this.re,-this.im)},ceil:function(d){return d=Math.pow(10,d||0),new h(Math.ceil(this.re*d)/d,Math.ceil(this.im*d)/d)},floor:function(d){return d=Math.pow(10,d||0),new h(Math.floor(this.re*d)/d,Math.floor(this.im*d)/d)},round:function(d){return d=Math.pow(10,d||0),new h(Math.round(this.re*d)/d,Math.round(this.im*d)/d)},equals:function(d,p){var v=new h(d,p);return Math.abs(v.re-this.re)<=h.EPSILON&&Math.abs(v.im-this.im)<=h.EPSILON},clone:function(){return new h(this.re,this.im)},toString:function(){var d=this.re,p=this.im,v="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(d)<h.EPSILON&&(d=0),Math.abs(p)<h.EPSILON&&(p=0),p===0?v+d:(d!==0?(v+=d,v+=" ",p<0?(p=-p,v+="-"):v+="+",v+=" "):p<0&&(p=-p,v+="-"),p!==1&&(v+=p),v+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},h.ZERO=new h(0,0),h.ONE=new h(1,0),h.I=new h(0,1),h.PI=new h(Math.PI,0),h.E=new h(Math.E,0),h.INFINITY=new h(1/0,1/0),h.NAN=new h(NaN,NaN),h.EPSILON=1e-15,Object.defineProperty(h,"__esModule",{value:!0}),h.default=h,h.Complex=h,s.exports=h})()})(df);var wv=df.exports,Gt=tt(wv),bv="Complex",Ev=[],Av=xe(bv,Ev,()=>(Object.defineProperty(Gt,"name",{value:"Complex"}),Gt.prototype.constructor=Gt,Gt.prototype.type="Complex",Gt.prototype.isComplex=!0,Gt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Gt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Gt.prototype.format=function(s){var e="",t=this.im,r=this.re,n=Ba(this.re,s),i=Ba(this.im,s),a=pt(s)?s:s?s.precision:null;if(a!==null){var u=Math.pow(10,-a);Math.abs(r/t)<u&&(r=0),Math.abs(t/r)<u&&(t=0)}return t===0?e=n:r===0?t===1?e="i":t===-1?e="-i":e=i+"i":t<0?t===-1?e=n+" - i":e=n+" - "+i.substring(1)+"i":t===1?e=n+" + i":e=n+" + "+i+"i",e},Gt.fromPolar=function(s){switch(arguments.length){case 1:{var e=arguments[0];if(typeof e=="object")return Gt(e);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var t=arguments[0],r=arguments[1];if(pt(t)){if(Cl(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),pt(r))return new Gt({r:t,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Gt.prototype.valueOf=Gt.prototype.toString,Gt.fromJSON=function(s){return new Gt(s)},Gt.compare=function(s,e){return s.re>e.re?1:s.re<e.re?-1:s.im>e.im?1:s.im<e.im?-1:0},Gt),{isClass:!0}),pf={exports:{}};/**
47
47
  * @license Fraction.js v4.3.0 20/08/2023
48
48
  * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
49
49
  *
50
50
  * Copyright (c) 2023, Robert Eisele (robert@raw.org)
51
51
  * Dual licensed under the MIT or GPL Version 2 licenses.
52
- **/(function(s,e){(function(t){var r=2e3,n={s:1,n:0,d:1};function i(m,w){if(isNaN(m=parseInt(m,10)))throw _();return m*w}function a(m,w){if(w===0)throw x();var D=Object.create(v.prototype);D.s=m<0?-1:1,m=m<0?-m:m;var C=p(m,w);return D.n=m/C,D.d=w/C,D}function u(m){for(var w={},D=m,C=2,b=4;b<=D;){for(;D%C===0;)D/=C,w[C]=(w[C]||0)+1;b+=1+2*C++}return D!==m?D>1&&(w[D]=(w[D]||0)+1):w[m]=(w[m]||0)+1,w}var f=function(m,w){var D=0,C=1,b=1,F=0,B=0,M=0,O=1,A=1,N=0,I=1,R=1,k=1,z=1e7,L;if(m!=null)if(w!==void 0){if(D=m,C=w,b=D*C,D%1!==0||C%1!==0)throw y()}else switch(typeof m){case"object":{if("d"in m&&"n"in m)D=m.n,C=m.d,"s"in m&&(D*=m.s);else if(0 in m)D=m[0],1 in m&&(C=m[1]);else throw _();b=D*C;break}case"number":{if(m<0&&(b=m,m=-m),m%1===0)D=m;else if(m>0){for(m>=1&&(A=Math.pow(10,Math.floor(1+Math.log(m)/Math.LN10)),m/=A);I<=z&&k<=z;)if(L=(N+R)/(I+k),m===L){I+k<=z?(D=N+R,C=I+k):k>I?(D=R,C=k):(D=N,C=I);break}else m>L?(N+=R,I+=k):(R+=N,k+=I),I>z?(D=R,C=k):(D=N,C=I);D*=A}else(isNaN(m)||isNaN(w))&&(C=D=NaN);break}case"string":{if(I=m.match(/\d+|./g),I===null)throw _();if(I[N]==="-"?(b=-1,N++):I[N]==="+"&&N++,I.length===N+1?B=i(I[N++],b):I[N+1]==="."||I[N]==="."?(I[N]!=="."&&(F=i(I[N++],b)),N++,(N+1===I.length||I[N+1]==="("&&I[N+3]===")"||I[N+1]==="'"&&I[N+3]==="'")&&(B=i(I[N],b),O=Math.pow(10,I[N].length),N++),(I[N]==="("&&I[N+2]===")"||I[N]==="'"&&I[N+2]==="'")&&(M=i(I[N+1],b),A=Math.pow(10,I[N+1].length)-1,N+=3)):I[N+1]==="/"||I[N+1]===":"?(B=i(I[N],b),O=i(I[N+2],1),N+=3):I[N+3]==="/"&&I[N+1]===" "&&(F=i(I[N],b),B=i(I[N+2],b),O=i(I[N+4],1),N+=5),I.length<=N){C=O*A,b=D=M+C*F+A*B;break}}default:throw _()}if(C===0)throw x();n.s=b<0?-1:1,n.n=Math.abs(D),n.d=Math.abs(C)};function c(m,w,D){for(var C=1;w>0;m=m*m%D,w>>=1)w&1&&(C=C*m%D);return C}function h(m,w){for(;w%2===0;w/=2);for(;w%5===0;w/=5);if(w===1)return 0;for(var D=10%w,C=1;D!==1;C++)if(D=D*10%w,C>r)return 0;return C}function d(m,w,D){for(var C=1,b=c(10,D,w),F=0;F<300;F++){if(C===b)return F;C=C*10%w,b=b*10%w}return 0}function p(m,w){if(!m)return w;if(!w)return m;for(;;){if(m%=w,!m)return w;if(w%=m,!w)return m}}function v(m,w){if(f(m,w),this instanceof v)m=p(n.d,n.n),this.s=n.s,this.n=n.n/m,this.d=n.d/m;else return a(n.s*n.n,n.d)}var x=function(){return new Error("Division by Zero")},_=function(){return new Error("Invalid argument")},y=function(){return new Error("Parameters must be integer")};v.prototype={s:1,n:0,d:1,abs:function(){return a(this.n,this.d)},neg:function(){return a(-this.s*this.n,this.d)},add:function(m,w){return f(m,w),a(this.s*this.n*n.d+n.s*this.d*n.n,this.d*n.d)},sub:function(m,w){return f(m,w),a(this.s*this.n*n.d-n.s*this.d*n.n,this.d*n.d)},mul:function(m,w){return f(m,w),a(this.s*n.s*this.n*n.n,this.d*n.d)},div:function(m,w){return f(m,w),a(this.s*n.s*this.n*n.d,this.d*n.n)},clone:function(){return a(this.s*this.n,this.d)},mod:function(m,w){if(isNaN(this.n)||isNaN(this.d))return new v(NaN);if(m===void 0)return a(this.s*this.n%this.d,1);if(f(m,w),n.n===0&&this.d===0)throw x();return a(this.s*(n.d*this.n)%(n.n*this.d),n.d*this.d)},gcd:function(m,w){return f(m,w),a(p(n.n,this.n)*p(n.d,this.d),n.d*this.d)},lcm:function(m,w){return f(m,w),n.n===0&&this.n===0?a(0,1):a(n.n*this.n,p(n.n,this.n)*p(n.d,this.d))},ceil:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):a(Math.ceil(m*this.s*this.n/this.d),m)},floor:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):a(Math.floor(m*this.s*this.n/this.d),m)},round:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):a(Math.round(m*this.s*this.n/this.d),m)},inverse:function(){return a(this.s*this.d,this.n)},pow:function(m,w){if(f(m,w),n.d===1)return n.s<0?a(Math.pow(this.s*this.d,n.n),Math.pow(this.n,n.n)):a(Math.pow(this.s*this.n,n.n),Math.pow(this.d,n.n));if(this.s<0)return null;var D=u(this.n),C=u(this.d),b=1,F=1;for(var B in D)if(B!=="1"){if(B==="0"){b=0;break}if(D[B]*=n.n,D[B]%n.d===0)D[B]/=n.d;else return null;b*=Math.pow(B,D[B])}for(var B in C)if(B!=="1"){if(C[B]*=n.n,C[B]%n.d===0)C[B]/=n.d;else return null;F*=Math.pow(B,C[B])}return n.s<0?a(F,b):a(b,F)},equals:function(m,w){return f(m,w),this.s*this.n*n.d===n.s*n.n*this.d},compare:function(m,w){f(m,w);var D=this.s*this.n*n.d-n.s*n.n*this.d;return(0<D)-(D<0)},simplify:function(m){if(isNaN(this.n)||isNaN(this.d))return this;m=m||.001;for(var w=this.abs(),D=w.toContinued(),C=1;C<D.length;C++){for(var b=a(D[C-1],1),F=C-2;F>=0;F--)b=b.inverse().add(D[F]);if(Math.abs(b.sub(w).valueOf())<m)return b.mul(this.s)}return this},divisible:function(m,w){return f(m,w),!(!(n.n*this.d)||this.n*n.d%(n.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(m){var w,D="",C=this.n,b=this.d;return this.s<0&&(D+="-"),b===1?D+=C:(m&&(w=Math.floor(C/b))>0&&(D+=w,D+=" ",C%=b),D+=C,D+="/",D+=b),D},toLatex:function(m){var w,D="",C=this.n,b=this.d;return this.s<0&&(D+="-"),b===1?D+=C:(m&&(w=Math.floor(C/b))>0&&(D+=w,C%=b),D+="\\frac{",D+=C,D+="}{",D+=b,D+="}"),D},toContinued:function(){var m,w=this.n,D=this.d,C=[];if(isNaN(w)||isNaN(D))return C;do C.push(Math.floor(w/D)),m=w%D,w=D,D=m;while(w!==1);return C},toString:function(m){var w=this.n,D=this.d;if(isNaN(w)||isNaN(D))return"NaN";m=m||15;var C=h(w,D),b=d(w,D,C),F=this.s<0?"-":"";if(F+=w/D|0,w%=D,w*=10,w&&(F+="."),C){for(var B=b;B--;)F+=w/D|0,w%=D,w*=10;F+="(";for(var B=C;B--;)F+=w/D|0,w%=D,w*=10;F+=")"}else for(var B=m;w&&B--;)F+=w/D|0,w%=D,w*=10;return F}},Object.defineProperty(v,"__esModule",{value:!0}),v.default=v,v.Fraction=v,s.exports=v})()})(dc);var Cv=dc.exports,mn=tt(Cv),Fv="Fraction",Bv=[],Mv=xe(Fv,Bv,()=>(Object.defineProperty(mn,"name",{value:"Fraction"}),mn.prototype.constructor=mn,mn.prototype.type="Fraction",mn.prototype.isFraction=!0,mn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},mn.fromJSON=function(s){return new mn(s)},mn),{isClass:!0}),Nv="Matrix",Sv=[],Ov=xe(Nv,Sv,()=>{function s(){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator")}return s.prototype.type="Matrix",s.prototype.isMatrix=!0,s.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},s.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},s.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},s.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},s.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},s.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},s.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},s.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},s.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},s.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},s.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},s.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},s.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},s.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},s.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},s.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},s.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},s},{isClass:!0});function pc(s){return Object.keys(s.signatures||{}).reduce(function(e,t){var r=(t.match(/,/g)||[]).length+1;return Math.max(e,r)},-1)}var Iv="DenseMatrix",Tv=["Matrix"],$v=xe(Iv,Tv,s=>{var{Matrix:e}=s;function t(h,d){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(d&&!un(d))throw new Error("Invalid datatype: "+d);if(mt(h))h.type==="DenseMatrix"?(this._data=ut(h._data),this._size=ut(h._size),this._datatype=d||h._datatype):(this._data=h.toArray(),this._size=h.size(),this._datatype=d||h._datatype);else if(h&&Ct(h.data)&&Ct(h.size))this._data=h.data,this._size=h.size,Ul(this._data,this._size),this._datatype=d||h.datatype;else if(Ct(h))this._data=c(h),this._size=Lt(this._data),Ul(this._data,this._size),this._datatype=d;else{if(h)throw new TypeError("Unsupported type of data ("+Sn(h)+")");this._data=[],this._size=[0],this._datatype=d}}t.prototype=new e,t.prototype.createDenseMatrix=function(h,d){return new t(h,d)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return Ys(this._data,Sn)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(h,d){return new t(h,d)},t.prototype.subset=function(h,d,p){switch(arguments.length){case 1:return r(this,h);case 2:case 3:return i(this,h,d,p);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(h){if(!Ct(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new rt(h.length,this._size.length);for(var d=0;d<h.length;d++)Ft(h[d],this._size[d]);for(var p=this._data,v=0,x=h.length;v<x;v++){var _=h[v];Ft(_,p.length),p=p[_]}return p},t.prototype.set=function(h,d,p){if(!Ct(h))throw new TypeError("Array expected");if(h.length<this._size.length)throw new rt(h.length,this._size.length,"<");var v,x,_,y=h.map(function(w){return w+1});f(this,y,p);var m=this._data;for(v=0,x=h.length-1;v<x;v++)_=h[v],Ft(_,m.length),m=m[_];return _=h[h.length-1],Ft(_,m.length),m[_]=d,this};function r(h,d){if(!Aa(d))throw new TypeError("Invalid index");var p=d.isScalar();if(p)return h.get(d.min());var v=d.size();if(v.length!==h._size.length)throw new rt(v.length,h._size.length);for(var x=d.min(),_=d.max(),y=0,m=h._size.length;y<m;y++)Ft(x[y],h._size[y]),Ft(_[y],h._size[y]);return new t(n(h._data,d,v.length,0),h._datatype)}function n(h,d,p,v){var x=v===p-1,_=d.dimension(v);return x?_.map(function(y){return Ft(y,h.length),h[y]}).valueOf():_.map(function(y){Ft(y,h.length);var m=h[y];return n(m,d,p,v+1)}).valueOf()}function i(h,d,p,v){if(!d||d.isIndex!==!0)throw new TypeError("Invalid index");var x=d.size(),_=d.isScalar(),y;if(mt(p)?(y=p.size(),p=p.valueOf()):y=Lt(p),_){if(y.length!==0)throw new TypeError("Scalar expected");h.set(d.min(),p,v)}else{if(!yi(y,x))try{y.length===0?p=Vl([p],x):p=Vl(p,x),y=Lt(p)}catch{}if(x.length<h._size.length)throw new rt(x.length,h._size.length,"<");if(y.length<x.length){for(var m=0,w=0;x[m]===1&&y[m]===1;)m++;for(;x[m]===1;)w++,m++;p=Hl(p,x.length,w,y)}if(!yi(x,y))throw new rt(x,y,">");var D=d.max().map(function(F){return F+1});f(h,D,v);var C=x.length,b=0;a(h._data,d,p,C,b)}return h}function a(h,d,p,v,x){var _=x===v-1,y=d.dimension(x);_?y.forEach(function(m,w){Ft(m),h[m]=p[w[0]]}):y.forEach(function(m,w){Ft(m),a(h[m],d,p[w[0]],v,x+1)})}t.prototype.resize=function(h,d,p){if(!is(h))throw new TypeError("Array or Matrix expected");var v=h.valueOf().map(_=>Array.isArray(_)&&_.length===1?_[0]:_),x=p?this.clone():this;return u(x,v,d)};function u(h,d,p){if(d.length===0){for(var v=h._data;Ct(v);)v=v[0];return v}return h._size=d.slice(0),h._data=Na(h._data,h._size,p),h}t.prototype.reshape=function(h,d){var p=d?this.clone():this;p._data=Oa(p._data,h);var v=p._size.reduce((x,_)=>x*_);return p._size=Ia(h,v),p};function f(h,d,p){for(var v=h._size.slice(0),x=!1;v.length<d.length;)v.push(0),x=!0;for(var _=0,y=d.length;_<y;_++)d[_]>v[_]&&(v[_]=d[_],x=!0);x&&u(h,v,p)}t.prototype.clone=function(){var h=new t({data:ut(this._data),size:ut(this._size),datatype:this._datatype});return h},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(h){var d=this,p=pc(h),v=function y(m,w){return Ct(m)?m.map(function(D,C){return y(D,w.concat(C))}):p===1?h(m):p===2?h(m,w):h(m,w,d)},x=v(this._data,[]),_=this._datatype!==void 0?Ys(x,Sn):void 0;return new t(x,_)},t.prototype.forEach=function(h){var d=this,p=function v(x,_){Ct(x)?x.forEach(function(y,m){v(y,_.concat(m))}):h(x,_,d)};p(this._data,[])},t.prototype[Symbol.iterator]=function*(){var h=function*d(p,v){if(Ct(p))for(var x=0;x<p.length;x++)yield*d(p[x],v.concat(x));else yield{value:p,index:v}};yield*h(this._data,[])},t.prototype.rows=function(){var h=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var p=this._data;for(var v of p)h.push(new t([v],this._datatype));return h},t.prototype.columns=function(){var h=this,d=[],p=this.size();if(p.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var v=this._data,x=function(m){var w=v.map(D=>[D[m]]);d.push(new t(w,h._datatype))},_=0;_<p[1];_++)x(_);return d},t.prototype.toArray=function(){return ut(this._data)},t.prototype.valueOf=function(){return this._data},t.prototype.format=function(h){return ct(this._data,h)},t.prototype.toString=function(){return ct(this._data)},t.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},t.prototype.diagonal=function(h){if(h){if(St(h)&&(h=h.toNumber()),!pt(h)||!bt(h))throw new TypeError("The parameter k must be an integer number")}else h=0;for(var d=h>0?h:0,p=h<0?-h:0,v=this._size[0],x=this._size[1],_=Math.min(v-p,x-d),y=[],m=0;m<_;m++)y[m]=this._data[m+p][m+d];return new t({data:y,size:[_],datatype:this._datatype})},t.diagonal=function(h,d,p,v){if(!Ct(h))throw new TypeError("Array expected, size parameter");if(h.length!==2)throw new Error("Only two dimensions matrix are supported");if(h=h.map(function(B){if(St(B)&&(B=B.toNumber()),!pt(B)||!bt(B)||B<1)throw new Error("Size values must be positive integers");return B}),p){if(St(p)&&(p=p.toNumber()),!pt(p)||!bt(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var x=p>0?p:0,_=p<0?-p:0,y=h[0],m=h[1],w=Math.min(y-_,m-x),D;if(Ct(d)){if(d.length!==w)throw new Error("Invalid value array length");D=function(M){return d[M]}}else if(mt(d)){var C=d.size();if(C.length!==1||C[0]!==w)throw new Error("Invalid matrix length");D=function(M){return d.get([M])}}else D=function(){return d};v||(v=St(D(0))?D(0).mul(0):0);var b=[];if(h.length>0){b=Na(b,h,v);for(var F=0;F<w;F++)b[F+_][F+x]=D(F)}return new t({data:b,size:[y,m]})},t.fromJSON=function(h){return new t(h)},t.prototype.swapRows=function(h,d){if(!pt(h)||!bt(h)||!pt(d)||!bt(d))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Ft(h,this._size[0]),Ft(d,this._size[0]),t._swapRows(h,d,this._data),this},t._swapRows=function(h,d,p){var v=p[h];p[h]=p[d],p[d]=v};function c(h){return mt(h)?c(h.valueOf()):Ct(h)?h.map(c):h}return t},{isClass:!0});function Rv(s){var e=s.length,t=s[0].length,r,n,i=[];for(n=0;n<t;n++){var a=[];for(r=0;r<e;r++)a.push(s[r][n]);i.push(a)}return i}function ro(s){for(var e=0;e<s.length;e++)if(is(s[e]))return!0;return!1}function as(s,e){mt(s)&&(s=s.valueOf());for(var t=0,r=s.length;t<r;t++){var n=s[t];Array.isArray(n)?as(n,e):e(n)}}function Jr(s,e,t){return s&&typeof s.map=="function"?s.map(function(r){return Jr(r,e)}):e(s)}function Wa(s,e,t){var r=Array.isArray(s)?Lt(s):s.size();if(e<0||e>=r.length)throw new On(e,r.length);return mt(s)?s.create(no(s.valueOf(),e,t)):no(s,e,t)}function no(s,e,t){var r,n,i,a;if(e<=0)if(Array.isArray(s[0])){for(a=Rv(s),n=[],r=0;r<a.length;r++)n[r]=no(a[r],e-1,t);return n}else{for(i=s[0],r=1;r<s.length;r++)i=t(i,s[r]);return i}else{for(n=[],r=0;r<s.length;r++)n[r]=no(s[r],e-1,t);return n}}var _c="isInteger",Lv=["typed"],Pv=xe(_c,Lv,s=>{var{typed:e}=s;return e(_c,{number:bt,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),vc="number",io="number, number";function gc(s){return Math.abs(s)}gc.signature=vc;function mc(s,e){return s+e}mc.signature=io;function xc(s,e){return s-e}xc.signature=io;function yc(s,e){return s*e}yc.signature=io;function Dc(s){return-s}Dc.signature=vc;function wc(s,e){return s*s<1&&e===1/0||s*s>1&&e===-1/0?0:Math.pow(s,e)}wc.signature=io;var bc="number";function Ec(s){return s===0}Ec.signature=bc;function Ac(s){return Number.isNaN(s)}Ac.signature=bc;var Cc="isNumeric",kv=["typed"],zv=xe(Cc,kv,s=>{var{typed:e}=s;return e(Cc,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Fc="isZero",qv=["typed"],Uv=xe(Fc,qv,s=>{var{typed:e}=s;return e(Fc,{number:Ec,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:e.referToSelf(t=>r=>e.find(t,r.valueType())(r.value)),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Bc="isNaN",Wv=["typed"],Hv=xe(Bc,Wv,s=>{var{typed:e}=s;return e(Bc,{number:Ac,BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":function(r){return Jr(r,Number.isNaN)}})});function so(s,e,t){if(t==null)return s.eq(e);if(s.eq(e))return!0;if(s.isNaN()||e.isNaN())return!1;if(s.isFinite()&&e.isFinite()){var r=s.minus(e).abs();if(r.isZero())return!0;var n=s.constructor.max(s.abs(),e.abs());return r.lte(n.times(t))}return!1}function jv(s,e,t){return ti(s.re,e.re,t)&&ti(s.im,e.im,t)}var oo=xe("compareUnits",["typed"],s=>{var{typed:e}=s;return{"Unit, Unit":e.referToSelf(t=>(r,n)=>{if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return e.find(t,[r.valueType(),n.valueType()])(r.value,n.value)})}}),ao="equalScalar",Yv=["typed","config"],Zv=xe(ao,Yv,s=>{var{typed:e,config:t}=s,r=oo({typed:e});return e(ao,{"boolean, boolean":function(i,a){return i===a},"number, number":function(i,a){return ti(i,a,t.epsilon)},"BigNumber, BigNumber":function(i,a){return i.eq(a)||so(i,a,t.epsilon)},"Fraction, Fraction":function(i,a){return i.equals(a)},"Complex, Complex":function(i,a){return jv(i,a,t.epsilon)}},r)});xe(ao,["typed","config"],s=>{var{typed:e,config:t}=s;return e(ao,{"number, number":function(n,i){return ti(n,i,t.epsilon)}})});var Vv="SparseMatrix",Gv=["typed","equalScalar","Matrix"],Kv=xe(Vv,Gv,s=>{var{typed:e,equalScalar:t,Matrix:r}=s;function n(_,y){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!un(y))throw new Error("Invalid datatype: "+y);if(mt(_))i(this,_,y);else if(_&&Ct(_.index)&&Ct(_.ptr)&&Ct(_.size))this._values=_.values,this._index=_.index,this._ptr=_.ptr,this._size=_.size,this._datatype=y||_.datatype;else if(Ct(_))a(this,_,y);else{if(_)throw new TypeError("Unsupported type of data ("+Sn(_)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function i(_,y,m){y.type==="SparseMatrix"?(_._values=y._values?ut(y._values):void 0,_._index=ut(y._index),_._ptr=ut(y._ptr),_._size=ut(y._size),_._datatype=m||y._datatype):a(_,y.valueOf(),m||y._datatype)}function a(_,y,m){_._values=[],_._index=[],_._ptr=[],_._datatype=m;var w=y.length,D=0,C=t,b=0;if(un(m)&&(C=e.find(t,[m,m])||t,b=e.convert(0,m)),w>0){var F=0;do{_._ptr.push(_._index.length);for(var B=0;B<w;B++){var M=y[B];if(Ct(M)){if(F===0&&D<M.length&&(D=M.length),F<M.length){var O=M[F];C(O,b)||(_._values.push(O),_._index.push(B))}}else F===0&&D<1&&(D=1),C(M,b)||(_._values.push(M),_._index.push(B))}F++}while(F<D)}_._ptr.push(_._index.length),_._size=[w,D]}n.prototype=new r,n.prototype.createSparseMatrix=function(_,y){return new n(_,y)},Object.defineProperty(n,"name",{value:"SparseMatrix"}),n.prototype.constructor=n,n.prototype.type="SparseMatrix",n.prototype.isSparseMatrix=!0,n.prototype.getDataType=function(){return Ys(this._values,Sn)},n.prototype.storage=function(){return"sparse"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(_,y){return new n(_,y)},n.prototype.density=function(){var _=this._size[0],y=this._size[1];return _!==0&&y!==0?this._index.length/(_*y):0},n.prototype.subset=function(_,y,m){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,_);case 2:case 3:return f(this,_,y,m);default:throw new SyntaxError("Wrong number of arguments")}};function u(_,y){if(!Aa(y))throw new TypeError("Invalid index");var m=y.isScalar();if(m)return _.get(y.min());var w=y.size();if(w.length!==_._size.length)throw new rt(w.length,_._size.length);var D,C,b,F,B=y.min(),M=y.max();for(D=0,C=_._size.length;D<C;D++)Ft(B[D],_._size[D]),Ft(M[D],_._size[D]);var O=_._values,A=_._index,N=_._ptr,I=y.dimension(0),R=y.dimension(1),k=[],z=[];I.forEach(function(ee,te){z[ee]=te[0],k[ee]=!0});var L=O?[]:void 0,G=[],H=[];return R.forEach(function(ee){for(H.push(G.length),b=N[ee],F=N[ee+1];b<F;b++)D=A[b],k[D]===!0&&(G.push(z[D]),L&&L.push(O[b]))}),H.push(G.length),new n({values:L,index:G,ptr:H,size:w,datatype:_._datatype})}function f(_,y,m,w){if(!y||y.isIndex!==!0)throw new TypeError("Invalid index");var D=y.size(),C=y.isScalar(),b;if(mt(m)?(b=m.size(),m=m.toArray()):b=Lt(m),C){if(b.length!==0)throw new TypeError("Scalar expected");_.set(y.min(),m,w)}else{if(D.length!==1&&D.length!==2)throw new rt(D.length,_._size.length,"<");if(b.length<D.length){for(var F=0,B=0;D[F]===1&&b[F]===1;)F++;for(;D[F]===1;)B++,F++;m=Hl(m,D.length,B,b)}if(!yi(D,b))throw new rt(D,b,">");if(D.length===1){var M=y.dimension(0);M.forEach(function(N,I){Ft(N),_.set([N,0],m[I[0]],w)})}else{var O=y.dimension(0),A=y.dimension(1);O.forEach(function(N,I){Ft(N),A.forEach(function(R,k){Ft(R),_.set([N,R],m[I[0]][k[0]],w)})})}}return _}n.prototype.get=function(_){if(!Ct(_))throw new TypeError("Array expected");if(_.length!==this._size.length)throw new rt(_.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=_[0],m=_[1];Ft(y,this._size[0]),Ft(m,this._size[1]);var w=c(y,this._ptr[m],this._ptr[m+1],this._index);return w<this._ptr[m+1]&&this._index[w]===y?this._values[w]:0},n.prototype.set=function(_,y,m){if(!Ct(_))throw new TypeError("Array expected");if(_.length!==this._size.length)throw new rt(_.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var w=_[0],D=_[1],C=this._size[0],b=this._size[1],F=t,B=0;un(this._datatype)&&(F=e.find(t,[this._datatype,this._datatype])||t,B=e.convert(0,this._datatype)),(w>C-1||D>b-1)&&(p(this,Math.max(w+1,C),Math.max(D+1,b),m),C=this._size[0],b=this._size[1]),Ft(w,C),Ft(D,b);var M=c(w,this._ptr[D],this._ptr[D+1],this._index);return M<this._ptr[D+1]&&this._index[M]===w?F(y,B)?h(M,D,this._values,this._index,this._ptr):this._values[M]=y:F(y,B)||d(M,w,D,y,this._values,this._index,this._ptr),this};function c(_,y,m,w){if(m-y===0)return m;for(var D=y;D<m;D++)if(w[D]===_)return D;return y}function h(_,y,m,w,D){m.splice(_,1),w.splice(_,1);for(var C=y+1;C<D.length;C++)D[C]--}function d(_,y,m,w,D,C,b){D.splice(_,0,w),C.splice(_,0,y);for(var F=m+1;F<b.length;F++)b[F]++}n.prototype.resize=function(_,y,m){if(!is(_))throw new TypeError("Array or Matrix expected");var w=_.valueOf().map(C=>Array.isArray(C)&&C.length===1?C[0]:C);if(w.length!==2)throw new Error("Only two dimensions matrix are supported");w.forEach(function(C){if(!pt(C)||!bt(C)||C<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ct(w)+")")});var D=m?this.clone():this;return p(D,w[0],w[1],y)};function p(_,y,m,w){var D=w||0,C=t,b=0;un(_._datatype)&&(C=e.find(t,[_._datatype,_._datatype])||t,b=e.convert(0,_._datatype),D=e.convert(D,_._datatype));var F=!C(D,b),B=_._size[0],M=_._size[1],O,A,N;if(m>M){for(A=M;A<m;A++)if(_._ptr[A]=_._values.length,F)for(O=0;O<B;O++)_._values.push(D),_._index.push(O);_._ptr[m]=_._values.length}else m<M&&(_._ptr.splice(m+1,M-m),_._values.splice(_._ptr[m],_._values.length),_._index.splice(_._ptr[m],_._index.length));if(M=m,y>B){if(F){var I=0;for(A=0;A<M;A++){_._ptr[A]=_._ptr[A]+I,N=_._ptr[A+1]+I;var R=0;for(O=B;O<y;O++,R++)_._values.splice(N+R,0,D),_._index.splice(N+R,0,O),I++}_._ptr[M]=_._values.length}}else if(y<B){var k=0;for(A=0;A<M;A++){_._ptr[A]=_._ptr[A]-k;var z=_._ptr[A],L=_._ptr[A+1]-k;for(N=z;N<L;N++)O=_._index[N],O>y-1&&(_._values.splice(N,1),_._index.splice(N,1),k++)}_._ptr[A]=_._values.length}return _._size[0]=y,_._size[1]=m,_}n.prototype.reshape=function(_,y){if(!Ct(_))throw new TypeError("Array expected");if(_.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");_.forEach(function(ee){if(!pt(ee)||!bt(ee)||ee<=-2||ee===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+ct(_)+")")});var m=this._size[0]*this._size[1];_=Ia(_,m);var w=_[0]*_[1];if(m!==w)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var D=y?this.clone():this;if(this._size[0]===_[0]&&this._size[1]===_[1])return D;for(var C=[],b=0;b<D._ptr.length;b++)for(var F=0;F<D._ptr[b+1]-D._ptr[b];F++)C.push(b);for(var B=D._values.slice(),M=D._index.slice(),O=0;O<D._index.length;O++){var A=M[O],N=C[O],I=A*D._size[1]+N;C[O]=I%_[1],M[O]=Math.floor(I/_[1])}D._values.length=0,D._index.length=0,D._ptr.length=_[1]+1,D._size=_.slice();for(var R=0;R<D._ptr.length;R++)D._ptr[R]=0;for(var k=0;k<B.length;k++){var z=M[k],L=C[k],G=B[k],H=c(z,D._ptr[L],D._ptr[L+1],D._index);d(H,z,L,G,D._values,D._index,D._ptr)}return D},n.prototype.clone=function(){var _=new n({values:this._values?ut(this._values):void 0,index:ut(this._index),ptr:ut(this._ptr),size:ut(this._size),datatype:this._datatype});return _},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(_,y){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var m=this,w=this._size[0],D=this._size[1],C=pc(_),b=function(B,M,O){return C===1?_(B):C===2?_(B,[M,O]):_(B,[M,O],m)};return v(this,0,w-1,0,D-1,b,y)};function v(_,y,m,w,D,C,b){var F=[],B=[],M=[],O=t,A=0;un(_._datatype)&&(O=e.find(t,[_._datatype,_._datatype])||t,A=e.convert(0,_._datatype));for(var N=function(Y,Q,pe){Y=C(Y,Q,pe),O(Y,A)||(F.push(Y),B.push(Q))},I=w;I<=D;I++){M.push(F.length);var R=_._ptr[I],k=_._ptr[I+1];if(b)for(var z=R;z<k;z++){var L=_._index[z];L>=y&&L<=m&&N(_._values[z],L-y,I-w)}else{for(var G={},H=R;H<k;H++){var ee=_._index[H];G[ee]=_._values[H]}for(var te=y;te<=m;te++){var j=te in G?G[te]:0;N(j,te-y,I-w)}}}return M.push(F.length),new n({values:F,index:B,ptr:M,size:[m-y+1,D-w+1]})}n.prototype.forEach=function(_,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var m=this,w=this._size[0],D=this._size[1],C=0;C<D;C++){var b=this._ptr[C],F=this._ptr[C+1];if(y)for(var B=b;B<F;B++){var M=this._index[B];_(this._values[B],[M,C],m)}else{for(var O={},A=b;A<F;A++){var N=this._index[A];O[N]=this._values[A]}for(var I=0;I<w;I++){var R=I in O?O[I]:0;_(R,[I,C],m)}}}},n.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var _=this._size[1],y=0;y<_;y++)for(var m=this._ptr[y],w=this._ptr[y+1],D=m;D<w;D++){var C=this._index[D];yield{value:this._values[D],index:[C,y]}}},n.prototype.toArray=function(){return x(this._values,this._index,this._ptr,this._size,!0)},n.prototype.valueOf=function(){return x(this._values,this._index,this._ptr,this._size,!1)};function x(_,y,m,w,D){var C=w[0],b=w[1],F=[],B,M;for(B=0;B<C;B++)for(F[B]=[],M=0;M<b;M++)F[B][M]=0;for(M=0;M<b;M++)for(var O=m[M],A=m[M+1],N=O;N<A;N++)B=y[N],F[B][M]=_?D?ut(_[N]):_[N]:1;return F}return n.prototype.format=function(_){for(var y=this._size[0],m=this._size[1],w=this.density(),D="Sparse Matrix ["+ct(y,_)+" x "+ct(m,_)+"] density: "+ct(w,_)+`
52
+ **/(function(s,e){(function(t){var r=2e3,n={s:1,n:0,d:1};function i(m,w){if(isNaN(m=parseInt(m,10)))throw _();return m*w}function a(m,w){if(w===0)throw x();var D=Object.create(v.prototype);D.s=m<0?-1:1,m=m<0?-m:m;var C=p(m,w);return D.n=m/C,D.d=w/C,D}function u(m){for(var w={},D=m,C=2,b=4;b<=D;){for(;D%C===0;)D/=C,w[C]=(w[C]||0)+1;b+=1+2*C++}return D!==m?D>1&&(w[D]=(w[D]||0)+1):w[m]=(w[m]||0)+1,w}var c=function(m,w){var D=0,C=1,b=1,F=0,B=0,M=0,O=1,A=1,N=0,I=1,L=1,k=1,z=1e7,R;if(m!=null)if(w!==void 0){if(D=m,C=w,b=D*C,D%1!==0||C%1!==0)throw y()}else switch(typeof m){case"object":{if("d"in m&&"n"in m)D=m.n,C=m.d,"s"in m&&(D*=m.s);else if(0 in m)D=m[0],1 in m&&(C=m[1]);else throw _();b=D*C;break}case"number":{if(m<0&&(b=m,m=-m),m%1===0)D=m;else if(m>0){for(m>=1&&(A=Math.pow(10,Math.floor(1+Math.log(m)/Math.LN10)),m/=A);I<=z&&k<=z;)if(R=(N+L)/(I+k),m===R){I+k<=z?(D=N+L,C=I+k):k>I?(D=L,C=k):(D=N,C=I);break}else m>R?(N+=L,I+=k):(L+=N,k+=I),I>z?(D=L,C=k):(D=N,C=I);D*=A}else(isNaN(m)||isNaN(w))&&(C=D=NaN);break}case"string":{if(I=m.match(/\d+|./g),I===null)throw _();if(I[N]==="-"?(b=-1,N++):I[N]==="+"&&N++,I.length===N+1?B=i(I[N++],b):I[N+1]==="."||I[N]==="."?(I[N]!=="."&&(F=i(I[N++],b)),N++,(N+1===I.length||I[N+1]==="("&&I[N+3]===")"||I[N+1]==="'"&&I[N+3]==="'")&&(B=i(I[N],b),O=Math.pow(10,I[N].length),N++),(I[N]==="("&&I[N+2]===")"||I[N]==="'"&&I[N+2]==="'")&&(M=i(I[N+1],b),A=Math.pow(10,I[N+1].length)-1,N+=3)):I[N+1]==="/"||I[N+1]===":"?(B=i(I[N],b),O=i(I[N+2],1),N+=3):I[N+3]==="/"&&I[N+1]===" "&&(F=i(I[N],b),B=i(I[N+2],b),O=i(I[N+4],1),N+=5),I.length<=N){C=O*A,b=D=M+C*F+A*B;break}}default:throw _()}if(C===0)throw x();n.s=b<0?-1:1,n.n=Math.abs(D),n.d=Math.abs(C)};function f(m,w,D){for(var C=1;w>0;m=m*m%D,w>>=1)w&1&&(C=C*m%D);return C}function h(m,w){for(;w%2===0;w/=2);for(;w%5===0;w/=5);if(w===1)return 0;for(var D=10%w,C=1;D!==1;C++)if(D=D*10%w,C>r)return 0;return C}function d(m,w,D){for(var C=1,b=f(10,D,w),F=0;F<300;F++){if(C===b)return F;C=C*10%w,b=b*10%w}return 0}function p(m,w){if(!m)return w;if(!w)return m;for(;;){if(m%=w,!m)return w;if(w%=m,!w)return m}}function v(m,w){if(c(m,w),this instanceof v)m=p(n.d,n.n),this.s=n.s,this.n=n.n/m,this.d=n.d/m;else return a(n.s*n.n,n.d)}var x=function(){return new Error("Division by Zero")},_=function(){return new Error("Invalid argument")},y=function(){return new Error("Parameters must be integer")};v.prototype={s:1,n:0,d:1,abs:function(){return a(this.n,this.d)},neg:function(){return a(-this.s*this.n,this.d)},add:function(m,w){return c(m,w),a(this.s*this.n*n.d+n.s*this.d*n.n,this.d*n.d)},sub:function(m,w){return c(m,w),a(this.s*this.n*n.d-n.s*this.d*n.n,this.d*n.d)},mul:function(m,w){return c(m,w),a(this.s*n.s*this.n*n.n,this.d*n.d)},div:function(m,w){return c(m,w),a(this.s*n.s*this.n*n.d,this.d*n.n)},clone:function(){return a(this.s*this.n,this.d)},mod:function(m,w){if(isNaN(this.n)||isNaN(this.d))return new v(NaN);if(m===void 0)return a(this.s*this.n%this.d,1);if(c(m,w),n.n===0&&this.d===0)throw x();return a(this.s*(n.d*this.n)%(n.n*this.d),n.d*this.d)},gcd:function(m,w){return c(m,w),a(p(n.n,this.n)*p(n.d,this.d),n.d*this.d)},lcm:function(m,w){return c(m,w),n.n===0&&this.n===0?a(0,1):a(n.n*this.n,p(n.n,this.n)*p(n.d,this.d))},ceil:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):a(Math.ceil(m*this.s*this.n/this.d),m)},floor:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):a(Math.floor(m*this.s*this.n/this.d),m)},round:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new v(NaN):a(Math.round(m*this.s*this.n/this.d),m)},inverse:function(){return a(this.s*this.d,this.n)},pow:function(m,w){if(c(m,w),n.d===1)return n.s<0?a(Math.pow(this.s*this.d,n.n),Math.pow(this.n,n.n)):a(Math.pow(this.s*this.n,n.n),Math.pow(this.d,n.n));if(this.s<0)return null;var D=u(this.n),C=u(this.d),b=1,F=1;for(var B in D)if(B!=="1"){if(B==="0"){b=0;break}if(D[B]*=n.n,D[B]%n.d===0)D[B]/=n.d;else return null;b*=Math.pow(B,D[B])}for(var B in C)if(B!=="1"){if(C[B]*=n.n,C[B]%n.d===0)C[B]/=n.d;else return null;F*=Math.pow(B,C[B])}return n.s<0?a(F,b):a(b,F)},equals:function(m,w){return c(m,w),this.s*this.n*n.d===n.s*n.n*this.d},compare:function(m,w){c(m,w);var D=this.s*this.n*n.d-n.s*n.n*this.d;return(0<D)-(D<0)},simplify:function(m){if(isNaN(this.n)||isNaN(this.d))return this;m=m||.001;for(var w=this.abs(),D=w.toContinued(),C=1;C<D.length;C++){for(var b=a(D[C-1],1),F=C-2;F>=0;F--)b=b.inverse().add(D[F]);if(Math.abs(b.sub(w).valueOf())<m)return b.mul(this.s)}return this},divisible:function(m,w){return c(m,w),!(!(n.n*this.d)||this.n*n.d%(n.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(m){var w,D="",C=this.n,b=this.d;return this.s<0&&(D+="-"),b===1?D+=C:(m&&(w=Math.floor(C/b))>0&&(D+=w,D+=" ",C%=b),D+=C,D+="/",D+=b),D},toLatex:function(m){var w,D="",C=this.n,b=this.d;return this.s<0&&(D+="-"),b===1?D+=C:(m&&(w=Math.floor(C/b))>0&&(D+=w,C%=b),D+="\\frac{",D+=C,D+="}{",D+=b,D+="}"),D},toContinued:function(){var m,w=this.n,D=this.d,C=[];if(isNaN(w)||isNaN(D))return C;do C.push(Math.floor(w/D)),m=w%D,w=D,D=m;while(w!==1);return C},toString:function(m){var w=this.n,D=this.d;if(isNaN(w)||isNaN(D))return"NaN";m=m||15;var C=h(w,D),b=d(w,D,C),F=this.s<0?"-":"";if(F+=w/D|0,w%=D,w*=10,w&&(F+="."),C){for(var B=b;B--;)F+=w/D|0,w%=D,w*=10;F+="(";for(var B=C;B--;)F+=w/D|0,w%=D,w*=10;F+=")"}else for(var B=m;w&&B--;)F+=w/D|0,w%=D,w*=10;return F}},Object.defineProperty(v,"__esModule",{value:!0}),v.default=v,v.Fraction=v,s.exports=v})()})(pf);var Cv=pf.exports,mn=tt(Cv),Fv="Fraction",Bv=[],Mv=xe(Fv,Bv,()=>(Object.defineProperty(mn,"name",{value:"Fraction"}),mn.prototype.constructor=mn,mn.prototype.type="Fraction",mn.prototype.isFraction=!0,mn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},mn.fromJSON=function(s){return new mn(s)},mn),{isClass:!0}),Nv="Matrix",Sv=[],Ov=xe(Nv,Sv,()=>{function s(){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator")}return s.prototype.type="Matrix",s.prototype.isMatrix=!0,s.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},s.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},s.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},s.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},s.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},s.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},s.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},s.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},s.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},s.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},s.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},s.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},s.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},s.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},s.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},s.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},s.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},s},{isClass:!0});function _f(s){return Object.keys(s.signatures||{}).reduce(function(e,t){var r=(t.match(/,/g)||[]).length+1;return Math.max(e,r)},-1)}var Iv="DenseMatrix",Tv=["Matrix"],$v=xe(Iv,Tv,s=>{var{Matrix:e}=s;function t(h,d){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(d&&!un(d))throw new Error("Invalid datatype: "+d);if(mt(h))h.type==="DenseMatrix"?(this._data=ut(h._data),this._size=ut(h._size),this._datatype=d||h._datatype):(this._data=h.toArray(),this._size=h.size(),this._datatype=d||h._datatype);else if(h&&Ct(h.data)&&Ct(h.size))this._data=h.data,this._size=h.size,Ul(this._data,this._size),this._datatype=d||h.datatype;else if(Ct(h))this._data=f(h),this._size=Rt(this._data),Ul(this._data,this._size),this._datatype=d;else{if(h)throw new TypeError("Unsupported type of data ("+Sn(h)+")");this._data=[],this._size=[0],this._datatype=d}}t.prototype=new e,t.prototype.createDenseMatrix=function(h,d){return new t(h,d)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return Ys(this._data,Sn)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(h,d){return new t(h,d)},t.prototype.subset=function(h,d,p){switch(arguments.length){case 1:return r(this,h);case 2:case 3:return i(this,h,d,p);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(h){if(!Ct(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new rt(h.length,this._size.length);for(var d=0;d<h.length;d++)Ft(h[d],this._size[d]);for(var p=this._data,v=0,x=h.length;v<x;v++){var _=h[v];Ft(_,p.length),p=p[_]}return p},t.prototype.set=function(h,d,p){if(!Ct(h))throw new TypeError("Array expected");if(h.length<this._size.length)throw new rt(h.length,this._size.length,"<");var v,x,_,y=h.map(function(w){return w+1});c(this,y,p);var m=this._data;for(v=0,x=h.length-1;v<x;v++)_=h[v],Ft(_,m.length),m=m[_];return _=h[h.length-1],Ft(_,m.length),m[_]=d,this};function r(h,d){if(!Aa(d))throw new TypeError("Invalid index");var p=d.isScalar();if(p)return h.get(d.min());var v=d.size();if(v.length!==h._size.length)throw new rt(v.length,h._size.length);for(var x=d.min(),_=d.max(),y=0,m=h._size.length;y<m;y++)Ft(x[y],h._size[y]),Ft(_[y],h._size[y]);return new t(n(h._data,d,v.length,0),h._datatype)}function n(h,d,p,v){var x=v===p-1,_=d.dimension(v);return x?_.map(function(y){return Ft(y,h.length),h[y]}).valueOf():_.map(function(y){Ft(y,h.length);var m=h[y];return n(m,d,p,v+1)}).valueOf()}function i(h,d,p,v){if(!d||d.isIndex!==!0)throw new TypeError("Invalid index");var x=d.size(),_=d.isScalar(),y;if(mt(p)?(y=p.size(),p=p.valueOf()):y=Rt(p),_){if(y.length!==0)throw new TypeError("Scalar expected");h.set(d.min(),p,v)}else{if(!yi(y,x))try{y.length===0?p=Vl([p],x):p=Vl(p,x),y=Rt(p)}catch{}if(x.length<h._size.length)throw new rt(x.length,h._size.length,"<");if(y.length<x.length){for(var m=0,w=0;x[m]===1&&y[m]===1;)m++;for(;x[m]===1;)w++,m++;p=Hl(p,x.length,w,y)}if(!yi(x,y))throw new rt(x,y,">");var D=d.max().map(function(F){return F+1});c(h,D,v);var C=x.length,b=0;a(h._data,d,p,C,b)}return h}function a(h,d,p,v,x){var _=x===v-1,y=d.dimension(x);_?y.forEach(function(m,w){Ft(m),h[m]=p[w[0]]}):y.forEach(function(m,w){Ft(m),a(h[m],d,p[w[0]],v,x+1)})}t.prototype.resize=function(h,d,p){if(!is(h))throw new TypeError("Array or Matrix expected");var v=h.valueOf().map(_=>Array.isArray(_)&&_.length===1?_[0]:_),x=p?this.clone():this;return u(x,v,d)};function u(h,d,p){if(d.length===0){for(var v=h._data;Ct(v);)v=v[0];return v}return h._size=d.slice(0),h._data=Na(h._data,h._size,p),h}t.prototype.reshape=function(h,d){var p=d?this.clone():this;p._data=Oa(p._data,h);var v=p._size.reduce((x,_)=>x*_);return p._size=Ia(h,v),p};function c(h,d,p){for(var v=h._size.slice(0),x=!1;v.length<d.length;)v.push(0),x=!0;for(var _=0,y=d.length;_<y;_++)d[_]>v[_]&&(v[_]=d[_],x=!0);x&&u(h,v,p)}t.prototype.clone=function(){var h=new t({data:ut(this._data),size:ut(this._size),datatype:this._datatype});return h},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(h){var d=this,p=_f(h),v=function y(m,w){return Ct(m)?m.map(function(D,C){return y(D,w.concat(C))}):p===1?h(m):p===2?h(m,w):h(m,w,d)},x=v(this._data,[]),_=this._datatype!==void 0?Ys(x,Sn):void 0;return new t(x,_)},t.prototype.forEach=function(h){var d=this,p=function v(x,_){Ct(x)?x.forEach(function(y,m){v(y,_.concat(m))}):h(x,_,d)};p(this._data,[])},t.prototype[Symbol.iterator]=function*(){var h=function*d(p,v){if(Ct(p))for(var x=0;x<p.length;x++)yield*d(p[x],v.concat(x));else yield{value:p,index:v}};yield*h(this._data,[])},t.prototype.rows=function(){var h=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var p=this._data;for(var v of p)h.push(new t([v],this._datatype));return h},t.prototype.columns=function(){var h=this,d=[],p=this.size();if(p.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var v=this._data,x=function(m){var w=v.map(D=>[D[m]]);d.push(new t(w,h._datatype))},_=0;_<p[1];_++)x(_);return d},t.prototype.toArray=function(){return ut(this._data)},t.prototype.valueOf=function(){return this._data},t.prototype.format=function(h){return ft(this._data,h)},t.prototype.toString=function(){return ft(this._data)},t.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},t.prototype.diagonal=function(h){if(h){if(St(h)&&(h=h.toNumber()),!pt(h)||!bt(h))throw new TypeError("The parameter k must be an integer number")}else h=0;for(var d=h>0?h:0,p=h<0?-h:0,v=this._size[0],x=this._size[1],_=Math.min(v-p,x-d),y=[],m=0;m<_;m++)y[m]=this._data[m+p][m+d];return new t({data:y,size:[_],datatype:this._datatype})},t.diagonal=function(h,d,p,v){if(!Ct(h))throw new TypeError("Array expected, size parameter");if(h.length!==2)throw new Error("Only two dimensions matrix are supported");if(h=h.map(function(B){if(St(B)&&(B=B.toNumber()),!pt(B)||!bt(B)||B<1)throw new Error("Size values must be positive integers");return B}),p){if(St(p)&&(p=p.toNumber()),!pt(p)||!bt(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var x=p>0?p:0,_=p<0?-p:0,y=h[0],m=h[1],w=Math.min(y-_,m-x),D;if(Ct(d)){if(d.length!==w)throw new Error("Invalid value array length");D=function(M){return d[M]}}else if(mt(d)){var C=d.size();if(C.length!==1||C[0]!==w)throw new Error("Invalid matrix length");D=function(M){return d.get([M])}}else D=function(){return d};v||(v=St(D(0))?D(0).mul(0):0);var b=[];if(h.length>0){b=Na(b,h,v);for(var F=0;F<w;F++)b[F+_][F+x]=D(F)}return new t({data:b,size:[y,m]})},t.fromJSON=function(h){return new t(h)},t.prototype.swapRows=function(h,d){if(!pt(h)||!bt(h)||!pt(d)||!bt(d))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Ft(h,this._size[0]),Ft(d,this._size[0]),t._swapRows(h,d,this._data),this},t._swapRows=function(h,d,p){var v=p[h];p[h]=p[d],p[d]=v};function f(h){return mt(h)?f(h.valueOf()):Ct(h)?h.map(f):h}return t},{isClass:!0});function Lv(s){var e=s.length,t=s[0].length,r,n,i=[];for(n=0;n<t;n++){var a=[];for(r=0;r<e;r++)a.push(s[r][n]);i.push(a)}return i}function ro(s){for(var e=0;e<s.length;e++)if(is(s[e]))return!0;return!1}function as(s,e){mt(s)&&(s=s.valueOf());for(var t=0,r=s.length;t<r;t++){var n=s[t];Array.isArray(n)?as(n,e):e(n)}}function Jr(s,e,t){return s&&typeof s.map=="function"?s.map(function(r){return Jr(r,e)}):e(s)}function Wa(s,e,t){var r=Array.isArray(s)?Rt(s):s.size();if(e<0||e>=r.length)throw new On(e,r.length);return mt(s)?s.create(no(s.valueOf(),e,t)):no(s,e,t)}function no(s,e,t){var r,n,i,a;if(e<=0)if(Array.isArray(s[0])){for(a=Lv(s),n=[],r=0;r<a.length;r++)n[r]=no(a[r],e-1,t);return n}else{for(i=s[0],r=1;r<s.length;r++)i=t(i,s[r]);return i}else{for(n=[],r=0;r<s.length;r++)n[r]=no(s[r],e-1,t);return n}}var vf="isInteger",Rv=["typed"],Pv=xe(vf,Rv,s=>{var{typed:e}=s;return e(vf,{number:bt,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),gf="number",io="number, number";function mf(s){return Math.abs(s)}mf.signature=gf;function xf(s,e){return s+e}xf.signature=io;function yf(s,e){return s-e}yf.signature=io;function Df(s,e){return s*e}Df.signature=io;function wf(s){return-s}wf.signature=gf;function bf(s,e){return s*s<1&&e===1/0||s*s>1&&e===-1/0?0:Math.pow(s,e)}bf.signature=io;var Ef="number";function Af(s){return s===0}Af.signature=Ef;function Cf(s){return Number.isNaN(s)}Cf.signature=Ef;var Ff="isNumeric",kv=["typed"],zv=xe(Ff,kv,s=>{var{typed:e}=s;return e(Ff,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Bf="isZero",qv=["typed"],Uv=xe(Bf,qv,s=>{var{typed:e}=s;return e(Bf,{number:Af,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:e.referToSelf(t=>r=>e.find(t,r.valueType())(r.value)),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Mf="isNaN",Wv=["typed"],Hv=xe(Mf,Wv,s=>{var{typed:e}=s;return e(Mf,{number:Cf,BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":function(r){return Jr(r,Number.isNaN)}})});function so(s,e,t){if(t==null)return s.eq(e);if(s.eq(e))return!0;if(s.isNaN()||e.isNaN())return!1;if(s.isFinite()&&e.isFinite()){var r=s.minus(e).abs();if(r.isZero())return!0;var n=s.constructor.max(s.abs(),e.abs());return r.lte(n.times(t))}return!1}function jv(s,e,t){return ti(s.re,e.re,t)&&ti(s.im,e.im,t)}var oo=xe("compareUnits",["typed"],s=>{var{typed:e}=s;return{"Unit, Unit":e.referToSelf(t=>(r,n)=>{if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return e.find(t,[r.valueType(),n.valueType()])(r.value,n.value)})}}),ao="equalScalar",Yv=["typed","config"],Zv=xe(ao,Yv,s=>{var{typed:e,config:t}=s,r=oo({typed:e});return e(ao,{"boolean, boolean":function(i,a){return i===a},"number, number":function(i,a){return ti(i,a,t.epsilon)},"BigNumber, BigNumber":function(i,a){return i.eq(a)||so(i,a,t.epsilon)},"Fraction, Fraction":function(i,a){return i.equals(a)},"Complex, Complex":function(i,a){return jv(i,a,t.epsilon)}},r)});xe(ao,["typed","config"],s=>{var{typed:e,config:t}=s;return e(ao,{"number, number":function(n,i){return ti(n,i,t.epsilon)}})});var Vv="SparseMatrix",Gv=["typed","equalScalar","Matrix"],Kv=xe(Vv,Gv,s=>{var{typed:e,equalScalar:t,Matrix:r}=s;function n(_,y){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!un(y))throw new Error("Invalid datatype: "+y);if(mt(_))i(this,_,y);else if(_&&Ct(_.index)&&Ct(_.ptr)&&Ct(_.size))this._values=_.values,this._index=_.index,this._ptr=_.ptr,this._size=_.size,this._datatype=y||_.datatype;else if(Ct(_))a(this,_,y);else{if(_)throw new TypeError("Unsupported type of data ("+Sn(_)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function i(_,y,m){y.type==="SparseMatrix"?(_._values=y._values?ut(y._values):void 0,_._index=ut(y._index),_._ptr=ut(y._ptr),_._size=ut(y._size),_._datatype=m||y._datatype):a(_,y.valueOf(),m||y._datatype)}function a(_,y,m){_._values=[],_._index=[],_._ptr=[],_._datatype=m;var w=y.length,D=0,C=t,b=0;if(un(m)&&(C=e.find(t,[m,m])||t,b=e.convert(0,m)),w>0){var F=0;do{_._ptr.push(_._index.length);for(var B=0;B<w;B++){var M=y[B];if(Ct(M)){if(F===0&&D<M.length&&(D=M.length),F<M.length){var O=M[F];C(O,b)||(_._values.push(O),_._index.push(B))}}else F===0&&D<1&&(D=1),C(M,b)||(_._values.push(M),_._index.push(B))}F++}while(F<D)}_._ptr.push(_._index.length),_._size=[w,D]}n.prototype=new r,n.prototype.createSparseMatrix=function(_,y){return new n(_,y)},Object.defineProperty(n,"name",{value:"SparseMatrix"}),n.prototype.constructor=n,n.prototype.type="SparseMatrix",n.prototype.isSparseMatrix=!0,n.prototype.getDataType=function(){return Ys(this._values,Sn)},n.prototype.storage=function(){return"sparse"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(_,y){return new n(_,y)},n.prototype.density=function(){var _=this._size[0],y=this._size[1];return _!==0&&y!==0?this._index.length/(_*y):0},n.prototype.subset=function(_,y,m){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,_);case 2:case 3:return c(this,_,y,m);default:throw new SyntaxError("Wrong number of arguments")}};function u(_,y){if(!Aa(y))throw new TypeError("Invalid index");var m=y.isScalar();if(m)return _.get(y.min());var w=y.size();if(w.length!==_._size.length)throw new rt(w.length,_._size.length);var D,C,b,F,B=y.min(),M=y.max();for(D=0,C=_._size.length;D<C;D++)Ft(B[D],_._size[D]),Ft(M[D],_._size[D]);var O=_._values,A=_._index,N=_._ptr,I=y.dimension(0),L=y.dimension(1),k=[],z=[];I.forEach(function(ee,te){z[ee]=te[0],k[ee]=!0});var R=O?[]:void 0,G=[],H=[];return L.forEach(function(ee){for(H.push(G.length),b=N[ee],F=N[ee+1];b<F;b++)D=A[b],k[D]===!0&&(G.push(z[D]),R&&R.push(O[b]))}),H.push(G.length),new n({values:R,index:G,ptr:H,size:w,datatype:_._datatype})}function c(_,y,m,w){if(!y||y.isIndex!==!0)throw new TypeError("Invalid index");var D=y.size(),C=y.isScalar(),b;if(mt(m)?(b=m.size(),m=m.toArray()):b=Rt(m),C){if(b.length!==0)throw new TypeError("Scalar expected");_.set(y.min(),m,w)}else{if(D.length!==1&&D.length!==2)throw new rt(D.length,_._size.length,"<");if(b.length<D.length){for(var F=0,B=0;D[F]===1&&b[F]===1;)F++;for(;D[F]===1;)B++,F++;m=Hl(m,D.length,B,b)}if(!yi(D,b))throw new rt(D,b,">");if(D.length===1){var M=y.dimension(0);M.forEach(function(N,I){Ft(N),_.set([N,0],m[I[0]],w)})}else{var O=y.dimension(0),A=y.dimension(1);O.forEach(function(N,I){Ft(N),A.forEach(function(L,k){Ft(L),_.set([N,L],m[I[0]][k[0]],w)})})}}return _}n.prototype.get=function(_){if(!Ct(_))throw new TypeError("Array expected");if(_.length!==this._size.length)throw new rt(_.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=_[0],m=_[1];Ft(y,this._size[0]),Ft(m,this._size[1]);var w=f(y,this._ptr[m],this._ptr[m+1],this._index);return w<this._ptr[m+1]&&this._index[w]===y?this._values[w]:0},n.prototype.set=function(_,y,m){if(!Ct(_))throw new TypeError("Array expected");if(_.length!==this._size.length)throw new rt(_.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var w=_[0],D=_[1],C=this._size[0],b=this._size[1],F=t,B=0;un(this._datatype)&&(F=e.find(t,[this._datatype,this._datatype])||t,B=e.convert(0,this._datatype)),(w>C-1||D>b-1)&&(p(this,Math.max(w+1,C),Math.max(D+1,b),m),C=this._size[0],b=this._size[1]),Ft(w,C),Ft(D,b);var M=f(w,this._ptr[D],this._ptr[D+1],this._index);return M<this._ptr[D+1]&&this._index[M]===w?F(y,B)?h(M,D,this._values,this._index,this._ptr):this._values[M]=y:F(y,B)||d(M,w,D,y,this._values,this._index,this._ptr),this};function f(_,y,m,w){if(m-y===0)return m;for(var D=y;D<m;D++)if(w[D]===_)return D;return y}function h(_,y,m,w,D){m.splice(_,1),w.splice(_,1);for(var C=y+1;C<D.length;C++)D[C]--}function d(_,y,m,w,D,C,b){D.splice(_,0,w),C.splice(_,0,y);for(var F=m+1;F<b.length;F++)b[F]++}n.prototype.resize=function(_,y,m){if(!is(_))throw new TypeError("Array or Matrix expected");var w=_.valueOf().map(C=>Array.isArray(C)&&C.length===1?C[0]:C);if(w.length!==2)throw new Error("Only two dimensions matrix are supported");w.forEach(function(C){if(!pt(C)||!bt(C)||C<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ft(w)+")")});var D=m?this.clone():this;return p(D,w[0],w[1],y)};function p(_,y,m,w){var D=w||0,C=t,b=0;un(_._datatype)&&(C=e.find(t,[_._datatype,_._datatype])||t,b=e.convert(0,_._datatype),D=e.convert(D,_._datatype));var F=!C(D,b),B=_._size[0],M=_._size[1],O,A,N;if(m>M){for(A=M;A<m;A++)if(_._ptr[A]=_._values.length,F)for(O=0;O<B;O++)_._values.push(D),_._index.push(O);_._ptr[m]=_._values.length}else m<M&&(_._ptr.splice(m+1,M-m),_._values.splice(_._ptr[m],_._values.length),_._index.splice(_._ptr[m],_._index.length));if(M=m,y>B){if(F){var I=0;for(A=0;A<M;A++){_._ptr[A]=_._ptr[A]+I,N=_._ptr[A+1]+I;var L=0;for(O=B;O<y;O++,L++)_._values.splice(N+L,0,D),_._index.splice(N+L,0,O),I++}_._ptr[M]=_._values.length}}else if(y<B){var k=0;for(A=0;A<M;A++){_._ptr[A]=_._ptr[A]-k;var z=_._ptr[A],R=_._ptr[A+1]-k;for(N=z;N<R;N++)O=_._index[N],O>y-1&&(_._values.splice(N,1),_._index.splice(N,1),k++)}_._ptr[A]=_._values.length}return _._size[0]=y,_._size[1]=m,_}n.prototype.reshape=function(_,y){if(!Ct(_))throw new TypeError("Array expected");if(_.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");_.forEach(function(ee){if(!pt(ee)||!bt(ee)||ee<=-2||ee===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+ft(_)+")")});var m=this._size[0]*this._size[1];_=Ia(_,m);var w=_[0]*_[1];if(m!==w)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var D=y?this.clone():this;if(this._size[0]===_[0]&&this._size[1]===_[1])return D;for(var C=[],b=0;b<D._ptr.length;b++)for(var F=0;F<D._ptr[b+1]-D._ptr[b];F++)C.push(b);for(var B=D._values.slice(),M=D._index.slice(),O=0;O<D._index.length;O++){var A=M[O],N=C[O],I=A*D._size[1]+N;C[O]=I%_[1],M[O]=Math.floor(I/_[1])}D._values.length=0,D._index.length=0,D._ptr.length=_[1]+1,D._size=_.slice();for(var L=0;L<D._ptr.length;L++)D._ptr[L]=0;for(var k=0;k<B.length;k++){var z=M[k],R=C[k],G=B[k],H=f(z,D._ptr[R],D._ptr[R+1],D._index);d(H,z,R,G,D._values,D._index,D._ptr)}return D},n.prototype.clone=function(){var _=new n({values:this._values?ut(this._values):void 0,index:ut(this._index),ptr:ut(this._ptr),size:ut(this._size),datatype:this._datatype});return _},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(_,y){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var m=this,w=this._size[0],D=this._size[1],C=_f(_),b=function(B,M,O){return C===1?_(B):C===2?_(B,[M,O]):_(B,[M,O],m)};return v(this,0,w-1,0,D-1,b,y)};function v(_,y,m,w,D,C,b){var F=[],B=[],M=[],O=t,A=0;un(_._datatype)&&(O=e.find(t,[_._datatype,_._datatype])||t,A=e.convert(0,_._datatype));for(var N=function(Y,Q,pe){Y=C(Y,Q,pe),O(Y,A)||(F.push(Y),B.push(Q))},I=w;I<=D;I++){M.push(F.length);var L=_._ptr[I],k=_._ptr[I+1];if(b)for(var z=L;z<k;z++){var R=_._index[z];R>=y&&R<=m&&N(_._values[z],R-y,I-w)}else{for(var G={},H=L;H<k;H++){var ee=_._index[H];G[ee]=_._values[H]}for(var te=y;te<=m;te++){var j=te in G?G[te]:0;N(j,te-y,I-w)}}}return M.push(F.length),new n({values:F,index:B,ptr:M,size:[m-y+1,D-w+1]})}n.prototype.forEach=function(_,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var m=this,w=this._size[0],D=this._size[1],C=0;C<D;C++){var b=this._ptr[C],F=this._ptr[C+1];if(y)for(var B=b;B<F;B++){var M=this._index[B];_(this._values[B],[M,C],m)}else{for(var O={},A=b;A<F;A++){var N=this._index[A];O[N]=this._values[A]}for(var I=0;I<w;I++){var L=I in O?O[I]:0;_(L,[I,C],m)}}}},n.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var _=this._size[1],y=0;y<_;y++)for(var m=this._ptr[y],w=this._ptr[y+1],D=m;D<w;D++){var C=this._index[D];yield{value:this._values[D],index:[C,y]}}},n.prototype.toArray=function(){return x(this._values,this._index,this._ptr,this._size,!0)},n.prototype.valueOf=function(){return x(this._values,this._index,this._ptr,this._size,!1)};function x(_,y,m,w,D){var C=w[0],b=w[1],F=[],B,M;for(B=0;B<C;B++)for(F[B]=[],M=0;M<b;M++)F[B][M]=0;for(M=0;M<b;M++)for(var O=m[M],A=m[M+1],N=O;N<A;N++)B=y[N],F[B][M]=_?D?ut(_[N]):_[N]:1;return F}return n.prototype.format=function(_){for(var y=this._size[0],m=this._size[1],w=this.density(),D="Sparse Matrix ["+ft(y,_)+" x "+ft(m,_)+"] density: "+ft(w,_)+`
53
53
  `,C=0;C<m;C++)for(var b=this._ptr[C],F=this._ptr[C+1],B=b;B<F;B++){var M=this._index[B];D+=`
54
- (`+ct(M,_)+", "+ct(C,_)+") ==> "+(this._values?ct(this._values[B],_):"X")}return D},n.prototype.toString=function(){return ct(this.toArray())},n.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(_){if(_){if(St(_)&&(_=_.toNumber()),!pt(_)||!bt(_))throw new TypeError("The parameter k must be an integer number")}else _=0;var y=_>0?_:0,m=_<0?-_:0,w=this._size[0],D=this._size[1],C=Math.min(w-m,D-y),b=[],F=[],B=[];B[0]=0;for(var M=y;M<D&&b.length<C;M++)for(var O=this._ptr[M],A=this._ptr[M+1],N=O;N<A;N++){var I=this._index[N];if(I===M-y+m){b.push(this._values[N]),F[b.length-1]=I-m;break}}return B.push(b.length),new n({values:b,index:F,ptr:B,size:[C,1]})},n.fromJSON=function(_){return new n(_)},n.diagonal=function(_,y,m,w,D){if(!Ct(_))throw new TypeError("Array expected, size parameter");if(_.length!==2)throw new Error("Only two dimensions matrix are supported");if(_=_.map(function(ee){if(St(ee)&&(ee=ee.toNumber()),!pt(ee)||!bt(ee)||ee<1)throw new Error("Size values must be positive integers");return ee}),m){if(St(m)&&(m=m.toNumber()),!pt(m)||!bt(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var C=t,b=0;un(D)&&(C=e.find(t,[D,D])||t,b=e.convert(0,D));var F=m>0?m:0,B=m<0?-m:0,M=_[0],O=_[1],A=Math.min(M-B,O-F),N;if(Ct(y)){if(y.length!==A)throw new Error("Invalid value array length");N=function(te){return y[te]}}else if(mt(y)){var I=y.size();if(I.length!==1||I[0]!==A)throw new Error("Invalid matrix length");N=function(te){return y.get([te])}}else N=function(){return y};for(var R=[],k=[],z=[],L=0;L<O;L++){z.push(R.length);var G=L-F;if(G>=0&&G<A){var H=N(G);C(H,b)||(k.push(G+B),R.push(H))}}return z.push(R.length),new n({values:R,index:k,ptr:z,size:[M,O]})},n.prototype.swapRows=function(_,y){if(!pt(_)||!bt(_)||!pt(y)||!bt(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Ft(_,this._size[0]),Ft(y,this._size[0]),n._swapRows(_,y,this._size[1],this._values,this._index,this._ptr),this},n._forEachRow=function(_,y,m,w,D){for(var C=w[_],b=w[_+1],F=C;F<b;F++)D(m[F],y[F])},n._swapRows=function(_,y,m,w,D,C){for(var b=0;b<m;b++){var F=C[b],B=C[b+1],M=c(_,F,B,D),O=c(y,F,B,D);if(M<B&&O<B&&D[M]===_&&D[O]===y){if(w){var A=w[M];w[M]=w[O],w[O]=A}continue}if(M<B&&D[M]===_&&(O>=B||D[O]!==y)){var N=w?w[M]:void 0;D.splice(O,0,y),w&&w.splice(O,0,N),D.splice(O<=M?M+1:M,1),w&&w.splice(O<=M?M+1:M,1);continue}if(O<B&&D[O]===y&&(M>=B||D[M]!==_)){var I=w?w[O]:void 0;D.splice(M,0,_),w&&w.splice(M,0,I),D.splice(M<=O?O+1:O,1),w&&w.splice(M<=O?O+1:O,1)}}},n},{isClass:!0}),Xv="number",Qv=["typed"];function Jv(s){var e=s.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var t={"0b":2,"0o":8,"0x":16}[e[1]],r=e[2],n=e[3];return{input:s,radix:t,integerPart:r,fractionalPart:n}}else return null}function eg(s){for(var e=parseInt(s.integerPart,s.radix),t=0,r=0;r<s.fractionalPart.length;r++){var n=parseInt(s.fractionalPart[r],s.radix);t+=n/Math.pow(s.radix,r+1)}var i=e+t;if(isNaN(i))throw new SyntaxError('String "'+s.input+'" is not a valid number');return i}var tg=xe(Xv,Qv,s=>{var{typed:e}=s,t=e("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var i=Jv(n);if(i)return eg(i);var a=0,u=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(a=Number(u[2]),n=u[1]);var f=Number(n);if(isNaN(f))throw new SyntaxError('String "'+n+'" is not a valid number');if(u){if(f>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));f>=2**(a-1)&&(f=f-2**a)}return f},BigNumber:function(n){return n.toNumber()},Fraction:function(n){return n.valueOf()},Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=r(n.value),i}),null:function(n){return 0},"Unit, string | Unit":function(n,i){return n.toNumber(i)},"Array | Matrix":e.referToSelf(r=>n=>Jr(n,r))});return t.fromJSON=function(r){return parseFloat(r.value)},t}),rg="bignumber",ng=["typed","BigNumber"],ig=xe(rg,ng,s=>{var{typed:e,BigNumber:t}=s;return e("bignumber",{"":function(){return new t(0)},number:function(n){return new t(n+"")},string:function(n){var i=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var a=i[2],u=t(i[1]),f=new t(2).pow(Number(a));if(u.gt(f.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var c=new t(2).pow(Number(a)-1);return u.gte(c)?u.sub(f):u}return new t(n)},BigNumber:function(n){return n},Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=r(n.value),i}),Fraction:function(n){return new t(n.n).div(n.d).times(n.s)},null:function(n){return new t(0)},"Array | Matrix":e.referToSelf(r=>n=>Jr(n,r))})}),sg="fraction",og=["typed","Fraction"],ag=xe(sg,og,s=>{var{typed:e,Fraction:t}=s;return e("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new t(n)},string:function(n){return new t(n)},"number, number":function(n,i){return new t(n,i)},null:function(n){return new t(0)},BigNumber:function(n){return new t(n.toString())},Fraction:function(n){return n},Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=r(n.value),i}),Object:function(n){return new t(n)},"Array | Matrix":e.referToSelf(r=>n=>Jr(n,r))})}),Mc="matrix",ug=["typed","Matrix","DenseMatrix","SparseMatrix"],lg=xe(Mc,ug,s=>{var{typed:e,Matrix:t,DenseMatrix:r,SparseMatrix:n}=s;return e(Mc,{"":function(){return i([])},string:function(u){return i([],u)},"string, string":function(u,f){return i([],u,f)},Array:function(u){return i(u)},Matrix:function(u){return i(u,u.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(a,u,f){if(u==="dense"||u==="default"||u===void 0)return new r(a,f);if(u==="sparse")return new n(a,f);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),Nc="unaryMinus",cg=["typed"],fg=xe(Nc,cg,s=>{var{typed:e}=s;return e(Nc,{number:Dc,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:e.referToSelf(t=>r=>{var n=r.clone();return n.value=e.find(t,n.valueType())(r.value),n}),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Sc="abs",hg=["typed"],dg=xe(Sc,hg,s=>{var{typed:e}=s;return e(Sc,{number:gc,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Oc="addScalar",pg=["typed"],_g=xe(Oc,pg,s=>{var{typed:e}=s;return e(Oc,{"number, number":mc,"Complex, Complex":function(r,n){return r.add(n)},"BigNumber, BigNumber":function(r,n){return r.plus(n)},"Fraction, Fraction":function(r,n){return r.add(n)},"Unit, Unit":e.referToSelf(t=>(r,n)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(n.value===null||n.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=e.find(t,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),Ic="subtractScalar",vg=["typed"],gg=xe(Ic,vg,s=>{var{typed:e}=s;return e(Ic,{"number, number":xc,"Complex, Complex":function(r,n){return r.sub(n)},"BigNumber, BigNumber":function(r,n){return r.minus(n)},"Fraction, Fraction":function(r,n){return r.sub(n)},"Unit, Unit":e.referToSelf(t=>(r,n)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(n.value===null||n.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=e.find(t,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),mg="matAlgo11xS0s",xg=["typed","equalScalar"],Ha=xe(mg,xg,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a,u){var f=n._values,c=n._index,h=n._ptr,d=n._size,p=n._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=d[0],x=d[1],_,y=t,m=0,w=a;typeof p=="string"&&(_=p,y=e.find(t,[_,_]),m=e.convert(0,_),i=e.convert(i,_),w=e.find(a,[_,_]));for(var D=[],C=[],b=[],F=0;F<x;F++){b[F]=C.length;for(var B=h[F],M=h[F+1],O=B;O<M;O++){var A=c[O],N=u?w(i,f[O]):w(f[O],i);y(N,m)||(C.push(A),D.push(N))}}return b[x]=C.length,n.createSparseMatrix({values:D,index:C,ptr:b,size:[v,x],datatype:_})}}),yg="matAlgo12xSfs",Dg=["typed","DenseMatrix"],Ci=xe(yg,Dg,s=>{var{typed:e,DenseMatrix:t}=s;return function(n,i,a,u){var f=n._values,c=n._index,h=n._ptr,d=n._size,p=n._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=d[0],x=d[1],_,y=a;typeof p=="string"&&(_=p,i=e.convert(i,_),y=e.find(a,[_,_]));for(var m=[],w=[],D=[],C=0;C<x;C++){for(var b=C+1,F=h[C],B=h[C+1],M=F;M<B;M++){var O=c[M];w[O]=f[M],D[O]=b}for(var A=0;A<v;A++)C===0&&(m[A]=[]),D[A]===b?m[A][C]=u?y(i,w[A]):y(w[A],i):m[A][C]=u?y(i,0):y(0,i)}return new t({data:m,size:[v,x],datatype:_})}}),wg="matAlgo14xDs",bg=["typed"],ja=xe(wg,bg,s=>{var{typed:e}=s;return function(n,i,a,u){var f=n._data,c=n._size,h=n._datatype,d,p=a;typeof h=="string"&&(d=h,i=e.convert(i,d),p=e.find(a,[d,d]));var v=c.length>0?t(p,0,c,c[0],f,i,u):[];return n.createDenseMatrix({data:v,size:ut(c),datatype:d})};function t(r,n,i,a,u,f,c){var h=[];if(n===i.length-1)for(var d=0;d<a;d++)h[d]=c?r(f,u[d]):r(u[d],f);else for(var p=0;p<a;p++)h[p]=t(r,n+1,i,i[n+1],u[p],f,c);return h}}),Eg="matAlgo02xDS0",Ag=["typed","equalScalar"],Cg=xe(Eg,Ag,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a,u){var f=n._data,c=n._size,h=n._datatype||n.getDataType(),d=i._values,p=i._index,v=i._ptr,x=i._size,_=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==x.length)throw new rt(c.length,x.length);if(c[0]!==x[0]||c[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+x+")");if(!d)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=c[0],m=c[1],w,D=t,C=0,b=a;typeof h=="string"&&h===_&&h!=="mixed"&&(w=h,D=e.find(t,[w,w]),C=e.convert(0,w),b=e.find(a,[w,w]));for(var F=[],B=[],M=[],O=0;O<m;O++){M[O]=B.length;for(var A=v[O],N=v[O+1],I=A;I<N;I++){var R=p[I],k=u?b(d[I],f[R][O]):b(f[R][O],d[I]);D(k,C)||(B.push(R),F.push(k))}}return M[m]=B.length,i.createSparseMatrix({values:F,index:B,ptr:M,size:[y,m],datatype:h===n._datatype&&_===i._datatype?w:void 0})}}),Fg="matAlgo03xDSf",Bg=["typed"],Fi=xe(Fg,Bg,s=>{var{typed:e}=s;return function(r,n,i,a){var u=r._data,f=r._size,c=r._datatype||r.getDataType(),h=n._values,d=n._index,p=n._ptr,v=n._size,x=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(f.length!==v.length)throw new rt(f.length,v.length);if(f[0]!==v[0]||f[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+v+")");if(!h)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var _=f[0],y=f[1],m,w=0,D=i;typeof c=="string"&&c===x&&c!=="mixed"&&(m=c,w=e.convert(0,m),D=e.find(i,[m,m]));for(var C=[],b=0;b<_;b++)C[b]=[];for(var F=[],B=[],M=0;M<y;M++){for(var O=M+1,A=p[M],N=p[M+1],I=A;I<N;I++){var R=d[I];F[R]=a?D(h[I],u[R][M]):D(u[R][M],h[I]),B[R]=O}for(var k=0;k<_;k++)B[k]===O?C[k][M]=F[k]:C[k][M]=a?D(w,u[k][M]):D(u[k][M],w)}return r.createDenseMatrix({data:C,size:[_,y],datatype:c===r._datatype&&x===n._datatype?m:void 0})}}),Mg="matAlgo05xSfSf",Ng=["typed","equalScalar"],Tc=xe(Mg,Ng,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a){var u=n._values,f=n._index,c=n._ptr,h=n._size,d=n._datatype||n._data===void 0?n._datatype:n.getDataType(),p=i._values,v=i._index,x=i._ptr,_=i._size,y=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(h.length!==_.length)throw new rt(h.length,_.length);if(h[0]!==_[0]||h[1]!==_[1])throw new RangeError("Dimension mismatch. Matrix A ("+h+") must match Matrix B ("+_+")");var m=h[0],w=h[1],D,C=t,b=0,F=a;typeof d=="string"&&d===y&&d!=="mixed"&&(D=d,C=e.find(t,[D,D]),b=e.convert(0,D),F=e.find(a,[D,D]));var B=u&&p?[]:void 0,M=[],O=[],A=B?[]:void 0,N=B?[]:void 0,I=[],R=[],k,z,L,G;for(z=0;z<w;z++){O[z]=M.length;var H=z+1;for(L=c[z],G=c[z+1];L<G;L++)k=f[L],M.push(k),I[k]=H,A&&(A[k]=u[L]);for(L=x[z],G=x[z+1];L<G;L++)k=v[L],I[k]!==H&&M.push(k),R[k]=H,N&&(N[k]=p[L]);if(B)for(L=O[z];L<M.length;){k=M[L];var ee=I[k],te=R[k];if(ee===H||te===H){var j=ee===H?A[k]:b,X=te===H?N[k]:b,Y=F(j,X);C(Y,b)?M.splice(L,1):(B.push(Y),L++)}}}return O[w]=M.length,n.createSparseMatrix({values:B,index:M,ptr:O,size:[m,w],datatype:d===n._datatype&&y===i._datatype?D:void 0})}}),Sg="matAlgo13xDD",Og=["typed"],Ig=xe(Sg,Og,s=>{var{typed:e}=s;return function(n,i,a){var u=n._data,f=n._size,c=n._datatype,h=i._data,d=i._size,p=i._datatype,v=[];if(f.length!==d.length)throw new rt(f.length,d.length);for(var x=0;x<f.length;x++){if(f[x]!==d[x])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+d+")");v[x]=f[x]}var _,y=a;typeof c=="string"&&c===p&&(_=c,y=e.find(a,[_,_]));var m=v.length>0?t(y,0,v,v[0],u,h):[];return n.createDenseMatrix({data:m,size:v,datatype:_})};function t(r,n,i,a,u,f){var c=[];if(n===i.length-1)for(var h=0;h<a;h++)c[h]=r(u[h],f[h]);else for(var d=0;d<a;d++)c[d]=t(r,n+1,i,i[n+1],u[d],f[d]);return c}}),Tg="broadcast",$g=["concat"],Rg=xe(Tg,$g,s=>{var{concat:e}=s;return function(n,i){var a=Math.max(n._size.length,i._size.length);if(n._size.length===i._size.length&&n._size.every((x,_)=>x===i._size[_]))return[n,i];for(var u=t(n._size,a,0),f=t(i._size,a,0),c=[],h=0;h<a;h++)c[h]=Math.max(u[h],f[h]);Zs(u,c),Zs(f,c);var d=n.clone(),p=i.clone();d._size.length<a?d.reshape(t(d._size,a,1)):p._size.length<a&&p.reshape(t(p._size,a,1));for(var v=0;v<a;v++)d._size[v]<c[v]&&(d=r(d,c[v],v)),p._size[v]<c[v]&&(p=r(p,c[v],v));return[d,p]};function t(n,i,a){return[...Array(i-n.length).fill(a),...n]}function r(n,i,a){return e(...Array(i).fill(n),a)}}),Lg="matrixAlgorithmSuite",Pg=["typed","matrix","concat"],ri=xe(Lg,Pg,s=>{var{typed:e,matrix:t,concat:r}=s,n=Ig({typed:e}),i=ja({typed:e}),a=Rg({concat:r});return function(f){var c=f.elop,h=f.SD||f.DS,d;c?(d={"DenseMatrix, DenseMatrix":(_,y)=>n(...a(_,y),c),"Array, Array":(_,y)=>n(...a(t(_),t(y)),c).valueOf(),"Array, DenseMatrix":(_,y)=>n(...a(t(_),y),c),"DenseMatrix, Array":(_,y)=>n(...a(_,t(y)),c)},f.SS&&(d["SparseMatrix, SparseMatrix"]=(_,y)=>f.SS(...a(_,y),c,!1)),f.DS&&(d["DenseMatrix, SparseMatrix"]=(_,y)=>f.DS(...a(_,y),c,!1),d["Array, SparseMatrix"]=(_,y)=>f.DS(...a(t(_),y),c,!1)),h&&(d["SparseMatrix, DenseMatrix"]=(_,y)=>h(...a(y,_),c,!0),d["SparseMatrix, Array"]=(_,y)=>h(...a(t(y),_),c,!0))):(d={"DenseMatrix, DenseMatrix":e.referToSelf(_=>(y,m)=>n(...a(y,m),_)),"Array, Array":e.referToSelf(_=>(y,m)=>n(...a(t(y),t(m)),_).valueOf()),"Array, DenseMatrix":e.referToSelf(_=>(y,m)=>n(...a(t(y),m),_)),"DenseMatrix, Array":e.referToSelf(_=>(y,m)=>n(...a(y,t(m)),_))},f.SS&&(d["SparseMatrix, SparseMatrix"]=e.referToSelf(_=>(y,m)=>f.SS(...a(y,m),_,!1))),f.DS&&(d["DenseMatrix, SparseMatrix"]=e.referToSelf(_=>(y,m)=>f.DS(...a(y,m),_,!1)),d["Array, SparseMatrix"]=e.referToSelf(_=>(y,m)=>f.DS(...a(t(y),m),_,!1))),h&&(d["SparseMatrix, DenseMatrix"]=e.referToSelf(_=>(y,m)=>h(...a(m,y),_,!0)),d["SparseMatrix, Array"]=e.referToSelf(_=>(y,m)=>h(...a(t(m),y),_,!0))));var p=f.scalar||"any",v=f.Ds||f.Ss;v&&(c?(d["DenseMatrix,"+p]=(_,y)=>i(_,y,c,!1),d[p+", DenseMatrix"]=(_,y)=>i(y,_,c,!0),d["Array,"+p]=(_,y)=>i(t(_),y,c,!1).valueOf(),d[p+", Array"]=(_,y)=>i(t(y),_,c,!0).valueOf()):(d["DenseMatrix,"+p]=e.referToSelf(_=>(y,m)=>i(y,m,_,!1)),d[p+", DenseMatrix"]=e.referToSelf(_=>(y,m)=>i(m,y,_,!0)),d["Array,"+p]=e.referToSelf(_=>(y,m)=>i(t(y),m,_,!1).valueOf()),d[p+", Array"]=e.referToSelf(_=>(y,m)=>i(t(m),y,_,!0).valueOf())));var x=f.sS!==void 0?f.sS:f.Ss;return c?(f.Ss&&(d["SparseMatrix,"+p]=(_,y)=>f.Ss(_,y,c,!1)),x&&(d[p+", SparseMatrix"]=(_,y)=>x(y,_,c,!0))):(f.Ss&&(d["SparseMatrix,"+p]=e.referToSelf(_=>(y,m)=>f.Ss(y,m,_,!1))),x&&(d[p+", SparseMatrix"]=e.referToSelf(_=>(y,m)=>x(m,y,_,!0)))),c&&c.signatures&&Fl(d,c.signatures),d}}),kg="matAlgo01xDSid",zg=["typed"],$c=xe(kg,zg,s=>{var{typed:e}=s;return function(r,n,i,a){var u=r._data,f=r._size,c=r._datatype||r.getDataType(),h=n._values,d=n._index,p=n._ptr,v=n._size,x=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(f.length!==v.length)throw new rt(f.length,v.length);if(f[0]!==v[0]||f[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+v+")");if(!h)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var _=f[0],y=f[1],m=typeof c=="string"&&c!=="mixed"&&c===x?c:void 0,w=m?e.find(i,[m,m]):i,D,C,b=[];for(D=0;D<_;D++)b[D]=[];var F=[],B=[];for(C=0;C<y;C++){for(var M=C+1,O=p[C],A=p[C+1],N=O;N<A;N++)D=d[N],F[D]=a?w(h[N],u[D][C]):w(u[D][C],h[N]),B[D]=M;for(D=0;D<_;D++)B[D]===M?b[D][C]=F[D]:b[D][C]=u[D][C]}return r.createDenseMatrix({data:b,size:[_,y],datatype:c===r._datatype&&x===n._datatype?m:void 0})}}),qg="matAlgo04xSidSid",Ug=["typed","equalScalar"],Wg=xe(qg,Ug,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a){var u=n._values,f=n._index,c=n._ptr,h=n._size,d=n._datatype||n._data===void 0?n._datatype:n.getDataType(),p=i._values,v=i._index,x=i._ptr,_=i._size,y=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(h.length!==_.length)throw new rt(h.length,_.length);if(h[0]!==_[0]||h[1]!==_[1])throw new RangeError("Dimension mismatch. Matrix A ("+h+") must match Matrix B ("+_+")");var m=h[0],w=h[1],D,C=t,b=0,F=a;typeof d=="string"&&d===y&&d!=="mixed"&&(D=d,C=e.find(t,[D,D]),b=e.convert(0,D),F=e.find(a,[D,D]));var B=u&&p?[]:void 0,M=[],O=[],A=u&&p?[]:void 0,N=u&&p?[]:void 0,I=[],R=[],k,z,L,G,H;for(z=0;z<w;z++){O[z]=M.length;var ee=z+1;for(G=c[z],H=c[z+1],L=G;L<H;L++)k=f[L],M.push(k),I[k]=ee,A&&(A[k]=u[L]);for(G=x[z],H=x[z+1],L=G;L<H;L++)if(k=v[L],I[k]===ee){if(A){var te=F(A[k],p[L]);C(te,b)?I[k]=null:A[k]=te}}else M.push(k),R[k]=ee,N&&(N[k]=p[L]);if(A&&N)for(L=O[z];L<M.length;)k=M[L],I[k]===ee?(B[L]=A[k],L++):R[k]===ee?(B[L]=N[k],L++):M.splice(L,1)}return O[w]=M.length,n.createSparseMatrix({values:B,index:M,ptr:O,size:[m,w],datatype:d===n._datatype&&y===i._datatype?D:void 0})}}),Hg="matAlgo10xSids",jg=["typed","DenseMatrix"],Rc=xe(Hg,jg,s=>{var{typed:e,DenseMatrix:t}=s;return function(n,i,a,u){var f=n._values,c=n._index,h=n._ptr,d=n._size,p=n._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=d[0],x=d[1],_,y=a;typeof p=="string"&&(_=p,i=e.convert(i,_),y=e.find(a,[_,_]));for(var m=[],w=[],D=[],C=0;C<x;C++){for(var b=C+1,F=h[C],B=h[C+1],M=F;M<B;M++){var O=c[M];w[O]=f[M],D[O]=b}for(var A=0;A<v;A++)C===0&&(m[A]=[]),D[A]===b?m[A][C]=u?y(i,w[A]):y(w[A],i):m[A][C]=i}return new t({data:m,size:[v,x],datatype:_})}}),Yg="multiplyScalar",Zg=["typed"],Vg=xe(Yg,Zg,s=>{var{typed:e}=s;return e("multiplyScalar",{"number, number":yc,"Complex, Complex":function(r,n){return r.mul(n)},"BigNumber, BigNumber":function(r,n){return r.times(n)},"Fraction, Fraction":function(r,n){return r.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(t,r)=>r.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,r)=>t.multiply(r)})}),Lc="multiply",Gg=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Kg=xe(Lc,Gg,s=>{var{typed:e,matrix:t,addScalar:r,multiplyScalar:n,equalScalar:i,dot:a}=s,u=Ha({typed:e,equalScalar:i}),f=ja({typed:e});function c(b,F){switch(b.length){case 1:switch(F.length){case 1:if(b[0]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(b[0]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+b[0]+") must match Matrix rows ("+F[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+F.length+" dimensions)")}break;case 2:switch(F.length){case 1:if(b[1]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+b[1]+") must match Vector length ("+F[0]+")");break;case 2:if(b[1]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+b[1]+") must match Matrix B rows ("+F[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+F.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+b.length+" dimensions)")}}function h(b,F,B){if(B===0)throw new Error("Cannot multiply two empty vectors");return a(b,F)}function d(b,F){if(F.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return p(b,F)}function p(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._data,N=F._size,I=F._datatype||F.getDataType(),R=M[0],k=N[1],z,L=r,G=n;O&&I&&O===I&&typeof O=="string"&&O!=="mixed"&&(z=O,L=e.find(r,[z,z]),G=e.find(n,[z,z]));for(var H=[],ee=0;ee<k;ee++){for(var te=G(B[0],A[0][ee]),j=1;j<R;j++)te=L(te,G(B[j],A[j][ee]));H[ee]=te}return b.createDenseMatrix({data:H,size:[k],datatype:O===b._datatype&&I===F._datatype?z:void 0})}var v=e("_multiplyMatrixVector",{"DenseMatrix, any":_,"SparseMatrix, any":w}),x=e("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":y,"DenseMatrix, SparseMatrix":m,"SparseMatrix, DenseMatrix":D,"SparseMatrix, SparseMatrix":C});function _(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._data,N=F._datatype||F.getDataType(),I=M[0],R=M[1],k,z=r,L=n;O&&N&&O===N&&typeof O=="string"&&O!=="mixed"&&(k=O,z=e.find(r,[k,k]),L=e.find(n,[k,k]));for(var G=[],H=0;H<I;H++){for(var ee=B[H],te=L(ee[0],A[0]),j=1;j<R;j++)te=z(te,L(ee[j],A[j]));G[H]=te}return b.createDenseMatrix({data:G,size:[I],datatype:O===b._datatype&&N===F._datatype?k:void 0})}function y(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._data,N=F._size,I=F._datatype||F.getDataType(),R=M[0],k=M[1],z=N[1],L,G=r,H=n;O&&I&&O===I&&typeof O=="string"&&O!=="mixed"&&O!=="mixed"&&(L=O,G=e.find(r,[L,L]),H=e.find(n,[L,L]));for(var ee=[],te=0;te<R;te++){var j=B[te];ee[te]=[];for(var X=0;X<z;X++){for(var Y=H(j[0],A[0][X]),Q=1;Q<k;Q++)Y=G(Y,H(j[Q],A[Q][X]));ee[te][X]=Y}}return b.createDenseMatrix({data:ee,size:[R,z],datatype:O===b._datatype&&I===F._datatype?L:void 0})}function m(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._values,N=F._index,I=F._ptr,R=F._size,k=F._datatype||F._data===void 0?F._datatype:F.getDataType();if(!A)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var z=M[0],L=R[1],G,H=r,ee=n,te=i,j=0;O&&k&&O===k&&typeof O=="string"&&O!=="mixed"&&(G=O,H=e.find(r,[G,G]),ee=e.find(n,[G,G]),te=e.find(i,[G,G]),j=e.convert(0,G));for(var X=[],Y=[],Q=[],pe=F.createSparseMatrix({values:X,index:Y,ptr:Q,size:[z,L],datatype:O===b._datatype&&k===F._datatype?G:void 0}),De=0;De<L;De++){Q[De]=Y.length;var we=I[De],be=I[De+1];if(be>we)for(var Oe=0,Fe=0;Fe<z;Fe++){for(var nt=Fe+1,Ye=void 0,Ie=we;Ie<be;Ie++){var Re=N[Ie];Oe!==nt?(Ye=ee(B[Fe][Re],A[Ie]),Oe=nt):Ye=H(Ye,ee(B[Fe][Re],A[Ie]))}Oe===nt&&!te(Ye,j)&&(Y.push(Fe),X.push(Ye))}}return Q[L]=Y.length,pe}function w(b,F){var B=b._values,M=b._index,O=b._ptr,A=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!B)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var N=F._data,I=F._datatype||F.getDataType(),R=b._size[0],k=F._size[0],z=[],L=[],G=[],H,ee=r,te=n,j=i,X=0;A&&I&&A===I&&typeof A=="string"&&A!=="mixed"&&(H=A,ee=e.find(r,[H,H]),te=e.find(n,[H,H]),j=e.find(i,[H,H]),X=e.convert(0,H));var Y=[],Q=[];G[0]=0;for(var pe=0;pe<k;pe++){var De=N[pe];if(!j(De,X))for(var we=O[pe],be=O[pe+1],Oe=we;Oe<be;Oe++){var Fe=M[Oe];Q[Fe]?Y[Fe]=ee(Y[Fe],te(De,B[Oe])):(Q[Fe]=!0,L.push(Fe),Y[Fe]=te(De,B[Oe]))}}for(var nt=L.length,Ye=0;Ye<nt;Ye++){var Ie=L[Ye];z[Ye]=Y[Ie]}return G[1]=L.length,b.createSparseMatrix({values:z,index:L,ptr:G,size:[R,1],datatype:A===b._datatype&&I===F._datatype?H:void 0})}function D(b,F){var B=b._values,M=b._index,O=b._ptr,A=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!B)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var N=F._data,I=F._datatype||F.getDataType(),R=b._size[0],k=F._size[0],z=F._size[1],L,G=r,H=n,ee=i,te=0;A&&I&&A===I&&typeof A=="string"&&A!=="mixed"&&(L=A,G=e.find(r,[L,L]),H=e.find(n,[L,L]),ee=e.find(i,[L,L]),te=e.convert(0,L));for(var j=[],X=[],Y=[],Q=b.createSparseMatrix({values:j,index:X,ptr:Y,size:[R,z],datatype:A===b._datatype&&I===F._datatype?L:void 0}),pe=[],De=[],we=0;we<z;we++){Y[we]=X.length;for(var be=we+1,Oe=0;Oe<k;Oe++){var Fe=N[Oe][we];if(!ee(Fe,te))for(var nt=O[Oe],Ye=O[Oe+1],Ie=nt;Ie<Ye;Ie++){var Re=M[Ie];De[Re]!==be?(De[Re]=be,X.push(Re),pe[Re]=H(Fe,B[Ie])):pe[Re]=G(pe[Re],H(Fe,B[Ie]))}}for(var xt=Y[we],Ut=X.length,Et=xt;Et<Ut;Et++){var lr=X[Et];j[Et]=pe[lr]}}return Y[z]=X.length,Q}function C(b,F){var B=b._values,M=b._index,O=b._ptr,A=b._datatype||b._data===void 0?b._datatype:b.getDataType(),N=F._values,I=F._index,R=F._ptr,k=F._datatype||F._data===void 0?F._datatype:F.getDataType(),z=b._size[0],L=F._size[1],G=B&&N,H,ee=r,te=n;A&&k&&A===k&&typeof A=="string"&&A!=="mixed"&&(H=A,ee=e.find(r,[H,H]),te=e.find(n,[H,H]));for(var j=G?[]:void 0,X=[],Y=[],Q=b.createSparseMatrix({values:j,index:X,ptr:Y,size:[z,L],datatype:A===b._datatype&&k===F._datatype?H:void 0}),pe=G?[]:void 0,De=[],we,be,Oe,Fe,nt,Ye,Ie,Re,xt=0;xt<L;xt++){Y[xt]=X.length;var Ut=xt+1;for(nt=R[xt],Ye=R[xt+1],Fe=nt;Fe<Ye;Fe++)if(Re=I[Fe],G)for(be=O[Re],Oe=O[Re+1],we=be;we<Oe;we++)Ie=M[we],De[Ie]!==Ut?(De[Ie]=Ut,X.push(Ie),pe[Ie]=te(N[Fe],B[we])):pe[Ie]=ee(pe[Ie],te(N[Fe],B[we]));else for(be=O[Re],Oe=O[Re+1],we=be;we<Oe;we++)Ie=M[we],De[Ie]!==Ut&&(De[Ie]=Ut,X.push(Ie));if(G)for(var Et=Y[xt],lr=X.length,Lr=Et;Lr<lr;Lr++){var cr=X[Lr];j[Lr]=pe[cr]}}return Y[L]=X.length,Q}return e(Lc,n,{"Array, Array":e.referTo("Matrix, Matrix",b=>(F,B)=>{c(Lt(F),Lt(B));var M=b(t(F),t(B));return mt(M)?M.valueOf():M}),"Matrix, Matrix":function(F,B){var M=F.size(),O=B.size();return c(M,O),M.length===1?O.length===1?h(F,B,M[0]):d(F,B):O.length===1?v(F,B):x(F,B)},"Matrix, Array":e.referTo("Matrix,Matrix",b=>(F,B)=>b(F,t(B))),"Array, Matrix":e.referToSelf(b=>(F,B)=>b(t(F,B.storage()),B)),"SparseMatrix, any":function(F,B){return u(F,B,n,!1)},"DenseMatrix, any":function(F,B){return f(F,B,n,!1)},"any, SparseMatrix":function(F,B){return u(B,F,n,!0)},"any, DenseMatrix":function(F,B){return f(B,F,n,!0)},"Array, any":function(F,B){return f(t(F),B,n,!1).valueOf()},"any, Array":function(F,B){return f(t(B),F,n,!0).valueOf()},"any, any":n,"any, any, ...any":e.referToSelf(b=>(F,B,M)=>{for(var O=b(F,B),A=0;A<M.length;A++)O=b(O,M[A]);return O})})}),Pc="subtract",Xg=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Qg=xe(Pc,Xg,s=>{var{typed:e,matrix:t,equalScalar:r,subtractScalar:n,unaryMinus:i,DenseMatrix:a,concat:u}=s,f=$c({typed:e}),c=Fi({typed:e}),h=Tc({typed:e,equalScalar:r}),d=Rc({typed:e,DenseMatrix:a}),p=Ci({typed:e,DenseMatrix:a}),v=ri({typed:e,matrix:t,concat:u});return e(Pc,{"any, any":n},v({elop:n,SS:h,DS:f,SD:c,Ss:p,sS:d}))}),Jg="matAlgo07xSSf",em=["typed","DenseMatrix"],uo=xe(Jg,em,s=>{var{typed:e,DenseMatrix:t}=s;return function(i,a,u){var f=i._size,c=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(f.length!==h.length)throw new rt(f.length,h.length);if(f[0]!==h[0]||f[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+h+")");var p=f[0],v=f[1],x,_=0,y=u;typeof c=="string"&&c===d&&c!=="mixed"&&(x=c,_=e.convert(0,x),y=e.find(u,[x,x]));var m,w,D=[];for(m=0;m<p;m++)D[m]=[];var C=[],b=[],F=[],B=[];for(w=0;w<v;w++){var M=w+1;for(r(i,w,F,C,M),r(a,w,B,b,M),m=0;m<p;m++){var O=F[m]===M?C[m]:_,A=B[m]===M?b[m]:_;D[m][w]=y(O,A)}}return new t({data:D,size:[p,v],datatype:c===i._datatype&&d===a._datatype?x:void 0})};function r(n,i,a,u,f){for(var c=n._values,h=n._index,d=n._ptr,p=d[i],v=d[i+1];p<v;p++){var x=h[p];a[x]=f,u[x]=c[p]}}}),kc="conj",tm=["typed"],rm=xe(kc,tm,s=>{var{typed:e}=s;return e(kc,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),zc="concat",nm=["typed","matrix","isInteger"],im=xe(zc,nm,s=>{var{typed:e,matrix:t,isInteger:r}=s;return e(zc,{"...Array | Matrix | number | BigNumber":function(i){var a,u=i.length,f=-1,c,h=!1,d=[];for(a=0;a<u;a++){var p=i[a];if(mt(p)&&(h=!0),pt(p)||St(p)){if(a!==u-1)throw new Error("Dimension must be specified as last argument");if(c=f,f=p.valueOf(),!r(f))throw new TypeError("Integer number expected for dimension");if(f<0||a>0&&f>c)throw new On(f,c+1)}else{var v=ut(p).valueOf(),x=Lt(v);if(d[a]=v,c=f,f=x.length-1,a>0&&f!==c)throw new rt(c+1,f+1)}}if(d.length===0)throw new SyntaxError("At least one matrix expected");for(var _=d.shift();d.length;)_=Zl(_,d.shift(),f);return h?t(_):_},"...string":function(i){return i.join("")}})}),qc="count",sm=["typed","size","prod"],om=xe(qc,sm,s=>{var{typed:e,size:t,prod:r}=s;return e(qc,{string:function(i){return i.length},"Matrix | Array":function(i){return r(t(i))}})}),Uc="identity",am=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],um=xe(Uc,am,s=>{var{typed:e,config:t,matrix:r,BigNumber:n,DenseMatrix:i,SparseMatrix:a}=s;return e(Uc,{"":function(){return t.matrix==="Matrix"?r([]):[]},string:function(h){return r(h)},"number | BigNumber":function(h){return f(h,h,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(h,d){return f(h,h,d)},"number | BigNumber, number | BigNumber":function(h,d){return f(h,d,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(h,d,p){return f(h,d,p)},Array:function(h){return u(h)},"Array, string":function(h,d){return u(h,d)},Matrix:function(h){return u(h.valueOf(),h.storage())},"Matrix, string":function(h,d){return u(h.valueOf(),d)}});function u(c,h){switch(c.length){case 0:return h?r(h):[];case 1:return f(c[0],c[0],h);case 2:return f(c[0],c[1],h);default:throw new Error("Vector containing two values expected")}}function f(c,h,d){var p=St(c)||St(h)?n:null;if(St(c)&&(c=c.toNumber()),St(h)&&(h=h.toNumber()),!bt(c)||c<1)throw new Error("Parameters in function identity must be positive integers");if(!bt(h)||h<1)throw new Error("Parameters in function identity must be positive integers");var v=p?new n(1):1,x=p?new p(0):0,_=[c,h];if(d){if(d==="sparse")return a.diagonal(_,v,0,x);if(d==="dense")return i.diagonal(_,v,0,x);throw new TypeError('Unknown matrix type "'.concat(d,'"'))}for(var y=Na([],_,x),m=c<h?c:h,w=0;w<m;w++)y[w][w]=v;return y}}),Wc="kron",lm=["typed","matrix","multiplyScalar"],cm=xe(Wc,lm,s=>{var{typed:e,matrix:t,multiplyScalar:r}=s;return e(Wc,{"Matrix, Matrix":function(a,u){return t(n(a.toArray(),u.toArray()))},"Matrix, Array":function(a,u){return t(n(a.toArray(),u))},"Array, Matrix":function(a,u){return t(n(a,u.toArray()))},"Array, Array":n});function n(i,a){if(Lt(i).length===1&&(i=[i]),Lt(a).length===1&&(a=[a]),Lt(i).length>2||Lt(a).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(i.length)+", y = "+JSON.stringify(a.length)+")");var u=[],f=[];return i.map(function(c){return a.map(function(h){return f=[],u.push(f),c.map(function(d){return h.map(function(p){return f.push(r(d,p))})})})})&&u}});function fm(){throw new Error('No "bignumber" implementation available')}function hm(){throw new Error('No "fraction" implementation available')}function dm(){throw new Error('No "matrix" implementation available')}var Hc="reshape",pm=["typed","isInteger","matrix"],_m=xe(Hc,pm,s=>{var{typed:e,isInteger:t}=s;return e(Hc,{"Matrix, Array":function(n,i){return n.reshape(i,!0)},"Array, Array":function(n,i){return i.forEach(function(a){if(!t(a))throw new TypeError("Invalid size for dimension: "+a)}),Oa(n,i)}})}),jc="size",vm=["typed","config","?matrix"],gm=xe(jc,vm,s=>{var{typed:e,config:t,matrix:r}=s;return e(jc,{Matrix:function(i){return i.create(i.size())},Array:Lt,string:function(i){return t.matrix==="Array"?[i.length]:r([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return t.matrix==="Array"?[]:r?r([]):dm()}})}),Yc="transpose",mm=["typed","matrix"],xm=xe(Yc,mm,s=>{var{typed:e,matrix:t}=s;return e(Yc,{Array:a=>r(t(a)).valueOf(),Matrix:r,any:ut});function r(a){var u=a.size(),f;switch(u.length){case 1:f=a.clone();break;case 2:{var c=u[0],h=u[1];if(h===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+ct(u)+")");switch(a.storage()){case"dense":f=n(a,c,h);break;case"sparse":f=i(a,c,h);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+ct(u)+")")}return f}function n(a,u,f){for(var c=a._data,h=[],d,p=0;p<f;p++){d=h[p]=[];for(var v=0;v<u;v++)d[v]=ut(c[v][p])}return a.createDenseMatrix({data:h,size:[f,u],datatype:a._datatype})}function i(a,u,f){for(var c=a._values,h=a._index,d=a._ptr,p=c?[]:void 0,v=[],x=[],_=[],y=0;y<u;y++)_[y]=0;var m,w,D;for(m=0,w=h.length;m<w;m++)_[h[m]]++;for(var C=0,b=0;b<u;b++)x.push(C),C+=_[b],_[b]=x[b];for(x.push(C),D=0;D<f;D++)for(var F=d[D],B=d[D+1],M=F;M<B;M++){var O=_[h[M]]++;v[O]=D,c&&(p[O]=ut(c[M]))}return a.createSparseMatrix({values:p,index:v,ptr:x,size:[f,u],datatype:a._datatype})}}),Zc="ctranspose",ym=["typed","transpose","conj"],Dm=xe(Zc,ym,s=>{var{typed:e,transpose:t,conj:r}=s;return e(Zc,{any:function(i){return r(t(i))}})}),Vc="mode",wm=["typed","isNaN","isNumeric"],bm=xe(Vc,wm,s=>{var{typed:e,isNaN:t,isNumeric:r}=s;return e(Vc,{"Array | Matrix":n,"...":function(a){return n(a)}});function n(i){i=Ta(i.valueOf());var a=i.length;if(a===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},f=[],c=0,h=0;h<i.length;h++){var d=i[h];if(r(d)&&t(d))throw new Error("Cannot calculate mode of an array containing NaN values");d in u||(u[d]=0),u[d]++,u[d]===c?f.push(d):u[d]>c&&(c=u[d],f=[d])}return f}});function Ln(s,e,t){var r;return String(s).indexOf("Unexpected type")!==-1?(r=arguments.length>2?" (type: "+Sn(t)+", value: "+JSON.stringify(t)+")":" (type: "+s.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+r)):String(s).indexOf("complex numbers")!==-1?(r=arguments.length>2?" (type: "+Sn(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+r)):s}var Gc="prod",Em=["typed","config","multiplyScalar","numeric"],Am=xe(Gc,Em,s=>{var{typed:e,config:t,multiplyScalar:r,numeric:n}=s;return e(Gc,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(u,f){throw new Error("prod(A, dim) is not yet supported")},"...":function(u){return i(u)}});function i(a){var u;if(as(a,function(f){try{u=u===void 0?f:r(u,f)}catch(c){throw Ln(c,"prod",f)}}),typeof u=="string"&&(u=n(u,t.number)),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),Cm="numeric",Fm=["number","?bignumber","?fraction"],Bm=xe(Cm,Fm,s=>{var{number:e,bignumber:t,fraction:r}=s,n={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:a=>e(a),BigNumber:t?a=>t(a):fm,Fraction:r?a=>r(a):hm};return function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",c=arguments.length>2?arguments[2]:void 0;if(c!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var h=Sn(u);if(!(h in n))throw new TypeError("Cannot convert "+u+' of type "'+h+'"; valid input types are '+Object.keys(n).join(", "));if(!(f in i))throw new TypeError("Cannot convert "+u+' to type "'+f+'"; valid output types are '+Object.keys(i).join(", "));return f===h?u:i[f](u)}}),Kc="divideScalar",Mm=["typed","numeric"],Nm=xe(Kc,Mm,s=>{var{typed:e,numeric:t}=s;return e(Kc,{"number, number":function(n,i){return n/i},"Complex, Complex":function(n,i){return n.div(i)},"BigNumber, BigNumber":function(n,i){return n.div(i)},"Fraction, Fraction":function(n,i){return n.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,n)=>r.divide(n),"number | Fraction | Complex | BigNumber, Unit":(r,n)=>n.divideInto(r)})}),Xc="pow",Sm=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],Om=xe(Xc,Sm,s=>{var{typed:e,config:t,identity:r,multiply:n,matrix:i,inv:a,number:u,fraction:f,Complex:c}=s;return e(Xc,{"number, number":h,"Complex, Complex":function(x,_){return x.pow(_)},"BigNumber, BigNumber":function(x,_){return _.isInteger()||x>=0||t.predictable?x.pow(_):new c(x.toNumber(),0).pow(_.toNumber(),0)},"Fraction, Fraction":function(x,_){var y=x.pow(_);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return h(x.valueOf(),_.valueOf())},"Array, number":d,"Array, BigNumber":function(x,_){return d(x,_.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(x,_){return p(x,_.toNumber())},"Unit, number | BigNumber":function(x,_){return x.pow(_)}});function h(v,x){if(t.predictable&&!bt(x)&&v<0)try{var _=f(x),y=u(_);if((x===y||Math.abs((x-y)/x)<1e-14)&&_.d%2===1)return(_.n%2===0?1:-1)*Math.pow(-v,x)}catch{}return t.predictable&&(v<-1&&x===1/0||v>-1&&v<0&&x===-1/0)?NaN:bt(x)||v>=0||t.predictable?wc(v,x):v*v<1&&x===1/0||v*v>1&&x===-1/0?0:new c(v,0).pow(x,0)}function d(v,x){if(!bt(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var _=Lt(v);if(_.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+_.length+" dimensions)");if(_[0]!==_[1])throw new Error("For A^b, A must be square (size is "+_[0]+"x"+_[1]+")");if(x<0)try{return d(a(v),-x)}catch(w){throw w.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):w}for(var y=r(_[0]).valueOf(),m=v;x>=1;)(x&1)===1&&(y=n(m,y)),x>>=1,m=n(m,m);return y}function p(v,x){return i(d(v.valueOf(),x))}}),Qc="dotDivide",Im=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],Tm=xe(Qc,Im,s=>{var{typed:e,matrix:t,equalScalar:r,divideScalar:n,DenseMatrix:i,concat:a}=s,u=Cg({typed:e,equalScalar:r}),f=Fi({typed:e}),c=uo({typed:e,DenseMatrix:i}),h=Ha({typed:e,equalScalar:r}),d=Ci({typed:e,DenseMatrix:i}),p=ri({typed:e,matrix:t,concat:a});return e(Qc,p({elop:n,SS:c,DS:f,SD:u,Ss:h,sS:d}))}),lo="compare",$m=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],Rm=xe(lo,$m,s=>{var{typed:e,config:t,equalScalar:r,matrix:n,BigNumber:i,Fraction:a,DenseMatrix:u,concat:f}=s,c=Fi({typed:e}),h=Tc({typed:e,equalScalar:r}),d=Ci({typed:e,DenseMatrix:u}),p=ri({typed:e,matrix:n,concat:f}),v=oo({typed:e});return e(lo,Lm({typed:e,config:t}),{"boolean, boolean":function(_,y){return _===y?0:_>y?1:-1},"BigNumber, BigNumber":function(_,y){return so(_,y,t.epsilon)?new i(0):new i(_.cmp(y))},"Fraction, Fraction":function(_,y){return new a(_.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},v,p({SS:h,DS:c,Ss:d}))}),Lm=xe(lo,["typed","config"],s=>{var{typed:e,config:t}=s;return e(lo,{"number, number":function(n,i){return ti(n,i,t.epsilon)?0:n>i?1:-1}})}),co="equal",Pm=["typed","matrix","equalScalar","DenseMatrix","concat"],km=xe(co,Pm,s=>{var{typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i}=s,a=Fi({typed:e}),u=uo({typed:e,DenseMatrix:n}),f=Ci({typed:e,DenseMatrix:n}),c=ri({typed:e,matrix:t,concat:i});return e(co,zm({typed:e,equalScalar:r}),c({elop:r,SS:u,DS:a,Ss:f}))}),zm=xe(co,["typed","equalScalar"],s=>{var{typed:e,equalScalar:t}=s;return e(co,{"any, any":function(n,i){return n===null?i===null:i===null?n===null:n===void 0?i===void 0:i===void 0?n===void 0:t(n,i)}})}),fo="smaller",qm=["typed","config","matrix","DenseMatrix","concat"],Um=xe(fo,qm,s=>{var{typed:e,config:t,matrix:r,DenseMatrix:n,concat:i}=s,a=Fi({typed:e}),u=uo({typed:e,DenseMatrix:n}),f=Ci({typed:e,DenseMatrix:n}),c=ri({typed:e,matrix:r,concat:i}),h=oo({typed:e});return e(fo,Wm({typed:e,config:t}),{"boolean, boolean":(d,p)=>d<p,"BigNumber, BigNumber":function(p,v){return p.lt(v)&&!so(p,v,t.epsilon)},"Fraction, Fraction":(d,p)=>d.compare(p)===-1,"Complex, Complex":function(p,v){throw new TypeError("No ordering relation is defined for complex numbers")}},h,c({SS:u,DS:a,Ss:f}))}),Wm=xe(fo,["typed","config"],s=>{var{typed:e,config:t}=s;return e(fo,{"number, number":function(n,i){return n<i&&!ti(n,i,t.epsilon)}})}),ho="larger",Hm=["typed","config","matrix","DenseMatrix","concat"],jm=xe(ho,Hm,s=>{var{typed:e,config:t,matrix:r,DenseMatrix:n,concat:i}=s,a=Fi({typed:e}),u=uo({typed:e,DenseMatrix:n}),f=Ci({typed:e,DenseMatrix:n}),c=ri({typed:e,matrix:r,concat:i}),h=oo({typed:e});return e(ho,Ym({typed:e,config:t}),{"boolean, boolean":(d,p)=>d>p,"BigNumber, BigNumber":function(p,v){return p.gt(v)&&!so(p,v,t.epsilon)},"Fraction, Fraction":(d,p)=>d.compare(p)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},h,c({SS:u,DS:a,Ss:f}))}),Ym=xe(ho,["typed","config"],s=>{var{typed:e,config:t}=s;return e(ho,{"number, number":function(n,i){return n>i&&!ti(n,i,t.epsilon)}})}),Jc="deepEqual",Zm=["typed","equal"],Vm=xe(Jc,Zm,s=>{var{typed:e,equal:t}=s;return e(Jc,{"any, any":function(i,a){return r(i.valueOf(),a.valueOf())}});function r(n,i){if(Array.isArray(n))if(Array.isArray(i)){var a=n.length;if(a!==i.length)return!1;for(var u=0;u<a;u++)if(!r(n[u],i[u]))return!1;return!0}else return!1;else return Array.isArray(i)?!1:t(n,i)}}),ef="partitionSelect",Gm=["typed","isNumeric","isNaN","compare"],Km=xe(ef,Gm,s=>{var{typed:e,isNumeric:t,isNaN:r,compare:n}=s,i=n,a=(c,h)=>-n(c,h);return e(ef,{"Array | Matrix, number":function(h,d){return u(h,d,i)},"Array | Matrix, number, string":function(h,d,p){if(p==="asc")return u(h,d,i);if(p==="desc")return u(h,d,a);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(c,h,d){if(!bt(h)||h<0)throw new Error("k must be a non-negative integer");if(mt(c)){var p=c.size();if(p.length>1)throw new Error("Only one dimensional matrices supported");return f(c.valueOf(),h,d)}if(Array.isArray(c))return f(c,h,d)}function f(c,h,d){if(h>=c.length)throw new Error("k out of bounds");for(var p=0;p<c.length;p++)if(t(c[p])&&r(c[p]))return c[p];for(var v=0,x=c.length-1;v<x;){for(var _=v,y=x,m=c[Math.floor(Math.random()*(x-v+1))+v];_<y;)if(d(c[_],m)>=0){var w=c[y];c[y]=c[_],c[_]=w,--y}else++_;d(c[_],m)>0&&--_,h<=_?x=_:v=_+1}return c[h]}}),tf="max",Xm=["typed","config","numeric","larger"],Qm=xe(tf,Xm,s=>{var{typed:e,config:t,numeric:r,larger:n}=s;return e(tf,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(f,c){return Wa(f,c.valueOf(),i)},"...":function(f){if(ro(f))throw new TypeError("Scalar values expected in function max");return a(f)}});function i(u,f){try{return n(u,f)?u:f}catch(c){throw Ln(c,"max",f)}}function a(u){var f;if(as(u,function(c){try{isNaN(c)&&typeof c=="number"?f=NaN:(f===void 0||n(c,f))&&(f=c)}catch(h){throw Ln(h,"max",c)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=r(f,t.number)),f}}),rf="min",Jm=["typed","config","numeric","smaller"],ex=xe(rf,Jm,s=>{var{typed:e,config:t,numeric:r,smaller:n}=s;return e(rf,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(f,c){return Wa(f,c.valueOf(),i)},"...":function(f){if(ro(f))throw new TypeError("Scalar values expected in function min");return a(f)}});function i(u,f){try{return n(u,f)?u:f}catch(c){throw Ln(c,"min",f)}}function a(u){var f;if(as(u,function(c){try{isNaN(c)&&typeof c=="number"?f=NaN:(f===void 0||n(c,f))&&(f=c)}catch(h){throw Ln(h,"min",c)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=r(f,t.number)),f}}),nf="add",tx=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],rx=xe(nf,tx,s=>{var{typed:e,matrix:t,addScalar:r,equalScalar:n,DenseMatrix:i,SparseMatrix:a,concat:u}=s,f=$c({typed:e}),c=Wg({typed:e,equalScalar:n}),h=Rc({typed:e,DenseMatrix:i}),d=ri({typed:e,matrix:t,concat:u});return e(nf,{"any, any":r,"any, any, ...any":e.referToSelf(p=>(v,x,_)=>{for(var y=p(v,x),m=0;m<_.length;m++)y=p(y,_[m]);return y})},d({elop:r,DS:f,SS:c,Ss:h}))}),sf="dot",nx=["typed","addScalar","multiplyScalar","conj","size"],ix=xe(sf,nx,s=>{var{typed:e,addScalar:t,multiplyScalar:r,conj:n,size:i}=s;return e(sf,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":f});function a(h,d){var p=c(h),v=c(d),x,_;if(p.length===1)x=p[0];else if(p.length===2&&p[1]===1)x=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(v.length===1)_=v[0];else if(v.length===2&&v[1]===1)_=v[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+v.join(", ")+")");if(x!==_)throw new RangeError("Vectors must have equal length ("+x+" != "+_+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function u(h,d){var p=a(h,d),v=mt(h)?h._data:h,x=mt(h)?h._datatype||h.getDataType():void 0,_=mt(d)?d._data:d,y=mt(d)?d._datatype||d.getDataType():void 0,m=c(h).length===2,w=c(d).length===2,D=t,C=r;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var b=x;D=e.find(t,[b,b]),C=e.find(r,[b,b])}if(!m&&!w){for(var F=C(n(v[0]),_[0]),B=1;B<p;B++)F=D(F,C(n(v[B]),_[B]));return F}if(!m&&w){for(var M=C(n(v[0]),_[0][0]),O=1;O<p;O++)M=D(M,C(n(v[O]),_[O][0]));return M}if(m&&!w){for(var A=C(n(v[0][0]),_[0]),N=1;N<p;N++)A=D(A,C(n(v[N][0]),_[N]));return A}if(m&&w){for(var I=C(n(v[0][0]),_[0][0]),R=1;R<p;R++)I=D(I,C(n(v[R][0]),_[R][0]));return I}}function f(h,d){a(h,d);for(var p=h._index,v=h._values,x=d._index,_=d._values,y=0,m=t,w=r,D=0,C=0;D<p.length&&C<x.length;){var b=p[D],F=x[C];if(b<F){D++;continue}if(b>F){C++;continue}b===F&&(y=m(y,w(v[D],_[C])),D++,C++)}return y}function c(h){return mt(h)?h.size():i(h)}}),sx="trace",ox=["typed","matrix","add"],ax=xe(sx,ox,s=>{var{typed:e,matrix:t,add:r}=s;return e("trace",{Array:function(u){return n(t(u))},SparseMatrix:i,DenseMatrix:n,any:ut});function n(a){var u=a._size,f=a._data;switch(u.length){case 1:if(u[0]===1)return ut(f[0]);throw new RangeError("Matrix must be square (size: "+ct(u)+")");case 2:{var c=u[0],h=u[1];if(c===h){for(var d=0,p=0;p<c;p++)d=r(d,f[p][p]);return d}else throw new RangeError("Matrix must be square (size: "+ct(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ct(u)+")")}}function i(a){var u=a._values,f=a._index,c=a._ptr,h=a._size,d=h[0],p=h[1];if(d===p){var v=0;if(u.length>0)for(var x=0;x<p;x++)for(var _=c[x],y=c[x+1],m=_;m<y;m++){var w=f[m];if(w===x){v=r(v,u[m]);break}if(w>x)break}return v}throw new RangeError("Matrix must be square (size: "+ct(h)+")")}}),of="det",ux=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],lx=xe(of,ux,s=>{var{typed:e,matrix:t,subtractScalar:r,multiply:n,divideScalar:i,isZero:a,unaryMinus:u}=s;return e(of,{any:function(h){return ut(h)},"Array | Matrix":function(h){var d;switch(mt(h)?d=h.size():Array.isArray(h)?(h=t(h),d=h.size()):d=[],d.length){case 0:return ut(h);case 1:if(d[0]===1)return ut(h.valueOf()[0]);if(d[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+ct(d)+")");case 2:{var p=d[0],v=d[1];if(p===v)return f(h.clone().valueOf(),p);if(v===0)return 1;throw new RangeError("Matrix must be square (size: "+ct(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ct(d)+")")}}});function f(c,h,d){if(h===1)return ut(c[0][0]);if(h===2)return r(n(c[0][0],c[1][1]),n(c[1][0],c[0][1]));for(var p=!1,v=new Array(h).fill(0).map((B,M)=>M),x=0;x<h;x++){var _=v[x];if(a(c[_][x])){var y=void 0;for(y=x+1;y<h;y++)if(!a(c[v[y]][x])){_=v[y],v[y]=v[x],v[x]=_,p=!p;break}if(y===h)return c[_][x]}for(var m=c[_][x],w=x===0?1:c[v[x-1]][x-1],D=x+1;D<h;D++)for(var C=v[D],b=x+1;b<h;b++)c[C][b]=i(r(n(c[C][b],m),n(c[C][x],c[_][b])),w)}var F=c[v[h-1]][h-1];return p?u(F):F}}),af="inv",cx=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],fx=xe(af,cx,s=>{var{typed:e,matrix:t,divideScalar:r,addScalar:n,multiply:i,unaryMinus:a,det:u,identity:f,abs:c}=s;return e(af,{"Array | Matrix":function(p){var v=mt(p)?p.size():Lt(p);switch(v.length){case 1:if(v[0]===1)return mt(p)?t([r(1,p.valueOf()[0])]):[r(1,p[0])];throw new RangeError("Matrix must be square (size: "+ct(v)+")");case 2:{var x=v[0],_=v[1];if(x===_)return mt(p)?t(h(p.valueOf(),x,_),p.storage()):h(p,x,_);throw new RangeError("Matrix must be square (size: "+ct(v)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ct(v)+")")}},any:function(p){return r(1,p)}});function h(d,p,v){var x,_,y,m,w;if(p===1){if(m=d[0][0],m===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,m)]]}else if(p===2){var D=u(d);if(D===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(d[1][1],D),r(a(d[0][1]),D)],[r(a(d[1][0]),D),r(d[0][0],D)]]}else{var C=d.concat();for(x=0;x<p;x++)C[x]=C[x].concat();for(var b=f(p).valueOf(),F=0;F<v;F++){var B=c(C[F][F]),M=F;for(x=F+1;x<p;)c(C[x][F])>B&&(B=c(C[x][F]),M=x),x++;if(B===0)throw Error("Cannot calculate inverse, determinant is zero");x=M,x!==F&&(w=C[F],C[F]=C[x],C[x]=w,w=b[F],b[F]=b[x],b[x]=w);var O=C[F],A=b[F];for(x=0;x<p;x++){var N=C[x],I=b[x];if(x!==F){if(N[F]!==0){for(y=r(a(N[F]),O[F]),_=F;_<v;_++)N[_]=n(N[_],i(y,O[_]));for(_=0;_<v;_++)I[_]=n(I[_],i(y,A[_]))}}else{for(y=O[F],_=F;_<v;_++)N[_]=r(N[_],y);for(_=0;_<v;_++)I[_]=r(I[_],y)}}}return b}}}),uf="pinv",hx=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],dx=xe(uf,hx,s=>{var{typed:e,matrix:t,inv:r,deepEqual:n,equal:i,dotDivide:a,dot:u,ctranspose:f,divideScalar:c,multiply:h,add:d,Complex:p}=s;return e(uf,{"Array | Matrix":function(D){var C=mt(D)?D.size():Lt(D);switch(C.length){case 1:return m(D)?f(D):C[0]===1?r(D):a(f(D),u(D,D));case 2:{if(m(D))return f(D);var b=C[0],F=C[1];if(b===F)try{return r(D)}catch(B){if(!(B instanceof Error&&B.message.match(/Cannot calculate inverse, determinant is zero/)))throw B}return mt(D)?t(v(D.valueOf(),b,F),D.storage()):v(D,b,F)}default:throw new RangeError("Matrix must be two dimensional (size: "+ct(C)+")")}},any:function(D){return i(D,0)?ut(D):c(1,D)}});function v(w,D,C){var{C:b,F}=_(w,D,C),B=h(r(h(f(b),b)),f(b)),M=h(f(F),r(h(F,f(F))));return h(M,B)}function x(w,D,C){for(var b=ut(w),F=0,B=0;B<D;B++){if(C<=F)return b;for(var M=B;y(b[M][F]);)if(M++,D===M&&(M=B,F++,C===F))return b;[b[M],b[B]]=[b[B],b[M]];for(var O=b[B][F],A=0;A<C;A++)b[B][A]=a(b[B][A],O);for(var N=0;N<D;N++)if(N!==B){O=b[N][F];for(var I=0;I<C;I++)b[N][I]=d(b[N][I],h(-1,h(O,b[B][I])))}F++}return b}function _(w,D,C){var b=x(w,D,C),F=w.map((M,O)=>M.filter((A,N)=>N<D&&!y(u(b[N],b[N])))),B=b.filter((M,O)=>!y(u(b[O],b[O])));return{C:F,F:B}}function y(w){return i(d(w,p(1,1)),d(0,p(1,1)))}function m(w){return n(d(w,p(1,1)),d(h(w,0),p(1,1)))}}),px="divide",_x=["typed","matrix","multiply","equalScalar","divideScalar","inv"],vx=xe(px,_x,s=>{var{typed:e,matrix:t,multiply:r,equalScalar:n,divideScalar:i,inv:a}=s,u=Ha({typed:e,equalScalar:n}),f=ja({typed:e});return e("divide",Fl({"Array | Matrix, Array | Matrix":function(h,d){return r(h,a(d))},"DenseMatrix, any":function(h,d){return f(h,d,i,!1)},"SparseMatrix, any":function(h,d){return u(h,d,i,!1)},"Array, any":function(h,d){return f(t(h),d,i,!1).valueOf()},"any, Array | Matrix":function(h,d){return r(h,a(d))}},i.signatures))}),lf="sum",gx=["typed","config","add","numeric"],mx=xe(lf,gx,s=>{var{typed:e,config:t,add:r,numeric:n}=s;return e(lf,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(f){if(ro(f))throw new TypeError("Scalar values expected in function sum");return i(f)}});function i(u){var f;return as(u,function(c){try{f=f===void 0?c:r(f,c)}catch(h){throw Ln(h,"sum",c)}}),f===void 0&&(f=n(0,t.number)),typeof f=="string"&&(f=n(f,t.number)),f}function a(u,f){try{var c=Wa(u,f,r);return c}catch(h){throw Ln(h,"sum")}}}),cf="median",xx=["typed","add","divide","compare","partitionSelect"],yx=xe(cf,xx,s=>{var{typed:e,add:t,divide:r,compare:n,partitionSelect:i}=s;function a(c){try{c=Ta(c.valueOf());var h=c.length;if(h===0)throw new Error("Cannot calculate median of an empty array");if(h%2===0){for(var d=h/2-1,p=i(c,d+1),v=c[d],x=0;x<d;++x)n(c[x],v)>0&&(v=c[x]);return f(v,p)}else{var _=i(c,(h-1)/2);return u(_)}}catch(y){throw Ln(y,"median")}}var u=e({"number | BigNumber | Complex | Unit":function(h){return h}}),f=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(h,d){return r(t(h,d),2)}});return e(cf,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(h,d){throw new Error("median(A, dim) is not yet supported")},"...":function(h){if(ro(h))throw new TypeError("Scalar values expected in function median");return a(h)}})}),Dx={},wx=Object.freeze({__proto__:null,default:Dx}),bx=Mt(wx),po=Dv({config:Er}),Ya=Av({}),Za=Mv({}),Va=Ov({}),cn=$v({Matrix:Va}),Te=E_({BigNumber:po,Complex:Ya,DenseMatrix:cn,Fraction:Za}),Ex=dg({typed:Te}),_o=_g({typed:Te}),Ax=ig({BigNumber:po,typed:Te}),ff=rm({typed:Te}),Pn=Zv({config:Er,typed:Te}),vo=Pv({typed:Te}),Cx=Uv({typed:Te}),go=Vg({typed:Te}),hf=tg({typed:Te}),Ga=Kv({Matrix:Va,equalScalar:Pn,typed:Te}),df=gg({typed:Te}),pf=Hv({typed:Te}),Ka=fg({typed:Te}),_f=ag({Fraction:Za,typed:Te}),vf=zv({typed:Te}),Pt=lg({DenseMatrix:cn,Matrix:Va,SparseMatrix:Ga,typed:Te}),gf=bm({isNaN:pf,isNumeric:vf,typed:Te}),us=Bm({bignumber:Ax,fraction:_f,number:hf}),Fx=Am({config:Er,multiplyScalar:go,numeric:us,typed:Te}),Bx=_m({isInteger:vo,matrix:Pt,typed:Te}),mf=gm({matrix:Pt,config:Er,typed:Te}),xf=xm({matrix:Pt,typed:Te}),ni=im({isInteger:vo,matrix:Pt,typed:Te}),Mx=om({prod:Fx,size:mf,typed:Te}),Nx=Dm({conj:ff,transpose:xf,typed:Te}),ls=Nm({numeric:us,typed:Te}),Sx=Tm({DenseMatrix:cn,concat:ni,divideScalar:ls,equalScalar:Pn,matrix:Pt,typed:Te}),yf=km({DenseMatrix:cn,concat:ni,equalScalar:Pn,matrix:Pt,typed:Te}),Df=um({BigNumber:po,DenseMatrix:cn,SparseMatrix:Ga,config:Er,matrix:Pt,typed:Te}),Ox=cm({matrix:Pt,multiplyScalar:go,typed:Te}),Ix=Um({DenseMatrix:cn,concat:ni,config:Er,matrix:Pt,typed:Te}),Tx=Qg({DenseMatrix:cn,concat:ni,equalScalar:Pn,matrix:Pt,subtractScalar:df,typed:Te,unaryMinus:Ka}),cs=rx({DenseMatrix:cn,SparseMatrix:Ga,addScalar:_o,concat:ni,equalScalar:Pn,matrix:Pt,typed:Te}),wf=Rm({BigNumber:po,DenseMatrix:cn,Fraction:Za,concat:ni,config:Er,equalScalar:Pn,matrix:Pt,typed:Te}),$x=Vm({equal:yf,typed:Te}),bf=ix({addScalar:_o,conj:ff,multiplyScalar:go,size:mf,typed:Te}),Rx=jm({DenseMatrix:cn,concat:ni,config:Er,matrix:Pt,typed:Te}),Xa=ex({config:Er,numeric:us,smaller:Ix,typed:Te}),Bi=Kg({addScalar:_o,dot:bf,equalScalar:Pn,matrix:Pt,multiplyScalar:go,typed:Te}),Lx=Km({compare:wf,isNaN:pf,isNumeric:vf,typed:Te}),Px=mx({add:cs,config:Er,numeric:us,typed:Te}),kx=ax({add:cs,matrix:Pt,typed:Te}),Ef=lx({divideScalar:ls,isZero:Cx,matrix:Pt,multiply:Bi,subtractScalar:df,typed:Te,unaryMinus:Ka}),zx=Qm({config:Er,larger:Rx,numeric:us,typed:Te}),mo=fx({abs:Ex,addScalar:_o,det:Ef,divideScalar:ls,identity:Df,matrix:Pt,multiply:Bi,typed:Te,unaryMinus:Ka}),qx=dx({Complex:Ya,add:cs,ctranspose:Nx,deepEqual:$x,divideScalar:ls,dot:bf,dotDivide:Sx,equal:yf,inv:mo,matrix:Pt,multiply:Bi,typed:Te}),Ux=Om({Complex:Ya,config:Er,fraction:_f,identity:Df,inv:mo,matrix:Pt,multiply:Bi,number:hf,typed:Te}),Wx=vx({divideScalar:ls,equalScalar:Pn,inv:mo,matrix:Pt,multiply:Bi,typed:Te}),Af=yx({add:cs,compare:wf,divide:Wx,partitionSelect:Lx,typed:Te});class Hx{constructor(e,t,r){U(this,"_cacheData");U(this,"_variables");U(this,"_math");U(this,"_timeframe");this._cacheData={},this._variables=e,this._math=t,this._timeframe=r}alma({series:e,length:t,offset:r,sigma:n,floor:i},a){if(t===void 0||r===void 0||n===void 0)return;const u=this._cacheDataList(e,t,`alma_${a}`);if(u===void 0)return;let f=r*(t-1);i&&(f=Math.floor(f));const c=t/n;let h=0,d=0;for(let p=0;p<=t-1;p++){const v=Math.exp(-1*Math.pow(p-f,2)/(2*Math.pow(c,2)));h+=v,d+=u[u.length-1-(t-p-1)]*v}return d/h}sma({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;let n=0;const i=this._cacheDataList(e,t,`sma_${r}`);if(i===void 0)return;const a=i.slice(-t);return n=Px(...a)/t,n}rma({source:e,length:t},r){if(e===void 0||t===void 0||isNaN(e))return;const n=this._cacheData[`sma_${r}`]||[];n[this._variables.bar_index]=e,this._cacheData[`sma_${r}`]=n;const{sum:i}=this._cacheData[`rma_${r}`]||{},a=1/t,u=i===void 0?this.sma({source:e,length:t},r):a*e+(1-a)*(i||0);return this._cacheDataHandle(`rma_${r}`,{sum:u}),u}atr({length:e},t){const{high:r,close:n}=this._cacheData[`atr_${t}`]||{},{high:i,close:a,low:u}=this._variables,f=r===void 0?i-u:Math.max(Math.max(i-u,Math.abs(i-n)),Math.abs(u-n));return this._cacheDataHandle(`atr_${t}`,{high:i,close:a}),this.rma({source:f,length:e},t)}barssince({condition:e},t){let{count:r}=this._cacheData[`barssince_${t}`]||{};if(e)r=0;else{if(r===void 0)return;r+=1}return this._cacheDataHandle(`barssince_${t}`,{count:r}),r}stdev({source:e,length:t,biased:r=!0},n){if(e===void 0||isNaN(e)||t===void 0)return;const i=this._cacheDataList(e,t,`stdev_${n}`),a=this.sma({source:e,length:t},n);if(i===void 0)return;let u=0;for(let f=0;f<t;f++){const c=this._sum(i[i.length-1-f],-(a||0));u+=c*c}return r||t<=1?Math.sqrt(u/t):Math.sqrt(u/(t-1))}_sum(e,t){let n=e+t;return Math.abs(n)<=1e-10&&(n=0),n}bb({series:e,length:t,mult:r},n){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return[];const i=this.sma({source:e,length:t},n),a=this.stdev({source:e,length:t},n);if(i===void 0||a===void 0)return[];const u=r*a;return[i,i+u,i-u]}bbw({series:e,length:t,mult:r},n){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return;const i=this.sma({source:e,length:t},n),a=this.stdev({source:e,length:t},n);if(i===void 0||a===void 0)return;const u=r*a;return(i+u-(i-u))/i}cci({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this.sma({source:e,length:t},r),i=this.dev({source:e,length:t},r);if(!(n===void 0||i===void 0))return(e-n)/(.015*i)}change({source:e,length:t=1},r){const n=this._cacheData[`change_${r}`]||[];n[this._variables.bar_index]=e,this._cacheData[`change_${r}`]=n;const i=n[n.length-1-t];if(!(e===void 0||isNaN(e)))return i===void 0?i:typeof e=="boolean"?i!==e:e-i}cmo({series:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this.change({source:e},r);if(n===void 0)return;const i=this._math.sum({source:n>=0?n:0,length:t},`sm1_${r}`),a=this._math.sum({source:n>=0?0:-n,length:t},`sm2_${r}`);if(!(i===void 0||a===void 0))return 100*(i-a)/(i+a)}cog({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this._cacheDataList(e,t,`cog_${r}`),i=this._math.sum({source:e,length:t},r);if(i===void 0||n===void 0)return;let a=0;for(let u=0;u<t;u++){const f=n[n.length-1-u];a+=f*(u+1)}return-a/i}correlation({source1:e,source2:t,length:r},n){if(e===void 0||isNaN(e)||t===void 0||isNaN(t)||r===void 0)return;const i=this._cacheDataList([e,t],r,`correlation_${n}`),a=this.sma({source:e,length:r},`sma1_${n}`),u=this.sma({source:t,length:r},`sma2_${n}`);if(a===void 0||u===void 0||i===void 0)return;let f=0,c=0,h=0;for(let p=0;p<r;p++){const[v,x]=i[i.length-1-p],_=v-a,y=x-u;f+=_*y,c+=_*_,h+=y*y}return isNaN(c)||isNaN(f)||isNaN(h)?void 0:f/Math.sqrt(c*h)}cross({source1:e,source2:t},r){if(e===void 0||t===void 0)return!1;const{source1:n,source2:i}=this._cacheData[`cross_${r}`]||{};return this._cacheDataHandle(`cross_${r}`,{source1:e,source2:t}),n===void 0||i===void 0?!1:n>=i&&e<t||n<=i&&e>t}crossover({source1:e,source2:t},r){if(e===void 0||t===void 0)return!1;const{source1:n,source2:i}=this._cacheData[`crossover_${r}`]||{};return this._cacheDataHandle(`crossover_${r}`,{source1:e,source2:t}),n===void 0||i===void 0?!1:n<=i&&e>t}crossunder({source1:e,source2:t},r){if(e===void 0||t===void 0)return!1;const{source1:n,source2:i}=this._cacheData[`crossunder_${r}`]||{};return this._cacheDataHandle(`crossunder_${r}`,{source1:e,source2:t}),n===void 0||i===void 0?!1:n>=i&&e<t}cum({source:e=0},t){e=isNaN(e)?0:e;let{sum:r}=this._cacheData[`cum_${t}`]||{};return r=r||0,r+=e,this._cacheDataHandle(`cum_${t}`,{sum:r}),r}dev({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this.sma({source:e,length:t},r);let i=0;const a=this._cacheDataList(e,t,`dev_${r}`);if(!(!a||n===void 0)){for(let u=0;u<t;u++){const f=a[a.length-1-u];i+=Math.abs(f-n)}return i/t}}dmi({diLength:e,adxSmoothing:t},r){if(e===void 0||t===void 0)return[void 0,void 0,void 0];const n=`dmi_${r}`,{low:i,high:a,close:u,PDMS:f,NDMS:c,TRS:h,ADX:d,count:p=0}=this._cacheData[n]||{},{low:v,high:x,close:_}=this._variables;if(i===void 0||a===void 0||u===void 0)return this._cacheData[n]={low:v,high:x,close:_,PDMS:f,NDMS:c,TRS:x-v,count:1},[void 0,void 0,void 0];let y=x-a,m=i-v;y=y>m&&y>0?y:0,m=m>y&&m>0?m:0,y===m&&(y=m=0);const w=Math.max(x-v,Math.abs(x-u),Math.abs(v-u));if(p<e)return this._cacheDataHandle(n,{low:v,high:x,close:_,PDMS:(f||0)+y,NDMS:(c||0)+m,TRS:(h||0)+w,count:p+1}),[void 0,void 0,void 0];{const D=f-f/e+y,C=c-c/e+m,b=h-h/e+w,F=D/b*100,B=C/b*100,M=Math.abs((F-B)/(F+B))*100;let O=M,A=[F,B,void 0];if(p+1-e<t){const N=p+1-e;O=((d||0)*(N-1)+M)/N}else O=(d*(t-1)+M)/t,A=[F,B,O];return this._cacheDataHandle(n,{low:v,high:x,close:_,PDMS:D,NDMS:C,TRS:b,ADX:O,count:p+1}),A}}ema({source:e,length:t},r){if(e===void 0||t===void 0||isNaN(e))return;let{sum:n,count:i=1}=this._cacheData[`ema_${r}`]||{};const a=this.sma({source:e,length:t},r);if(i>t){const u=2/(t+1);n=n===void 0?e:u*e+(1-u)*(n||0)}else n=a;return i+=1,this._cacheDataHandle(`ema_${r}`,{sum:n,count:i}),n}falling({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return!1;const{source:n,fallings:i=[]}=this._cacheData[`falling_${r}`]||{};i.push(n>e);const a=i.slice(-t);return this._cacheDataHandle(`falling_${r}`,{source:e,fallings:a}),a.length<t?!1:a.every(u=>u)}rising({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return!1;const{source:n,risings:i=[]}=this._cacheData[`rising_${r}`]||{};i.push(n<e);const a=i.slice(-t);return this._cacheDataHandle(`rising_${r}`,{source:e,risings:a}),a.length<t?!1:a.every(u=>u)}highest({source:e,length:t},r){if(t===void 0||t<=0)return;const n=this._cacheData[`highest_${r}`]||[],{high:i,bar_index:a}=this._variables;typeof e!="number"?n[a]=i:n[a]=e,this._cacheData[`highest_${r}`]=n;const u=n.filter(()=>!0);if(!(u.length<t))return Math.max(...u.slice(-t))}highestbars({source:e,length:t},r){if(t===void 0||t<=0)return;const n=this._cacheData[`highestbars_${r}`]||[],{high:i,bar_index:a}=this._variables;typeof e!="number"?n[a]=i:n[a]=e,this._cacheData[`highestbars_${r}`]=n;const u=n.filter(()=>!0);return u.length<t?void 0:u.slice(-t).reduce((c,h,d,p)=>h>=p[c]?d:c,0)-t+1}wma({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this._cacheDataList(e,t,`wma_${r}`);if(!n)return;let i=0,a=0;for(let u=0;u<t;u++){const f=(t-u)*t;i+=f,a+=n[n.length-1-u]*f}return a/i}hma({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this.wma({source:e,length:t},r),i=this.wma({source:e,length:Math.round(t/2)},r);return n===void 0||i===void 0?void 0:this.wma({source:2*i-n,length:Math.floor(Math.sqrt(t))},`hma_${r}`)}kc({series:e,length:t,mult:r,useTrueRange:n=!0},i){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return[void 0,void 0,void 0];const a=this.ema({source:e,length:t},i),{ta:u,high:f,low:c}=this._variables,h=n?u.tr:f-c,d=this.ema({source:h,length:t},`range_${i}`);return[a,a+d*r,a-d*r]}kcw({series:e,length:t,mult:r,useTrueRange:n=!0},i){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return;const a=this.ema({source:e,length:t},i),{ta:u,high:f,low:c}=this._variables,h=n?u.tr:f-c,d=this.ema({source:h,length:t},`range_${i}`);return(a+d*r-(a-d*r))/a}linreg({source:e,length:t,offset:r},n){if(t===void 0||r===void 0)return;const i=this._cacheDataList(e,t,`dev_${n}`);if(!i)return;const a=i.slice(-t).filter(v=>v!==void 0);let u=0,f=0,c=0,h=0;for(const[v,x]of a.entries())u+=v,f+=x,c+=v*x,h+=v*v;const d=(t*c-u*f)/(t*h-u*u);return(f-d*u)/t+d*(t-1-r)}lowest({source:e,length:t},r){if(t===void 0||t<=0)return;const n=this._cacheData[`lowest_${r}`]||[],{low:i,bar_index:a}=this._variables;typeof e!="number"?n[a]=i:n[a]=e,this._cacheData[`lowest_${r}`]=n;const u=n.filter(()=>!0);if(!(u.length<t))return Math.min(...u.slice(-t))}lowestbars({source:e,length:t},r){if(t===void 0||t<=0)return;const n=this._cacheData[`lowestbars_${r}`]||[],{low:i,bar_index:a}=this._variables;typeof e!="number"?n[a]=i:n[a]=e,this._cacheData[`lowestbars_${r}`]=n;const u=n.filter(()=>!0);return u.length<t?void 0:u.slice(-t).reduce((c,h,d,p)=>h<=p[c]?d:c,0)-t+1}macd({source:e,fastlen:t,slowlen:r,siglen:n},i){if(e===void 0||isNaN(e)||t===void 0||r===void 0||n===void 0)return[void 0,void 0,void 0];const a=this.ema({source:e,length:t},`ema1_${i}`),u=this.ema({source:e,length:r},`ema2_${i}`);if(a===void 0||u===void 0)return[void 0,void 0,void 0];const f=a-u,c=this.ema({source:f,length:n},`macd_${i}`);if(c===void 0)return[f,c,void 0];const h=f-c;return[f,c,h]}max({source:e},t){if(e===void 0||isNaN(e))return;let r=this._cacheData[`max_${t}`]||0;return e>r&&(r=e),this._cacheData[`max_${t}`]=r,r}min({source:e},t){if(e===void 0||isNaN(e))return;let r=this._cacheData[`min_${t}`]||1/0;return e<r&&(r=e),this._cacheData[`min_${t}`]=r,r}median({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this._cacheDataList(e,t,`dev_${r}`);if(n)return Af(n.slice(-t))}mfi({series:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const{volume:n}=this._variables,i=this.change({source:e},r),a=this._math.sum({source:n*(i>=0?0:e),length:t},`lower_${r}`),u=this._math.sum({source:n*(i<=0?0:e),length:t},`upper_${r}`);if(!(u===void 0||a===void 0))return 100-100/(1+u/a)}mode({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this._cacheDataList(e,t,`mode_${r}`);if(n)return Xa(gf(n.slice(-t)))}mom({source:e,length:t},r){if(t===void 0||t<0)return;const n=`mom_${r}`,i=this._cacheData[n]||[];if(i[this._variables.bar_index]=e,this._cacheData[n]=i,i.length<=t||e===void 0||isNaN(e))return;let a=i.length-t-1,u;for(;u===void 0&&a>=0;)u=i[a],a--;return u===void 0?u:e-u}percentile_linear_interpolation({source:e,length:t,percentage:r},n){if(t===void 0||r===void 0||t<0||r<0||r>100)return;const i=this._cacheDataList(e,t+1,`percentile_linear_interpolation_${n}`);if(!i)return;const a=this._sort(i.slice(-(t+1))),u=a.length;r/=100;const f=1/(u*2);if(r<=f)return a[0];if(r>=1-1/(u*2))return a[u-1];for(const[c,h]of a.entries()){const d=a[c-1];if(r<(c+.5)/u)return d===void 0||h===void 0?void 0:d+(h-d)*(r-(c-.5)/u)/(1/u)}}percentile_nearest_rank({source:e,length:t,percentage:r},n){if(t===void 0||r===void 0||e===void 0||isNaN(e)||t<0||r<0||r>100)return;const i=this._cacheDataList(e,t,`percentile_nearest_rank_${n}`);if(!i)return;const a=this._sort(i.slice(-t)),u=r/100*a.length,f=Math.ceil(u)-1;return a[f>=a.length?a.length-1:f]}percentrank({source:e,length:t},r){if(t===void 0||t<0)return;const n=this._cacheDataList(e,t+1,`percentile_nearest_rank_${r}`);if(!n)return;const i=n.slice(-(t+1)),a=e;if(a===void 0)return;let u=0;for(let f=0;f<i.length;f++)i[f]!==void 0&&(i[f]<a||i[f]===a&&f<t)&&u++;return u/(i.length-1)*100}pivot_point_levels({type:e,anchor:t,developing:r},n){const i=new it;let{close:a,open:u,low:f,high:c}=this._variables;const h=`pivot_point_levels_${n}`,{close:d,low:p,high:v,open:x,result:_}=this._cacheData[h]||{};if(!t&&(v&&p&&(c=Math.max(v,c),f=Math.min(p,f)),this._cacheDataHandle(h,{close:a,open:u,low:f,high:c,result:_}),!r))return i._value=_||[],i;const y={close:a,open:u,low:f,high:c};t===!0&&!r&&(a=d,u=x,f=p,c=v);const m=this._getPivotPointLevels(c,f,a,u,r,e);return this._cacheDataHandle(h,{...y,result:m}),i._value=m,i}_getPivotPointLevels(e,t,r,n,i,a){if(r===void 0||n===void 0||t===void 0||e===void 0)return[];switch(a){case ei.traditional:return this._traditional(e,t,r);case ei.fibonacci:return this._fibonacci(e,t,r);case ei.woodie:return i?[]:this._woodie(e,t);case ei.classic:return this._classic(e,t,r);case ei.dm:return this._DM(e,t,r,n);case ei.camarilla:return this._camarilla(e,t,r);default:return[]}}_traditional(e,t,r){const n=(e+t+r)/3,i=n*2-t,a=n+(e-t),u=n*2+(e-2*t),f=n*3+(e-3*t),c=n*4+(e-4*t),h=n*2-e,d=n-(e-t),p=n*2-(2*e-t),v=n*3-(3*e-t),x=n*4-(4*e-t);return[n,i,h,a,d,u,p,f,v,c,x]}_fibonacci(e,t,r){const n=(e+t+r)/3,i=n+.382*(e-t),a=n-.382*(e-t),u=n+.618*(e-t),f=n-.618*(e-t),c=n+(e-t),h=n-(e-t);return[n,i,a,u,f,c,h]}_woodie(e,t){const{open:r}=this._variables,n=(e+t+2*r)/4,i=2*n-t,a=2*n-e,u=n+(e-t),f=n-(e-t),c=e+2*(n-t),h=t-2*(e-n),d=c+(e-t),p=h-(e-t);return[n,i,a,u,f,c,h,d,p]}_classic(e,t,r){const n=(e+t+r)/3,i=2*n-t,a=2*n-e,u=n+(e-t),f=n-(e-t),c=n+2*(e-t),h=n-2*(e-t),d=n+3*(e-t),p=n-3*(e-t);return[n,i,a,u,f,c,h,d,p]}_DM(e,t,r,n){let i;n===r?i=e+t+2*r:r>n?i=2*e+t+r:i=2*t+e+r;const a=i/4,u=i/2-t,f=i/2-e;return[a,u,f]}_camarilla(e,t,r){const n=(e+t+r)/3,i=r+1.1*(e-t)/12,a=r-1.1*(e-t)/12,u=r+1.1*(e-t)/6,f=r-1.1*(e-t)/6,c=r+1.1*(e-t)/4,h=r-1.1*(e-t)/4,d=r+1.1*(e-t)/2,p=r-1.1*(e-t)/2,v=e/t*r,x=r-(v-r);return[n,i,a,u,f,c,h,d,p,v,x]}pivothigh({source:e=this._variables.high,leftbars:t,rightbars:r},n){if(t===void 0||r===void 0||t<0||r<0)return;const i=this._cacheDataList(e,t+r+1,`pivothigh_${n}`);if(!i)return;const a=i.slice(-(t+r+1)),u=a[t];return Math.max(...a)===u?u:void 0}pivotlow({source:e=this._variables.low,leftbars:t,rightbars:r},n){if(t===void 0||r===void 0||t<0||r<0)return;const i=this._cacheDataList(e,t+r+1,`pivotlow_${n}`);if(!i)return;const a=i.slice(-(t+r+1)),u=a[t];return Math.min(...a)===u?u:void 0}range({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<0)return;const n=this._cacheDataList(e,t,`range_${r}`);if(!n)return;const i=n.filter(f=>f!==void 0).slice(-t),a=Math.max(...i),u=Math.min(...i);return a-u}roc({source:e,length:t},r){if(t===void 0||t<0)return;const n=this._cacheDataList(e,t+1,`roc_${r}`),i=this.change({source:e,length:t},r);if(n)return 100*i/n[n.length-1-t]}rsi({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<0)return;const{source:n}=this._cacheData[`rsi_${r}`]||{},i=Math.max(e-n,0),a=Math.max(n-e,0),u=this.rma({source:i,length:t},`rma1_${r}`),f=this.rma({source:a,length:t},`rma2_${r}`);if(this._cacheDataHandle(`rsi_${r}`,{source:e}),!(u===void 0||f===void 0))return 100-100/(1+u/f)}sar({start:e,inc:t,max:r},n){if(e===void 0||t===void 0||r===void 0)return;const{close:i,low:a,high:u,preLow:f,preHigh:c,data:h={}}=this._cacheData[`sar_${n}`]||{};let{result:d,maxMin:p,acceleration:v,isBelow:x}=h,_=!1;const{close:y,low:m,high:w,bar_index:D}=this._variables;return D===1&&(y>i?(x=!0,p=w,d=a):(x=!1,p=m,d=u),_=!0,v=e),d=d+v*(p-d),x?d>m&&(_=!0,x=!1,d=Math.max(w,p||0),p=m,v=e):d<w&&(_=!0,x=!0,d=Math.min(m,p||0),p=w,v=e),_||(x?w>(p||0)&&(p=w,v=Math.min((v||0)+t,r)):m<(p||0)&&(p=m,v=Math.min((v||0)+t,r))),x?(d=Math.min(d,a),D>1&&(d=Math.min(d,f))):(d=Math.max(d,u),D>1&&(d=Math.max(d,c))),this._cacheDataHandle(`sar_${n}`,{high:w,close:y,low:m,preLow:a,preHigh:u,data:Object.assign(h,{result:d,maxMin:p,acceleration:v,isBelow:x})}),d}stoch({source:e,high:t,low:r,length:n},i){if(n===void 0||t===void 0||r===void 0||e===void 0||isNaN(e)||n<0)return;const a=this.lowest({source:r,length:n},i),u=this.highest({source:t,length:n},i);if(!(a===void 0||u===void 0))return 100*(this._variables.close-a)/(u-a)}supertrend({factor:e,atrPeriod:t},r){if(e===void 0||t===void 0)return[void 0,void 0];const{hl2:n,close:i}=this._variables,a=`supertrend_${r}`,{upperBand:u,lowerBand:f,superTrend:c,atr:h,close:d}=this._cacheData[a]||{},p=this.atr({length:t},r);if(p===void 0)return this._cacheDataHandle(a,{close:i}),[void 0,void 0];let v=n+e*p,x=n-e*p;const _=u||0,y=f||0;x=x>y||d<y?x:y,v=v<_||d>_?v:_;let m;h===void 0?m=1:c===_?m=i>v?-1:1:m=i<x?1:-1;const w=m===-1?x:v;return this._cacheDataHandle(a,{upperBand:v,lowerBand:x,superTrend:w,atr:p,close:i}),[w,m]}swma({source:e},t){let{list:r}=this._cacheData[`swma_${t}`]||{};if(r||(r=[]),r.push(e),r=r.slice(-4),this._cacheDataHandle(`swma_${t}`,{list:r}),!(r.filter(n=>n!==void 0).length<4))return r[3]*1/6+r[2]*2/6+r[1]*2/6+r[0]*1/6}tr({handle_na:e=!1},t){const{close:r,low:n,high:i}=this._variables,{close:a}=this._cacheData[`tr_${t}`]||{};return this._cacheDataHandle(`tr_${t}`,{close:r}),a===void 0?e?i-n:void 0:Math.max(i-n,Math.abs(i-a),Math.abs(n-a))}tsi({source:e,short_length:t,long_length:r},n){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return;const i=this.change({source:e},n);if(i===void 0)return;const a=this.ema({source:Math.abs(i),length:t},`absema1_${n}`),u=this.ema({source:i,length:t},`ema1_${n}`);if(u===void 0)return;const f=this.ema({source:u,length:r},`ema2_${n}`),c=this.ema({source:a,length:t},`absema2_${n}`);if(f!==void 0)return f/c}valuewhen({condition:e,source:t,occurrence:r},n){if(t===void 0||r===void 0||r<0)return;let{list:i}=this._cacheData[`valuewhen_${n}`]||{};return i||(i=[]),e&&i.push(t),this._cacheDataHandle(`valuewhen_${n}`,{list:i}),i[i.length-1-r]}variance({source:e,length:t,biased:r=!0},n){if(e===void 0||isNaN(e)||t===void 0||t<0)return;const i=this.sma({source:e,length:t},n),a=this._cacheDataList(e,t,`mode_${n}`);if(!a||i===void 0)return;const u=a.filter(c=>c!==void 0&&!isNaN(c)).slice(-t);if(u.length<t)return;const f=u.reduce((c,h)=>c+Math.pow(h-i,2),0);if(f!==void 0)return r||t<=1?f/t:f/(t-1)}vwap({source:e,anchor:t,stdev_mult:r},n){if(e===void 0)return;t=t===void 0?this._timeframe.change({timeframe:"1D"},n):t;const{volume:i}=this._variables;let{sum:a=0,sumV:u=0,count:f=0,isReset:c,sumS:h=0}=this._cacheData[`vwap_${n}`]||{};if(t&&(a=u=f=h=0,c=!0),!c)return r!==void 0?[]:void 0;const d=e*i+a,p=i+u,v=d/p;return f++,r!==void 0?(h=i*Math.pow(e,2)+h,this._cacheDataHandle(`vwap_${n}`,{sum:d,sumV:p,count:f,isReset:c,sumS:h}),this._computeBands(h,p,r,v)):(this._cacheDataHandle(`vwap_${n}`,{sum:d,sumV:p,count:f,isReset:c}),v)}_computeBands(e,t,r,n){let i=e/t-Math.pow(n,2);i=i<0?0:i;const a=Math.sqrt(i),u=a!==void 0&&!isNaN(a)?n+r*a:void 0,f=a!==void 0&&!isNaN(a)?n-r*a:void 0;return[n,u,f]}vwma({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0||t<=0)return;const{volume:n}=this._variables,i=this.sma({source:e*n,length:t},`sma1_${r}`),a=this.sma({source:n,length:t},`sma2_${r}`);if(!(i===void 0||a===void 0))return i/a}wpr({length:e},t){if(e===void 0||e<=0)return;const r=this.highest({length:e},t),n=this.lowest({length:e},t),{close:i}=this._variables;if(!(r===void 0||n===void 0))return(r-i)/(r-n)*-100}_sort(e){const t=e.length;for(let r=0;r<t;r++){let n={};for(let i=0;i<t-r;i++){const{currentVal:a,currentIndex:u}=n,f=e[i];if(f!==void 0){if(a!==void 0&&f<a){e.splice(i,1),e.splice(u,0,f),n={currentIndex:u+1,currentVal:a};continue}n={currentIndex:i,currentVal:f}}}}return e}_cacheDataList(e,t,r){const n=this._cacheData[r]||[];n[this._variables.bar_index]=e,this._cacheData[r]=n;const i=n.filter(()=>!0);if(!(i.length<t))return i}_cacheDataHandle(e,t){const{barIndex:r}=this._cacheData[e]||{};r!==this._variables.bar_index&&(this._cacheData[e]=Object.assign(t,{barIndex:this._variables.bar_index}))}}const Kt={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeRepeatErr:"$keyword '$name' is already defined.",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",typeFieldErr:"In a type declaration, all fields without a default value must be explicitly typified.",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an na object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function.",libraryTitleErr:"Invalid argument 'title' in 'library' call. It cannot contain spaces, special characters or begin with a digit.",exportFuncArgErr:"All exported functions args should be typified",indiRunErr:"An indicator must contain at least one of the following: any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, `alertcondition()`, or any drawing (line, label, box, table, polyline).",libraryExportErr:"A library must contain at least one exported function, method, or type.",strategyRunErr:"A strategy must contain at least one of the following: any `strategy.*()` function that creates orders, any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, or any drawing (line, label, box, table, polyline).",exportUseErr:"Only libraries can contain exported $type.",funcRepeatErr:"The '$name' function has overloads with the same parameters. The type of parameters must be different in overloaded versions of functions.",importMultipleErr:"Cannot import a library more than once",importNotExitErr:"The user '$username' does not have a published library titled '$libraryName'",importNameRepeatErr:"More than one import uses the same alias: $name. Previous usage at line: $line",exportFuncHasInputErr:"The exported function '$func' depends on the '$name' input variable, which is not allowed.",libraryTitleIsKeywordErr:"Invalid argument 'title' in 'library' call. Token: '$name' can't be used as library title.",exportFuncUseGlobalVarErr:"Cannot use global variables in exported functions. Function: $func",loopRuntimeErr:"Loop takes too long to execute (> 500 ms)",paramsErr:"Invalid value '$value' for '$param' parameter of the '$func' function. Possible values: $targetVal",displayErr:"Invalid argument 'display' in '$func' call. Possible values: $values",exportFuncUseReqErr:"Cannot use `request.*()` call in exported function `$name()`",requestExprErr:"Type series $type cannot be used in $name 'expression' argument",argDefaultErr:"The default value assigned to a parameter must be either a literal value (e.g., `5`) or a built-in variable (e.g., `close`)",overloadFuncErr:"Cannot use global variables or any values qualified as 'input' in the local scopes of overloaded functions or methods. Remove any global variables or inputs from the scopes of all '$name()' overloads.",againAssignErr:"Unable to determine the object for the field assignment. Try putting the object into a separate variable before assigning values to its fields.",requestUserInLoopErr:"Cannot use `request.*()` call within loops or conditional structures.",enumVarNameErr:"Invalid enum name '$name': `bool`, `int`, `float`, `string`, and `color` are not allowed.",enumVarNameBuiltinErr:"Invalid object name: $name. Namespaces of built-ins cannot be used.",typeNameErr:"Invalid user-defined type name '$name': `bool`, `int`, `float`, `string`, and `color` are not allowed.",enumUseErr:"Cannot use the '$name' as a value. Use one of the enum's fields instead.",conditionalErr:"'$name' conditional expression must be of a bool type!",fortoErr:'The value of the "for" loop must be a number.',indicatorUseStrategyFuncErr:"You cannot use strategy $type ($name) in indicator script."};an.SERIES,an.SIMPLE,an.INPUT,an.CONST,an.INT,an.FLOAT,an.BOOL,an.COLOR,an.STRING;const jx=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"],Yx=["case","catch","default","delete","do","finally","function","instanceof","new","return","this","throw","try","typeof","void","with"],Zx=["linefill","polyline","matrix","series","simple","string","array","color","const","float","label","table","bool","line","box","int","map","continue","for","varip","var","in","export","import","method","switch","break","while","else","type","and","for","not","as","by","if","in","or","to"];class Vx{constructor(e,t,r){U(this,"_cacheData");U(this,"_variables");U(this,"_errorListener");U(this,"_historyInputs");U(this,"_name");this._cacheData={},this._variables=e,this._errorListener=t,this._name=`inputs_${r}`,this._historyInputs=self.workerStorage.get(this._name)||{}}update(e){for(const t of e){const r=t.id;this._cacheData[r]=Object.assign(this._cacheData[r]||{},{...t,isModify:!0}),self.workerStorage.updateValue(this._name,`in_${t.index}`,{modifyDefval:t.sourceTypeName||t.defval})}}input(e,t){return this._cacheHandle(e,t)}int(e,t){return this._cacheHandle(e,t,ur.INT)}bool(e,t){return this._cacheHandle(e,t,ur.BOOL)}color(e,t){return this._cacheHandle(e,t,ur.COLOR)}time(e,t){return this._cacheHandle(e,t,ur.TIME)}float(e,t){return this._cacheHandle(e,t,ur.FLOAT)}price(e,t){return this._cacheHandle(e,t,ur.PRICE)}source(e,t){return this._cacheHandle(e,t,ur.SOURCE)}string(e,t){return this._cacheHandle(e,t,ur.STRING)}symbol(e,t){return this._cacheHandle(e,t,ur.SYMBOL)}session(e,t){return this._cacheHandle(e,t,ur.SESSION)}text_area(e,t){return this._cacheHandle(e,t,ur.TEXT_AREA)}timeframe(e,t){return this._cacheHandle(e,t,ur.TIMEFRAME)}enum(e,t){return this._cacheHandle(e,t,ur.ENUM)}_cacheHandle(e,t,r){if(t.startsWith("export"))return e.defval;const n=`${r||"input"}_${t}`,i=this._cacheData[n];if(e.defval===void 0&&this._errorListener.addError(Kt.inputDefvalErr,t,Ve.Error),i)i.isModify?i.sourceTypeName&&(this._cacheData[n].defval=this._variables[i.sourceTypeName]):Object.assign(this._cacheData[n],e);else{const{defval:a,display:u}=e;this._displayVerify(t,u),e={inputType:r,...e},this._cacheData[n]=e,this._judgeHistoryInputs(e),(r||e.inputType)===ur.SOURCE?this._cacheData[n].options=jx:e.options&&!e.options.includes(a)&&this._errorListener.addError(`input's defval should be in options, but '${a}' is not in [${e.options.toString()}]`,t,Ve.Error,6+((r==null?void 0:r.length)||-1))}return this._cacheData[n].defval}_judgeHistoryInputs(e){const{defval:t,sourceTypeName:r,index:n}=e;let i=r||t;const a=`in_${n}`,u=this._historyInputs[a];if(!u)self.workerStorage.setValue(this._name,a,{defval:i});else{const{defval:f,modifyDefval:c}=u;f===i?i=c||i:self.workerStorage.setValue(this._name,a,{defval:i})}r?e.sourceTypeName=i:e.defval=i}_displayVerify(e,t){!t||!t.length||t.includes(Zt.dataWindow)||t.includes(Zt.statusLine)||this._errorListener.addError(or(Kt.displayErr,{func:"input",values:"[display.none, display.data_window, display.status_line, display.all]"}),e,Ve.Error)}getInputs(){const e=Object.keys(this._cacheData),t=[];for(const r of e){const n=this._cacheData[r];n.id=r,t.push(n)}return t.sort((r,n)=>(r.index||0)-(n.index||0))}}class Gx{color({x:e}){return e}new({color:e,transp:t=100}){me(t)&&(t=100);const r=(100-t)/100,{r:n,g:i,b:a}=this._parseColor(e||"");return`rgba(${Math.round(n)}, ${Math.round(i)}, ${Math.round(a)}, ${r})`}rgb({red:e=0,green:t=0,blue:r=0,transp:n=0}){return me(n)&&(n=0),me(e)&&(e=0),me(t)&&(t=0),me(r)&&(r=0),`rgba(${e}, ${t}, ${r}, ${(100-n)/100})`}g({color:e}){return e?this._parseColor(e).g:0}r({color:e}){return e?this._parseColor(e).r:0}b({color:e}){return e?this._parseColor(e).b:0}t({color:e}){return e?Math.round(this._parseColor(e).a*100):0}from_gradient({value:e,bottom_value:t,top_value:r,bottom_color:n,top_color:i}){if(me(e)||me(t)||me(r))return"rgba(0,0,0,1)";const a=(e-t)/(r-t),u=Math.min(Math.max(a,0),1),{r:f,g:c,b:h,a:d}=this._parseColor(n||"rgba(0,0,0,0)"),{r:p,g:v,b:x,a:_}=this._parseColor(i||"rgba(0,0,0,0)"),y=f+u*(p-f),m=c+u*(v-c),w=h+u*(x-h),D=d+u*(_-d);return`rgba(${Math.round(y)}, ${Math.round(m)}, ${Math.round(w)}, ${D.toFixed(2)})`}_parseColor(e){let t,r,n,i;if(e.startsWith("#")){t=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),n=parseInt(e.substring(5,7),16);const a=e.substring(7);a?i=(255-parseInt(a,16))/255:i=1}else{const a=this._parserRgbColor(e);t=a[0]||0,r=a[1]||0,n=a[2]||0,i=a[3]||1}return{r:t,g:r,b:n,a:i}}_parserRgbColor(e){var t;return((t=e.match(/\d+/g))==null?void 0:t.map(Number))||[]}}var We={};const Kx=Object.prototype.toString;function fs(s){const e=Kx.call(s);return e.endsWith("Array]")&&!e.includes("Big")}var Xx=Object.freeze({__proto__:null,isAnyArray:fs}),Qx=Mt(Xx);function Jx(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!fs(s))throw new TypeError("input must be an array");if(s.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,n=e.toIndex,i=n===void 0?s.length:n;if(r<0||r>=s.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>s.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=s[r],u=r+1;u<i;u++)s[u]>a&&(a=s[u]);return a}function ey(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!fs(s))throw new TypeError("input must be an array");if(s.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,n=e.toIndex,i=n===void 0?s.length:n;if(r<0||r>=s.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>s.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=s[r],u=r+1;u<i;u++)s[u]<a&&(a=s[u]);return a}function ty(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(fs(s)){if(s.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!fs(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(s.length);var r=ey(s),n=Jx(s);if(r===n)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var i=e.min,a=i===void 0?e.autoMinMax?r:0:i,u=e.max,f=u===void 0?e.autoMinMax?n:1:u;if(a>=f)throw new RangeError("min option must be smaller than max option");for(var c=(f-a)/(n-r),h=0;h<s.length;h++)t[h]=(s[h]-r)*c+a;return t}var ry=Object.freeze({__proto__:null,default:ty}),ny=Mt(ry);Object.defineProperty(We,"__esModule",{value:!0});var gr=Qx,Cf=ny;const xo=" ".repeat(2),Ff=" ".repeat(4);function iy(){return Bf(this)}function Bf(s,e={}){const{maxRows:t=15,maxColumns:r=10,maxNumSize:n=8,padMinus:i="auto"}=e;return`${s.constructor.name} {
54
+ (`+ft(M,_)+", "+ft(C,_)+") ==> "+(this._values?ft(this._values[B],_):"X")}return D},n.prototype.toString=function(){return ft(this.toArray())},n.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(_){if(_){if(St(_)&&(_=_.toNumber()),!pt(_)||!bt(_))throw new TypeError("The parameter k must be an integer number")}else _=0;var y=_>0?_:0,m=_<0?-_:0,w=this._size[0],D=this._size[1],C=Math.min(w-m,D-y),b=[],F=[],B=[];B[0]=0;for(var M=y;M<D&&b.length<C;M++)for(var O=this._ptr[M],A=this._ptr[M+1],N=O;N<A;N++){var I=this._index[N];if(I===M-y+m){b.push(this._values[N]),F[b.length-1]=I-m;break}}return B.push(b.length),new n({values:b,index:F,ptr:B,size:[C,1]})},n.fromJSON=function(_){return new n(_)},n.diagonal=function(_,y,m,w,D){if(!Ct(_))throw new TypeError("Array expected, size parameter");if(_.length!==2)throw new Error("Only two dimensions matrix are supported");if(_=_.map(function(ee){if(St(ee)&&(ee=ee.toNumber()),!pt(ee)||!bt(ee)||ee<1)throw new Error("Size values must be positive integers");return ee}),m){if(St(m)&&(m=m.toNumber()),!pt(m)||!bt(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var C=t,b=0;un(D)&&(C=e.find(t,[D,D])||t,b=e.convert(0,D));var F=m>0?m:0,B=m<0?-m:0,M=_[0],O=_[1],A=Math.min(M-B,O-F),N;if(Ct(y)){if(y.length!==A)throw new Error("Invalid value array length");N=function(te){return y[te]}}else if(mt(y)){var I=y.size();if(I.length!==1||I[0]!==A)throw new Error("Invalid matrix length");N=function(te){return y.get([te])}}else N=function(){return y};for(var L=[],k=[],z=[],R=0;R<O;R++){z.push(L.length);var G=R-F;if(G>=0&&G<A){var H=N(G);C(H,b)||(k.push(G+B),L.push(H))}}return z.push(L.length),new n({values:L,index:k,ptr:z,size:[M,O]})},n.prototype.swapRows=function(_,y){if(!pt(_)||!bt(_)||!pt(y)||!bt(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Ft(_,this._size[0]),Ft(y,this._size[0]),n._swapRows(_,y,this._size[1],this._values,this._index,this._ptr),this},n._forEachRow=function(_,y,m,w,D){for(var C=w[_],b=w[_+1],F=C;F<b;F++)D(m[F],y[F])},n._swapRows=function(_,y,m,w,D,C){for(var b=0;b<m;b++){var F=C[b],B=C[b+1],M=f(_,F,B,D),O=f(y,F,B,D);if(M<B&&O<B&&D[M]===_&&D[O]===y){if(w){var A=w[M];w[M]=w[O],w[O]=A}continue}if(M<B&&D[M]===_&&(O>=B||D[O]!==y)){var N=w?w[M]:void 0;D.splice(O,0,y),w&&w.splice(O,0,N),D.splice(O<=M?M+1:M,1),w&&w.splice(O<=M?M+1:M,1);continue}if(O<B&&D[O]===y&&(M>=B||D[M]!==_)){var I=w?w[O]:void 0;D.splice(M,0,_),w&&w.splice(M,0,I),D.splice(M<=O?O+1:O,1),w&&w.splice(M<=O?O+1:O,1)}}},n},{isClass:!0}),Xv="number",Qv=["typed"];function Jv(s){var e=s.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var t={"0b":2,"0o":8,"0x":16}[e[1]],r=e[2],n=e[3];return{input:s,radix:t,integerPart:r,fractionalPart:n}}else return null}function eg(s){for(var e=parseInt(s.integerPart,s.radix),t=0,r=0;r<s.fractionalPart.length;r++){var n=parseInt(s.fractionalPart[r],s.radix);t+=n/Math.pow(s.radix,r+1)}var i=e+t;if(isNaN(i))throw new SyntaxError('String "'+s.input+'" is not a valid number');return i}var tg=xe(Xv,Qv,s=>{var{typed:e}=s,t=e("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var i=Jv(n);if(i)return eg(i);var a=0,u=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(a=Number(u[2]),n=u[1]);var c=Number(n);if(isNaN(c))throw new SyntaxError('String "'+n+'" is not a valid number');if(u){if(c>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));c>=2**(a-1)&&(c=c-2**a)}return c},BigNumber:function(n){return n.toNumber()},Fraction:function(n){return n.valueOf()},Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=r(n.value),i}),null:function(n){return 0},"Unit, string | Unit":function(n,i){return n.toNumber(i)},"Array | Matrix":e.referToSelf(r=>n=>Jr(n,r))});return t.fromJSON=function(r){return parseFloat(r.value)},t}),rg="bignumber",ng=["typed","BigNumber"],ig=xe(rg,ng,s=>{var{typed:e,BigNumber:t}=s;return e("bignumber",{"":function(){return new t(0)},number:function(n){return new t(n+"")},string:function(n){var i=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var a=i[2],u=t(i[1]),c=new t(2).pow(Number(a));if(u.gt(c.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var f=new t(2).pow(Number(a)-1);return u.gte(f)?u.sub(c):u}return new t(n)},BigNumber:function(n){return n},Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=r(n.value),i}),Fraction:function(n){return new t(n.n).div(n.d).times(n.s)},null:function(n){return new t(0)},"Array | Matrix":e.referToSelf(r=>n=>Jr(n,r))})}),sg="fraction",og=["typed","Fraction"],ag=xe(sg,og,s=>{var{typed:e,Fraction:t}=s;return e("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new t(n)},string:function(n){return new t(n)},"number, number":function(n,i){return new t(n,i)},null:function(n){return new t(0)},BigNumber:function(n){return new t(n.toString())},Fraction:function(n){return n},Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=r(n.value),i}),Object:function(n){return new t(n)},"Array | Matrix":e.referToSelf(r=>n=>Jr(n,r))})}),Nf="matrix",ug=["typed","Matrix","DenseMatrix","SparseMatrix"],lg=xe(Nf,ug,s=>{var{typed:e,Matrix:t,DenseMatrix:r,SparseMatrix:n}=s;return e(Nf,{"":function(){return i([])},string:function(u){return i([],u)},"string, string":function(u,c){return i([],u,c)},Array:function(u){return i(u)},Matrix:function(u){return i(u,u.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(a,u,c){if(u==="dense"||u==="default"||u===void 0)return new r(a,c);if(u==="sparse")return new n(a,c);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),Sf="unaryMinus",fg=["typed"],cg=xe(Sf,fg,s=>{var{typed:e}=s;return e(Sf,{number:wf,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:e.referToSelf(t=>r=>{var n=r.clone();return n.value=e.find(t,n.valueType())(r.value),n}),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),Of="abs",hg=["typed"],dg=xe(Of,hg,s=>{var{typed:e}=s;return e(Of,{number:mf,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),If="addScalar",pg=["typed"],_g=xe(If,pg,s=>{var{typed:e}=s;return e(If,{"number, number":xf,"Complex, Complex":function(r,n){return r.add(n)},"BigNumber, BigNumber":function(r,n){return r.plus(n)},"Fraction, Fraction":function(r,n){return r.add(n)},"Unit, Unit":e.referToSelf(t=>(r,n)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(n.value===null||n.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=e.find(t,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),Tf="subtractScalar",vg=["typed"],gg=xe(Tf,vg,s=>{var{typed:e}=s;return e(Tf,{"number, number":yf,"Complex, Complex":function(r,n){return r.sub(n)},"BigNumber, BigNumber":function(r,n){return r.minus(n)},"Fraction, Fraction":function(r,n){return r.sub(n)},"Unit, Unit":e.referToSelf(t=>(r,n)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(n.value===null||n.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=e.find(t,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),mg="matAlgo11xS0s",xg=["typed","equalScalar"],Ha=xe(mg,xg,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a,u){var c=n._values,f=n._index,h=n._ptr,d=n._size,p=n._datatype;if(!c)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=d[0],x=d[1],_,y=t,m=0,w=a;typeof p=="string"&&(_=p,y=e.find(t,[_,_]),m=e.convert(0,_),i=e.convert(i,_),w=e.find(a,[_,_]));for(var D=[],C=[],b=[],F=0;F<x;F++){b[F]=C.length;for(var B=h[F],M=h[F+1],O=B;O<M;O++){var A=f[O],N=u?w(i,c[O]):w(c[O],i);y(N,m)||(C.push(A),D.push(N))}}return b[x]=C.length,n.createSparseMatrix({values:D,index:C,ptr:b,size:[v,x],datatype:_})}}),yg="matAlgo12xSfs",Dg=["typed","DenseMatrix"],Ci=xe(yg,Dg,s=>{var{typed:e,DenseMatrix:t}=s;return function(n,i,a,u){var c=n._values,f=n._index,h=n._ptr,d=n._size,p=n._datatype;if(!c)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=d[0],x=d[1],_,y=a;typeof p=="string"&&(_=p,i=e.convert(i,_),y=e.find(a,[_,_]));for(var m=[],w=[],D=[],C=0;C<x;C++){for(var b=C+1,F=h[C],B=h[C+1],M=F;M<B;M++){var O=f[M];w[O]=c[M],D[O]=b}for(var A=0;A<v;A++)C===0&&(m[A]=[]),D[A]===b?m[A][C]=u?y(i,w[A]):y(w[A],i):m[A][C]=u?y(i,0):y(0,i)}return new t({data:m,size:[v,x],datatype:_})}}),wg="matAlgo14xDs",bg=["typed"],ja=xe(wg,bg,s=>{var{typed:e}=s;return function(n,i,a,u){var c=n._data,f=n._size,h=n._datatype,d,p=a;typeof h=="string"&&(d=h,i=e.convert(i,d),p=e.find(a,[d,d]));var v=f.length>0?t(p,0,f,f[0],c,i,u):[];return n.createDenseMatrix({data:v,size:ut(f),datatype:d})};function t(r,n,i,a,u,c,f){var h=[];if(n===i.length-1)for(var d=0;d<a;d++)h[d]=f?r(c,u[d]):r(u[d],c);else for(var p=0;p<a;p++)h[p]=t(r,n+1,i,i[n+1],u[p],c,f);return h}}),Eg="matAlgo02xDS0",Ag=["typed","equalScalar"],Cg=xe(Eg,Ag,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a,u){var c=n._data,f=n._size,h=n._datatype||n.getDataType(),d=i._values,p=i._index,v=i._ptr,x=i._size,_=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==x.length)throw new rt(f.length,x.length);if(f[0]!==x[0]||f[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+x+")");if(!d)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=f[0],m=f[1],w,D=t,C=0,b=a;typeof h=="string"&&h===_&&h!=="mixed"&&(w=h,D=e.find(t,[w,w]),C=e.convert(0,w),b=e.find(a,[w,w]));for(var F=[],B=[],M=[],O=0;O<m;O++){M[O]=B.length;for(var A=v[O],N=v[O+1],I=A;I<N;I++){var L=p[I],k=u?b(d[I],c[L][O]):b(c[L][O],d[I]);D(k,C)||(B.push(L),F.push(k))}}return M[m]=B.length,i.createSparseMatrix({values:F,index:B,ptr:M,size:[y,m],datatype:h===n._datatype&&_===i._datatype?w:void 0})}}),Fg="matAlgo03xDSf",Bg=["typed"],Fi=xe(Fg,Bg,s=>{var{typed:e}=s;return function(r,n,i,a){var u=r._data,c=r._size,f=r._datatype||r.getDataType(),h=n._values,d=n._index,p=n._ptr,v=n._size,x=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(c.length!==v.length)throw new rt(c.length,v.length);if(c[0]!==v[0]||c[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+v+")");if(!h)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var _=c[0],y=c[1],m,w=0,D=i;typeof f=="string"&&f===x&&f!=="mixed"&&(m=f,w=e.convert(0,m),D=e.find(i,[m,m]));for(var C=[],b=0;b<_;b++)C[b]=[];for(var F=[],B=[],M=0;M<y;M++){for(var O=M+1,A=p[M],N=p[M+1],I=A;I<N;I++){var L=d[I];F[L]=a?D(h[I],u[L][M]):D(u[L][M],h[I]),B[L]=O}for(var k=0;k<_;k++)B[k]===O?C[k][M]=F[k]:C[k][M]=a?D(w,u[k][M]):D(u[k][M],w)}return r.createDenseMatrix({data:C,size:[_,y],datatype:f===r._datatype&&x===n._datatype?m:void 0})}}),Mg="matAlgo05xSfSf",Ng=["typed","equalScalar"],$f=xe(Mg,Ng,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a){var u=n._values,c=n._index,f=n._ptr,h=n._size,d=n._datatype||n._data===void 0?n._datatype:n.getDataType(),p=i._values,v=i._index,x=i._ptr,_=i._size,y=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(h.length!==_.length)throw new rt(h.length,_.length);if(h[0]!==_[0]||h[1]!==_[1])throw new RangeError("Dimension mismatch. Matrix A ("+h+") must match Matrix B ("+_+")");var m=h[0],w=h[1],D,C=t,b=0,F=a;typeof d=="string"&&d===y&&d!=="mixed"&&(D=d,C=e.find(t,[D,D]),b=e.convert(0,D),F=e.find(a,[D,D]));var B=u&&p?[]:void 0,M=[],O=[],A=B?[]:void 0,N=B?[]:void 0,I=[],L=[],k,z,R,G;for(z=0;z<w;z++){O[z]=M.length;var H=z+1;for(R=f[z],G=f[z+1];R<G;R++)k=c[R],M.push(k),I[k]=H,A&&(A[k]=u[R]);for(R=x[z],G=x[z+1];R<G;R++)k=v[R],I[k]!==H&&M.push(k),L[k]=H,N&&(N[k]=p[R]);if(B)for(R=O[z];R<M.length;){k=M[R];var ee=I[k],te=L[k];if(ee===H||te===H){var j=ee===H?A[k]:b,X=te===H?N[k]:b,Y=F(j,X);C(Y,b)?M.splice(R,1):(B.push(Y),R++)}}}return O[w]=M.length,n.createSparseMatrix({values:B,index:M,ptr:O,size:[m,w],datatype:d===n._datatype&&y===i._datatype?D:void 0})}}),Sg="matAlgo13xDD",Og=["typed"],Ig=xe(Sg,Og,s=>{var{typed:e}=s;return function(n,i,a){var u=n._data,c=n._size,f=n._datatype,h=i._data,d=i._size,p=i._datatype,v=[];if(c.length!==d.length)throw new rt(c.length,d.length);for(var x=0;x<c.length;x++){if(c[x]!==d[x])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+d+")");v[x]=c[x]}var _,y=a;typeof f=="string"&&f===p&&(_=f,y=e.find(a,[_,_]));var m=v.length>0?t(y,0,v,v[0],u,h):[];return n.createDenseMatrix({data:m,size:v,datatype:_})};function t(r,n,i,a,u,c){var f=[];if(n===i.length-1)for(var h=0;h<a;h++)f[h]=r(u[h],c[h]);else for(var d=0;d<a;d++)f[d]=t(r,n+1,i,i[n+1],u[d],c[d]);return f}}),Tg="broadcast",$g=["concat"],Lg=xe(Tg,$g,s=>{var{concat:e}=s;return function(n,i){var a=Math.max(n._size.length,i._size.length);if(n._size.length===i._size.length&&n._size.every((x,_)=>x===i._size[_]))return[n,i];for(var u=t(n._size,a,0),c=t(i._size,a,0),f=[],h=0;h<a;h++)f[h]=Math.max(u[h],c[h]);Zs(u,f),Zs(c,f);var d=n.clone(),p=i.clone();d._size.length<a?d.reshape(t(d._size,a,1)):p._size.length<a&&p.reshape(t(p._size,a,1));for(var v=0;v<a;v++)d._size[v]<f[v]&&(d=r(d,f[v],v)),p._size[v]<f[v]&&(p=r(p,f[v],v));return[d,p]};function t(n,i,a){return[...Array(i-n.length).fill(a),...n]}function r(n,i,a){return e(...Array(i).fill(n),a)}}),Rg="matrixAlgorithmSuite",Pg=["typed","matrix","concat"],ri=xe(Rg,Pg,s=>{var{typed:e,matrix:t,concat:r}=s,n=Ig({typed:e}),i=ja({typed:e}),a=Lg({concat:r});return function(c){var f=c.elop,h=c.SD||c.DS,d;f?(d={"DenseMatrix, DenseMatrix":(_,y)=>n(...a(_,y),f),"Array, Array":(_,y)=>n(...a(t(_),t(y)),f).valueOf(),"Array, DenseMatrix":(_,y)=>n(...a(t(_),y),f),"DenseMatrix, Array":(_,y)=>n(...a(_,t(y)),f)},c.SS&&(d["SparseMatrix, SparseMatrix"]=(_,y)=>c.SS(...a(_,y),f,!1)),c.DS&&(d["DenseMatrix, SparseMatrix"]=(_,y)=>c.DS(...a(_,y),f,!1),d["Array, SparseMatrix"]=(_,y)=>c.DS(...a(t(_),y),f,!1)),h&&(d["SparseMatrix, DenseMatrix"]=(_,y)=>h(...a(y,_),f,!0),d["SparseMatrix, Array"]=(_,y)=>h(...a(t(y),_),f,!0))):(d={"DenseMatrix, DenseMatrix":e.referToSelf(_=>(y,m)=>n(...a(y,m),_)),"Array, Array":e.referToSelf(_=>(y,m)=>n(...a(t(y),t(m)),_).valueOf()),"Array, DenseMatrix":e.referToSelf(_=>(y,m)=>n(...a(t(y),m),_)),"DenseMatrix, Array":e.referToSelf(_=>(y,m)=>n(...a(y,t(m)),_))},c.SS&&(d["SparseMatrix, SparseMatrix"]=e.referToSelf(_=>(y,m)=>c.SS(...a(y,m),_,!1))),c.DS&&(d["DenseMatrix, SparseMatrix"]=e.referToSelf(_=>(y,m)=>c.DS(...a(y,m),_,!1)),d["Array, SparseMatrix"]=e.referToSelf(_=>(y,m)=>c.DS(...a(t(y),m),_,!1))),h&&(d["SparseMatrix, DenseMatrix"]=e.referToSelf(_=>(y,m)=>h(...a(m,y),_,!0)),d["SparseMatrix, Array"]=e.referToSelf(_=>(y,m)=>h(...a(t(m),y),_,!0))));var p=c.scalar||"any",v=c.Ds||c.Ss;v&&(f?(d["DenseMatrix,"+p]=(_,y)=>i(_,y,f,!1),d[p+", DenseMatrix"]=(_,y)=>i(y,_,f,!0),d["Array,"+p]=(_,y)=>i(t(_),y,f,!1).valueOf(),d[p+", Array"]=(_,y)=>i(t(y),_,f,!0).valueOf()):(d["DenseMatrix,"+p]=e.referToSelf(_=>(y,m)=>i(y,m,_,!1)),d[p+", DenseMatrix"]=e.referToSelf(_=>(y,m)=>i(m,y,_,!0)),d["Array,"+p]=e.referToSelf(_=>(y,m)=>i(t(y),m,_,!1).valueOf()),d[p+", Array"]=e.referToSelf(_=>(y,m)=>i(t(m),y,_,!0).valueOf())));var x=c.sS!==void 0?c.sS:c.Ss;return f?(c.Ss&&(d["SparseMatrix,"+p]=(_,y)=>c.Ss(_,y,f,!1)),x&&(d[p+", SparseMatrix"]=(_,y)=>x(y,_,f,!0))):(c.Ss&&(d["SparseMatrix,"+p]=e.referToSelf(_=>(y,m)=>c.Ss(y,m,_,!1))),x&&(d[p+", SparseMatrix"]=e.referToSelf(_=>(y,m)=>x(m,y,_,!0)))),f&&f.signatures&&Fl(d,f.signatures),d}}),kg="matAlgo01xDSid",zg=["typed"],Lf=xe(kg,zg,s=>{var{typed:e}=s;return function(r,n,i,a){var u=r._data,c=r._size,f=r._datatype||r.getDataType(),h=n._values,d=n._index,p=n._ptr,v=n._size,x=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(c.length!==v.length)throw new rt(c.length,v.length);if(c[0]!==v[0]||c[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+v+")");if(!h)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var _=c[0],y=c[1],m=typeof f=="string"&&f!=="mixed"&&f===x?f:void 0,w=m?e.find(i,[m,m]):i,D,C,b=[];for(D=0;D<_;D++)b[D]=[];var F=[],B=[];for(C=0;C<y;C++){for(var M=C+1,O=p[C],A=p[C+1],N=O;N<A;N++)D=d[N],F[D]=a?w(h[N],u[D][C]):w(u[D][C],h[N]),B[D]=M;for(D=0;D<_;D++)B[D]===M?b[D][C]=F[D]:b[D][C]=u[D][C]}return r.createDenseMatrix({data:b,size:[_,y],datatype:f===r._datatype&&x===n._datatype?m:void 0})}}),qg="matAlgo04xSidSid",Ug=["typed","equalScalar"],Wg=xe(qg,Ug,s=>{var{typed:e,equalScalar:t}=s;return function(n,i,a){var u=n._values,c=n._index,f=n._ptr,h=n._size,d=n._datatype||n._data===void 0?n._datatype:n.getDataType(),p=i._values,v=i._index,x=i._ptr,_=i._size,y=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(h.length!==_.length)throw new rt(h.length,_.length);if(h[0]!==_[0]||h[1]!==_[1])throw new RangeError("Dimension mismatch. Matrix A ("+h+") must match Matrix B ("+_+")");var m=h[0],w=h[1],D,C=t,b=0,F=a;typeof d=="string"&&d===y&&d!=="mixed"&&(D=d,C=e.find(t,[D,D]),b=e.convert(0,D),F=e.find(a,[D,D]));var B=u&&p?[]:void 0,M=[],O=[],A=u&&p?[]:void 0,N=u&&p?[]:void 0,I=[],L=[],k,z,R,G,H;for(z=0;z<w;z++){O[z]=M.length;var ee=z+1;for(G=f[z],H=f[z+1],R=G;R<H;R++)k=c[R],M.push(k),I[k]=ee,A&&(A[k]=u[R]);for(G=x[z],H=x[z+1],R=G;R<H;R++)if(k=v[R],I[k]===ee){if(A){var te=F(A[k],p[R]);C(te,b)?I[k]=null:A[k]=te}}else M.push(k),L[k]=ee,N&&(N[k]=p[R]);if(A&&N)for(R=O[z];R<M.length;)k=M[R],I[k]===ee?(B[R]=A[k],R++):L[k]===ee?(B[R]=N[k],R++):M.splice(R,1)}return O[w]=M.length,n.createSparseMatrix({values:B,index:M,ptr:O,size:[m,w],datatype:d===n._datatype&&y===i._datatype?D:void 0})}}),Hg="matAlgo10xSids",jg=["typed","DenseMatrix"],Rf=xe(Hg,jg,s=>{var{typed:e,DenseMatrix:t}=s;return function(n,i,a,u){var c=n._values,f=n._index,h=n._ptr,d=n._size,p=n._datatype;if(!c)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=d[0],x=d[1],_,y=a;typeof p=="string"&&(_=p,i=e.convert(i,_),y=e.find(a,[_,_]));for(var m=[],w=[],D=[],C=0;C<x;C++){for(var b=C+1,F=h[C],B=h[C+1],M=F;M<B;M++){var O=f[M];w[O]=c[M],D[O]=b}for(var A=0;A<v;A++)C===0&&(m[A]=[]),D[A]===b?m[A][C]=u?y(i,w[A]):y(w[A],i):m[A][C]=i}return new t({data:m,size:[v,x],datatype:_})}}),Yg="multiplyScalar",Zg=["typed"],Vg=xe(Yg,Zg,s=>{var{typed:e}=s;return e("multiplyScalar",{"number, number":Df,"Complex, Complex":function(r,n){return r.mul(n)},"BigNumber, BigNumber":function(r,n){return r.times(n)},"Fraction, Fraction":function(r,n){return r.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(t,r)=>r.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,r)=>t.multiply(r)})}),Pf="multiply",Gg=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Kg=xe(Pf,Gg,s=>{var{typed:e,matrix:t,addScalar:r,multiplyScalar:n,equalScalar:i,dot:a}=s,u=Ha({typed:e,equalScalar:i}),c=ja({typed:e});function f(b,F){switch(b.length){case 1:switch(F.length){case 1:if(b[0]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(b[0]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+b[0]+") must match Matrix rows ("+F[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+F.length+" dimensions)")}break;case 2:switch(F.length){case 1:if(b[1]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+b[1]+") must match Vector length ("+F[0]+")");break;case 2:if(b[1]!==F[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+b[1]+") must match Matrix B rows ("+F[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+F.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+b.length+" dimensions)")}}function h(b,F,B){if(B===0)throw new Error("Cannot multiply two empty vectors");return a(b,F)}function d(b,F){if(F.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return p(b,F)}function p(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._data,N=F._size,I=F._datatype||F.getDataType(),L=M[0],k=N[1],z,R=r,G=n;O&&I&&O===I&&typeof O=="string"&&O!=="mixed"&&(z=O,R=e.find(r,[z,z]),G=e.find(n,[z,z]));for(var H=[],ee=0;ee<k;ee++){for(var te=G(B[0],A[0][ee]),j=1;j<L;j++)te=R(te,G(B[j],A[j][ee]));H[ee]=te}return b.createDenseMatrix({data:H,size:[k],datatype:O===b._datatype&&I===F._datatype?z:void 0})}var v=e("_multiplyMatrixVector",{"DenseMatrix, any":_,"SparseMatrix, any":w}),x=e("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":y,"DenseMatrix, SparseMatrix":m,"SparseMatrix, DenseMatrix":D,"SparseMatrix, SparseMatrix":C});function _(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._data,N=F._datatype||F.getDataType(),I=M[0],L=M[1],k,z=r,R=n;O&&N&&O===N&&typeof O=="string"&&O!=="mixed"&&(k=O,z=e.find(r,[k,k]),R=e.find(n,[k,k]));for(var G=[],H=0;H<I;H++){for(var ee=B[H],te=R(ee[0],A[0]),j=1;j<L;j++)te=z(te,R(ee[j],A[j]));G[H]=te}return b.createDenseMatrix({data:G,size:[I],datatype:O===b._datatype&&N===F._datatype?k:void 0})}function y(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._data,N=F._size,I=F._datatype||F.getDataType(),L=M[0],k=M[1],z=N[1],R,G=r,H=n;O&&I&&O===I&&typeof O=="string"&&O!=="mixed"&&O!=="mixed"&&(R=O,G=e.find(r,[R,R]),H=e.find(n,[R,R]));for(var ee=[],te=0;te<L;te++){var j=B[te];ee[te]=[];for(var X=0;X<z;X++){for(var Y=H(j[0],A[0][X]),Q=1;Q<k;Q++)Y=G(Y,H(j[Q],A[Q][X]));ee[te][X]=Y}}return b.createDenseMatrix({data:ee,size:[L,z],datatype:O===b._datatype&&I===F._datatype?R:void 0})}function m(b,F){var B=b._data,M=b._size,O=b._datatype||b.getDataType(),A=F._values,N=F._index,I=F._ptr,L=F._size,k=F._datatype||F._data===void 0?F._datatype:F.getDataType();if(!A)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var z=M[0],R=L[1],G,H=r,ee=n,te=i,j=0;O&&k&&O===k&&typeof O=="string"&&O!=="mixed"&&(G=O,H=e.find(r,[G,G]),ee=e.find(n,[G,G]),te=e.find(i,[G,G]),j=e.convert(0,G));for(var X=[],Y=[],Q=[],pe=F.createSparseMatrix({values:X,index:Y,ptr:Q,size:[z,R],datatype:O===b._datatype&&k===F._datatype?G:void 0}),De=0;De<R;De++){Q[De]=Y.length;var we=I[De],be=I[De+1];if(be>we)for(var Oe=0,Fe=0;Fe<z;Fe++){for(var nt=Fe+1,Ye=void 0,Ie=we;Ie<be;Ie++){var Le=N[Ie];Oe!==nt?(Ye=ee(B[Fe][Le],A[Ie]),Oe=nt):Ye=H(Ye,ee(B[Fe][Le],A[Ie]))}Oe===nt&&!te(Ye,j)&&(Y.push(Fe),X.push(Ye))}}return Q[R]=Y.length,pe}function w(b,F){var B=b._values,M=b._index,O=b._ptr,A=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!B)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var N=F._data,I=F._datatype||F.getDataType(),L=b._size[0],k=F._size[0],z=[],R=[],G=[],H,ee=r,te=n,j=i,X=0;A&&I&&A===I&&typeof A=="string"&&A!=="mixed"&&(H=A,ee=e.find(r,[H,H]),te=e.find(n,[H,H]),j=e.find(i,[H,H]),X=e.convert(0,H));var Y=[],Q=[];G[0]=0;for(var pe=0;pe<k;pe++){var De=N[pe];if(!j(De,X))for(var we=O[pe],be=O[pe+1],Oe=we;Oe<be;Oe++){var Fe=M[Oe];Q[Fe]?Y[Fe]=ee(Y[Fe],te(De,B[Oe])):(Q[Fe]=!0,R.push(Fe),Y[Fe]=te(De,B[Oe]))}}for(var nt=R.length,Ye=0;Ye<nt;Ye++){var Ie=R[Ye];z[Ye]=Y[Ie]}return G[1]=R.length,b.createSparseMatrix({values:z,index:R,ptr:G,size:[L,1],datatype:A===b._datatype&&I===F._datatype?H:void 0})}function D(b,F){var B=b._values,M=b._index,O=b._ptr,A=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!B)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var N=F._data,I=F._datatype||F.getDataType(),L=b._size[0],k=F._size[0],z=F._size[1],R,G=r,H=n,ee=i,te=0;A&&I&&A===I&&typeof A=="string"&&A!=="mixed"&&(R=A,G=e.find(r,[R,R]),H=e.find(n,[R,R]),ee=e.find(i,[R,R]),te=e.convert(0,R));for(var j=[],X=[],Y=[],Q=b.createSparseMatrix({values:j,index:X,ptr:Y,size:[L,z],datatype:A===b._datatype&&I===F._datatype?R:void 0}),pe=[],De=[],we=0;we<z;we++){Y[we]=X.length;for(var be=we+1,Oe=0;Oe<k;Oe++){var Fe=N[Oe][we];if(!ee(Fe,te))for(var nt=O[Oe],Ye=O[Oe+1],Ie=nt;Ie<Ye;Ie++){var Le=M[Ie];De[Le]!==be?(De[Le]=be,X.push(Le),pe[Le]=H(Fe,B[Ie])):pe[Le]=G(pe[Le],H(Fe,B[Ie]))}}for(var xt=Y[we],Ut=X.length,Et=xt;Et<Ut;Et++){var lr=X[Et];j[Et]=pe[lr]}}return Y[z]=X.length,Q}function C(b,F){var B=b._values,M=b._index,O=b._ptr,A=b._datatype||b._data===void 0?b._datatype:b.getDataType(),N=F._values,I=F._index,L=F._ptr,k=F._datatype||F._data===void 0?F._datatype:F.getDataType(),z=b._size[0],R=F._size[1],G=B&&N,H,ee=r,te=n;A&&k&&A===k&&typeof A=="string"&&A!=="mixed"&&(H=A,ee=e.find(r,[H,H]),te=e.find(n,[H,H]));for(var j=G?[]:void 0,X=[],Y=[],Q=b.createSparseMatrix({values:j,index:X,ptr:Y,size:[z,R],datatype:A===b._datatype&&k===F._datatype?H:void 0}),pe=G?[]:void 0,De=[],we,be,Oe,Fe,nt,Ye,Ie,Le,xt=0;xt<R;xt++){Y[xt]=X.length;var Ut=xt+1;for(nt=L[xt],Ye=L[xt+1],Fe=nt;Fe<Ye;Fe++)if(Le=I[Fe],G)for(be=O[Le],Oe=O[Le+1],we=be;we<Oe;we++)Ie=M[we],De[Ie]!==Ut?(De[Ie]=Ut,X.push(Ie),pe[Ie]=te(N[Fe],B[we])):pe[Ie]=ee(pe[Ie],te(N[Fe],B[we]));else for(be=O[Le],Oe=O[Le+1],we=be;we<Oe;we++)Ie=M[we],De[Ie]!==Ut&&(De[Ie]=Ut,X.push(Ie));if(G)for(var Et=Y[xt],lr=X.length,Rr=Et;Rr<lr;Rr++){var fr=X[Rr];j[Rr]=pe[fr]}}return Y[R]=X.length,Q}return e(Pf,n,{"Array, Array":e.referTo("Matrix, Matrix",b=>(F,B)=>{f(Rt(F),Rt(B));var M=b(t(F),t(B));return mt(M)?M.valueOf():M}),"Matrix, Matrix":function(F,B){var M=F.size(),O=B.size();return f(M,O),M.length===1?O.length===1?h(F,B,M[0]):d(F,B):O.length===1?v(F,B):x(F,B)},"Matrix, Array":e.referTo("Matrix,Matrix",b=>(F,B)=>b(F,t(B))),"Array, Matrix":e.referToSelf(b=>(F,B)=>b(t(F,B.storage()),B)),"SparseMatrix, any":function(F,B){return u(F,B,n,!1)},"DenseMatrix, any":function(F,B){return c(F,B,n,!1)},"any, SparseMatrix":function(F,B){return u(B,F,n,!0)},"any, DenseMatrix":function(F,B){return c(B,F,n,!0)},"Array, any":function(F,B){return c(t(F),B,n,!1).valueOf()},"any, Array":function(F,B){return c(t(B),F,n,!0).valueOf()},"any, any":n,"any, any, ...any":e.referToSelf(b=>(F,B,M)=>{for(var O=b(F,B),A=0;A<M.length;A++)O=b(O,M[A]);return O})})}),kf="subtract",Xg=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Qg=xe(kf,Xg,s=>{var{typed:e,matrix:t,equalScalar:r,subtractScalar:n,unaryMinus:i,DenseMatrix:a,concat:u}=s,c=Lf({typed:e}),f=Fi({typed:e}),h=$f({typed:e,equalScalar:r}),d=Rf({typed:e,DenseMatrix:a}),p=Ci({typed:e,DenseMatrix:a}),v=ri({typed:e,matrix:t,concat:u});return e(kf,{"any, any":n},v({elop:n,SS:h,DS:c,SD:f,Ss:p,sS:d}))}),Jg="matAlgo07xSSf",em=["typed","DenseMatrix"],uo=xe(Jg,em,s=>{var{typed:e,DenseMatrix:t}=s;return function(i,a,u){var c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==h.length)throw new rt(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");var p=c[0],v=c[1],x,_=0,y=u;typeof f=="string"&&f===d&&f!=="mixed"&&(x=f,_=e.convert(0,x),y=e.find(u,[x,x]));var m,w,D=[];for(m=0;m<p;m++)D[m]=[];var C=[],b=[],F=[],B=[];for(w=0;w<v;w++){var M=w+1;for(r(i,w,F,C,M),r(a,w,B,b,M),m=0;m<p;m++){var O=F[m]===M?C[m]:_,A=B[m]===M?b[m]:_;D[m][w]=y(O,A)}}return new t({data:D,size:[p,v],datatype:f===i._datatype&&d===a._datatype?x:void 0})};function r(n,i,a,u,c){for(var f=n._values,h=n._index,d=n._ptr,p=d[i],v=d[i+1];p<v;p++){var x=h[p];a[x]=c,u[x]=f[p]}}}),zf="conj",tm=["typed"],rm=xe(zf,tm,s=>{var{typed:e}=s;return e(zf,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":e.referToSelf(t=>r=>Jr(r,t))})}),qf="concat",nm=["typed","matrix","isInteger"],im=xe(qf,nm,s=>{var{typed:e,matrix:t,isInteger:r}=s;return e(qf,{"...Array | Matrix | number | BigNumber":function(i){var a,u=i.length,c=-1,f,h=!1,d=[];for(a=0;a<u;a++){var p=i[a];if(mt(p)&&(h=!0),pt(p)||St(p)){if(a!==u-1)throw new Error("Dimension must be specified as last argument");if(f=c,c=p.valueOf(),!r(c))throw new TypeError("Integer number expected for dimension");if(c<0||a>0&&c>f)throw new On(c,f+1)}else{var v=ut(p).valueOf(),x=Rt(v);if(d[a]=v,f=c,c=x.length-1,a>0&&c!==f)throw new rt(f+1,c+1)}}if(d.length===0)throw new SyntaxError("At least one matrix expected");for(var _=d.shift();d.length;)_=Zl(_,d.shift(),c);return h?t(_):_},"...string":function(i){return i.join("")}})}),Uf="count",sm=["typed","size","prod"],om=xe(Uf,sm,s=>{var{typed:e,size:t,prod:r}=s;return e(Uf,{string:function(i){return i.length},"Matrix | Array":function(i){return r(t(i))}})}),Wf="identity",am=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],um=xe(Wf,am,s=>{var{typed:e,config:t,matrix:r,BigNumber:n,DenseMatrix:i,SparseMatrix:a}=s;return e(Wf,{"":function(){return t.matrix==="Matrix"?r([]):[]},string:function(h){return r(h)},"number | BigNumber":function(h){return c(h,h,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(h,d){return c(h,h,d)},"number | BigNumber, number | BigNumber":function(h,d){return c(h,d,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(h,d,p){return c(h,d,p)},Array:function(h){return u(h)},"Array, string":function(h,d){return u(h,d)},Matrix:function(h){return u(h.valueOf(),h.storage())},"Matrix, string":function(h,d){return u(h.valueOf(),d)}});function u(f,h){switch(f.length){case 0:return h?r(h):[];case 1:return c(f[0],f[0],h);case 2:return c(f[0],f[1],h);default:throw new Error("Vector containing two values expected")}}function c(f,h,d){var p=St(f)||St(h)?n:null;if(St(f)&&(f=f.toNumber()),St(h)&&(h=h.toNumber()),!bt(f)||f<1)throw new Error("Parameters in function identity must be positive integers");if(!bt(h)||h<1)throw new Error("Parameters in function identity must be positive integers");var v=p?new n(1):1,x=p?new p(0):0,_=[f,h];if(d){if(d==="sparse")return a.diagonal(_,v,0,x);if(d==="dense")return i.diagonal(_,v,0,x);throw new TypeError('Unknown matrix type "'.concat(d,'"'))}for(var y=Na([],_,x),m=f<h?f:h,w=0;w<m;w++)y[w][w]=v;return y}}),Hf="kron",lm=["typed","matrix","multiplyScalar"],fm=xe(Hf,lm,s=>{var{typed:e,matrix:t,multiplyScalar:r}=s;return e(Hf,{"Matrix, Matrix":function(a,u){return t(n(a.toArray(),u.toArray()))},"Matrix, Array":function(a,u){return t(n(a.toArray(),u))},"Array, Matrix":function(a,u){return t(n(a,u.toArray()))},"Array, Array":n});function n(i,a){if(Rt(i).length===1&&(i=[i]),Rt(a).length===1&&(a=[a]),Rt(i).length>2||Rt(a).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(i.length)+", y = "+JSON.stringify(a.length)+")");var u=[],c=[];return i.map(function(f){return a.map(function(h){return c=[],u.push(c),f.map(function(d){return h.map(function(p){return c.push(r(d,p))})})})})&&u}});function cm(){throw new Error('No "bignumber" implementation available')}function hm(){throw new Error('No "fraction" implementation available')}function dm(){throw new Error('No "matrix" implementation available')}var jf="reshape",pm=["typed","isInteger","matrix"],_m=xe(jf,pm,s=>{var{typed:e,isInteger:t}=s;return e(jf,{"Matrix, Array":function(n,i){return n.reshape(i,!0)},"Array, Array":function(n,i){return i.forEach(function(a){if(!t(a))throw new TypeError("Invalid size for dimension: "+a)}),Oa(n,i)}})}),Yf="size",vm=["typed","config","?matrix"],gm=xe(Yf,vm,s=>{var{typed:e,config:t,matrix:r}=s;return e(Yf,{Matrix:function(i){return i.create(i.size())},Array:Rt,string:function(i){return t.matrix==="Array"?[i.length]:r([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return t.matrix==="Array"?[]:r?r([]):dm()}})}),Zf="transpose",mm=["typed","matrix"],xm=xe(Zf,mm,s=>{var{typed:e,matrix:t}=s;return e(Zf,{Array:a=>r(t(a)).valueOf(),Matrix:r,any:ut});function r(a){var u=a.size(),c;switch(u.length){case 1:c=a.clone();break;case 2:{var f=u[0],h=u[1];if(h===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+ft(u)+")");switch(a.storage()){case"dense":c=n(a,f,h);break;case"sparse":c=i(a,f,h);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+ft(u)+")")}return c}function n(a,u,c){for(var f=a._data,h=[],d,p=0;p<c;p++){d=h[p]=[];for(var v=0;v<u;v++)d[v]=ut(f[v][p])}return a.createDenseMatrix({data:h,size:[c,u],datatype:a._datatype})}function i(a,u,c){for(var f=a._values,h=a._index,d=a._ptr,p=f?[]:void 0,v=[],x=[],_=[],y=0;y<u;y++)_[y]=0;var m,w,D;for(m=0,w=h.length;m<w;m++)_[h[m]]++;for(var C=0,b=0;b<u;b++)x.push(C),C+=_[b],_[b]=x[b];for(x.push(C),D=0;D<c;D++)for(var F=d[D],B=d[D+1],M=F;M<B;M++){var O=_[h[M]]++;v[O]=D,f&&(p[O]=ut(f[M]))}return a.createSparseMatrix({values:p,index:v,ptr:x,size:[c,u],datatype:a._datatype})}}),Vf="ctranspose",ym=["typed","transpose","conj"],Dm=xe(Vf,ym,s=>{var{typed:e,transpose:t,conj:r}=s;return e(Vf,{any:function(i){return r(t(i))}})}),Gf="mode",wm=["typed","isNaN","isNumeric"],bm=xe(Gf,wm,s=>{var{typed:e,isNaN:t,isNumeric:r}=s;return e(Gf,{"Array | Matrix":n,"...":function(a){return n(a)}});function n(i){i=Ta(i.valueOf());var a=i.length;if(a===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},c=[],f=0,h=0;h<i.length;h++){var d=i[h];if(r(d)&&t(d))throw new Error("Cannot calculate mode of an array containing NaN values");d in u||(u[d]=0),u[d]++,u[d]===f?c.push(d):u[d]>f&&(f=u[d],c=[d])}return c}});function Rn(s,e,t){var r;return String(s).indexOf("Unexpected type")!==-1?(r=arguments.length>2?" (type: "+Sn(t)+", value: "+JSON.stringify(t)+")":" (type: "+s.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+r)):String(s).indexOf("complex numbers")!==-1?(r=arguments.length>2?" (type: "+Sn(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+r)):s}var Kf="prod",Em=["typed","config","multiplyScalar","numeric"],Am=xe(Kf,Em,s=>{var{typed:e,config:t,multiplyScalar:r,numeric:n}=s;return e(Kf,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(u,c){throw new Error("prod(A, dim) is not yet supported")},"...":function(u){return i(u)}});function i(a){var u;if(as(a,function(c){try{u=u===void 0?c:r(u,c)}catch(f){throw Rn(f,"prod",c)}}),typeof u=="string"&&(u=n(u,t.number)),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),Cm="numeric",Fm=["number","?bignumber","?fraction"],Bm=xe(Cm,Fm,s=>{var{number:e,bignumber:t,fraction:r}=s,n={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:a=>e(a),BigNumber:t?a=>t(a):cm,Fraction:r?a=>r(a):hm};return function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",f=arguments.length>2?arguments[2]:void 0;if(f!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var h=Sn(u);if(!(h in n))throw new TypeError("Cannot convert "+u+' of type "'+h+'"; valid input types are '+Object.keys(n).join(", "));if(!(c in i))throw new TypeError("Cannot convert "+u+' to type "'+c+'"; valid output types are '+Object.keys(i).join(", "));return c===h?u:i[c](u)}}),Xf="divideScalar",Mm=["typed","numeric"],Nm=xe(Xf,Mm,s=>{var{typed:e,numeric:t}=s;return e(Xf,{"number, number":function(n,i){return n/i},"Complex, Complex":function(n,i){return n.div(i)},"BigNumber, BigNumber":function(n,i){return n.div(i)},"Fraction, Fraction":function(n,i){return n.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,n)=>r.divide(n),"number | Fraction | Complex | BigNumber, Unit":(r,n)=>n.divideInto(r)})}),Qf="pow",Sm=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],Om=xe(Qf,Sm,s=>{var{typed:e,config:t,identity:r,multiply:n,matrix:i,inv:a,number:u,fraction:c,Complex:f}=s;return e(Qf,{"number, number":h,"Complex, Complex":function(x,_){return x.pow(_)},"BigNumber, BigNumber":function(x,_){return _.isInteger()||x>=0||t.predictable?x.pow(_):new f(x.toNumber(),0).pow(_.toNumber(),0)},"Fraction, Fraction":function(x,_){var y=x.pow(_);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return h(x.valueOf(),_.valueOf())},"Array, number":d,"Array, BigNumber":function(x,_){return d(x,_.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(x,_){return p(x,_.toNumber())},"Unit, number | BigNumber":function(x,_){return x.pow(_)}});function h(v,x){if(t.predictable&&!bt(x)&&v<0)try{var _=c(x),y=u(_);if((x===y||Math.abs((x-y)/x)<1e-14)&&_.d%2===1)return(_.n%2===0?1:-1)*Math.pow(-v,x)}catch{}return t.predictable&&(v<-1&&x===1/0||v>-1&&v<0&&x===-1/0)?NaN:bt(x)||v>=0||t.predictable?bf(v,x):v*v<1&&x===1/0||v*v>1&&x===-1/0?0:new f(v,0).pow(x,0)}function d(v,x){if(!bt(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var _=Rt(v);if(_.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+_.length+" dimensions)");if(_[0]!==_[1])throw new Error("For A^b, A must be square (size is "+_[0]+"x"+_[1]+")");if(x<0)try{return d(a(v),-x)}catch(w){throw w.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):w}for(var y=r(_[0]).valueOf(),m=v;x>=1;)(x&1)===1&&(y=n(m,y)),x>>=1,m=n(m,m);return y}function p(v,x){return i(d(v.valueOf(),x))}}),Jf="dotDivide",Im=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],Tm=xe(Jf,Im,s=>{var{typed:e,matrix:t,equalScalar:r,divideScalar:n,DenseMatrix:i,concat:a}=s,u=Cg({typed:e,equalScalar:r}),c=Fi({typed:e}),f=uo({typed:e,DenseMatrix:i}),h=Ha({typed:e,equalScalar:r}),d=Ci({typed:e,DenseMatrix:i}),p=ri({typed:e,matrix:t,concat:a});return e(Jf,p({elop:n,SS:f,DS:c,SD:u,Ss:h,sS:d}))}),lo="compare",$m=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],Lm=xe(lo,$m,s=>{var{typed:e,config:t,equalScalar:r,matrix:n,BigNumber:i,Fraction:a,DenseMatrix:u,concat:c}=s,f=Fi({typed:e}),h=$f({typed:e,equalScalar:r}),d=Ci({typed:e,DenseMatrix:u}),p=ri({typed:e,matrix:n,concat:c}),v=oo({typed:e});return e(lo,Rm({typed:e,config:t}),{"boolean, boolean":function(_,y){return _===y?0:_>y?1:-1},"BigNumber, BigNumber":function(_,y){return so(_,y,t.epsilon)?new i(0):new i(_.cmp(y))},"Fraction, Fraction":function(_,y){return new a(_.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},v,p({SS:h,DS:f,Ss:d}))}),Rm=xe(lo,["typed","config"],s=>{var{typed:e,config:t}=s;return e(lo,{"number, number":function(n,i){return ti(n,i,t.epsilon)?0:n>i?1:-1}})}),fo="equal",Pm=["typed","matrix","equalScalar","DenseMatrix","concat"],km=xe(fo,Pm,s=>{var{typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i}=s,a=Fi({typed:e}),u=uo({typed:e,DenseMatrix:n}),c=Ci({typed:e,DenseMatrix:n}),f=ri({typed:e,matrix:t,concat:i});return e(fo,zm({typed:e,equalScalar:r}),f({elop:r,SS:u,DS:a,Ss:c}))}),zm=xe(fo,["typed","equalScalar"],s=>{var{typed:e,equalScalar:t}=s;return e(fo,{"any, any":function(n,i){return n===null?i===null:i===null?n===null:n===void 0?i===void 0:i===void 0?n===void 0:t(n,i)}})}),co="smaller",qm=["typed","config","matrix","DenseMatrix","concat"],Um=xe(co,qm,s=>{var{typed:e,config:t,matrix:r,DenseMatrix:n,concat:i}=s,a=Fi({typed:e}),u=uo({typed:e,DenseMatrix:n}),c=Ci({typed:e,DenseMatrix:n}),f=ri({typed:e,matrix:r,concat:i}),h=oo({typed:e});return e(co,Wm({typed:e,config:t}),{"boolean, boolean":(d,p)=>d<p,"BigNumber, BigNumber":function(p,v){return p.lt(v)&&!so(p,v,t.epsilon)},"Fraction, Fraction":(d,p)=>d.compare(p)===-1,"Complex, Complex":function(p,v){throw new TypeError("No ordering relation is defined for complex numbers")}},h,f({SS:u,DS:a,Ss:c}))}),Wm=xe(co,["typed","config"],s=>{var{typed:e,config:t}=s;return e(co,{"number, number":function(n,i){return n<i&&!ti(n,i,t.epsilon)}})}),ho="larger",Hm=["typed","config","matrix","DenseMatrix","concat"],jm=xe(ho,Hm,s=>{var{typed:e,config:t,matrix:r,DenseMatrix:n,concat:i}=s,a=Fi({typed:e}),u=uo({typed:e,DenseMatrix:n}),c=Ci({typed:e,DenseMatrix:n}),f=ri({typed:e,matrix:r,concat:i}),h=oo({typed:e});return e(ho,Ym({typed:e,config:t}),{"boolean, boolean":(d,p)=>d>p,"BigNumber, BigNumber":function(p,v){return p.gt(v)&&!so(p,v,t.epsilon)},"Fraction, Fraction":(d,p)=>d.compare(p)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},h,f({SS:u,DS:a,Ss:c}))}),Ym=xe(ho,["typed","config"],s=>{var{typed:e,config:t}=s;return e(ho,{"number, number":function(n,i){return n>i&&!ti(n,i,t.epsilon)}})}),ec="deepEqual",Zm=["typed","equal"],Vm=xe(ec,Zm,s=>{var{typed:e,equal:t}=s;return e(ec,{"any, any":function(i,a){return r(i.valueOf(),a.valueOf())}});function r(n,i){if(Array.isArray(n))if(Array.isArray(i)){var a=n.length;if(a!==i.length)return!1;for(var u=0;u<a;u++)if(!r(n[u],i[u]))return!1;return!0}else return!1;else return Array.isArray(i)?!1:t(n,i)}}),tc="partitionSelect",Gm=["typed","isNumeric","isNaN","compare"],Km=xe(tc,Gm,s=>{var{typed:e,isNumeric:t,isNaN:r,compare:n}=s,i=n,a=(f,h)=>-n(f,h);return e(tc,{"Array | Matrix, number":function(h,d){return u(h,d,i)},"Array | Matrix, number, string":function(h,d,p){if(p==="asc")return u(h,d,i);if(p==="desc")return u(h,d,a);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(f,h,d){if(!bt(h)||h<0)throw new Error("k must be a non-negative integer");if(mt(f)){var p=f.size();if(p.length>1)throw new Error("Only one dimensional matrices supported");return c(f.valueOf(),h,d)}if(Array.isArray(f))return c(f,h,d)}function c(f,h,d){if(h>=f.length)throw new Error("k out of bounds");for(var p=0;p<f.length;p++)if(t(f[p])&&r(f[p]))return f[p];for(var v=0,x=f.length-1;v<x;){for(var _=v,y=x,m=f[Math.floor(Math.random()*(x-v+1))+v];_<y;)if(d(f[_],m)>=0){var w=f[y];f[y]=f[_],f[_]=w,--y}else++_;d(f[_],m)>0&&--_,h<=_?x=_:v=_+1}return f[h]}}),rc="max",Xm=["typed","config","numeric","larger"],Qm=xe(rc,Xm,s=>{var{typed:e,config:t,numeric:r,larger:n}=s;return e(rc,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(c,f){return Wa(c,f.valueOf(),i)},"...":function(c){if(ro(c))throw new TypeError("Scalar values expected in function max");return a(c)}});function i(u,c){try{return n(u,c)?u:c}catch(f){throw Rn(f,"max",c)}}function a(u){var c;if(as(u,function(f){try{isNaN(f)&&typeof f=="number"?c=NaN:(c===void 0||n(f,c))&&(c=f)}catch(h){throw Rn(h,"max",f)}}),c===void 0)throw new Error("Cannot calculate max of an empty array");return typeof c=="string"&&(c=r(c,t.number)),c}}),nc="min",Jm=["typed","config","numeric","smaller"],ex=xe(nc,Jm,s=>{var{typed:e,config:t,numeric:r,smaller:n}=s;return e(nc,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(c,f){return Wa(c,f.valueOf(),i)},"...":function(c){if(ro(c))throw new TypeError("Scalar values expected in function min");return a(c)}});function i(u,c){try{return n(u,c)?u:c}catch(f){throw Rn(f,"min",c)}}function a(u){var c;if(as(u,function(f){try{isNaN(f)&&typeof f=="number"?c=NaN:(c===void 0||n(f,c))&&(c=f)}catch(h){throw Rn(h,"min",f)}}),c===void 0)throw new Error("Cannot calculate min of an empty array");return typeof c=="string"&&(c=r(c,t.number)),c}}),ic="add",tx=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],rx=xe(ic,tx,s=>{var{typed:e,matrix:t,addScalar:r,equalScalar:n,DenseMatrix:i,SparseMatrix:a,concat:u}=s,c=Lf({typed:e}),f=Wg({typed:e,equalScalar:n}),h=Rf({typed:e,DenseMatrix:i}),d=ri({typed:e,matrix:t,concat:u});return e(ic,{"any, any":r,"any, any, ...any":e.referToSelf(p=>(v,x,_)=>{for(var y=p(v,x),m=0;m<_.length;m++)y=p(y,_[m]);return y})},d({elop:r,DS:c,SS:f,Ss:h}))}),sc="dot",nx=["typed","addScalar","multiplyScalar","conj","size"],ix=xe(sc,nx,s=>{var{typed:e,addScalar:t,multiplyScalar:r,conj:n,size:i}=s;return e(sc,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":c});function a(h,d){var p=f(h),v=f(d),x,_;if(p.length===1)x=p[0];else if(p.length===2&&p[1]===1)x=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(v.length===1)_=v[0];else if(v.length===2&&v[1]===1)_=v[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+v.join(", ")+")");if(x!==_)throw new RangeError("Vectors must have equal length ("+x+" != "+_+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function u(h,d){var p=a(h,d),v=mt(h)?h._data:h,x=mt(h)?h._datatype||h.getDataType():void 0,_=mt(d)?d._data:d,y=mt(d)?d._datatype||d.getDataType():void 0,m=f(h).length===2,w=f(d).length===2,D=t,C=r;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var b=x;D=e.find(t,[b,b]),C=e.find(r,[b,b])}if(!m&&!w){for(var F=C(n(v[0]),_[0]),B=1;B<p;B++)F=D(F,C(n(v[B]),_[B]));return F}if(!m&&w){for(var M=C(n(v[0]),_[0][0]),O=1;O<p;O++)M=D(M,C(n(v[O]),_[O][0]));return M}if(m&&!w){for(var A=C(n(v[0][0]),_[0]),N=1;N<p;N++)A=D(A,C(n(v[N][0]),_[N]));return A}if(m&&w){for(var I=C(n(v[0][0]),_[0][0]),L=1;L<p;L++)I=D(I,C(n(v[L][0]),_[L][0]));return I}}function c(h,d){a(h,d);for(var p=h._index,v=h._values,x=d._index,_=d._values,y=0,m=t,w=r,D=0,C=0;D<p.length&&C<x.length;){var b=p[D],F=x[C];if(b<F){D++;continue}if(b>F){C++;continue}b===F&&(y=m(y,w(v[D],_[C])),D++,C++)}return y}function f(h){return mt(h)?h.size():i(h)}}),sx="trace",ox=["typed","matrix","add"],ax=xe(sx,ox,s=>{var{typed:e,matrix:t,add:r}=s;return e("trace",{Array:function(u){return n(t(u))},SparseMatrix:i,DenseMatrix:n,any:ut});function n(a){var u=a._size,c=a._data;switch(u.length){case 1:if(u[0]===1)return ut(c[0]);throw new RangeError("Matrix must be square (size: "+ft(u)+")");case 2:{var f=u[0],h=u[1];if(f===h){for(var d=0,p=0;p<f;p++)d=r(d,c[p][p]);return d}else throw new RangeError("Matrix must be square (size: "+ft(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ft(u)+")")}}function i(a){var u=a._values,c=a._index,f=a._ptr,h=a._size,d=h[0],p=h[1];if(d===p){var v=0;if(u.length>0)for(var x=0;x<p;x++)for(var _=f[x],y=f[x+1],m=_;m<y;m++){var w=c[m];if(w===x){v=r(v,u[m]);break}if(w>x)break}return v}throw new RangeError("Matrix must be square (size: "+ft(h)+")")}}),oc="det",ux=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],lx=xe(oc,ux,s=>{var{typed:e,matrix:t,subtractScalar:r,multiply:n,divideScalar:i,isZero:a,unaryMinus:u}=s;return e(oc,{any:function(h){return ut(h)},"Array | Matrix":function(h){var d;switch(mt(h)?d=h.size():Array.isArray(h)?(h=t(h),d=h.size()):d=[],d.length){case 0:return ut(h);case 1:if(d[0]===1)return ut(h.valueOf()[0]);if(d[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+ft(d)+")");case 2:{var p=d[0],v=d[1];if(p===v)return c(h.clone().valueOf(),p);if(v===0)return 1;throw new RangeError("Matrix must be square (size: "+ft(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ft(d)+")")}}});function c(f,h,d){if(h===1)return ut(f[0][0]);if(h===2)return r(n(f[0][0],f[1][1]),n(f[1][0],f[0][1]));for(var p=!1,v=new Array(h).fill(0).map((B,M)=>M),x=0;x<h;x++){var _=v[x];if(a(f[_][x])){var y=void 0;for(y=x+1;y<h;y++)if(!a(f[v[y]][x])){_=v[y],v[y]=v[x],v[x]=_,p=!p;break}if(y===h)return f[_][x]}for(var m=f[_][x],w=x===0?1:f[v[x-1]][x-1],D=x+1;D<h;D++)for(var C=v[D],b=x+1;b<h;b++)f[C][b]=i(r(n(f[C][b],m),n(f[C][x],f[_][b])),w)}var F=f[v[h-1]][h-1];return p?u(F):F}}),ac="inv",fx=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],cx=xe(ac,fx,s=>{var{typed:e,matrix:t,divideScalar:r,addScalar:n,multiply:i,unaryMinus:a,det:u,identity:c,abs:f}=s;return e(ac,{"Array | Matrix":function(p){var v=mt(p)?p.size():Rt(p);switch(v.length){case 1:if(v[0]===1)return mt(p)?t([r(1,p.valueOf()[0])]):[r(1,p[0])];throw new RangeError("Matrix must be square (size: "+ft(v)+")");case 2:{var x=v[0],_=v[1];if(x===_)return mt(p)?t(h(p.valueOf(),x,_),p.storage()):h(p,x,_);throw new RangeError("Matrix must be square (size: "+ft(v)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ft(v)+")")}},any:function(p){return r(1,p)}});function h(d,p,v){var x,_,y,m,w;if(p===1){if(m=d[0][0],m===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,m)]]}else if(p===2){var D=u(d);if(D===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(d[1][1],D),r(a(d[0][1]),D)],[r(a(d[1][0]),D),r(d[0][0],D)]]}else{var C=d.concat();for(x=0;x<p;x++)C[x]=C[x].concat();for(var b=c(p).valueOf(),F=0;F<v;F++){var B=f(C[F][F]),M=F;for(x=F+1;x<p;)f(C[x][F])>B&&(B=f(C[x][F]),M=x),x++;if(B===0)throw Error("Cannot calculate inverse, determinant is zero");x=M,x!==F&&(w=C[F],C[F]=C[x],C[x]=w,w=b[F],b[F]=b[x],b[x]=w);var O=C[F],A=b[F];for(x=0;x<p;x++){var N=C[x],I=b[x];if(x!==F){if(N[F]!==0){for(y=r(a(N[F]),O[F]),_=F;_<v;_++)N[_]=n(N[_],i(y,O[_]));for(_=0;_<v;_++)I[_]=n(I[_],i(y,A[_]))}}else{for(y=O[F],_=F;_<v;_++)N[_]=r(N[_],y);for(_=0;_<v;_++)I[_]=r(I[_],y)}}}return b}}}),uc="pinv",hx=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],dx=xe(uc,hx,s=>{var{typed:e,matrix:t,inv:r,deepEqual:n,equal:i,dotDivide:a,dot:u,ctranspose:c,divideScalar:f,multiply:h,add:d,Complex:p}=s;return e(uc,{"Array | Matrix":function(D){var C=mt(D)?D.size():Rt(D);switch(C.length){case 1:return m(D)?c(D):C[0]===1?r(D):a(c(D),u(D,D));case 2:{if(m(D))return c(D);var b=C[0],F=C[1];if(b===F)try{return r(D)}catch(B){if(!(B instanceof Error&&B.message.match(/Cannot calculate inverse, determinant is zero/)))throw B}return mt(D)?t(v(D.valueOf(),b,F),D.storage()):v(D,b,F)}default:throw new RangeError("Matrix must be two dimensional (size: "+ft(C)+")")}},any:function(D){return i(D,0)?ut(D):f(1,D)}});function v(w,D,C){var{C:b,F}=_(w,D,C),B=h(r(h(c(b),b)),c(b)),M=h(c(F),r(h(F,c(F))));return h(M,B)}function x(w,D,C){for(var b=ut(w),F=0,B=0;B<D;B++){if(C<=F)return b;for(var M=B;y(b[M][F]);)if(M++,D===M&&(M=B,F++,C===F))return b;[b[M],b[B]]=[b[B],b[M]];for(var O=b[B][F],A=0;A<C;A++)b[B][A]=a(b[B][A],O);for(var N=0;N<D;N++)if(N!==B){O=b[N][F];for(var I=0;I<C;I++)b[N][I]=d(b[N][I],h(-1,h(O,b[B][I])))}F++}return b}function _(w,D,C){var b=x(w,D,C),F=w.map((M,O)=>M.filter((A,N)=>N<D&&!y(u(b[N],b[N])))),B=b.filter((M,O)=>!y(u(b[O],b[O])));return{C:F,F:B}}function y(w){return i(d(w,p(1,1)),d(0,p(1,1)))}function m(w){return n(d(w,p(1,1)),d(h(w,0),p(1,1)))}}),px="divide",_x=["typed","matrix","multiply","equalScalar","divideScalar","inv"],vx=xe(px,_x,s=>{var{typed:e,matrix:t,multiply:r,equalScalar:n,divideScalar:i,inv:a}=s,u=Ha({typed:e,equalScalar:n}),c=ja({typed:e});return e("divide",Fl({"Array | Matrix, Array | Matrix":function(h,d){return r(h,a(d))},"DenseMatrix, any":function(h,d){return c(h,d,i,!1)},"SparseMatrix, any":function(h,d){return u(h,d,i,!1)},"Array, any":function(h,d){return c(t(h),d,i,!1).valueOf()},"any, Array | Matrix":function(h,d){return r(h,a(d))}},i.signatures))}),lc="sum",gx=["typed","config","add","numeric"],mx=xe(lc,gx,s=>{var{typed:e,config:t,add:r,numeric:n}=s;return e(lc,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(c){if(ro(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(u){var c;return as(u,function(f){try{c=c===void 0?f:r(c,f)}catch(h){throw Rn(h,"sum",f)}}),c===void 0&&(c=n(0,t.number)),typeof c=="string"&&(c=n(c,t.number)),c}function a(u,c){try{var f=Wa(u,c,r);return f}catch(h){throw Rn(h,"sum")}}}),fc="median",xx=["typed","add","divide","compare","partitionSelect"],yx=xe(fc,xx,s=>{var{typed:e,add:t,divide:r,compare:n,partitionSelect:i}=s;function a(f){try{f=Ta(f.valueOf());var h=f.length;if(h===0)throw new Error("Cannot calculate median of an empty array");if(h%2===0){for(var d=h/2-1,p=i(f,d+1),v=f[d],x=0;x<d;++x)n(f[x],v)>0&&(v=f[x]);return c(v,p)}else{var _=i(f,(h-1)/2);return u(_)}}catch(y){throw Rn(y,"median")}}var u=e({"number | BigNumber | Complex | Unit":function(h){return h}}),c=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(h,d){return r(t(h,d),2)}});return e(fc,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(h,d){throw new Error("median(A, dim) is not yet supported")},"...":function(h){if(ro(h))throw new TypeError("Scalar values expected in function median");return a(h)}})}),Dx={},wx=Object.freeze({__proto__:null,default:Dx}),bx=Mt(wx),po=Dv({config:Er}),Ya=Av({}),Za=Mv({}),Va=Ov({}),fn=$v({Matrix:Va}),Te=E_({BigNumber:po,Complex:Ya,DenseMatrix:fn,Fraction:Za}),Ex=dg({typed:Te}),_o=_g({typed:Te}),Ax=ig({BigNumber:po,typed:Te}),cc=rm({typed:Te}),Pn=Zv({config:Er,typed:Te}),vo=Pv({typed:Te}),Cx=Uv({typed:Te}),go=Vg({typed:Te}),hc=tg({typed:Te}),Ga=Kv({Matrix:Va,equalScalar:Pn,typed:Te}),dc=gg({typed:Te}),pc=Hv({typed:Te}),Ka=cg({typed:Te}),_c=ag({Fraction:Za,typed:Te}),vc=zv({typed:Te}),Pt=lg({DenseMatrix:fn,Matrix:Va,SparseMatrix:Ga,typed:Te}),gc=bm({isNaN:pc,isNumeric:vc,typed:Te}),us=Bm({bignumber:Ax,fraction:_c,number:hc}),Fx=Am({config:Er,multiplyScalar:go,numeric:us,typed:Te}),Bx=_m({isInteger:vo,matrix:Pt,typed:Te}),mc=gm({matrix:Pt,config:Er,typed:Te}),xc=xm({matrix:Pt,typed:Te}),ni=im({isInteger:vo,matrix:Pt,typed:Te}),Mx=om({prod:Fx,size:mc,typed:Te}),Nx=Dm({conj:cc,transpose:xc,typed:Te}),ls=Nm({numeric:us,typed:Te}),Sx=Tm({DenseMatrix:fn,concat:ni,divideScalar:ls,equalScalar:Pn,matrix:Pt,typed:Te}),yc=km({DenseMatrix:fn,concat:ni,equalScalar:Pn,matrix:Pt,typed:Te}),Dc=um({BigNumber:po,DenseMatrix:fn,SparseMatrix:Ga,config:Er,matrix:Pt,typed:Te}),Ox=fm({matrix:Pt,multiplyScalar:go,typed:Te}),Ix=Um({DenseMatrix:fn,concat:ni,config:Er,matrix:Pt,typed:Te}),Tx=Qg({DenseMatrix:fn,concat:ni,equalScalar:Pn,matrix:Pt,subtractScalar:dc,typed:Te,unaryMinus:Ka}),fs=rx({DenseMatrix:fn,SparseMatrix:Ga,addScalar:_o,concat:ni,equalScalar:Pn,matrix:Pt,typed:Te}),wc=Lm({BigNumber:po,DenseMatrix:fn,Fraction:Za,concat:ni,config:Er,equalScalar:Pn,matrix:Pt,typed:Te}),$x=Vm({equal:yc,typed:Te}),bc=ix({addScalar:_o,conj:cc,multiplyScalar:go,size:mc,typed:Te}),Lx=jm({DenseMatrix:fn,concat:ni,config:Er,matrix:Pt,typed:Te}),Xa=ex({config:Er,numeric:us,smaller:Ix,typed:Te}),Bi=Kg({addScalar:_o,dot:bc,equalScalar:Pn,matrix:Pt,multiplyScalar:go,typed:Te}),Rx=Km({compare:wc,isNaN:pc,isNumeric:vc,typed:Te}),Px=mx({add:fs,config:Er,numeric:us,typed:Te}),kx=ax({add:fs,matrix:Pt,typed:Te}),Ec=lx({divideScalar:ls,isZero:Cx,matrix:Pt,multiply:Bi,subtractScalar:dc,typed:Te,unaryMinus:Ka}),zx=Qm({config:Er,larger:Lx,numeric:us,typed:Te}),mo=cx({abs:Ex,addScalar:_o,det:Ec,divideScalar:ls,identity:Dc,matrix:Pt,multiply:Bi,typed:Te,unaryMinus:Ka}),qx=dx({Complex:Ya,add:fs,ctranspose:Nx,deepEqual:$x,divideScalar:ls,dot:bc,dotDivide:Sx,equal:yc,inv:mo,matrix:Pt,multiply:Bi,typed:Te}),Ux=Om({Complex:Ya,config:Er,fraction:_c,identity:Dc,inv:mo,matrix:Pt,multiply:Bi,number:hc,typed:Te}),Wx=vx({divideScalar:ls,equalScalar:Pn,inv:mo,matrix:Pt,multiply:Bi,typed:Te}),Ac=yx({add:fs,compare:wc,divide:Wx,partitionSelect:Rx,typed:Te});class Hx{constructor(e,t,r){U(this,"_cacheData");U(this,"_variables");U(this,"_math");U(this,"_timeframe");this._cacheData={},this._variables=e,this._math=t,this._timeframe=r}alma({series:e,length:t,offset:r,sigma:n,floor:i},a){if(t===void 0||r===void 0||n===void 0)return;const u=this._cacheDataList(e,t,`alma_${a}`);if(u===void 0)return;let c=r*(t-1);i&&(c=Math.floor(c));const f=t/n;let h=0,d=0;for(let p=0;p<=t-1;p++){const v=Math.exp(-1*Math.pow(p-c,2)/(2*Math.pow(f,2)));h+=v,d+=u[u.length-1-(t-p-1)]*v}return d/h}sma({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;let n=0;const i=this._cacheDataList(e,t,`sma_${r}`);if(i===void 0)return;const a=i.slice(-t);return n=Px(...a)/t,n}rma({source:e,length:t},r){if(e===void 0||t===void 0||isNaN(e))return;this._cacheDataList(e,t,`sma_${r}`);const{sum:n}=this._cacheData[`rma_${r}`]||{},i=1/t,a=n===void 0?this.sma({source:e,length:t},r):i*e+(1-i)*(n||0);return this._cacheDataHandle(`rma_${r}`,{sum:a}),a}atr({length:e},t){const{high:r,close:n}=this._cacheData[`atr_${t}`]||{},{high:i,close:a,low:u}=this._variables,c=r===void 0?i-u:Math.max(Math.max(i-u,Math.abs(i-n)),Math.abs(u-n));return this._cacheDataHandle(`atr_${t}`,{high:i,close:a}),this.rma({source:c,length:e},t)}barssince({condition:e},t){let{count:r}=this._cacheData[`barssince_${t}`]||{};if(e)r=0;else{if(r===void 0)return;r+=1}return this._cacheDataHandle(`barssince_${t}`,{count:r}),r}stdev({source:e,length:t,biased:r=!0},n){if(e===void 0||isNaN(e)||t===void 0)return;const i=this._cacheDataList(e,t,`stdev_${n}`),a=this.sma({source:e,length:t},n);if(i===void 0)return;let u=0;for(let c=0;c<t;c++){const f=this._sum(i[i.length-1-c],-(a||0));u+=f*f}return r||t<=1?Math.sqrt(u/t):Math.sqrt(u/(t-1))}_sum(e,t){let n=e+t;return Math.abs(n)<=1e-10&&(n=0),n}bb({series:e,length:t,mult:r},n){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return[];const i=this.sma({source:e,length:t},n),a=this.stdev({source:e,length:t},n);if(i===void 0||a===void 0)return[];const u=r*a;return[i,i+u,i-u]}bbw({series:e,length:t,mult:r},n){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return;const i=this.sma({source:e,length:t},n),a=this.stdev({source:e,length:t},n);if(i===void 0||a===void 0)return;const u=r*a;return(i+u-(i-u))/i}cci({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this.sma({source:e,length:t},r),i=this.dev({source:e,length:t},r);if(!(n===void 0||i===void 0))return(e-n)/(.015*i)}change({source:e,length:t=1},r){const n=this._cacheData[`change_${r}`]||[];n[this._variables.bar_index]=e,this._cacheData[`change_${r}`]=n;const i=n[n.length-1-t];if(!(e===void 0||isNaN(e)))return i===void 0?i:typeof e=="boolean"?i!==e:e-i}cmo({series:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this.change({source:e},r);if(n===void 0)return;const i=this._math.sum({source:n>=0?n:0,length:t},`sm1_${r}`),a=this._math.sum({source:n>=0?0:-n,length:t},`sm2_${r}`);if(!(i===void 0||a===void 0))return 100*(i-a)/(i+a)}cog({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this._cacheDataList(e,t,`cog_${r}`),i=this._math.sum({source:e,length:t},r);if(i===void 0||n===void 0)return;let a=0;for(let u=0;u<t;u++){const c=n[n.length-1-u];a+=c*(u+1)}return-a/i}correlation({source1:e,source2:t,length:r},n){if(e===void 0||isNaN(e)||t===void 0||isNaN(t)||r===void 0)return;const i=this._cacheDataList([e,t],r,`correlation_${n}`),a=this.sma({source:e,length:r},`sma1_${n}`),u=this.sma({source:t,length:r},`sma2_${n}`);if(a===void 0||u===void 0||i===void 0)return;let c=0,f=0,h=0;for(let p=0;p<r;p++){const[v,x]=i[i.length-1-p],_=v-a,y=x-u;c+=_*y,f+=_*_,h+=y*y}return isNaN(f)||isNaN(c)||isNaN(h)?void 0:c/Math.sqrt(f*h)}cross({source1:e,source2:t},r){if(e===void 0||t===void 0)return!1;const{source1:n,source2:i}=this._cacheData[`cross_${r}`]||{};return this._cacheDataHandle(`cross_${r}`,{source1:e,source2:t}),n===void 0||i===void 0?!1:n>=i&&e<t||n<=i&&e>t}crossover({source1:e,source2:t},r){if(e===void 0||t===void 0)return!1;const{source1:n,source2:i}=this._cacheData[`crossover_${r}`]||{};return this._cacheDataHandle(`crossover_${r}`,{source1:e,source2:t}),n===void 0||i===void 0?!1:n<=i&&e>t}crossunder({source1:e,source2:t},r){if(e===void 0||t===void 0)return!1;const{source1:n,source2:i}=this._cacheData[`crossunder_${r}`]||{};return this._cacheDataHandle(`crossunder_${r}`,{source1:e,source2:t}),n===void 0||i===void 0?!1:n>=i&&e<t}cum({source:e=0},t){e=isNaN(e)?0:e;let{sum:r}=this._cacheData[`cum_${t}`]||{};return r=r||0,r+=e,this._cacheDataHandle(`cum_${t}`,{sum:r}),r}dev({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return;const n=this.sma({source:e,length:t},r);let i=0;const a=this._cacheDataList(e,t,`dev_${r}`);if(!(!a||n===void 0)){for(let u=0;u<t;u++){const c=a[a.length-1-u];i+=Math.abs(c-n)}return i/t}}dmi({diLength:e,adxSmoothing:t},r){if(e===void 0||t===void 0)return[void 0,void 0,void 0];const n=`dmi_${r}`,{low:i,high:a,close:u,PDMS:c,NDMS:f,TRS:h,ADX:d,count:p=0}=this._cacheData[n]||{},{low:v,high:x,close:_}=this._variables;if(i===void 0||a===void 0||u===void 0)return this._cacheData[n]={low:v,high:x,close:_,PDMS:c,NDMS:f,TRS:x-v,count:1},[void 0,void 0,void 0];let y=x-a,m=i-v;y=y>m&&y>0?y:0,m=m>y&&m>0?m:0,y===m&&(y=m=0);const w=Math.max(x-v,Math.abs(x-u),Math.abs(v-u));if(p<e)return this._cacheDataHandle(n,{low:v,high:x,close:_,PDMS:(c||0)+y,NDMS:(f||0)+m,TRS:(h||0)+w,count:p+1}),[void 0,void 0,void 0];{const D=c-c/e+y,C=f-f/e+m,b=h-h/e+w,F=D/b*100,B=C/b*100,M=Math.abs((F-B)/(F+B))*100;let O=M,A=[F,B,void 0];if(p+1-e<t){const N=p+1-e;O=((d||0)*(N-1)+M)/N}else O=(d*(t-1)+M)/t,A=[F,B,O];return this._cacheDataHandle(n,{low:v,high:x,close:_,PDMS:D,NDMS:C,TRS:b,ADX:O,count:p+1}),A}}ema({source:e,length:t},r){if(e===void 0||t===void 0||isNaN(e))return;let{sum:n,count:i=1}=this._cacheData[`ema_${r}`]||{};const a=this.sma({source:e,length:t},r);if(i>t){const u=2/(t+1);n=n===void 0?e:u*e+(1-u)*(n||0)}else n=a;return i+=1,this._cacheDataHandle(`ema_${r}`,{sum:n,count:i}),n}falling({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return!1;const{source:n,fallings:i=[]}=this._cacheData[`falling_${r}`]||{};i.push(n>e);const a=i.slice(-t);return this._cacheDataHandle(`falling_${r}`,{source:e,fallings:a}),a.length<t?!1:a.every(u=>u)}rising({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0)return!1;const{source:n,risings:i=[]}=this._cacheData[`rising_${r}`]||{};i.push(n<e);const a=i.slice(-t);return this._cacheDataHandle(`rising_${r}`,{source:e,risings:a}),a.length<t?!1:a.every(u=>u)}highest({source:e,length:t},r){if(t===void 0||t<=0)return;const{high:n}=this._variables,i=this._cacheDataList(typeof e!="number"?n:e,t,`highest_${r}`);if(i)return Math.max(...i.slice(-t))}highestbars({source:e,length:t},r){if(t===void 0||t<=0)return;const{high:n}=this._variables,i=this._cacheDataList(typeof e!="number"?n:e,t,`highestbars_${r}`);return i?i.slice(-t).reduce((u,c,f,h)=>c>=h[u]?f:u,0)-t+1:void 0}wma({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this._cacheDataList(e,t,`wma_${r}`);if(!n)return;let i=0,a=0;for(let u=0;u<t;u++){const c=(t-u)*t;i+=c,a+=n[n.length-1-u]*c}return a/i}hma({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this.wma({source:e,length:t},r),i=this.wma({source:e,length:Math.round(t/2)},r);return n===void 0||i===void 0?void 0:this.wma({source:2*i-n,length:Math.floor(Math.sqrt(t))},`hma_${r}`)}kc({series:e,length:t,mult:r,useTrueRange:n=!0},i){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return[void 0,void 0,void 0];const a=this.ema({source:e,length:t},i),{ta:u,high:c,low:f}=this._variables,h=n?u.tr:c-f,d=this.ema({source:h,length:t},`range_${i}`);return[a,a+d*r,a-d*r]}kcw({series:e,length:t,mult:r,useTrueRange:n=!0},i){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return;const a=this.ema({source:e,length:t},i),{ta:u,high:c,low:f}=this._variables,h=n?u.tr:c-f,d=this.ema({source:h,length:t},`range_${i}`);return(a+d*r-(a-d*r))/a}linreg({source:e,length:t,offset:r},n){if(t===void 0||r===void 0)return;const i=this._cacheDataList(e,t,`dev_${n}`);if(!i)return;const a=i.slice(-t).filter(v=>v!==void 0);let u=0,c=0,f=0,h=0;for(const[v,x]of a.entries())u+=v,c+=x,f+=v*x,h+=v*v;const d=(t*f-u*c)/(t*h-u*u);return(c-d*u)/t+d*(t-1-r)}lowest({source:e,length:t},r){if(t===void 0||t<=0)return;const{low:n}=this._variables,i=this._cacheDataList(typeof e!="number"?n:e,t,`lowest_${r}`);if(i)return Math.min(...i.slice(-t))}lowestbars({source:e,length:t},r){if(t===void 0||t<=0)return;const{low:n}=this._variables,i=this._cacheDataList(typeof e!="number"?n:e,t,`lowestbars_${r}`);return i?i.slice(-t).reduce((u,c,f,h)=>c<=h[u]?f:u,0)-t+1:void 0}macd({source:e,fastlen:t,slowlen:r,siglen:n},i){if(e===void 0||isNaN(e)||t===void 0||r===void 0||n===void 0)return[void 0,void 0,void 0];const a=this.ema({source:e,length:t},`ema1_${i}`),u=this.ema({source:e,length:r},`ema2_${i}`);if(a===void 0||u===void 0)return[void 0,void 0,void 0];const c=a-u,f=this.ema({source:c,length:n},`macd_${i}`);if(f===void 0)return[c,f,void 0];const h=c-f;return[c,f,h]}max({source:e},t){if(e===void 0||isNaN(e))return;let r=this._cacheData[`max_${t}`]||0;return e>r&&(r=e),this._cacheData[`max_${t}`]=r,r}min({source:e},t){if(e===void 0||isNaN(e))return;let r=this._cacheData[`min_${t}`]||1/0;return e<r&&(r=e),this._cacheData[`min_${t}`]=r,r}median({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this._cacheDataList(e,t,`dev_${r}`);if(n)return Ac(n.slice(-t))}mfi({series:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const{volume:n}=this._variables,i=this.change({source:e},r),a=this._math.sum({source:n*(i>=0?0:e),length:t},`lower_${r}`),u=this._math.sum({source:n*(i<=0?0:e),length:t},`upper_${r}`);if(!(u===void 0||a===void 0))return 100-100/(1+u/a)}mode({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<=0)return;const n=this._cacheDataList(e,t,`mode_${r}`);if(n)return Xa(gc(n.slice(-t)))}mom({source:e,length:t},r){if(t===void 0||t<0)return;const n=`mom_${r}`,i=this._cacheData[n]||[];if(i[this._variables.bar_index]=e,this._cacheData[n]=i,i.length<=t||e===void 0||isNaN(e))return;let a=i.length-t-1,u;for(;u===void 0&&a>=0;)u=i[a],a--;return u===void 0?u:e-u}percentile_linear_interpolation({source:e,length:t,percentage:r},n){if(t===void 0||r===void 0||t<0||r<0||r>100)return;const i=this._cacheDataList(e,t+1,`percentile_linear_interpolation_${n}`);if(!i)return;const a=this._sort(i.slice(-(t+1))),u=a.length;r/=100;const c=1/(u*2);if(r<=c)return a[0];if(r>=1-1/(u*2))return a[u-1];for(const[f,h]of a.entries()){const d=a[f-1];if(r<(f+.5)/u)return d===void 0||h===void 0?void 0:d+(h-d)*(r-(f-.5)/u)/(1/u)}}percentile_nearest_rank({source:e,length:t,percentage:r},n){if(t===void 0||r===void 0||e===void 0||isNaN(e)||t<0||r<0||r>100)return;const i=this._cacheDataList(e,t,`percentile_nearest_rank_${n}`);if(!i)return;const a=this._sort(i.slice(-t)),u=r/100*a.length,c=Math.ceil(u)-1;return a[c>=a.length?a.length-1:c]}percentrank({source:e,length:t},r){if(t===void 0||t<0)return;const n=this._cacheDataList(e,t+1,`percentile_nearest_rank_${r}`);if(!n)return;const i=n.slice(-(t+1)),a=e;if(a===void 0)return;let u=0;for(let c=0;c<i.length;c++)i[c]!==void 0&&(i[c]<a||i[c]===a&&c<t)&&u++;return u/(i.length-1)*100}pivot_point_levels({type:e,anchor:t,developing:r},n){const i=new it;let{close:a,open:u,low:c,high:f}=this._variables;const h=`pivot_point_levels_${n}`,{close:d,low:p,high:v,open:x,result:_}=this._cacheData[h]||{};if(!t&&(v&&p&&(f=Math.max(v,f),c=Math.min(p,c)),this._cacheDataHandle(h,{close:a,open:u,low:c,high:f,result:_}),!r))return i._value=_||[],i;const y={close:a,open:u,low:c,high:f};t===!0&&!r&&(a=d,u=x,c=p,f=v);const m=this._getPivotPointLevels(f,c,a,u,r,e);return this._cacheDataHandle(h,{...y,result:m}),i._value=m,i}_getPivotPointLevels(e,t,r,n,i,a){if(r===void 0||n===void 0||t===void 0||e===void 0)return[];switch(a){case ei.traditional:return this._traditional(e,t,r);case ei.fibonacci:return this._fibonacci(e,t,r);case ei.woodie:return i?[]:this._woodie(e,t);case ei.classic:return this._classic(e,t,r);case ei.dm:return this._DM(e,t,r,n);case ei.camarilla:return this._camarilla(e,t,r);default:return[]}}_traditional(e,t,r){const n=(e+t+r)/3,i=n*2-t,a=n+(e-t),u=n*2+(e-2*t),c=n*3+(e-3*t),f=n*4+(e-4*t),h=n*2-e,d=n-(e-t),p=n*2-(2*e-t),v=n*3-(3*e-t),x=n*4-(4*e-t);return[n,i,h,a,d,u,p,c,v,f,x]}_fibonacci(e,t,r){const n=(e+t+r)/3,i=n+.382*(e-t),a=n-.382*(e-t),u=n+.618*(e-t),c=n-.618*(e-t),f=n+(e-t),h=n-(e-t);return[n,i,a,u,c,f,h]}_woodie(e,t){const{open:r}=this._variables,n=(e+t+2*r)/4,i=2*n-t,a=2*n-e,u=n+(e-t),c=n-(e-t),f=e+2*(n-t),h=t-2*(e-n),d=f+(e-t),p=h-(e-t);return[n,i,a,u,c,f,h,d,p]}_classic(e,t,r){const n=(e+t+r)/3,i=2*n-t,a=2*n-e,u=n+(e-t),c=n-(e-t),f=n+2*(e-t),h=n-2*(e-t),d=n+3*(e-t),p=n-3*(e-t);return[n,i,a,u,c,f,h,d,p]}_DM(e,t,r,n){let i;n===r?i=e+t+2*r:r>n?i=2*e+t+r:i=2*t+e+r;const a=i/4,u=i/2-t,c=i/2-e;return[a,u,c]}_camarilla(e,t,r){const n=(e+t+r)/3,i=r+1.1*(e-t)/12,a=r-1.1*(e-t)/12,u=r+1.1*(e-t)/6,c=r-1.1*(e-t)/6,f=r+1.1*(e-t)/4,h=r-1.1*(e-t)/4,d=r+1.1*(e-t)/2,p=r-1.1*(e-t)/2,v=e/t*r,x=r-(v-r);return[n,i,a,u,c,f,h,d,p,v,x]}pivothigh({source:e=this._variables.high,leftbars:t,rightbars:r},n){if(t===void 0||r===void 0||t<0||r<0)return;const i=this._cacheDataList(e,t+r+1,`pivothigh_${n}`);if(!i)return;const a=i.slice(-(t+r+1)),u=a[t];return Math.max(...a)===u?u:void 0}pivotlow({source:e=this._variables.low,leftbars:t,rightbars:r},n){if(t===void 0||r===void 0||t<0||r<0)return;const i=this._cacheDataList(e,t+r+1,`pivotlow_${n}`);if(!i)return;const a=i.slice(-(t+r+1)),u=a[t];return Math.min(...a)===u?u:void 0}range({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<0)return;const n=this._cacheDataList(e,t,`range_${r}`);if(!n)return;const i=n.filter(c=>c!==void 0).slice(-t),a=Math.max(...i),u=Math.min(...i);return a-u}roc({source:e,length:t},r){if(t===void 0||t<0)return;const n=this._cacheDataList(e,t+1,`roc_${r}`),i=this.change({source:e,length:t},r);if(n)return 100*i/n[n.length-1-t]}rsi({source:e,length:t},r){if(t===void 0||e===void 0||isNaN(e)||t<0)return;const{source:n}=this._cacheData[`rsi_${r}`]||{},i=Math.max(e-n,0),a=Math.max(n-e,0),u=this.rma({source:i,length:t},`rma1_${r}`),c=this.rma({source:a,length:t},`rma2_${r}`);if(this._cacheDataHandle(`rsi_${r}`,{source:e}),!(u===void 0||c===void 0))return 100-100/(1+u/c)}sar({start:e,inc:t,max:r},n){if(e===void 0||t===void 0||r===void 0)return;const{close:i,low:a,high:u,preLow:c,preHigh:f,data:h={}}=this._cacheData[`sar_${n}`]||{};let{result:d,maxMin:p,acceleration:v,isBelow:x}=h,_=!1;const{close:y,low:m,high:w,bar_index:D}=this._variables;return D===1&&(y>i?(x=!0,p=w,d=a):(x=!1,p=m,d=u),_=!0,v=e),d=d+v*(p-d),x?d>m&&(_=!0,x=!1,d=Math.max(w,p||0),p=m,v=e):d<w&&(_=!0,x=!0,d=Math.min(m,p||0),p=w,v=e),_||(x?w>(p||0)&&(p=w,v=Math.min((v||0)+t,r)):m<(p||0)&&(p=m,v=Math.min((v||0)+t,r))),x?(d=Math.min(d,a),D>1&&(d=Math.min(d,c))):(d=Math.max(d,u),D>1&&(d=Math.max(d,f))),this._cacheDataHandle(`sar_${n}`,{high:w,close:y,low:m,preLow:a,preHigh:u,data:Object.assign(h,{result:d,maxMin:p,acceleration:v,isBelow:x})}),d}stoch({source:e,high:t,low:r,length:n},i){if(n===void 0||t===void 0||r===void 0||e===void 0||isNaN(e)||n<0)return;const a=this.lowest({source:r,length:n},i),u=this.highest({source:t,length:n},i);if(!(a===void 0||u===void 0))return 100*(this._variables.close-a)/(u-a)}supertrend({factor:e,atrPeriod:t},r){if(e===void 0||t===void 0)return[void 0,void 0];const{hl2:n,close:i}=this._variables,a=`supertrend_${r}`,{upperBand:u,lowerBand:c,superTrend:f,atr:h,close:d}=this._cacheData[a]||{},p=this.atr({length:t},r);if(p===void 0)return this._cacheDataHandle(a,{close:i}),[void 0,void 0];let v=n+e*p,x=n-e*p;const _=u||0,y=c||0;x=x>y||d<y?x:y,v=v<_||d>_?v:_;let m;h===void 0?m=1:f===_?m=i>v?-1:1:m=i<x?1:-1;const w=m===-1?x:v;return this._cacheDataHandle(a,{upperBand:v,lowerBand:x,superTrend:w,atr:p,close:i}),[w,m]}swma({source:e},t){let{list:r}=this._cacheData[`swma_${t}`]||{};if(r||(r=[]),r.push(e),r=r.slice(-4),this._cacheDataHandle(`swma_${t}`,{list:r}),!(r.filter(n=>n!==void 0).length<4))return r[3]*1/6+r[2]*2/6+r[1]*2/6+r[0]*1/6}tr({handle_na:e=!1},t){const{close:r,low:n,high:i}=this._variables,{close:a}=this._cacheData[`tr_${t}`]||{};return this._cacheDataHandle(`tr_${t}`,{close:r}),a===void 0?e?i-n:void 0:Math.max(i-n,Math.abs(i-a),Math.abs(n-a))}tsi({source:e,short_length:t,long_length:r},n){if(e===void 0||isNaN(e)||t===void 0||r===void 0)return;const i=this.change({source:e},n);if(i===void 0)return;const a=this.ema({source:Math.abs(i),length:t},`absema1_${n}`),u=this.ema({source:i,length:t},`ema1_${n}`);if(u===void 0)return;const c=this.ema({source:u,length:r},`ema2_${n}`),f=this.ema({source:a,length:t},`absema2_${n}`);if(c!==void 0)return c/f}valuewhen({condition:e,source:t,occurrence:r},n){if(t===void 0||r===void 0||r<0)return;let{list:i}=this._cacheData[`valuewhen_${n}`]||{};return i||(i=[]),e&&i.push(t),this._cacheDataHandle(`valuewhen_${n}`,{list:i}),i[i.length-1-r]}variance({source:e,length:t,biased:r=!0},n){if(e===void 0||isNaN(e)||t===void 0||t<0)return;const i=this.sma({source:e,length:t},n),a=this._cacheDataList(e,t,`mode_${n}`);if(!a||i===void 0)return;const u=a.filter(f=>f!==void 0&&!isNaN(f)).slice(-t);if(u.length<t)return;const c=u.reduce((f,h)=>f+Math.pow(h-i,2),0);if(c!==void 0)return r||t<=1?c/t:c/(t-1)}vwap({source:e,anchor:t,stdev_mult:r},n){if(e===void 0)return;t=t===void 0?this._timeframe.change({timeframe:"1D"},n):t;const{volume:i}=this._variables;let{sum:a=0,sumV:u=0,count:c=0,isReset:f,sumS:h=0}=this._cacheData[`vwap_${n}`]||{};if(t&&(a=u=c=h=0,f=!0),!f)return r!==void 0?[]:void 0;const d=e*i+a,p=i+u,v=d/p;return c++,r!==void 0?(h=i*Math.pow(e,2)+h,this._cacheDataHandle(`vwap_${n}`,{sum:d,sumV:p,count:c,isReset:f,sumS:h}),this._computeBands(h,p,r,v)):(this._cacheDataHandle(`vwap_${n}`,{sum:d,sumV:p,count:c,isReset:f}),v)}_computeBands(e,t,r,n){let i=e/t-Math.pow(n,2);i=i<0?0:i;const a=Math.sqrt(i),u=a!==void 0&&!isNaN(a)?n+r*a:void 0,c=a!==void 0&&!isNaN(a)?n-r*a:void 0;return[n,u,c]}vwma({source:e,length:t},r){if(e===void 0||isNaN(e)||t===void 0||t<=0)return;const{volume:n}=this._variables,i=this.sma({source:e*n,length:t},`sma1_${r}`),a=this.sma({source:n,length:t},`sma2_${r}`);if(!(i===void 0||a===void 0))return i/a}wpr({length:e},t){if(e===void 0||e<=0)return;const r=this.highest({length:e},t),n=this.lowest({length:e},t),{close:i}=this._variables;if(!(r===void 0||n===void 0))return(r-i)/(r-n)*-100}_sort(e){const t=e.length;for(let r=0;r<t;r++){let n={};for(let i=0;i<t-r;i++){const{currentVal:a,currentIndex:u}=n,c=e[i];if(c!==void 0){if(a!==void 0&&c<a){e.splice(i,1),e.splice(u,0,c),n={currentIndex:u+1,currentVal:a};continue}n={currentIndex:i,currentVal:c}}}}return e}_cacheDataList(e,t,r){const n=this._cacheData[r]||{barIndex:-1,list:[]},{bar_index:i}=this._variables;if(n.barIndex<=i&&(n.barIndex===i?n.list[n.list.length-1]=e:n.list.push(e),n.barIndex=i,this._cacheData[r]=n),!(n.list.length<t))return n.list}_cacheDataHandle(e,t){const{barIndex:r}=this._cacheData[e]||{};r!==this._variables.bar_index&&(this._cacheData[e]=Object.assign(t,{barIndex:this._variables.bar_index}))}}const Kt={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeRepeatErr:"$keyword '$name' is already defined.",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",typeFieldErr:"In a type declaration, all fields without a default value must be explicitly typified.",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an na object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function.",libraryTitleErr:"Invalid argument 'title' in 'library' call. It cannot contain spaces, special characters or begin with a digit.",exportFuncArgErr:"All exported functions args should be typified",indiRunErr:"An indicator must contain at least one of the following: any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, `alertcondition()`, or any drawing (line, label, box, table, polyline).",libraryExportErr:"A library must contain at least one exported function, method, or type.",strategyRunErr:"A strategy must contain at least one of the following: any `strategy.*()` function that creates orders, any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, or any drawing (line, label, box, table, polyline).",exportUseErr:"Only libraries can contain exported $type.",funcRepeatErr:"The '$name' function has overloads with the same parameters. The type of parameters must be different in overloaded versions of functions.",importMultipleErr:"Cannot import a library more than once",importNotExitErr:"The user '$username' does not have a published library titled '$libraryName'",importNameRepeatErr:"More than one import uses the same alias: $name. Previous usage at line: $line",exportFuncHasInputErr:"The exported function '$func' depends on the '$name' input variable, which is not allowed.",libraryTitleIsKeywordErr:"Invalid argument 'title' in 'library' call. Token: '$name' can't be used as library title.",exportFuncUseGlobalVarErr:"Cannot use global variables in exported functions. Function: $func",loopRuntimeErr:"Loop takes too long to execute (> 500 ms)",paramsErr:"Invalid value '$value' for '$param' parameter of the '$func' function. Possible values: $targetVal",displayErr:"Invalid argument 'display' in '$func' call. Possible values: $values",exportFuncUseReqErr:"Cannot use `request.*()` call in exported function `$name()`",requestExprErr:"Type series $type cannot be used in $name 'expression' argument",argDefaultErr:"The default value assigned to a parameter must be either a literal value (e.g., `5`) or a built-in variable (e.g., `close`)",overloadFuncErr:"Cannot use global variables or any values qualified as 'input' in the local scopes of overloaded functions or methods. Remove any global variables or inputs from the scopes of all '$name()' overloads.",againAssignErr:"Unable to determine the object for the field assignment. Try putting the object into a separate variable before assigning values to its fields.",requestUserInLoopErr:"Cannot use `request.*()` call within loops or conditional structures.",enumVarNameErr:"Invalid enum name '$name': `bool`, `int`, `float`, `string`, and `color` are not allowed.",enumVarNameBuiltinErr:"Invalid object name: $name. Namespaces of built-ins cannot be used.",typeNameErr:"Invalid user-defined type name '$name': `bool`, `int`, `float`, `string`, and `color` are not allowed.",enumUseErr:"Cannot use the '$name' as a value. Use one of the enum's fields instead.",conditionalErr:"'$name' conditional expression must be of a bool type!",fortoErr:'The value of the "for" loop must be a number.',indicatorUseStrategyFuncErr:"You cannot use strategy $type ($name) in indicator script."};an.SERIES,an.SIMPLE,an.INPUT,an.CONST,an.INT,an.FLOAT,an.BOOL,an.COLOR,an.STRING;const jx=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"],Yx=["case","catch","default","delete","do","finally","function","instanceof","new","return","this","throw","try","typeof","void","with"],Zx=["linefill","polyline","matrix","series","simple","string","array","color","const","float","label","table","bool","line","box","int","map","continue","for","varip","var","in","export","import","method","switch","break","while","else","type","and","for","not","as","by","if","in","or","to"];class Vx{constructor(e,t,r){U(this,"_cacheData");U(this,"_variables");U(this,"_errorListener");U(this,"_historyInputs");U(this,"_name");this._cacheData={},this._variables=e,this._errorListener=t,this._name=`inputs_${r}`,this._historyInputs=self.workerStorage.get(this._name)||{}}update(e){for(const t of e){const r=t.id;this._cacheData[r]=Object.assign(this._cacheData[r]||{},{...t,isModify:!0}),self.workerStorage.updateValue(this._name,`in_${t.index}`,{modifyDefval:t.sourceTypeName||t.defval})}}input(e,t){return this._cacheHandle(e,t)}int(e,t){return this._cacheHandle(e,t,ur.INT)}bool(e,t){return this._cacheHandle(e,t,ur.BOOL)}color(e,t){return this._cacheHandle(e,t,ur.COLOR)}time(e,t){return this._cacheHandle(e,t,ur.TIME)}float(e,t){return this._cacheHandle(e,t,ur.FLOAT)}price(e,t){return this._cacheHandle(e,t,ur.PRICE)}source(e,t){return this._cacheHandle(e,t,ur.SOURCE)}string(e,t){return this._cacheHandle(e,t,ur.STRING)}symbol(e,t){return this._cacheHandle(e,t,ur.SYMBOL)}session(e,t){return this._cacheHandle(e,t,ur.SESSION)}text_area(e,t){return this._cacheHandle(e,t,ur.TEXT_AREA)}timeframe(e,t){return this._cacheHandle(e,t,ur.TIMEFRAME)}enum(e,t){return this._cacheHandle(e,t,ur.ENUM)}_cacheHandle(e,t,r){if(t.startsWith("export"))return e.defval;const n=`${r||"input"}_${t}`,i=this._cacheData[n];if(e.defval===void 0&&this._errorListener.addError(Kt.inputDefvalErr,t,Ve.Error),i)i.isModify?i.sourceTypeName&&(this._cacheData[n].defval=this._variables[i.sourceTypeName]):Object.assign(this._cacheData[n],e);else{const{defval:a,display:u}=e;this._displayVerify(t,u),e={inputType:r,...e},this._cacheData[n]=e,this._judgeHistoryInputs(e),(r||e.inputType)===ur.SOURCE?this._cacheData[n].options=jx:e.options&&!e.options.includes(a)&&this._errorListener.addError(`input's defval should be in options, but '${a}' is not in [${e.options.toString()}]`,t,Ve.Error,6+((r==null?void 0:r.length)||-1))}return this._cacheData[n].defval}_judgeHistoryInputs(e){const{defval:t,sourceTypeName:r,index:n}=e;let i=r||t;const a=`in_${n}`,u=this._historyInputs[a];if(!u)self.workerStorage.setValue(this._name,a,{defval:i});else{const{defval:c,modifyDefval:f}=u;c===i?i=f||i:self.workerStorage.setValue(this._name,a,{defval:i})}r?e.sourceTypeName=i:e.defval=i}_displayVerify(e,t){!t||!t.length||t.includes(Zt.dataWindow)||t.includes(Zt.statusLine)||this._errorListener.addError(or(Kt.displayErr,{func:"input",values:"[display.none, display.data_window, display.status_line, display.all]"}),e,Ve.Error)}getInputs(){const e=Object.keys(this._cacheData),t=[];for(const r of e){const n=this._cacheData[r];n.id=r,t.push(n)}return t.sort((r,n)=>(r.index||0)-(n.index||0))}}class Gx{color({x:e}){return e}new({color:e,transp:t=100}){me(t)&&(t=100);const r=(100-t)/100,{r:n,g:i,b:a}=this._parseColor(e||"");return`rgba(${Math.round(n)}, ${Math.round(i)}, ${Math.round(a)}, ${r})`}rgb({red:e=0,green:t=0,blue:r=0,transp:n=0}){return me(n)&&(n=0),me(e)&&(e=0),me(t)&&(t=0),me(r)&&(r=0),`rgba(${e}, ${t}, ${r}, ${(100-n)/100})`}g({color:e}){return e?this._parseColor(e).g:0}r({color:e}){return e?this._parseColor(e).r:0}b({color:e}){return e?this._parseColor(e).b:0}t({color:e}){return e?Math.round(this._parseColor(e).a*100):0}from_gradient({value:e,bottom_value:t,top_value:r,bottom_color:n,top_color:i}){if(me(e)||me(t)||me(r))return"rgba(0,0,0,1)";const a=(e-t)/(r-t),u=Math.min(Math.max(a,0),1),{r:c,g:f,b:h,a:d}=this._parseColor(n||"rgba(0,0,0,0)"),{r:p,g:v,b:x,a:_}=this._parseColor(i||"rgba(0,0,0,0)"),y=c+u*(p-c),m=f+u*(v-f),w=h+u*(x-h),D=d+u*(_-d);return`rgba(${Math.round(y)}, ${Math.round(m)}, ${Math.round(w)}, ${D.toFixed(2)})`}_parseColor(e){let t,r,n,i;if(e.startsWith("#")){t=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),n=parseInt(e.substring(5,7),16);const a=e.substring(7);a?i=(255-parseInt(a,16))/255:i=1}else{const a=this._parserRgbColor(e);t=a[0]||0,r=a[1]||0,n=a[2]||0,i=a[3]||1}return{r:t,g:r,b:n,a:i}}_parserRgbColor(e){var t;return((t=e.match(/\d+/g))==null?void 0:t.map(Number))||[]}}var We={};const Kx=Object.prototype.toString;function cs(s){const e=Kx.call(s);return e.endsWith("Array]")&&!e.includes("Big")}var Xx=Object.freeze({__proto__:null,isAnyArray:cs}),Qx=Mt(Xx);function Jx(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!cs(s))throw new TypeError("input must be an array");if(s.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,n=e.toIndex,i=n===void 0?s.length:n;if(r<0||r>=s.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>s.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=s[r],u=r+1;u<i;u++)s[u]>a&&(a=s[u]);return a}function ey(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!cs(s))throw new TypeError("input must be an array");if(s.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,n=e.toIndex,i=n===void 0?s.length:n;if(r<0||r>=s.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>s.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=s[r],u=r+1;u<i;u++)s[u]<a&&(a=s[u]);return a}function ty(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(cs(s)){if(s.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!cs(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(s.length);var r=ey(s),n=Jx(s);if(r===n)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var i=e.min,a=i===void 0?e.autoMinMax?r:0:i,u=e.max,c=u===void 0?e.autoMinMax?n:1:u;if(a>=c)throw new RangeError("min option must be smaller than max option");for(var f=(c-a)/(n-r),h=0;h<s.length;h++)t[h]=(s[h]-r)*f+a;return t}var ry=Object.freeze({__proto__:null,default:ty}),ny=Mt(ry);Object.defineProperty(We,"__esModule",{value:!0});var gr=Qx,Cc=ny;const xo=" ".repeat(2),Fc=" ".repeat(4);function iy(){return Bc(this)}function Bc(s,e={}){const{maxRows:t=15,maxColumns:r=10,maxNumSize:n=8,padMinus:i="auto"}=e;return`${s.constructor.name} {
55
55
  ${xo}[
56
- ${Ff}${sy(s,t,r,n,i)}
56
+ ${Fc}${sy(s,t,r,n,i)}
57
57
  ${xo}]
58
58
  ${xo}rows: ${s.rows}
59
59
  ${xo}columns: ${s.columns}
60
- }`}function sy(s,e,t,r,n){const{rows:i,columns:a}=s,u=Math.min(i,e),f=Math.min(a,t),c=[];if(n==="auto"){n=!1;e:for(let h=0;h<u;h++)for(let d=0;d<f;d++)if(s.get(h,d)<0){n=!0;break e}}for(let h=0;h<u;h++){let d=[];for(let p=0;p<f;p++)d.push(oy(s.get(h,p),r,n));c.push(`${d.join(" ")}`)}return f!==a&&(c[c.length-1]+=` ... ${a-t} more columns`),u!==i&&c.push(`... ${i-e} more rows`),c.join(`
61
- ${Ff}`)}function oy(s,e,t){return(s>=0&&t?` ${Mf(s,e-1)}`:Mf(s,e)).padEnd(e)}function Mf(s,e){let t=s.toString();if(t.length<=e)return t;let r=s.toFixed(e);if(r.length>e&&(r=s.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;let n=s.toExponential(e);return n.length>e&&(n=s.toExponential(Math.max(0,e-(n.length-e)))),n.slice(0)}function ay(s,e){s.prototype.add=function(r){return typeof r=="number"?this.addS(r):this.addM(r)},s.prototype.addS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)+r);return this},s.prototype.addM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)+r.get(n,i));return this},s.add=function(r,n){return new e(r).add(n)},s.prototype.sub=function(r){return typeof r=="number"?this.subS(r):this.subM(r)},s.prototype.subS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)-r);return this},s.prototype.subM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)-r.get(n,i));return this},s.sub=function(r,n){return new e(r).sub(n)},s.prototype.subtract=s.prototype.sub,s.prototype.subtractS=s.prototype.subS,s.prototype.subtractM=s.prototype.subM,s.subtract=s.sub,s.prototype.mul=function(r){return typeof r=="number"?this.mulS(r):this.mulM(r)},s.prototype.mulS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)*r);return this},s.prototype.mulM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)*r.get(n,i));return this},s.mul=function(r,n){return new e(r).mul(n)},s.prototype.multiply=s.prototype.mul,s.prototype.multiplyS=s.prototype.mulS,s.prototype.multiplyM=s.prototype.mulM,s.multiply=s.mul,s.prototype.div=function(r){return typeof r=="number"?this.divS(r):this.divM(r)},s.prototype.divS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)/r);return this},s.prototype.divM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)/r.get(n,i));return this},s.div=function(r,n){return new e(r).div(n)},s.prototype.divide=s.prototype.div,s.prototype.divideS=s.prototype.divS,s.prototype.divideM=s.prototype.divM,s.divide=s.div,s.prototype.mod=function(r){return typeof r=="number"?this.modS(r):this.modM(r)},s.prototype.modS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)%r);return this},s.prototype.modM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)%r.get(n,i));return this},s.mod=function(r,n){return new e(r).mod(n)},s.prototype.modulus=s.prototype.mod,s.prototype.modulusS=s.prototype.modS,s.prototype.modulusM=s.prototype.modM,s.modulus=s.mod,s.prototype.and=function(r){return typeof r=="number"?this.andS(r):this.andM(r)},s.prototype.andS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)&r);return this},s.prototype.andM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)&r.get(n,i));return this},s.and=function(r,n){return new e(r).and(n)},s.prototype.or=function(r){return typeof r=="number"?this.orS(r):this.orM(r)},s.prototype.orS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)|r);return this},s.prototype.orM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)|r.get(n,i));return this},s.or=function(r,n){return new e(r).or(n)},s.prototype.xor=function(r){return typeof r=="number"?this.xorS(r):this.xorM(r)},s.prototype.xorS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)^r);return this},s.prototype.xorM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)^r.get(n,i));return this},s.xor=function(r,n){return new e(r).xor(n)},s.prototype.leftShift=function(r){return typeof r=="number"?this.leftShiftS(r):this.leftShiftM(r)},s.prototype.leftShiftS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)<<r);return this},s.prototype.leftShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)<<r.get(n,i));return this},s.leftShift=function(r,n){return new e(r).leftShift(n)},s.prototype.signPropagatingRightShift=function(r){return typeof r=="number"?this.signPropagatingRightShiftS(r):this.signPropagatingRightShiftM(r)},s.prototype.signPropagatingRightShiftS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>r);return this},s.prototype.signPropagatingRightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>r.get(n,i));return this},s.signPropagatingRightShift=function(r,n){return new e(r).signPropagatingRightShift(n)},s.prototype.rightShift=function(r){return typeof r=="number"?this.rightShiftS(r):this.rightShiftM(r)},s.prototype.rightShiftS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>>r);return this},s.prototype.rightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>>r.get(n,i));return this},s.rightShift=function(r,n){return new e(r).rightShift(n)},s.prototype.zeroFillRightShift=s.prototype.rightShift,s.prototype.zeroFillRightShiftS=s.prototype.rightShiftS,s.prototype.zeroFillRightShiftM=s.prototype.rightShiftM,s.zeroFillRightShift=s.rightShift,s.prototype.not=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,~this.get(r,n));return this},s.not=function(r){return new e(r).not()},s.prototype.abs=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.abs(this.get(r,n)));return this},s.abs=function(r){return new e(r).abs()},s.prototype.acos=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.acos(this.get(r,n)));return this},s.acos=function(r){return new e(r).acos()},s.prototype.acosh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.acosh(this.get(r,n)));return this},s.acosh=function(r){return new e(r).acosh()},s.prototype.asin=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.asin(this.get(r,n)));return this},s.asin=function(r){return new e(r).asin()},s.prototype.asinh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.asinh(this.get(r,n)));return this},s.asinh=function(r){return new e(r).asinh()},s.prototype.atan=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.atan(this.get(r,n)));return this},s.atan=function(r){return new e(r).atan()},s.prototype.atanh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.atanh(this.get(r,n)));return this},s.atanh=function(r){return new e(r).atanh()},s.prototype.cbrt=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.cbrt(this.get(r,n)));return this},s.cbrt=function(r){return new e(r).cbrt()},s.prototype.ceil=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.ceil(this.get(r,n)));return this},s.ceil=function(r){return new e(r).ceil()},s.prototype.clz32=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.clz32(this.get(r,n)));return this},s.clz32=function(r){return new e(r).clz32()},s.prototype.cos=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.cos(this.get(r,n)));return this},s.cos=function(r){return new e(r).cos()},s.prototype.cosh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.cosh(this.get(r,n)));return this},s.cosh=function(r){return new e(r).cosh()},s.prototype.exp=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.exp(this.get(r,n)));return this},s.exp=function(r){return new e(r).exp()},s.prototype.expm1=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.expm1(this.get(r,n)));return this},s.expm1=function(r){return new e(r).expm1()},s.prototype.floor=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.floor(this.get(r,n)));return this},s.floor=function(r){return new e(r).floor()},s.prototype.fround=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.fround(this.get(r,n)));return this},s.fround=function(r){return new e(r).fround()},s.prototype.log=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log(this.get(r,n)));return this},s.log=function(r){return new e(r).log()},s.prototype.log1p=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log1p(this.get(r,n)));return this},s.log1p=function(r){return new e(r).log1p()},s.prototype.log10=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log10(this.get(r,n)));return this},s.log10=function(r){return new e(r).log10()},s.prototype.log2=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log2(this.get(r,n)));return this},s.log2=function(r){return new e(r).log2()},s.prototype.round=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.round(this.get(r,n)));return this},s.round=function(r){return new e(r).round()},s.prototype.sign=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sign(this.get(r,n)));return this},s.sign=function(r){return new e(r).sign()},s.prototype.sin=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sin(this.get(r,n)));return this},s.sin=function(r){return new e(r).sin()},s.prototype.sinh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sinh(this.get(r,n)));return this},s.sinh=function(r){return new e(r).sinh()},s.prototype.sqrt=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sqrt(this.get(r,n)));return this},s.sqrt=function(r){return new e(r).sqrt()},s.prototype.tan=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.tan(this.get(r,n)));return this},s.tan=function(r){return new e(r).tan()},s.prototype.tanh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.tanh(this.get(r,n)));return this},s.tanh=function(r){return new e(r).tanh()},s.prototype.trunc=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.trunc(this.get(r,n)));return this},s.trunc=function(r){return new e(r).trunc()},s.pow=function(r,n){return new e(r).pow(n)},s.prototype.pow=function(r){return typeof r=="number"?this.powS(r):this.powM(r)},s.prototype.powS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.pow(this.get(n,i),r));return this},s.prototype.powM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.pow(this.get(n,i),r.get(n,i)));return this}}function $r(s,e,t){let r=t?s.rows:s.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Rr(s,e,t){let r=t?s.columns:s.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Mi(s,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==s.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Ni(s,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==s.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Qa(s,e){if(!gr.isAnyArray(e))throw new TypeError("row indices must be an array");for(let t=0;t<e.length;t++)if(e[t]<0||e[t]>=s.rows)throw new RangeError("row indices are out of range")}function Ja(s,e){if(!gr.isAnyArray(e))throw new TypeError("column indices must be an array");for(let t=0;t<e.length;t++)if(e[t]<0||e[t]>=s.columns)throw new RangeError("column indices are out of range")}function eu(s,e,t,r,n){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(Do("startRow",e),Do("endRow",t),Do("startColumn",r),Do("endColumn",n),e>t||r>n||e<0||e>=s.rows||t<0||t>=s.rows||r<0||r>=s.columns||n<0||n>=s.columns)throw new RangeError("Submatrix indices are out of range")}function yo(s,e=0){let t=[];for(let r=0;r<s;r++)t.push(e);return t}function Do(s,e){if(typeof e!="number")throw new TypeError(`${s} must be a number`)}function Si(s){if(s.isEmpty())throw new Error("Empty matrix has no elements to index")}function uy(s){let e=yo(s.rows);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[t]+=s.get(t,r);return e}function ly(s){let e=yo(s.columns);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[r]+=s.get(t,r);return e}function cy(s){let e=0;for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)e+=s.get(t,r);return e}function fy(s){let e=yo(s.rows,1);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[t]*=s.get(t,r);return e}function hy(s){let e=yo(s.columns,1);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[r]*=s.get(t,r);return e}function dy(s){let e=1;for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)e*=s.get(t,r);return e}function py(s,e,t){const r=s.rows,n=s.columns,i=[];for(let a=0;a<r;a++){let u=0,f=0,c=0;for(let h=0;h<n;h++)c=s.get(a,h)-t[a],u+=c,f+=c*c;e?i.push((f-u*u/n)/(n-1)):i.push((f-u*u/n)/n)}return i}function _y(s,e,t){const r=s.rows,n=s.columns,i=[];for(let a=0;a<n;a++){let u=0,f=0,c=0;for(let h=0;h<r;h++)c=s.get(h,a)-t[a],u+=c,f+=c*c;e?i.push((f-u*u/r)/(r-1)):i.push((f-u*u/r)/r)}return i}function vy(s,e,t){const r=s.rows,n=s.columns,i=r*n;let a=0,u=0,f=0;for(let c=0;c<r;c++)for(let h=0;h<n;h++)f=s.get(c,h)-t,a+=f,u+=f*f;return e?(u-a*a/i)/(i-1):(u-a*a/i)/i}function gy(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)-e[t])}function my(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)-e[r])}function xy(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)-e)}function yy(s){const e=[];for(let t=0;t<s.rows;t++){let r=0;for(let n=0;n<s.columns;n++)r+=Math.pow(s.get(t,n),2)/(s.columns-1);e.push(Math.sqrt(r))}return e}function Dy(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)/e[t])}function wy(s){const e=[];for(let t=0;t<s.columns;t++){let r=0;for(let n=0;n<s.rows;n++)r+=Math.pow(s.get(n,t),2)/(s.rows-1);e.push(Math.sqrt(r))}return e}function by(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)/e[r])}function Ey(s){const e=s.size-1;let t=0;for(let r=0;r<s.columns;r++)for(let n=0;n<s.rows;n++)t+=Math.pow(s.get(n,r),2)/e;return Math.sqrt(t)}function Ay(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)/e)}class ke{static from1DArray(e,t,r){if(e*t!==r.length)throw new RangeError("data length does not match given dimensions");let i=new ve(e,t);for(let a=0;a<e;a++)for(let u=0;u<t;u++)i.set(a,u,r[a*t+u]);return i}static rowVector(e){let t=new ve(1,e.length);for(let r=0;r<e.length;r++)t.set(0,r,e[r]);return t}static columnVector(e){let t=new ve(e.length,1);for(let r=0;r<e.length;r++)t.set(r,0,e[r]);return t}static zeros(e,t){return new ve(e,t)}static ones(e,t){return new ve(e,t).fill(1)}static rand(e,t,r={}){if(typeof r!="object")throw new TypeError("options must be an object");const{random:n=Math.random}=r;let i=new ve(e,t);for(let a=0;a<e;a++)for(let u=0;u<t;u++)i.set(a,u,n());return i}static randInt(e,t,r={}){if(typeof r!="object")throw new TypeError("options must be an object");const{min:n=0,max:i=1e3,random:a=Math.random}=r;if(!Number.isInteger(n))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(n>=i)throw new RangeError("min must be smaller than max");let u=i-n,f=new ve(e,t);for(let c=0;c<e;c++)for(let h=0;h<t;h++){let d=n+Math.round(a()*u);f.set(c,h,d)}return f}static eye(e,t,r){t===void 0&&(t=e),r===void 0&&(r=1);let n=Math.min(e,t),i=this.zeros(e,t);for(let a=0;a<n;a++)i.set(a,a,r);return i}static diag(e,t,r){let n=e.length;t===void 0&&(t=n),r===void 0&&(r=t);let i=Math.min(n,t,r),a=this.zeros(t,r);for(let u=0;u<i;u++)a.set(u,u,e[u]);return a}static min(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let r=e.rows,n=e.columns,i=new ve(r,n);for(let a=0;a<r;a++)for(let u=0;u<n;u++)i.set(a,u,Math.min(e.get(a,u),t.get(a,u)));return i}static max(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let r=e.rows,n=e.columns,i=new this(r,n);for(let a=0;a<r;a++)for(let u=0;u<n;u++)i.set(a,u,Math.max(e.get(a,u),t.get(a,u)));return i}static checkMatrix(e){return ke.isMatrix(e)?e:new ve(e)}static isMatrix(e){return e!=null&&e.klass==="Matrix"}get size(){return this.rows*this.columns}apply(e){if(typeof e!="function")throw new TypeError("callback must be a function");for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.call(this,t,r);return this}to1DArray(){let e=[];for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.push(this.get(t,r));return e}to2DArray(){let e=[];for(let t=0;t<this.rows;t++){e.push([]);for(let r=0;r<this.columns;r++)e[t].push(this.get(t,r))}return e}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let e=0;e<this.rows;e++)for(let t=0;t<=e;t++)if(this.get(e,t)!==this.get(t,e))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let e=0;e<this.rows;e++)if(this.get(e,e)!==0)return!1;return!0}isEchelonForm(){let e=0,t=0,r=-1,n=!0,i=!1;for(;e<this.rows&&n;){for(t=0,i=!1;t<this.columns&&i===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>r?(i=!0,r=t):(n=!1,i=!0);e++}return n}isReducedEchelonForm(){let e=0,t=0,r=-1,n=!0,i=!1;for(;e<this.rows&&n;){for(t=0,i=!1;t<this.columns&&i===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>r?(i=!0,r=t):(n=!1,i=!0);for(let a=t+1;a<this.rows;a++)this.get(e,a)!==0&&(n=!1);e++}return n}echelonForm(){let e=this.clone(),t=0,r=0;for(;t<e.rows&&r<e.columns;){let n=t;for(let i=t;i<e.rows;i++)e.get(i,r)>e.get(n,r)&&(n=i);if(e.get(n,r)===0)r++;else{e.swapRows(t,n);let i=e.get(t,r);for(let a=r;a<e.columns;a++)e.set(t,a,e.get(t,a)/i);for(let a=t+1;a<e.rows;a++){let u=e.get(a,r)/e.get(t,r);e.set(a,r,0);for(let f=r+1;f<e.columns;f++)e.set(a,f,e.get(a,f)-e.get(t,f)*u)}t++,r++}}return e}reducedEchelonForm(){let e=this.echelonForm(),t=e.columns,r=e.rows,n=r-1;for(;n>=0;)if(e.maxRow(n)===0)n--;else{let i=0,a=!1;for(;i<r&&a===!1;)e.get(n,i)===1?a=!0:i++;for(let u=0;u<n;u++){let f=e.get(u,i);for(let c=i;c<t;c++){let h=e.get(u,c)-f*e.get(n,c);e.set(u,c,h)}}n--}return e}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{rows:t=1,columns:r=1}=e;if(!Number.isInteger(t)||t<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(r)||r<=0)throw new TypeError("columns must be a positive integer");let n=new ve(this.rows*t,this.columns*r);for(let i=0;i<t;i++)for(let a=0;a<r;a++)n.setSubMatrix(this,this.rows*i,this.columns*a);return n}fill(e){for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,e);return this}neg(){return this.mulS(-1)}getRow(e){$r(this,e);let t=[];for(let r=0;r<this.columns;r++)t.push(this.get(e,r));return t}getRowVector(e){return ve.rowVector(this.getRow(e))}setRow(e,t){$r(this,e),t=Mi(this,t);for(let r=0;r<this.columns;r++)this.set(e,r,t[r]);return this}swapRows(e,t){$r(this,e),$r(this,t);for(let r=0;r<this.columns;r++){let n=this.get(e,r);this.set(e,r,this.get(t,r)),this.set(t,r,n)}return this}getColumn(e){Rr(this,e);let t=[];for(let r=0;r<this.rows;r++)t.push(this.get(r,e));return t}getColumnVector(e){return ve.columnVector(this.getColumn(e))}setColumn(e,t){Rr(this,e),t=Ni(this,t);for(let r=0;r<this.rows;r++)this.set(r,e,t[r]);return this}swapColumns(e,t){Rr(this,e),Rr(this,t);for(let r=0;r<this.rows;r++){let n=this.get(r,e);this.set(r,e,this.get(r,t)),this.set(r,t,n)}return this}addRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)+e[r]);return this}subRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)-e[r]);return this}mulRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e[r]);return this}divRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)/e[r]);return this}addColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)+e[t]);return this}subColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)-e[t]);return this}mulColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e[t]);return this}divColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)/e[t]);return this}mulRow(e,t){$r(this,e);for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t);return this}mulColumn(e,t){Rr(this,e);for(let r=0;r<this.rows;r++)this.set(r,e,this.get(r,e)*t);return this}max(e){if(this.isEmpty())return NaN;switch(e){case"row":{const t=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t[r]&&(t[r]=this.get(r,n));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t[n]&&(t[n]=this.get(r,n));return t}case void 0:{let t=this.get(0,0);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t&&(t=this.get(r,n));return t}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){Si(this);let e=this.get(0,0),t=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>e&&(e=this.get(r,n),t[0]=r,t[1]=n);return t}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t[r]&&(t[r]=this.get(r,n));return t}case"column":{const t=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t[n]&&(t[n]=this.get(r,n));return t}case void 0:{let t=this.get(0,0);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t&&(t=this.get(r,n));return t}default:throw new Error(`invalid option: ${e}`)}}minIndex(){Si(this);let e=this.get(0,0),t=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<e&&(e=this.get(r,n),t[0]=r,t[1]=n);return t}maxRow(e){if($r(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let r=1;r<this.columns;r++)this.get(e,r)>t&&(t=this.get(e,r));return t}maxRowIndex(e){$r(this,e),Si(this);let t=this.get(e,0),r=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n),r[1]=n);return r}minRow(e){if($r(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let r=1;r<this.columns;r++)this.get(e,r)<t&&(t=this.get(e,r));return t}minRowIndex(e){$r(this,e),Si(this);let t=this.get(e,0),r=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n),r[1]=n);return r}maxColumn(e){if(Rr(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let r=1;r<this.rows;r++)this.get(r,e)>t&&(t=this.get(r,e));return t}maxColumnIndex(e){Rr(this,e),Si(this);let t=this.get(0,e),r=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)>t&&(t=this.get(n,e),r[0]=n);return r}minColumn(e){if(Rr(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let r=1;r<this.rows;r++)this.get(r,e)<t&&(t=this.get(r,e));return t}minColumnIndex(e){Rr(this,e),Si(this);let t=this.get(0,e),r=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)<t&&(t=this.get(n,e),r[0]=n);return r}diag(){let e=Math.min(this.rows,this.columns),t=[];for(let r=0;r<e;r++)t.push(this.get(r,r));return t}norm(e="frobenius"){switch(e){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${e}`)}}cumulativeSum(){let e=0;for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e+=this.get(t,r),this.set(t,r,e);return this}dot(e){ke.isMatrix(e)&&(e=e.to1DArray());let t=this.to1DArray();if(t.length!==e.length)throw new RangeError("vectors do not have the same size");let r=0;for(let n=0;n<t.length;n++)r+=t[n]*e[n];return r}mmul(e){e=ve.checkMatrix(e);let t=this.rows,r=this.columns,n=e.columns,i=new ve(t,n),a=new Float64Array(r);for(let u=0;u<n;u++){for(let f=0;f<r;f++)a[f]=e.get(f,u);for(let f=0;f<t;f++){let c=0;for(let h=0;h<r;h++)c+=this.get(f,h)*a[h];i.set(f,u,c)}}return i}strassen2x2(e){e=ve.checkMatrix(e);let t=new ve(2,2);const r=this.get(0,0),n=e.get(0,0),i=this.get(0,1),a=e.get(0,1),u=this.get(1,0),f=e.get(1,0),c=this.get(1,1),h=e.get(1,1),d=(r+c)*(n+h),p=(u+c)*n,v=r*(a-h),x=c*(f-n),_=(r+i)*h,y=(u-r)*(n+a),m=(i-c)*(f+h),w=d+x-_+m,D=v+_,C=p+x,b=d-p+v+y;return t.set(0,0,w),t.set(0,1,D),t.set(1,0,C),t.set(1,1,b),t}strassen3x3(e){e=ve.checkMatrix(e);let t=new ve(3,3);const r=this.get(0,0),n=this.get(0,1),i=this.get(0,2),a=this.get(1,0),u=this.get(1,1),f=this.get(1,2),c=this.get(2,0),h=this.get(2,1),d=this.get(2,2),p=e.get(0,0),v=e.get(0,1),x=e.get(0,2),_=e.get(1,0),y=e.get(1,1),m=e.get(1,2),w=e.get(2,0),D=e.get(2,1),C=e.get(2,2),b=(r+n+i-a-u-h-d)*y,F=(r-a)*(-v+y),B=u*(-p+v+_-y-m-w+C),M=(-r+a+u)*(p-v+y),O=(a+u)*(-p+v),A=r*p,N=(-r+c+h)*(p-x+m),I=(-r+c)*(x-m),R=(c+h)*(-p+x),k=(r+n+i-u-f-c-h)*m,z=h*(-p+x+_-y-m-w+D),L=(-i+h+d)*(y+w-D),G=(i-d)*(y-D),H=i*w,ee=(h+d)*(-w+D),te=(-i+u+f)*(m+w-C),j=(i-f)*(m-C),X=(u+f)*(-w+C),Y=n*_,Q=f*D,pe=a*x,De=c*v,we=d*C,be=A+H+Y,Oe=b+M+O+A+L+H+ee,Fe=A+N+R+k+H+te+X,nt=F+B+M+A+H+te+j,Ye=F+M+O+A+Q,Ie=H+te+j+X+pe,Re=A+N+I+z+L+G+H,xt=L+G+H+ee+De,Ut=A+N+I+R+we;return t.set(0,0,be),t.set(0,1,Oe),t.set(0,2,Fe),t.set(1,0,nt),t.set(1,1,Ye),t.set(1,2,Ie),t.set(2,0,Re),t.set(2,1,xt),t.set(2,2,Ut),t}mmulStrassen(e){e=ve.checkMatrix(e);let t=this.clone(),r=t.rows,n=t.columns,i=e.rows,a=e.columns;n!==i&&console.warn(`Multiplying ${r} x ${n} and ${i} x ${a} matrix: dimensions do not match.`);function u(d,p,v){let x=d.rows,_=d.columns;if(x===p&&_===v)return d;{let y=ke.zeros(p,v);return y=y.setSubMatrix(d,0,0),y}}let f=Math.max(r,i),c=Math.max(n,a);t=u(t,f,c),e=u(e,f,c);function h(d,p,v,x){if(v<=512||x<=512)return d.mmul(p);v%2===1&&x%2===1?(d=u(d,v+1,x+1),p=u(p,v+1,x+1)):v%2===1?(d=u(d,v+1,x),p=u(p,v+1,x)):x%2===1&&(d=u(d,v,x+1),p=u(p,v,x+1));let _=parseInt(d.rows/2,10),y=parseInt(d.columns/2,10),m=d.subMatrix(0,_-1,0,y-1),w=p.subMatrix(0,_-1,0,y-1),D=d.subMatrix(0,_-1,y,d.columns-1),C=p.subMatrix(0,_-1,y,p.columns-1),b=d.subMatrix(_,d.rows-1,0,y-1),F=p.subMatrix(_,p.rows-1,0,y-1),B=d.subMatrix(_,d.rows-1,y,d.columns-1),M=p.subMatrix(_,p.rows-1,y,p.columns-1),O=h(ke.add(m,B),ke.add(w,M),_,y),A=h(ke.add(b,B),w,_,y),N=h(m,ke.sub(C,M),_,y),I=h(B,ke.sub(F,w),_,y),R=h(ke.add(m,D),M,_,y),k=h(ke.sub(b,m),ke.add(w,C),_,y),z=h(ke.sub(D,B),ke.add(F,M),_,y),L=ke.add(O,I);L.sub(R),L.add(z);let G=ke.add(N,R),H=ke.add(A,I),ee=ke.sub(O,A);ee.add(N),ee.add(k);let te=ke.zeros(2*L.rows,2*L.columns);return te=te.setSubMatrix(L,0,0),te=te.setSubMatrix(G,L.rows,0),te=te.setSubMatrix(H,0,L.columns),te=te.setSubMatrix(ee,L.rows,L.columns),te.subMatrix(0,v-1,0,x-1)}return h(t,e,f,c)}scaleRows(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:r=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(t>=r)throw new RangeError("min must be smaller than max");let n=new ve(this.rows,this.columns);for(let i=0;i<this.rows;i++){const a=this.getRow(i);a.length>0&&Cf(a,{min:t,max:r,output:a}),n.setRow(i,a)}return n}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:r=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(t>=r)throw new RangeError("min must be smaller than max");let n=new ve(this.rows,this.columns);for(let i=0;i<this.columns;i++){const a=this.getColumn(i);a.length&&Cf(a,{min:t,max:r,output:a}),n.setColumn(i,a)}return n}flipRows(){const e=Math.ceil(this.columns/2);for(let t=0;t<this.rows;t++)for(let r=0;r<e;r++){let n=this.get(t,r),i=this.get(t,this.columns-1-r);this.set(t,r,i),this.set(t,this.columns-1-r,n)}return this}flipColumns(){const e=Math.ceil(this.rows/2);for(let t=0;t<this.columns;t++)for(let r=0;r<e;r++){let n=this.get(r,t),i=this.get(this.rows-1-r,t);this.set(r,t,i),this.set(this.rows-1-r,t,n)}return this}kroneckerProduct(e){e=ve.checkMatrix(e);let t=this.rows,r=this.columns,n=e.rows,i=e.columns,a=new ve(t*n,r*i);for(let u=0;u<t;u++)for(let f=0;f<r;f++)for(let c=0;c<n;c++)for(let h=0;h<i;h++)a.set(n*u+c,i*f+h,this.get(u,f)*e.get(c,h));return a}kroneckerSum(e){if(e=ve.checkMatrix(e),!this.isSquare()||!e.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let t=this.rows,r=e.rows,n=this.kroneckerProduct(ve.eye(r,r)),i=ve.eye(t,t).kroneckerProduct(e);return n.add(i)}transpose(){let e=new ve(this.columns,this.rows);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.set(r,t,this.get(t,r));return e}sortRows(e=Nf){for(let t=0;t<this.rows;t++)this.setRow(t,this.getRow(t).sort(e));return this}sortColumns(e=Nf){for(let t=0;t<this.columns;t++)this.setColumn(t,this.getColumn(t).sort(e));return this}subMatrix(e,t,r,n){eu(this,e,t,r,n);let i=new ve(t-e+1,n-r+1);for(let a=e;a<=t;a++)for(let u=r;u<=n;u++)i.set(a-e,u-r,this.get(a,u));return i}subMatrixRow(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.columns-1),t>r||t<0||t>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let n=new ve(e.length,r-t+1);for(let i=0;i<e.length;i++)for(let a=t;a<=r;a++){if(e[i]<0||e[i]>=this.rows)throw new RangeError(`Row index out of range: ${e[i]}`);n.set(i,a-t,this.get(e[i],a))}return n}subMatrixColumn(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.rows-1),t>r||t<0||t>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let n=new ve(r-t+1,e.length);for(let i=0;i<e.length;i++)for(let a=t;a<=r;a++){if(e[i]<0||e[i]>=this.columns)throw new RangeError(`Column index out of range: ${e[i]}`);n.set(a-t,i,this.get(a,e[i]))}return n}setSubMatrix(e,t,r){if(e=ve.checkMatrix(e),e.isEmpty())return this;let n=t+e.rows-1,i=r+e.columns-1;eu(this,t,n,r,i);for(let a=0;a<e.rows;a++)for(let u=0;u<e.columns;u++)this.set(t+a,r+u,e.get(a,u));return this}selection(e,t){Qa(this,e),Ja(this,t);let r=new ve(e.length,t.length);for(let n=0;n<e.length;n++){let i=e[n];for(let a=0;a<t.length;a++){let u=t[a];r.set(n,a,this.get(i,u))}}return r}trace(){let e=Math.min(this.rows,this.columns),t=0;for(let r=0;r<e;r++)t+=this.get(r,r);return t}clone(){return this.constructor.copy(this,new ve(this.rows,this.columns))}static copy(e,t){for(const[r,n,i]of e.entries())t.set(r,n,i);return t}sum(e){switch(e){case"row":return uy(this);case"column":return ly(this);case void 0:return cy(this);default:throw new Error(`invalid option: ${e}`)}}product(e){switch(e){case"row":return fy(this);case"column":return hy(this);case void 0:return dy(this);default:throw new Error(`invalid option: ${e}`)}}mean(e){const t=this.sum(e);switch(e){case"row":{for(let r=0;r<this.rows;r++)t[r]/=this.columns;return t}case"column":{for(let r=0;r<this.columns;r++)t[r]/=this.rows;return t}case void 0:return t/this.size;default:throw new Error(`invalid option: ${e}`)}}variance(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");const{unbiased:r=!0,mean:n=this.mean(e)}=t;if(typeof r!="boolean")throw new TypeError("unbiased must be a boolean");switch(e){case"row":{if(!gr.isAnyArray(n))throw new TypeError("mean must be an array");return py(this,r,n)}case"column":{if(!gr.isAnyArray(n))throw new TypeError("mean must be an array");return _y(this,r,n)}case void 0:{if(typeof n!="number")throw new TypeError("mean must be a number");return vy(this,r,n)}default:throw new Error(`invalid option: ${e}`)}}standardDeviation(e,t){typeof e=="object"&&(t=e,e=void 0);const r=this.variance(e,t);if(e===void 0)return Math.sqrt(r);for(let n=0;n<r.length;n++)r[n]=Math.sqrt(r[n]);return r}center(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");const{center:r=this.mean(e)}=t;switch(e){case"row":{if(!gr.isAnyArray(r))throw new TypeError("center must be an array");return gy(this,r),this}case"column":{if(!gr.isAnyArray(r))throw new TypeError("center must be an array");return my(this,r),this}case void 0:{if(typeof r!="number")throw new TypeError("center must be a number");return xy(this,r),this}default:throw new Error(`invalid option: ${e}`)}}scale(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");let r=t.scale;switch(e){case"row":{if(r===void 0)r=yy(this);else if(!gr.isAnyArray(r))throw new TypeError("scale must be an array");return Dy(this,r),this}case"column":{if(r===void 0)r=wy(this);else if(!gr.isAnyArray(r))throw new TypeError("scale must be an array");return by(this,r),this}case void 0:{if(r===void 0)r=Ey(this);else if(typeof r!="number")throw new TypeError("scale must be a number");return Ay(this,r),this}default:throw new Error(`invalid option: ${e}`)}}toString(e){return Bf(this,e)}[Symbol.iterator](){return this.entries()}*entries(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield[e,t,this.get(e,t)]}*values(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield this.get(e,t)}}ke.prototype.klass="Matrix",typeof Symbol<"u"&&(ke.prototype[Symbol.for("nodejs.util.inspect.custom")]=iy);function Nf(s,e){return s-e}function Cy(s){return s.every(e=>typeof e=="number")}ke.random=ke.rand,ke.randomInt=ke.randInt,ke.diagonal=ke.diag,ke.prototype.diagonal=ke.prototype.diag,ke.identity=ke.eye,ke.prototype.negate=ke.prototype.neg,ke.prototype.tensorProduct=ke.prototype.kroneckerProduct;let ve=(Ri=class extends ke{constructor(t,r){super();_l(this,_s);U(this,"data");if(Ri.isMatrix(t))vl(this,_s,gl).call(this,t.rows,t.columns),Ri.copy(t,this);else if(Number.isInteger(t)&&t>=0)vl(this,_s,gl).call(this,t,r);else if(gr.isAnyArray(t)){const n=t;if(t=n.length,r=t?n[0].length:0,typeof r!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let i=0;i<t;i++){if(n[i].length!==r)throw new RangeError("Inconsistent array dimensions");if(!Cy(n[i]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(n[i]))}this.rows=t,this.columns=r}else throw new TypeError("First argument must be a positive number or an array")}set(t,r,n){return this.data[t][r]=n,this}get(t,r){return this.data[t][r]}removeRow(t){return $r(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,r){return r===void 0&&(r=t,t=this.rows),$r(this,t,!0),r=Float64Array.from(Mi(this,r)),this.data.splice(t,0,r),this.rows+=1,this}removeColumn(t){Rr(this,t);for(let r=0;r<this.rows;r++){const n=new Float64Array(this.columns-1);for(let i=0;i<t;i++)n[i]=this.data[r][i];for(let i=t+1;i<this.columns;i++)n[i-1]=this.data[r][i];this.data[r]=n}return this.columns-=1,this}addColumn(t,r){typeof r>"u"&&(r=t,t=this.columns),Rr(this,t,!0),r=Ni(this,r);for(let n=0;n<this.rows;n++){const i=new Float64Array(this.columns+1);let a=0;for(;a<t;a++)i[a]=this.data[n][a];for(i[a++]=r[n];a<this.columns+1;a++)i[a]=this.data[n][a-1];this.data[n]=i}return this.columns+=1,this}},_s=new WeakSet,gl=function(t,r){if(this.data=[],Number.isInteger(r)&&r>=0)for(let n=0;n<t;n++)this.data.push(new Float64Array(r));else throw new TypeError("nColumns must be a positive integer");this.rows=t,this.columns=r},Ri);ay(ke,ve);const $o=class $o extends ke{constructor(t){super();_l(this,tr,void 0);if(ve.isMatrix(t)){if(!t.isSymmetric())throw new TypeError("not symmetric data");Ea(this,tr,ve.copy(t,new ve(t.rows,t.rows)))}else if(Number.isInteger(t)&&t>=0)Ea(this,tr,new ve(t,t));else if(Ea(this,tr,new ve(t)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return on(this,tr).size}get rows(){return on(this,tr).rows}get columns(){return on(this,tr).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(t){return ve.isMatrix(t)&&t.klassType==="SymmetricMatrix"}static zeros(t){return new this(t)}static ones(t){return new this(t).fill(1)}clone(){const t=new $o(this.diagonalSize);for(const[r,n,i]of this.upperRightEntries())t.set(r,n,i);return t}toMatrix(){return new ve(this)}get(t,r){return on(this,tr).get(t,r)}set(t,r,n){return on(this,tr).set(t,r,n),on(this,tr).set(r,t,n),this}removeCross(t){return on(this,tr).removeRow(t),on(this,tr).removeColumn(t),this}addCross(t,r){r===void 0&&(r=t,t=this.diagonalSize);const n=r.slice();return n.splice(t,1),on(this,tr).addRow(t,n),on(this,tr).addColumn(t,r),this}applyMask(t){if(t.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const r=[];for(const[n,i]of t.entries())i||r.push(n);r.reverse();for(const n of r)this.removeCross(n);return this}toCompact(){const{diagonalSize:t}=this,r=new Array(t*(t+1)/2);for(let n=0,i=0,a=0;a<r.length;a++)r[a]=this.get(i,n),++n>=t&&(n=++i);return r}static fromCompact(t){const r=t.length,n=(Math.sqrt(8*r+1)-1)/2;if(!Number.isInteger(n))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(t)}`);const i=new $o(n);for(let a=0,u=0,f=0;f<r;f++)i.set(a,u,t[f]),++a>=n&&(a=++u);return i}*upperRightEntries(){for(let t=0,r=0;t<this.diagonalSize;void 0){const n=this.get(t,r);yield[t,r,n],++r>=this.diagonalSize&&(r=++t)}}*upperRightValues(){for(let t=0,r=0;t<this.diagonalSize;void 0)yield this.get(t,r),++r>=this.diagonalSize&&(r=++t)}};tr=new WeakMap;let ii=$o;ii.prototype.klassType="SymmetricMatrix";class wo extends ii{static isDistanceMatrix(e){return ii.isSymmetricMatrix(e)&&e.klassSubType==="DistanceMatrix"}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,t,r){return e===t&&(r=0),super.set(e,t,r)}addCross(e,t){return t===void 0&&(t=e,e=this.diagonalSize),t=t.slice(),t[e]=0,super.addCross(e,t)}toSymmetricMatrix(){return new ii(this)}clone(){const e=new wo(this.diagonalSize);for(const[t,r,n]of this.upperRightEntries())t!==r&&e.set(t,r,n);return e}toCompact(){const{diagonalSize:e}=this,t=(e-1)*e/2,r=new Array(t);for(let n=1,i=0,a=0;a<r.length;a++)r[a]=this.get(i,n),++n>=e&&(n=++i+1);return r}static fromCompact(e){const t=e.length,r=(Math.sqrt(8*t+1)+1)/2;if(!Number.isInteger(r))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const n=new this(r);for(let i=1,a=0,u=0;u<t;u++)n.set(i,a,e[u]),++i>=r&&(i=++a+1);return n}}wo.prototype.klassSubType="DistanceMatrix";class xn extends ke{constructor(e,t,r){super(),this.matrix=e,this.rows=t,this.columns=r}}class Fy extends xn{constructor(e,t){Rr(e,t),super(e,e.rows,1),this.column=t}set(e,t,r){return this.matrix.set(e,this.column,r),this}get(e){return this.matrix.get(e,this.column)}}class By extends xn{constructor(e,t){Ja(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,r){return this.matrix.set(e,this.columnIndices[t],r),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}}class My extends xn{constructor(e){super(e,e.rows,e.columns)}set(e,t,r){return this.matrix.set(e,this.columns-t-1,r),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}}class Ny extends xn{constructor(e){super(e,e.rows,e.columns)}set(e,t,r){return this.matrix.set(this.rows-e-1,t,r),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}}class Sy extends xn{constructor(e,t){$r(e,t),super(e,1,e.columns),this.row=t}set(e,t,r){return this.matrix.set(this.row,t,r),this}get(e,t){return this.matrix.get(this.row,t)}}class Oy extends xn{constructor(e,t){Qa(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,r){return this.matrix.set(this.rowIndices[e],t,r),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}}class bo extends xn{constructor(e,t,r){Qa(e,t),Ja(e,r),super(e,t.length,r.length),this.rowIndices=t,this.columnIndices=r}set(e,t,r){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],r),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class Iy extends xn{constructor(e,t,r,n,i){eu(e,t,r,n,i),super(e,r-t+1,i-n+1),this.startRow=t,this.startColumn=n}set(e,t,r){return this.matrix.set(this.startRow+e,this.startColumn+t,r),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}}class Ty extends xn{constructor(e){super(e,e.columns,e.rows)}set(e,t,r){return this.matrix.set(t,e,r),this}get(e,t){return this.matrix.get(t,e)}}class Sf extends ke{constructor(e,t={}){const{rows:r=1}=t;if(e.length%r!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=e.length/r,this.data=e}set(e,t,r){let n=this._calculateIndex(e,t);return this.data[n]=r,this}get(e,t){let r=this._calculateIndex(e,t);return this.data[r]}_calculateIndex(e,t){return e*this.columns+t}}class Ar extends ke{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,r){return this.data[e][t]=r,this}get(e,t){return this.data[e][t]}}function $y(s,e){if(gr.isAnyArray(s))return s[0]&&gr.isAnyArray(s[0])?new Ar(s):new Sf(s,e);throw new Error("the argument is not an array")}class Eo{constructor(e){e=Ar.checkMatrix(e);let t=e.clone(),r=t.rows,n=t.columns,i=new Float64Array(r),a=1,u,f,c,h,d,p,v,x,_;for(u=0;u<r;u++)i[u]=u;for(x=new Float64Array(r),f=0;f<n;f++){for(u=0;u<r;u++)x[u]=t.get(u,f);for(u=0;u<r;u++){for(_=Math.min(u,f),d=0,c=0;c<_;c++)d+=t.get(u,c)*x[c];x[u]-=d,t.set(u,f,x[u])}for(h=f,u=f+1;u<r;u++)Math.abs(x[u])>Math.abs(x[h])&&(h=u);if(h!==f){for(c=0;c<n;c++)p=t.get(h,c),t.set(h,c,t.get(f,c)),t.set(f,c,p);v=i[h],i[h]=i[f],i[f]=v,a=-a}if(f<r&&t.get(f,f)!==0)for(u=f+1;u<r;u++)t.set(u,f,t.get(u,f)/t.get(f,f))}this.LU=t,this.pivotVector=i,this.pivotSign=a}isSingular(){let e=this.LU,t=e.columns;for(let r=0;r<t;r++)if(e.get(r,r)===0)return!0;return!1}solve(e){e=ve.checkMatrix(e);let t=this.LU;if(t.rows!==e.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let n=e.columns,i=e.subMatrixRow(this.pivotVector,0,n-1),a=t.columns,u,f,c;for(c=0;c<a;c++)for(u=c+1;u<a;u++)for(f=0;f<n;f++)i.set(u,f,i.get(u,f)-i.get(c,f)*t.get(u,c));for(c=a-1;c>=0;c--){for(f=0;f<n;f++)i.set(c,f,i.get(c,f)/t.get(c,c));for(u=0;u<c;u++)for(f=0;f<n;f++)i.set(u,f,i.get(u,f)-i.get(c,f)*t.get(u,c))}return i}get determinant(){let e=this.LU;if(!e.isSquare())throw new Error("Matrix must be square");let t=this.pivotSign,r=e.columns;for(let n=0;n<r;n++)t*=e.get(n,n);return t}get lowerTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,n=new ve(t,r);for(let i=0;i<t;i++)for(let a=0;a<r;a++)i>a?n.set(i,a,e.get(i,a)):i===a?n.set(i,a,1):n.set(i,a,0);return n}get upperTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,n=new ve(t,r);for(let i=0;i<t;i++)for(let a=0;a<r;a++)i<=a?n.set(i,a,e.get(i,a)):n.set(i,a,0);return n}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function yn(s,e){let t=0;return Math.abs(s)>Math.abs(e)?(t=e/s,Math.abs(s)*Math.sqrt(1+t*t)):e!==0?(t=s/e,Math.abs(e)*Math.sqrt(1+t*t)):0}class tu{constructor(e){e=Ar.checkMatrix(e);let t=e.clone(),r=e.rows,n=e.columns,i=new Float64Array(n),a,u,f,c;for(f=0;f<n;f++){let h=0;for(a=f;a<r;a++)h=yn(h,t.get(a,f));if(h!==0){for(t.get(f,f)<0&&(h=-h),a=f;a<r;a++)t.set(a,f,t.get(a,f)/h);for(t.set(f,f,t.get(f,f)+1),u=f+1;u<n;u++){for(c=0,a=f;a<r;a++)c+=t.get(a,f)*t.get(a,u);for(c=-c/t.get(f,f),a=f;a<r;a++)t.set(a,u,t.get(a,u)+c*t.get(a,f))}}i[f]=-h}this.QR=t,this.Rdiag=i}solve(e){e=ve.checkMatrix(e);let t=this.QR,r=t.rows;if(e.rows!==r)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let n=e.columns,i=e.clone(),a=t.columns,u,f,c,h;for(c=0;c<a;c++)for(f=0;f<n;f++){for(h=0,u=c;u<r;u++)h+=t.get(u,c)*i.get(u,f);for(h=-h/t.get(c,c),u=c;u<r;u++)i.set(u,f,i.get(u,f)+h*t.get(u,c))}for(c=a-1;c>=0;c--){for(f=0;f<n;f++)i.set(c,f,i.get(c,f)/this.Rdiag[c]);for(u=0;u<c;u++)for(f=0;f<n;f++)i.set(u,f,i.get(u,f)-i.get(c,f)*t.get(u,c))}return i.subMatrix(0,a-1,0,n-1)}isFullRank(){let e=this.QR.columns;for(let t=0;t<e;t++)if(this.Rdiag[t]===0)return!1;return!0}get upperTriangularMatrix(){let e=this.QR,t=e.columns,r=new ve(t,t),n,i;for(n=0;n<t;n++)for(i=0;i<t;i++)n<i?r.set(n,i,e.get(n,i)):n===i?r.set(n,i,this.Rdiag[n]):r.set(n,i,0);return r}get orthogonalMatrix(){let e=this.QR,t=e.rows,r=e.columns,n=new ve(t,r),i,a,u,f;for(u=r-1;u>=0;u--){for(i=0;i<t;i++)n.set(i,u,0);for(n.set(u,u,1),a=u;a<r;a++)if(e.get(u,u)!==0){for(f=0,i=u;i<t;i++)f+=e.get(i,u)*n.get(i,a);for(f=-f/e.get(u,u),i=u;i<t;i++)n.set(i,a,n.get(i,a)+f*e.get(i,u))}}return n}}class Oi{constructor(e,t={}){if(e=Ar.checkMatrix(e),e.isEmpty())throw new Error("Matrix must be non-empty");let r=e.rows,n=e.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:a=!0,autoTranspose:u=!1}=t;let f=!!i,c=!!a,h=!1,d;if(r<n)if(!u)d=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{d=e.transpose(),r=d.rows,n=d.columns,h=!0;let A=f;f=c,c=A}else d=e.clone();let p=Math.min(r,n),v=Math.min(r+1,n),x=new Float64Array(v),_=new ve(r,p),y=new ve(n,n),m=new Float64Array(n),w=new Float64Array(r),D=new Float64Array(v);for(let A=0;A<v;A++)D[A]=A;let C=Math.min(r-1,n),b=Math.max(0,Math.min(n-2,r)),F=Math.max(C,b);for(let A=0;A<F;A++){if(A<C){x[A]=0;for(let N=A;N<r;N++)x[A]=yn(x[A],d.get(N,A));if(x[A]!==0){d.get(A,A)<0&&(x[A]=-x[A]);for(let N=A;N<r;N++)d.set(N,A,d.get(N,A)/x[A]);d.set(A,A,d.get(A,A)+1)}x[A]=-x[A]}for(let N=A+1;N<n;N++){if(A<C&&x[A]!==0){let I=0;for(let R=A;R<r;R++)I+=d.get(R,A)*d.get(R,N);I=-I/d.get(A,A);for(let R=A;R<r;R++)d.set(R,N,d.get(R,N)+I*d.get(R,A))}m[N]=d.get(A,N)}if(f&&A<C)for(let N=A;N<r;N++)_.set(N,A,d.get(N,A));if(A<b){m[A]=0;for(let N=A+1;N<n;N++)m[A]=yn(m[A],m[N]);if(m[A]!==0){m[A+1]<0&&(m[A]=0-m[A]);for(let N=A+1;N<n;N++)m[N]/=m[A];m[A+1]+=1}if(m[A]=-m[A],A+1<r&&m[A]!==0){for(let N=A+1;N<r;N++)w[N]=0;for(let N=A+1;N<r;N++)for(let I=A+1;I<n;I++)w[N]+=m[I]*d.get(N,I);for(let N=A+1;N<n;N++){let I=-m[N]/m[A+1];for(let R=A+1;R<r;R++)d.set(R,N,d.get(R,N)+I*w[R])}}if(c)for(let N=A+1;N<n;N++)y.set(N,A,m[N])}}let B=Math.min(n,r+1);if(C<n&&(x[C]=d.get(C,C)),r<B&&(x[B-1]=0),b+1<B&&(m[b]=d.get(b,B-1)),m[B-1]=0,f){for(let A=C;A<p;A++){for(let N=0;N<r;N++)_.set(N,A,0);_.set(A,A,1)}for(let A=C-1;A>=0;A--)if(x[A]!==0){for(let N=A+1;N<p;N++){let I=0;for(let R=A;R<r;R++)I+=_.get(R,A)*_.get(R,N);I=-I/_.get(A,A);for(let R=A;R<r;R++)_.set(R,N,_.get(R,N)+I*_.get(R,A))}for(let N=A;N<r;N++)_.set(N,A,-_.get(N,A));_.set(A,A,1+_.get(A,A));for(let N=0;N<A-1;N++)_.set(N,A,0)}else{for(let N=0;N<r;N++)_.set(N,A,0);_.set(A,A,1)}}if(c)for(let A=n-1;A>=0;A--){if(A<b&&m[A]!==0)for(let N=A+1;N<n;N++){let I=0;for(let R=A+1;R<n;R++)I+=y.get(R,A)*y.get(R,N);I=-I/y.get(A+1,A);for(let R=A+1;R<n;R++)y.set(R,N,y.get(R,N)+I*y.get(R,A))}for(let N=0;N<n;N++)y.set(N,A,0);y.set(A,A,1)}let M=B-1,O=Number.EPSILON;for(;B>0;){let A,N;for(A=B-2;A>=-1&&A!==-1;A--){const I=Number.MIN_VALUE+O*Math.abs(x[A]+Math.abs(x[A+1]));if(Math.abs(m[A])<=I||Number.isNaN(m[A])){m[A]=0;break}}if(A===B-2)N=4;else{let I;for(I=B-1;I>=A&&I!==A;I--){let R=(I!==B?Math.abs(m[I]):0)+(I!==A+1?Math.abs(m[I-1]):0);if(Math.abs(x[I])<=O*R){x[I]=0;break}}I===A?N=3:I===B-1?N=1:(N=2,A=I)}switch(A++,N){case 1:{let I=m[B-2];m[B-2]=0;for(let R=B-2;R>=A;R--){let k=yn(x[R],I),z=x[R]/k,L=I/k;if(x[R]=k,R!==A&&(I=-L*m[R-1],m[R-1]=z*m[R-1]),c)for(let G=0;G<n;G++)k=z*y.get(G,R)+L*y.get(G,B-1),y.set(G,B-1,-L*y.get(G,R)+z*y.get(G,B-1)),y.set(G,R,k)}break}case 2:{let I=m[A-1];m[A-1]=0;for(let R=A;R<B;R++){let k=yn(x[R],I),z=x[R]/k,L=I/k;if(x[R]=k,I=-L*m[R],m[R]=z*m[R],f)for(let G=0;G<r;G++)k=z*_.get(G,R)+L*_.get(G,A-1),_.set(G,A-1,-L*_.get(G,R)+z*_.get(G,A-1)),_.set(G,R,k)}break}case 3:{const I=Math.max(Math.abs(x[B-1]),Math.abs(x[B-2]),Math.abs(m[B-2]),Math.abs(x[A]),Math.abs(m[A])),R=x[B-1]/I,k=x[B-2]/I,z=m[B-2]/I,L=x[A]/I,G=m[A]/I,H=((k+R)*(k-R)+z*z)/2,ee=R*z*(R*z);let te=0;(H!==0||ee!==0)&&(H<0?te=0-Math.sqrt(H*H+ee):te=Math.sqrt(H*H+ee),te=ee/(H+te));let j=(L+R)*(L-R)+te,X=L*G;for(let Y=A;Y<B-1;Y++){let Q=yn(j,X);Q===0&&(Q=Number.MIN_VALUE);let pe=j/Q,De=X/Q;if(Y!==A&&(m[Y-1]=Q),j=pe*x[Y]+De*m[Y],m[Y]=pe*m[Y]-De*x[Y],X=De*x[Y+1],x[Y+1]=pe*x[Y+1],c)for(let we=0;we<n;we++)Q=pe*y.get(we,Y)+De*y.get(we,Y+1),y.set(we,Y+1,-De*y.get(we,Y)+pe*y.get(we,Y+1)),y.set(we,Y,Q);if(Q=yn(j,X),Q===0&&(Q=Number.MIN_VALUE),pe=j/Q,De=X/Q,x[Y]=Q,j=pe*m[Y]+De*x[Y+1],x[Y+1]=-De*m[Y]+pe*x[Y+1],X=De*m[Y+1],m[Y+1]=pe*m[Y+1],f&&Y<r-1)for(let we=0;we<r;we++)Q=pe*_.get(we,Y)+De*_.get(we,Y+1),_.set(we,Y+1,-De*_.get(we,Y)+pe*_.get(we,Y+1)),_.set(we,Y,Q)}m[B-2]=j;break}case 4:{if(x[A]<=0&&(x[A]=x[A]<0?-x[A]:0,c))for(let I=0;I<=M;I++)y.set(I,A,-y.get(I,A));for(;A<M&&!(x[A]>=x[A+1]);){let I=x[A];if(x[A]=x[A+1],x[A+1]=I,c&&A<n-1)for(let R=0;R<n;R++)I=y.get(R,A+1),y.set(R,A+1,y.get(R,A)),y.set(R,A,I);if(f&&A<r-1)for(let R=0;R<r;R++)I=_.get(R,A+1),_.set(R,A+1,_.get(R,A)),_.set(R,A,I);A++}B--;break}}}if(h){let A=y;y=_,_=A}this.m=r,this.n=n,this.s=x,this.U=_,this.V=y}solve(e){let t=e,r=this.threshold,n=this.s.length,i=ve.zeros(n,n);for(let p=0;p<n;p++)Math.abs(this.s[p])<=r?i.set(p,p,0):i.set(p,p,1/this.s[p]);let a=this.U,u=this.rightSingularVectors,f=u.mmul(i),c=u.rows,h=a.rows,d=ve.zeros(c,h);for(let p=0;p<c;p++)for(let v=0;v<h;v++){let x=0;for(let _=0;_<n;_++)x+=f.get(p,_)*a.get(v,_);d.set(p,v,x)}return d.mmul(t)}solveForDiagonal(e){return this.solve(ve.diag(e))}inverse(){let e=this.V,t=this.threshold,r=e.rows,n=e.columns,i=new ve(r,this.s.length);for(let h=0;h<r;h++)for(let d=0;d<n;d++)Math.abs(this.s[d])>t&&i.set(h,d,e.get(h,d)/this.s[d]);let a=this.U,u=a.rows,f=a.columns,c=new ve(r,u);for(let h=0;h<r;h++)for(let d=0;d<u;d++){let p=0;for(let v=0;v<f;v++)p+=i.get(h,v)*a.get(d,v);c.set(h,d,p)}return c}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let e=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,t=0,r=this.s;for(let n=0,i=r.length;n<i;n++)r[n]>e&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ve.diag(this.s)}}function Ry(s,e=!1){return s=Ar.checkMatrix(s),e?new Oi(s).inverse():Of(s,ve.eye(s.rows))}function Of(s,e,t=!1){return s=Ar.checkMatrix(s),e=Ar.checkMatrix(e),t?new Oi(s).solve(e):s.isSquare()?new Eo(s).solve(e):new tu(s).solve(e)}function Ao(s){if(s=ve.checkMatrix(s),s.isSquare()){if(s.columns===0)return 1;let e,t,r,n;if(s.columns===2)return e=s.get(0,0),t=s.get(0,1),r=s.get(1,0),n=s.get(1,1),e*n-t*r;if(s.columns===3){let i,a,u;return i=new bo(s,[1,2],[1,2]),a=new bo(s,[1,2],[0,2]),u=new bo(s,[1,2],[0,1]),e=s.get(0,0),t=s.get(0,1),r=s.get(0,2),e*Ao(i)-t*Ao(a)+r*Ao(u)}else return new Eo(s).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Ly(s,e){let t=[];for(let r=0;r<s;r++)r!==e&&t.push(r);return t}function Py(s,e,t,r=1e-9,n=1e-9){if(s>n)return new Array(e.rows+1).fill(0);{let i=e.addRow(t,[0]);for(let a=0;a<i.rows;a++)Math.abs(i.get(a,0))<r&&i.set(a,0,0);return i.to1DArray()}}function ky(s,e={}){const{thresholdValue:t=1e-9,thresholdError:r=1e-9}=e;s=ve.checkMatrix(s);let n=s.rows,i=new ve(n,n);for(let a=0;a<n;a++){let u=ve.columnVector(s.getRow(a)),f=s.subMatrixRow(Ly(n,a)).transpose(),h=new Oi(f).solve(u),d=ve.sub(u,f.mmul(h)).abs().max();i.setRow(a,Py(d,h,a,t,r))}return i}function zy(s,e=Number.EPSILON){if(s=ve.checkMatrix(s),s.isEmpty())return s.transpose();let t=new Oi(s,{autoTranspose:!0}),r=t.leftSingularVectors,n=t.rightSingularVectors,i=t.diagonal;for(let a=0;a<i.length;a++)Math.abs(i[a])>e?i[a]=1/i[a]:i[a]=0;return n.mmul(ve.diag(i).mmul(r.transpose()))}function qy(s,e=s,t={}){s=new ve(s);let r=!1;if(typeof e=="object"&&!ve.isMatrix(e)&&!gr.isAnyArray(e)?(t=e,e=s,r=!0):e=new ve(e),s.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:n=!0}=t;n&&(s=s.center("column"),r||(e=e.center("column")));const i=s.transpose().mmul(e);for(let a=0;a<i.rows;a++)for(let u=0;u<i.columns;u++)i.set(a,u,i.get(a,u)*(1/(s.rows-1)));return i}function Uy(s,e=s,t={}){s=new ve(s);let r=!1;if(typeof e=="object"&&!ve.isMatrix(e)&&!gr.isAnyArray(e)?(t=e,e=s,r=!0):e=new ve(e),s.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:n=!0,scale:i=!0}=t;n&&(s.center("column"),r||e.center("column")),i&&(s.scale("column"),r||e.scale("column"));const a=s.standardDeviation("column",{unbiased:!0}),u=r?a:e.standardDeviation("column",{unbiased:!0}),f=s.transpose().mmul(e);for(let c=0;c<f.rows;c++)for(let h=0;h<f.columns;h++)f.set(c,h,f.get(c,h)*(1/(a[c]*u[h]))*(1/(s.rows-1)));return f}let If=class{constructor(e,t={}){const{assumeSymmetric:r=!1}=t;if(e=Ar.checkMatrix(e),!e.isSquare())throw new Error("Matrix is not a square matrix");if(e.isEmpty())throw new Error("Matrix must be non-empty");let n=e.columns,i=new ve(n,n),a=new Float64Array(n),u=new Float64Array(n),f=e,c,h,d=!1;if(r?d=!0:d=e.isSymmetric(),d){for(c=0;c<n;c++)for(h=0;h<n;h++)i.set(c,h,f.get(c,h));Wy(n,u,a,i),Hy(n,u,a,i)}else{let p=new ve(n,n),v=new Float64Array(n);for(h=0;h<n;h++)for(c=0;c<n;c++)p.set(c,h,f.get(c,h));jy(n,p,v,i),Yy(n,u,a,i,p)}this.n=n,this.e=u,this.d=a,this.V=i}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let e=this.n,t=this.e,r=this.d,n=new ve(e,e),i,a;for(i=0;i<e;i++){for(a=0;a<e;a++)n.set(i,a,0);n.set(i,i,r[i]),t[i]>0?n.set(i,i+1,t[i]):t[i]<0&&n.set(i,i-1,t[i])}return n}};function Wy(s,e,t,r){let n,i,a,u,f,c,h,d;for(f=0;f<s;f++)t[f]=r.get(s-1,f);for(u=s-1;u>0;u--){for(d=0,a=0,c=0;c<u;c++)d=d+Math.abs(t[c]);if(d===0)for(e[u]=t[u-1],f=0;f<u;f++)t[f]=r.get(u-1,f),r.set(u,f,0),r.set(f,u,0);else{for(c=0;c<u;c++)t[c]/=d,a+=t[c]*t[c];for(n=t[u-1],i=Math.sqrt(a),n>0&&(i=-i),e[u]=d*i,a=a-n*i,t[u-1]=n-i,f=0;f<u;f++)e[f]=0;for(f=0;f<u;f++){for(n=t[f],r.set(f,u,n),i=e[f]+r.get(f,f)*n,c=f+1;c<=u-1;c++)i+=r.get(c,f)*t[c],e[c]+=r.get(c,f)*n;e[f]=i}for(n=0,f=0;f<u;f++)e[f]/=a,n+=e[f]*t[f];for(h=n/(a+a),f=0;f<u;f++)e[f]-=h*t[f];for(f=0;f<u;f++){for(n=t[f],i=e[f],c=f;c<=u-1;c++)r.set(c,f,r.get(c,f)-(n*e[c]+i*t[c]));t[f]=r.get(u-1,f),r.set(u,f,0)}}t[u]=a}for(u=0;u<s-1;u++){if(r.set(s-1,u,r.get(u,u)),r.set(u,u,1),a=t[u+1],a!==0){for(c=0;c<=u;c++)t[c]=r.get(c,u+1)/a;for(f=0;f<=u;f++){for(i=0,c=0;c<=u;c++)i+=r.get(c,u+1)*r.get(c,f);for(c=0;c<=u;c++)r.set(c,f,r.get(c,f)-i*t[c])}}for(c=0;c<=u;c++)r.set(c,u+1,0)}for(f=0;f<s;f++)t[f]=r.get(s-1,f),r.set(s-1,f,0);r.set(s-1,s-1,1),e[0]=0}function Hy(s,e,t,r){let n,i,a,u,f,c,h,d,p,v,x,_,y,m,w,D;for(a=1;a<s;a++)e[a-1]=e[a];e[s-1]=0;let C=0,b=0,F=Number.EPSILON;for(c=0;c<s;c++){for(b=Math.max(b,Math.abs(t[c])+Math.abs(e[c])),h=c;h<s&&!(Math.abs(e[h])<=F*b);)h++;if(h>c)do{for(n=t[c],d=(t[c+1]-n)/(2*e[c]),p=yn(d,1),d<0&&(p=-p),t[c]=e[c]/(d+p),t[c+1]=e[c]*(d+p),v=t[c+1],i=n-t[c],a=c+2;a<s;a++)t[a]-=i;for(C=C+i,d=t[h],x=1,_=x,y=x,m=e[c+1],w=0,D=0,a=h-1;a>=c;a--)for(y=_,_=x,D=w,n=x*e[a],i=x*d,p=yn(d,e[a]),e[a+1]=w*p,w=e[a]/p,x=d/p,d=x*t[a]-w*n,t[a+1]=i+w*(x*n+w*t[a]),f=0;f<s;f++)i=r.get(f,a+1),r.set(f,a+1,w*r.get(f,a)+x*i),r.set(f,a,x*r.get(f,a)-w*i);d=-w*D*y*m*e[c]/v,e[c]=w*d,t[c]=x*d}while(Math.abs(e[c])>F*b);t[c]=t[c]+C,e[c]=0}for(a=0;a<s-1;a++){for(f=a,d=t[a],u=a+1;u<s;u++)t[u]<d&&(f=u,d=t[u]);if(f!==a)for(t[f]=t[a],t[a]=d,u=0;u<s;u++)d=r.get(u,a),r.set(u,a,r.get(u,f)),r.set(u,f,d)}}function jy(s,e,t,r){let n=0,i=s-1,a,u,f,c,h,d,p;for(d=n+1;d<=i-1;d++){for(p=0,c=d;c<=i;c++)p=p+Math.abs(e.get(c,d-1));if(p!==0){for(f=0,c=i;c>=d;c--)t[c]=e.get(c,d-1)/p,f+=t[c]*t[c];for(u=Math.sqrt(f),t[d]>0&&(u=-u),f=f-t[d]*u,t[d]=t[d]-u,h=d;h<s;h++){for(a=0,c=i;c>=d;c--)a+=t[c]*e.get(c,h);for(a=a/f,c=d;c<=i;c++)e.set(c,h,e.get(c,h)-a*t[c])}for(c=0;c<=i;c++){for(a=0,h=i;h>=d;h--)a+=t[h]*e.get(c,h);for(a=a/f,h=d;h<=i;h++)e.set(c,h,e.get(c,h)-a*t[h])}t[d]=p*t[d],e.set(d,d-1,p*u)}}for(c=0;c<s;c++)for(h=0;h<s;h++)r.set(c,h,c===h?1:0);for(d=i-1;d>=n+1;d--)if(e.get(d,d-1)!==0){for(c=d+1;c<=i;c++)t[c]=e.get(c,d-1);for(h=d;h<=i;h++){for(u=0,c=d;c<=i;c++)u+=t[c]*r.get(c,h);for(u=u/t[d]/e.get(d,d-1),c=d;c<=i;c++)r.set(c,h,r.get(c,h)+u*t[c])}}}function Yy(s,e,t,r,n){let i=s-1,a=0,u=s-1,f=Number.EPSILON,c=0,h=0,d=0,p=0,v=0,x=0,_=0,y=0,m,w,D,C,b,F,B,M,O,A,N,I,R,k,z;for(m=0;m<s;m++)for((m<a||m>u)&&(t[m]=n.get(m,m),e[m]=0),w=Math.max(m-1,0);w<s;w++)h=h+Math.abs(n.get(m,w));for(;i>=a;){for(C=i;C>a&&(x=Math.abs(n.get(C-1,C-1))+Math.abs(n.get(C,C)),x===0&&(x=h),!(Math.abs(n.get(C,C-1))<f*x));)C--;if(C===i)n.set(i,i,n.get(i,i)+c),t[i]=n.get(i,i),e[i]=0,i--,y=0;else if(C===i-1){if(B=n.get(i,i-1)*n.get(i-1,i),d=(n.get(i-1,i-1)-n.get(i,i))/2,p=d*d+B,_=Math.sqrt(Math.abs(p)),n.set(i,i,n.get(i,i)+c),n.set(i-1,i-1,n.get(i-1,i-1)+c),M=n.get(i,i),p>=0){for(_=d>=0?d+_:d-_,t[i-1]=M+_,t[i]=t[i-1],_!==0&&(t[i]=M-B/_),e[i-1]=0,e[i]=0,M=n.get(i,i-1),x=Math.abs(M)+Math.abs(_),d=M/x,p=_/x,v=Math.sqrt(d*d+p*p),d=d/v,p=p/v,w=i-1;w<s;w++)_=n.get(i-1,w),n.set(i-1,w,p*_+d*n.get(i,w)),n.set(i,w,p*n.get(i,w)-d*_);for(m=0;m<=i;m++)_=n.get(m,i-1),n.set(m,i-1,p*_+d*n.get(m,i)),n.set(m,i,p*n.get(m,i)-d*_);for(m=a;m<=u;m++)_=r.get(m,i-1),r.set(m,i-1,p*_+d*r.get(m,i)),r.set(m,i,p*r.get(m,i)-d*_)}else t[i-1]=M+d,t[i]=M+d,e[i-1]=_,e[i]=-_;i=i-2,y=0}else{if(M=n.get(i,i),O=0,B=0,C<i&&(O=n.get(i-1,i-1),B=n.get(i,i-1)*n.get(i-1,i)),y===10){for(c+=M,m=a;m<=i;m++)n.set(m,m,n.get(m,m)-M);x=Math.abs(n.get(i,i-1))+Math.abs(n.get(i-1,i-2)),M=O=.75*x,B=-.4375*x*x}if(y===30&&(x=(O-M)/2,x=x*x+B,x>0)){for(x=Math.sqrt(x),O<M&&(x=-x),x=M-B/((O-M)/2+x),m=a;m<=i;m++)n.set(m,m,n.get(m,m)-x);c+=x,M=O=B=.964}for(y=y+1,b=i-2;b>=C&&(_=n.get(b,b),v=M-_,x=O-_,d=(v*x-B)/n.get(b+1,b)+n.get(b,b+1),p=n.get(b+1,b+1)-_-v-x,v=n.get(b+2,b+1),x=Math.abs(d)+Math.abs(p)+Math.abs(v),d=d/x,p=p/x,v=v/x,!(b===C||Math.abs(n.get(b,b-1))*(Math.abs(p)+Math.abs(v))<f*(Math.abs(d)*(Math.abs(n.get(b-1,b-1))+Math.abs(_)+Math.abs(n.get(b+1,b+1))))));)b--;for(m=b+2;m<=i;m++)n.set(m,m-2,0),m>b+2&&n.set(m,m-3,0);for(D=b;D<=i-1&&(k=D!==i-1,D!==b&&(d=n.get(D,D-1),p=n.get(D+1,D-1),v=k?n.get(D+2,D-1):0,M=Math.abs(d)+Math.abs(p)+Math.abs(v),M!==0&&(d=d/M,p=p/M,v=v/M)),M!==0);D++)if(x=Math.sqrt(d*d+p*p+v*v),d<0&&(x=-x),x!==0){for(D!==b?n.set(D,D-1,-x*M):C!==b&&n.set(D,D-1,-n.get(D,D-1)),d=d+x,M=d/x,O=p/x,_=v/x,p=p/d,v=v/d,w=D;w<s;w++)d=n.get(D,w)+p*n.get(D+1,w),k&&(d=d+v*n.get(D+2,w),n.set(D+2,w,n.get(D+2,w)-d*_)),n.set(D,w,n.get(D,w)-d*M),n.set(D+1,w,n.get(D+1,w)-d*O);for(m=0;m<=Math.min(i,D+3);m++)d=M*n.get(m,D)+O*n.get(m,D+1),k&&(d=d+_*n.get(m,D+2),n.set(m,D+2,n.get(m,D+2)-d*v)),n.set(m,D,n.get(m,D)-d),n.set(m,D+1,n.get(m,D+1)-d*p);for(m=a;m<=u;m++)d=M*r.get(m,D)+O*r.get(m,D+1),k&&(d=d+_*r.get(m,D+2),r.set(m,D+2,r.get(m,D+2)-d*v)),r.set(m,D,r.get(m,D)-d),r.set(m,D+1,r.get(m,D+1)-d*p)}}}if(h!==0){for(i=s-1;i>=0;i--)if(d=t[i],p=e[i],p===0)for(C=i,n.set(i,i,1),m=i-1;m>=0;m--){for(B=n.get(m,m)-d,v=0,w=C;w<=i;w++)v=v+n.get(m,w)*n.get(w,i);if(e[m]<0)_=B,x=v;else if(C=m,e[m]===0?n.set(m,i,B!==0?-v/B:-v/(f*h)):(M=n.get(m,m+1),O=n.get(m+1,m),p=(t[m]-d)*(t[m]-d)+e[m]*e[m],F=(M*x-_*v)/p,n.set(m,i,F),n.set(m+1,i,Math.abs(M)>Math.abs(_)?(-v-B*F)/M:(-x-O*F)/_)),F=Math.abs(n.get(m,i)),f*F*F>1)for(w=m;w<=i;w++)n.set(w,i,n.get(w,i)/F)}else if(p<0)for(C=i-1,Math.abs(n.get(i,i-1))>Math.abs(n.get(i-1,i))?(n.set(i-1,i-1,p/n.get(i,i-1)),n.set(i-1,i,-(n.get(i,i)-d)/n.get(i,i-1))):(z=Co(0,-n.get(i-1,i),n.get(i-1,i-1)-d,p),n.set(i-1,i-1,z[0]),n.set(i-1,i,z[1])),n.set(i,i-1,0),n.set(i,i,1),m=i-2;m>=0;m--){for(A=0,N=0,w=C;w<=i;w++)A=A+n.get(m,w)*n.get(w,i-1),N=N+n.get(m,w)*n.get(w,i);if(B=n.get(m,m)-d,e[m]<0)_=B,v=A,x=N;else if(C=m,e[m]===0?(z=Co(-A,-N,B,p),n.set(m,i-1,z[0]),n.set(m,i,z[1])):(M=n.get(m,m+1),O=n.get(m+1,m),I=(t[m]-d)*(t[m]-d)+e[m]*e[m]-p*p,R=(t[m]-d)*2*p,I===0&&R===0&&(I=f*h*(Math.abs(B)+Math.abs(p)+Math.abs(M)+Math.abs(O)+Math.abs(_))),z=Co(M*v-_*A+p*N,M*x-_*N-p*A,I,R),n.set(m,i-1,z[0]),n.set(m,i,z[1]),Math.abs(M)>Math.abs(_)+Math.abs(p)?(n.set(m+1,i-1,(-A-B*n.get(m,i-1)+p*n.get(m,i))/M),n.set(m+1,i,(-N-B*n.get(m,i)-p*n.get(m,i-1))/M)):(z=Co(-v-O*n.get(m,i-1),-x-O*n.get(m,i),_,p),n.set(m+1,i-1,z[0]),n.set(m+1,i,z[1]))),F=Math.max(Math.abs(n.get(m,i-1)),Math.abs(n.get(m,i))),f*F*F>1)for(w=m;w<=i;w++)n.set(w,i-1,n.get(w,i-1)/F),n.set(w,i,n.get(w,i)/F)}for(m=0;m<s;m++)if(m<a||m>u)for(w=m;w<s;w++)r.set(m,w,n.get(m,w));for(w=s-1;w>=a;w--)for(m=a;m<=u;m++){for(_=0,D=a;D<=Math.min(w,u);D++)_=_+r.get(m,D)*n.get(D,w);r.set(m,w,_)}}}function Co(s,e,t,r){let n,i;return Math.abs(t)>Math.abs(r)?(n=r/t,i=t+n*r,[(s+n*e)/i,(e-n*s)/i]):(n=t/r,i=r+n*t,[(n*s+e)/i,(n*e-s)/i])}class Tf{constructor(e){if(e=Ar.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let t=e,r=t.rows,n=new ve(r,r),i=!0,a,u,f;for(u=0;u<r;u++){let c=0;for(f=0;f<u;f++){let h=0;for(a=0;a<f;a++)h+=n.get(f,a)*n.get(u,a);h=(t.get(u,f)-h)/n.get(f,f),n.set(u,f,h),c=c+h*h}for(c=t.get(u,u)-c,i&=c>0,n.set(u,u,Math.sqrt(Math.max(c,0))),f=u+1;f<r;f++)n.set(u,f,0)}this.L=n,this.positiveDefinite=!!i}isPositiveDefinite(){return this.positiveDefinite}solve(e){e=Ar.checkMatrix(e);let t=this.L,r=t.rows;if(e.rows!==r)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let n=e.columns,i=e.clone(),a,u,f;for(f=0;f<r;f++)for(u=0;u<n;u++){for(a=0;a<f;a++)i.set(f,u,i.get(f,u)-i.get(a,u)*t.get(f,a));i.set(f,u,i.get(f,u)/t.get(f,f))}for(f=r-1;f>=0;f--)for(u=0;u<n;u++){for(a=f+1;a<r;a++)i.set(f,u,i.get(f,u)-i.get(a,u)*t.get(a,f));i.set(f,u,i.get(f,u)/t.get(f,f))}return i}get lowerTriangularMatrix(){return this.L}}class $f{constructor(e,t={}){e=Ar.checkMatrix(e);let{Y:r}=t;const{scaleScores:n=!1,maxIterations:i=1e3,terminationCriteria:a=1e-10}=t;let u;if(r){if(gr.isAnyArray(r)&&typeof r[0]=="number"?r=ve.columnVector(r):r=Ar.checkMatrix(r),r.rows!==e.rows)throw new Error("Y should have the same number of rows as X");u=r.getColumnVector(0)}else u=e.getColumnVector(0);let f=1,c,h,d,p;for(let v=0;v<i&&f>a;v++)d=e.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),d=d.div(d.norm()),c=e.mmul(d).div(d.transpose().mmul(d).get(0,0)),v>0&&(f=c.clone().sub(p).pow(2).sum()),p=c.clone(),r?(h=r.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0)),h=h.div(h.norm()),u=r.mmul(h).div(h.transpose().mmul(h).get(0,0))):u=c;if(r){let v=e.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0));v=v.div(v.norm());let x=e.clone().sub(c.clone().mmul(v.transpose())),_=u.transpose().mmul(c).div(c.transpose().mmul(c).get(0,0)),y=r.clone().sub(c.clone().mulS(_.get(0,0)).mmul(h.transpose()));this.t=c,this.p=v.transpose(),this.w=d.transpose(),this.q=h,this.u=u,this.s=c.transpose().mmul(c),this.xResidual=x,this.yResidual=y,this.betas=_}else this.w=d.transpose(),this.s=c.transpose().mmul(c).sqrt(),n?this.t=c.clone().div(this.s.get(0,0)):this.t=c,this.xResidual=e.sub(c.mmul(d.transpose()))}}We.AbstractMatrix=ke,We.CHO=Tf,We.CholeskyDecomposition=Tf,We.DistanceMatrix=wo,We.EVD=If;var Zy=We.EigenvalueDecomposition=If;We.LU=Eo,We.LuDecomposition=Eo;var Rf=We.Matrix=ve;We.MatrixColumnSelectionView=By,We.MatrixColumnView=Fy,We.MatrixFlipColumnView=My,We.MatrixFlipRowView=Ny,We.MatrixRowSelectionView=Oy,We.MatrixRowView=Sy,We.MatrixSelectionView=bo,We.MatrixSubView=Iy,We.MatrixTransposeView=Ty,We.NIPALS=$f,We.Nipals=$f,We.QR=tu,We.QrDecomposition=tu,We.SVD=Oi,We.SingularValueDecomposition=Oi,We.SymmetricMatrix=ii,We.WrapperMatrix1D=Sf,We.WrapperMatrix2D=Ar,We.correlation=Uy,We.covariance=qy;var Lf=We.default=ve;We.determinant=Ao,We.inverse=Ry,We.linearDependencies=ky,We.pseudoInverse=zy,We.solve=Of,We.wrap=$y;const Pf=Zy,kf=Rf;Lf.Matrix&&Lf.Matrix;class Vy{constructor(e){U(this,"_errorListener");this._errorListener=e}new({rows:e,columns:t,initial_value:r}={}){return new ru(e,t,r,this._errorListener)}avg({id:e}){return e==null?void 0:e.avg()}col({id:e,column:t}){return e==null?void 0:e.col({column:t})}det({id:e}){return e==null?void 0:e.det()}get({id:e,row:t,column:r}){return e==null?void 0:e.get({row:t,column:r})}inv({id:e}){return e==null?void 0:e.inv()}max({id:e}){return e==null?void 0:e.max()}min({id:e}){return e==null?void 0:e.min()}pow({id:e,power:t}){return e==null?void 0:e.pow({power:t})}row({id:e,row:t}){return e==null?void 0:e.row({row:t})}set({id:e,row:t,column:r,value:n}){e==null||e.set({row:t,column:r,value:n})}sum({id1:e,id2:t}){return e==null?void 0:e.sum({id2:t})}copy({id:e}){return e==null?void 0:e.copy()}diff({id1:e,id2:t}){return e==null?void 0:e.diff({id2:t})}rows({id:e}){return e==null?void 0:e.rows()}columns({id:e}){return e==null?void 0:e.columns()}fill({id:e,value:t,from_row:r,to_row:n,from_column:i,to_column:a}){e==null||e.fill({value:t,from_row:r,to_row:n,from_column:i,to_column:a})}kron({id1:e,id2:t}){return e==null?void 0:e.kron({id2:t})}mode({id:e}){return e==null?void 0:e.mode()}mult({id1:e,id2:t}){return e==null?void 0:e.mult({id2:t})}pinv({id:e}){return e==null?void 0:e.pinv()}rank({id:e}){return e==null?void 0:e.rank()}sort({id:e,column:t,order:r}){e==null||e.sort({column:t,order:r})}trace({id:e}){return e==null?void 0:e.trace()}concat({id1:e,id2:t}){return e==null?void 0:e.concat({id2:t})}median({id:e}){return e==null?void 0:e.median()}add_col({id:e,column:t,array_id:r}){e==null||e.add_col({column:t,array_id:r})}add_row({id:e,row:t,array_id:r}){e==null||e.add_row({row:t,array_id:r})}is_zero({id:e}){return e==null?void 0:e.is_zero()}reshape({id:e,rows:t,columns:r},n){return e==null?void 0:e.reshape({rows:t,columns:r},n)}reverse({id:e}){e==null||e.reverse()}is_binary({id:e}){return e==null?void 0:e.is_binary()}is_square({id:e}){return e==null?void 0:e.is_square()}submatrix({id:e,from_row:t,to_row:r,from_column:n,to_column:i}){return e==null?void 0:e.submatrix({from_row:t,to_row:r,from_column:n,to_column:i})}swap_rows({id:e,row1:t,row2:r}){e==null||e.swap_rows({row1:t,row2:r})}transpose({id:e}){return e==null?void 0:e.transpose()}remove_col({id:e,column:t}){return e==null?void 0:e.remove_col({column:t})}remove_row({id:e,row:t}){return e==null?void 0:e.remove_row({row:t})}eigenvalues({id:e}){return e==null?void 0:e.eigenvalues()}is_diagonal({id:e}){return e==null?void 0:e.is_diagonal()}is_identity({id:e}){return e==null?void 0:e.is_identity()}eigenvectors({id:e}){return e==null?void 0:e.eigenvectors()}is_symmetric({id:e}){return e==null?void 0:e.is_symmetric()}swap_columns({id:e,column1:t,column2:r}){e==null||e.swap_columns({column1:t,column2:r})}is_stochastic({id:e}){return e==null?void 0:e.is_stochastic()}is_triangular({id:e}){return e==null?void 0:e.is_triangular()}elements_count({id:e}){return e==null?void 0:e.elements_count()}is_antidiagonal({id:e}){return e==null?void 0:e.is_antidiagonal()}is_antisymmetric({id:e}){return e==null?void 0:e.is_antisymmetric()}}class ru{constructor(e=0,t=0,r=void 0,n){U(this,"_matrixInstance");U(this,"_errorListener");this._matrixInstance=this._createMatrix(e,t,r),this._errorListener=n}get _matrixArray(){return this._matrixInstance.map(e=>[...e._value])}get _value(){return this._matrixInstance}set _value(e){this._matrixInstance=e}get isMatrix(){return!0}_createMatrix(e,t,r){return Array.from(new Array(e),()=>new it(t,r,this._errorListener))}avg(){let e=0,t=0;for(const n of this._matrixInstance)for(const i of n._value)e+=me(i)?0:i,t+=1;return e/t}col({column:e}){const t=[],r=new it(0,void 0,this._errorListener);if(me(e))return r;for(const n of this._matrixInstance)t.push(n._value[e]);return r._value=t,r}det(){return Ef(this._matrixArray)}get({row:e,column:t}){var r,n;if(!(me(e)||me(t)))return(n=(r=this._matrixInstance[e])==null?void 0:r._value)==null?void 0:n[t]}inv(){const e=mo(this._matrixArray);return this._newMatrix(e)}max(){return zx(this._matrixArray)}min(){return Xa(this._matrixArray)}pow({power:e}){const t=me(e)?this._matrixArray:Ux(this._matrixArray,e);return this._newMatrix(t)}row({row:e}){return me(e)?new it(0,void 0,this._errorListener):this._matrixInstance[e]}set({row:e,column:t,value:r}){me(e)||me(t)||this._matrixInstance[e].set({index:t,value:r})}sum({id2:e}){const t=cs(this._matrixArray,typeof e=="number"?e:e._matrixArray);return this._newMatrix(t)}copy(){return this._newMatrix(this._matrixArray)}diff({id2:e}){const t=Tx(this._matrixArray,typeof e=="number"?e:e._matrixArray);return this._newMatrix(t)}rows(){return this._matrixInstance.length}columns(){return this._matrixArray.length&&this._matrixArray[0].length}fill({value:e,from_row:t,to_row:r,from_column:n,to_column:i}={}){me(t)&&(t=0),me(r)&&(r=this.rows()),me(n)&&(n=0),me(i)&&(i=this.columns());for(const[a,u]of this._matrixInstance.entries())for(const[f]of u._value.entries())a<r&&a>=t&&f>=n&&f<i&&u.set({index:f,value:e})}kron({id2:e}){const t=Ox(this._matrixArray,e._matrixArray);return this._newMatrix(t)}mode(){return Xa(gf(this._matrixArray))}mult({id2:e}){const t=typeof e=="number"?e:e._matrixArray?e._matrixArray:e._value,r=Bi(this._matrixArray,t);return this._newMatrix(r)}pinv(){const e=qx(this._matrixArray);return this._newMatrix(e)}rank(){return this._matrixRank(this._matrixArray)}sort({column:e,order:t=Qn.ascending}={}){me(e)&&(e=0),this._matrixInstance.sort((r,n)=>{const i=r._value[e],a=n._value[e];return t!==Qn.descending?i-a:a-i})}trace(){return kx(this._matrixArray)}concat({id2:e}){for(const t of e._value)this._matrixInstance.push(t);return this}median(){return Af(this._matrixArray)}add_col({column:e,array_id:t}={}){me(e)&&(e=this.columns());for(const[r,n]of this._matrixInstance.entries())n.insert({index:e,value:t?t._value[r]:void 0})}add_row({row:e,array_id:t}){me(e)&&(e=this.rows()),this._matrixInstance.splice(e,0,t||new it(this.columns(),void 0,this._errorListener))}is_zero(){return this._matrixArray.every(e=>e.every(t=>t===0))}reshape({rows:e=0,columns:t=0},r){if(e*t!==this.columns()*this.rows()){this._errorListener.addError("New matrix must be of same area as original matrix",r,Ve.Error);return}const n=Bx(this._matrixArray,[e,t]);this._matrixInstance=n.map(i=>{const a=new it(0,void 0,this._errorListener);return a._value=[...i],a})}reverse(){this._matrixInstance.reverse();for(const e of this._matrixInstance)e.reverse()}is_binary(){return this._matrixArray.every(e=>e.every(t=>t===0||t===1))}is_square(){return this.rows()===this.columns()}submatrix({from_row:e,to_row:t,from_column:r,to_column:n}={}){me(e)&&(e=0),me(t)&&(t=this.rows()),me(r)&&(r=0),me(n)&&(n=this.columns());const i=this._matrixArray.splice(e,t),a=[];for(const u of i)a.push(u.splice(r,n));return this._newMatrix(a)}swap_rows({row1:e,row2:t}){if(me(e)||me(t))return;const r=this._matrixInstance[e],n=this._matrixInstance[t];this._matrixInstance[e]=n,this._matrixInstance[t]=r}transpose(){const e=xf(this._matrixArray);return this._newMatrix(e)}remove_col({column:e}={}){me(e)&&(e=this.columns());const t=[];for(const n of this._matrixInstance){const i=n._value.splice(e,1);t.push(i[0])}const r=new it(0,void 0,this._errorListener);return r._value=t,r}remove_row({row:e}={}){return me(e)&&(e=this.rows()),this._matrixInstance.splice(e,1)[0]}eigenvalues(){const e=new Pf(new kf(this._matrixArray)),t=new it(0,void 0,this._errorListener);return t._value=e.realEigenvalues,t}is_diagonal(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<t;i++)if(n!==i&&r[n][i]!==0)return!1;return!0}is_identity(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<t;i++)if(n!==i&&r[n][i]!==0||n===i&&r[n][i]!==1)return!1;return!0}eigenvectors(){const e=new Pf(new kf(this._matrixArray));return this._newMatrix(e.eigenvectorMatrix.to2DArray())}is_symmetric(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=n+1;i<t;i++)if(r[n][i]!==r[i][n])return!1;return!0}swap_columns({column1:e,column2:t}){if(!(me(e)||me(t)))for(const r of this._matrixInstance){const n=r._value[e],i=r._value[t];r.set({index:e,value:i}),r.set({index:t,value:n})}}is_stochastic(){const e=this._matrixArray;for(let t=0;t<e.length;t++){let r=0;for(let n=0;n<e[t].length;n++){if(e[t][n]<0)return!1;r+=e[t][n]}if(Math.abs(r-1)>Number.EPSILON)return!1}return!0}is_triangular(){const e=this.rows(),t=this.columns();return e!==t?!1:this._isUpperTriangular(e)||this._isLowerTriangular(e)}elements_count(){return Mx(this._matrixArray)}is_antidiagonal(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<e;i++)if(n+i!==e-1&&r[n][i]!==0)return!1;return!0}is_antisymmetric(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<e;i++)if(n!==i&&r[n][i]!==-r[i][n])return!1;return!0}_isUpperTriangular(e){const t=this._matrixArray;for(let r=1;r<e;r++)for(let n=0;n<r;n++)if(t[r][n]!==0)return!1;return!0}_isLowerTriangular(e){const t=this._matrixArray;for(let r=0;r<e-1;r++)for(let n=r+1;n<e;n++)if(t[r][n]!==0)return!1;return!0}_newMatrix(e){const t=new ru(0,0,void 0,this._errorListener);return t._value=e.map(r=>{const n=new it(0,void 0,this._errorListener);return n._value=[...r],n}),t}_matrixRank(e){let t=0;const r=e.length,n=e[0].length,i=[...e].map(a=>[...a]);for(let a=0;a<r&&!(a>=n);a++){let u=a;for(;u<r&&i[u][a]===0;)u++;if(u===r)continue;if(u!==a){const c=i[u];i[u]=i[a],i[a]=c}const f=i[a][a];for(let c=0;c<n;c++)i[a][c]/=f;for(let c=a+1;c<r;c++){const h=i[c][a];i[c]=i[c].map((d,p)=>d-h*i[a][p]),i[c][a]=0}}for(let a=0;a<r;a++)i[a].some(u=>Number(u.toFixed(8))!==0)&&t++;return t}}class Gy{constructor(e){U(this,"_variables");U(this,"_cacheData");this._variables=e,this._cacheData={}}change({timeframe:e},t){if(!e)return!0;const r=pn(e),n=pn(this._variables.timeframe.period);if(r<n)return!0;const i=`change_${t}`,a=this._cacheData[i],u=this._variables.time;if(a){if(a.offset){if(a.currentTime+a.offset<=u)return this._cacheData[i]={currentTime:u,offset:0},!0}else if(a.currentTime+r*1e3<=u)return this._cacheData[i]={currentTime:u,offset:0},!0}else{const f=this._calcTimeOffset(u,e);return this._cacheData[i]={currentTime:u,offset:f},!1}return!1}in_seconds({timeframe:e}={}){return pn(e||this._variables.timeframe.period)}from_seconds({seconds:e=0}){const t=e*1e3,r=ot.duration(t);if(r.years())return"12M";const i=r.asMonths();if(vo(i))return`${i}M`;const a=r.asWeeks();if(vo(a))return`${a}M`;const u=r.asDays();if(u>=1)return`${Math.ceil(u)}D`;const f=r.asMinutes();if(f>=1)return`${Math.ceil(f)}`;const c=r.asSeconds();return c<=1?"1S":c<=5?"5S":c<=10?"10S":c<=15?"15S":c<=30?"30S":"1"}_calcTimeOffset(e,t){let r=0;if(t.includes("W")){const u=ot(e).day();t="1D",u!==1&&(r=(8-u)*60*60*24*1e3)}else if(t.includes("M")){const u=ot(e).date();t="1D";const f=ot(e).daysInMonth();u!==1&&(r=(f-u+1)*60*60*24*1e3)}const n=this._variables.getTimeTradingday(e,t),i=pn(t)*1e3,a=e-n-Math.floor((e-n)/i)*i;return r?r-a:a}}class Ky{constructor(e,t){U(this,"_errorListener");U(this,"_intlNumberFormatter");U(this,"_precision");this._errorListener=e,this._precision=t,this._intlNumberFormatter=new Intl.NumberFormat("en",{notation:"compact"})}pos({source:e="",str:t=""}){return e==null?void 0:e.indexOf(t)}trim({source:e=""}){return e==null?void 0:e.trim()}lower({source:e=""}){return e==null?void 0:e.toLocaleLowerCase()}match({source:e="",regex:t=""}){const r=e==null?void 0:e.match(new RegExp(t));return r?r[0]:""}split({string:e="",separator:t=""}){const r=e==null?void 0:e.split(t),n=new it;return n._value=r||[],n}upper({source:e=""}){return e==null?void 0:e.toLocaleUpperCase()}format({formatString:e=""},t){return this._strFormat(e,t)}length({string:e=""}){return e==null?void 0:e.length}repeat({source:e="",repeat:t,separator:r=""},n){if(me(t)){this._errorListener.addError("Invalid array length",n,Ve.Error);return}return Array.from(new Array(t),()=>e).join(r)}replace({source:e="",target:t="",replacement:r="",occurrence:n}){me(n)&&(n=0);let i=-1;for(let a=0;a<n+1&&(i=e.indexOf(t,i+1),i!==-1);a++);return i!==-1?e.substring(0,i)+r+e.substring(i+t.length):e}contains({source:e="",str:t=""}){return e==null?void 0:e.includes(t)}endswith({source:e="",str:t=""}){return e==null?void 0:e.endsWith(t)}tonumber({string:e=""}){if(/[^\d.]/.test(e))return;const t=parseFloat(e);return isNaN(t)?void 0:t}tostring({value:e,format:t}){if(e===void 0)return"NaN";if(typeof e=="object"){if(e.isArray)return this._arrToStr(e._value,t);if(e.isMatrix){const r=[];for(const n of e._matrixArray)r.push(this._arrToStr(n,t));return r.join(`
62
- `)}}if(typeof e=="string")return e;if(typeof e=="boolean")return String(e);if(typeof e=="number")return String(this._toStringFormat(e,t))}_arrToStr(e,t){return`[${e.map(n=>typeof n=="number"?this._toStringFormat(n,t):n).toString()}]`}substring({source:e="",begin_pos:t=0,end_pos:r}){return me(t)&&(t=0),me(r)&&(r=void 0),e==null?void 0:e.substring(t,r)}startswith({source:e="",str:t=""}){return e==null?void 0:e.startsWith(t)}format_time({time:e,format:t="yyyy-MM-dd'T'HH:mm:ssZ",timezone:r}){return me(e)&&(e=0),Zr(e,r).format(t)}replace_all({source:e="",target:t="",replacement:r=""}){return e==null?void 0:e.replace(new RegExp(t,"g"),r)}_toStringFormat(e,t){if(!t)return e;switch(t){case Je.mintick:return e.toFixed(this._precision);case Je.price:return`${e}%`;case Je.volume:return this._intlNumberFormatter.format(Math.round(e));default:const[r,n]=t.split(".");let[i,a=""]=String(e).split(".");if(r.includes("#")?i=r.replace(/#/,i).replace(/#/g,""):i=`${r}${i}`,n&&n.includes("#")){const u=n.split("#").length-1;a=`${a.substring(0,u)}${n.replace(/#/g,"")}`}else a=n||"";return a?`${i}.${a}`:i}}_formatNumber(e,t){if(!t)return e;switch(t){case"integer":return String(Math.round(e));case"currency":return`$${e}`;case"percent":return`${e*100}%`;default:const r=t.split(".")[1],n=r?r.length:0;return parseFloat(e.toFixed(n))}}_strFormat(e,t){let r=e;return t.forEach((n,i)=>{if(typeof n=="number"){const a=`\\{\\s*${i}\\s*,\\s*number\\s*,\\s*([^\\}]+)\\s*\\}`,u=e.match(new RegExp(a));if(u){const f=u[1];r=r.replace(new RegExp(a,"g"),String(this._formatNumber(n,f)))}else r=r.replace(new RegExp(`\\{${i}\\}`,"g"),String(n))}else r=r.replace(new RegExp(`\\{${i}\\}`,"g"),n)}),r}}class Xy{constructor(e){U(this,"_errorListener");this._errorListener=e}new(){return new nu(this._errorListener)}copy({id:e}){return e==null?void 0:e.copy()}get({id:e,key:t}){return e==null?void 0:e.get({key:t})}put({id:e,key:t,value:r}){return e==null?void 0:e.put({key:t,value:r})}keys({id:e}){return e==null?void 0:e.keys()}size({id:e}){return e==null?void 0:e.size()}clear({id:e}){e==null||e.clear()}remove({id:e,key:t}){return e==null?void 0:e.remove({key:t})}values({id:e}){return e==null?void 0:e.values()}put_all({id:e,id2:t}){e==null||e.put_all({id2:t})}contains({id:e,key:t}){return e==null?void 0:e.contains({key:t})}}class nu{constructor(e){U(this,"_errorListener");U(this,"_mapInstance");this._errorListener=e,this._mapInstance=new Map}get isMap(){return!0}_copyMap(e){const t=new nu(this._errorListener);return t._mapInstance=new Map(e.entries()),t}copy(){return this._copyMap(this._mapInstance)}get({key:e}){return this._mapInstance.get(e)}put({key:e,value:t}){return this._mapInstance.set(e,t)}keys(){const e=new it(0,void 0,this._errorListener);return e._value=[...this._mapInstance.keys()],e}size(){return this._mapInstance.size}clear(){this._mapInstance.clear()}remove({key:e}){const t=this._mapInstance.get(e);return this._mapInstance.delete(e),t||void 0}values(){const e=new it(0,void 0,this._errorListener);return e._value=[...this._mapInstance.values()],e}put_all({id2:e}){this._mapInstance=new Map([...this._mapInstance,...e._mapInstance])}contains({key:e}){return this._mapInstance.has(e)}}class Qy{constructor(e){U(this,"_variables");this._variables=e}new({price:e,time:t,index:r}){return new si(e,r,t)}now({price:e}){const{time:t,bar_index:r}=this._variables;return new si(e,r,t)}copy({id:e}){const{price:t,time:r,index:n}=e||{};return new si(t,n,r)}from_index({price:e,index:t}){return new si(e,t)}from_time({price:e,time:t}){return new si(e,void 0,t)}}class si{constructor(e,t,r){U(this,"_index");U(this,"_price");U(this,"_time");this._index=t,this._price=e,this._time=r}get index(){return this._index}get price(){return this._price}get time(){return this._time}copy(){return new si(this._price,this._index,this._time)}}class Jy{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultLabel",{text:"",xloc:wt.bar_index,yloc:Kr.price,size:ar.normal,style:vt.styleLabelDown,textalign:je.alignCenter});this._variables=e,this._errorListener=t}new(e,t){const{time:r,high:n,low:i,bar_index:a}=this._variables,u=`label_${t}_${a}`,f={...this._defaultLabel,...e,id:u,time:r};e.point&&(f.x=f.xloc===wt.bar_index?e.point.index:e.point.time,f.y=e.point.price),f.yloc===Kr.abovebar?f.y=n:f.yloc===Kr.belowbar&&(f.y=i),this._verfiyArgs(e,t);const c=new hs(u,this._variables,this._errorListener);return t.startsWith("export")||this._variables.label.add(u,f,c),c}_verfiyArgs(e,t){const{xloc:r,yloc:n,style:i,size:a,textalign:u,text_font_family:f}=e,c="label.new";this._paramVerfiy(i,t,c,Object.values(vt),"style"),this._paramVerfiy(r,t,c,Object.values(wt),"xloc"),this._paramVerfiy(n,t,c,Object.values(Kr),"yloc"),this._paramVerfiy(a,t,c,Object.values(ar),"size"),this._paramVerfiy(u,t,c,[je.alignLeft,je.alignCenter,je.alignRight],"textalign"),this._paramVerfiy(f,t,c,Object.values(Jn),"text_font_family")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}label(e,t){return e.x?e.x:new hs(t,this._variables,this._errorListener)}copy({id:e},t){return e==null?void 0:e.copy(t)}get_x({id:e},t){return e==null?void 0:e.get_x(t)}get_y({id:e},t){return e==null?void 0:e.get_y(t)}set_x({id:e,...t},r){e==null||e.set_x(t,r)}set_y({id:e,...t},r){e==null||e.set_y(t,r)}delete({id:e}){e==null||e.delete()}get_text({id:e},t){return e==null?void 0:e.get_text(t)}set_xy({id:e,...t},r){e==null||e.set_xy(t,r)}set_size({id:e,...t},r){e==null||e.set_size(t,r)}set_xloc({id:e,...t},r){e==null||e.set_xloc(t,r)}set_yloc({id:e,...t},r){e==null||e.set_yloc(t,r)}set_style({id:e,...t},r){e==null||e.set_style(t,r)}set_color({id:e,...t},r){e==null||e.set_color(t,r)}set_tooltip({id:e,...t},r){e==null||e.set_tooltip(t,r)}set_point({id:e,...t},r){e==null||e.set_point(t,r)}set_text({id:e,...t},r){e==null||e.set_text(t,r)}set_textcolor({id:e,...t},r){e==null||e.set_textcolor(t,r)}set_textalign({id:e,...t},r){e==null||e.set_textalign(t,r)}set_text_font_family({id:e,...t},r){e==null||e.set_text_font_family(t,r)}}class hs{constructor(e,t,r){U(this,"_id");U(this,"_variables");U(this,"_errorListener");this._id=e,this._variables=t,this._errorListener=r}copy(e){const t=`label_${e}_${this._variables.bar_index}`,r=this._getLabel(e),n=new hs(t,this._variables,this._errorListener);if(r){const i={...r,id:t};this._variables.label.add(t,i,n)}return n}get_x(e){var t;return(t=this._getLabel(e))==null?void 0:t.x}get_y(e){var t;return(t=this._getLabel(e))==null?void 0:t.y}set_x({x:e},t){const r=this._getLabel(t);r&&(r.x=e)}set_y({y:e},t){const r=this._getLabel(t);r&&(r.y=e)}delete(){this._variables.label.delete(this._id)}set_xy({x:e,y:t},r){const n=this._getLabel(r);n&&(n.x=e,n.y=t)}get_text(e){var t;return(t=this._getLabel(e))==null?void 0:t.text}set_size({size:e},t){const r=this._getLabel(t);r&&(r.size=e),this._paramVerfiy(e,t,"label.set_size",Object.values(ar),"size")}set_text({text:e},t){const r=this._getLabel(t);r&&(r.text=e)}set_xloc({x:e,xloc:t},r){const n=this._getLabel(r);n&&(n.x=e,n.xloc=t,this._paramVerfiy(t,r,"label.set_xloc",Object.values(wt),"xloc"))}set_yloc({yloc:e},t){const r=this._getLabel(t),{high:n,low:i}=this._variables;r&&(r.yloc=e,e===Kr.abovebar?r.y=n:e===Kr.belowbar&&(r.y=i),this._paramVerfiy(e,t,"label.set_yloc",Object.values(Kr),"yloc"))}set_color({color:e},t){const r=this._getLabel(t);r&&(r.color=e)}set_point({point:e},t){const r=this._getLabel(t);r&&(r.x=r.xloc===wt.bar_index?e==null?void 0:e.index:e==null?void 0:e.time,r.y=e==null?void 0:e.price)}set_style({style:e},t){const r=this._getLabel(t);r&&(r.style=e),this._paramVerfiy(e,t,"label.set_style",Object.values(vt),"style")}set_tooltip({tooltip:e},t){const r=this._getLabel(t);r&&(r.tooltip=e)}set_textalign({textalign:e},t){const r=this._getLabel(t);r&&(r.textalign=e),this._paramVerfiy(e,t,"label.set_textalign",[je.alignLeft,je.alignCenter,je.alignRight],"textalign")}set_textcolor({textcolor:e},t){const r=this._getLabel(t);r&&(r.textcolor=e)}set_text_font_family({text_font_family:e},t){const r=this._getLabel(t);r&&(r.text_font_family=e),this._paramVerfiy(e,t,"label.set_text_font_family",Object.values(Jn),"text_font_family")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getLabel(e){const t=this._variables.label.get(this._id);return t||console.log(`错误${e}: label 不存在`),t}}const eD={freq_all:Vr.freqAll,freq_once_per_bar:Vr.freqOncePerBar,freq_once_per_bar_close:Vr.freqOncePerBarClose},tD={gaps_off:ns.gapsOff,gaps_on:ns.gapsOn,lookahead_off:ns.lookaheadOff,lookahead_on:ns.lookaheadOn},Ii={aqua:"#00BCD4",black:"#363A45",blue:"#2196F3",fuchsia:"#E040FB",gray:"#787B86",green:"#4CAF50",lime:"#00E676",maroon:"#880E4F",navy:"#311B92",olive:"#808000",orange:"#FF9800",purple:"#9C27B0",red:"#FF5252",silver:"#B2B5BE",teal:"#00897B",white:"#FFFFFF",yellow:"#FFEB3B"},zf={AUD:"AUD",BTC:"BTC",CAD:"CAD",CHF:"CHF",ETH:"ETH",EUR:"EUR",GBP:"GBP",HKD:"HKD",INR:"INR",JPY:"JPY",KRW:"KRW",MYR:"MYR",NOK:"NOK",NONE:"NONE",NZD:"NZD",RUB:"RUB",SEK:"SEK",SGD:"SGD",TRY:"TRY",USD:"USD",USDT:"USDT",ZAR:"ZAR"},rD={friday:6,monday:2,saturday:7,sunday:1,thursday:5,tuesday:3,wednesday:4},qf={all:[Zt.dataWindow,Zt.pane,Zt.priceScale,Zt.statusLine],data_window:[Zt.dataWindow],none:[],pane:[Zt.pane],price_scale:[Zt.priceScale],status_line:[Zt.statusLine]},nD={both:Gr.both,left:Gr.left,none:Gr.none,right:Gr.right},iD={inherit:Je.inherit,mintick:Je.mintick,percent:Je.percent,price:Je.price,volume:Je.volume},sD={style_solid:ks.styleSolid,style_dashed:ks.styleDashed,style_dotted:ks.styleDotted},oD={style_arrowdown:vt.styleArrowdown,style_arrowup:vt.styleArrowup,style_circle:vt.styleCircle,style_cross:vt.styleCross,style_diamond:vt.styleDiamond,style_flag:vt.styleFlag,style_label_center:vt.styleLabelCenter,style_label_down:vt.styleLabelDown,style_label_left:vt.styleLabelLeft,style_label_lower_left:vt.styleLabelLowerLeft,style_label_lower_right:vt.styleLabelLowerRight,style_label_right:vt.styleLabelRight,style_label_up:vt.styleLabelUp,style_label_upper_left:vt.styleLabelUpperLeft,style_label_upper_right:vt.styleLabelUpperRight,style_none:vt.styleNone,style_square:vt.styleSquare,style_text_outline:vt.styleTextOutline,style_triangledown:vt.styleTriangledown,style_triangleup:vt.styleTriangleup,style_xcross:vt.styleXcross},aD={style_arrow_both:zt.styleArrowBoth,style_arrow_left:zt.styleArrowLeft,style_arrow_right:zt.styleArrowRight,style_dashed:zt.styleDashed,style_dotted:zt.styleDotted,style_solid:zt.styleSolid},uD={abovebar:_n.abovebar,absolute:_n.absolute,belowbar:_n.belowbar,bottom:_n.bottom,top:_n.top},lD={e:2.718281828459045,phi:1.618033988749895,pi:3.141592653589793,rphi:.6180339887498948},cD={style_area:Or.styleArea,style_areabr:Or.styleAreabr,style_circles:Or.styleCircles,style_columns:Or.styleColumns,style_cross:Or.styleCross,style_histogram:Or.styleHistogram,style_line:Or.styleLine,style_linebr:Or.styleLinebr,style_stepline:Or.styleStepline,style_stepline_diamond:Or.styleSteplineDiamond,style_steplinebr:Or.styleSteplinebr},fD={bottom_center:br.bottomCenter,bottom_left:br.bottomLeft,bottom_right:br.bottomRight,middle_center:br.middleCenter,middle_left:br.middleLeft,middle_right:br.middleRight,top_center:br.topCenter,top_left:br.topLeft,top_right:br.topRight},hD={left:zs.left,none:zs.none,right:zs.right},dD={arrowdown:_r.arrowdown,arrowup:_r.arrowup,circle:_r.circle,cross:_r.cross,diamond:_r.diamond,flag:_r.flag,labeldown:_r.labeldown,labelup:_r.labelup,square:_r.square,triangledown:_r.triangledown,triangleup:_r.triangleup,xcross:_r.xcross},pD={auto:ar.auto,huge:ar.huge,large:ar.large,normal:ar.normal,small:ar.small,tiny:ar.tiny},_D={cash:Rt.cash,fixed:Rt.fixed,percent_of_equity:Rt.percentOfEquity,commission:{cash_per_contract:Ir.cashPerContract,cash_per_order:Ir.cashPerOrder,percent:Ir.percent},direction:{all:gt.all,long:gt.long,short:gt.short},oca:{cancel:vn.cancel,none:vn.none,reduce:vn.reduce}},vD={align_bottom:je.alignBottom,align_center:je.alignCenter,align_left:je.alignLeft,align_right:je.alignRight,align_top:je.alignTop,wrap_auto:je.wrapAuto,wrap_none:je.wrapNone},gD={bar_index:wt.bar_index,bar_time:wt.bar_time},mD={abovebar:Kr.abovebar,belowbar:Kr.belowbar,price:Kr.price},xD={actual:Us.actual,estimate:Us.estimate,standardized:Us.standardized};class Uf{constructor(){U(this,"adjustment",{dividends:Ps.dividends,none:Ps.none,splits:Ps.splits});U(this,"alert",eD);U(this,"barmerge",tD);U(this,"color",Ii);U(this,"currency",zf);U(this,"dayofweek",rD);U(this,"earnings",xD);U(this,"display",qf);U(this,"extend",nD);U(this,"font",{family_default:Jn.familyDefault,family_monospace:Jn.familyMonospace});U(this,"format",iD);U(this,"hline",sD);U(this,"label",oD);U(this,"line",aD);U(this,"location",uD);U(this,"math",lD);U(this,"order",{ascending:Qn.ascending,descending:Qn.descending});U(this,"plot",cD);U(this,"position",fD);U(this,"scale",hD);U(this,"session",{extended:qs.extended,regular:qs.regular});U(this,"shape",dD);U(this,"size",pD);U(this,"splits",{denominator:"denominator",numerator:"numerator"});U(this,"strategy",_D);U(this,"text",vD);U(this,"xloc",gD);U(this,"yloc",mD)}updateData(){}}class yD{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultPolyline",{curved:!1,closed:!1,xloc:wt.bar_index,line_color:Ii.blue,line_style:zt.styleSolid,line_width:1});this._variables=e,this._errorListener=t}new(e,t){var a;const r=`polyline_${t}_${this._variables.bar_index}`,n=Object.assign({},this._defaultPolyline,e,{id:r,points:(a=e.points)==null?void 0:a._value.map(u=>({time:u.time,index:u.index,price:u.price}))}),i=new Wf(r,this._variables);return this._verfiyArgs(e,t),t.startsWith("export")||this._variables.polyline.add(r,n,i),i}_verfiyArgs(e,t){const{line_style:r,xloc:n}=e,i="polyline.new";this._paramVerfiy(r,t,i,Object.values(zt),"line_style"),this._paramVerfiy(n,t,i,Object.values(wt),"xloc")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}delete({id:e}){e&&e.delete()}}class Wf{constructor(e,t){U(this,"_id");U(this,"_variables");this._variables=t,this._id=e}delete(){this._variables.polyline.delete(this._id)}}class DD{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultLine",{xloc:wt.bar_index,extend:Gr.none,style:zt.styleSolid});this._variables=e,this._errorListener=t}new({first_point:e,second_point:t,...r},n){const i=`line_${n}_${this._variables.bar_index}`,a={...this._defaultLine,...r,id:i};if(e&&t){const f=a.xloc===wt.bar_index?e.index:e.time,c=a.xloc===wt.bar_index?t.index:t.time;Object.assign(a,{x1:f,y1:e.price,x2:c,y2:t.price})}this._verfiyArgs(r,n);const u=new ds(i,this._variables,this._errorListener);return n.startsWith("export")||this._variables.line.add(i,a,u),u}_verfiyArgs(e,t){const{extend:r,xloc:n,style:i}=e,a="line.new";this._paramVerfiy(i,t,a,Object.values(zt),"style"),this._paramVerfiy(r,t,a,Object.values(Gr),"extend"),this._paramVerfiy(n,t,a,Object.values(wt),"xloc")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}line(e,t){return e.x?e.x:new ds(t,this._variables,this._errorListener)}copy({id:e},t){return e==null?void 0:e.copy(t)}delete({id:e}){e==null||e.delete()}get_x1({id:e},t){return e==null?void 0:e.get_x1(t)}get_x2({id:e},t){return e==null?void 0:e.get_x2(t)}get_y1({id:e},t){return e==null?void 0:e.get_y1(t)}get_y2({id:e},t){return e==null?void 0:e.get_y2(t)}set_x1({id:e,...t},r){e==null||e.set_x1(t,r)}set_x2({id:e,...t},r){e==null||e.set_x2(t,r)}set_y1({id:e,...t},r){e==null||e.set_y1(t,r)}set_y2({id:e,...t},r){e==null||e.set_y2(t,r)}set_xy1({id:e,...t},r){e==null||e.set_xy1(t,r)}set_xy2({id:e,...t},r){e==null||e.set_xy2(t,r)}set_xloc({id:e,...t},r){e==null||e.set_xloc(t,r)}get_price({id:e,...t},r){return e==null?void 0:e.get_price(t,r)}set_color({id:e,...t},r){e==null||e.set_color(t,r)}set_style({id:e,...t},r){e==null||e.set_style(t,r)}set_width({id:e,...t},r){e==null||e.set_width(t,r)}set_extend({id:e,...t},r){e==null||e.set_extend(t,r)}set_first_point({id:e,...t},r){e==null||e.set_first_point(t,r)}set_second_point({id:e,...t},r){e==null||e.set_second_point(t,r)}}class ds{constructor(e,t,r){U(this,"_variables");U(this,"_id");U(this,"_errorListener");this._id=e,this._variables=t,this._errorListener=r}get data(){return this._variables.line.get(this._id)}copy(e){const t=`line_${e}_${this._variables.bar_index}`,r=this._getLine(e),n=new ds(t,this._variables,this._errorListener);return r&&this._variables.line.add(t,{...r,id:t},n),n}delete(){this._variables.line.delete(this._id)}get_price({x:e},t){const r=this._getLine(t);if(e===void 0)return e;if(r&&r.xloc===wt.bar_index){const{x1:n,y1:i,x2:a,y2:u}=r;return n===void 0||a===void 0||i===void 0||u===void 0?void 0:(u-i)/(a-n)*(e-n)+i}}get_x1(e){var t;return(t=this._getLine(e))==null?void 0:t.x1}get_x2(e){var t;return(t=this._getLine(e))==null?void 0:t.x2}get_y1(e){var t;return(t=this._getLine(e))==null?void 0:t.y1}get_y2(e){var t;return(t=this._getLine(e))==null?void 0:t.y2}set_x1({x:e},t){const r=this._getLine(t);r&&(r.x1=e)}set_x2({x:e},t){const r=this._getLine(t);r&&(r.x2=e)}set_y1({y:e},t){const r=this._getLine(t);r&&(r.y1=e)}set_y2({y:e},t){const r=this._getLine(t);r&&(r.y2=e)}set_xy1({x:e,y:t},r){const n=this._getLine(r);n&&(n.x1=e,n.y1=t)}set_xy2({x:e,y:t},r){const n=this._getLine(r);n&&(n.x2=e,n.y2=t)}set_xloc({xloc:e,x1:t,x2:r},n){const i=this._getLine(n);i&&(i.xloc=e,i.x1=t,i.x2=r,this._paramVerfiy(e,n,"line.set_xloc",Object.values(wt),"xloc"))}set_color({color:e},t){const r=this._getLine(t);r&&(r.color=e)}set_style({style:e},t){const r=this._getLine(t);r&&(r.style=e,this._paramVerfiy(e,t,"line.set_style",Object.values(zt),"style"))}set_width({width:e},t){const r=this._getLine(t);r&&(r.width=e)}set_extend({extend:e},t){const r=this._getLine(t);r&&(r.extend=e,this._paramVerfiy(e,t,"line.set_extend",Object.values(Gr),"extend"))}set_first_point({point:e},t){const r=this._getLine(t);if(r){const{index:n,time:i,price:a}=e||{},u=r.xloc===wt.bar_index?n:i,f=a;u&&(r.x1=u),f&&(r.y1=f)}}set_second_point({point:e},t){const r=this._getLine(t);if(r){const{index:n,time:i,price:a}=e||{},u=r.xloc===wt.bar_index?n:i,f=a;u&&(r.x2=u),f&&(r.y2=f)}}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getLine(e){const t=this._variables.line.get(this._id);return t||console.log(`${e}: line 不存在`),t}}class wD{constructor(e){U(this,"_variables");this._variables=e}new({line1:e,line2:t,color:r},n){const i=`linefill_${n}_${this._variables.bar_index}`,a=e==null?void 0:e.data,u=t==null?void 0:t.data;a&&(a.linefills=a.linefills||[],a.linefills.push(i)),u&&(u.linefills=u.linefills||[],u.linefills.push(i));const f=new Fo(this._variables,i,e,t);return n.startsWith("export")||(a||u)&&this._variables.linefill.add(i,{line1:a,line2:u,color:r,id:i},f),f}delete({id:e}){e==null||e.delete()}get_line1({id:e}){return e==null?void 0:e.get_line1()}get_line2({id:e}){return e==null?void 0:e.get_line2()}set_color({id:e,...t}){e==null||e.set_color(t)}}class Fo{constructor(e,t,r,n){U(this,"_id");U(this,"_line1");U(this,"_line2");U(this,"_variables");this._variables=e,this._id=t,this._line1=r,this._line2=n}linefill(e,t){return e.x?e.x:new Fo(this._variables,t)}delete(){var t,r;const e=this._variables.linefill.get(this._id);if(e){const{line1:n,line2:i}=e;n&&(n.linefills=(t=n.linefills)==null?void 0:t.filter(a=>a!==this._id)),i&&(i.linefills=(r=i.linefills)==null?void 0:r.filter(a=>a!==this._id))}this._line1=void 0,this._line2=void 0,this._variables.linefill.delete(this._id)}get_line1(){return this._line1}get_line2(){return this._line2}set_color({color:e}){const t=this._variables.linefill.get(this._id);t&&(t.color=e)}}class bD{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultBox",{border_color:Ii.blue,border_width:1,bgcolor:Ii.blue,xloc:wt.bar_index,extend:Gr.none,style:zt.styleSolid,text:"",text_size:ar.auto,text_color:Ii.black,text_halign:je.alignCenter,text_valign:je.alignCenter,text_wrap:je.wrapNone});this._variables=e,this._errorListener=t}box({x:e},t){return e===void 0?new ps(this._variables,t,this._errorListener):e}new({top_left:e,bottom_right:t,...r},n){const i=`box_${n}_${this._variables.bar_index}`,a={...this._defaultBox,...r,id:i};if(e){const{price:f,time:c,index:h}=e;a.top=f,a.left=a.xloc===wt.bar_index?h:c}if(t){const{price:f,time:c,index:h}=t;a.bottom=f,a.right=a.xloc===wt.bar_index?h:c}this._verfiyArgs(r,n);const u=new ps(this._variables,i,this._errorListener);return n.startsWith("export")||this._variables.box.add(i,a,u),u}_verfiyArgs(e,t){const{border_style:r,extend:n,xloc:i,text_size:a,text_halign:u,text_valign:f,text_wrap:c,text_font_family:h}=e,d="box.new";this._paramVerfiy(r,t,d,[zt.styleDashed,zt.styleDotted,zt.styleSolid],"border_style"),this._paramVerfiy(n,t,d,Object.values(Gr),"extend"),this._paramVerfiy(i,t,d,Object.values(wt),"xloc"),this._paramVerfiy(a,t,d,Object.values(ar),"text_size"),this._paramVerfiy(u,t,d,[je.alignLeft,je.alignCenter,je.alignRight],"text_halign"),this._paramVerfiy(f,t,d,[je.alignBottom,je.alignCenter,je.alignTop],"text_valign"),this._paramVerfiy(c,t,d,[je.wrapAuto,je.wrapNone],"text_wrap"),this._paramVerfiy(h,t,d,Object.values(Jn),"text_font_family")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}copy({id:e},t){return e==null?void 0:e.copy(t)}delete({id:e}){e==null||e.delete()}get_top({id:e}){return e==null?void 0:e.get_top()}get_bottom({id:e}){return e==null?void 0:e.get_bottom()}get_left({id:e}){return e==null?void 0:e.get_left()}get_right({id:e}){return e==null?void 0:e.get_right()}set_top({id:e,...t}){e==null||e.set_top(t)}set_bottom({id:e,...t}){e==null||e.set_bottom(t)}set_left({id:e,...t}){e==null||e.set_left(t)}set_right({id:e,...t}){e==null||e.set_right(t)}set_extend({id:e,...t},r){e==null||e.set_extend(t,r)}set_bgcolor({id:e,...t}){e==null||e.set_bgcolor(t)}set_border_color({id:e,...t}){e==null||e.set_border_color(t)}set_border_width({id:e,...t}){e==null||e.set_border_width(t)}set_border_style({id:e,...t},r){e==null||e.set_border_style(t,r)}set_lefttop({id:e,...t}){e==null||e.set_lefttop(t)}set_rightbottom({id:e,...t}){e==null||e.set_rightbottom(t)}set_text_size({id:e,...t},r){e==null||e.set_text_size(t,r)}set_text_wrap({id:e,...t},r){e==null||e.set_text_wrap(t,r)}set_text_color({id:e,...t}){e==null||e.set_text_color(t)}set_text_halign({id:e,...t},r){e==null||e.set_text_halign(t,r)}set_text_valign({id:e,...t},r){e==null||e.set_text_valign(t,r)}set_top_left_point({id:e,...t}){e==null||e.set_top_left_point(t)}set_bottom_right_point({id:e,...t}){e==null||e.set_bottom_right_point(t)}set_text_font_family({id:e,...t},r){e==null||e.set_text_font_family(t,r)}}class ps{constructor(e,t,r){U(this,"_id");U(this,"_variables");U(this,"_errorListener");this._variables=e,this._id=t,this._errorListener=r}copy(e){const t=`box_${e}_${this._variables.bar_index}`,r=this._getBox(),n=new ps(this._variables,t,this._errorListener);return r&&this._variables.box.add(t,{...r,id:t},n),n}delete(){this._variables.box.delete(this._id)}get_top(){const e=this._getBox();return e&&e.top}set_top({top:e}){const t=this._getBox();t&&(t.top=e)}get_left(){const e=this._getBox();return e&&e.left}set_left({left:e}){const t=this._getBox();t&&(t.left=e)}set_text({text:e}){const t=this._getBox();t&&(t.text=e)}get_right(){const e=this._getBox();return e&&e.right}set_right({right:e}){const t=this._getBox();t&&(t.right=e)}get_bottom(){const e=this._getBox();return e&&e.bottom}set_bottom({bottom:e}){const t=this._getBox();t&&(t.bottom=e)}set_extend({extend:e},t){const r=this._getBox();r&&(r.extend=e,this._paramVerfiy(e,t,"box.set_extend",Object.values(Gr),"extend"))}set_bgcolor({color:e}){const t=this._getBox();t&&(t.bgcolor=e)}set_lefttop({left:e,top:t}){const r=this._getBox();r&&(r.left=e,r.top=t)}set_text_size({text_size:e},t){const r=this._getBox();r&&(r.text_size=e,this._paramVerfiy(e,t,"box.set_text_size",Object.values(ar),"text_size"))}set_text_wrap({text_wrap:e},t){const r=this._getBox();r&&(r.text_wrap=e,this._paramVerfiy(e,t,"box.set_text_wrap",[je.wrapAuto,je.wrapNone],"text_wrap"))}set_text_color({text_color:e}){const t=this._getBox();t&&(t.text_color=e)}set_rightbottom({right:e,bottom:t}){const r=this._getBox();r&&(r.right=e,r.bottom=t)}set_text_halign({text_halign:e},t){const r=this._getBox();r&&(r.text_halign=e,this._paramVerfiy(e,t,"box.set_text_halign",[je.alignLeft,je.alignCenter,je.alignRight],"text_halign"))}set_text_valign({text_valign:e},t){const r=this._getBox();r&&(r.text_valign=e,this._paramVerfiy(e,t,"box.set_text_valign",[je.alignBottom,je.alignCenter,je.alignTop],"text_valign"))}set_top_left_point({point:e}){const t=this._getBox();if(t){const{index:r,price:n,time:i}=e||{};t.top=n,t.left=t.xloc===wt.bar_index?r:i}}set_border_color({color:e}){const t=this._getBox();t&&(t.border_color=e)}set_border_style({style:e},t){const r=this._getBox();r&&(r.border_style=e,this._paramVerfiy(e,t,"box.set_border_style",[zt.styleDashed,zt.styleDotted,zt.styleSolid],"style"))}set_border_width({width:e}){const t=this._getBox();t&&(t.border_width=e)}set_bottom_right_point({point:e}){const t=this._getBox();if(t){const{index:r,price:n,time:i}=e||{};t.bottom=n,t.right=t.xloc===wt.bar_index?r:i}}set_text_font_family({text_font_family:e},t){const r=this._getBox();r&&(r.text_font_family=e,this._paramVerfiy(e,t,"box.set_text_font_family",Object.values(Jn),"text_font_family"))}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getBox(){return this._variables.box.get(this._id)}}class ED{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultTable",{position:br.topLeft,columns:0,rows:0,frame_width:0,border_width:0});this._variables=e,this._errorListener=t}table({x:e},t){return e||new iu(this._variables,t,this._errorListener)}new(e,t){const r=`table_${t}_${this._variables.bar_index}`,n={...this._defaultTable,...e,cell:[],id:r},i=new iu(this._variables,r,this._errorListener);return this._paramVerfiy(e.position,t,"table.new",Object.values(br),"position"),t.startsWith("export")||this._variables.table.add(r,n,i),i}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}cell({table_id:e,...t}){e==null||e.cell(t)}cell_set_bgcolor({table_id:e,...t}){e==null||e.cell_set_bgcolor(t)}cell_set_height({table_id:e,...t}){e==null||e.cell_set_height(t)}cell_set_text({table_id:e,...t}){e==null||e.cell_set_text(t)}cell_set_text_color({table_id:e,...t}){e==null||e.cell_set_text_color(t)}cell_set_text_font_family({table_id:e,...t}){e==null||e.cell_set_text_font_family(t)}cell_set_text_halign({table_id:e,...t}){e==null||e.cell_set_text_halign(t)}cell_set_text_valign({table_id:e,...t}){e==null||e.cell_set_text_valign(t)}cell_set_text_size({table_id:e,...t}){e==null||e.cell_set_text_size(t)}cell_set_tooltip({table_id:e,...t}){e==null||e.cell_set_tooltip(t)}cell_set_width({table_id:e,...t}){e==null||e.cell_set_width(t)}clear({table_id:e,...t}){e==null||e.clear(t)}delete({table_id:e}){e==null||e.delete()}merge_cells({table_id:e,...t},r){e==null||e.merge_cells(t,r)}set_bgcolor({table_id:e,...t}){e==null||e.set_bgcolor(t)}set_border_color({table_id:e,...t}){e==null||e.set_border_color(t)}set_border_width({table_id:e,...t}){e==null||e.set_border_width(t)}set_frame_color({table_id:e,...t}){e==null||e.set_frame_color(t)}set_frame_width({table_id:e,...t}){e==null||e.set_frame_width(t)}set_position({table_id:e,...t},r){e==null||e.set_position(t,r)}}class iu{constructor(e,t,r){U(this,"_id");U(this,"_variables");U(this,"_errorListener");U(this,"_defaultCell",{column:0,row:0,text:"",text_color:Ii.black,text_halign:je.alignCenter,text_valign:je.alignCenter,text_size:ar.normal});this._variables=e,this._id=t,this._errorListener=r}cell(e){const t={...this._defaultCell,...e},{column:r=0,row:n=0}=t,i=this._variables.table.get(this._id);if(i){const a=i.cell||[],u=a[n]||[];u[r]=t,a[n]=u,i.cell=a}}cell_set_bgcolor({column:e=0,row:t=0,bgcolor:r}){const n=this._getTableItem(e,t);n&&(n.bgcolor=r)}cell_set_height({column:e=0,row:t=0,height:r}){const n=this._getTableItem(e,t);n&&(n.height=r)}cell_set_text({column:e=0,row:t=0,text:r}){const n=this._getTableItem(e,t);n&&(n.text=r)}cell_set_text_color({column:e=0,row:t=0,text_color:r}){const n=this._getTableItem(e,t);n&&(n.text_color=r)}cell_set_text_font_family({column:e=0,row:t=0,text_font_family:r}){const n=this._getTableItem(e,t);n&&(n.text_font_family=r)}cell_set_text_halign({column:e=0,row:t=0,text_halign:r}){const n=this._getTableItem(e,t);n&&(n.text_halign=r)}cell_set_text_valign({column:e=0,row:t=0,text_valign:r}){const n=this._getTableItem(e,t);n&&(n.text_valign=r)}cell_set_text_size({column:e=0,row:t=0,text_size:r}){const n=this._getTableItem(e,t);n&&(n.text_size=r)}cell_set_tooltip({column:e=0,row:t=0,tooltip:r}){const n=this._getTableItem(e,t);n&&(n.tooltip=r)}cell_set_width({column:e=0,row:t=0,width:r}){const n=this._getTableItem(e,t);n&&(n.width=r)}clear({start_column:e=0,start_row:t=0,end_column:r=0,end_row:n=0}){const i=this._variables.table.get(this._id);if(i){const a=i.cell;if(a)for(let u=t;u<=n;u++)for(let f=e;f<=r;f++){const c=a[u];c&&(c[f]=void 0)}}}delete(){this._variables.table.delete(this._id)}merge_cells({start_column:e=0,start_row:t=0,end_column:r=0,end_row:n=0},i){if(e>r||t>n){console.log(`error ${i}: start_column > end_column or start_row > end_row`);return}const a=this._getTableItem(e,t);if(!a)return;this.clear({start_column:e,start_row:t,end_column:r,end_row:n});const u=this._variables.table.get(this._id);u.cell[t][e]={...a,isMerge:!0,merge_columns:r-e+1,merge_rows:n-t+1}}set_bgcolor({bgcolor:e}){const t=this._variables.table.get(this._id);t&&(t.bgcolor=e)}set_border_color({border_color:e}){const t=this._variables.table.get(this._id);t&&(t.border_color=e)}set_border_width({border_width:e}){const t=this._variables.table.get(this._id);t&&(t.border_width=e)}set_frame_color({frame_color:e}){const t=this._variables.table.get(this._id);t&&(t.frame_color=e)}set_frame_width({frame_width:e}){const t=this._variables.table.get(this._id);t&&(t.frame_width=e)}set_position({position:e},t){const r=this._variables.table.get(this._id);r&&(r.position=e,this._paramVerfiy(e,t,"table.set_position",Object.values(br),"position"))}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getTableItem(e,t){const r=this._variables.table.get(this._id);if(r){const n=r.cell;return n?n[t][e]:void 0}}}class AD{constructor(e){U(this,"_strategy");this._strategy=e}commission({trade_num:e}){return this._verifyTradeNum(e)&&this._strategy.historyOrders[e].commission||0}entry_bar_index({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].in_index}entry_comment({trade_num:e}){if(!this._verifyTradeNum(e))return"";const{comment:t,id:r}=this._strategy.historyOrders[e];return t||r}entry_id({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].id:""}entry_price({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].in_price}entry_time({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].in_time}exit_bar_index({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].out_index}exit_comment({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].out_comment:""}exit_id({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].out_id:""}exit_price({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].out_price}exit_time({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].out_time}max_drawdown({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].trading_loss:0}max_drawdown_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].trading_loss_percent:0}max_runup({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].max_profit:0}max_runup_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].max_profit_percent:0}profit({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].profit:0}profit_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].profit_percent:0}size({trade_num:e}){if(!this._verifyTradeNum(e))return 0;const{out_qty:t=0,direction:r}=this._strategy.historyOrders[e];return r===gt.long?t:-t}_verifyTradeNum(e){if(typeof e!="number"||e<0)return!1;const t=this._strategy.historyOrders.length;return!(e>=t)}}class CD{constructor(e){U(this,"_strategy");this._strategy=e}commission({trade_num:e}){if(!this._verifyTradeNum(e))return 0;const{qty:t=0,original_qty:r=0,commission:n=0}=this._strategy.orders[e];return n*t/r}entry_bar_index({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.orders[e].in_index}entry_comment({trade_num:e}){if(!this._verifyTradeNum(e))return"";const{comment:t,id:r}=this._strategy.orders[e];return t||r}entry_id({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].id:""}entry_price({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.orders[e].in_price}entry_time({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.orders[e].in_time}max_drawdown({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].trading_loss:0}max_drawdown_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].trading_loss_percent:0}max_runup({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].max_profit:0}max_runup_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].max_profit_percent:0}profit({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].profit:0}profit_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].profit_percent:0}size({trade_num:e}){if(!this._verifyTradeNum(e))return 0;const{qty:t=0,direction:r}=this._strategy.orders[e];return r===gt.long?t:-t}_verifyTradeNum(e){if(typeof e!="number"||e<0)return!1;const t=this._strategy.orders.length;return!(e>=t)}}class FD{constructor(e,t){U(this,"_strategy");U(this,"_errorListener");this._strategy=e,this._errorListener=t}allow_entry_in({value:e},t){this._paramVerfiy(e,t,"strategy.risk.allow_entry_in",Object.values(gt),"value"),this._strategy.updateRisk({allow_entry_in:e})}max_cons_loss_days({count:e}){this._strategy.updateRisk({max_cons_loss_days:e})}max_drawdown({value:e,type:t},r){this._paramVerfiy(t,r,"strategy.risk.max_drawdown",[Rt.percentOfEquity,Rt.cash],"type"),t===Rt.percentOfEquity&&(e=e>100?100:e),this._strategy.updateRisk({max_drawdown:e,max_drawdown_type:t})}max_intraday_filled_orders({count:e}){this._strategy.updateRisk({max_intraday_filled_orders:e})}max_intraday_loss({value:e,type:t},r){this._paramVerfiy(t,r,"strategy.risk.max_intraday_loss",[Rt.percentOfEquity,Rt.cash],"type"),t===Rt.percentOfEquity&&(e=e>100?100:e),this._strategy.updateRisk({max_intraday_loss:e,max_intraday_loss_type:t})}max_position_size({contracts:e}){this._strategy.updateRisk({max_position_size:e})}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}}let BD=class{constructor(e,t,r,n){U(this,"_variables");U(this,"_options");U(this,"_totalChangeCapital");U(this,"_historyOrder");U(this,"_orders");U(this,"_pendingOrders");U(this,"_mintick");U(this,"_funcOptions");U(this,"_pendingCloseOrders");U(this,"_errorListener");U(this,"_risk");U(this,"_opentrades");U(this,"_closedtrades");U(this,"_riskNamespace");this._variables=e,this._errorListener=n,this._options={overlay:!1,format:Je.inherit,pyramiding:0,calc_on_order_fills:!1,calc_on_every_tick:!1,max_bars_back:0,backtest_fill_limits_assumption:0,default_qty_type:Rt.fixed,default_qty_value:1,initial_capital:1e6,currency:zf.NONE,slippage:0,commission_type:Ir.percent,commission_value:0,process_orders_on_close:!1,close_entries_rule:"FIFO",margin_long:0,margin_short:0,explicit_plot_zorder:!1,max_lines_count:50,max_labels_count:50,max_boxes_count:50,calc_bars_count:0,risk_free_rate:2,use_bar_magnifier:!1,fill_orders_on_standard_ohlc:!1,max_polylines_count:50},this._funcOptions=t,this._totalChangeCapital=0,this._orders=[],this._pendingOrders=[],this._historyOrder=[],this._pendingCloseOrders=[],this._mintick=r,this._variables.strategy.updateOrders(this._orders),this._variables.strategy.updateHistoryOrders(this._historyOrder),this._variables.strategy.updateStrategyOptions(this._options),this._risk={intradayOrders:0},this._opentrades=new CD(this),this._closedtrades=new AD(this),this._riskNamespace=new FD(this,n)}get orders(){return[...this._orders]}get historyOrders(){return[...this._historyOrder]}get _orderProfit(){return this._orders.reduce((e,t)=>e+(t.profit||0),0)}get _freezeCapital(){const{close:e}=this._variables;return this._orders.reduce((t,r)=>t+e*(r.qty||0),0)}get opentrades(){return this._opentrades}get closedtrades(){return this._closedtrades}get risk(){return this._riskNamespace}updateOptions(e){Object.assign(this._options,e),this._maxConsLossDaysVerify(),this._pendingOrderHandle(),this._maxIntradayFilledOrdersVerify(),this._ordersHandle(),!this._options.process_orders_on_close&&this._calcLiquidate()}updateRisk(e){Object.assign(this._risk,e)}endExecution(){this._calcProfitAndLoss(),this._variables.strategy.update(),this._maxDrawdownVerify(),this._maxIntradayLoss(),this._pendingCloseOrderHandle(),this._options.process_orders_on_close&&this._calcLiquidate()}_maxIntradayLoss(){var v;const{max_intraday_loss:e,max_intraday_loss_type:t,isDisabledOpen:r}=this._risk;if(e===void 0||!t||r)return;const{high:n,low:i,time_tradingday:a,time:u,strategy:{netprofit:f,initial_capital:c}}=this._variables;let{preNetprofit:h=0}=this._risk;u===a&&(h=f,this._risk.preNetprofit=f,this._risk.isTemporaryBan=!1);let d=h-f;d+=this._orders.reduce((x,_)=>{const{in_price:y,direction:m,qty:w=0,commission:D=0,original_qty:C=0}=_,b=m===gt.long?1:-1,F=(n-y)*w,B=(i-y)*w,M=b===1?-B:F;return x+M+w/C*D},0);let p=!1;switch(t){case Rt.cash:p=e<d;break;case Rt.percentOfEquity:const x=d/(c+f)*100;p=e<x;break}if(p){this._risk.isTemporaryBan=!0;const x=(v=this._orders[0])==null?void 0:v.direction;this._closeOrders(this._orders,x===gt.long?i:n,"Close Position (Max intraday Loss)"),this._pendingOrders=[]}}_maxIntradayFilledOrdersVerify(){const{max_intraday_filled_orders:e,intradayOrders:t=0,isDisabledOpen:r}=this._risk;if(e===void 0||r)return;const{time:n,time_tradingday:i,open:a}=this._variables;n===i&&(this._risk.intradayOrders=0,this._risk.isTemporaryBan=!1),e<=t&&(this._risk.isTemporaryBan=!0,this._closeOrders(this._orders,a,"Close Position (Max number of filled orders in one day)"),this._pendingOrders=[])}_maxConsLossDaysVerify(){const{max_cons_loss_days:e,lossDays:t=0,isDisabledOpen:r,totalProfit:n=0}=this._risk;if(e===void 0||r)return;const{time:i,time_tradingday:a,strategy:u,open:f}=this._variables;let c=t;if(i===a){const h=u.netprofit+u.openprofit;h<n?c=0:c++,Object.assign(this._risk,{lossDays:c,totalProfit:h})}e<=c&&this._riskTouchOff(f,"Close Position (Max consecutive loss days)")}_maxDrawdownVerify(){var n;const{max_drawdown:e,max_drawdown_type:t,isDisabledOpen:r}=this._risk;if(!r&&e!==void 0&&t){const{max_drawdown:i,max_drawdown_percent:a}=this._variables.strategy;let u=!1;switch(t){case Rt.percentOfEquity:u=a<i;break;case Rt.cash:u=e<i;break}if(u){const{high:f,low:c}=this._variables,h=(n=this._orders[0])==null?void 0:n.direction;this._riskTouchOff(h===gt.long?f:c,"Close Position (Max Drawdown)")}}}_riskTouchOff(e,t){this._risk.isDisabledOpen=!0,this._closeOrders(this._orders,e,t),this._pendingOrders=[]}strategy(e,t){this._variables.bar_index||(this._paramVerfiy(e.format,t,"strategy",[Je.inherit,Je.price,Je.percent,Je.volume],"format"),this._paramVerfiy(e.default_qty_type,t,"strategy",Object.values(Rt),"default_qty_type"),this._paramVerfiy(e.commission_type,t,"strategy",Object.values(Ir),"commission_type"),this._options={...e},this._variables.updateMaxLength(e),Object.assign(this._funcOptions,{strategy:this._options,scriptType:"strategy"}))}order(e,t){this._risk.isDisabledOpen||(this._paramVerfiy(e.oca_type,t,"strategy.order",Object.values(vn),"oca_type"),this._orderHandle(e))}entry(e,t){this._risk.isDisabledOpen||(this._paramVerfiy(e.oca_type,t,"strategy.entry",Object.values(vn),"oca_type"),this._entryHandle(e))}close(e){if(!this._orders.length)return;const{immediately:t}=e;t||this._options.process_orders_on_close?this._pendingCloseOrders.push({...e,place_order_type:"close"}):this._pendingOrders.push({...e,place_order_type:"close"})}close_all(e){if(typeof e=="string"&&(e={}),!this._orders.length)return;const{immediately:t}=e;t||this._options.process_orders_on_close?this._pendingCloseOrders.push({...e,place_order_type:"close_all"}):this._pendingOrders.push({...e,place_order_type:"close_all"})}cancel({id:e}){this._pendingOrders=this._pendingOrders.filter(t=>!(t.id===e&&t.place_order_type!=="close"))}cancel_all(){this._pendingOrders=this._pendingOrders.filter(e=>e.place_order_type==="close_all")}exit(e,t){this._exit(e,t)}convert_to_account({value:e}){return e}convert_to_symbol({value:e}){return e}default_entry_qty({fill_price:e}){return e?this._calcDefaultQty(e):0}_calcDefaultQty(e){const{default_qty_type:t=Rt.fixed,default_qty_value:r=1,initial_capital:n}=this._options;switch(t){case Rt.fixed:return r;case Rt.cash:return r/e;case Rt.percentOfEquity:return(n+this._orderProfit+this._totalChangeCapital)*r/100/e}}_getCapital(e,t){const{margin_long:r=0,margin_short:n=0}=this._options;return r<100&&r>0&&e===1?t=t*100/r:n<=100&&n>0&&e===-1&&(t=t*100/n),t}_calcProfitAndLoss(){const{high:e,low:t,close:r}=this._variables;for(const n of this._orders){const{in_price:i,qty:a=0,direction:u}=n,f=u===gt.long?1:-1,c=(r-i)*f*a,h=(e-i)*a,d=(t-i)*a,p=f===1?h:-d,v=f===1?-d:h;this._calcOrderPercent(n,c,p,v)}}_calcOrderPercent(e,t,r,n){const{commission_value:i}=this._options,{close:a}=this._variables,{original_qty:u=0,qty:f=0,in_price:c,max_profit:h=0,trading_loss:d=0}=e;let{commission:p=0}=e;const v=c*f;if(i){const x=this._getCommission(a,f);t=t-x,p=p*f/u,r-=p,n+=p}r=Math.max(r,h),n=Math.min(n,d),Object.assign(e,{profit:t-p,total_profit:this._totalChangeCapital+t,max_profit:r,trading_loss:n,profit_percent:t/v*100,max_profit_percent:r/v*100,trading_loss_percent:n/v*100})}_calcLiquidate(){if(!this._orders.length)return;const{high:e,low:t}=this._variables,{initial_capital:r,margin_long:n=0,margin_short:i=0,commission_value:a=0}=this._options,u=this._orders[0].direction===gt.long?1:-1,f=u===1?t:e,c=(u===1?n:i)/100;if(c<=0)return;const[h,d,p]=this._orders.reduce((m,w)=>{let[D,C,b]=m;const{in_price:F,qty:B=0,original_qty:M=0,commission:O=0}=w,A=F*B,N=f*B;if(D+=A,C+=N,a){const I=this._getCommission(f,B);b+=I+B/M*O}return[D,C,b]},[0,0,0]),v=u*(d-h),_=r+this._totalChangeCapital+v-p-d*c;if(_>=0)return;const y=Math.trunc(_/c/f)*4;this._marginCallOrders(f,y,"Margin Call")}_marginCallOrders(e,t,r){const{close_entries_rule:n="FIFO"}=this._options;if(n==="FIFO"){this._processOrders(this._orders,e,t*this._orders.length,r,r);return}for(const i of this.orders)this._processOrder(i,e,t,r,r);this._orders=this._orders.filter(i=>!i.isDeal),this._variables.strategy.updateOrders(this._orders)}_orderHandle(e){const{process_orders_on_close:t,slippage:r=0}=this._options,{orders:n,isMarketPrice:i,quantities:a,close:u,price:f,activePrice:c}=this._orderArgsParse(e),h=e.direction===gt.long?1:-1;if(a<=0)return;let d=a;if(i&&t){if(n.length){const _=this._processOrders(n,u,d,e.id,e.comment);if(_<=0)return;d=_}const v=u+h*r*this._mintick;if(!this._judgeCapitalEnough(d,v,h))return;this._ocaGroupVerify(d,e.oca_name,e.oca_type),this._calcCurrentOrder({...e,in_price:v,in_index:this._variables.bar_index,in_time:this._variables.time,qty:d,place_order_type:"order"});return}this._judgeCapitalEnough(a,f,h)&&this._addPendingOrders(e,f,d,i,c)}_judgeCapitalEnough(e,t,r){if(e<=0)return!1;const{margin_long:n=0,margin_short:i=0}=this._options;if((n===0||n===100)&&r===1||i===0&&r===-1)return!0;const u=this._getCapital(r,this._options.initial_capital+this._orderProfit+this._totalChangeCapital)-this._freezeCapital;return e*t<=u}_ocaGroupVerify(e,t,r){if(!t||!r||r===vn.none)return!1;let n=!1;switch(r){case vn.cancel:this._pendingOrders=this._pendingOrders.filter(i=>{if(i.oca_name===t)i.isCancel=!0,n=!0;else return!0});break;case vn.reduce:this._pendingOrders=this._pendingOrders.filter(i=>{const{qty:a=0,oca_name:u}=i;if(t===u){const f=a-e;return n=!0,f<=0?(i.isCancel=!0,!1):(i.qty=f,!0)}else return!0});break}return n}_processOrders(e,t,r,n,i){let a=r;for(const u of e)if(a=this._processOrder(u,t,a,n,i),a<=0)break;return this._orders=this._orders.filter(u=>!u.isDeal),this._variables.strategy.updateOrders(this._orders),a}_addPendingOrders(e,t,r,n,i){const a=this._pendingOrders.find(u=>u.id===e.id&&!u.isMarketPrice);if(a)Object.assign(a,{...e,in_price:t,isMarketPrice:n,qty:r,active_price:i});else{const u={...e,in_price:t,isMarketPrice:n,qty:r,active_price:i,place_order_type:"order"};this._pendingOrders.push(u)}}_orderArgsParse(e){const{direction:t,qty:r,stop:n}=e;let i=e.limit||0;const{close:a}=this._variables;let u=a,f=!1,c;const h=t===gt.long?1:-1,d=n&&(n-a)*h>0,{backtest_fill_limits_assumption:p=0}=this._options;p>0&&i&&(i-=p*this._mintick*h);const v=i&&(i-a)*h<0;d&&v?(c=n,u=i):d?u=n:v?u=i:f=!0;const x=r||this._calcDefaultQty(u)||1;return{orders:this._orders.filter(y=>y.direction!==t),isMarketPrice:f,activePrice:c,quantities:x,close:a,price:u}}_entryHandle(e){const{process_orders_on_close:t}=this._options,{orders:r,isMarketPrice:n,quantities:i,close:a,price:u,activePrice:f}=this._orderArgsParse(e);if(i<=0)return;if(r.length&&n&&t){this._entryOrder(r,a,i,e);return}this._judgeCapitalEnough(i,a,e.direction===gt.long?1:-1)&&this._addPendingEntry(e,u,i,n,f)}_entryOrder(e,t,r,n){const{time:i,bar_index:a}=this._variables,{slippage:u=0}=this._options,{oca_name:f,oca_type:c,direction:h,comment:d,isMarketPrice:p,id:v}=n,x=h===gt.long?1:-1;if(this._closeOrders(e,t,v,d),r=this._getAvailablePositionSize(r,h),r<=0)return;t=t+u*this._mintick*x;const _={...n,in_price:t,original_qty:r,qty:r,in_index:a,in_time:i,place_order_type:"entry"};if(p){this._calcCurrentOrder(_);return}const{pendingOrders:y,orders:m}=this._getEntryOrders(h),w=y.length+m.length;w&&w>=(this._options.pyramiding||0)||!this._judgeCapitalEnough(r,t,x)||(this._ocaGroupVerify(r,f,c),this._calcCurrentOrder(_))}_getAvailablePositionSize(e,t){const{max_position_size:r,allow_entry_in:n}=this._risk;if(n&&n!==gt.all&&n!==t)return 0;if(r===void 0)return e;const i=this._orders.reduce((a,u)=>a+(u.qty||0),0);return i?i+e>r?0:e:e>r?e-r:0}_getEntryOrders(e){const t=this._pendingOrders.filter(n=>["entry","order"].includes(n.place_order_type)&&n.direction===e),r=this._orders.filter(n=>n.direction===e);return{pendingOrders:t,orders:r}}_addPendingEntry(e,t,r,n,i){if(r=this._getAvailablePositionSize(r,e.direction),r<=0)return;const{pendingOrders:a,orders:u}=this._getEntryOrders(e.direction),f=a.length+u.length,c=a.find(h=>h.id===e.id&&h.place_order_type==="entry");if(c)Object.assign(c,{...e,in_price:t,isMarketPrice:n,qty:r,active_price:i});else if(!f||f<(this._options.pyramiding||1)){const h={...e,in_price:t,isMarketPrice:n,qty:r,active_price:i,place_order_type:"entry"};this._pendingOrders.push(h)}}_closeAllOrders(e,t){const{comment:r}=e,{bar_index:n}=this._variables,i=this._orders.filter(a=>a.in_index!==n);i.length&&(this._closeOrders(i,t,"Close position order",r),this._orders=[],this._variables.strategy.updateOrders(this._orders))}_closeOrders(e,t,r,n){for(const i of e)this._closeOrder(i,t,r,n);this._orders=this._orders.filter(i=>!i.isDeal),this._variables.strategy.updateOrders(this._orders)}_closeOrder(e,t,r,n){const{time:i,bar_index:a}=this._variables,{slippage:u=0}=this._options,{in_price:f,qty:c=0,direction:h}=e,d=h===gt.long?1:-1;t=t-d*u*this._mintick,e.isDeal=!0;const p=(t-f)*d*c,v={...e,out_price:t,out_id:r,out_index:a,out_time:i,out_comment:n,out_qty:c,profit:p};this._calcPercent(v),this._risk.intradayOrders+=1,this._historyOrder.push(v),this._variables.strategy.updateHistoryOrders(this._historyOrder)}_ordersHandle(){const e=this._orders.filter(a=>a.place_order_type==="exit"&&!a.hasExit);if(!e.length)return;const{open:t,low:r,high:n,close:i}=this._variables;for(const a of e){const{stop:u,limit:f,trail_stop_price:c,isMarketPriceLimit:h,isMarketPriceStop:d,direction:p,id:v,out_comment:x,active_price:_,trail_offset:y=0,out_qty:m,comment_loss:w,comment_profit:D,comment_trailing:C}=a;let b=c;const F=p===gt.long?1:-1;let B,M=x;if(h||d?B=t:(f&&r<=f&&n>=f&&(M=D||x,B=f),u&&r<=u&&n>=u&&(B=b?(u-b)*F>0?u:b:u,M=(b===B?C:w)||x)),B)this._processExitOnClose(a,B,{from_entry:v,comment:M,qty:m});else{let O=!1;if(_&&_<=n&&_>=r&&(b=_-y*F*this._mintick,(b-i)*F>=0&&(a.isMarketPriceStop=!0,this._options.process_orders_on_close&&(B=b)),O=!0,a.trail_stop_price=b),b)if((b-t)*F>=0&&!O)B=b;else{const A=(F===1?n:r)-y*F*this._mintick;F===1?b<t&&b>=r&&A>b&&A<i?B=b:A>b?(b=A,A>=i&&(B=A)):b<=n&&r<=b&&(B=b):b>t&&b<=n&&A<b&&A>i?B=b:A<b?(b=A,A<=i&&(B=A)):b<=n&&r<=b&&(B=b),a.trail_stop_price=b}B&&this._processExitOnClose(a,B,{from_entry:v,comment:C||x,qty:m})}}}_pendingOrderHandle(){if(!this._pendingOrders.length)return;const e=[],t=this._pendingOrders.filter(n=>n.place_order_type==="exit"),r=this._pendingOrders.filter(n=>["close","close_all"].includes(n.place_order_type||""));for(const n of r)switch(n.place_order_type){case"close":this._closeOrderHandle(n);break;case"close_all":this._closeAllOrders(n,this._variables.open);break}for(const n of this._pendingOrders){const{isCancel:i,place_order_type:a}=n;if(i)continue;let u;switch(a){case"entry":u=this._entryOrderHandle(n);break;case"order":u=this._orderOrderHandle(n);break}u&&e.push(u)}for(const n of t){const i=this._exitOrderHandle(n);i&&e.push(i)}this._pendingOrders=e}_pendingCloseOrderHandle(){if(!this._pendingCloseOrders.length)return;const e=this._pendingCloseOrders.filter(n=>n.place_order_type==="exit"),t=this._pendingCloseOrders.filter(n=>["close","close_all"].includes(n.place_order_type||"")),{close:r}=this._variables;for(const n of t)switch(n.place_order_type){case"close":this._closeOrderHandle(n,!0);break;case"close_all":this._closeAllOrders(n,r);break}for(const n of e){const{from_entry:i}=n,a=this._orders.filter(u=>!i||u.id===i&&(u.isMarketPriceLimit||u.isMarketPriceStop));for(const u of a)this._processExitOnClose(u,u.limit||u.stop||u.trail_stop_price||r,n)}this._pendingCloseOrders=[]}_entryOrderHandle(e){const{open:t,low:r,high:n}=this._variables,{isMarketPrice:i,qty:a=0,in_price:u,direction:f,active_price:c}=e;if(c&&n>=c&&r<=c)return delete e.active_price,e;let h=u;if(i&&(h=t),h<=n&&h>=r){const d=this._orders.filter(p=>p.direction!==f);this._entryOrder(d,h,a,e)}else return e}_orderOrderHandle(e){const{open:t,low:r,high:n,time:i,bar_index:a}=this._variables,{slippage:u=0}=this._options,{isMarketPrice:f,qty:c=0,in_price:h,direction:d,comment:p,oca_name:v,oca_type:x,active_price:_,id:y}=e;if(_&&n>=_&&r<=_)return delete e.active_price,e;let m=h,w=c;if(f&&(m=t),m<=n&&m>=r){const D=this._orders.filter(b=>b.direction!==d);if(D.length&&(w=this._processOrders(D,m,c,y,p),w<=0))return;const C=d===gt.long?1:-1;this._ocaGroupVerify(w,v,x),this._calcCurrentOrder({...e,in_price:m+C*u*this._mintick,in_index:a,in_time:i,qty:w});return}else return e}_closeOrderHandle(e,t){const{id:r,qty:n,qty_percent:i=100,comment:a}=e,{bar_index:u}=this._variables,f=this._orders.filter(v=>v.id===r&&v.in_index!==u&&(!v.close_qty||v.close_qty<(v.qty||0)));if(!f.length)return;let c=0;if(n?c=n:(c=f.reduce((v,x)=>v+(x.qty||0),c),c=i/100*c),c<=0)return;const{open:h,close:d}=this._variables;let p=c;for(const v of f){const{qty:x=0}=v;p<x?v.close_qty=p:(v.close_qty=x,p-=x)}this._processOrders(this._options.close_entries_rule==="ANY"?f:this._orders,t?d:h,c,`Close entry(s) order ${r}`,a)}_exitOrderHandle(e){const{from_entry:t}=e,r=this._orders.filter(n=>(!t||t===n.id)&&!n.hasExit);if(!(r.length&&!this._ordersToExit(r,e)))return e}_exit(e,t){const{profit:r,loss:n,stop:i,limit:a,trail_offset:u,trail_price:f,trail_points:c,from_entry:h="",id:d}=e;if(this._isNaN(r)&&this._isNaN(n)&&this._isNaN(i)&&this._isNaN(a)&&(this._isNaN(u)||this._isNaN(c)&&this._isNaN(f))){this._errorListener.addError("strategy.exit must have at least one of the following parameters: 'profit', 'limit', 'loss', 'stop' or one of the following pairs: 'trail_offset' and 'trail_price' / 'trail_points'. To close the position at market price, use 'strategy.close'",t,Ve.Error);return}const p={...e,place_order_type:"exit"},v=this._orders.filter(y=>(!h||h===y.id)&&!y.hasExit),x=this._pendingOrders.filter(y=>!h||h===y.id);if(v.length){if(!this._ordersToExit(v,p))return}else if(!x.length)return;const _=this._pendingOrders.find(y=>y.id===d);_?Object.assign(_,{...e}):this._pendingOrders.push(p)}_ordersToExit(e,t){const{qty:r,qty_percent:n=100,id:i,comment:a,comment_loss:u,comment_profit:f,comment_trailing:c}=t;let h=r,d=!1;t.comment=a||i;for(const p of e){const{qty:v=0}=p,x=p.direction===gt.long?1:-1;h=r?r>=v?v:r:n/100*v,p.out_qty=h,h<v&&(d=!0),Object.assign(p,{out_comment:a||i,comment_loss:u,comment_profit:f,comment_trailing:c}),!(this._stopProfit(p,x,{...t,qty:h})||this._stopLoss(p,x,{...t,qty:h})||this._trailStopLoss(p,x,{...t,qty:h}))&&(p.place_order_type="exit")}return d}_addExitPendingCloseOrders(e){e.place_order_type="exit";const t=this._pendingCloseOrders.find(r=>r.id===e.id);t?Object.assign(t,{...e}):this._pendingCloseOrders.push(e)}_stopProfit(e,t,r){const{limit:n,profit:i,comment_profit:a,comment:u}=r;let f=n;const{close:c}=this._variables,{in_price:h}=e,{process_orders_on_close:d}=this._options;if(!this._isNaN(i)&&this._isNaN(n)&&(f=h+t*i*this._mintick),e.limit=f,f&&(f-c)*t<=0&&(e.isMarketPriceLimit=!0,r.comment=a||u,Object.assign(e,{out_comment:r.comment}),f=c,d))return this._addExitPendingCloseOrders(r),!0}_stopLoss(e,t,r){const{stop:n,loss:i,comment_loss:a,comment:u}=r;let f=n;const{close:c}=this._variables,{in_price:h}=e,{process_orders_on_close:d}=this._options;if(!this._isNaN(i)&&this._isNaN(n)&&(f=h-t*i*this._mintick),e.stop=f,f&&(f-c)*t>=0&&(e.isMarketPriceStop=!0,r.comment=a||u,Object.assign(e,{out_comment:r.comment}),f=c,d))return this._addExitPendingCloseOrders(r),!0}_trailStopLoss(e,t,r){const{trail_offset:n,trail_price:i,trail_points:a,comment_trailing:u,comment:f}=r;if(!this._isNaN(n)){const{close:c}=this._variables,{in_price:h}=e,{process_orders_on_close:d}=this._options;let p;if(this._isNaN(i)?this._isNaN(a)||(p=h+a*t*this._mintick):p=i,e.trail_offset=n,p&&(p-c)*t<=0){const v=c-n*t*this._mintick;if((v-c)*t>=0&&(e.trail_stop_price=c,e.isMarketPriceStop=!0,r.comment=u||f,Object.assign(e,{out_comment:r.comment}),d))return this._addExitPendingCloseOrders(r),!0;e.trail_stop_price=v}e.active_price=p}}_processExitOnClose(e,t,r){const{qty:n=0,comment:i,id:a}=r,{close_entries_rule:u="FIFO"}=this._options;if(u==="FIFO"){const f=this._processExitOrders(this._orders,t,n,a,i);f&&!f.hasExit?(f.hasExit=!0,Object.assign(e,{trail_stop_price:f.trail_stop_price,stop:f.stop,limit:f.limit,trail_offset:f.trail_offset,active_price:f.active_price})):f&&(e.hasExit=!0)}else e.hasExit=!0,this._processOrders([e],t,n,a,i)}_processExitOrders(e,t,r,n,i){let a=r,u;for(const f of e)if(u=f,a=this._processOrder(f,t,a,n,i),a<=0||!f.hasExit)break;return this._orders=this._orders.filter(f=>!f.isDeal),this._variables.strategy.updateOrders(this._orders),u}_processOrder(e,t,r,n,i){const{time:a,bar_index:u}=this._variables,{slippage:f=0}=this._options,{in_price:c,qty:h=0,max_profit:d=0,trading_loss:p=0,direction:v,commission:x=0,original_qty:_=0}=e,y=v===gt.long?1:-1;if(t=t-y*f*this._mintick,r<h){const m=h-r,w=(t-c)*y*r,D=d/h*r,C=p/h*r;this._calcPercent({...e,out_price:t,out_id:n,out_index:u,out_time:a,out_comment:i,profit:w,out_qty:r,max_profit:D,trading_loss:C});const b=(t-c)*y*m-x*m/_;Object.assign(e,{qty:m,profit:b,max_profit:d-D,trading_loss:p-C,total_profit:this._totalChangeCapital+b}),r=0}else{e.isDeal=!0;const m=(t-c)*y*h;this._calcPercent({...e,out_price:t,out_id:n,out_index:u,out_time:a,out_comment:i,out_qty:h,profit:m}),r-=h}return r}_calcPercent(e){const{commission_value:t}=this._options,{in_price:r,out_qty:n=0,out_price:i=0,original_qty:a=0}=e;let{profit:u=0,max_profit:f=0,trading_loss:c=0,commission:h=0}=e;f=f<0?0:f;const d=r*n;if(this._totalChangeCapital+=u,t){const p=this._getCommission(i,n);this._totalChangeCapital-=p,h=h*n/a+p,u=u-h,Object.assign(e,{commission:h,profit:u,max_profit:f})}Object.assign(e,{total_profit:this._totalChangeCapital,profit_percent:u/d*100,max_profit_percent:f/d*100,trading_loss_percent:c/d*100}),this._risk.intradayOrders+=1,this._historyOrder.push(e),this._variables.strategy.updateHistoryOrders(this._historyOrder)}_getCommission(e,t){const{commission_value:r=0,commission_type:n}=this._options,i=e*t;let a=0;switch(n){case Ir.percent:a=i*r/100;break;case Ir.cashPerContract:a=t*r;break;case Ir.cashPerOrder:a=r;break}return a}_calcCurrentOrder(e){const{commission_value:t}=this._options,{in_price:r,qty:n=0,max_profit:i=0,trading_loss:a=0}=e;let{profit:u=0}=e;const f=r*n;if(t){const c=this._getCommission(r,n);this._totalChangeCapital-=c,u=u-c,Object.assign(e,{commission:c,profit:u,total_profit:this._totalChangeCapital})}Object.assign(e,{original_qty:n,profit_percent:u/f*100,max_profit_percent:i/f*100,trading_loss_percent:a/f*100}),this._risk.intradayOrders+=1,this._orders.push(e),this._variables.strategy.updateOrders(this._orders)}_isNaN(e){return e===void 0||isNaN(e)}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}};var Hf={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){return function(t,r,n){r.prototype.isBetween=function(i,a,u,f){var c=n(i),h=n(a),d=(f=f||"()")[0]==="(",p=f[1]===")";return(d?this.isAfter(c,u):!this.isBefore(c,u))&&(p?this.isBefore(h,u):!this.isAfter(h,u))||(d?this.isBefore(c,u):!this.isAfter(c,u))&&(p?this.isAfter(h,u):!this.isBefore(h,u))}}})})(Hf);var MD=Hf.exports,ND=tt(MD),jf={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){return function(t,r,n){var i=r.prototype,a=function(p){var v,x=p.date,_=p.utc,y={};if(!((v=x)===null||v instanceof Date||v instanceof Array||i.$utils().u(v)||v.constructor.name!=="Object")){if(!Object.keys(x).length)return new Date;var m=_?n.utc():n();Object.keys(x).forEach(function(O){var A,N;y[A=O,N=i.$utils().p(A),N==="date"?"day":N]=x[O]});var w=y.day||(y.year||y.month>=0?1:m.date()),D=y.year||m.year(),C=y.month>=0?y.month:y.year||y.day?0:m.month(),b=y.hour||0,F=y.minute||0,B=y.second||0,M=y.millisecond||0;return _?new Date(Date.UTC(D,C,w,b,F,B,M)):new Date(D,C,w,b,F,B,M)}return x},u=i.parse;i.parse=function(p){p.date=a.bind(this)(p),u.bind(this)(p)};var f=i.set,c=i.add,h=i.subtract,d=function(p,v,x,_){_===void 0&&(_=1);var y=Object.keys(v),m=this;return y.forEach(function(w){m=p.bind(m)(v[w]*_,w)}),m};i.set=function(p,v){return v=v===void 0?p:v,p.constructor.name==="Object"?d.bind(this)(function(x,_){return f.bind(this)(_,x)},v,p):f.bind(this)(p,v)},i.add=function(p,v){return p.constructor.name==="Object"?d.bind(this)(c,p,v):c.bind(this)(p,v)},i.subtract=function(p,v){return p.constructor.name==="Object"?d.bind(this)(c,p,v,-1):h.bind(this)(p,v)}}})})(jf);var SD=jf.exports,OD=tt(SD),Yf={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t,r,n=1e3,i=6e4,a=36e5,u=864e5,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,h=2628e6,d=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,p={years:c,months:h,days:u,hours:a,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},v=function(F){return F instanceof C},x=function(F,B,M){return new C(F,M,B.$l)},_=function(F){return r.p(F)+"s"},y=function(F){return F<0},m=function(F){return y(F)?Math.ceil(F):Math.floor(F)},w=function(F){return Math.abs(F)},D=function(F,B){return F?y(F)?{negative:!0,format:""+w(F)+B}:{negative:!1,format:""+F+B}:{negative:!1,format:""}},C=function(){function F(M,O,A){var N=this;if(this.$d={},this.$l=A,M===void 0&&(this.$ms=0,this.parseFromMilliseconds()),O)return x(M*p[_(O)],this);if(typeof M=="number")return this.$ms=M,this.parseFromMilliseconds(),this;if(typeof M=="object")return Object.keys(M).forEach(function(k){N.$d[_(k)]=M[k]}),this.calMilliseconds(),this;if(typeof M=="string"){var I=M.match(d);if(I){var R=I.slice(2).map(function(k){return k!=null?Number(k):0});return this.$d.years=R[0],this.$d.months=R[1],this.$d.weeks=R[2],this.$d.days=R[3],this.$d.hours=R[4],this.$d.minutes=R[5],this.$d.seconds=R[6],this.calMilliseconds(),this}}return this}var B=F.prototype;return B.calMilliseconds=function(){var M=this;this.$ms=Object.keys(this.$d).reduce(function(O,A){return O+(M.$d[A]||0)*p[A]},0)},B.parseFromMilliseconds=function(){var M=this.$ms;this.$d.years=m(M/c),M%=c,this.$d.months=m(M/h),M%=h,this.$d.days=m(M/u),M%=u,this.$d.hours=m(M/a),M%=a,this.$d.minutes=m(M/i),M%=i,this.$d.seconds=m(M/n),M%=n,this.$d.milliseconds=M},B.toISOString=function(){var M=D(this.$d.years,"Y"),O=D(this.$d.months,"M"),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var N=D(A,"D"),I=D(this.$d.hours,"H"),R=D(this.$d.minutes,"M"),k=this.$d.seconds||0;this.$d.milliseconds&&(k+=this.$d.milliseconds/1e3,k=Math.round(1e3*k)/1e3);var z=D(k,"S"),L=M.negative||O.negative||N.negative||I.negative||R.negative||z.negative,G=I.format||R.format||z.format?"T":"",H=(L?"-":"")+"P"+M.format+O.format+N.format+G+I.format+R.format+z.format;return H==="P"||H==="-P"?"P0D":H},B.toJSON=function(){return this.toISOString()},B.format=function(M){var O=M||"YYYY-MM-DDTHH:mm:ss",A={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return O.replace(f,function(N,I){return I||String(A[N])})},B.as=function(M){return this.$ms/p[_(M)]},B.get=function(M){var O=this.$ms,A=_(M);return A==="milliseconds"?O%=1e3:O=A==="weeks"?m(O/p[A]):this.$d[A],O||0},B.add=function(M,O,A){var N;return N=O?M*p[_(O)]:v(M)?M.$ms:x(M,this).$ms,x(this.$ms+N*(A?-1:1),this)},B.subtract=function(M,O){return this.add(M,O,!0)},B.locale=function(M){var O=this.clone();return O.$l=M,O},B.clone=function(){return x(this.$ms,this)},B.humanize=function(M){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!M)},B.valueOf=function(){return this.asMilliseconds()},B.milliseconds=function(){return this.get("milliseconds")},B.asMilliseconds=function(){return this.as("milliseconds")},B.seconds=function(){return this.get("seconds")},B.asSeconds=function(){return this.as("seconds")},B.minutes=function(){return this.get("minutes")},B.asMinutes=function(){return this.as("minutes")},B.hours=function(){return this.get("hours")},B.asHours=function(){return this.as("hours")},B.days=function(){return this.get("days")},B.asDays=function(){return this.as("days")},B.weeks=function(){return this.get("weeks")},B.asWeeks=function(){return this.as("weeks")},B.months=function(){return this.get("months")},B.asMonths=function(){return this.as("months")},B.years=function(){return this.get("years")},B.asYears=function(){return this.as("years")},F}(),b=function(F,B,M){return F.add(B.years()*M,"y").add(B.months()*M,"M").add(B.days()*M,"d").add(B.hours()*M,"h").add(B.minutes()*M,"m").add(B.seconds()*M,"s").add(B.milliseconds()*M,"ms")};return function(F,B,M){t=M,r=M().$utils(),M.duration=function(N,I){var R=M.locale();return x(N,{$l:R},I)},M.isDuration=v;var O=B.prototype.add,A=B.prototype.subtract;B.prototype.add=function(N,I){return v(N)?b(this,N,1):O.bind(this)(N,I)},B.prototype.subtract=function(N,I){return v(N)?b(this,N,-1):A.bind(this)(N,I)}}})})(Yf);var ID=Yf.exports,TD=tt(ID);ot.extend(yl),ot.extend(ND),ot.extend(OD),ot.extend(TD);class Zf{constructor(e,t,r){U(this,"array");U(this,"color");U(this,"math");U(this,"str");U(this,"map");U(this,"matrix");U(this,"timeframe");U(this,"ta");U(this,"input");U(this,"_variables");U(this,"_cacheData");U(this,"_options");U(this,"_errorListener");U(this,"_plots");U(this,"_plotshapes");U(this,"_plotbars");U(this,"_plotchars");U(this,"_plotarrows");U(this,"_plotcandles");U(this,"_alerts");U(this,"_bgColors");U(this,"_hlines");U(this,"_fills");U(this,"chart");U(this,"line");U(this,"label");U(this,"polyline");U(this,"box");U(this,"table");U(this,"linefill");U(this,"log");U(this,"runtime");U(this,"strategy");U(this,"request");U(this,"syminfo");U(this,"_count",0);var i;const n=((i=e.toString().split(".")[1])==null?void 0:i.length)||4;this._variables=t,this._errorListener=new fw,this.array=new g1(this._errorListener),this.math=new m1(n,this._errorListener),this.color=new Gx,this.str=new Ky(this._errorListener,n),this.map=new Xy(this._errorListener),this.timeframe=new Gy(t),this.matrix=new Vy(this._errorListener),this.ta=new Hx(t,this.math,this.timeframe),this._cacheData={},this._options={},this._bgColors={},this._alerts=new Map,this._hlines=new Map,this._fills=new Map,this.input=new Vx(t,this._errorListener,r),this._plots=new Map,this._plotshapes=new Map,this._plotbars=new Map,this._plotcandles=new Map,this._plotchars=new Map,this._plotarrows=new Map,this.chart={point:new Qy(t)},this.line=new DD(t,this._errorListener),this.label=new Jy(t,this._errorListener),this.polyline=new yD(t,this._errorListener),this.box=new bD(t,this._errorListener),this.table=new ED(t,this._errorListener),this.linefill=new wD(t),this.log=new lw(t),this.runtime=new cw(this._errorListener),this.strategy=new BD(this._variables,this._options,e,this._errorListener),this.request=new aw(this._variables,r),this.syminfo=new uw}get errors(){return this._errorListener.errors}options(e){if(e.length)return this._getDataOfBarindex(e);const t=this.input.getInputs(),r=this._alerts.size?[...this._alerts.values()]:void 0;this._alerts.clear();const n=Object.keys(this._bgColors);let i;if(n.length){i={};for(const y of n)i[y]=[...this._bgColors[y].values()]}const a=this._hlines.size?[...this._hlines.values()]:void 0,u=this._fills.size?[...this._fills.values()]:void 0,f=this.log.logs.length?this.log.logs:void 0;this.log.clearLogs(),this._options.scriptType==="strategy"&&Object.assign(this._options,{orders:this.strategy.orders,historyOrders:this.strategy.historyOrders});const c=this._plots.size>0?[...this._plots.values()]:void 0,h=this._plotbars.size>0?[...this._plotbars.values()]:void 0,d=this._plotshapes.size>0?[...this._plotshapes.values()]:void 0,p=this._plotarrows.size>0?[...this._plotarrows.values()]:void 0,v=this._plotcandles.size>0?[...this._plotcandles.values()]:void 0,x=this._plotchars.size>0?[...this._plotchars.values()]:void 0,_=this._getDraws();return Object.assign(this._options,{inputs:t,plots:c,draws:_,alerts:r,colors:i,hlines:a,fills:u,logs:f,plotshapes:d,plotarrows:p,plotcandles:v,plotchars:x,plotbars:h})}_getDataOfBarindex(e){const t=this._alerts.size?[...this._alerts.values()]:void 0;this._alerts.clear();const r=Object.keys(this._bgColors);let n;if(r.length){n={};for(const d of r)n[d]=[...this._bgColors[d].values()].map(p=>{const v=[];for(const x of e){const _=p.colors[x];_&&v.push(_)}return p.colors=v,p})}const i=this._hlines.size?[...this._hlines.values()]:void 0,a=this._fills.size?this._getDataFromBarindex(e,[...this._fills.values()]):void 0,u=this.log.logs.length?this.log.logs:void 0;this.log.clearLogs(),this._options.scriptType==="strategy"&&Object.assign(this._options,{orders:this.strategy.orders,historyOrders:this.strategy.historyOrders});const f=this._getDataFromBarindex(e,[...this._plots.values()]),c=this._plotshapes.size>0?this._getDataFromBarindex(e,[...this._plotshapes.values()]):void 0,h=this._getDrawsFromBarindex(e);return Object.assign(this._options,{plots:f,draws:h,alerts:t,colors:n,hlines:i,fills:a,logs:u,plotshapes:c})}_getDataFromBarindex(e,t){return t.map(r=>{const n=[];for(const i of e){const a=r.data[i];a&&n.push(a)}return r.data=n,{...r}})}_getDraws(){const{line:e,linefill:t,table:r,box:n,polyline:i,label:a}=this._variables,u={};return e.data.length&&(u.lines=e.data),t.data.length&&(u.linefills=t.data),r.data.length&&(u.tables=r.data),n.data.length&&(u.boxes=n.data),i.data.length&&(u.polylines=i.data),a.data.length&&(u.labels=a.data),Object.keys(u).length?u:void 0}_getDrawsFromBarindex(e){const{line:t,linefill:r,table:n,box:i,polyline:a,label:u}=this._variables,f={};return t.data.length&&(f.lines=t.getValOfBarIndex(e)),r.data.length&&(f.linefills=r.getValOfBarIndex(e)),n.data.length&&(f.tables=n.getValOfBarIndex(e)),i.data.length&&(f.boxes=i.getValOfBarIndex(e)),a.data.length&&(f.polylines=a.getValOfBarIndex(e)),u.data.length&&(f.labels=u.getValOfBarIndex(e)),Object.keys(f).length?f:void 0}updateOptions(e){const{inputs:t}=e;t&&t.length&&this.input.update(t)}update(e){const{barIndex:t}=e;this.strategy.updateOptions(),this.math.update(t)}endExecution(){this.strategy.endExecution()}library(e,t){if(!this._variables.bar_index){const r=/^[^\W\d\s][^\W\s]*$/,{title:n}=e;r.test(n)?(Zx.includes(n)||Yx.includes(n))&&this._errorListener.addError(or(Kt.libraryTitleIsKeywordErr,{name:n}),t,Ve.Error):this._errorListener.addError(Kt.libraryTitleErr,t,Ve.Error),this._options.scriptType="library",this._options.library=e}}indicator(e,t){if(!this._variables.bar_index){const{format:r}=e;this._paramVerfiy(r,t,"indicator",[Je.inherit,Je.percent,Je.price,Je.volume]),this._variables.updateMaxLength(e),this._options.scriptType="indicator",this._options.indicator=e}}_paramVerfiy(e="",t,r,n,i="format"){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}plot(e,t){const{series:r,color:n,...i}=e,{bar_index:a,time:u}=this._variables,f=`plot_${t}`,c=this._plots.get(f),h=(c==null?void 0:c.data)||[],d=r!==void 0&&isNaN(r)?void 0:r;if(h[a]={value:[u,d],itemStyle:{color:n}},this._seriesColorHandle(e,["color"],c),!c){this._count++,this._paramVerfiy(e.format,t,"plot",[Je.percent,Je.price,Je.volume]);const p=n?[n]:void 0;this._plots.set(f,{editable:!0,...i,colors:p,data:h,id:f,zIndex:this._count})}return{type:"plot",key:f}}plotbar(e,t){const{open:r,close:n,low:i,high:a,color:u,...f}=e,{bar_index:c,time:h}=this._variables,d=`plotbar_${t}`,p=this._plotbars.get(d),v=(p==null?void 0:p.data)||[],x=n!==void 0&&isNaN(n)?void 0:n,_=r!==void 0&&isNaN(r)?void 0:r,y=i!==void 0&&isNaN(i)?void 0:i,m=a!==void 0&&isNaN(a)?void 0:a,w=[h,_,x,y,m];if(v[c]={value:w,itemStyle:{color:u}},this._seriesColorHandle(e,["color"],p),!p){this._count++,this._paramVerfiy(e.format,t,"plotbar",[Je.percent,Je.price,Je.volume]);const D=u?[u]:void 0;this._plotbars.set(d,{editable:!0,...f,colors:D,data:v,id:d,zIndex:this._count})}}_verfiyArgs(e,t,r){const{size:n,format:i,location:a,style:u}=e;this._paramVerfiy(u,r,t,Object.values(_r),"style"),this._paramVerfiy(a,r,t,Object.values(_n),"location"),this._paramVerfiy(n,r,t,Object.values(ar),"size"),this._paramVerfiy(i,r,t,[Je.percent,Je.price,Je.volume],"format")}plotchar(e,t){const{series:r,color:n,textcolor:i,location:a=_n.abovebar,...u}=e,{bar_index:f,time:c,high:h,low:d}=this._variables,p=`plotchar_${t}`,v=this._plotchars.get(p),x=(v==null?void 0:v.data)||[],_={value:[c,r],itemStyle:{color:n,textcolor:i},low:d,high:h};x[f]=_,this._seriesColorHandle(e,["color","textcolor"],v),v||(this._count++,this._verfiyArgs(e,"plotchar",t),this._plotchars.set(p,{editable:!0,...u,location:a,data:x,id:p,zIndex:this._count}))}plotarrow(e,t){const{series:r,colorup:n,colordown:i,...a}=e,{bar_index:u,time:f}=this._variables,c=`plotarrow_${t}`,h=this._plotarrows.get(c),d=(h==null?void 0:h.data)||[];d[u]={value:[f,r!==void 0&&isNaN(r)?void 0:r],itemStyle:{colorup:n,colordown:i}},this._seriesColorHandle(e,["colorup","colordown"],h),h||(this._count++,this._paramVerfiy(e.format,t,"plotarrow",[Je.percent,Je.price,Je.volume]),this._plotarrows.set(c,{editable:!0,...a,data:d,id:c,zIndex:this._count}))}plotshape(e,t){const{series:r,color:n,textcolor:i,location:a=_n.abovebar,...u}=e,{bar_index:f,time:c,low:h,high:d}=this._variables,p=`plotshape_${t}`,v=this._plotshapes.get(p),x=(v==null?void 0:v.data)||[],_={value:r,color:n,textcolor:i,time:c,low:h,high:d};if(x[f]=_,this._seriesColorHandle(e,["color","textcolor"],v),!v){this._count++;const y=n?[n]:void 0;this._verfiyArgs(e,"plotshape",t),this._plotshapes.set(p,{editable:!0,...u,data:x,location:a,id:p,colors:y,zIndex:this._count})}}plotcandle(e,t){const{wickcolor:r,bordercolor:n,color:i,close:a,open:u,low:f,high:c,...h}=e,{bar_index:d,time:p}=this._variables,v=`plotcandle_${t}`,x=this._plotcandles.get(v),_=(x==null?void 0:x.data)||[],y=a!==void 0&&isNaN(a)?void 0:a,m=u!==void 0&&isNaN(u)?void 0:u,w=f!==void 0&&isNaN(f)?void 0:f,D=c!==void 0&&isNaN(c)?void 0:c,C=[p,m,y,w,D];_[d]={value:C,wickcolor:r,bordercolor:n,color:i},this._seriesColorHandle(e,["wickcolor","bordercolor","color"],x),x||(this._count++,this._paramVerfiy(e.format,t,"plotcandle",[Je.percent,Je.price,Je.volume]),this._plotcandles.set(v,{editable:!0,...h,data:_,id:v,zIndex:this._count}))}hline(e,t){const r=`hline_${t}`;this._verifyDisplay(e.display,"hline",t);const n=e.display&&!e.display.length?Zt.none:Zt.all;return this._hlines.has(r)||(this._count++,this._hlines.set(r,{id:r,linewidth:1,editable:!0,display:n,...e,zIndex:this._count})),{type:"hline",key:r}}fill(e,t){var b,F,B,M,O,A,N,I,R,k;const{color:r,top_color:n,bottom_color:i,seriesColors:a,hline1:u,hline2:f,plot1:c,plot2:h,...d}=e,{bar_index:p,time:v}=this._variables,x=`fill_${t}`,_=this._fills.get(x),y=(_==null?void 0:_.data)||[];this._verifyDisplay(e.display,"fill",t);const m=e.display&&!e.display.length?Zt.none:Zt.all;let w,D,C="plot";if(u&&f)w=(b=this._hlines.get(u==null?void 0:u.key))==null?void 0:b.price,D=(F=this._hlines.get(f==null?void 0:f.key))==null?void 0:F.price,C="hline";else{const z=((B=this._plots.get(c==null?void 0:c.key))==null?void 0:B.data)||[],L=((M=this._plots.get(h==null?void 0:h.key))==null?void 0:M.data)||[];w=(A=(O=z[p])==null?void 0:O.value)==null?void 0:A[1],D=(I=(N=L[p])==null?void 0:N.value)==null?void 0:I[1]}if(y[p]={time:v,color:r,top_color:n,bottom_color:i,plot1:w,plot2:D},this._seriesColorHandle(e,["color","top_color","bottom_color"],_),!_){this._count++;const z=((R=this._options.indicator)==null?void 0:R.explicit_plot_zorder)||((k=this._options.strategy)==null?void 0:k.explicit_plot_zorder),L=r?[r]:void 0,G=n?[n]:void 0,H=i?[i]:void 0;this._fills.set(x,{id:x,colors:L,top_colors:G,bottom_colors:H,display:m,data:y,type:C,editable:!0,fillgaps:!1,hline1:u,hline2:f,plot1:c,plot2:h,...d,zIndex:z?this._count:void 0})}}alert({message:e,freq:t=Vr.freqOncePerBar},r){const{bar_index:n,_isRealTimeBar:i,last_bar_index:a}=this._variables,u=`alert_${r}`,f=this._cacheData[u]||{},c=f.barIndex;if(this._paramVerfiy(t,r,"alert",[Vr.freqAll,Vr.freqOncePerBar,Vr.freqOncePerBarClose]),t===Vr.freqOncePerBar&&n===c){this._alerts.delete(u);return}this._cacheData[u]=f;const h={message:e,freq:t,id:u,type:"alert"};if(i){t!==Vr.freqOncePerBarClose&&this._alerts.set(u,h),f.barIndex=n;return}if(!i&&t===Vr.freqOncePerBarClose&&n===c&&a===n-1){this._alerts.set(u,h),f.barIndex=n;return}this._alerts.delete(u)}alertcondition({condition:e,message:t,title:r},n){const{_isRealTimeBar:i}=this._variables,a=`alertcondition_${n}`;i&&e?this._alerts.set(a,{message:t,title:r,id:a,type:"alertcondition"}):this._alerts.delete(a)}barcolor(e,t){this._setColors(e,"barcolor",t)}bgcolor(e,t){this._setColors(e,"bgcolor",t)}_verifyDisplay(e=qf.all,t,r){e.length&&e.length<4&&this._errorListener.addError(or(Kt.displayErr,{func:t,values:"[display.none, display.all]"}),r,Ve.Error)}_setColors(e,t,r){const{color:n,seriesColors:i,...a}=e;this._verifyDisplay(a.display,t,r);const u=e.display&&!e.display.length?Zt.none:Zt.all,{bar_index:f,time:c}=this._variables,h=`${t}_${r}`;this._bgColors[t]||(this._bgColors[t]=new Map);const d=this._bgColors[t].get(h),p=(d==null?void 0:d.colors)||[],v=(d==null?void 0:d.setColors)||[];n&&!v.includes(n)&&v.push(n),p[f]={color:n,time:c},d||this._bgColors[t].set(h,{...a,display:u,colors:p,setColors:v,id:h})}max_bars_back({var:e,num:t,var_name:r}){console.log(e,t,r)}float({x:e}){return e}bool({x:e}){return e||!1}string({x:e}){return e}int({x:e}){return e&&Math.trunc(e)}na({x:e}){return!!(e===void 0||isNaN(e))}fixnan({source:e},t){return e===void 0||isNaN(e)?this._cacheData[`fixnan_${t}`]:(this._cacheData[`fixnan_${t}`]=e,e)}nz({source:e,replacement:t}){return e!==void 0&&!isNaN(e)?e:t||0}time({timeframe:e="",session:t,timezone:r,bars_back:n=0},i){return this._timeHandle(this._variables.time,i,e,t,r,n)}time_close({timeframe:e="",session:t,timezone:r,bars_back:n=0},i){return this._variables.time_close&&this._timeHandle(this._variables.time_close,i,e,t,r,n)}timestamp(e){const{dateString:t,timezone:r,year:n,month:i,day:a,hour:u=0,minute:f=0,second:c=0}=e;if(t)return ot(t).utc(!/GMT|UTC/.test(t)).valueOf();let h=i-1,d=n;if(h<0){const v=Math.ceil(Math.abs(h/12));h=12*v+h,d=n-v}let p=ot({year:d,month:h,day:a,hour:u,minute:f,second:c});return r&&(p=Zr(p.utc(!0).valueOf(),r)),p.utc(!0).valueOf()}weekofyear({time:e,timezone:t}){return Zr(e,t).week()}year({time:e,timezone:t}){return Zr(e,t).year()}second({time:e,timezone:t}){return Zr(e,t).second()}month({time:e,timezone:t}){return Zr(e,t).month()+1}minute({time:e,timezone:t}){return Zr(e,t).minute()}hour({time:e,timezone:t}){return Zr(e,t).hour()}dayofweek({time:e,timezone:t}){return Zr(e,t).day()+1}dayofmonth({time:e,timezone:t}){return Zr(e,t).date()}_calcTimeOffset(e,t){const r=this._variables.getTimeTradingday(e,t),n=pn(t)*1e3;return e-r-Math.floor((e-r)/n)*n}_timeHandle(e,t,r="",n,i,a=0){const u=r||this._variables.timeframe.period,f=pn(u),c=pn(this._variables.timeframe.period);let h;if(f<=c)h=e;else{const d=`time_${t}`,p=this._cacheData[d];if(p)p.currentTime+f*1e3-p.offset<=e?(h=e,this._cacheData[d]={currentTime:e,offset:0}):h=p;else{const v=this._calcTimeOffset(e,u);this._cacheData[d]={currentTime:e,offset:v},h=e}}if(n){const{timePeriods:d,weeks:p}=this._parserSession(n,t),v=ot(e).format("YYYY-MM-DD"),x=h;h=void 0;for(const y of d){const[m,w]=y;if(ot(e).isBetween(`${v} ${m}`,`${v} ${w}`,"hour")){ot(x).isBetween(`${v} ${m}`,`${v} ${w}`,"hour")?h=x:h=ot(`${v} ${m}`).valueOf();break}}const _=this._variables.dayofweek;h&&!p.includes(_)&&(h=void 0)}return i&&(h=h&&Zr(h,i).valueOf()),h&&h-a*c*1e3}_seriesColorHandle(e,t,r){var n;if(r&&t!=null&&t.length)for(const i of t){if((n=r.gradientColorKeys)!=null&&n.includes(i))continue;const a=e[i];if(!a)continue;const u=r[`${i}s`]||[];u.includes(a)||(u.push(a),r[`${i}s`]=u,u.length>5&&(r[`${i}s`]=[],r.gradientColorKeys=r.gradientColorKeys||[],r.gradientColorKeys.push(i)))}}_parserSession(e,t){const r=e.split(":"),n=r[0],a=(r[1]||"1234567").split("").map(f=>{const c=parseInt(f,10);if(c<1||c>7){this._errorListener.addError(`Invalid day of week: ${f}`,t,Ve.Error);return}return c});return{timePeriods:n.split(",").map(f=>{const c=f.split("-");return c.length!==2?(this._errorListener.addError(`Invalid time period: ${f}`,t,Ve.Error),[]):[this._processTime(c[0],t),this._processTime(c[1],t)]}),weeks:a}}_processTime(e,t){const r=parseInt(e.slice(0,2),10),n=parseInt(e.slice(2),10);if(!(r>=0&&r<=23)&&n>=0&&n<=59){this._errorListener.addError("Invalid time: Time must be within 00:00 to 23:59",t,Ve.Error);return}return`${r}:${n}`}}var Vf={exports:{}};function $D(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var su={exports:{}},Gf;function Ge(){return Gf||(Gf=1,function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t=t||function(r,n){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof ye<"u"&&ye.crypto&&(i=ye.crypto),!i&&typeof $D=="function")try{i=bx}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},u=Object.create||function(){function w(){}return function(D){var C;return w.prototype=D,C=new w,w.prototype=null,C}}(),f={},c=f.lib={},h=c.Base=function(){return{extend:function(w){var D=u(this);return w&&D.mixIn(w),(!D.hasOwnProperty("init")||this.init===D.init)&&(D.init=function(){D.$super.init.apply(this,arguments)}),D.init.prototype=D,D.$super=this,D},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var D in w)w.hasOwnProperty(D)&&(this[D]=w[D]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=c.WordArray=h.extend({init:function(w,D){w=this.words=w||[],D!=n?this.sigBytes=D:this.sigBytes=w.length*4},toString:function(w){return(w||v).stringify(this)},concat:function(w){var D=this.words,C=w.words,b=this.sigBytes,F=w.sigBytes;if(this.clamp(),b%4)for(var B=0;B<F;B++){var M=C[B>>>2]>>>24-B%4*8&255;D[b+B>>>2]|=M<<24-(b+B)%4*8}else for(var O=0;O<F;O+=4)D[b+O>>>2]=C[O>>>2];return this.sigBytes+=F,this},clamp:function(){var w=this.words,D=this.sigBytes;w[D>>>2]&=4294967295<<32-D%4*8,w.length=r.ceil(D/4)},clone:function(){var w=h.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var D=[],C=0;C<w;C+=4)D.push(a());return new d.init(D,w)}}),p=f.enc={},v=p.Hex={stringify:function(w){for(var D=w.words,C=w.sigBytes,b=[],F=0;F<C;F++){var B=D[F>>>2]>>>24-F%4*8&255;b.push((B>>>4).toString(16)),b.push((B&15).toString(16))}return b.join("")},parse:function(w){for(var D=w.length,C=[],b=0;b<D;b+=2)C[b>>>3]|=parseInt(w.substr(b,2),16)<<24-b%8*4;return new d.init(C,D/2)}},x=p.Latin1={stringify:function(w){for(var D=w.words,C=w.sigBytes,b=[],F=0;F<C;F++){var B=D[F>>>2]>>>24-F%4*8&255;b.push(String.fromCharCode(B))}return b.join("")},parse:function(w){for(var D=w.length,C=[],b=0;b<D;b++)C[b>>>2]|=(w.charCodeAt(b)&255)<<24-b%4*8;return new d.init(C,D)}},_=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(x.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return x.parse(unescape(encodeURIComponent(w)))}},y=c.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=_.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var D,C=this._data,b=C.words,F=C.sigBytes,B=this.blockSize,M=B*4,O=F/M;w?O=r.ceil(O):O=r.max((O|0)-this._minBufferSize,0);var A=O*B,N=r.min(A*4,F);if(A){for(var I=0;I<A;I+=B)this._doProcessBlock(b,I);D=b.splice(0,A),C.sigBytes-=N}return new d.init(D,N)},clone:function(){var w=h.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});c.Hasher=y.extend({cfg:h.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var D=this._doFinalize();return D},blockSize:16,_createHelper:function(w){return function(D,C){return new w.init(C).finalize(D)}},_createHmacHelper:function(w){return function(D,C){return new m.HMAC.init(w,C).finalize(D)}}});var m=f.algo={};return f}(Math);return t})}(su)),su.exports}var ou={exports:{}},Kf;function Bo(){return Kf||(Kf=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.Base,u=i.WordArray,f=n.x64={};f.Word=a.extend({init:function(c,h){this.high=c,this.low=h}}),f.WordArray=a.extend({init:function(c,h){c=this.words=c||[],h!=r?this.sigBytes=h:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,h=c.length,d=[],p=0;p<h;p++){var v=c[p];d.push(v.high),d.push(v.low)}return u.create(d,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),h=c.words=this.words.slice(0),d=h.length,p=0;p<d;p++)h[p]=h[p].clone();return c}})}(),t})}(ou)),ou.exports}var au={exports:{}},Xf;function RD(){return Xf||(Xf=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){if(typeof ArrayBuffer=="function"){var r=t,n=r.lib,i=n.WordArray,a=i.init,u=i.init=function(f){if(f instanceof ArrayBuffer&&(f=new Uint8Array(f)),(f instanceof Int8Array||typeof Uint8ClampedArray<"u"&&f instanceof Uint8ClampedArray||f instanceof Int16Array||f instanceof Uint16Array||f instanceof Int32Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array)&&(f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength)),f instanceof Uint8Array){for(var c=f.byteLength,h=[],d=0;d<c;d++)h[d>>>2]|=f[d]<<24-d%4*8;a.call(this,h,c)}else a.apply(this,arguments)};u.prototype=i}}(),t.lib.WordArray})}(au)),au.exports}var uu={exports:{}},Qf;function LD(){return Qf||(Qf=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(f){for(var c=f.words,h=f.sigBytes,d=[],p=0;p<h;p+=2){var v=c[p>>>2]>>>16-p%4*8&65535;d.push(String.fromCharCode(v))}return d.join("")},parse:function(f){for(var c=f.length,h=[],d=0;d<c;d++)h[d>>>1]|=f.charCodeAt(d)<<16-d%2*16;return i.create(h,c*2)}},a.Utf16LE={stringify:function(f){for(var c=f.words,h=f.sigBytes,d=[],p=0;p<h;p+=2){var v=u(c[p>>>2]>>>16-p%4*8&65535);d.push(String.fromCharCode(v))}return d.join("")},parse:function(f){for(var c=f.length,h=[],d=0;d<c;d++)h[d>>>1]|=u(f.charCodeAt(d)<<16-d%2*16);return i.create(h,c*2)}};function u(f){return f<<8&4278255360|f>>>8&16711935}}(),t.enc.Utf16})}(uu)),uu.exports}var lu={exports:{}},Jf;function oi(){return Jf||(Jf=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(f){var c=f.words,h=f.sigBytes,d=this._map;f.clamp();for(var p=[],v=0;v<h;v+=3)for(var x=c[v>>>2]>>>24-v%4*8&255,_=c[v+1>>>2]>>>24-(v+1)%4*8&255,y=c[v+2>>>2]>>>24-(v+2)%4*8&255,m=x<<16|_<<8|y,w=0;w<4&&v+w*.75<h;w++)p.push(d.charAt(m>>>6*(3-w)&63));var D=d.charAt(64);if(D)for(;p.length%4;)p.push(D);return p.join("")},parse:function(f){var c=f.length,h=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<h.length;p++)d[h.charCodeAt(p)]=p}var v=h.charAt(64);if(v){var x=f.indexOf(v);x!==-1&&(c=x)}return u(f,c,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function u(f,c,h){for(var d=[],p=0,v=0;v<c;v++)if(v%4){var x=h[f.charCodeAt(v-1)]<<v%4*2,_=h[f.charCodeAt(v)]>>>6-v%4*2,y=x|_;d[p>>>2]|=y<<24-p%4*8,p++}return i.create(d,p)}}(),t.enc.Base64})}(lu)),lu.exports}var cu={exports:{}},eh;function PD(){return eh||(eh=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.enc;a.Base64url={stringify:function(f,c){c===void 0&&(c=!0);var h=f.words,d=f.sigBytes,p=c?this._safe_map:this._map;f.clamp();for(var v=[],x=0;x<d;x+=3)for(var _=h[x>>>2]>>>24-x%4*8&255,y=h[x+1>>>2]>>>24-(x+1)%4*8&255,m=h[x+2>>>2]>>>24-(x+2)%4*8&255,w=_<<16|y<<8|m,D=0;D<4&&x+D*.75<d;D++)v.push(p.charAt(w>>>6*(3-D)&63));var C=p.charAt(64);if(C)for(;v.length%4;)v.push(C);return v.join("")},parse:function(f,c){c===void 0&&(c=!0);var h=f.length,d=c?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v<d.length;v++)p[d.charCodeAt(v)]=v}var x=d.charAt(64);if(x){var _=f.indexOf(x);_!==-1&&(h=_)}return u(f,h,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function u(f,c,h){for(var d=[],p=0,v=0;v<c;v++)if(v%4){var x=h[f.charCodeAt(v-1)]<<v%4*2,_=h[f.charCodeAt(v)]>>>6-v%4*2,y=x|_;d[p>>>2]|=y<<24-p%4*8,p++}return i.create(d,p)}}(),t.enc.Base64url})}(cu)),cu.exports}var fu={exports:{}},th;function ai(){return th||(th=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,f=n.algo,c=[];(function(){for(var _=0;_<64;_++)c[_]=r.abs(r.sin(_+1))*4294967296|0})();var h=f.MD5=u.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(_,y){for(var m=0;m<16;m++){var w=y+m,D=_[w];_[w]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}var C=this._hash.words,b=_[y+0],F=_[y+1],B=_[y+2],M=_[y+3],O=_[y+4],A=_[y+5],N=_[y+6],I=_[y+7],R=_[y+8],k=_[y+9],z=_[y+10],L=_[y+11],G=_[y+12],H=_[y+13],ee=_[y+14],te=_[y+15],j=C[0],X=C[1],Y=C[2],Q=C[3];j=d(j,X,Y,Q,b,7,c[0]),Q=d(Q,j,X,Y,F,12,c[1]),Y=d(Y,Q,j,X,B,17,c[2]),X=d(X,Y,Q,j,M,22,c[3]),j=d(j,X,Y,Q,O,7,c[4]),Q=d(Q,j,X,Y,A,12,c[5]),Y=d(Y,Q,j,X,N,17,c[6]),X=d(X,Y,Q,j,I,22,c[7]),j=d(j,X,Y,Q,R,7,c[8]),Q=d(Q,j,X,Y,k,12,c[9]),Y=d(Y,Q,j,X,z,17,c[10]),X=d(X,Y,Q,j,L,22,c[11]),j=d(j,X,Y,Q,G,7,c[12]),Q=d(Q,j,X,Y,H,12,c[13]),Y=d(Y,Q,j,X,ee,17,c[14]),X=d(X,Y,Q,j,te,22,c[15]),j=p(j,X,Y,Q,F,5,c[16]),Q=p(Q,j,X,Y,N,9,c[17]),Y=p(Y,Q,j,X,L,14,c[18]),X=p(X,Y,Q,j,b,20,c[19]),j=p(j,X,Y,Q,A,5,c[20]),Q=p(Q,j,X,Y,z,9,c[21]),Y=p(Y,Q,j,X,te,14,c[22]),X=p(X,Y,Q,j,O,20,c[23]),j=p(j,X,Y,Q,k,5,c[24]),Q=p(Q,j,X,Y,ee,9,c[25]),Y=p(Y,Q,j,X,M,14,c[26]),X=p(X,Y,Q,j,R,20,c[27]),j=p(j,X,Y,Q,H,5,c[28]),Q=p(Q,j,X,Y,B,9,c[29]),Y=p(Y,Q,j,X,I,14,c[30]),X=p(X,Y,Q,j,G,20,c[31]),j=v(j,X,Y,Q,A,4,c[32]),Q=v(Q,j,X,Y,R,11,c[33]),Y=v(Y,Q,j,X,L,16,c[34]),X=v(X,Y,Q,j,ee,23,c[35]),j=v(j,X,Y,Q,F,4,c[36]),Q=v(Q,j,X,Y,O,11,c[37]),Y=v(Y,Q,j,X,I,16,c[38]),X=v(X,Y,Q,j,z,23,c[39]),j=v(j,X,Y,Q,H,4,c[40]),Q=v(Q,j,X,Y,b,11,c[41]),Y=v(Y,Q,j,X,M,16,c[42]),X=v(X,Y,Q,j,N,23,c[43]),j=v(j,X,Y,Q,k,4,c[44]),Q=v(Q,j,X,Y,G,11,c[45]),Y=v(Y,Q,j,X,te,16,c[46]),X=v(X,Y,Q,j,B,23,c[47]),j=x(j,X,Y,Q,b,6,c[48]),Q=x(Q,j,X,Y,I,10,c[49]),Y=x(Y,Q,j,X,ee,15,c[50]),X=x(X,Y,Q,j,A,21,c[51]),j=x(j,X,Y,Q,G,6,c[52]),Q=x(Q,j,X,Y,M,10,c[53]),Y=x(Y,Q,j,X,z,15,c[54]),X=x(X,Y,Q,j,F,21,c[55]),j=x(j,X,Y,Q,R,6,c[56]),Q=x(Q,j,X,Y,te,10,c[57]),Y=x(Y,Q,j,X,N,15,c[58]),X=x(X,Y,Q,j,H,21,c[59]),j=x(j,X,Y,Q,O,6,c[60]),Q=x(Q,j,X,Y,L,10,c[61]),Y=x(Y,Q,j,X,B,15,c[62]),X=x(X,Y,Q,j,k,21,c[63]),C[0]=C[0]+j|0,C[1]=C[1]+X|0,C[2]=C[2]+Y|0,C[3]=C[3]+Q|0},_doFinalize:function(){var _=this._data,y=_.words,m=this._nDataBytes*8,w=_.sigBytes*8;y[w>>>5]|=128<<24-w%32;var D=r.floor(m/4294967296),C=m;y[(w+64>>>9<<4)+15]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,y[(w+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,_.sigBytes=(y.length+1)*4,this._process();for(var b=this._hash,F=b.words,B=0;B<4;B++){var M=F[B];F[B]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var _=u.clone.call(this);return _._hash=this._hash.clone(),_}});function d(_,y,m,w,D,C,b){var F=_+(y&m|~y&w)+D+b;return(F<<C|F>>>32-C)+y}function p(_,y,m,w,D,C,b){var F=_+(y&w|m&~w)+D+b;return(F<<C|F>>>32-C)+y}function v(_,y,m,w,D,C,b){var F=_+(y^m^w)+D+b;return(F<<C|F>>>32-C)+y}function x(_,y,m,w,D,C,b){var F=_+(m^(y|~w))+D+b;return(F<<C|F>>>32-C)+y}n.MD5=u._createHelper(h),n.HmacMD5=u._createHmacHelper(h)}(Math),t.MD5})}(fu)),fu.exports}var hu={exports:{}},rh;function nh(){return rh||(rh=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=n.Hasher,u=r.algo,f=[],c=u.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(h,d){for(var p=this._hash.words,v=p[0],x=p[1],_=p[2],y=p[3],m=p[4],w=0;w<80;w++){if(w<16)f[w]=h[d+w]|0;else{var D=f[w-3]^f[w-8]^f[w-14]^f[w-16];f[w]=D<<1|D>>>31}var C=(v<<5|v>>>27)+m+f[w];w<20?C+=(x&_|~x&y)+1518500249:w<40?C+=(x^_^y)+1859775393:w<60?C+=(x&_|x&y|_&y)-1894007588:C+=(x^_^y)-899497514,m=y,y=_,_=x<<30|x>>>2,x=v,v=C}p[0]=p[0]+v|0,p[1]=p[1]+x|0,p[2]=p[2]+_|0,p[3]=p[3]+y|0,p[4]=p[4]+m|0},_doFinalize:function(){var h=this._data,d=h.words,p=this._nDataBytes*8,v=h.sigBytes*8;return d[v>>>5]|=128<<24-v%32,d[(v+64>>>9<<4)+14]=Math.floor(p/4294967296),d[(v+64>>>9<<4)+15]=p,h.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});r.SHA1=a._createHelper(c),r.HmacSHA1=a._createHmacHelper(c)}(),t.SHA1})}(hu)),hu.exports}var du={exports:{}},ih;function pu(){return ih||(ih=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,f=n.algo,c=[],h=[];(function(){function v(m){for(var w=r.sqrt(m),D=2;D<=w;D++)if(!(m%D))return!1;return!0}function x(m){return(m-(m|0))*4294967296|0}for(var _=2,y=0;y<64;)v(_)&&(y<8&&(c[y]=x(r.pow(_,1/2))),h[y]=x(r.pow(_,1/3)),y++),_++})();var d=[],p=f.SHA256=u.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(v,x){for(var _=this._hash.words,y=_[0],m=_[1],w=_[2],D=_[3],C=_[4],b=_[5],F=_[6],B=_[7],M=0;M<64;M++){if(M<16)d[M]=v[x+M]|0;else{var O=d[M-15],A=(O<<25|O>>>7)^(O<<14|O>>>18)^O>>>3,N=d[M-2],I=(N<<15|N>>>17)^(N<<13|N>>>19)^N>>>10;d[M]=A+d[M-7]+I+d[M-16]}var R=C&b^~C&F,k=y&m^y&w^m&w,z=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),L=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),G=B+L+R+h[M]+d[M],H=z+k;B=F,F=b,b=C,C=D+G|0,D=w,w=m,m=y,y=G+H|0}_[0]=_[0]+y|0,_[1]=_[1]+m|0,_[2]=_[2]+w|0,_[3]=_[3]+D|0,_[4]=_[4]+C|0,_[5]=_[5]+b|0,_[6]=_[6]+F|0,_[7]=_[7]+B|0},_doFinalize:function(){var v=this._data,x=v.words,_=this._nDataBytes*8,y=v.sigBytes*8;return x[y>>>5]|=128<<24-y%32,x[(y+64>>>9<<4)+14]=r.floor(_/4294967296),x[(y+64>>>9<<4)+15]=_,v.sigBytes=x.length*4,this._process(),this._hash},clone:function(){var v=u.clone.call(this);return v._hash=this._hash.clone(),v}});n.SHA256=u._createHelper(p),n.HmacSHA256=u._createHmacHelper(p)}(Math),t.SHA256})}(du)),du.exports}var _u={exports:{}},sh;function kD(){return sh||(sh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),pu())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.algo,u=a.SHA256,f=a.SHA224=u.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var c=u._doFinalize.call(this);return c.sigBytes-=4,c}});r.SHA224=u._createHelper(f),r.HmacSHA224=u._createHmacHelper(f)}(),t.SHA224})}(_u)),_u.exports}var vu={exports:{}},oh;function ah(){return oh||(oh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.Hasher,a=r.x64,u=a.Word,f=a.WordArray,c=r.algo;function h(){return u.create.apply(u,arguments)}var d=[h(1116352408,3609767458),h(1899447441,602891725),h(3049323471,3964484399),h(3921009573,2173295548),h(961987163,4081628472),h(1508970993,3053834265),h(2453635748,2937671579),h(2870763221,3664609560),h(3624381080,2734883394),h(310598401,1164996542),h(607225278,1323610764),h(1426881987,3590304994),h(1925078388,4068182383),h(2162078206,991336113),h(2614888103,633803317),h(3248222580,3479774868),h(3835390401,2666613458),h(4022224774,944711139),h(264347078,2341262773),h(604807628,2007800933),h(770255983,1495990901),h(1249150122,1856431235),h(1555081692,3175218132),h(1996064986,2198950837),h(2554220882,3999719339),h(2821834349,766784016),h(2952996808,2566594879),h(3210313671,3203337956),h(3336571891,1034457026),h(3584528711,2466948901),h(113926993,3758326383),h(338241895,168717936),h(666307205,1188179964),h(773529912,1546045734),h(1294757372,1522805485),h(1396182291,2643833823),h(1695183700,2343527390),h(1986661051,1014477480),h(2177026350,1206759142),h(2456956037,344077627),h(2730485921,1290863460),h(2820302411,3158454273),h(3259730800,3505952657),h(3345764771,106217008),h(3516065817,3606008344),h(3600352804,1432725776),h(4094571909,1467031594),h(275423344,851169720),h(430227734,3100823752),h(506948616,1363258195),h(659060556,3750685593),h(883997877,3785050280),h(958139571,3318307427),h(1322822218,3812723403),h(1537002063,2003034995),h(1747873779,3602036899),h(1955562222,1575990012),h(2024104815,1125592928),h(2227730452,2716904306),h(2361852424,442776044),h(2428436474,593698344),h(2756734187,3733110249),h(3204031479,2999351573),h(3329325298,3815920427),h(3391569614,3928383900),h(3515267271,566280711),h(3940187606,3454069534),h(4118630271,4000239992),h(116418474,1914138554),h(174292421,2731055270),h(289380356,3203993006),h(460393269,320620315),h(685471733,587496836),h(852142971,1086792851),h(1017036298,365543100),h(1126000580,2618297676),h(1288033470,3409855158),h(1501505948,4234509866),h(1607167915,987167468),h(1816402316,1246189591)],p=[];(function(){for(var x=0;x<80;x++)p[x]=h()})();var v=c.SHA512=i.extend({_doReset:function(){this._hash=new f.init([new u.init(1779033703,4089235720),new u.init(3144134277,2227873595),new u.init(1013904242,4271175723),new u.init(2773480762,1595750129),new u.init(1359893119,2917565137),new u.init(2600822924,725511199),new u.init(528734635,4215389547),new u.init(1541459225,327033209)])},_doProcessBlock:function(x,_){for(var y=this._hash.words,m=y[0],w=y[1],D=y[2],C=y[3],b=y[4],F=y[5],B=y[6],M=y[7],O=m.high,A=m.low,N=w.high,I=w.low,R=D.high,k=D.low,z=C.high,L=C.low,G=b.high,H=b.low,ee=F.high,te=F.low,j=B.high,X=B.low,Y=M.high,Q=M.low,pe=O,De=A,we=N,be=I,Oe=R,Fe=k,nt=z,Ye=L,Ie=G,Re=H,xt=ee,Ut=te,Et=j,lr=X,Lr=Y,cr=Q,yt=0;yt<80;yt++){var Ot,P,V=p[yt];if(yt<16)P=V.high=x[_+yt*2]|0,Ot=V.low=x[_+yt*2+1]|0;else{var J=p[yt-15],ie=J.high,ue=J.low,se=(ie>>>1|ue<<31)^(ie>>>8|ue<<24)^ie>>>7,_e=(ue>>>1|ie<<31)^(ue>>>8|ie<<24)^(ue>>>7|ie<<25),he=p[yt-2],de=he.high,fe=he.low,Xe=(de>>>19|fe<<13)^(de<<3|fe>>>29)^de>>>6,et=(fe>>>19|de<<13)^(fe<<3|de>>>29)^(fe>>>6|de<<26),ht=p[yt-7],kt=ht.high,It=ht.low,rr=p[yt-16],fr=rr.high,en=rr.low;Ot=_e+It,P=se+kt+(Ot>>>0<_e>>>0?1:0),Ot=Ot+et,P=P+Xe+(Ot>>>0<et>>>0?1:0),Ot=Ot+en,P=P+fr+(Ot>>>0<en>>>0?1:0),V.high=P,V.low=Ot}var Dn=Ie&xt^~Ie&Et,li=Re&Ut^~Re&lr,vs=pe&we^pe&Oe^we&Oe,gs=De&be^De&Fe^be&Fe,ms=(pe>>>28|De<<4)^(pe<<30|De>>>2)^(pe<<25|De>>>7),Li=(De>>>28|pe<<4)^(De<<30|pe>>>2)^(De<<25|pe>>>7),Pi=(Ie>>>14|Re<<18)^(Ie>>>18|Re<<14)^(Ie<<23|Re>>>9),xs=(Re>>>14|Ie<<18)^(Re>>>18|Ie<<14)^(Re<<23|Ie>>>9),ki=d[yt],ys=ki.high,zn=ki.low,Xt=cr+xs,mr=Lr+Pi+(Xt>>>0<cr>>>0?1:0),Xt=Xt+li,mr=mr+Dn+(Xt>>>0<li>>>0?1:0),Xt=Xt+zn,mr=mr+ys+(Xt>>>0<zn>>>0?1:0),Xt=Xt+Ot,mr=mr+P+(Xt>>>0<Ot>>>0?1:0),zi=Li+gs,Ds=ms+vs+(zi>>>0<Li>>>0?1:0);Lr=Et,cr=lr,Et=xt,lr=Ut,xt=Ie,Ut=Re,Re=Ye+Xt|0,Ie=nt+mr+(Re>>>0<Ye>>>0?1:0)|0,nt=Oe,Ye=Fe,Oe=we,Fe=be,we=pe,be=De,De=Xt+zi|0,pe=mr+Ds+(De>>>0<Xt>>>0?1:0)|0}A=m.low=A+De,m.high=O+pe+(A>>>0<De>>>0?1:0),I=w.low=I+be,w.high=N+we+(I>>>0<be>>>0?1:0),k=D.low=k+Fe,D.high=R+Oe+(k>>>0<Fe>>>0?1:0),L=C.low=L+Ye,C.high=z+nt+(L>>>0<Ye>>>0?1:0),H=b.low=H+Re,b.high=G+Ie+(H>>>0<Re>>>0?1:0),te=F.low=te+Ut,F.high=ee+xt+(te>>>0<Ut>>>0?1:0),X=B.low=X+lr,B.high=j+Et+(X>>>0<lr>>>0?1:0),Q=M.low=Q+cr,M.high=Y+Lr+(Q>>>0<cr>>>0?1:0)},_doFinalize:function(){var x=this._data,_=x.words,y=this._nDataBytes*8,m=x.sigBytes*8;_[m>>>5]|=128<<24-m%32,_[(m+128>>>10<<5)+30]=Math.floor(y/4294967296),_[(m+128>>>10<<5)+31]=y,x.sigBytes=_.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var x=i.clone.call(this);return x._hash=this._hash.clone(),x},blockSize:1024/32});r.SHA512=i._createHelper(v),r.HmacSHA512=i._createHmacHelper(v)}(),t.SHA512})}(vu)),vu.exports}var gu={exports:{}},uh;function zD(){return uh||(uh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo(),ah())})(ye,function(t){return function(){var r=t,n=r.x64,i=n.Word,a=n.WordArray,u=r.algo,f=u.SHA512,c=u.SHA384=f.extend({_doReset:function(){this._hash=new a.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var h=f._doFinalize.call(this);return h.sigBytes-=16,h}});r.SHA384=f._createHelper(c),r.HmacSHA384=f._createHmacHelper(c)}(),t.SHA384})}(gu)),gu.exports}var mu={exports:{}},lh;function qD(){return lh||(lh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,f=n.x64,c=f.Word,h=n.algo,d=[],p=[],v=[];(function(){for(var y=1,m=0,w=0;w<24;w++){d[y+5*m]=(w+1)*(w+2)/2%64;var D=m%5,C=(2*y+3*m)%5;y=D,m=C}for(var y=0;y<5;y++)for(var m=0;m<5;m++)p[y+5*m]=m+(2*y+3*m)%5*5;for(var b=1,F=0;F<24;F++){for(var B=0,M=0,O=0;O<7;O++){if(b&1){var A=(1<<O)-1;A<32?M^=1<<A:B^=1<<A-32}b&128?b=b<<1^113:b<<=1}v[F]=c.create(B,M)}})();var x=[];(function(){for(var y=0;y<25;y++)x[y]=c.create()})();var _=h.SHA3=u.extend({cfg:u.cfg.extend({outputLength:512}),_doReset:function(){for(var y=this._state=[],m=0;m<25;m++)y[m]=new c.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(y,m){for(var w=this._state,D=this.blockSize/2,C=0;C<D;C++){var b=y[m+2*C],F=y[m+2*C+1];b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,F=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360;var B=w[C];B.high^=F,B.low^=b}for(var M=0;M<24;M++){for(var O=0;O<5;O++){for(var A=0,N=0,I=0;I<5;I++){var B=w[O+5*I];A^=B.high,N^=B.low}var R=x[O];R.high=A,R.low=N}for(var O=0;O<5;O++)for(var k=x[(O+4)%5],z=x[(O+1)%5],L=z.high,G=z.low,A=k.high^(L<<1|G>>>31),N=k.low^(G<<1|L>>>31),I=0;I<5;I++){var B=w[O+5*I];B.high^=A,B.low^=N}for(var H=1;H<25;H++){var A,N,B=w[H],ee=B.high,te=B.low,j=d[H];j<32?(A=ee<<j|te>>>32-j,N=te<<j|ee>>>32-j):(A=te<<j-32|ee>>>64-j,N=ee<<j-32|te>>>64-j);var X=x[p[H]];X.high=A,X.low=N}var Y=x[0],Q=w[0];Y.high=Q.high,Y.low=Q.low;for(var O=0;O<5;O++)for(var I=0;I<5;I++){var H=O+5*I,B=w[H],pe=x[H],De=x[(O+1)%5+5*I],we=x[(O+2)%5+5*I];B.high=pe.high^~De.high&we.high,B.low=pe.low^~De.low&we.low}var B=w[0],be=v[M];B.high^=be.high,B.low^=be.low}},_doFinalize:function(){var y=this._data,m=y.words;this._nDataBytes*8;var w=y.sigBytes*8,D=this.blockSize*32;m[w>>>5]|=1<<24-w%32,m[(r.ceil((w+1)/D)*D>>>5)-1]|=128,y.sigBytes=m.length*4,this._process();for(var C=this._state,b=this.cfg.outputLength/8,F=b/8,B=[],M=0;M<F;M++){var O=C[M],A=O.high,N=O.low;A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,B.push(N),B.push(A)}return new a.init(B,b)},clone:function(){for(var y=u.clone.call(this),m=y._state=this._state.slice(0),w=0;w<25;w++)m[w]=m[w].clone();return y}});n.SHA3=u._createHelper(_),n.HmacSHA3=u._createHmacHelper(_)}(Math),t.SHA3})}(mu)),mu.exports}var xu={exports:{}},ch;function UD(){return ch||(ch=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){/** @preserve
60
+ }`}function sy(s,e,t,r,n){const{rows:i,columns:a}=s,u=Math.min(i,e),c=Math.min(a,t),f=[];if(n==="auto"){n=!1;e:for(let h=0;h<u;h++)for(let d=0;d<c;d++)if(s.get(h,d)<0){n=!0;break e}}for(let h=0;h<u;h++){let d=[];for(let p=0;p<c;p++)d.push(oy(s.get(h,p),r,n));f.push(`${d.join(" ")}`)}return c!==a&&(f[f.length-1]+=` ... ${a-t} more columns`),u!==i&&f.push(`... ${i-e} more rows`),f.join(`
61
+ ${Fc}`)}function oy(s,e,t){return(s>=0&&t?` ${Mc(s,e-1)}`:Mc(s,e)).padEnd(e)}function Mc(s,e){let t=s.toString();if(t.length<=e)return t;let r=s.toFixed(e);if(r.length>e&&(r=s.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;let n=s.toExponential(e);return n.length>e&&(n=s.toExponential(Math.max(0,e-(n.length-e)))),n.slice(0)}function ay(s,e){s.prototype.add=function(r){return typeof r=="number"?this.addS(r):this.addM(r)},s.prototype.addS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)+r);return this},s.prototype.addM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)+r.get(n,i));return this},s.add=function(r,n){return new e(r).add(n)},s.prototype.sub=function(r){return typeof r=="number"?this.subS(r):this.subM(r)},s.prototype.subS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)-r);return this},s.prototype.subM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)-r.get(n,i));return this},s.sub=function(r,n){return new e(r).sub(n)},s.prototype.subtract=s.prototype.sub,s.prototype.subtractS=s.prototype.subS,s.prototype.subtractM=s.prototype.subM,s.subtract=s.sub,s.prototype.mul=function(r){return typeof r=="number"?this.mulS(r):this.mulM(r)},s.prototype.mulS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)*r);return this},s.prototype.mulM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)*r.get(n,i));return this},s.mul=function(r,n){return new e(r).mul(n)},s.prototype.multiply=s.prototype.mul,s.prototype.multiplyS=s.prototype.mulS,s.prototype.multiplyM=s.prototype.mulM,s.multiply=s.mul,s.prototype.div=function(r){return typeof r=="number"?this.divS(r):this.divM(r)},s.prototype.divS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)/r);return this},s.prototype.divM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)/r.get(n,i));return this},s.div=function(r,n){return new e(r).div(n)},s.prototype.divide=s.prototype.div,s.prototype.divideS=s.prototype.divS,s.prototype.divideM=s.prototype.divM,s.divide=s.div,s.prototype.mod=function(r){return typeof r=="number"?this.modS(r):this.modM(r)},s.prototype.modS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)%r);return this},s.prototype.modM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)%r.get(n,i));return this},s.mod=function(r,n){return new e(r).mod(n)},s.prototype.modulus=s.prototype.mod,s.prototype.modulusS=s.prototype.modS,s.prototype.modulusM=s.prototype.modM,s.modulus=s.mod,s.prototype.and=function(r){return typeof r=="number"?this.andS(r):this.andM(r)},s.prototype.andS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)&r);return this},s.prototype.andM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)&r.get(n,i));return this},s.and=function(r,n){return new e(r).and(n)},s.prototype.or=function(r){return typeof r=="number"?this.orS(r):this.orM(r)},s.prototype.orS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)|r);return this},s.prototype.orM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)|r.get(n,i));return this},s.or=function(r,n){return new e(r).or(n)},s.prototype.xor=function(r){return typeof r=="number"?this.xorS(r):this.xorM(r)},s.prototype.xorS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)^r);return this},s.prototype.xorM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)^r.get(n,i));return this},s.xor=function(r,n){return new e(r).xor(n)},s.prototype.leftShift=function(r){return typeof r=="number"?this.leftShiftS(r):this.leftShiftM(r)},s.prototype.leftShiftS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)<<r);return this},s.prototype.leftShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)<<r.get(n,i));return this},s.leftShift=function(r,n){return new e(r).leftShift(n)},s.prototype.signPropagatingRightShift=function(r){return typeof r=="number"?this.signPropagatingRightShiftS(r):this.signPropagatingRightShiftM(r)},s.prototype.signPropagatingRightShiftS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>r);return this},s.prototype.signPropagatingRightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>r.get(n,i));return this},s.signPropagatingRightShift=function(r,n){return new e(r).signPropagatingRightShift(n)},s.prototype.rightShift=function(r){return typeof r=="number"?this.rightShiftS(r):this.rightShiftM(r)},s.prototype.rightShiftS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>>r);return this},s.prototype.rightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,this.get(n,i)>>>r.get(n,i));return this},s.rightShift=function(r,n){return new e(r).rightShift(n)},s.prototype.zeroFillRightShift=s.prototype.rightShift,s.prototype.zeroFillRightShiftS=s.prototype.rightShiftS,s.prototype.zeroFillRightShiftM=s.prototype.rightShiftM,s.zeroFillRightShift=s.rightShift,s.prototype.not=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,~this.get(r,n));return this},s.not=function(r){return new e(r).not()},s.prototype.abs=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.abs(this.get(r,n)));return this},s.abs=function(r){return new e(r).abs()},s.prototype.acos=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.acos(this.get(r,n)));return this},s.acos=function(r){return new e(r).acos()},s.prototype.acosh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.acosh(this.get(r,n)));return this},s.acosh=function(r){return new e(r).acosh()},s.prototype.asin=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.asin(this.get(r,n)));return this},s.asin=function(r){return new e(r).asin()},s.prototype.asinh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.asinh(this.get(r,n)));return this},s.asinh=function(r){return new e(r).asinh()},s.prototype.atan=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.atan(this.get(r,n)));return this},s.atan=function(r){return new e(r).atan()},s.prototype.atanh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.atanh(this.get(r,n)));return this},s.atanh=function(r){return new e(r).atanh()},s.prototype.cbrt=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.cbrt(this.get(r,n)));return this},s.cbrt=function(r){return new e(r).cbrt()},s.prototype.ceil=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.ceil(this.get(r,n)));return this},s.ceil=function(r){return new e(r).ceil()},s.prototype.clz32=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.clz32(this.get(r,n)));return this},s.clz32=function(r){return new e(r).clz32()},s.prototype.cos=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.cos(this.get(r,n)));return this},s.cos=function(r){return new e(r).cos()},s.prototype.cosh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.cosh(this.get(r,n)));return this},s.cosh=function(r){return new e(r).cosh()},s.prototype.exp=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.exp(this.get(r,n)));return this},s.exp=function(r){return new e(r).exp()},s.prototype.expm1=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.expm1(this.get(r,n)));return this},s.expm1=function(r){return new e(r).expm1()},s.prototype.floor=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.floor(this.get(r,n)));return this},s.floor=function(r){return new e(r).floor()},s.prototype.fround=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.fround(this.get(r,n)));return this},s.fround=function(r){return new e(r).fround()},s.prototype.log=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log(this.get(r,n)));return this},s.log=function(r){return new e(r).log()},s.prototype.log1p=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log1p(this.get(r,n)));return this},s.log1p=function(r){return new e(r).log1p()},s.prototype.log10=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log10(this.get(r,n)));return this},s.log10=function(r){return new e(r).log10()},s.prototype.log2=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.log2(this.get(r,n)));return this},s.log2=function(r){return new e(r).log2()},s.prototype.round=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.round(this.get(r,n)));return this},s.round=function(r){return new e(r).round()},s.prototype.sign=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sign(this.get(r,n)));return this},s.sign=function(r){return new e(r).sign()},s.prototype.sin=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sin(this.get(r,n)));return this},s.sin=function(r){return new e(r).sin()},s.prototype.sinh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sinh(this.get(r,n)));return this},s.sinh=function(r){return new e(r).sinh()},s.prototype.sqrt=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.sqrt(this.get(r,n)));return this},s.sqrt=function(r){return new e(r).sqrt()},s.prototype.tan=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.tan(this.get(r,n)));return this},s.tan=function(r){return new e(r).tan()},s.prototype.tanh=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.tanh(this.get(r,n)));return this},s.tanh=function(r){return new e(r).tanh()},s.prototype.trunc=function(){for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.set(r,n,Math.trunc(this.get(r,n)));return this},s.trunc=function(r){return new e(r).trunc()},s.pow=function(r,n){return new e(r).pow(n)},s.prototype.pow=function(r){return typeof r=="number"?this.powS(r):this.powM(r)},s.prototype.powS=function(r){for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.pow(this.get(n,i),r));return this},s.prototype.powM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let n=0;n<this.rows;n++)for(let i=0;i<this.columns;i++)this.set(n,i,Math.pow(this.get(n,i),r.get(n,i)));return this}}function $r(s,e,t){let r=t?s.rows:s.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Lr(s,e,t){let r=t?s.columns:s.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Mi(s,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==s.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Ni(s,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==s.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Qa(s,e){if(!gr.isAnyArray(e))throw new TypeError("row indices must be an array");for(let t=0;t<e.length;t++)if(e[t]<0||e[t]>=s.rows)throw new RangeError("row indices are out of range")}function Ja(s,e){if(!gr.isAnyArray(e))throw new TypeError("column indices must be an array");for(let t=0;t<e.length;t++)if(e[t]<0||e[t]>=s.columns)throw new RangeError("column indices are out of range")}function eu(s,e,t,r,n){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(Do("startRow",e),Do("endRow",t),Do("startColumn",r),Do("endColumn",n),e>t||r>n||e<0||e>=s.rows||t<0||t>=s.rows||r<0||r>=s.columns||n<0||n>=s.columns)throw new RangeError("Submatrix indices are out of range")}function yo(s,e=0){let t=[];for(let r=0;r<s;r++)t.push(e);return t}function Do(s,e){if(typeof e!="number")throw new TypeError(`${s} must be a number`)}function Si(s){if(s.isEmpty())throw new Error("Empty matrix has no elements to index")}function uy(s){let e=yo(s.rows);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[t]+=s.get(t,r);return e}function ly(s){let e=yo(s.columns);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[r]+=s.get(t,r);return e}function fy(s){let e=0;for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)e+=s.get(t,r);return e}function cy(s){let e=yo(s.rows,1);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[t]*=s.get(t,r);return e}function hy(s){let e=yo(s.columns,1);for(let t=0;t<s.rows;++t)for(let r=0;r<s.columns;++r)e[r]*=s.get(t,r);return e}function dy(s){let e=1;for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)e*=s.get(t,r);return e}function py(s,e,t){const r=s.rows,n=s.columns,i=[];for(let a=0;a<r;a++){let u=0,c=0,f=0;for(let h=0;h<n;h++)f=s.get(a,h)-t[a],u+=f,c+=f*f;e?i.push((c-u*u/n)/(n-1)):i.push((c-u*u/n)/n)}return i}function _y(s,e,t){const r=s.rows,n=s.columns,i=[];for(let a=0;a<n;a++){let u=0,c=0,f=0;for(let h=0;h<r;h++)f=s.get(h,a)-t[a],u+=f,c+=f*f;e?i.push((c-u*u/r)/(r-1)):i.push((c-u*u/r)/r)}return i}function vy(s,e,t){const r=s.rows,n=s.columns,i=r*n;let a=0,u=0,c=0;for(let f=0;f<r;f++)for(let h=0;h<n;h++)c=s.get(f,h)-t,a+=c,u+=c*c;return e?(u-a*a/i)/(i-1):(u-a*a/i)/i}function gy(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)-e[t])}function my(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)-e[r])}function xy(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)-e)}function yy(s){const e=[];for(let t=0;t<s.rows;t++){let r=0;for(let n=0;n<s.columns;n++)r+=Math.pow(s.get(t,n),2)/(s.columns-1);e.push(Math.sqrt(r))}return e}function Dy(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)/e[t])}function wy(s){const e=[];for(let t=0;t<s.columns;t++){let r=0;for(let n=0;n<s.rows;n++)r+=Math.pow(s.get(n,t),2)/(s.rows-1);e.push(Math.sqrt(r))}return e}function by(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)/e[r])}function Ey(s){const e=s.size-1;let t=0;for(let r=0;r<s.columns;r++)for(let n=0;n<s.rows;n++)t+=Math.pow(s.get(n,r),2)/e;return Math.sqrt(t)}function Ay(s,e){for(let t=0;t<s.rows;t++)for(let r=0;r<s.columns;r++)s.set(t,r,s.get(t,r)/e)}class ke{static from1DArray(e,t,r){if(e*t!==r.length)throw new RangeError("data length does not match given dimensions");let i=new ve(e,t);for(let a=0;a<e;a++)for(let u=0;u<t;u++)i.set(a,u,r[a*t+u]);return i}static rowVector(e){let t=new ve(1,e.length);for(let r=0;r<e.length;r++)t.set(0,r,e[r]);return t}static columnVector(e){let t=new ve(e.length,1);for(let r=0;r<e.length;r++)t.set(r,0,e[r]);return t}static zeros(e,t){return new ve(e,t)}static ones(e,t){return new ve(e,t).fill(1)}static rand(e,t,r={}){if(typeof r!="object")throw new TypeError("options must be an object");const{random:n=Math.random}=r;let i=new ve(e,t);for(let a=0;a<e;a++)for(let u=0;u<t;u++)i.set(a,u,n());return i}static randInt(e,t,r={}){if(typeof r!="object")throw new TypeError("options must be an object");const{min:n=0,max:i=1e3,random:a=Math.random}=r;if(!Number.isInteger(n))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(n>=i)throw new RangeError("min must be smaller than max");let u=i-n,c=new ve(e,t);for(let f=0;f<e;f++)for(let h=0;h<t;h++){let d=n+Math.round(a()*u);c.set(f,h,d)}return c}static eye(e,t,r){t===void 0&&(t=e),r===void 0&&(r=1);let n=Math.min(e,t),i=this.zeros(e,t);for(let a=0;a<n;a++)i.set(a,a,r);return i}static diag(e,t,r){let n=e.length;t===void 0&&(t=n),r===void 0&&(r=t);let i=Math.min(n,t,r),a=this.zeros(t,r);for(let u=0;u<i;u++)a.set(u,u,e[u]);return a}static min(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let r=e.rows,n=e.columns,i=new ve(r,n);for(let a=0;a<r;a++)for(let u=0;u<n;u++)i.set(a,u,Math.min(e.get(a,u),t.get(a,u)));return i}static max(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let r=e.rows,n=e.columns,i=new this(r,n);for(let a=0;a<r;a++)for(let u=0;u<n;u++)i.set(a,u,Math.max(e.get(a,u),t.get(a,u)));return i}static checkMatrix(e){return ke.isMatrix(e)?e:new ve(e)}static isMatrix(e){return e!=null&&e.klass==="Matrix"}get size(){return this.rows*this.columns}apply(e){if(typeof e!="function")throw new TypeError("callback must be a function");for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.call(this,t,r);return this}to1DArray(){let e=[];for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.push(this.get(t,r));return e}to2DArray(){let e=[];for(let t=0;t<this.rows;t++){e.push([]);for(let r=0;r<this.columns;r++)e[t].push(this.get(t,r))}return e}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let e=0;e<this.rows;e++)for(let t=0;t<=e;t++)if(this.get(e,t)!==this.get(t,e))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let e=0;e<this.rows;e++)if(this.get(e,e)!==0)return!1;return!0}isEchelonForm(){let e=0,t=0,r=-1,n=!0,i=!1;for(;e<this.rows&&n;){for(t=0,i=!1;t<this.columns&&i===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>r?(i=!0,r=t):(n=!1,i=!0);e++}return n}isReducedEchelonForm(){let e=0,t=0,r=-1,n=!0,i=!1;for(;e<this.rows&&n;){for(t=0,i=!1;t<this.columns&&i===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>r?(i=!0,r=t):(n=!1,i=!0);for(let a=t+1;a<this.rows;a++)this.get(e,a)!==0&&(n=!1);e++}return n}echelonForm(){let e=this.clone(),t=0,r=0;for(;t<e.rows&&r<e.columns;){let n=t;for(let i=t;i<e.rows;i++)e.get(i,r)>e.get(n,r)&&(n=i);if(e.get(n,r)===0)r++;else{e.swapRows(t,n);let i=e.get(t,r);for(let a=r;a<e.columns;a++)e.set(t,a,e.get(t,a)/i);for(let a=t+1;a<e.rows;a++){let u=e.get(a,r)/e.get(t,r);e.set(a,r,0);for(let c=r+1;c<e.columns;c++)e.set(a,c,e.get(a,c)-e.get(t,c)*u)}t++,r++}}return e}reducedEchelonForm(){let e=this.echelonForm(),t=e.columns,r=e.rows,n=r-1;for(;n>=0;)if(e.maxRow(n)===0)n--;else{let i=0,a=!1;for(;i<r&&a===!1;)e.get(n,i)===1?a=!0:i++;for(let u=0;u<n;u++){let c=e.get(u,i);for(let f=i;f<t;f++){let h=e.get(u,f)-c*e.get(n,f);e.set(u,f,h)}}n--}return e}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{rows:t=1,columns:r=1}=e;if(!Number.isInteger(t)||t<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(r)||r<=0)throw new TypeError("columns must be a positive integer");let n=new ve(this.rows*t,this.columns*r);for(let i=0;i<t;i++)for(let a=0;a<r;a++)n.setSubMatrix(this,this.rows*i,this.columns*a);return n}fill(e){for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,e);return this}neg(){return this.mulS(-1)}getRow(e){$r(this,e);let t=[];for(let r=0;r<this.columns;r++)t.push(this.get(e,r));return t}getRowVector(e){return ve.rowVector(this.getRow(e))}setRow(e,t){$r(this,e),t=Mi(this,t);for(let r=0;r<this.columns;r++)this.set(e,r,t[r]);return this}swapRows(e,t){$r(this,e),$r(this,t);for(let r=0;r<this.columns;r++){let n=this.get(e,r);this.set(e,r,this.get(t,r)),this.set(t,r,n)}return this}getColumn(e){Lr(this,e);let t=[];for(let r=0;r<this.rows;r++)t.push(this.get(r,e));return t}getColumnVector(e){return ve.columnVector(this.getColumn(e))}setColumn(e,t){Lr(this,e),t=Ni(this,t);for(let r=0;r<this.rows;r++)this.set(r,e,t[r]);return this}swapColumns(e,t){Lr(this,e),Lr(this,t);for(let r=0;r<this.rows;r++){let n=this.get(r,e);this.set(r,e,this.get(r,t)),this.set(r,t,n)}return this}addRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)+e[r]);return this}subRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)-e[r]);return this}mulRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e[r]);return this}divRowVector(e){e=Mi(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)/e[r]);return this}addColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)+e[t]);return this}subColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)-e[t]);return this}mulColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e[t]);return this}divColumnVector(e){e=Ni(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)/e[t]);return this}mulRow(e,t){$r(this,e);for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t);return this}mulColumn(e,t){Lr(this,e);for(let r=0;r<this.rows;r++)this.set(r,e,this.get(r,e)*t);return this}max(e){if(this.isEmpty())return NaN;switch(e){case"row":{const t=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t[r]&&(t[r]=this.get(r,n));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t[n]&&(t[n]=this.get(r,n));return t}case void 0:{let t=this.get(0,0);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>t&&(t=this.get(r,n));return t}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){Si(this);let e=this.get(0,0),t=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)>e&&(e=this.get(r,n),t[0]=r,t[1]=n);return t}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t[r]&&(t[r]=this.get(r,n));return t}case"column":{const t=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t[n]&&(t[n]=this.get(r,n));return t}case void 0:{let t=this.get(0,0);for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<t&&(t=this.get(r,n));return t}default:throw new Error(`invalid option: ${e}`)}}minIndex(){Si(this);let e=this.get(0,0),t=[0,0];for(let r=0;r<this.rows;r++)for(let n=0;n<this.columns;n++)this.get(r,n)<e&&(e=this.get(r,n),t[0]=r,t[1]=n);return t}maxRow(e){if($r(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let r=1;r<this.columns;r++)this.get(e,r)>t&&(t=this.get(e,r));return t}maxRowIndex(e){$r(this,e),Si(this);let t=this.get(e,0),r=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n),r[1]=n);return r}minRow(e){if($r(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let r=1;r<this.columns;r++)this.get(e,r)<t&&(t=this.get(e,r));return t}minRowIndex(e){$r(this,e),Si(this);let t=this.get(e,0),r=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n),r[1]=n);return r}maxColumn(e){if(Lr(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let r=1;r<this.rows;r++)this.get(r,e)>t&&(t=this.get(r,e));return t}maxColumnIndex(e){Lr(this,e),Si(this);let t=this.get(0,e),r=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)>t&&(t=this.get(n,e),r[0]=n);return r}minColumn(e){if(Lr(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let r=1;r<this.rows;r++)this.get(r,e)<t&&(t=this.get(r,e));return t}minColumnIndex(e){Lr(this,e),Si(this);let t=this.get(0,e),r=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)<t&&(t=this.get(n,e),r[0]=n);return r}diag(){let e=Math.min(this.rows,this.columns),t=[];for(let r=0;r<e;r++)t.push(this.get(r,r));return t}norm(e="frobenius"){switch(e){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${e}`)}}cumulativeSum(){let e=0;for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e+=this.get(t,r),this.set(t,r,e);return this}dot(e){ke.isMatrix(e)&&(e=e.to1DArray());let t=this.to1DArray();if(t.length!==e.length)throw new RangeError("vectors do not have the same size");let r=0;for(let n=0;n<t.length;n++)r+=t[n]*e[n];return r}mmul(e){e=ve.checkMatrix(e);let t=this.rows,r=this.columns,n=e.columns,i=new ve(t,n),a=new Float64Array(r);for(let u=0;u<n;u++){for(let c=0;c<r;c++)a[c]=e.get(c,u);for(let c=0;c<t;c++){let f=0;for(let h=0;h<r;h++)f+=this.get(c,h)*a[h];i.set(c,u,f)}}return i}strassen2x2(e){e=ve.checkMatrix(e);let t=new ve(2,2);const r=this.get(0,0),n=e.get(0,0),i=this.get(0,1),a=e.get(0,1),u=this.get(1,0),c=e.get(1,0),f=this.get(1,1),h=e.get(1,1),d=(r+f)*(n+h),p=(u+f)*n,v=r*(a-h),x=f*(c-n),_=(r+i)*h,y=(u-r)*(n+a),m=(i-f)*(c+h),w=d+x-_+m,D=v+_,C=p+x,b=d-p+v+y;return t.set(0,0,w),t.set(0,1,D),t.set(1,0,C),t.set(1,1,b),t}strassen3x3(e){e=ve.checkMatrix(e);let t=new ve(3,3);const r=this.get(0,0),n=this.get(0,1),i=this.get(0,2),a=this.get(1,0),u=this.get(1,1),c=this.get(1,2),f=this.get(2,0),h=this.get(2,1),d=this.get(2,2),p=e.get(0,0),v=e.get(0,1),x=e.get(0,2),_=e.get(1,0),y=e.get(1,1),m=e.get(1,2),w=e.get(2,0),D=e.get(2,1),C=e.get(2,2),b=(r+n+i-a-u-h-d)*y,F=(r-a)*(-v+y),B=u*(-p+v+_-y-m-w+C),M=(-r+a+u)*(p-v+y),O=(a+u)*(-p+v),A=r*p,N=(-r+f+h)*(p-x+m),I=(-r+f)*(x-m),L=(f+h)*(-p+x),k=(r+n+i-u-c-f-h)*m,z=h*(-p+x+_-y-m-w+D),R=(-i+h+d)*(y+w-D),G=(i-d)*(y-D),H=i*w,ee=(h+d)*(-w+D),te=(-i+u+c)*(m+w-C),j=(i-c)*(m-C),X=(u+c)*(-w+C),Y=n*_,Q=c*D,pe=a*x,De=f*v,we=d*C,be=A+H+Y,Oe=b+M+O+A+R+H+ee,Fe=A+N+L+k+H+te+X,nt=F+B+M+A+H+te+j,Ye=F+M+O+A+Q,Ie=H+te+j+X+pe,Le=A+N+I+z+R+G+H,xt=R+G+H+ee+De,Ut=A+N+I+L+we;return t.set(0,0,be),t.set(0,1,Oe),t.set(0,2,Fe),t.set(1,0,nt),t.set(1,1,Ye),t.set(1,2,Ie),t.set(2,0,Le),t.set(2,1,xt),t.set(2,2,Ut),t}mmulStrassen(e){e=ve.checkMatrix(e);let t=this.clone(),r=t.rows,n=t.columns,i=e.rows,a=e.columns;n!==i&&console.warn(`Multiplying ${r} x ${n} and ${i} x ${a} matrix: dimensions do not match.`);function u(d,p,v){let x=d.rows,_=d.columns;if(x===p&&_===v)return d;{let y=ke.zeros(p,v);return y=y.setSubMatrix(d,0,0),y}}let c=Math.max(r,i),f=Math.max(n,a);t=u(t,c,f),e=u(e,c,f);function h(d,p,v,x){if(v<=512||x<=512)return d.mmul(p);v%2===1&&x%2===1?(d=u(d,v+1,x+1),p=u(p,v+1,x+1)):v%2===1?(d=u(d,v+1,x),p=u(p,v+1,x)):x%2===1&&(d=u(d,v,x+1),p=u(p,v,x+1));let _=parseInt(d.rows/2,10),y=parseInt(d.columns/2,10),m=d.subMatrix(0,_-1,0,y-1),w=p.subMatrix(0,_-1,0,y-1),D=d.subMatrix(0,_-1,y,d.columns-1),C=p.subMatrix(0,_-1,y,p.columns-1),b=d.subMatrix(_,d.rows-1,0,y-1),F=p.subMatrix(_,p.rows-1,0,y-1),B=d.subMatrix(_,d.rows-1,y,d.columns-1),M=p.subMatrix(_,p.rows-1,y,p.columns-1),O=h(ke.add(m,B),ke.add(w,M),_,y),A=h(ke.add(b,B),w,_,y),N=h(m,ke.sub(C,M),_,y),I=h(B,ke.sub(F,w),_,y),L=h(ke.add(m,D),M,_,y),k=h(ke.sub(b,m),ke.add(w,C),_,y),z=h(ke.sub(D,B),ke.add(F,M),_,y),R=ke.add(O,I);R.sub(L),R.add(z);let G=ke.add(N,L),H=ke.add(A,I),ee=ke.sub(O,A);ee.add(N),ee.add(k);let te=ke.zeros(2*R.rows,2*R.columns);return te=te.setSubMatrix(R,0,0),te=te.setSubMatrix(G,R.rows,0),te=te.setSubMatrix(H,0,R.columns),te=te.setSubMatrix(ee,R.rows,R.columns),te.subMatrix(0,v-1,0,x-1)}return h(t,e,c,f)}scaleRows(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:r=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(t>=r)throw new RangeError("min must be smaller than max");let n=new ve(this.rows,this.columns);for(let i=0;i<this.rows;i++){const a=this.getRow(i);a.length>0&&Cc(a,{min:t,max:r,output:a}),n.setRow(i,a)}return n}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:r=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(t>=r)throw new RangeError("min must be smaller than max");let n=new ve(this.rows,this.columns);for(let i=0;i<this.columns;i++){const a=this.getColumn(i);a.length&&Cc(a,{min:t,max:r,output:a}),n.setColumn(i,a)}return n}flipRows(){const e=Math.ceil(this.columns/2);for(let t=0;t<this.rows;t++)for(let r=0;r<e;r++){let n=this.get(t,r),i=this.get(t,this.columns-1-r);this.set(t,r,i),this.set(t,this.columns-1-r,n)}return this}flipColumns(){const e=Math.ceil(this.rows/2);for(let t=0;t<this.columns;t++)for(let r=0;r<e;r++){let n=this.get(r,t),i=this.get(this.rows-1-r,t);this.set(r,t,i),this.set(this.rows-1-r,t,n)}return this}kroneckerProduct(e){e=ve.checkMatrix(e);let t=this.rows,r=this.columns,n=e.rows,i=e.columns,a=new ve(t*n,r*i);for(let u=0;u<t;u++)for(let c=0;c<r;c++)for(let f=0;f<n;f++)for(let h=0;h<i;h++)a.set(n*u+f,i*c+h,this.get(u,c)*e.get(f,h));return a}kroneckerSum(e){if(e=ve.checkMatrix(e),!this.isSquare()||!e.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let t=this.rows,r=e.rows,n=this.kroneckerProduct(ve.eye(r,r)),i=ve.eye(t,t).kroneckerProduct(e);return n.add(i)}transpose(){let e=new ve(this.columns,this.rows);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.set(r,t,this.get(t,r));return e}sortRows(e=Nc){for(let t=0;t<this.rows;t++)this.setRow(t,this.getRow(t).sort(e));return this}sortColumns(e=Nc){for(let t=0;t<this.columns;t++)this.setColumn(t,this.getColumn(t).sort(e));return this}subMatrix(e,t,r,n){eu(this,e,t,r,n);let i=new ve(t-e+1,n-r+1);for(let a=e;a<=t;a++)for(let u=r;u<=n;u++)i.set(a-e,u-r,this.get(a,u));return i}subMatrixRow(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.columns-1),t>r||t<0||t>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let n=new ve(e.length,r-t+1);for(let i=0;i<e.length;i++)for(let a=t;a<=r;a++){if(e[i]<0||e[i]>=this.rows)throw new RangeError(`Row index out of range: ${e[i]}`);n.set(i,a-t,this.get(e[i],a))}return n}subMatrixColumn(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.rows-1),t>r||t<0||t>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let n=new ve(r-t+1,e.length);for(let i=0;i<e.length;i++)for(let a=t;a<=r;a++){if(e[i]<0||e[i]>=this.columns)throw new RangeError(`Column index out of range: ${e[i]}`);n.set(a-t,i,this.get(a,e[i]))}return n}setSubMatrix(e,t,r){if(e=ve.checkMatrix(e),e.isEmpty())return this;let n=t+e.rows-1,i=r+e.columns-1;eu(this,t,n,r,i);for(let a=0;a<e.rows;a++)for(let u=0;u<e.columns;u++)this.set(t+a,r+u,e.get(a,u));return this}selection(e,t){Qa(this,e),Ja(this,t);let r=new ve(e.length,t.length);for(let n=0;n<e.length;n++){let i=e[n];for(let a=0;a<t.length;a++){let u=t[a];r.set(n,a,this.get(i,u))}}return r}trace(){let e=Math.min(this.rows,this.columns),t=0;for(let r=0;r<e;r++)t+=this.get(r,r);return t}clone(){return this.constructor.copy(this,new ve(this.rows,this.columns))}static copy(e,t){for(const[r,n,i]of e.entries())t.set(r,n,i);return t}sum(e){switch(e){case"row":return uy(this);case"column":return ly(this);case void 0:return fy(this);default:throw new Error(`invalid option: ${e}`)}}product(e){switch(e){case"row":return cy(this);case"column":return hy(this);case void 0:return dy(this);default:throw new Error(`invalid option: ${e}`)}}mean(e){const t=this.sum(e);switch(e){case"row":{for(let r=0;r<this.rows;r++)t[r]/=this.columns;return t}case"column":{for(let r=0;r<this.columns;r++)t[r]/=this.rows;return t}case void 0:return t/this.size;default:throw new Error(`invalid option: ${e}`)}}variance(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");const{unbiased:r=!0,mean:n=this.mean(e)}=t;if(typeof r!="boolean")throw new TypeError("unbiased must be a boolean");switch(e){case"row":{if(!gr.isAnyArray(n))throw new TypeError("mean must be an array");return py(this,r,n)}case"column":{if(!gr.isAnyArray(n))throw new TypeError("mean must be an array");return _y(this,r,n)}case void 0:{if(typeof n!="number")throw new TypeError("mean must be a number");return vy(this,r,n)}default:throw new Error(`invalid option: ${e}`)}}standardDeviation(e,t){typeof e=="object"&&(t=e,e=void 0);const r=this.variance(e,t);if(e===void 0)return Math.sqrt(r);for(let n=0;n<r.length;n++)r[n]=Math.sqrt(r[n]);return r}center(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");const{center:r=this.mean(e)}=t;switch(e){case"row":{if(!gr.isAnyArray(r))throw new TypeError("center must be an array");return gy(this,r),this}case"column":{if(!gr.isAnyArray(r))throw new TypeError("center must be an array");return my(this,r),this}case void 0:{if(typeof r!="number")throw new TypeError("center must be a number");return xy(this,r),this}default:throw new Error(`invalid option: ${e}`)}}scale(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");let r=t.scale;switch(e){case"row":{if(r===void 0)r=yy(this);else if(!gr.isAnyArray(r))throw new TypeError("scale must be an array");return Dy(this,r),this}case"column":{if(r===void 0)r=wy(this);else if(!gr.isAnyArray(r))throw new TypeError("scale must be an array");return by(this,r),this}case void 0:{if(r===void 0)r=Ey(this);else if(typeof r!="number")throw new TypeError("scale must be a number");return Ay(this,r),this}default:throw new Error(`invalid option: ${e}`)}}toString(e){return Bc(this,e)}[Symbol.iterator](){return this.entries()}*entries(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield[e,t,this.get(e,t)]}*values(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield this.get(e,t)}}ke.prototype.klass="Matrix",typeof Symbol<"u"&&(ke.prototype[Symbol.for("nodejs.util.inspect.custom")]=iy);function Nc(s,e){return s-e}function Cy(s){return s.every(e=>typeof e=="number")}ke.random=ke.rand,ke.randomInt=ke.randInt,ke.diagonal=ke.diag,ke.prototype.diagonal=ke.prototype.diag,ke.identity=ke.eye,ke.prototype.negate=ke.prototype.neg,ke.prototype.tensorProduct=ke.prototype.kroneckerProduct;let ve=(Li=class extends ke{constructor(t,r){super();_l(this,_s);U(this,"data");if(Li.isMatrix(t))vl(this,_s,gl).call(this,t.rows,t.columns),Li.copy(t,this);else if(Number.isInteger(t)&&t>=0)vl(this,_s,gl).call(this,t,r);else if(gr.isAnyArray(t)){const n=t;if(t=n.length,r=t?n[0].length:0,typeof r!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let i=0;i<t;i++){if(n[i].length!==r)throw new RangeError("Inconsistent array dimensions");if(!Cy(n[i]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(n[i]))}this.rows=t,this.columns=r}else throw new TypeError("First argument must be a positive number or an array")}set(t,r,n){return this.data[t][r]=n,this}get(t,r){return this.data[t][r]}removeRow(t){return $r(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,r){return r===void 0&&(r=t,t=this.rows),$r(this,t,!0),r=Float64Array.from(Mi(this,r)),this.data.splice(t,0,r),this.rows+=1,this}removeColumn(t){Lr(this,t);for(let r=0;r<this.rows;r++){const n=new Float64Array(this.columns-1);for(let i=0;i<t;i++)n[i]=this.data[r][i];for(let i=t+1;i<this.columns;i++)n[i-1]=this.data[r][i];this.data[r]=n}return this.columns-=1,this}addColumn(t,r){typeof r>"u"&&(r=t,t=this.columns),Lr(this,t,!0),r=Ni(this,r);for(let n=0;n<this.rows;n++){const i=new Float64Array(this.columns+1);let a=0;for(;a<t;a++)i[a]=this.data[n][a];for(i[a++]=r[n];a<this.columns+1;a++)i[a]=this.data[n][a-1];this.data[n]=i}return this.columns+=1,this}},_s=new WeakSet,gl=function(t,r){if(this.data=[],Number.isInteger(r)&&r>=0)for(let n=0;n<t;n++)this.data.push(new Float64Array(r));else throw new TypeError("nColumns must be a positive integer");this.rows=t,this.columns=r},Li);ay(ke,ve);const $o=class $o extends ke{constructor(t){super();_l(this,tr,void 0);if(ve.isMatrix(t)){if(!t.isSymmetric())throw new TypeError("not symmetric data");Ea(this,tr,ve.copy(t,new ve(t.rows,t.rows)))}else if(Number.isInteger(t)&&t>=0)Ea(this,tr,new ve(t,t));else if(Ea(this,tr,new ve(t)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return on(this,tr).size}get rows(){return on(this,tr).rows}get columns(){return on(this,tr).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(t){return ve.isMatrix(t)&&t.klassType==="SymmetricMatrix"}static zeros(t){return new this(t)}static ones(t){return new this(t).fill(1)}clone(){const t=new $o(this.diagonalSize);for(const[r,n,i]of this.upperRightEntries())t.set(r,n,i);return t}toMatrix(){return new ve(this)}get(t,r){return on(this,tr).get(t,r)}set(t,r,n){return on(this,tr).set(t,r,n),on(this,tr).set(r,t,n),this}removeCross(t){return on(this,tr).removeRow(t),on(this,tr).removeColumn(t),this}addCross(t,r){r===void 0&&(r=t,t=this.diagonalSize);const n=r.slice();return n.splice(t,1),on(this,tr).addRow(t,n),on(this,tr).addColumn(t,r),this}applyMask(t){if(t.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const r=[];for(const[n,i]of t.entries())i||r.push(n);r.reverse();for(const n of r)this.removeCross(n);return this}toCompact(){const{diagonalSize:t}=this,r=new Array(t*(t+1)/2);for(let n=0,i=0,a=0;a<r.length;a++)r[a]=this.get(i,n),++n>=t&&(n=++i);return r}static fromCompact(t){const r=t.length,n=(Math.sqrt(8*r+1)-1)/2;if(!Number.isInteger(n))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(t)}`);const i=new $o(n);for(let a=0,u=0,c=0;c<r;c++)i.set(a,u,t[c]),++a>=n&&(a=++u);return i}*upperRightEntries(){for(let t=0,r=0;t<this.diagonalSize;void 0){const n=this.get(t,r);yield[t,r,n],++r>=this.diagonalSize&&(r=++t)}}*upperRightValues(){for(let t=0,r=0;t<this.diagonalSize;void 0)yield this.get(t,r),++r>=this.diagonalSize&&(r=++t)}};tr=new WeakMap;let ii=$o;ii.prototype.klassType="SymmetricMatrix";class wo extends ii{static isDistanceMatrix(e){return ii.isSymmetricMatrix(e)&&e.klassSubType==="DistanceMatrix"}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,t,r){return e===t&&(r=0),super.set(e,t,r)}addCross(e,t){return t===void 0&&(t=e,e=this.diagonalSize),t=t.slice(),t[e]=0,super.addCross(e,t)}toSymmetricMatrix(){return new ii(this)}clone(){const e=new wo(this.diagonalSize);for(const[t,r,n]of this.upperRightEntries())t!==r&&e.set(t,r,n);return e}toCompact(){const{diagonalSize:e}=this,t=(e-1)*e/2,r=new Array(t);for(let n=1,i=0,a=0;a<r.length;a++)r[a]=this.get(i,n),++n>=e&&(n=++i+1);return r}static fromCompact(e){const t=e.length,r=(Math.sqrt(8*t+1)+1)/2;if(!Number.isInteger(r))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const n=new this(r);for(let i=1,a=0,u=0;u<t;u++)n.set(i,a,e[u]),++i>=r&&(i=++a+1);return n}}wo.prototype.klassSubType="DistanceMatrix";class xn extends ke{constructor(e,t,r){super(),this.matrix=e,this.rows=t,this.columns=r}}class Fy extends xn{constructor(e,t){Lr(e,t),super(e,e.rows,1),this.column=t}set(e,t,r){return this.matrix.set(e,this.column,r),this}get(e){return this.matrix.get(e,this.column)}}class By extends xn{constructor(e,t){Ja(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,r){return this.matrix.set(e,this.columnIndices[t],r),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}}class My extends xn{constructor(e){super(e,e.rows,e.columns)}set(e,t,r){return this.matrix.set(e,this.columns-t-1,r),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}}class Ny extends xn{constructor(e){super(e,e.rows,e.columns)}set(e,t,r){return this.matrix.set(this.rows-e-1,t,r),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}}class Sy extends xn{constructor(e,t){$r(e,t),super(e,1,e.columns),this.row=t}set(e,t,r){return this.matrix.set(this.row,t,r),this}get(e,t){return this.matrix.get(this.row,t)}}class Oy extends xn{constructor(e,t){Qa(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,r){return this.matrix.set(this.rowIndices[e],t,r),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}}class bo extends xn{constructor(e,t,r){Qa(e,t),Ja(e,r),super(e,t.length,r.length),this.rowIndices=t,this.columnIndices=r}set(e,t,r){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],r),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class Iy extends xn{constructor(e,t,r,n,i){eu(e,t,r,n,i),super(e,r-t+1,i-n+1),this.startRow=t,this.startColumn=n}set(e,t,r){return this.matrix.set(this.startRow+e,this.startColumn+t,r),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}}class Ty extends xn{constructor(e){super(e,e.columns,e.rows)}set(e,t,r){return this.matrix.set(t,e,r),this}get(e,t){return this.matrix.get(t,e)}}class Sc extends ke{constructor(e,t={}){const{rows:r=1}=t;if(e.length%r!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=e.length/r,this.data=e}set(e,t,r){let n=this._calculateIndex(e,t);return this.data[n]=r,this}get(e,t){let r=this._calculateIndex(e,t);return this.data[r]}_calculateIndex(e,t){return e*this.columns+t}}class Ar extends ke{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,r){return this.data[e][t]=r,this}get(e,t){return this.data[e][t]}}function $y(s,e){if(gr.isAnyArray(s))return s[0]&&gr.isAnyArray(s[0])?new Ar(s):new Sc(s,e);throw new Error("the argument is not an array")}class Eo{constructor(e){e=Ar.checkMatrix(e);let t=e.clone(),r=t.rows,n=t.columns,i=new Float64Array(r),a=1,u,c,f,h,d,p,v,x,_;for(u=0;u<r;u++)i[u]=u;for(x=new Float64Array(r),c=0;c<n;c++){for(u=0;u<r;u++)x[u]=t.get(u,c);for(u=0;u<r;u++){for(_=Math.min(u,c),d=0,f=0;f<_;f++)d+=t.get(u,f)*x[f];x[u]-=d,t.set(u,c,x[u])}for(h=c,u=c+1;u<r;u++)Math.abs(x[u])>Math.abs(x[h])&&(h=u);if(h!==c){for(f=0;f<n;f++)p=t.get(h,f),t.set(h,f,t.get(c,f)),t.set(c,f,p);v=i[h],i[h]=i[c],i[c]=v,a=-a}if(c<r&&t.get(c,c)!==0)for(u=c+1;u<r;u++)t.set(u,c,t.get(u,c)/t.get(c,c))}this.LU=t,this.pivotVector=i,this.pivotSign=a}isSingular(){let e=this.LU,t=e.columns;for(let r=0;r<t;r++)if(e.get(r,r)===0)return!0;return!1}solve(e){e=ve.checkMatrix(e);let t=this.LU;if(t.rows!==e.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let n=e.columns,i=e.subMatrixRow(this.pivotVector,0,n-1),a=t.columns,u,c,f;for(f=0;f<a;f++)for(u=f+1;u<a;u++)for(c=0;c<n;c++)i.set(u,c,i.get(u,c)-i.get(f,c)*t.get(u,f));for(f=a-1;f>=0;f--){for(c=0;c<n;c++)i.set(f,c,i.get(f,c)/t.get(f,f));for(u=0;u<f;u++)for(c=0;c<n;c++)i.set(u,c,i.get(u,c)-i.get(f,c)*t.get(u,f))}return i}get determinant(){let e=this.LU;if(!e.isSquare())throw new Error("Matrix must be square");let t=this.pivotSign,r=e.columns;for(let n=0;n<r;n++)t*=e.get(n,n);return t}get lowerTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,n=new ve(t,r);for(let i=0;i<t;i++)for(let a=0;a<r;a++)i>a?n.set(i,a,e.get(i,a)):i===a?n.set(i,a,1):n.set(i,a,0);return n}get upperTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,n=new ve(t,r);for(let i=0;i<t;i++)for(let a=0;a<r;a++)i<=a?n.set(i,a,e.get(i,a)):n.set(i,a,0);return n}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function yn(s,e){let t=0;return Math.abs(s)>Math.abs(e)?(t=e/s,Math.abs(s)*Math.sqrt(1+t*t)):e!==0?(t=s/e,Math.abs(e)*Math.sqrt(1+t*t)):0}class tu{constructor(e){e=Ar.checkMatrix(e);let t=e.clone(),r=e.rows,n=e.columns,i=new Float64Array(n),a,u,c,f;for(c=0;c<n;c++){let h=0;for(a=c;a<r;a++)h=yn(h,t.get(a,c));if(h!==0){for(t.get(c,c)<0&&(h=-h),a=c;a<r;a++)t.set(a,c,t.get(a,c)/h);for(t.set(c,c,t.get(c,c)+1),u=c+1;u<n;u++){for(f=0,a=c;a<r;a++)f+=t.get(a,c)*t.get(a,u);for(f=-f/t.get(c,c),a=c;a<r;a++)t.set(a,u,t.get(a,u)+f*t.get(a,c))}}i[c]=-h}this.QR=t,this.Rdiag=i}solve(e){e=ve.checkMatrix(e);let t=this.QR,r=t.rows;if(e.rows!==r)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let n=e.columns,i=e.clone(),a=t.columns,u,c,f,h;for(f=0;f<a;f++)for(c=0;c<n;c++){for(h=0,u=f;u<r;u++)h+=t.get(u,f)*i.get(u,c);for(h=-h/t.get(f,f),u=f;u<r;u++)i.set(u,c,i.get(u,c)+h*t.get(u,f))}for(f=a-1;f>=0;f--){for(c=0;c<n;c++)i.set(f,c,i.get(f,c)/this.Rdiag[f]);for(u=0;u<f;u++)for(c=0;c<n;c++)i.set(u,c,i.get(u,c)-i.get(f,c)*t.get(u,f))}return i.subMatrix(0,a-1,0,n-1)}isFullRank(){let e=this.QR.columns;for(let t=0;t<e;t++)if(this.Rdiag[t]===0)return!1;return!0}get upperTriangularMatrix(){let e=this.QR,t=e.columns,r=new ve(t,t),n,i;for(n=0;n<t;n++)for(i=0;i<t;i++)n<i?r.set(n,i,e.get(n,i)):n===i?r.set(n,i,this.Rdiag[n]):r.set(n,i,0);return r}get orthogonalMatrix(){let e=this.QR,t=e.rows,r=e.columns,n=new ve(t,r),i,a,u,c;for(u=r-1;u>=0;u--){for(i=0;i<t;i++)n.set(i,u,0);for(n.set(u,u,1),a=u;a<r;a++)if(e.get(u,u)!==0){for(c=0,i=u;i<t;i++)c+=e.get(i,u)*n.get(i,a);for(c=-c/e.get(u,u),i=u;i<t;i++)n.set(i,a,n.get(i,a)+c*e.get(i,u))}}return n}}class Oi{constructor(e,t={}){if(e=Ar.checkMatrix(e),e.isEmpty())throw new Error("Matrix must be non-empty");let r=e.rows,n=e.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:a=!0,autoTranspose:u=!1}=t;let c=!!i,f=!!a,h=!1,d;if(r<n)if(!u)d=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{d=e.transpose(),r=d.rows,n=d.columns,h=!0;let A=c;c=f,f=A}else d=e.clone();let p=Math.min(r,n),v=Math.min(r+1,n),x=new Float64Array(v),_=new ve(r,p),y=new ve(n,n),m=new Float64Array(n),w=new Float64Array(r),D=new Float64Array(v);for(let A=0;A<v;A++)D[A]=A;let C=Math.min(r-1,n),b=Math.max(0,Math.min(n-2,r)),F=Math.max(C,b);for(let A=0;A<F;A++){if(A<C){x[A]=0;for(let N=A;N<r;N++)x[A]=yn(x[A],d.get(N,A));if(x[A]!==0){d.get(A,A)<0&&(x[A]=-x[A]);for(let N=A;N<r;N++)d.set(N,A,d.get(N,A)/x[A]);d.set(A,A,d.get(A,A)+1)}x[A]=-x[A]}for(let N=A+1;N<n;N++){if(A<C&&x[A]!==0){let I=0;for(let L=A;L<r;L++)I+=d.get(L,A)*d.get(L,N);I=-I/d.get(A,A);for(let L=A;L<r;L++)d.set(L,N,d.get(L,N)+I*d.get(L,A))}m[N]=d.get(A,N)}if(c&&A<C)for(let N=A;N<r;N++)_.set(N,A,d.get(N,A));if(A<b){m[A]=0;for(let N=A+1;N<n;N++)m[A]=yn(m[A],m[N]);if(m[A]!==0){m[A+1]<0&&(m[A]=0-m[A]);for(let N=A+1;N<n;N++)m[N]/=m[A];m[A+1]+=1}if(m[A]=-m[A],A+1<r&&m[A]!==0){for(let N=A+1;N<r;N++)w[N]=0;for(let N=A+1;N<r;N++)for(let I=A+1;I<n;I++)w[N]+=m[I]*d.get(N,I);for(let N=A+1;N<n;N++){let I=-m[N]/m[A+1];for(let L=A+1;L<r;L++)d.set(L,N,d.get(L,N)+I*w[L])}}if(f)for(let N=A+1;N<n;N++)y.set(N,A,m[N])}}let B=Math.min(n,r+1);if(C<n&&(x[C]=d.get(C,C)),r<B&&(x[B-1]=0),b+1<B&&(m[b]=d.get(b,B-1)),m[B-1]=0,c){for(let A=C;A<p;A++){for(let N=0;N<r;N++)_.set(N,A,0);_.set(A,A,1)}for(let A=C-1;A>=0;A--)if(x[A]!==0){for(let N=A+1;N<p;N++){let I=0;for(let L=A;L<r;L++)I+=_.get(L,A)*_.get(L,N);I=-I/_.get(A,A);for(let L=A;L<r;L++)_.set(L,N,_.get(L,N)+I*_.get(L,A))}for(let N=A;N<r;N++)_.set(N,A,-_.get(N,A));_.set(A,A,1+_.get(A,A));for(let N=0;N<A-1;N++)_.set(N,A,0)}else{for(let N=0;N<r;N++)_.set(N,A,0);_.set(A,A,1)}}if(f)for(let A=n-1;A>=0;A--){if(A<b&&m[A]!==0)for(let N=A+1;N<n;N++){let I=0;for(let L=A+1;L<n;L++)I+=y.get(L,A)*y.get(L,N);I=-I/y.get(A+1,A);for(let L=A+1;L<n;L++)y.set(L,N,y.get(L,N)+I*y.get(L,A))}for(let N=0;N<n;N++)y.set(N,A,0);y.set(A,A,1)}let M=B-1,O=Number.EPSILON;for(;B>0;){let A,N;for(A=B-2;A>=-1&&A!==-1;A--){const I=Number.MIN_VALUE+O*Math.abs(x[A]+Math.abs(x[A+1]));if(Math.abs(m[A])<=I||Number.isNaN(m[A])){m[A]=0;break}}if(A===B-2)N=4;else{let I;for(I=B-1;I>=A&&I!==A;I--){let L=(I!==B?Math.abs(m[I]):0)+(I!==A+1?Math.abs(m[I-1]):0);if(Math.abs(x[I])<=O*L){x[I]=0;break}}I===A?N=3:I===B-1?N=1:(N=2,A=I)}switch(A++,N){case 1:{let I=m[B-2];m[B-2]=0;for(let L=B-2;L>=A;L--){let k=yn(x[L],I),z=x[L]/k,R=I/k;if(x[L]=k,L!==A&&(I=-R*m[L-1],m[L-1]=z*m[L-1]),f)for(let G=0;G<n;G++)k=z*y.get(G,L)+R*y.get(G,B-1),y.set(G,B-1,-R*y.get(G,L)+z*y.get(G,B-1)),y.set(G,L,k)}break}case 2:{let I=m[A-1];m[A-1]=0;for(let L=A;L<B;L++){let k=yn(x[L],I),z=x[L]/k,R=I/k;if(x[L]=k,I=-R*m[L],m[L]=z*m[L],c)for(let G=0;G<r;G++)k=z*_.get(G,L)+R*_.get(G,A-1),_.set(G,A-1,-R*_.get(G,L)+z*_.get(G,A-1)),_.set(G,L,k)}break}case 3:{const I=Math.max(Math.abs(x[B-1]),Math.abs(x[B-2]),Math.abs(m[B-2]),Math.abs(x[A]),Math.abs(m[A])),L=x[B-1]/I,k=x[B-2]/I,z=m[B-2]/I,R=x[A]/I,G=m[A]/I,H=((k+L)*(k-L)+z*z)/2,ee=L*z*(L*z);let te=0;(H!==0||ee!==0)&&(H<0?te=0-Math.sqrt(H*H+ee):te=Math.sqrt(H*H+ee),te=ee/(H+te));let j=(R+L)*(R-L)+te,X=R*G;for(let Y=A;Y<B-1;Y++){let Q=yn(j,X);Q===0&&(Q=Number.MIN_VALUE);let pe=j/Q,De=X/Q;if(Y!==A&&(m[Y-1]=Q),j=pe*x[Y]+De*m[Y],m[Y]=pe*m[Y]-De*x[Y],X=De*x[Y+1],x[Y+1]=pe*x[Y+1],f)for(let we=0;we<n;we++)Q=pe*y.get(we,Y)+De*y.get(we,Y+1),y.set(we,Y+1,-De*y.get(we,Y)+pe*y.get(we,Y+1)),y.set(we,Y,Q);if(Q=yn(j,X),Q===0&&(Q=Number.MIN_VALUE),pe=j/Q,De=X/Q,x[Y]=Q,j=pe*m[Y]+De*x[Y+1],x[Y+1]=-De*m[Y]+pe*x[Y+1],X=De*m[Y+1],m[Y+1]=pe*m[Y+1],c&&Y<r-1)for(let we=0;we<r;we++)Q=pe*_.get(we,Y)+De*_.get(we,Y+1),_.set(we,Y+1,-De*_.get(we,Y)+pe*_.get(we,Y+1)),_.set(we,Y,Q)}m[B-2]=j;break}case 4:{if(x[A]<=0&&(x[A]=x[A]<0?-x[A]:0,f))for(let I=0;I<=M;I++)y.set(I,A,-y.get(I,A));for(;A<M&&!(x[A]>=x[A+1]);){let I=x[A];if(x[A]=x[A+1],x[A+1]=I,f&&A<n-1)for(let L=0;L<n;L++)I=y.get(L,A+1),y.set(L,A+1,y.get(L,A)),y.set(L,A,I);if(c&&A<r-1)for(let L=0;L<r;L++)I=_.get(L,A+1),_.set(L,A+1,_.get(L,A)),_.set(L,A,I);A++}B--;break}}}if(h){let A=y;y=_,_=A}this.m=r,this.n=n,this.s=x,this.U=_,this.V=y}solve(e){let t=e,r=this.threshold,n=this.s.length,i=ve.zeros(n,n);for(let p=0;p<n;p++)Math.abs(this.s[p])<=r?i.set(p,p,0):i.set(p,p,1/this.s[p]);let a=this.U,u=this.rightSingularVectors,c=u.mmul(i),f=u.rows,h=a.rows,d=ve.zeros(f,h);for(let p=0;p<f;p++)for(let v=0;v<h;v++){let x=0;for(let _=0;_<n;_++)x+=c.get(p,_)*a.get(v,_);d.set(p,v,x)}return d.mmul(t)}solveForDiagonal(e){return this.solve(ve.diag(e))}inverse(){let e=this.V,t=this.threshold,r=e.rows,n=e.columns,i=new ve(r,this.s.length);for(let h=0;h<r;h++)for(let d=0;d<n;d++)Math.abs(this.s[d])>t&&i.set(h,d,e.get(h,d)/this.s[d]);let a=this.U,u=a.rows,c=a.columns,f=new ve(r,u);for(let h=0;h<r;h++)for(let d=0;d<u;d++){let p=0;for(let v=0;v<c;v++)p+=i.get(h,v)*a.get(d,v);f.set(h,d,p)}return f}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let e=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,t=0,r=this.s;for(let n=0,i=r.length;n<i;n++)r[n]>e&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ve.diag(this.s)}}function Ly(s,e=!1){return s=Ar.checkMatrix(s),e?new Oi(s).inverse():Oc(s,ve.eye(s.rows))}function Oc(s,e,t=!1){return s=Ar.checkMatrix(s),e=Ar.checkMatrix(e),t?new Oi(s).solve(e):s.isSquare()?new Eo(s).solve(e):new tu(s).solve(e)}function Ao(s){if(s=ve.checkMatrix(s),s.isSquare()){if(s.columns===0)return 1;let e,t,r,n;if(s.columns===2)return e=s.get(0,0),t=s.get(0,1),r=s.get(1,0),n=s.get(1,1),e*n-t*r;if(s.columns===3){let i,a,u;return i=new bo(s,[1,2],[1,2]),a=new bo(s,[1,2],[0,2]),u=new bo(s,[1,2],[0,1]),e=s.get(0,0),t=s.get(0,1),r=s.get(0,2),e*Ao(i)-t*Ao(a)+r*Ao(u)}else return new Eo(s).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Ry(s,e){let t=[];for(let r=0;r<s;r++)r!==e&&t.push(r);return t}function Py(s,e,t,r=1e-9,n=1e-9){if(s>n)return new Array(e.rows+1).fill(0);{let i=e.addRow(t,[0]);for(let a=0;a<i.rows;a++)Math.abs(i.get(a,0))<r&&i.set(a,0,0);return i.to1DArray()}}function ky(s,e={}){const{thresholdValue:t=1e-9,thresholdError:r=1e-9}=e;s=ve.checkMatrix(s);let n=s.rows,i=new ve(n,n);for(let a=0;a<n;a++){let u=ve.columnVector(s.getRow(a)),c=s.subMatrixRow(Ry(n,a)).transpose(),h=new Oi(c).solve(u),d=ve.sub(u,c.mmul(h)).abs().max();i.setRow(a,Py(d,h,a,t,r))}return i}function zy(s,e=Number.EPSILON){if(s=ve.checkMatrix(s),s.isEmpty())return s.transpose();let t=new Oi(s,{autoTranspose:!0}),r=t.leftSingularVectors,n=t.rightSingularVectors,i=t.diagonal;for(let a=0;a<i.length;a++)Math.abs(i[a])>e?i[a]=1/i[a]:i[a]=0;return n.mmul(ve.diag(i).mmul(r.transpose()))}function qy(s,e=s,t={}){s=new ve(s);let r=!1;if(typeof e=="object"&&!ve.isMatrix(e)&&!gr.isAnyArray(e)?(t=e,e=s,r=!0):e=new ve(e),s.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:n=!0}=t;n&&(s=s.center("column"),r||(e=e.center("column")));const i=s.transpose().mmul(e);for(let a=0;a<i.rows;a++)for(let u=0;u<i.columns;u++)i.set(a,u,i.get(a,u)*(1/(s.rows-1)));return i}function Uy(s,e=s,t={}){s=new ve(s);let r=!1;if(typeof e=="object"&&!ve.isMatrix(e)&&!gr.isAnyArray(e)?(t=e,e=s,r=!0):e=new ve(e),s.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:n=!0,scale:i=!0}=t;n&&(s.center("column"),r||e.center("column")),i&&(s.scale("column"),r||e.scale("column"));const a=s.standardDeviation("column",{unbiased:!0}),u=r?a:e.standardDeviation("column",{unbiased:!0}),c=s.transpose().mmul(e);for(let f=0;f<c.rows;f++)for(let h=0;h<c.columns;h++)c.set(f,h,c.get(f,h)*(1/(a[f]*u[h]))*(1/(s.rows-1)));return c}let Ic=class{constructor(e,t={}){const{assumeSymmetric:r=!1}=t;if(e=Ar.checkMatrix(e),!e.isSquare())throw new Error("Matrix is not a square matrix");if(e.isEmpty())throw new Error("Matrix must be non-empty");let n=e.columns,i=new ve(n,n),a=new Float64Array(n),u=new Float64Array(n),c=e,f,h,d=!1;if(r?d=!0:d=e.isSymmetric(),d){for(f=0;f<n;f++)for(h=0;h<n;h++)i.set(f,h,c.get(f,h));Wy(n,u,a,i),Hy(n,u,a,i)}else{let p=new ve(n,n),v=new Float64Array(n);for(h=0;h<n;h++)for(f=0;f<n;f++)p.set(f,h,c.get(f,h));jy(n,p,v,i),Yy(n,u,a,i,p)}this.n=n,this.e=u,this.d=a,this.V=i}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let e=this.n,t=this.e,r=this.d,n=new ve(e,e),i,a;for(i=0;i<e;i++){for(a=0;a<e;a++)n.set(i,a,0);n.set(i,i,r[i]),t[i]>0?n.set(i,i+1,t[i]):t[i]<0&&n.set(i,i-1,t[i])}return n}};function Wy(s,e,t,r){let n,i,a,u,c,f,h,d;for(c=0;c<s;c++)t[c]=r.get(s-1,c);for(u=s-1;u>0;u--){for(d=0,a=0,f=0;f<u;f++)d=d+Math.abs(t[f]);if(d===0)for(e[u]=t[u-1],c=0;c<u;c++)t[c]=r.get(u-1,c),r.set(u,c,0),r.set(c,u,0);else{for(f=0;f<u;f++)t[f]/=d,a+=t[f]*t[f];for(n=t[u-1],i=Math.sqrt(a),n>0&&(i=-i),e[u]=d*i,a=a-n*i,t[u-1]=n-i,c=0;c<u;c++)e[c]=0;for(c=0;c<u;c++){for(n=t[c],r.set(c,u,n),i=e[c]+r.get(c,c)*n,f=c+1;f<=u-1;f++)i+=r.get(f,c)*t[f],e[f]+=r.get(f,c)*n;e[c]=i}for(n=0,c=0;c<u;c++)e[c]/=a,n+=e[c]*t[c];for(h=n/(a+a),c=0;c<u;c++)e[c]-=h*t[c];for(c=0;c<u;c++){for(n=t[c],i=e[c],f=c;f<=u-1;f++)r.set(f,c,r.get(f,c)-(n*e[f]+i*t[f]));t[c]=r.get(u-1,c),r.set(u,c,0)}}t[u]=a}for(u=0;u<s-1;u++){if(r.set(s-1,u,r.get(u,u)),r.set(u,u,1),a=t[u+1],a!==0){for(f=0;f<=u;f++)t[f]=r.get(f,u+1)/a;for(c=0;c<=u;c++){for(i=0,f=0;f<=u;f++)i+=r.get(f,u+1)*r.get(f,c);for(f=0;f<=u;f++)r.set(f,c,r.get(f,c)-i*t[f])}}for(f=0;f<=u;f++)r.set(f,u+1,0)}for(c=0;c<s;c++)t[c]=r.get(s-1,c),r.set(s-1,c,0);r.set(s-1,s-1,1),e[0]=0}function Hy(s,e,t,r){let n,i,a,u,c,f,h,d,p,v,x,_,y,m,w,D;for(a=1;a<s;a++)e[a-1]=e[a];e[s-1]=0;let C=0,b=0,F=Number.EPSILON;for(f=0;f<s;f++){for(b=Math.max(b,Math.abs(t[f])+Math.abs(e[f])),h=f;h<s&&!(Math.abs(e[h])<=F*b);)h++;if(h>f)do{for(n=t[f],d=(t[f+1]-n)/(2*e[f]),p=yn(d,1),d<0&&(p=-p),t[f]=e[f]/(d+p),t[f+1]=e[f]*(d+p),v=t[f+1],i=n-t[f],a=f+2;a<s;a++)t[a]-=i;for(C=C+i,d=t[h],x=1,_=x,y=x,m=e[f+1],w=0,D=0,a=h-1;a>=f;a--)for(y=_,_=x,D=w,n=x*e[a],i=x*d,p=yn(d,e[a]),e[a+1]=w*p,w=e[a]/p,x=d/p,d=x*t[a]-w*n,t[a+1]=i+w*(x*n+w*t[a]),c=0;c<s;c++)i=r.get(c,a+1),r.set(c,a+1,w*r.get(c,a)+x*i),r.set(c,a,x*r.get(c,a)-w*i);d=-w*D*y*m*e[f]/v,e[f]=w*d,t[f]=x*d}while(Math.abs(e[f])>F*b);t[f]=t[f]+C,e[f]=0}for(a=0;a<s-1;a++){for(c=a,d=t[a],u=a+1;u<s;u++)t[u]<d&&(c=u,d=t[u]);if(c!==a)for(t[c]=t[a],t[a]=d,u=0;u<s;u++)d=r.get(u,a),r.set(u,a,r.get(u,c)),r.set(u,c,d)}}function jy(s,e,t,r){let n=0,i=s-1,a,u,c,f,h,d,p;for(d=n+1;d<=i-1;d++){for(p=0,f=d;f<=i;f++)p=p+Math.abs(e.get(f,d-1));if(p!==0){for(c=0,f=i;f>=d;f--)t[f]=e.get(f,d-1)/p,c+=t[f]*t[f];for(u=Math.sqrt(c),t[d]>0&&(u=-u),c=c-t[d]*u,t[d]=t[d]-u,h=d;h<s;h++){for(a=0,f=i;f>=d;f--)a+=t[f]*e.get(f,h);for(a=a/c,f=d;f<=i;f++)e.set(f,h,e.get(f,h)-a*t[f])}for(f=0;f<=i;f++){for(a=0,h=i;h>=d;h--)a+=t[h]*e.get(f,h);for(a=a/c,h=d;h<=i;h++)e.set(f,h,e.get(f,h)-a*t[h])}t[d]=p*t[d],e.set(d,d-1,p*u)}}for(f=0;f<s;f++)for(h=0;h<s;h++)r.set(f,h,f===h?1:0);for(d=i-1;d>=n+1;d--)if(e.get(d,d-1)!==0){for(f=d+1;f<=i;f++)t[f]=e.get(f,d-1);for(h=d;h<=i;h++){for(u=0,f=d;f<=i;f++)u+=t[f]*r.get(f,h);for(u=u/t[d]/e.get(d,d-1),f=d;f<=i;f++)r.set(f,h,r.get(f,h)+u*t[f])}}}function Yy(s,e,t,r,n){let i=s-1,a=0,u=s-1,c=Number.EPSILON,f=0,h=0,d=0,p=0,v=0,x=0,_=0,y=0,m,w,D,C,b,F,B,M,O,A,N,I,L,k,z;for(m=0;m<s;m++)for((m<a||m>u)&&(t[m]=n.get(m,m),e[m]=0),w=Math.max(m-1,0);w<s;w++)h=h+Math.abs(n.get(m,w));for(;i>=a;){for(C=i;C>a&&(x=Math.abs(n.get(C-1,C-1))+Math.abs(n.get(C,C)),x===0&&(x=h),!(Math.abs(n.get(C,C-1))<c*x));)C--;if(C===i)n.set(i,i,n.get(i,i)+f),t[i]=n.get(i,i),e[i]=0,i--,y=0;else if(C===i-1){if(B=n.get(i,i-1)*n.get(i-1,i),d=(n.get(i-1,i-1)-n.get(i,i))/2,p=d*d+B,_=Math.sqrt(Math.abs(p)),n.set(i,i,n.get(i,i)+f),n.set(i-1,i-1,n.get(i-1,i-1)+f),M=n.get(i,i),p>=0){for(_=d>=0?d+_:d-_,t[i-1]=M+_,t[i]=t[i-1],_!==0&&(t[i]=M-B/_),e[i-1]=0,e[i]=0,M=n.get(i,i-1),x=Math.abs(M)+Math.abs(_),d=M/x,p=_/x,v=Math.sqrt(d*d+p*p),d=d/v,p=p/v,w=i-1;w<s;w++)_=n.get(i-1,w),n.set(i-1,w,p*_+d*n.get(i,w)),n.set(i,w,p*n.get(i,w)-d*_);for(m=0;m<=i;m++)_=n.get(m,i-1),n.set(m,i-1,p*_+d*n.get(m,i)),n.set(m,i,p*n.get(m,i)-d*_);for(m=a;m<=u;m++)_=r.get(m,i-1),r.set(m,i-1,p*_+d*r.get(m,i)),r.set(m,i,p*r.get(m,i)-d*_)}else t[i-1]=M+d,t[i]=M+d,e[i-1]=_,e[i]=-_;i=i-2,y=0}else{if(M=n.get(i,i),O=0,B=0,C<i&&(O=n.get(i-1,i-1),B=n.get(i,i-1)*n.get(i-1,i)),y===10){for(f+=M,m=a;m<=i;m++)n.set(m,m,n.get(m,m)-M);x=Math.abs(n.get(i,i-1))+Math.abs(n.get(i-1,i-2)),M=O=.75*x,B=-.4375*x*x}if(y===30&&(x=(O-M)/2,x=x*x+B,x>0)){for(x=Math.sqrt(x),O<M&&(x=-x),x=M-B/((O-M)/2+x),m=a;m<=i;m++)n.set(m,m,n.get(m,m)-x);f+=x,M=O=B=.964}for(y=y+1,b=i-2;b>=C&&(_=n.get(b,b),v=M-_,x=O-_,d=(v*x-B)/n.get(b+1,b)+n.get(b,b+1),p=n.get(b+1,b+1)-_-v-x,v=n.get(b+2,b+1),x=Math.abs(d)+Math.abs(p)+Math.abs(v),d=d/x,p=p/x,v=v/x,!(b===C||Math.abs(n.get(b,b-1))*(Math.abs(p)+Math.abs(v))<c*(Math.abs(d)*(Math.abs(n.get(b-1,b-1))+Math.abs(_)+Math.abs(n.get(b+1,b+1))))));)b--;for(m=b+2;m<=i;m++)n.set(m,m-2,0),m>b+2&&n.set(m,m-3,0);for(D=b;D<=i-1&&(k=D!==i-1,D!==b&&(d=n.get(D,D-1),p=n.get(D+1,D-1),v=k?n.get(D+2,D-1):0,M=Math.abs(d)+Math.abs(p)+Math.abs(v),M!==0&&(d=d/M,p=p/M,v=v/M)),M!==0);D++)if(x=Math.sqrt(d*d+p*p+v*v),d<0&&(x=-x),x!==0){for(D!==b?n.set(D,D-1,-x*M):C!==b&&n.set(D,D-1,-n.get(D,D-1)),d=d+x,M=d/x,O=p/x,_=v/x,p=p/d,v=v/d,w=D;w<s;w++)d=n.get(D,w)+p*n.get(D+1,w),k&&(d=d+v*n.get(D+2,w),n.set(D+2,w,n.get(D+2,w)-d*_)),n.set(D,w,n.get(D,w)-d*M),n.set(D+1,w,n.get(D+1,w)-d*O);for(m=0;m<=Math.min(i,D+3);m++)d=M*n.get(m,D)+O*n.get(m,D+1),k&&(d=d+_*n.get(m,D+2),n.set(m,D+2,n.get(m,D+2)-d*v)),n.set(m,D,n.get(m,D)-d),n.set(m,D+1,n.get(m,D+1)-d*p);for(m=a;m<=u;m++)d=M*r.get(m,D)+O*r.get(m,D+1),k&&(d=d+_*r.get(m,D+2),r.set(m,D+2,r.get(m,D+2)-d*v)),r.set(m,D,r.get(m,D)-d),r.set(m,D+1,r.get(m,D+1)-d*p)}}}if(h!==0){for(i=s-1;i>=0;i--)if(d=t[i],p=e[i],p===0)for(C=i,n.set(i,i,1),m=i-1;m>=0;m--){for(B=n.get(m,m)-d,v=0,w=C;w<=i;w++)v=v+n.get(m,w)*n.get(w,i);if(e[m]<0)_=B,x=v;else if(C=m,e[m]===0?n.set(m,i,B!==0?-v/B:-v/(c*h)):(M=n.get(m,m+1),O=n.get(m+1,m),p=(t[m]-d)*(t[m]-d)+e[m]*e[m],F=(M*x-_*v)/p,n.set(m,i,F),n.set(m+1,i,Math.abs(M)>Math.abs(_)?(-v-B*F)/M:(-x-O*F)/_)),F=Math.abs(n.get(m,i)),c*F*F>1)for(w=m;w<=i;w++)n.set(w,i,n.get(w,i)/F)}else if(p<0)for(C=i-1,Math.abs(n.get(i,i-1))>Math.abs(n.get(i-1,i))?(n.set(i-1,i-1,p/n.get(i,i-1)),n.set(i-1,i,-(n.get(i,i)-d)/n.get(i,i-1))):(z=Co(0,-n.get(i-1,i),n.get(i-1,i-1)-d,p),n.set(i-1,i-1,z[0]),n.set(i-1,i,z[1])),n.set(i,i-1,0),n.set(i,i,1),m=i-2;m>=0;m--){for(A=0,N=0,w=C;w<=i;w++)A=A+n.get(m,w)*n.get(w,i-1),N=N+n.get(m,w)*n.get(w,i);if(B=n.get(m,m)-d,e[m]<0)_=B,v=A,x=N;else if(C=m,e[m]===0?(z=Co(-A,-N,B,p),n.set(m,i-1,z[0]),n.set(m,i,z[1])):(M=n.get(m,m+1),O=n.get(m+1,m),I=(t[m]-d)*(t[m]-d)+e[m]*e[m]-p*p,L=(t[m]-d)*2*p,I===0&&L===0&&(I=c*h*(Math.abs(B)+Math.abs(p)+Math.abs(M)+Math.abs(O)+Math.abs(_))),z=Co(M*v-_*A+p*N,M*x-_*N-p*A,I,L),n.set(m,i-1,z[0]),n.set(m,i,z[1]),Math.abs(M)>Math.abs(_)+Math.abs(p)?(n.set(m+1,i-1,(-A-B*n.get(m,i-1)+p*n.get(m,i))/M),n.set(m+1,i,(-N-B*n.get(m,i)-p*n.get(m,i-1))/M)):(z=Co(-v-O*n.get(m,i-1),-x-O*n.get(m,i),_,p),n.set(m+1,i-1,z[0]),n.set(m+1,i,z[1]))),F=Math.max(Math.abs(n.get(m,i-1)),Math.abs(n.get(m,i))),c*F*F>1)for(w=m;w<=i;w++)n.set(w,i-1,n.get(w,i-1)/F),n.set(w,i,n.get(w,i)/F)}for(m=0;m<s;m++)if(m<a||m>u)for(w=m;w<s;w++)r.set(m,w,n.get(m,w));for(w=s-1;w>=a;w--)for(m=a;m<=u;m++){for(_=0,D=a;D<=Math.min(w,u);D++)_=_+r.get(m,D)*n.get(D,w);r.set(m,w,_)}}}function Co(s,e,t,r){let n,i;return Math.abs(t)>Math.abs(r)?(n=r/t,i=t+n*r,[(s+n*e)/i,(e-n*s)/i]):(n=t/r,i=r+n*t,[(n*s+e)/i,(n*e-s)/i])}class Tc{constructor(e){if(e=Ar.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let t=e,r=t.rows,n=new ve(r,r),i=!0,a,u,c;for(u=0;u<r;u++){let f=0;for(c=0;c<u;c++){let h=0;for(a=0;a<c;a++)h+=n.get(c,a)*n.get(u,a);h=(t.get(u,c)-h)/n.get(c,c),n.set(u,c,h),f=f+h*h}for(f=t.get(u,u)-f,i&=f>0,n.set(u,u,Math.sqrt(Math.max(f,0))),c=u+1;c<r;c++)n.set(u,c,0)}this.L=n,this.positiveDefinite=!!i}isPositiveDefinite(){return this.positiveDefinite}solve(e){e=Ar.checkMatrix(e);let t=this.L,r=t.rows;if(e.rows!==r)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let n=e.columns,i=e.clone(),a,u,c;for(c=0;c<r;c++)for(u=0;u<n;u++){for(a=0;a<c;a++)i.set(c,u,i.get(c,u)-i.get(a,u)*t.get(c,a));i.set(c,u,i.get(c,u)/t.get(c,c))}for(c=r-1;c>=0;c--)for(u=0;u<n;u++){for(a=c+1;a<r;a++)i.set(c,u,i.get(c,u)-i.get(a,u)*t.get(a,c));i.set(c,u,i.get(c,u)/t.get(c,c))}return i}get lowerTriangularMatrix(){return this.L}}class $c{constructor(e,t={}){e=Ar.checkMatrix(e);let{Y:r}=t;const{scaleScores:n=!1,maxIterations:i=1e3,terminationCriteria:a=1e-10}=t;let u;if(r){if(gr.isAnyArray(r)&&typeof r[0]=="number"?r=ve.columnVector(r):r=Ar.checkMatrix(r),r.rows!==e.rows)throw new Error("Y should have the same number of rows as X");u=r.getColumnVector(0)}else u=e.getColumnVector(0);let c=1,f,h,d,p;for(let v=0;v<i&&c>a;v++)d=e.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),d=d.div(d.norm()),f=e.mmul(d).div(d.transpose().mmul(d).get(0,0)),v>0&&(c=f.clone().sub(p).pow(2).sum()),p=f.clone(),r?(h=r.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0)),h=h.div(h.norm()),u=r.mmul(h).div(h.transpose().mmul(h).get(0,0))):u=f;if(r){let v=e.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0));v=v.div(v.norm());let x=e.clone().sub(f.clone().mmul(v.transpose())),_=u.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0)),y=r.clone().sub(f.clone().mulS(_.get(0,0)).mmul(h.transpose()));this.t=f,this.p=v.transpose(),this.w=d.transpose(),this.q=h,this.u=u,this.s=f.transpose().mmul(f),this.xResidual=x,this.yResidual=y,this.betas=_}else this.w=d.transpose(),this.s=f.transpose().mmul(f).sqrt(),n?this.t=f.clone().div(this.s.get(0,0)):this.t=f,this.xResidual=e.sub(f.mmul(d.transpose()))}}We.AbstractMatrix=ke,We.CHO=Tc,We.CholeskyDecomposition=Tc,We.DistanceMatrix=wo,We.EVD=Ic;var Zy=We.EigenvalueDecomposition=Ic;We.LU=Eo,We.LuDecomposition=Eo;var Lc=We.Matrix=ve;We.MatrixColumnSelectionView=By,We.MatrixColumnView=Fy,We.MatrixFlipColumnView=My,We.MatrixFlipRowView=Ny,We.MatrixRowSelectionView=Oy,We.MatrixRowView=Sy,We.MatrixSelectionView=bo,We.MatrixSubView=Iy,We.MatrixTransposeView=Ty,We.NIPALS=$c,We.Nipals=$c,We.QR=tu,We.QrDecomposition=tu,We.SVD=Oi,We.SingularValueDecomposition=Oi,We.SymmetricMatrix=ii,We.WrapperMatrix1D=Sc,We.WrapperMatrix2D=Ar,We.correlation=Uy,We.covariance=qy;var Rc=We.default=ve;We.determinant=Ao,We.inverse=Ly,We.linearDependencies=ky,We.pseudoInverse=zy,We.solve=Oc,We.wrap=$y;const Pc=Zy,kc=Lc;Rc.Matrix&&Rc.Matrix;class Vy{constructor(e){U(this,"_errorListener");this._errorListener=e}new({rows:e,columns:t,initial_value:r}={}){return new ru(e,t,r,this._errorListener)}avg({id:e}){return e==null?void 0:e.avg()}col({id:e,column:t}){return e==null?void 0:e.col({column:t})}det({id:e}){return e==null?void 0:e.det()}get({id:e,row:t,column:r}){return e==null?void 0:e.get({row:t,column:r})}inv({id:e}){return e==null?void 0:e.inv()}max({id:e}){return e==null?void 0:e.max()}min({id:e}){return e==null?void 0:e.min()}pow({id:e,power:t}){return e==null?void 0:e.pow({power:t})}row({id:e,row:t}){return e==null?void 0:e.row({row:t})}set({id:e,row:t,column:r,value:n}){e==null||e.set({row:t,column:r,value:n})}sum({id1:e,id2:t}){return e==null?void 0:e.sum({id2:t})}copy({id:e}){return e==null?void 0:e.copy()}diff({id1:e,id2:t}){return e==null?void 0:e.diff({id2:t})}rows({id:e}){return e==null?void 0:e.rows()}columns({id:e}){return e==null?void 0:e.columns()}fill({id:e,value:t,from_row:r,to_row:n,from_column:i,to_column:a}){e==null||e.fill({value:t,from_row:r,to_row:n,from_column:i,to_column:a})}kron({id1:e,id2:t}){return e==null?void 0:e.kron({id2:t})}mode({id:e}){return e==null?void 0:e.mode()}mult({id1:e,id2:t}){return e==null?void 0:e.mult({id2:t})}pinv({id:e}){return e==null?void 0:e.pinv()}rank({id:e}){return e==null?void 0:e.rank()}sort({id:e,column:t,order:r}){e==null||e.sort({column:t,order:r})}trace({id:e}){return e==null?void 0:e.trace()}concat({id1:e,id2:t}){return e==null?void 0:e.concat({id2:t})}median({id:e}){return e==null?void 0:e.median()}add_col({id:e,column:t,array_id:r}){e==null||e.add_col({column:t,array_id:r})}add_row({id:e,row:t,array_id:r}){e==null||e.add_row({row:t,array_id:r})}is_zero({id:e}){return e==null?void 0:e.is_zero()}reshape({id:e,rows:t,columns:r},n){return e==null?void 0:e.reshape({rows:t,columns:r},n)}reverse({id:e}){e==null||e.reverse()}is_binary({id:e}){return e==null?void 0:e.is_binary()}is_square({id:e}){return e==null?void 0:e.is_square()}submatrix({id:e,from_row:t,to_row:r,from_column:n,to_column:i}){return e==null?void 0:e.submatrix({from_row:t,to_row:r,from_column:n,to_column:i})}swap_rows({id:e,row1:t,row2:r}){e==null||e.swap_rows({row1:t,row2:r})}transpose({id:e}){return e==null?void 0:e.transpose()}remove_col({id:e,column:t}){return e==null?void 0:e.remove_col({column:t})}remove_row({id:e,row:t}){return e==null?void 0:e.remove_row({row:t})}eigenvalues({id:e}){return e==null?void 0:e.eigenvalues()}is_diagonal({id:e}){return e==null?void 0:e.is_diagonal()}is_identity({id:e}){return e==null?void 0:e.is_identity()}eigenvectors({id:e}){return e==null?void 0:e.eigenvectors()}is_symmetric({id:e}){return e==null?void 0:e.is_symmetric()}swap_columns({id:e,column1:t,column2:r}){e==null||e.swap_columns({column1:t,column2:r})}is_stochastic({id:e}){return e==null?void 0:e.is_stochastic()}is_triangular({id:e}){return e==null?void 0:e.is_triangular()}elements_count({id:e}){return e==null?void 0:e.elements_count()}is_antidiagonal({id:e}){return e==null?void 0:e.is_antidiagonal()}is_antisymmetric({id:e}){return e==null?void 0:e.is_antisymmetric()}}class ru{constructor(e=0,t=0,r=void 0,n){U(this,"_matrixInstance");U(this,"_errorListener");this._matrixInstance=this._createMatrix(e,t,r),this._errorListener=n}get _matrixArray(){return this._matrixInstance.map(e=>[...e._value])}get _value(){return this._matrixInstance}set _value(e){this._matrixInstance=e}get isMatrix(){return!0}_createMatrix(e,t,r){return Array.from(new Array(e),()=>new it(t,r,this._errorListener))}avg(){let e=0,t=0;for(const n of this._matrixInstance)for(const i of n._value)e+=me(i)?0:i,t+=1;return e/t}col({column:e}){const t=[],r=new it(0,void 0,this._errorListener);if(me(e))return r;for(const n of this._matrixInstance)t.push(n._value[e]);return r._value=t,r}det(){return Ec(this._matrixArray)}get({row:e,column:t}){var r,n;if(!(me(e)||me(t)))return(n=(r=this._matrixInstance[e])==null?void 0:r._value)==null?void 0:n[t]}inv(){const e=mo(this._matrixArray);return this._newMatrix(e)}max(){return zx(this._matrixArray)}min(){return Xa(this._matrixArray)}pow({power:e}){const t=me(e)?this._matrixArray:Ux(this._matrixArray,e);return this._newMatrix(t)}row({row:e}){return me(e)?new it(0,void 0,this._errorListener):this._matrixInstance[e]}set({row:e,column:t,value:r}){me(e)||me(t)||this._matrixInstance[e].set({index:t,value:r})}sum({id2:e}){const t=fs(this._matrixArray,typeof e=="number"?e:e._matrixArray);return this._newMatrix(t)}copy(){return this._newMatrix(this._matrixArray)}diff({id2:e}){const t=Tx(this._matrixArray,typeof e=="number"?e:e._matrixArray);return this._newMatrix(t)}rows(){return this._matrixInstance.length}columns(){return this._matrixArray.length&&this._matrixArray[0].length}fill({value:e,from_row:t,to_row:r,from_column:n,to_column:i}={}){me(t)&&(t=0),me(r)&&(r=this.rows()),me(n)&&(n=0),me(i)&&(i=this.columns());for(const[a,u]of this._matrixInstance.entries())for(const[c]of u._value.entries())a<r&&a>=t&&c>=n&&c<i&&u.set({index:c,value:e})}kron({id2:e}){const t=Ox(this._matrixArray,e._matrixArray);return this._newMatrix(t)}mode(){return Xa(gc(this._matrixArray))}mult({id2:e}){const t=typeof e=="number"?e:e._matrixArray?e._matrixArray:e._value,r=Bi(this._matrixArray,t);return this._newMatrix(r)}pinv(){const e=qx(this._matrixArray);return this._newMatrix(e)}rank(){return this._matrixRank(this._matrixArray)}sort({column:e,order:t=Qn.ascending}={}){me(e)&&(e=0),this._matrixInstance.sort((r,n)=>{const i=r._value[e],a=n._value[e];return t!==Qn.descending?i-a:a-i})}trace(){return kx(this._matrixArray)}concat({id2:e}){for(const t of e._value)this._matrixInstance.push(t);return this}median(){return Ac(this._matrixArray)}add_col({column:e,array_id:t}={}){me(e)&&(e=this.columns());for(const[r,n]of this._matrixInstance.entries())n.insert({index:e,value:t?t._value[r]:void 0})}add_row({row:e,array_id:t}){me(e)&&(e=this.rows()),this._matrixInstance.splice(e,0,t||new it(this.columns(),void 0,this._errorListener))}is_zero(){return this._matrixArray.every(e=>e.every(t=>t===0))}reshape({rows:e=0,columns:t=0},r){if(e*t!==this.columns()*this.rows()){this._errorListener.addError("New matrix must be of same area as original matrix",r,Ve.Error);return}const n=Bx(this._matrixArray,[e,t]);this._matrixInstance=n.map(i=>{const a=new it(0,void 0,this._errorListener);return a._value=[...i],a})}reverse(){this._matrixInstance.reverse();for(const e of this._matrixInstance)e.reverse()}is_binary(){return this._matrixArray.every(e=>e.every(t=>t===0||t===1))}is_square(){return this.rows()===this.columns()}submatrix({from_row:e,to_row:t,from_column:r,to_column:n}={}){me(e)&&(e=0),me(t)&&(t=this.rows()),me(r)&&(r=0),me(n)&&(n=this.columns());const i=this._matrixArray.splice(e,t),a=[];for(const u of i)a.push(u.splice(r,n));return this._newMatrix(a)}swap_rows({row1:e,row2:t}){if(me(e)||me(t))return;const r=this._matrixInstance[e],n=this._matrixInstance[t];this._matrixInstance[e]=n,this._matrixInstance[t]=r}transpose(){const e=xc(this._matrixArray);return this._newMatrix(e)}remove_col({column:e}={}){me(e)&&(e=this.columns());const t=[];for(const n of this._matrixInstance){const i=n._value.splice(e,1);t.push(i[0])}const r=new it(0,void 0,this._errorListener);return r._value=t,r}remove_row({row:e}={}){return me(e)&&(e=this.rows()),this._matrixInstance.splice(e,1)[0]}eigenvalues(){const e=new Pc(new kc(this._matrixArray)),t=new it(0,void 0,this._errorListener);return t._value=e.realEigenvalues,t}is_diagonal(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<t;i++)if(n!==i&&r[n][i]!==0)return!1;return!0}is_identity(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<t;i++)if(n!==i&&r[n][i]!==0||n===i&&r[n][i]!==1)return!1;return!0}eigenvectors(){const e=new Pc(new kc(this._matrixArray));return this._newMatrix(e.eigenvectorMatrix.to2DArray())}is_symmetric(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=n+1;i<t;i++)if(r[n][i]!==r[i][n])return!1;return!0}swap_columns({column1:e,column2:t}){if(!(me(e)||me(t)))for(const r of this._matrixInstance){const n=r._value[e],i=r._value[t];r.set({index:e,value:i}),r.set({index:t,value:n})}}is_stochastic(){const e=this._matrixArray;for(let t=0;t<e.length;t++){let r=0;for(let n=0;n<e[t].length;n++){if(e[t][n]<0)return!1;r+=e[t][n]}if(Math.abs(r-1)>Number.EPSILON)return!1}return!0}is_triangular(){const e=this.rows(),t=this.columns();return e!==t?!1:this._isUpperTriangular(e)||this._isLowerTriangular(e)}elements_count(){return Mx(this._matrixArray)}is_antidiagonal(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<e;i++)if(n+i!==e-1&&r[n][i]!==0)return!1;return!0}is_antisymmetric(){const e=this.rows(),t=this.columns();if(e!==t)return!1;const r=this._matrixArray;for(let n=0;n<e;n++)for(let i=0;i<e;i++)if(n!==i&&r[n][i]!==-r[i][n])return!1;return!0}_isUpperTriangular(e){const t=this._matrixArray;for(let r=1;r<e;r++)for(let n=0;n<r;n++)if(t[r][n]!==0)return!1;return!0}_isLowerTriangular(e){const t=this._matrixArray;for(let r=0;r<e-1;r++)for(let n=r+1;n<e;n++)if(t[r][n]!==0)return!1;return!0}_newMatrix(e){const t=new ru(0,0,void 0,this._errorListener);return t._value=e.map(r=>{const n=new it(0,void 0,this._errorListener);return n._value=[...r],n}),t}_matrixRank(e){let t=0;const r=e.length,n=e[0].length,i=[...e].map(a=>[...a]);for(let a=0;a<r&&!(a>=n);a++){let u=a;for(;u<r&&i[u][a]===0;)u++;if(u===r)continue;if(u!==a){const f=i[u];i[u]=i[a],i[a]=f}const c=i[a][a];for(let f=0;f<n;f++)i[a][f]/=c;for(let f=a+1;f<r;f++){const h=i[f][a];i[f]=i[f].map((d,p)=>d-h*i[a][p]),i[f][a]=0}}for(let a=0;a<r;a++)i[a].some(u=>Number(u.toFixed(8))!==0)&&t++;return t}}class Gy{constructor(e){U(this,"_variables");U(this,"_cacheData");this._variables=e,this._cacheData={}}change({timeframe:e},t){if(!e)return!0;const r=pn(e),n=pn(this._variables.timeframe.period);if(r<n)return!0;const i=`change_${t}`,a=this._cacheData[i],u=this._variables.time;if(a){if(a.offset){if(a.currentTime+a.offset<=u)return this._cacheData[i]={currentTime:u,offset:0},!0}else if(a.currentTime+r*1e3<=u)return this._cacheData[i]={currentTime:u,offset:0},!0}else{const c=this._calcTimeOffset(u,e);return this._cacheData[i]={currentTime:u,offset:c},!1}return!1}in_seconds({timeframe:e}={}){return pn(e||this._variables.timeframe.period)}from_seconds({seconds:e=0}){const t=e*1e3,r=ot.duration(t);if(r.years())return"12M";const i=r.asMonths();if(vo(i))return`${i}M`;const a=r.asWeeks();if(vo(a))return`${a}M`;const u=r.asDays();if(u>=1)return`${Math.ceil(u)}D`;const c=r.asMinutes();if(c>=1)return`${Math.ceil(c)}`;const f=r.asSeconds();return f<=1?"1S":f<=5?"5S":f<=10?"10S":f<=15?"15S":f<=30?"30S":"1"}_calcTimeOffset(e,t){let r=0;if(t.includes("W")){const u=ot(e).day();t="1D",u!==1&&(r=(8-u)*60*60*24*1e3)}else if(t.includes("M")){const u=ot(e).date();t="1D";const c=ot(e).daysInMonth();u!==1&&(r=(c-u+1)*60*60*24*1e3)}const n=this._variables.getTimeTradingday(e,t),i=pn(t)*1e3,a=e-n-Math.floor((e-n)/i)*i;return r?r-a:a}}class Ky{constructor(e,t){U(this,"_errorListener");U(this,"_intlNumberFormatter");U(this,"_precision");this._errorListener=e,this._precision=t,this._intlNumberFormatter=new Intl.NumberFormat("en",{notation:"compact"})}pos({source:e="",str:t=""}){return e==null?void 0:e.indexOf(t)}trim({source:e=""}){return e==null?void 0:e.trim()}lower({source:e=""}){return e==null?void 0:e.toLocaleLowerCase()}match({source:e="",regex:t=""}){const r=e==null?void 0:e.match(new RegExp(t));return r?r[0]:""}split({string:e="",separator:t=""}){const r=e==null?void 0:e.split(t),n=new it;return n._value=r||[],n}upper({source:e=""}){return e==null?void 0:e.toLocaleUpperCase()}format({formatString:e=""},t){return this._strFormat(e,t)}length({string:e=""}){return e==null?void 0:e.length}repeat({source:e="",repeat:t,separator:r=""},n){if(me(t)){this._errorListener.addError("Invalid array length",n,Ve.Error);return}return Array.from(new Array(t),()=>e).join(r)}replace({source:e="",target:t="",replacement:r="",occurrence:n}){me(n)&&(n=0);let i=-1;for(let a=0;a<n+1&&(i=e.indexOf(t,i+1),i!==-1);a++);return i!==-1?e.substring(0,i)+r+e.substring(i+t.length):e}contains({source:e="",str:t=""}){return e==null?void 0:e.includes(t)}endswith({source:e="",str:t=""}){return e==null?void 0:e.endsWith(t)}tonumber({string:e=""}){if(/[^\d.]/.test(e))return;const t=parseFloat(e);return isNaN(t)?void 0:t}tostring({value:e,format:t}){if(e===void 0)return"NaN";if(typeof e=="object"){if(e.isArray)return this._arrToStr(e._value,t);if(e.isMatrix){const r=[];for(const n of e._matrixArray)r.push(this._arrToStr(n,t));return r.join(`
62
+ `)}}if(typeof e=="string")return e;if(typeof e=="boolean")return String(e);if(typeof e=="number")return String(this._toStringFormat(e,t))}_arrToStr(e,t){return`[${e.map(n=>typeof n=="number"?this._toStringFormat(n,t):n).toString()}]`}substring({source:e="",begin_pos:t=0,end_pos:r}){return me(t)&&(t=0),me(r)&&(r=void 0),e==null?void 0:e.substring(t,r)}startswith({source:e="",str:t=""}){return e==null?void 0:e.startsWith(t)}format_time({time:e,format:t="yyyy-MM-dd'T'HH:mm:ssZ",timezone:r}){return me(e)&&(e=0),Zr(e,r).format(t)}replace_all({source:e="",target:t="",replacement:r=""}){return e==null?void 0:e.replace(new RegExp(t,"g"),r)}_toStringFormat(e,t){if(!t)return e;switch(t){case Je.mintick:return e.toFixed(this._precision);case Je.price:return`${e}%`;case Je.volume:return this._intlNumberFormatter.format(Math.round(e));default:const[r,n]=t.split(".");let[i,a=""]=String(e).split(".");if(r.includes("#")?i=r.replace(/#/,i).replace(/#/g,""):i=`${r}${i}`,n&&n.includes("#")){const u=n.split("#").length-1;a=`${a.substring(0,u)}${n.replace(/#/g,"")}`}else a=n||"";return a?`${i}.${a}`:i}}_formatNumber(e,t){if(!t)return e;switch(t){case"integer":return String(Math.round(e));case"currency":return`$${e}`;case"percent":return`${e*100}%`;default:const r=t.split(".")[1],n=r?r.length:0;return parseFloat(e.toFixed(n))}}_strFormat(e,t){let r=e;return t.forEach((n,i)=>{if(typeof n=="number"){const a=`\\{\\s*${i}\\s*,\\s*number\\s*,\\s*([^\\}]+)\\s*\\}`,u=e.match(new RegExp(a));if(u){const c=u[1];r=r.replace(new RegExp(a,"g"),String(this._formatNumber(n,c)))}else r=r.replace(new RegExp(`\\{${i}\\}`,"g"),String(n))}else r=r.replace(new RegExp(`\\{${i}\\}`,"g"),n)}),r}}class Xy{constructor(e){U(this,"_errorListener");this._errorListener=e}new(){return new nu(this._errorListener)}copy({id:e}){return e==null?void 0:e.copy()}get({id:e,key:t}){return e==null?void 0:e.get({key:t})}put({id:e,key:t,value:r}){return e==null?void 0:e.put({key:t,value:r})}keys({id:e}){return e==null?void 0:e.keys()}size({id:e}){return e==null?void 0:e.size()}clear({id:e}){e==null||e.clear()}remove({id:e,key:t}){return e==null?void 0:e.remove({key:t})}values({id:e}){return e==null?void 0:e.values()}put_all({id:e,id2:t}){e==null||e.put_all({id2:t})}contains({id:e,key:t}){return e==null?void 0:e.contains({key:t})}}class nu{constructor(e){U(this,"_errorListener");U(this,"_mapInstance");this._errorListener=e,this._mapInstance=new Map}get isMap(){return!0}_copyMap(e){const t=new nu(this._errorListener);return t._mapInstance=new Map(e.entries()),t}copy(){return this._copyMap(this._mapInstance)}get({key:e}){return this._mapInstance.get(e)}put({key:e,value:t}){return this._mapInstance.set(e,t)}keys(){const e=new it(0,void 0,this._errorListener);return e._value=[...this._mapInstance.keys()],e}size(){return this._mapInstance.size}clear(){this._mapInstance.clear()}remove({key:e}){const t=this._mapInstance.get(e);return this._mapInstance.delete(e),t||void 0}values(){const e=new it(0,void 0,this._errorListener);return e._value=[...this._mapInstance.values()],e}put_all({id2:e}){this._mapInstance=new Map([...this._mapInstance,...e._mapInstance])}contains({key:e}){return this._mapInstance.has(e)}}class Qy{constructor(e){U(this,"_variables");this._variables=e}new({price:e,time:t,index:r}){return new si(e,r,t)}now({price:e}){const{time:t,bar_index:r}=this._variables;return new si(e,r,t)}copy({id:e}){const{price:t,time:r,index:n}=e||{};return new si(t,n,r)}from_index({price:e,index:t}){return new si(e,t)}from_time({price:e,time:t}){return new si(e,void 0,t)}}class si{constructor(e,t,r){U(this,"_index");U(this,"_price");U(this,"_time");this._index=t,this._price=e,this._time=r}get index(){return this._index}get price(){return this._price}get time(){return this._time}copy(){return new si(this._price,this._index,this._time)}}class Jy{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultLabel",{text:"",xloc:wt.bar_index,yloc:Kr.price,size:ar.normal,style:vt.styleLabelDown,textalign:je.alignCenter});this._variables=e,this._errorListener=t}new(e,t){const{time:r,high:n,low:i,bar_index:a}=this._variables,u=`label_${t}_${a}`,c={...this._defaultLabel,...e,id:u,time:r};e.point&&(c.x=c.xloc===wt.bar_index?e.point.index:e.point.time,c.y=e.point.price),c.yloc===Kr.abovebar?c.y=n:c.yloc===Kr.belowbar&&(c.y=i),this._verfiyArgs(e,t);const f=new hs(u,this._variables,this._errorListener);return t.startsWith("export")||this._variables.label.add(u,c,f),f}_verfiyArgs(e,t){const{xloc:r,yloc:n,style:i,size:a,textalign:u,text_font_family:c}=e,f="label.new";this._paramVerfiy(i,t,f,Object.values(vt),"style"),this._paramVerfiy(r,t,f,Object.values(wt),"xloc"),this._paramVerfiy(n,t,f,Object.values(Kr),"yloc"),this._paramVerfiy(a,t,f,Object.values(ar),"size"),this._paramVerfiy(u,t,f,[je.alignLeft,je.alignCenter,je.alignRight],"textalign"),this._paramVerfiy(c,t,f,Object.values(Jn),"text_font_family")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}label(e,t){return e.x?e.x:new hs(t,this._variables,this._errorListener)}copy({id:e},t){return e==null?void 0:e.copy(t)}get_x({id:e},t){return e==null?void 0:e.get_x(t)}get_y({id:e},t){return e==null?void 0:e.get_y(t)}set_x({id:e,...t},r){e==null||e.set_x(t,r)}set_y({id:e,...t},r){e==null||e.set_y(t,r)}delete({id:e}){e==null||e.delete()}get_text({id:e},t){return e==null?void 0:e.get_text(t)}set_xy({id:e,...t},r){e==null||e.set_xy(t,r)}set_size({id:e,...t},r){e==null||e.set_size(t,r)}set_xloc({id:e,...t},r){e==null||e.set_xloc(t,r)}set_yloc({id:e,...t},r){e==null||e.set_yloc(t,r)}set_style({id:e,...t},r){e==null||e.set_style(t,r)}set_color({id:e,...t},r){e==null||e.set_color(t,r)}set_tooltip({id:e,...t},r){e==null||e.set_tooltip(t,r)}set_point({id:e,...t},r){e==null||e.set_point(t,r)}set_text({id:e,...t},r){e==null||e.set_text(t,r)}set_textcolor({id:e,...t},r){e==null||e.set_textcolor(t,r)}set_textalign({id:e,...t},r){e==null||e.set_textalign(t,r)}set_text_font_family({id:e,...t},r){e==null||e.set_text_font_family(t,r)}}class hs{constructor(e,t,r){U(this,"_id");U(this,"_variables");U(this,"_errorListener");this._id=e,this._variables=t,this._errorListener=r}copy(e){const t=`label_${e}_${this._variables.bar_index}`,r=this._getLabel(e),n=new hs(t,this._variables,this._errorListener);if(r){const i={...r,id:t};this._variables.label.add(t,i,n)}return n}get_x(e){var t;return(t=this._getLabel(e))==null?void 0:t.x}get_y(e){var t;return(t=this._getLabel(e))==null?void 0:t.y}set_x({x:e},t){const r=this._getLabel(t);r&&(r.x=e)}set_y({y:e},t){const r=this._getLabel(t);r&&(r.y=e)}delete(){this._variables.label.delete(this._id)}set_xy({x:e,y:t},r){const n=this._getLabel(r);n&&(n.x=e,n.y=t)}get_text(e){var t;return(t=this._getLabel(e))==null?void 0:t.text}set_size({size:e},t){const r=this._getLabel(t);r&&(r.size=e),this._paramVerfiy(e,t,"label.set_size",Object.values(ar),"size")}set_text({text:e},t){const r=this._getLabel(t);r&&(r.text=e)}set_xloc({x:e,xloc:t},r){const n=this._getLabel(r);n&&(n.x=e,n.xloc=t,this._paramVerfiy(t,r,"label.set_xloc",Object.values(wt),"xloc"))}set_yloc({yloc:e},t){const r=this._getLabel(t),{high:n,low:i}=this._variables;r&&(r.yloc=e,e===Kr.abovebar?r.y=n:e===Kr.belowbar&&(r.y=i),this._paramVerfiy(e,t,"label.set_yloc",Object.values(Kr),"yloc"))}set_color({color:e},t){const r=this._getLabel(t);r&&(r.color=e)}set_point({point:e},t){const r=this._getLabel(t);r&&(r.x=r.xloc===wt.bar_index?e==null?void 0:e.index:e==null?void 0:e.time,r.y=e==null?void 0:e.price)}set_style({style:e},t){const r=this._getLabel(t);r&&(r.style=e),this._paramVerfiy(e,t,"label.set_style",Object.values(vt),"style")}set_tooltip({tooltip:e},t){const r=this._getLabel(t);r&&(r.tooltip=e)}set_textalign({textalign:e},t){const r=this._getLabel(t);r&&(r.textalign=e),this._paramVerfiy(e,t,"label.set_textalign",[je.alignLeft,je.alignCenter,je.alignRight],"textalign")}set_textcolor({textcolor:e},t){const r=this._getLabel(t);r&&(r.textcolor=e)}set_text_font_family({text_font_family:e},t){const r=this._getLabel(t);r&&(r.text_font_family=e),this._paramVerfiy(e,t,"label.set_text_font_family",Object.values(Jn),"text_font_family")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getLabel(e){const t=this._variables.label.get(this._id);return t||console.log(`错误${e}: label 不存在`),t}}const eD={freq_all:Vr.freqAll,freq_once_per_bar:Vr.freqOncePerBar,freq_once_per_bar_close:Vr.freqOncePerBarClose},tD={gaps_off:ns.gapsOff,gaps_on:ns.gapsOn,lookahead_off:ns.lookaheadOff,lookahead_on:ns.lookaheadOn},Ii={aqua:"#00BCD4",black:"#363A45",blue:"#2196F3",fuchsia:"#E040FB",gray:"#787B86",green:"#4CAF50",lime:"#00E676",maroon:"#880E4F",navy:"#311B92",olive:"#808000",orange:"#FF9800",purple:"#9C27B0",red:"#FF5252",silver:"#B2B5BE",teal:"#00897B",white:"#FFFFFF",yellow:"#FFEB3B"},zc={AUD:"AUD",BTC:"BTC",CAD:"CAD",CHF:"CHF",ETH:"ETH",EUR:"EUR",GBP:"GBP",HKD:"HKD",INR:"INR",JPY:"JPY",KRW:"KRW",MYR:"MYR",NOK:"NOK",NONE:"NONE",NZD:"NZD",RUB:"RUB",SEK:"SEK",SGD:"SGD",TRY:"TRY",USD:"USD",USDT:"USDT",ZAR:"ZAR"},rD={friday:6,monday:2,saturday:7,sunday:1,thursday:5,tuesday:3,wednesday:4},qc={all:[Zt.dataWindow,Zt.pane,Zt.priceScale,Zt.statusLine],data_window:[Zt.dataWindow],none:[],pane:[Zt.pane],price_scale:[Zt.priceScale],status_line:[Zt.statusLine]},nD={both:Gr.both,left:Gr.left,none:Gr.none,right:Gr.right},iD={inherit:Je.inherit,mintick:Je.mintick,percent:Je.percent,price:Je.price,volume:Je.volume},sD={style_solid:ks.styleSolid,style_dashed:ks.styleDashed,style_dotted:ks.styleDotted},oD={style_arrowdown:vt.styleArrowdown,style_arrowup:vt.styleArrowup,style_circle:vt.styleCircle,style_cross:vt.styleCross,style_diamond:vt.styleDiamond,style_flag:vt.styleFlag,style_label_center:vt.styleLabelCenter,style_label_down:vt.styleLabelDown,style_label_left:vt.styleLabelLeft,style_label_lower_left:vt.styleLabelLowerLeft,style_label_lower_right:vt.styleLabelLowerRight,style_label_right:vt.styleLabelRight,style_label_up:vt.styleLabelUp,style_label_upper_left:vt.styleLabelUpperLeft,style_label_upper_right:vt.styleLabelUpperRight,style_none:vt.styleNone,style_square:vt.styleSquare,style_text_outline:vt.styleTextOutline,style_triangledown:vt.styleTriangledown,style_triangleup:vt.styleTriangleup,style_xcross:vt.styleXcross},aD={style_arrow_both:zt.styleArrowBoth,style_arrow_left:zt.styleArrowLeft,style_arrow_right:zt.styleArrowRight,style_dashed:zt.styleDashed,style_dotted:zt.styleDotted,style_solid:zt.styleSolid},uD={abovebar:_n.abovebar,absolute:_n.absolute,belowbar:_n.belowbar,bottom:_n.bottom,top:_n.top},lD={e:2.718281828459045,phi:1.618033988749895,pi:3.141592653589793,rphi:.6180339887498948},fD={style_area:Or.styleArea,style_areabr:Or.styleAreabr,style_circles:Or.styleCircles,style_columns:Or.styleColumns,style_cross:Or.styleCross,style_histogram:Or.styleHistogram,style_line:Or.styleLine,style_linebr:Or.styleLinebr,style_stepline:Or.styleStepline,style_stepline_diamond:Or.styleSteplineDiamond,style_steplinebr:Or.styleSteplinebr},cD={bottom_center:br.bottomCenter,bottom_left:br.bottomLeft,bottom_right:br.bottomRight,middle_center:br.middleCenter,middle_left:br.middleLeft,middle_right:br.middleRight,top_center:br.topCenter,top_left:br.topLeft,top_right:br.topRight},hD={left:zs.left,none:zs.none,right:zs.right},dD={arrowdown:_r.arrowdown,arrowup:_r.arrowup,circle:_r.circle,cross:_r.cross,diamond:_r.diamond,flag:_r.flag,labeldown:_r.labeldown,labelup:_r.labelup,square:_r.square,triangledown:_r.triangledown,triangleup:_r.triangleup,xcross:_r.xcross},pD={auto:ar.auto,huge:ar.huge,large:ar.large,normal:ar.normal,small:ar.small,tiny:ar.tiny},_D={cash:Lt.cash,fixed:Lt.fixed,percent_of_equity:Lt.percentOfEquity,commission:{cash_per_contract:Ir.cashPerContract,cash_per_order:Ir.cashPerOrder,percent:Ir.percent},direction:{all:gt.all,long:gt.long,short:gt.short},oca:{cancel:vn.cancel,none:vn.none,reduce:vn.reduce}},vD={align_bottom:je.alignBottom,align_center:je.alignCenter,align_left:je.alignLeft,align_right:je.alignRight,align_top:je.alignTop,wrap_auto:je.wrapAuto,wrap_none:je.wrapNone},gD={bar_index:wt.bar_index,bar_time:wt.bar_time},mD={abovebar:Kr.abovebar,belowbar:Kr.belowbar,price:Kr.price},xD={actual:Us.actual,estimate:Us.estimate,standardized:Us.standardized};class Uc{constructor(){U(this,"adjustment",{dividends:Ps.dividends,none:Ps.none,splits:Ps.splits});U(this,"alert",eD);U(this,"barmerge",tD);U(this,"color",Ii);U(this,"currency",zc);U(this,"dayofweek",rD);U(this,"earnings",xD);U(this,"display",qc);U(this,"extend",nD);U(this,"font",{family_default:Jn.familyDefault,family_monospace:Jn.familyMonospace});U(this,"format",iD);U(this,"hline",sD);U(this,"label",oD);U(this,"line",aD);U(this,"location",uD);U(this,"math",lD);U(this,"order",{ascending:Qn.ascending,descending:Qn.descending});U(this,"plot",fD);U(this,"position",cD);U(this,"scale",hD);U(this,"session",{extended:qs.extended,regular:qs.regular});U(this,"shape",dD);U(this,"size",pD);U(this,"splits",{denominator:"denominator",numerator:"numerator"});U(this,"strategy",_D);U(this,"text",vD);U(this,"xloc",gD);U(this,"yloc",mD)}updateData(){}}class yD{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultPolyline",{curved:!1,closed:!1,xloc:wt.bar_index,line_color:Ii.blue,line_style:zt.styleSolid,line_width:1});this._variables=e,this._errorListener=t}new(e,t){var a;const r=`polyline_${t}_${this._variables.bar_index}`,n=Object.assign({},this._defaultPolyline,e,{id:r,points:(a=e.points)==null?void 0:a._value.map(u=>({time:u.time,index:u.index,price:u.price}))}),i=new Wc(r,this._variables);return this._verfiyArgs(e,t),t.startsWith("export")||this._variables.polyline.add(r,n,i),i}_verfiyArgs(e,t){const{line_style:r,xloc:n}=e,i="polyline.new";this._paramVerfiy(r,t,i,Object.values(zt),"line_style"),this._paramVerfiy(n,t,i,Object.values(wt),"xloc")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}delete({id:e}){e&&e.delete()}}class Wc{constructor(e,t){U(this,"_id");U(this,"_variables");this._variables=t,this._id=e}delete(){this._variables.polyline.delete(this._id)}}class DD{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultLine",{xloc:wt.bar_index,extend:Gr.none,style:zt.styleSolid});this._variables=e,this._errorListener=t}new({first_point:e,second_point:t,...r},n){const i=`line_${n}_${this._variables.bar_index}`,a={...this._defaultLine,...r,id:i};if(e&&t){const c=a.xloc===wt.bar_index?e.index:e.time,f=a.xloc===wt.bar_index?t.index:t.time;Object.assign(a,{x1:c,y1:e.price,x2:f,y2:t.price})}this._verfiyArgs(r,n);const u=new ds(i,this._variables,this._errorListener);return n.startsWith("export")||this._variables.line.add(i,a,u),u}_verfiyArgs(e,t){const{extend:r,xloc:n,style:i}=e,a="line.new";this._paramVerfiy(i,t,a,Object.values(zt),"style"),this._paramVerfiy(r,t,a,Object.values(Gr),"extend"),this._paramVerfiy(n,t,a,Object.values(wt),"xloc")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}line(e,t){return e.x?e.x:new ds(t,this._variables,this._errorListener)}copy({id:e},t){return e==null?void 0:e.copy(t)}delete({id:e}){e==null||e.delete()}get_x1({id:e},t){return e==null?void 0:e.get_x1(t)}get_x2({id:e},t){return e==null?void 0:e.get_x2(t)}get_y1({id:e},t){return e==null?void 0:e.get_y1(t)}get_y2({id:e},t){return e==null?void 0:e.get_y2(t)}set_x1({id:e,...t},r){e==null||e.set_x1(t,r)}set_x2({id:e,...t},r){e==null||e.set_x2(t,r)}set_y1({id:e,...t},r){e==null||e.set_y1(t,r)}set_y2({id:e,...t},r){e==null||e.set_y2(t,r)}set_xy1({id:e,...t},r){e==null||e.set_xy1(t,r)}set_xy2({id:e,...t},r){e==null||e.set_xy2(t,r)}set_xloc({id:e,...t},r){e==null||e.set_xloc(t,r)}get_price({id:e,...t},r){return e==null?void 0:e.get_price(t,r)}set_color({id:e,...t},r){e==null||e.set_color(t,r)}set_style({id:e,...t},r){e==null||e.set_style(t,r)}set_width({id:e,...t},r){e==null||e.set_width(t,r)}set_extend({id:e,...t},r){e==null||e.set_extend(t,r)}set_first_point({id:e,...t},r){e==null||e.set_first_point(t,r)}set_second_point({id:e,...t},r){e==null||e.set_second_point(t,r)}}class ds{constructor(e,t,r){U(this,"_variables");U(this,"_id");U(this,"_errorListener");this._id=e,this._variables=t,this._errorListener=r}get data(){return this._variables.line.get(this._id)}copy(e){const t=`line_${e}_${this._variables.bar_index}`,r=this._getLine(e),n=new ds(t,this._variables,this._errorListener);return r&&this._variables.line.add(t,{...r,id:t},n),n}delete(){this._variables.line.delete(this._id)}get_price({x:e},t){const r=this._getLine(t);if(e===void 0)return e;if(r&&r.xloc===wt.bar_index){const{x1:n,y1:i,x2:a,y2:u}=r;return n===void 0||a===void 0||i===void 0||u===void 0?void 0:(u-i)/(a-n)*(e-n)+i}}get_x1(e){var t;return(t=this._getLine(e))==null?void 0:t.x1}get_x2(e){var t;return(t=this._getLine(e))==null?void 0:t.x2}get_y1(e){var t;return(t=this._getLine(e))==null?void 0:t.y1}get_y2(e){var t;return(t=this._getLine(e))==null?void 0:t.y2}set_x1({x:e},t){const r=this._getLine(t);r&&(r.x1=e)}set_x2({x:e},t){const r=this._getLine(t);r&&(r.x2=e)}set_y1({y:e},t){const r=this._getLine(t);r&&(r.y1=e)}set_y2({y:e},t){const r=this._getLine(t);r&&(r.y2=e)}set_xy1({x:e,y:t},r){const n=this._getLine(r);n&&(n.x1=e,n.y1=t)}set_xy2({x:e,y:t},r){const n=this._getLine(r);n&&(n.x2=e,n.y2=t)}set_xloc({xloc:e,x1:t,x2:r},n){const i=this._getLine(n);i&&(i.xloc=e,i.x1=t,i.x2=r,this._paramVerfiy(e,n,"line.set_xloc",Object.values(wt),"xloc"))}set_color({color:e},t){const r=this._getLine(t);r&&(r.color=e)}set_style({style:e},t){const r=this._getLine(t);r&&(r.style=e,this._paramVerfiy(e,t,"line.set_style",Object.values(zt),"style"))}set_width({width:e},t){const r=this._getLine(t);r&&(r.width=e)}set_extend({extend:e},t){const r=this._getLine(t);r&&(r.extend=e,this._paramVerfiy(e,t,"line.set_extend",Object.values(Gr),"extend"))}set_first_point({point:e},t){const r=this._getLine(t);if(r){const{index:n,time:i,price:a}=e||{},u=r.xloc===wt.bar_index?n:i,c=a;u&&(r.x1=u),c&&(r.y1=c)}}set_second_point({point:e},t){const r=this._getLine(t);if(r){const{index:n,time:i,price:a}=e||{},u=r.xloc===wt.bar_index?n:i,c=a;u&&(r.x2=u),c&&(r.y2=c)}}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getLine(e){const t=this._variables.line.get(this._id);return t||console.log(`${e}: line 不存在`),t}}class wD{constructor(e){U(this,"_variables");this._variables=e}new({line1:e,line2:t,color:r},n){const i=`linefill_${n}_${this._variables.bar_index}`,a=e==null?void 0:e.data,u=t==null?void 0:t.data;a&&(a.linefills=a.linefills||[],a.linefills.push(i)),u&&(u.linefills=u.linefills||[],u.linefills.push(i));const c=new Fo(this._variables,i,e,t);return n.startsWith("export")||(a||u)&&this._variables.linefill.add(i,{line1:a,line2:u,color:r,id:i},c),c}delete({id:e}){e==null||e.delete()}get_line1({id:e}){return e==null?void 0:e.get_line1()}get_line2({id:e}){return e==null?void 0:e.get_line2()}set_color({id:e,...t}){e==null||e.set_color(t)}}class Fo{constructor(e,t,r,n){U(this,"_id");U(this,"_line1");U(this,"_line2");U(this,"_variables");this._variables=e,this._id=t,this._line1=r,this._line2=n}linefill(e,t){return e.x?e.x:new Fo(this._variables,t)}delete(){var t,r;const e=this._variables.linefill.get(this._id);if(e){const{line1:n,line2:i}=e;n&&(n.linefills=(t=n.linefills)==null?void 0:t.filter(a=>a!==this._id)),i&&(i.linefills=(r=i.linefills)==null?void 0:r.filter(a=>a!==this._id))}this._line1=void 0,this._line2=void 0,this._variables.linefill.delete(this._id)}get_line1(){return this._line1}get_line2(){return this._line2}set_color({color:e}){const t=this._variables.linefill.get(this._id);t&&(t.color=e)}}class bD{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultBox",{border_color:Ii.blue,border_width:1,bgcolor:Ii.blue,xloc:wt.bar_index,extend:Gr.none,style:zt.styleSolid,text:"",text_size:ar.auto,text_color:Ii.black,text_halign:je.alignCenter,text_valign:je.alignCenter,text_wrap:je.wrapNone});this._variables=e,this._errorListener=t}box({x:e},t){return e===void 0?new ps(this._variables,t,this._errorListener):e}new({top_left:e,bottom_right:t,...r},n){const i=`box_${n}_${this._variables.bar_index}`,a={...this._defaultBox,...r,id:i};if(e){const{price:c,time:f,index:h}=e;a.top=c,a.left=a.xloc===wt.bar_index?h:f}if(t){const{price:c,time:f,index:h}=t;a.bottom=c,a.right=a.xloc===wt.bar_index?h:f}this._verfiyArgs(r,n);const u=new ps(this._variables,i,this._errorListener);return n.startsWith("export")||this._variables.box.add(i,a,u),u}_verfiyArgs(e,t){const{border_style:r,extend:n,xloc:i,text_size:a,text_halign:u,text_valign:c,text_wrap:f,text_font_family:h}=e,d="box.new";this._paramVerfiy(r,t,d,[zt.styleDashed,zt.styleDotted,zt.styleSolid],"border_style"),this._paramVerfiy(n,t,d,Object.values(Gr),"extend"),this._paramVerfiy(i,t,d,Object.values(wt),"xloc"),this._paramVerfiy(a,t,d,Object.values(ar),"text_size"),this._paramVerfiy(u,t,d,[je.alignLeft,je.alignCenter,je.alignRight],"text_halign"),this._paramVerfiy(c,t,d,[je.alignBottom,je.alignCenter,je.alignTop],"text_valign"),this._paramVerfiy(f,t,d,[je.wrapAuto,je.wrapNone],"text_wrap"),this._paramVerfiy(h,t,d,Object.values(Jn),"text_font_family")}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}copy({id:e},t){return e==null?void 0:e.copy(t)}delete({id:e}){e==null||e.delete()}get_top({id:e}){return e==null?void 0:e.get_top()}get_bottom({id:e}){return e==null?void 0:e.get_bottom()}get_left({id:e}){return e==null?void 0:e.get_left()}get_right({id:e}){return e==null?void 0:e.get_right()}set_top({id:e,...t}){e==null||e.set_top(t)}set_bottom({id:e,...t}){e==null||e.set_bottom(t)}set_left({id:e,...t}){e==null||e.set_left(t)}set_right({id:e,...t}){e==null||e.set_right(t)}set_extend({id:e,...t},r){e==null||e.set_extend(t,r)}set_bgcolor({id:e,...t}){e==null||e.set_bgcolor(t)}set_border_color({id:e,...t}){e==null||e.set_border_color(t)}set_border_width({id:e,...t}){e==null||e.set_border_width(t)}set_border_style({id:e,...t},r){e==null||e.set_border_style(t,r)}set_lefttop({id:e,...t}){e==null||e.set_lefttop(t)}set_rightbottom({id:e,...t}){e==null||e.set_rightbottom(t)}set_text_size({id:e,...t},r){e==null||e.set_text_size(t,r)}set_text_wrap({id:e,...t},r){e==null||e.set_text_wrap(t,r)}set_text_color({id:e,...t}){e==null||e.set_text_color(t)}set_text_halign({id:e,...t},r){e==null||e.set_text_halign(t,r)}set_text_valign({id:e,...t},r){e==null||e.set_text_valign(t,r)}set_top_left_point({id:e,...t}){e==null||e.set_top_left_point(t)}set_bottom_right_point({id:e,...t}){e==null||e.set_bottom_right_point(t)}set_text_font_family({id:e,...t},r){e==null||e.set_text_font_family(t,r)}}class ps{constructor(e,t,r){U(this,"_id");U(this,"_variables");U(this,"_errorListener");this._variables=e,this._id=t,this._errorListener=r}copy(e){const t=`box_${e}_${this._variables.bar_index}`,r=this._getBox(),n=new ps(this._variables,t,this._errorListener);return r&&this._variables.box.add(t,{...r,id:t},n),n}delete(){this._variables.box.delete(this._id)}get_top(){const e=this._getBox();return e&&e.top}set_top({top:e}){const t=this._getBox();t&&(t.top=e)}get_left(){const e=this._getBox();return e&&e.left}set_left({left:e}){const t=this._getBox();t&&(t.left=e)}set_text({text:e}){const t=this._getBox();t&&(t.text=e)}get_right(){const e=this._getBox();return e&&e.right}set_right({right:e}){const t=this._getBox();t&&(t.right=e)}get_bottom(){const e=this._getBox();return e&&e.bottom}set_bottom({bottom:e}){const t=this._getBox();t&&(t.bottom=e)}set_extend({extend:e},t){const r=this._getBox();r&&(r.extend=e,this._paramVerfiy(e,t,"box.set_extend",Object.values(Gr),"extend"))}set_bgcolor({color:e}){const t=this._getBox();t&&(t.bgcolor=e)}set_lefttop({left:e,top:t}){const r=this._getBox();r&&(r.left=e,r.top=t)}set_text_size({text_size:e},t){const r=this._getBox();r&&(r.text_size=e,this._paramVerfiy(e,t,"box.set_text_size",Object.values(ar),"text_size"))}set_text_wrap({text_wrap:e},t){const r=this._getBox();r&&(r.text_wrap=e,this._paramVerfiy(e,t,"box.set_text_wrap",[je.wrapAuto,je.wrapNone],"text_wrap"))}set_text_color({text_color:e}){const t=this._getBox();t&&(t.text_color=e)}set_rightbottom({right:e,bottom:t}){const r=this._getBox();r&&(r.right=e,r.bottom=t)}set_text_halign({text_halign:e},t){const r=this._getBox();r&&(r.text_halign=e,this._paramVerfiy(e,t,"box.set_text_halign",[je.alignLeft,je.alignCenter,je.alignRight],"text_halign"))}set_text_valign({text_valign:e},t){const r=this._getBox();r&&(r.text_valign=e,this._paramVerfiy(e,t,"box.set_text_valign",[je.alignBottom,je.alignCenter,je.alignTop],"text_valign"))}set_top_left_point({point:e}){const t=this._getBox();if(t){const{index:r,price:n,time:i}=e||{};t.top=n,t.left=t.xloc===wt.bar_index?r:i}}set_border_color({color:e}){const t=this._getBox();t&&(t.border_color=e)}set_border_style({style:e},t){const r=this._getBox();r&&(r.border_style=e,this._paramVerfiy(e,t,"box.set_border_style",[zt.styleDashed,zt.styleDotted,zt.styleSolid],"style"))}set_border_width({width:e}){const t=this._getBox();t&&(t.border_width=e)}set_bottom_right_point({point:e}){const t=this._getBox();if(t){const{index:r,price:n,time:i}=e||{};t.bottom=n,t.right=t.xloc===wt.bar_index?r:i}}set_text_font_family({text_font_family:e},t){const r=this._getBox();r&&(r.text_font_family=e,this._paramVerfiy(e,t,"box.set_text_font_family",Object.values(Jn),"text_font_family"))}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getBox(){return this._variables.box.get(this._id)}}class ED{constructor(e,t){U(this,"_variables");U(this,"_errorListener");U(this,"_defaultTable",{position:br.topLeft,columns:0,rows:0,frame_width:0,border_width:0});this._variables=e,this._errorListener=t}table({x:e},t){return e||new iu(this._variables,t,this._errorListener)}new(e,t){const r=`table_${t}_${this._variables.bar_index}`,n={...this._defaultTable,...e,cell:[],id:r},i=new iu(this._variables,r,this._errorListener);return this._paramVerfiy(e.position,t,"table.new",Object.values(br),"position"),t.startsWith("export")||this._variables.table.add(r,n,i),i}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}cell({table_id:e,...t}){e==null||e.cell(t)}cell_set_bgcolor({table_id:e,...t}){e==null||e.cell_set_bgcolor(t)}cell_set_height({table_id:e,...t}){e==null||e.cell_set_height(t)}cell_set_text({table_id:e,...t}){e==null||e.cell_set_text(t)}cell_set_text_color({table_id:e,...t}){e==null||e.cell_set_text_color(t)}cell_set_text_font_family({table_id:e,...t}){e==null||e.cell_set_text_font_family(t)}cell_set_text_halign({table_id:e,...t}){e==null||e.cell_set_text_halign(t)}cell_set_text_valign({table_id:e,...t}){e==null||e.cell_set_text_valign(t)}cell_set_text_size({table_id:e,...t}){e==null||e.cell_set_text_size(t)}cell_set_tooltip({table_id:e,...t}){e==null||e.cell_set_tooltip(t)}cell_set_width({table_id:e,...t}){e==null||e.cell_set_width(t)}clear({table_id:e,...t}){e==null||e.clear(t)}delete({table_id:e}){e==null||e.delete()}merge_cells({table_id:e,...t},r){e==null||e.merge_cells(t,r)}set_bgcolor({table_id:e,...t}){e==null||e.set_bgcolor(t)}set_border_color({table_id:e,...t}){e==null||e.set_border_color(t)}set_border_width({table_id:e,...t}){e==null||e.set_border_width(t)}set_frame_color({table_id:e,...t}){e==null||e.set_frame_color(t)}set_frame_width({table_id:e,...t}){e==null||e.set_frame_width(t)}set_position({table_id:e,...t},r){e==null||e.set_position(t,r)}}class iu{constructor(e,t,r){U(this,"_id");U(this,"_variables");U(this,"_errorListener");U(this,"_defaultCell",{column:0,row:0,text:"",text_color:Ii.black,text_halign:je.alignCenter,text_valign:je.alignCenter,text_size:ar.normal});this._variables=e,this._id=t,this._errorListener=r}cell(e){const t={...this._defaultCell,...e},{column:r=0,row:n=0}=t,i=this._variables.table.get(this._id);if(i){const a=i.cell||[],u=a[n]||[];u[r]=t,a[n]=u,i.cell=a}}cell_set_bgcolor({column:e=0,row:t=0,bgcolor:r}){const n=this._getTableItem(e,t);n&&(n.bgcolor=r)}cell_set_height({column:e=0,row:t=0,height:r}){const n=this._getTableItem(e,t);n&&(n.height=r)}cell_set_text({column:e=0,row:t=0,text:r}){const n=this._getTableItem(e,t);n&&(n.text=r)}cell_set_text_color({column:e=0,row:t=0,text_color:r}){const n=this._getTableItem(e,t);n&&(n.text_color=r)}cell_set_text_font_family({column:e=0,row:t=0,text_font_family:r}){const n=this._getTableItem(e,t);n&&(n.text_font_family=r)}cell_set_text_halign({column:e=0,row:t=0,text_halign:r}){const n=this._getTableItem(e,t);n&&(n.text_halign=r)}cell_set_text_valign({column:e=0,row:t=0,text_valign:r}){const n=this._getTableItem(e,t);n&&(n.text_valign=r)}cell_set_text_size({column:e=0,row:t=0,text_size:r}){const n=this._getTableItem(e,t);n&&(n.text_size=r)}cell_set_tooltip({column:e=0,row:t=0,tooltip:r}){const n=this._getTableItem(e,t);n&&(n.tooltip=r)}cell_set_width({column:e=0,row:t=0,width:r}){const n=this._getTableItem(e,t);n&&(n.width=r)}clear({start_column:e=0,start_row:t=0,end_column:r=0,end_row:n=0}){const i=this._variables.table.get(this._id);if(i){const a=i.cell;if(a)for(let u=t;u<=n;u++)for(let c=e;c<=r;c++){const f=a[u];f&&(f[c]=void 0)}}}delete(){this._variables.table.delete(this._id)}merge_cells({start_column:e=0,start_row:t=0,end_column:r=0,end_row:n=0},i){if(e>r||t>n){console.log(`error ${i}: start_column > end_column or start_row > end_row`);return}const a=this._getTableItem(e,t);if(!a)return;this.clear({start_column:e,start_row:t,end_column:r,end_row:n});const u=this._variables.table.get(this._id);u.cell[t][e]={...a,isMerge:!0,merge_columns:r-e+1,merge_rows:n-t+1}}set_bgcolor({bgcolor:e}){const t=this._variables.table.get(this._id);t&&(t.bgcolor=e)}set_border_color({border_color:e}){const t=this._variables.table.get(this._id);t&&(t.border_color=e)}set_border_width({border_width:e}){const t=this._variables.table.get(this._id);t&&(t.border_width=e)}set_frame_color({frame_color:e}){const t=this._variables.table.get(this._id);t&&(t.frame_color=e)}set_frame_width({frame_width:e}){const t=this._variables.table.get(this._id);t&&(t.frame_width=e)}set_position({position:e},t){const r=this._variables.table.get(this._id);r&&(r.position=e,this._paramVerfiy(e,t,"table.set_position",Object.values(br),"position"))}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}_getTableItem(e,t){const r=this._variables.table.get(this._id);if(r){const n=r.cell;return n?n[t][e]:void 0}}}class AD{constructor(e){U(this,"_strategy");this._strategy=e}commission({trade_num:e}){return this._verifyTradeNum(e)&&this._strategy.historyOrders[e].commission||0}entry_bar_index({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].in_index}entry_comment({trade_num:e}){if(!this._verifyTradeNum(e))return"";const{comment:t,id:r}=this._strategy.historyOrders[e];return t||r}entry_id({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].id:""}entry_price({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].in_price}entry_time({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].in_time}exit_bar_index({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].out_index}exit_comment({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].out_comment:""}exit_id({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].out_id:""}exit_price({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].out_price}exit_time({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.historyOrders[e].out_time}max_drawdown({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].trading_loss:0}max_drawdown_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].trading_loss_percent:0}max_runup({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].max_profit:0}max_runup_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].max_profit_percent:0}profit({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].profit:0}profit_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.historyOrders[e].profit_percent:0}size({trade_num:e}){if(!this._verifyTradeNum(e))return 0;const{out_qty:t=0,direction:r}=this._strategy.historyOrders[e];return r===gt.long?t:-t}_verifyTradeNum(e){if(typeof e!="number"||e<0)return!1;const t=this._strategy.historyOrders.length;return!(e>=t)}}class CD{constructor(e){U(this,"_strategy");this._strategy=e}commission({trade_num:e}){if(!this._verifyTradeNum(e))return 0;const{qty:t=0,original_qty:r=0,commission:n=0}=this._strategy.orders[e];return n*t/r}entry_bar_index({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.orders[e].in_index}entry_comment({trade_num:e}){if(!this._verifyTradeNum(e))return"";const{comment:t,id:r}=this._strategy.orders[e];return t||r}entry_id({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].id:""}entry_price({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.orders[e].in_price}entry_time({trade_num:e}){if(this._verifyTradeNum(e))return this._strategy.orders[e].in_time}max_drawdown({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].trading_loss:0}max_drawdown_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].trading_loss_percent:0}max_runup({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].max_profit:0}max_runup_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].max_profit_percent:0}profit({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].profit:0}profit_percent({trade_num:e}){return this._verifyTradeNum(e)?this._strategy.orders[e].profit_percent:0}size({trade_num:e}){if(!this._verifyTradeNum(e))return 0;const{qty:t=0,direction:r}=this._strategy.orders[e];return r===gt.long?t:-t}_verifyTradeNum(e){if(typeof e!="number"||e<0)return!1;const t=this._strategy.orders.length;return!(e>=t)}}class FD{constructor(e,t){U(this,"_strategy");U(this,"_errorListener");this._strategy=e,this._errorListener=t}allow_entry_in({value:e},t){this._paramVerfiy(e,t,"strategy.risk.allow_entry_in",Object.values(gt),"value"),this._strategy.updateRisk({allow_entry_in:e})}max_cons_loss_days({count:e}){this._strategy.updateRisk({max_cons_loss_days:e})}max_drawdown({value:e,type:t},r){this._paramVerfiy(t,r,"strategy.risk.max_drawdown",[Lt.percentOfEquity,Lt.cash],"type"),t===Lt.percentOfEquity&&(e=e>100?100:e),this._strategy.updateRisk({max_drawdown:e,max_drawdown_type:t})}max_intraday_filled_orders({count:e}){this._strategy.updateRisk({max_intraday_filled_orders:e})}max_intraday_loss({value:e,type:t},r){this._paramVerfiy(t,r,"strategy.risk.max_intraday_loss",[Lt.percentOfEquity,Lt.cash],"type"),t===Lt.percentOfEquity&&(e=e>100?100:e),this._strategy.updateRisk({max_intraday_loss:e,max_intraday_loss_type:t})}max_position_size({contracts:e}){this._strategy.updateRisk({max_position_size:e})}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}}let BD=class{constructor(e,t,r,n){U(this,"_variables");U(this,"_options");U(this,"_totalChangeCapital");U(this,"_historyOrder");U(this,"_orders");U(this,"_pendingOrders");U(this,"_mintick");U(this,"_funcOptions");U(this,"_pendingCloseOrders");U(this,"_errorListener");U(this,"_risk");U(this,"_opentrades");U(this,"_closedtrades");U(this,"_riskNamespace");this._variables=e,this._errorListener=n,this._options={overlay:!1,format:Je.inherit,pyramiding:0,calc_on_order_fills:!1,calc_on_every_tick:!1,max_bars_back:0,backtest_fill_limits_assumption:0,default_qty_type:Lt.fixed,default_qty_value:1,initial_capital:1e6,currency:zc.NONE,slippage:0,commission_type:Ir.percent,commission_value:0,process_orders_on_close:!1,close_entries_rule:"FIFO",margin_long:0,margin_short:0,explicit_plot_zorder:!1,max_lines_count:50,max_labels_count:50,max_boxes_count:50,calc_bars_count:0,risk_free_rate:2,use_bar_magnifier:!1,fill_orders_on_standard_ohlc:!1,max_polylines_count:50},this._funcOptions=t,this._totalChangeCapital=0,this._orders=[],this._pendingOrders=[],this._historyOrder=[],this._pendingCloseOrders=[],this._mintick=r,this._variables.strategy.updateOrders(this._orders),this._variables.strategy.updateHistoryOrders(this._historyOrder),this._variables.strategy.updateStrategyOptions(this._options),this._risk={intradayOrders:0},this._opentrades=new CD(this),this._closedtrades=new AD(this),this._riskNamespace=new FD(this,n)}get orders(){return[...this._orders]}get historyOrders(){return[...this._historyOrder]}get _orderProfit(){return this._orders.reduce((e,t)=>e+(t.profit||0),0)}get _freezeCapital(){const{close:e}=this._variables;return this._orders.reduce((t,r)=>t+e*(r.qty||0),0)}get opentrades(){return this._opentrades}get closedtrades(){return this._closedtrades}get risk(){return this._riskNamespace}updateOptions(e){Object.assign(this._options,e),this._maxConsLossDaysVerify(),this._pendingOrderHandle(),this._maxIntradayFilledOrdersVerify(),this._ordersHandle(),!this._options.process_orders_on_close&&this._calcLiquidate()}updateRisk(e){Object.assign(this._risk,e)}endExecution(){this._calcProfitAndLoss(),this._variables.strategy.update(),this._maxDrawdownVerify(),this._maxIntradayLoss(),this._pendingCloseOrderHandle(),this._options.process_orders_on_close&&this._calcLiquidate()}_maxIntradayLoss(){var v;const{max_intraday_loss:e,max_intraday_loss_type:t,isDisabledOpen:r}=this._risk;if(e===void 0||!t||r)return;const{high:n,low:i,time_tradingday:a,time:u,strategy:{netprofit:c,initial_capital:f}}=this._variables;let{preNetprofit:h=0}=this._risk;u===a&&(h=c,this._risk.preNetprofit=c,this._risk.isTemporaryBan=!1);let d=h-c;d+=this._orders.reduce((x,_)=>{const{in_price:y,direction:m,qty:w=0,commission:D=0,original_qty:C=0}=_,b=m===gt.long?1:-1,F=(n-y)*w,B=(i-y)*w,M=b===1?-B:F;return x+M+w/C*D},0);let p=!1;switch(t){case Lt.cash:p=e<d;break;case Lt.percentOfEquity:const x=d/(f+c)*100;p=e<x;break}if(p){this._risk.isTemporaryBan=!0;const x=(v=this._orders[0])==null?void 0:v.direction;this._closeOrders(this._orders,x===gt.long?i:n,"Close Position (Max intraday Loss)"),this._pendingOrders=[]}}_maxIntradayFilledOrdersVerify(){const{max_intraday_filled_orders:e,intradayOrders:t=0,isDisabledOpen:r}=this._risk;if(e===void 0||r)return;const{time:n,time_tradingday:i,open:a}=this._variables;n===i&&(this._risk.intradayOrders=0,this._risk.isTemporaryBan=!1),e<=t&&(this._risk.isTemporaryBan=!0,this._closeOrders(this._orders,a,"Close Position (Max number of filled orders in one day)"),this._pendingOrders=[])}_maxConsLossDaysVerify(){const{max_cons_loss_days:e,lossDays:t=0,isDisabledOpen:r,totalProfit:n=0}=this._risk;if(e===void 0||r)return;const{time:i,time_tradingday:a,strategy:u,open:c}=this._variables;let f=t;if(i===a){const h=u.netprofit+u.openprofit;h<n?f=0:f++,Object.assign(this._risk,{lossDays:f,totalProfit:h})}e<=f&&this._riskTouchOff(c,"Close Position (Max consecutive loss days)")}_maxDrawdownVerify(){var n;const{max_drawdown:e,max_drawdown_type:t,isDisabledOpen:r}=this._risk;if(!r&&e!==void 0&&t){const{max_drawdown:i,max_drawdown_percent:a}=this._variables.strategy;let u=!1;switch(t){case Lt.percentOfEquity:u=a<i;break;case Lt.cash:u=e<i;break}if(u){const{high:c,low:f}=this._variables,h=(n=this._orders[0])==null?void 0:n.direction;this._riskTouchOff(h===gt.long?c:f,"Close Position (Max Drawdown)")}}}_riskTouchOff(e,t){this._risk.isDisabledOpen=!0,this._closeOrders(this._orders,e,t),this._pendingOrders=[]}strategy(e,t){this._variables.bar_index||(this._paramVerfiy(e.format,t,"strategy",[Je.inherit,Je.price,Je.percent,Je.volume],"format"),this._paramVerfiy(e.default_qty_type,t,"strategy",Object.values(Lt),"default_qty_type"),this._paramVerfiy(e.commission_type,t,"strategy",Object.values(Ir),"commission_type"),this._options={...e},this._variables.updateMaxLength(e),Object.assign(this._funcOptions,{strategy:this._options,scriptType:"strategy"}))}order(e,t){this._risk.isDisabledOpen||(this._paramVerfiy(e.oca_type,t,"strategy.order",Object.values(vn),"oca_type"),this._orderHandle(e))}entry(e,t){this._risk.isDisabledOpen||(this._paramVerfiy(e.oca_type,t,"strategy.entry",Object.values(vn),"oca_type"),this._entryHandle(e))}close(e){if(!this._orders.length)return;const{immediately:t}=e;t||this._options.process_orders_on_close?this._pendingCloseOrders.push({...e,place_order_type:"close"}):this._pendingOrders.push({...e,place_order_type:"close"})}close_all(e){if(typeof e=="string"&&(e={}),!this._orders.length)return;const{immediately:t}=e;t||this._options.process_orders_on_close?this._pendingCloseOrders.push({...e,place_order_type:"close_all"}):this._pendingOrders.push({...e,place_order_type:"close_all"})}cancel({id:e}){this._pendingOrders=this._pendingOrders.filter(t=>!(t.id===e&&t.place_order_type!=="close"))}cancel_all(){this._pendingOrders=this._pendingOrders.filter(e=>e.place_order_type==="close_all")}exit(e,t){this._exit(e,t)}convert_to_account({value:e}){return e}convert_to_symbol({value:e}){return e}default_entry_qty({fill_price:e}){return e?this._calcDefaultQty(e):0}_calcDefaultQty(e){const{default_qty_type:t=Lt.fixed,default_qty_value:r=1,initial_capital:n}=this._options;switch(t){case Lt.fixed:return r;case Lt.cash:return r/e;case Lt.percentOfEquity:return(n+this._orderProfit+this._totalChangeCapital)*r/100/e}}_getCapital(e,t){const{margin_long:r=0,margin_short:n=0}=this._options;return r<100&&r>0&&e===1?t=t*100/r:n<=100&&n>0&&e===-1&&(t=t*100/n),t}_calcProfitAndLoss(){const{high:e,low:t,close:r}=this._variables;for(const n of this._orders){const{in_price:i,qty:a=0,direction:u}=n,c=u===gt.long?1:-1,f=(r-i)*c*a,h=(e-i)*a,d=(t-i)*a,p=c===1?h:-d,v=c===1?-d:h;this._calcOrderPercent(n,f,p,v)}}_calcOrderPercent(e,t,r,n){const{commission_value:i}=this._options,{close:a}=this._variables,{original_qty:u=0,qty:c=0,in_price:f,max_profit:h=0,trading_loss:d=0}=e;let{commission:p=0}=e;const v=f*c;if(i){const x=this._getCommission(a,c);t=t-x,p=p*c/u,r-=p,n+=p}r=Math.max(r,h),n=Math.min(n,d),Object.assign(e,{profit:t-p,total_profit:this._totalChangeCapital+t,max_profit:r,trading_loss:n,profit_percent:t/v*100,max_profit_percent:r/v*100,trading_loss_percent:n/v*100})}_calcLiquidate(){if(!this._orders.length)return;const{high:e,low:t}=this._variables,{initial_capital:r,margin_long:n=0,margin_short:i=0,commission_value:a=0}=this._options,u=this._orders[0].direction===gt.long?1:-1,c=u===1?t:e,f=(u===1?n:i)/100;if(f<=0)return;const[h,d,p]=this._orders.reduce((m,w)=>{let[D,C,b]=m;const{in_price:F,qty:B=0,original_qty:M=0,commission:O=0}=w,A=F*B,N=c*B;if(D+=A,C+=N,a){const I=this._getCommission(c,B);b+=I+B/M*O}return[D,C,b]},[0,0,0]),v=u*(d-h),_=r+this._totalChangeCapital+v-p-d*f;if(_>=0)return;const y=Math.trunc(_/f/c)*4;this._marginCallOrders(c,y,"Margin Call")}_marginCallOrders(e,t,r){const{close_entries_rule:n="FIFO"}=this._options;if(n==="FIFO"){this._processOrders(this._orders,e,t*this._orders.length,r,r);return}for(const i of this.orders)this._processOrder(i,e,t,r,r);this._orders=this._orders.filter(i=>!i.isDeal),this._variables.strategy.updateOrders(this._orders)}_orderHandle(e){const{process_orders_on_close:t,slippage:r=0}=this._options,{orders:n,isMarketPrice:i,quantities:a,close:u,price:c,activePrice:f}=this._orderArgsParse(e),h=e.direction===gt.long?1:-1;if(a<=0)return;let d=a;if(i&&t){if(n.length){const _=this._processOrders(n,u,d,e.id,e.comment);if(_<=0)return;d=_}const v=u+h*r*this._mintick;if(!this._judgeCapitalEnough(d,v,h))return;this._ocaGroupVerify(d,e.oca_name,e.oca_type),this._calcCurrentOrder({...e,in_price:v,in_index:this._variables.bar_index,in_time:this._variables.time,qty:d,place_order_type:"order"});return}this._judgeCapitalEnough(a,c,h)&&this._addPendingOrders(e,c,d,i,f)}_judgeCapitalEnough(e,t,r){if(e<=0)return!1;const{margin_long:n=0,margin_short:i=0}=this._options;if((n===0||n===100)&&r===1||i===0&&r===-1)return!0;const u=this._getCapital(r,this._options.initial_capital+this._orderProfit+this._totalChangeCapital)-this._freezeCapital;return e*t<=u}_ocaGroupVerify(e,t,r){if(!t||!r||r===vn.none)return!1;let n=!1;switch(r){case vn.cancel:this._pendingOrders=this._pendingOrders.filter(i=>{if(i.oca_name===t)i.isCancel=!0,n=!0;else return!0});break;case vn.reduce:this._pendingOrders=this._pendingOrders.filter(i=>{const{qty:a=0,oca_name:u}=i;if(t===u){const c=a-e;return n=!0,c<=0?(i.isCancel=!0,!1):(i.qty=c,!0)}else return!0});break}return n}_processOrders(e,t,r,n,i){let a=r;for(const u of e)if(a=this._processOrder(u,t,a,n,i),a<=0)break;return this._orders=this._orders.filter(u=>!u.isDeal),this._variables.strategy.updateOrders(this._orders),a}_addPendingOrders(e,t,r,n,i){const a=this._pendingOrders.find(u=>u.id===e.id&&!u.isMarketPrice);if(a)Object.assign(a,{...e,in_price:t,isMarketPrice:n,qty:r,active_price:i});else{const u={...e,in_price:t,isMarketPrice:n,qty:r,active_price:i,place_order_type:"order"};this._pendingOrders.push(u)}}_orderArgsParse(e){const{direction:t,qty:r,stop:n}=e;let i=e.limit||0;const{close:a}=this._variables;let u=a,c=!1,f;const h=t===gt.long?1:-1,d=n&&(n-a)*h>0,{backtest_fill_limits_assumption:p=0}=this._options;p>0&&i&&(i-=p*this._mintick*h);const v=i&&(i-a)*h<0;d&&v?(f=n,u=i):d?u=n:v?u=i:c=!0;const x=r||this._calcDefaultQty(u)||1;return{orders:this._orders.filter(y=>y.direction!==t),isMarketPrice:c,activePrice:f,quantities:x,close:a,price:u}}_entryHandle(e){const{process_orders_on_close:t}=this._options,{orders:r,isMarketPrice:n,quantities:i,close:a,price:u,activePrice:c}=this._orderArgsParse(e);if(i<=0)return;if(r.length&&n&&t){this._entryOrder(r,a,i,e);return}this._judgeCapitalEnough(i,a,e.direction===gt.long?1:-1)&&this._addPendingEntry(e,u,i,n,c)}_entryOrder(e,t,r,n){const{time:i,bar_index:a}=this._variables,{slippage:u=0}=this._options,{oca_name:c,oca_type:f,direction:h,comment:d,isMarketPrice:p,id:v}=n,x=h===gt.long?1:-1;if(this._closeOrders(e,t,v,d),r=this._getAvailablePositionSize(r,h),r<=0)return;t=t+u*this._mintick*x;const _={...n,in_price:t,original_qty:r,qty:r,in_index:a,in_time:i,place_order_type:"entry"};if(p){this._calcCurrentOrder(_);return}const{pendingOrders:y,orders:m}=this._getEntryOrders(h),w=y.length+m.length;w&&w>=(this._options.pyramiding||0)||!this._judgeCapitalEnough(r,t,x)||(this._ocaGroupVerify(r,c,f),this._calcCurrentOrder(_))}_getAvailablePositionSize(e,t){const{max_position_size:r,allow_entry_in:n}=this._risk;if(n&&n!==gt.all&&n!==t)return 0;if(r===void 0)return e;const i=this._orders.reduce((a,u)=>a+(u.qty||0),0);return i?i+e>r?0:e:e>r?e-r:0}_getEntryOrders(e){const t=this._pendingOrders.filter(n=>["entry","order"].includes(n.place_order_type)&&n.direction===e),r=this._orders.filter(n=>n.direction===e);return{pendingOrders:t,orders:r}}_addPendingEntry(e,t,r,n,i){if(r=this._getAvailablePositionSize(r,e.direction),r<=0)return;const{pendingOrders:a,orders:u}=this._getEntryOrders(e.direction),c=a.length+u.length,f=a.find(h=>h.id===e.id&&h.place_order_type==="entry");if(f)Object.assign(f,{...e,in_price:t,isMarketPrice:n,qty:r,active_price:i});else if(!c||c<(this._options.pyramiding||1)){const h={...e,in_price:t,isMarketPrice:n,qty:r,active_price:i,place_order_type:"entry"};this._pendingOrders.push(h)}}_closeAllOrders(e,t){const{comment:r}=e,{bar_index:n}=this._variables,i=this._orders.filter(a=>a.in_index!==n);i.length&&(this._closeOrders(i,t,"Close position order",r),this._orders=[],this._variables.strategy.updateOrders(this._orders))}_closeOrders(e,t,r,n){for(const i of e)this._closeOrder(i,t,r,n);this._orders=this._orders.filter(i=>!i.isDeal),this._variables.strategy.updateOrders(this._orders)}_closeOrder(e,t,r,n){const{time:i,bar_index:a}=this._variables,{slippage:u=0}=this._options,{in_price:c,qty:f=0,direction:h}=e,d=h===gt.long?1:-1;t=t-d*u*this._mintick,e.isDeal=!0;const p=(t-c)*d*f,v={...e,out_price:t,out_id:r,out_index:a,out_time:i,out_comment:n,out_qty:f,profit:p};this._calcPercent(v),this._risk.intradayOrders+=1,this._historyOrder.push(v),this._variables.strategy.updateHistoryOrders(this._historyOrder)}_ordersHandle(){const e=this._orders.filter(a=>a.place_order_type==="exit"&&!a.hasExit);if(!e.length)return;const{open:t,low:r,high:n,close:i}=this._variables;for(const a of e){const{stop:u,limit:c,trail_stop_price:f,isMarketPriceLimit:h,isMarketPriceStop:d,direction:p,id:v,out_comment:x,active_price:_,trail_offset:y=0,out_qty:m,comment_loss:w,comment_profit:D,comment_trailing:C}=a;let b=f;const F=p===gt.long?1:-1;let B,M=x;if(h||d?B=t:(c&&r<=c&&n>=c&&(M=D||x,B=c),u&&r<=u&&n>=u&&(B=b?(u-b)*F>0?u:b:u,M=(b===B?C:w)||x)),B)this._processExitOnClose(a,B,{from_entry:v,comment:M,qty:m});else{let O=!1;if(_&&_<=n&&_>=r&&(b=_-y*F*this._mintick,(b-i)*F>=0&&(a.isMarketPriceStop=!0,this._options.process_orders_on_close&&(B=b)),O=!0,a.trail_stop_price=b),b)if((b-t)*F>=0&&!O)B=b;else{const A=(F===1?n:r)-y*F*this._mintick;F===1?b<t&&b>=r&&A>b&&A<i?B=b:A>b?(b=A,A>=i&&(B=A)):b<=n&&r<=b&&(B=b):b>t&&b<=n&&A<b&&A>i?B=b:A<b?(b=A,A<=i&&(B=A)):b<=n&&r<=b&&(B=b),a.trail_stop_price=b}B&&this._processExitOnClose(a,B,{from_entry:v,comment:C||x,qty:m})}}}_pendingOrderHandle(){if(!this._pendingOrders.length)return;const e=[],t=this._pendingOrders.filter(n=>n.place_order_type==="exit"),r=this._pendingOrders.filter(n=>["close","close_all"].includes(n.place_order_type||""));for(const n of r)switch(n.place_order_type){case"close":this._closeOrderHandle(n);break;case"close_all":this._closeAllOrders(n,this._variables.open);break}for(const n of this._pendingOrders){const{isCancel:i,place_order_type:a}=n;if(i)continue;let u;switch(a){case"entry":u=this._entryOrderHandle(n);break;case"order":u=this._orderOrderHandle(n);break}u&&e.push(u)}for(const n of t){const i=this._exitOrderHandle(n);i&&e.push(i)}this._pendingOrders=e}_pendingCloseOrderHandle(){if(!this._pendingCloseOrders.length)return;const e=this._pendingCloseOrders.filter(n=>n.place_order_type==="exit"),t=this._pendingCloseOrders.filter(n=>["close","close_all"].includes(n.place_order_type||"")),{close:r}=this._variables;for(const n of t)switch(n.place_order_type){case"close":this._closeOrderHandle(n,!0);break;case"close_all":this._closeAllOrders(n,r);break}for(const n of e){const{from_entry:i}=n,a=this._orders.filter(u=>!i||u.id===i&&(u.isMarketPriceLimit||u.isMarketPriceStop));for(const u of a)this._processExitOnClose(u,u.limit||u.stop||u.trail_stop_price||r,n)}this._pendingCloseOrders=[]}_entryOrderHandle(e){const{open:t,low:r,high:n}=this._variables,{isMarketPrice:i,qty:a=0,in_price:u,direction:c,active_price:f}=e;if(f&&n>=f&&r<=f)return delete e.active_price,e;let h=u;if(i&&(h=t),h<=n&&h>=r){const d=this._orders.filter(p=>p.direction!==c);this._entryOrder(d,h,a,e)}else return e}_orderOrderHandle(e){const{open:t,low:r,high:n,time:i,bar_index:a}=this._variables,{slippage:u=0}=this._options,{isMarketPrice:c,qty:f=0,in_price:h,direction:d,comment:p,oca_name:v,oca_type:x,active_price:_,id:y}=e;if(_&&n>=_&&r<=_)return delete e.active_price,e;let m=h,w=f;if(c&&(m=t),m<=n&&m>=r){const D=this._orders.filter(b=>b.direction!==d);if(D.length&&(w=this._processOrders(D,m,f,y,p),w<=0))return;const C=d===gt.long?1:-1;this._ocaGroupVerify(w,v,x),this._calcCurrentOrder({...e,in_price:m+C*u*this._mintick,in_index:a,in_time:i,qty:w});return}else return e}_closeOrderHandle(e,t){const{id:r,qty:n,qty_percent:i=100,comment:a}=e,{bar_index:u}=this._variables,c=this._orders.filter(v=>v.id===r&&v.in_index!==u&&(!v.close_qty||v.close_qty<(v.qty||0)));if(!c.length)return;let f=0;if(n?f=n:(f=c.reduce((v,x)=>v+(x.qty||0),f),f=i/100*f),f<=0)return;const{open:h,close:d}=this._variables;let p=f;for(const v of c){const{qty:x=0}=v;p<x?v.close_qty=p:(v.close_qty=x,p-=x)}this._processOrders(this._options.close_entries_rule==="ANY"?c:this._orders,t?d:h,f,`Close entry(s) order ${r}`,a)}_exitOrderHandle(e){const{from_entry:t}=e,r=this._orders.filter(n=>(!t||t===n.id)&&!n.hasExit);if(!(r.length&&!this._ordersToExit(r,e)))return e}_exit(e,t){const{profit:r,loss:n,stop:i,limit:a,trail_offset:u,trail_price:c,trail_points:f,from_entry:h="",id:d}=e;if(this._isNaN(r)&&this._isNaN(n)&&this._isNaN(i)&&this._isNaN(a)&&(this._isNaN(u)||this._isNaN(f)&&this._isNaN(c))){this._errorListener.addError("strategy.exit must have at least one of the following parameters: 'profit', 'limit', 'loss', 'stop' or one of the following pairs: 'trail_offset' and 'trail_price' / 'trail_points'. To close the position at market price, use 'strategy.close'",t,Ve.Error);return}const p={...e,place_order_type:"exit"},v=this._orders.filter(y=>(!h||h===y.id)&&!y.hasExit),x=this._pendingOrders.filter(y=>!h||h===y.id);if(v.length){if(!this._ordersToExit(v,p))return}else if(!x.length)return;const _=this._pendingOrders.find(y=>y.id===d);_?Object.assign(_,{...e}):this._pendingOrders.push(p)}_ordersToExit(e,t){const{qty:r,qty_percent:n=100,id:i,comment:a,comment_loss:u,comment_profit:c,comment_trailing:f}=t;let h=r,d=!1;t.comment=a||i;for(const p of e){const{qty:v=0}=p,x=p.direction===gt.long?1:-1;h=r?r>=v?v:r:n/100*v,p.out_qty=h,h<v&&(d=!0),Object.assign(p,{out_comment:a||i,comment_loss:u,comment_profit:c,comment_trailing:f}),!(this._stopProfit(p,x,{...t,qty:h})||this._stopLoss(p,x,{...t,qty:h})||this._trailStopLoss(p,x,{...t,qty:h}))&&(p.place_order_type="exit")}return d}_addExitPendingCloseOrders(e){e.place_order_type="exit";const t=this._pendingCloseOrders.find(r=>r.id===e.id);t?Object.assign(t,{...e}):this._pendingCloseOrders.push(e)}_stopProfit(e,t,r){const{limit:n,profit:i,comment_profit:a,comment:u}=r;let c=n;const{close:f}=this._variables,{in_price:h}=e,{process_orders_on_close:d}=this._options;if(!this._isNaN(i)&&this._isNaN(n)&&(c=h+t*i*this._mintick),e.limit=c,c&&(c-f)*t<=0&&(e.isMarketPriceLimit=!0,r.comment=a||u,Object.assign(e,{out_comment:r.comment}),c=f,d))return this._addExitPendingCloseOrders(r),!0}_stopLoss(e,t,r){const{stop:n,loss:i,comment_loss:a,comment:u}=r;let c=n;const{close:f}=this._variables,{in_price:h}=e,{process_orders_on_close:d}=this._options;if(!this._isNaN(i)&&this._isNaN(n)&&(c=h-t*i*this._mintick),e.stop=c,c&&(c-f)*t>=0&&(e.isMarketPriceStop=!0,r.comment=a||u,Object.assign(e,{out_comment:r.comment}),c=f,d))return this._addExitPendingCloseOrders(r),!0}_trailStopLoss(e,t,r){const{trail_offset:n,trail_price:i,trail_points:a,comment_trailing:u,comment:c}=r;if(!this._isNaN(n)){const{close:f}=this._variables,{in_price:h}=e,{process_orders_on_close:d}=this._options;let p;if(this._isNaN(i)?this._isNaN(a)||(p=h+a*t*this._mintick):p=i,e.trail_offset=n,p&&(p-f)*t<=0){const v=f-n*t*this._mintick;if((v-f)*t>=0&&(e.trail_stop_price=f,e.isMarketPriceStop=!0,r.comment=u||c,Object.assign(e,{out_comment:r.comment}),d))return this._addExitPendingCloseOrders(r),!0;e.trail_stop_price=v}e.active_price=p}}_processExitOnClose(e,t,r){const{qty:n=0,comment:i,id:a}=r,{close_entries_rule:u="FIFO"}=this._options;if(u==="FIFO"){const c=this._processExitOrders(this._orders,t,n,a,i);c&&!c.hasExit?(c.hasExit=!0,Object.assign(e,{trail_stop_price:c.trail_stop_price,stop:c.stop,limit:c.limit,trail_offset:c.trail_offset,active_price:c.active_price})):c&&(e.hasExit=!0)}else e.hasExit=!0,this._processOrders([e],t,n,a,i)}_processExitOrders(e,t,r,n,i){let a=r,u;for(const c of e)if(u=c,a=this._processOrder(c,t,a,n,i),a<=0||!c.hasExit)break;return this._orders=this._orders.filter(c=>!c.isDeal),this._variables.strategy.updateOrders(this._orders),u}_processOrder(e,t,r,n,i){const{time:a,bar_index:u}=this._variables,{slippage:c=0}=this._options,{in_price:f,qty:h=0,max_profit:d=0,trading_loss:p=0,direction:v,commission:x=0,original_qty:_=0}=e,y=v===gt.long?1:-1;if(t=t-y*c*this._mintick,r<h){const m=h-r,w=(t-f)*y*r,D=d/h*r,C=p/h*r;this._calcPercent({...e,out_price:t,out_id:n,out_index:u,out_time:a,out_comment:i,profit:w,out_qty:r,max_profit:D,trading_loss:C});const b=(t-f)*y*m-x*m/_;Object.assign(e,{qty:m,profit:b,max_profit:d-D,trading_loss:p-C,total_profit:this._totalChangeCapital+b}),r=0}else{e.isDeal=!0;const m=(t-f)*y*h;this._calcPercent({...e,out_price:t,out_id:n,out_index:u,out_time:a,out_comment:i,out_qty:h,profit:m}),r-=h}return r}_calcPercent(e){const{commission_value:t}=this._options,{in_price:r,out_qty:n=0,out_price:i=0,original_qty:a=0}=e;let{profit:u=0,max_profit:c=0,trading_loss:f=0,commission:h=0}=e;c=c<0?0:c;const d=r*n;if(this._totalChangeCapital+=u,t){const p=this._getCommission(i,n);this._totalChangeCapital-=p,h=h*n/a+p,u=u-h,Object.assign(e,{commission:h,profit:u,max_profit:c})}Object.assign(e,{total_profit:this._totalChangeCapital,profit_percent:u/d*100,max_profit_percent:c/d*100,trading_loss_percent:f/d*100}),this._risk.intradayOrders+=1,this._historyOrder.push(e),this._variables.strategy.updateHistoryOrders(this._historyOrder)}_getCommission(e,t){const{commission_value:r=0,commission_type:n}=this._options,i=e*t;let a=0;switch(n){case Ir.percent:a=i*r/100;break;case Ir.cashPerContract:a=t*r;break;case Ir.cashPerOrder:a=r;break}return a}_calcCurrentOrder(e){const{commission_value:t}=this._options,{in_price:r,qty:n=0,max_profit:i=0,trading_loss:a=0}=e;let{profit:u=0}=e;const c=r*n;if(t){const f=this._getCommission(r,n);this._totalChangeCapital-=f,u=u-f,Object.assign(e,{commission:f,profit:u,total_profit:this._totalChangeCapital})}Object.assign(e,{original_qty:n,profit_percent:u/c*100,max_profit_percent:i/c*100,trading_loss_percent:a/c*100}),this._risk.intradayOrders+=1,this._orders.push(e),this._variables.strategy.updateOrders(this._orders)}_isNaN(e){return e===void 0||isNaN(e)}_paramVerfiy(e="",t,r,n,i){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}};var Hc={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){return function(t,r,n){r.prototype.isBetween=function(i,a,u,c){var f=n(i),h=n(a),d=(c=c||"()")[0]==="(",p=c[1]===")";return(d?this.isAfter(f,u):!this.isBefore(f,u))&&(p?this.isBefore(h,u):!this.isAfter(h,u))||(d?this.isBefore(f,u):!this.isAfter(f,u))&&(p?this.isAfter(h,u):!this.isBefore(h,u))}}})})(Hc);var MD=Hc.exports,ND=tt(MD),jc={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){return function(t,r,n){var i=r.prototype,a=function(p){var v,x=p.date,_=p.utc,y={};if(!((v=x)===null||v instanceof Date||v instanceof Array||i.$utils().u(v)||v.constructor.name!=="Object")){if(!Object.keys(x).length)return new Date;var m=_?n.utc():n();Object.keys(x).forEach(function(O){var A,N;y[A=O,N=i.$utils().p(A),N==="date"?"day":N]=x[O]});var w=y.day||(y.year||y.month>=0?1:m.date()),D=y.year||m.year(),C=y.month>=0?y.month:y.year||y.day?0:m.month(),b=y.hour||0,F=y.minute||0,B=y.second||0,M=y.millisecond||0;return _?new Date(Date.UTC(D,C,w,b,F,B,M)):new Date(D,C,w,b,F,B,M)}return x},u=i.parse;i.parse=function(p){p.date=a.bind(this)(p),u.bind(this)(p)};var c=i.set,f=i.add,h=i.subtract,d=function(p,v,x,_){_===void 0&&(_=1);var y=Object.keys(v),m=this;return y.forEach(function(w){m=p.bind(m)(v[w]*_,w)}),m};i.set=function(p,v){return v=v===void 0?p:v,p.constructor.name==="Object"?d.bind(this)(function(x,_){return c.bind(this)(_,x)},v,p):c.bind(this)(p,v)},i.add=function(p,v){return p.constructor.name==="Object"?d.bind(this)(f,p,v):f.bind(this)(p,v)},i.subtract=function(p,v){return p.constructor.name==="Object"?d.bind(this)(f,p,v,-1):h.bind(this)(p,v)}}})})(jc);var SD=jc.exports,OD=tt(SD),Yc={exports:{}};(function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t,r,n=1e3,i=6e4,a=36e5,u=864e5,c=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=31536e6,h=2628e6,d=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,p={years:f,months:h,days:u,hours:a,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},v=function(F){return F instanceof C},x=function(F,B,M){return new C(F,M,B.$l)},_=function(F){return r.p(F)+"s"},y=function(F){return F<0},m=function(F){return y(F)?Math.ceil(F):Math.floor(F)},w=function(F){return Math.abs(F)},D=function(F,B){return F?y(F)?{negative:!0,format:""+w(F)+B}:{negative:!1,format:""+F+B}:{negative:!1,format:""}},C=function(){function F(M,O,A){var N=this;if(this.$d={},this.$l=A,M===void 0&&(this.$ms=0,this.parseFromMilliseconds()),O)return x(M*p[_(O)],this);if(typeof M=="number")return this.$ms=M,this.parseFromMilliseconds(),this;if(typeof M=="object")return Object.keys(M).forEach(function(k){N.$d[_(k)]=M[k]}),this.calMilliseconds(),this;if(typeof M=="string"){var I=M.match(d);if(I){var L=I.slice(2).map(function(k){return k!=null?Number(k):0});return this.$d.years=L[0],this.$d.months=L[1],this.$d.weeks=L[2],this.$d.days=L[3],this.$d.hours=L[4],this.$d.minutes=L[5],this.$d.seconds=L[6],this.calMilliseconds(),this}}return this}var B=F.prototype;return B.calMilliseconds=function(){var M=this;this.$ms=Object.keys(this.$d).reduce(function(O,A){return O+(M.$d[A]||0)*p[A]},0)},B.parseFromMilliseconds=function(){var M=this.$ms;this.$d.years=m(M/f),M%=f,this.$d.months=m(M/h),M%=h,this.$d.days=m(M/u),M%=u,this.$d.hours=m(M/a),M%=a,this.$d.minutes=m(M/i),M%=i,this.$d.seconds=m(M/n),M%=n,this.$d.milliseconds=M},B.toISOString=function(){var M=D(this.$d.years,"Y"),O=D(this.$d.months,"M"),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var N=D(A,"D"),I=D(this.$d.hours,"H"),L=D(this.$d.minutes,"M"),k=this.$d.seconds||0;this.$d.milliseconds&&(k+=this.$d.milliseconds/1e3,k=Math.round(1e3*k)/1e3);var z=D(k,"S"),R=M.negative||O.negative||N.negative||I.negative||L.negative||z.negative,G=I.format||L.format||z.format?"T":"",H=(R?"-":"")+"P"+M.format+O.format+N.format+G+I.format+L.format+z.format;return H==="P"||H==="-P"?"P0D":H},B.toJSON=function(){return this.toISOString()},B.format=function(M){var O=M||"YYYY-MM-DDTHH:mm:ss",A={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return O.replace(c,function(N,I){return I||String(A[N])})},B.as=function(M){return this.$ms/p[_(M)]},B.get=function(M){var O=this.$ms,A=_(M);return A==="milliseconds"?O%=1e3:O=A==="weeks"?m(O/p[A]):this.$d[A],O||0},B.add=function(M,O,A){var N;return N=O?M*p[_(O)]:v(M)?M.$ms:x(M,this).$ms,x(this.$ms+N*(A?-1:1),this)},B.subtract=function(M,O){return this.add(M,O,!0)},B.locale=function(M){var O=this.clone();return O.$l=M,O},B.clone=function(){return x(this.$ms,this)},B.humanize=function(M){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!M)},B.valueOf=function(){return this.asMilliseconds()},B.milliseconds=function(){return this.get("milliseconds")},B.asMilliseconds=function(){return this.as("milliseconds")},B.seconds=function(){return this.get("seconds")},B.asSeconds=function(){return this.as("seconds")},B.minutes=function(){return this.get("minutes")},B.asMinutes=function(){return this.as("minutes")},B.hours=function(){return this.get("hours")},B.asHours=function(){return this.as("hours")},B.days=function(){return this.get("days")},B.asDays=function(){return this.as("days")},B.weeks=function(){return this.get("weeks")},B.asWeeks=function(){return this.as("weeks")},B.months=function(){return this.get("months")},B.asMonths=function(){return this.as("months")},B.years=function(){return this.get("years")},B.asYears=function(){return this.as("years")},F}(),b=function(F,B,M){return F.add(B.years()*M,"y").add(B.months()*M,"M").add(B.days()*M,"d").add(B.hours()*M,"h").add(B.minutes()*M,"m").add(B.seconds()*M,"s").add(B.milliseconds()*M,"ms")};return function(F,B,M){t=M,r=M().$utils(),M.duration=function(N,I){var L=M.locale();return x(N,{$l:L},I)},M.isDuration=v;var O=B.prototype.add,A=B.prototype.subtract;B.prototype.add=function(N,I){return v(N)?b(this,N,1):O.bind(this)(N,I)},B.prototype.subtract=function(N,I){return v(N)?b(this,N,-1):A.bind(this)(N,I)}}})})(Yc);var ID=Yc.exports,TD=tt(ID);ot.extend(yl),ot.extend(ND),ot.extend(OD),ot.extend(TD);class Zc{constructor(e,t,r){U(this,"array");U(this,"color");U(this,"math");U(this,"str");U(this,"map");U(this,"matrix");U(this,"timeframe");U(this,"ta");U(this,"input");U(this,"_variables");U(this,"_cacheData");U(this,"_options");U(this,"_errorListener");U(this,"_plots");U(this,"_plotshapes");U(this,"_plotbars");U(this,"_plotchars");U(this,"_plotarrows");U(this,"_plotcandles");U(this,"_alerts");U(this,"_bgColors");U(this,"_hlines");U(this,"_fills");U(this,"chart");U(this,"line");U(this,"label");U(this,"polyline");U(this,"box");U(this,"table");U(this,"linefill");U(this,"log");U(this,"runtime");U(this,"strategy");U(this,"request");U(this,"syminfo");U(this,"_count",0);var i;const n=((i=e.toString().split(".")[1])==null?void 0:i.length)||4;this._variables=t,this._errorListener=new cw,this.array=new g1(this._errorListener),this.math=new m1(n,this._errorListener),this.color=new Gx,this.str=new Ky(this._errorListener,n),this.map=new Xy(this._errorListener),this.timeframe=new Gy(t),this.matrix=new Vy(this._errorListener),this.ta=new Hx(t,this.math,this.timeframe),this._cacheData={},this._options={},this._bgColors={},this._alerts=new Map,this._hlines=new Map,this._fills=new Map,this.input=new Vx(t,this._errorListener,r),this._plots=new Map,this._plotshapes=new Map,this._plotbars=new Map,this._plotcandles=new Map,this._plotchars=new Map,this._plotarrows=new Map,this.chart={point:new Qy(t)},this.line=new DD(t,this._errorListener),this.label=new Jy(t,this._errorListener),this.polyline=new yD(t,this._errorListener),this.box=new bD(t,this._errorListener),this.table=new ED(t,this._errorListener),this.linefill=new wD(t),this.log=new lw(t),this.runtime=new fw(this._errorListener),this.strategy=new BD(this._variables,this._options,e,this._errorListener),this.request=new aw(this._variables,r),this.syminfo=new uw}get errors(){return this._errorListener.errors}options(e){if(e.length)return this._getDataOfBarindex(e);const t=this.input.getInputs(),r=this._alerts.size?[...this._alerts.values()]:void 0;this._alerts.clear();const n=Object.keys(this._bgColors);let i;if(n.length){i={};for(const y of n)i[y]=[...this._bgColors[y].values()]}const a=this._hlines.size?[...this._hlines.values()]:void 0,u=this._fills.size?[...this._fills.values()]:void 0,c=this.log.logs.length?this.log.logs:void 0;this.log.clearLogs(),this._options.scriptType==="strategy"&&Object.assign(this._options,{orders:this.strategy.orders,historyOrders:this.strategy.historyOrders});const f=this._plots.size>0?[...this._plots.values()]:void 0,h=this._plotbars.size>0?[...this._plotbars.values()]:void 0,d=this._plotshapes.size>0?[...this._plotshapes.values()]:void 0,p=this._plotarrows.size>0?[...this._plotarrows.values()]:void 0,v=this._plotcandles.size>0?[...this._plotcandles.values()]:void 0,x=this._plotchars.size>0?[...this._plotchars.values()]:void 0,_=this._getDraws();return Object.assign(this._options,{inputs:t,plots:f,draws:_,alerts:r,colors:i,hlines:a,fills:u,logs:c,plotshapes:d,plotarrows:p,plotcandles:v,plotchars:x,plotbars:h})}_getDataOfBarindex(e){const t=this._alerts.size?[...this._alerts.values()]:void 0;this._alerts.clear();const r=Object.keys(this._bgColors);let n;if(r.length){n={};for(const d of r)n[d]=[...this._bgColors[d].values()].map(p=>{const v=[];for(const x of e){const _=p.colors[x];_&&v.push(_)}return p.colors=v,p})}const i=this._hlines.size?[...this._hlines.values()]:void 0,a=this._fills.size?this._getDataFromBarindex(e,[...this._fills.values()]):void 0,u=this.log.logs.length?this.log.logs:void 0;this.log.clearLogs(),this._options.scriptType==="strategy"&&Object.assign(this._options,{orders:this.strategy.orders,historyOrders:this.strategy.historyOrders});const c=this._getDataFromBarindex(e,[...this._plots.values()]),f=this._plotshapes.size>0?this._getDataFromBarindex(e,[...this._plotshapes.values()]):void 0,h=this._getDrawsFromBarindex(e);return Object.assign(this._options,{plots:c,draws:h,alerts:t,colors:n,hlines:i,fills:a,logs:u,plotshapes:f})}_getDataFromBarindex(e,t){return t.map(r=>{const n=[];for(const i of e){const a=r.data[i];a&&n.push(a)}return r.data=n,{...r}})}_getDraws(){const{line:e,linefill:t,table:r,box:n,polyline:i,label:a}=this._variables,u={};return e.data.length&&(u.lines=e.data),t.data.length&&(u.linefills=t.data),r.data.length&&(u.tables=r.data),n.data.length&&(u.boxes=n.data),i.data.length&&(u.polylines=i.data),a.data.length&&(u.labels=a.data),Object.keys(u).length?u:void 0}_getDrawsFromBarindex(e){const{line:t,linefill:r,table:n,box:i,polyline:a,label:u}=this._variables,c={};return t.data.length&&(c.lines=t.getValOfBarIndex(e)),r.data.length&&(c.linefills=r.getValOfBarIndex(e)),n.data.length&&(c.tables=n.getValOfBarIndex(e)),i.data.length&&(c.boxes=i.getValOfBarIndex(e)),a.data.length&&(c.polylines=a.getValOfBarIndex(e)),u.data.length&&(c.labels=u.getValOfBarIndex(e)),Object.keys(c).length?c:void 0}updateOptions(e){const{inputs:t}=e;t&&t.length&&this.input.update(t)}update(e){const{barIndex:t}=e;this.strategy.updateOptions(),this.math.update(t)}endExecution(){this.strategy.endExecution()}library(e,t){if(!this._variables.bar_index){const r=/^[^\W\d\s][^\W\s]*$/,{title:n}=e;r.test(n)?(Zx.includes(n)||Yx.includes(n))&&this._errorListener.addError(or(Kt.libraryTitleIsKeywordErr,{name:n}),t,Ve.Error):this._errorListener.addError(Kt.libraryTitleErr,t,Ve.Error),this._options.scriptType="library",this._options.library=e}}indicator(e,t){if(!this._variables.bar_index){const{format:r}=e;this._paramVerfiy(r,t,"indicator",[Je.inherit,Je.percent,Je.price,Je.volume]),this._variables.updateMaxLength(e),this._options.scriptType="indicator",this._options.indicator=e}}_paramVerfiy(e="",t,r,n,i="format"){e&&!n.includes(e)&&this._errorListener.addError(or(Kt.paramsErr,{value:e,func:r,param:i,targetVal:`[${n.join(", ")}]`}),t,Ve.Error)}plot(e,t){const{series:r,color:n,...i}=e,{bar_index:a,time:u}=this._variables,c=`plot_${t}`,f=this._plots.get(c),h=(f==null?void 0:f.data)||[],d=r!==void 0&&isNaN(r)?void 0:r;if(h[a]={value:[u,d],itemStyle:{color:n}},this._seriesColorHandle(e,["color"],f),!f){this._count++,this._paramVerfiy(e.format,t,"plot",[Je.percent,Je.price,Je.volume]);const p=n?[n]:void 0;this._plots.set(c,{editable:!0,...i,colors:p,data:h,id:c,zIndex:this._count})}return{type:"plot",key:c}}plotbar(e,t){const{open:r,close:n,low:i,high:a,color:u,...c}=e,{bar_index:f,time:h}=this._variables,d=`plotbar_${t}`,p=this._plotbars.get(d),v=(p==null?void 0:p.data)||[],x=n!==void 0&&isNaN(n)?void 0:n,_=r!==void 0&&isNaN(r)?void 0:r,y=i!==void 0&&isNaN(i)?void 0:i,m=a!==void 0&&isNaN(a)?void 0:a,w=[h,_,x,y,m];if(v[f]={value:w,itemStyle:{color:u}},this._seriesColorHandle(e,["color"],p),!p){this._count++,this._paramVerfiy(e.format,t,"plotbar",[Je.percent,Je.price,Je.volume]);const D=u?[u]:void 0;this._plotbars.set(d,{editable:!0,...c,colors:D,data:v,id:d,zIndex:this._count})}}_verfiyArgs(e,t,r){const{size:n,format:i,location:a,style:u}=e;this._paramVerfiy(u,r,t,Object.values(_r),"style"),this._paramVerfiy(a,r,t,Object.values(_n),"location"),this._paramVerfiy(n,r,t,Object.values(ar),"size"),this._paramVerfiy(i,r,t,[Je.percent,Je.price,Je.volume],"format")}plotchar(e,t){const{series:r,color:n,textcolor:i,location:a=_n.abovebar,...u}=e,{bar_index:c,time:f,high:h,low:d}=this._variables,p=`plotchar_${t}`,v=this._plotchars.get(p),x=(v==null?void 0:v.data)||[],_={value:[f,r],itemStyle:{color:n,textcolor:i},low:d,high:h};x[c]=_,this._seriesColorHandle(e,["color","textcolor"],v),v||(this._count++,this._verfiyArgs(e,"plotchar",t),this._plotchars.set(p,{editable:!0,...u,location:a,data:x,id:p,zIndex:this._count}))}plotarrow(e,t){const{series:r,colorup:n,colordown:i,...a}=e,{bar_index:u,time:c}=this._variables,f=`plotarrow_${t}`,h=this._plotarrows.get(f),d=(h==null?void 0:h.data)||[];d[u]={value:[c,r!==void 0&&isNaN(r)?void 0:r],itemStyle:{colorup:n,colordown:i}},this._seriesColorHandle(e,["colorup","colordown"],h),h||(this._count++,this._paramVerfiy(e.format,t,"plotarrow",[Je.percent,Je.price,Je.volume]),this._plotarrows.set(f,{editable:!0,...a,data:d,id:f,zIndex:this._count}))}plotshape(e,t){const{series:r,color:n,textcolor:i,location:a=_n.abovebar,...u}=e,{bar_index:c,time:f,low:h,high:d}=this._variables,p=`plotshape_${t}`,v=this._plotshapes.get(p),x=(v==null?void 0:v.data)||[],_={value:r,color:n,textcolor:i,time:f,low:h,high:d};if(x[c]=_,this._seriesColorHandle(e,["color","textcolor"],v),!v){this._count++;const y=n?[n]:void 0;this._verfiyArgs(e,"plotshape",t),this._plotshapes.set(p,{editable:!0,...u,data:x,location:a,id:p,colors:y,zIndex:this._count})}}plotcandle(e,t){const{wickcolor:r,bordercolor:n,color:i,close:a,open:u,low:c,high:f,...h}=e,{bar_index:d,time:p}=this._variables,v=`plotcandle_${t}`,x=this._plotcandles.get(v),_=(x==null?void 0:x.data)||[],y=a!==void 0&&isNaN(a)?void 0:a,m=u!==void 0&&isNaN(u)?void 0:u,w=c!==void 0&&isNaN(c)?void 0:c,D=f!==void 0&&isNaN(f)?void 0:f,C=[p,m,y,w,D];_[d]={value:C,wickcolor:r,bordercolor:n,color:i},this._seriesColorHandle(e,["wickcolor","bordercolor","color"],x),x||(this._count++,this._paramVerfiy(e.format,t,"plotcandle",[Je.percent,Je.price,Je.volume]),this._plotcandles.set(v,{editable:!0,...h,data:_,id:v,zIndex:this._count}))}hline(e,t){const r=`hline_${t}`;this._verifyDisplay(e.display,"hline",t);const n=e.display&&!e.display.length?Zt.none:Zt.all;return this._hlines.has(r)||(this._count++,this._hlines.set(r,{id:r,linewidth:1,editable:!0,display:n,...e,zIndex:this._count})),{type:"hline",key:r}}fill(e,t){var b,F,B,M,O,A,N,I,L,k;const{color:r,top_color:n,bottom_color:i,seriesColors:a,hline1:u,hline2:c,plot1:f,plot2:h,...d}=e,{bar_index:p,time:v}=this._variables,x=`fill_${t}`,_=this._fills.get(x),y=(_==null?void 0:_.data)||[];this._verifyDisplay(e.display,"fill",t);const m=e.display&&!e.display.length?Zt.none:Zt.all;let w,D,C="plot";if(u&&c)w=(b=this._hlines.get(u==null?void 0:u.key))==null?void 0:b.price,D=(F=this._hlines.get(c==null?void 0:c.key))==null?void 0:F.price,C="hline";else{const z=((B=this._plots.get(f==null?void 0:f.key))==null?void 0:B.data)||[],R=((M=this._plots.get(h==null?void 0:h.key))==null?void 0:M.data)||[];w=(A=(O=z[p])==null?void 0:O.value)==null?void 0:A[1],D=(I=(N=R[p])==null?void 0:N.value)==null?void 0:I[1]}if(y[p]={time:v,color:r,top_color:n,bottom_color:i,plot1:w,plot2:D},this._seriesColorHandle(e,["color","top_color","bottom_color"],_),!_){this._count++;const z=((L=this._options.indicator)==null?void 0:L.explicit_plot_zorder)||((k=this._options.strategy)==null?void 0:k.explicit_plot_zorder),R=r?[r]:void 0,G=n?[n]:void 0,H=i?[i]:void 0;this._fills.set(x,{id:x,colors:R,top_colors:G,bottom_colors:H,display:m,data:y,type:C,editable:!0,fillgaps:!1,hline1:u,hline2:c,plot1:f,plot2:h,...d,zIndex:z?this._count:void 0})}}alert({message:e,freq:t=Vr.freqOncePerBar},r){const{bar_index:n,_isRealTimeBar:i,last_bar_index:a}=this._variables,u=`alert_${r}`,c=this._cacheData[u]||{},f=c.barIndex;if(this._paramVerfiy(t,r,"alert",[Vr.freqAll,Vr.freqOncePerBar,Vr.freqOncePerBarClose]),t===Vr.freqOncePerBar&&n===f){this._alerts.delete(u);return}this._cacheData[u]=c;const h={message:e,freq:t,id:u,type:"alert"};if(i){t!==Vr.freqOncePerBarClose&&this._alerts.set(u,h),c.barIndex=n;return}if(!i&&t===Vr.freqOncePerBarClose&&n===f&&a===n-1){this._alerts.set(u,h),c.barIndex=n;return}this._alerts.delete(u)}alertcondition({condition:e,message:t,title:r},n){const{_isRealTimeBar:i}=this._variables,a=`alertcondition_${n}`;i&&e?this._alerts.set(a,{message:t,title:r,id:a,type:"alertcondition"}):this._alerts.delete(a)}barcolor(e,t){this._setColors(e,"barcolor",t)}bgcolor(e,t){this._setColors(e,"bgcolor",t)}_verifyDisplay(e=qc.all,t,r){e.length&&e.length<4&&this._errorListener.addError(or(Kt.displayErr,{func:t,values:"[display.none, display.all]"}),r,Ve.Error)}_setColors(e,t,r){const{color:n,seriesColors:i,...a}=e;this._verifyDisplay(a.display,t,r);const u=e.display&&!e.display.length?Zt.none:Zt.all,{bar_index:c,time:f}=this._variables,h=`${t}_${r}`;this._bgColors[t]||(this._bgColors[t]=new Map);const d=this._bgColors[t].get(h),p=(d==null?void 0:d.colors)||[],v=(d==null?void 0:d.setColors)||[];n&&!v.includes(n)&&v.push(n),p[c]={color:n,time:f},d||this._bgColors[t].set(h,{...a,display:u,colors:p,setColors:v,id:h})}max_bars_back({var:e,num:t,var_name:r}){console.log(e,t,r)}float({x:e}){return e}bool({x:e}){return e||!1}string({x:e}){return e}int({x:e}){return e&&Math.trunc(e)}na({x:e}){return!!(e===void 0||isNaN(e))}fixnan({source:e},t){return e===void 0||isNaN(e)?this._cacheData[`fixnan_${t}`]:(this._cacheData[`fixnan_${t}`]=e,e)}nz({source:e,replacement:t}){return e!==void 0&&!isNaN(e)?e:t||0}time({timeframe:e="",session:t,timezone:r,bars_back:n=0},i){return this._timeHandle(this._variables.time,i,e,t,r,n)}time_close({timeframe:e="",session:t,timezone:r,bars_back:n=0},i){return this._variables.time_close&&this._timeHandle(this._variables.time_close,i,e,t,r,n)}timestamp(e){const{dateString:t,timezone:r,year:n,month:i,day:a,hour:u=0,minute:c=0,second:f=0}=e;if(t)return ot(t).utc(!/GMT|UTC/.test(t)).valueOf();let h=i-1,d=n;if(h<0){const v=Math.ceil(Math.abs(h/12));h=12*v+h,d=n-v}let p=ot({year:d,month:h,day:a,hour:u,minute:c,second:f});return r&&(p=Zr(p.utc(!0).valueOf(),r)),p.utc(!0).valueOf()}weekofyear({time:e,timezone:t}){return Zr(e,t).week()}year({time:e,timezone:t}){return Zr(e,t).year()}second({time:e,timezone:t}){return Zr(e,t).second()}month({time:e,timezone:t}){return Zr(e,t).month()+1}minute({time:e,timezone:t}){return Zr(e,t).minute()}hour({time:e,timezone:t}){return Zr(e,t).hour()}dayofweek({time:e,timezone:t}){return Zr(e,t).day()+1}dayofmonth({time:e,timezone:t}){return Zr(e,t).date()}_calcTimeOffset(e,t){const r=this._variables.getTimeTradingday(e,t),n=pn(t)*1e3;return e-r-Math.floor((e-r)/n)*n}_timeHandle(e,t,r="",n,i,a=0){const u=r||this._variables.timeframe.period,c=pn(u),f=pn(this._variables.timeframe.period);let h;if(c<=f)h=e;else{const d=`time_${t}`,p=this._cacheData[d];if(p)p.currentTime+c*1e3-p.offset<=e?(h=e,this._cacheData[d]={currentTime:e,offset:0}):h=p;else{const v=this._calcTimeOffset(e,u);this._cacheData[d]={currentTime:e,offset:v},h=e}}if(n){const{timePeriods:d,weeks:p}=this._parserSession(n,t),v=ot(e).format("YYYY-MM-DD"),x=h;h=void 0;for(const y of d){const[m,w]=y;if(ot(e).isBetween(`${v} ${m}`,`${v} ${w}`,"hour")){ot(x).isBetween(`${v} ${m}`,`${v} ${w}`,"hour")?h=x:h=ot(`${v} ${m}`).valueOf();break}}const _=this._variables.dayofweek;h&&!p.includes(_)&&(h=void 0)}return i&&(h=h&&Zr(h,i).valueOf()),h&&h-a*f*1e3}_seriesColorHandle(e,t,r){var n;if(r&&t!=null&&t.length)for(const i of t){if((n=r.gradientColorKeys)!=null&&n.includes(i))continue;const a=e[i];if(!a)continue;const u=r[`${i}s`]||[];u.includes(a)||(u.push(a),r[`${i}s`]=u,u.length>5&&(r[`${i}s`]=[],r.gradientColorKeys=r.gradientColorKeys||[],r.gradientColorKeys.push(i)))}}_parserSession(e,t){const r=e.split(":"),n=r[0],a=(r[1]||"1234567").split("").map(c=>{const f=parseInt(c,10);if(f<1||f>7){this._errorListener.addError(`Invalid day of week: ${c}`,t,Ve.Error);return}return f});return{timePeriods:n.split(",").map(c=>{const f=c.split("-");return f.length!==2?(this._errorListener.addError(`Invalid time period: ${c}`,t,Ve.Error),[]):[this._processTime(f[0],t),this._processTime(f[1],t)]}),weeks:a}}_processTime(e,t){const r=parseInt(e.slice(0,2),10),n=parseInt(e.slice(2),10);if(!(r>=0&&r<=23)&&n>=0&&n<=59){this._errorListener.addError("Invalid time: Time must be within 00:00 to 23:59",t,Ve.Error);return}return`${r}:${n}`}}var Vc={exports:{}};function $D(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var su={exports:{}},Gc;function Ge(){return Gc||(Gc=1,function(s,e){(function(t,r){s.exports=r()})(ye,function(){var t=t||function(r,n){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof ye<"u"&&ye.crypto&&(i=ye.crypto),!i&&typeof $D=="function")try{i=bx}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},u=Object.create||function(){function w(){}return function(D){var C;return w.prototype=D,C=new w,w.prototype=null,C}}(),c={},f=c.lib={},h=f.Base=function(){return{extend:function(w){var D=u(this);return w&&D.mixIn(w),(!D.hasOwnProperty("init")||this.init===D.init)&&(D.init=function(){D.$super.init.apply(this,arguments)}),D.init.prototype=D,D.$super=this,D},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var D in w)w.hasOwnProperty(D)&&(this[D]=w[D]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=f.WordArray=h.extend({init:function(w,D){w=this.words=w||[],D!=n?this.sigBytes=D:this.sigBytes=w.length*4},toString:function(w){return(w||v).stringify(this)},concat:function(w){var D=this.words,C=w.words,b=this.sigBytes,F=w.sigBytes;if(this.clamp(),b%4)for(var B=0;B<F;B++){var M=C[B>>>2]>>>24-B%4*8&255;D[b+B>>>2]|=M<<24-(b+B)%4*8}else for(var O=0;O<F;O+=4)D[b+O>>>2]=C[O>>>2];return this.sigBytes+=F,this},clamp:function(){var w=this.words,D=this.sigBytes;w[D>>>2]&=4294967295<<32-D%4*8,w.length=r.ceil(D/4)},clone:function(){var w=h.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var D=[],C=0;C<w;C+=4)D.push(a());return new d.init(D,w)}}),p=c.enc={},v=p.Hex={stringify:function(w){for(var D=w.words,C=w.sigBytes,b=[],F=0;F<C;F++){var B=D[F>>>2]>>>24-F%4*8&255;b.push((B>>>4).toString(16)),b.push((B&15).toString(16))}return b.join("")},parse:function(w){for(var D=w.length,C=[],b=0;b<D;b+=2)C[b>>>3]|=parseInt(w.substr(b,2),16)<<24-b%8*4;return new d.init(C,D/2)}},x=p.Latin1={stringify:function(w){for(var D=w.words,C=w.sigBytes,b=[],F=0;F<C;F++){var B=D[F>>>2]>>>24-F%4*8&255;b.push(String.fromCharCode(B))}return b.join("")},parse:function(w){for(var D=w.length,C=[],b=0;b<D;b++)C[b>>>2]|=(w.charCodeAt(b)&255)<<24-b%4*8;return new d.init(C,D)}},_=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(x.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return x.parse(unescape(encodeURIComponent(w)))}},y=f.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=_.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var D,C=this._data,b=C.words,F=C.sigBytes,B=this.blockSize,M=B*4,O=F/M;w?O=r.ceil(O):O=r.max((O|0)-this._minBufferSize,0);var A=O*B,N=r.min(A*4,F);if(A){for(var I=0;I<A;I+=B)this._doProcessBlock(b,I);D=b.splice(0,A),C.sigBytes-=N}return new d.init(D,N)},clone:function(){var w=h.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});f.Hasher=y.extend({cfg:h.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var D=this._doFinalize();return D},blockSize:16,_createHelper:function(w){return function(D,C){return new w.init(C).finalize(D)}},_createHmacHelper:function(w){return function(D,C){return new m.HMAC.init(w,C).finalize(D)}}});var m=c.algo={};return c}(Math);return t})}(su)),su.exports}var ou={exports:{}},Kc;function Bo(){return Kc||(Kc=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.Base,u=i.WordArray,c=n.x64={};c.Word=a.extend({init:function(f,h){this.high=f,this.low=h}}),c.WordArray=a.extend({init:function(f,h){f=this.words=f||[],h!=r?this.sigBytes=h:this.sigBytes=f.length*8},toX32:function(){for(var f=this.words,h=f.length,d=[],p=0;p<h;p++){var v=f[p];d.push(v.high),d.push(v.low)}return u.create(d,this.sigBytes)},clone:function(){for(var f=a.clone.call(this),h=f.words=this.words.slice(0),d=h.length,p=0;p<d;p++)h[p]=h[p].clone();return f}})}(),t})}(ou)),ou.exports}var au={exports:{}},Xc;function LD(){return Xc||(Xc=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){if(typeof ArrayBuffer=="function"){var r=t,n=r.lib,i=n.WordArray,a=i.init,u=i.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var f=c.byteLength,h=[],d=0;d<f;d++)h[d>>>2]|=c[d]<<24-d%4*8;a.call(this,h,f)}else a.apply(this,arguments)};u.prototype=i}}(),t.lib.WordArray})}(au)),au.exports}var uu={exports:{}},Qc;function RD(){return Qc||(Qc=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(c){for(var f=c.words,h=c.sigBytes,d=[],p=0;p<h;p+=2){var v=f[p>>>2]>>>16-p%4*8&65535;d.push(String.fromCharCode(v))}return d.join("")},parse:function(c){for(var f=c.length,h=[],d=0;d<f;d++)h[d>>>1]|=c.charCodeAt(d)<<16-d%2*16;return i.create(h,f*2)}},a.Utf16LE={stringify:function(c){for(var f=c.words,h=c.sigBytes,d=[],p=0;p<h;p+=2){var v=u(f[p>>>2]>>>16-p%4*8&65535);d.push(String.fromCharCode(v))}return d.join("")},parse:function(c){for(var f=c.length,h=[],d=0;d<f;d++)h[d>>>1]|=u(c.charCodeAt(d)<<16-d%2*16);return i.create(h,f*2)}};function u(c){return c<<8&4278255360|c>>>8&16711935}}(),t.enc.Utf16})}(uu)),uu.exports}var lu={exports:{}},Jc;function oi(){return Jc||(Jc=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(c){var f=c.words,h=c.sigBytes,d=this._map;c.clamp();for(var p=[],v=0;v<h;v+=3)for(var x=f[v>>>2]>>>24-v%4*8&255,_=f[v+1>>>2]>>>24-(v+1)%4*8&255,y=f[v+2>>>2]>>>24-(v+2)%4*8&255,m=x<<16|_<<8|y,w=0;w<4&&v+w*.75<h;w++)p.push(d.charAt(m>>>6*(3-w)&63));var D=d.charAt(64);if(D)for(;p.length%4;)p.push(D);return p.join("")},parse:function(c){var f=c.length,h=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<h.length;p++)d[h.charCodeAt(p)]=p}var v=h.charAt(64);if(v){var x=c.indexOf(v);x!==-1&&(f=x)}return u(c,f,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function u(c,f,h){for(var d=[],p=0,v=0;v<f;v++)if(v%4){var x=h[c.charCodeAt(v-1)]<<v%4*2,_=h[c.charCodeAt(v)]>>>6-v%4*2,y=x|_;d[p>>>2]|=y<<24-p%4*8,p++}return i.create(d,p)}}(),t.enc.Base64})}(lu)),lu.exports}var fu={exports:{}},eh;function PD(){return eh||(eh=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.enc;a.Base64url={stringify:function(c,f){f===void 0&&(f=!0);var h=c.words,d=c.sigBytes,p=f?this._safe_map:this._map;c.clamp();for(var v=[],x=0;x<d;x+=3)for(var _=h[x>>>2]>>>24-x%4*8&255,y=h[x+1>>>2]>>>24-(x+1)%4*8&255,m=h[x+2>>>2]>>>24-(x+2)%4*8&255,w=_<<16|y<<8|m,D=0;D<4&&x+D*.75<d;D++)v.push(p.charAt(w>>>6*(3-D)&63));var C=p.charAt(64);if(C)for(;v.length%4;)v.push(C);return v.join("")},parse:function(c,f){f===void 0&&(f=!0);var h=c.length,d=f?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v<d.length;v++)p[d.charCodeAt(v)]=v}var x=d.charAt(64);if(x){var _=c.indexOf(x);_!==-1&&(h=_)}return u(c,h,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function u(c,f,h){for(var d=[],p=0,v=0;v<f;v++)if(v%4){var x=h[c.charCodeAt(v-1)]<<v%4*2,_=h[c.charCodeAt(v)]>>>6-v%4*2,y=x|_;d[p>>>2]|=y<<24-p%4*8,p++}return i.create(d,p)}}(),t.enc.Base64url})}(fu)),fu.exports}var cu={exports:{}},th;function ai(){return th||(th=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,c=n.algo,f=[];(function(){for(var _=0;_<64;_++)f[_]=r.abs(r.sin(_+1))*4294967296|0})();var h=c.MD5=u.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(_,y){for(var m=0;m<16;m++){var w=y+m,D=_[w];_[w]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}var C=this._hash.words,b=_[y+0],F=_[y+1],B=_[y+2],M=_[y+3],O=_[y+4],A=_[y+5],N=_[y+6],I=_[y+7],L=_[y+8],k=_[y+9],z=_[y+10],R=_[y+11],G=_[y+12],H=_[y+13],ee=_[y+14],te=_[y+15],j=C[0],X=C[1],Y=C[2],Q=C[3];j=d(j,X,Y,Q,b,7,f[0]),Q=d(Q,j,X,Y,F,12,f[1]),Y=d(Y,Q,j,X,B,17,f[2]),X=d(X,Y,Q,j,M,22,f[3]),j=d(j,X,Y,Q,O,7,f[4]),Q=d(Q,j,X,Y,A,12,f[5]),Y=d(Y,Q,j,X,N,17,f[6]),X=d(X,Y,Q,j,I,22,f[7]),j=d(j,X,Y,Q,L,7,f[8]),Q=d(Q,j,X,Y,k,12,f[9]),Y=d(Y,Q,j,X,z,17,f[10]),X=d(X,Y,Q,j,R,22,f[11]),j=d(j,X,Y,Q,G,7,f[12]),Q=d(Q,j,X,Y,H,12,f[13]),Y=d(Y,Q,j,X,ee,17,f[14]),X=d(X,Y,Q,j,te,22,f[15]),j=p(j,X,Y,Q,F,5,f[16]),Q=p(Q,j,X,Y,N,9,f[17]),Y=p(Y,Q,j,X,R,14,f[18]),X=p(X,Y,Q,j,b,20,f[19]),j=p(j,X,Y,Q,A,5,f[20]),Q=p(Q,j,X,Y,z,9,f[21]),Y=p(Y,Q,j,X,te,14,f[22]),X=p(X,Y,Q,j,O,20,f[23]),j=p(j,X,Y,Q,k,5,f[24]),Q=p(Q,j,X,Y,ee,9,f[25]),Y=p(Y,Q,j,X,M,14,f[26]),X=p(X,Y,Q,j,L,20,f[27]),j=p(j,X,Y,Q,H,5,f[28]),Q=p(Q,j,X,Y,B,9,f[29]),Y=p(Y,Q,j,X,I,14,f[30]),X=p(X,Y,Q,j,G,20,f[31]),j=v(j,X,Y,Q,A,4,f[32]),Q=v(Q,j,X,Y,L,11,f[33]),Y=v(Y,Q,j,X,R,16,f[34]),X=v(X,Y,Q,j,ee,23,f[35]),j=v(j,X,Y,Q,F,4,f[36]),Q=v(Q,j,X,Y,O,11,f[37]),Y=v(Y,Q,j,X,I,16,f[38]),X=v(X,Y,Q,j,z,23,f[39]),j=v(j,X,Y,Q,H,4,f[40]),Q=v(Q,j,X,Y,b,11,f[41]),Y=v(Y,Q,j,X,M,16,f[42]),X=v(X,Y,Q,j,N,23,f[43]),j=v(j,X,Y,Q,k,4,f[44]),Q=v(Q,j,X,Y,G,11,f[45]),Y=v(Y,Q,j,X,te,16,f[46]),X=v(X,Y,Q,j,B,23,f[47]),j=x(j,X,Y,Q,b,6,f[48]),Q=x(Q,j,X,Y,I,10,f[49]),Y=x(Y,Q,j,X,ee,15,f[50]),X=x(X,Y,Q,j,A,21,f[51]),j=x(j,X,Y,Q,G,6,f[52]),Q=x(Q,j,X,Y,M,10,f[53]),Y=x(Y,Q,j,X,z,15,f[54]),X=x(X,Y,Q,j,F,21,f[55]),j=x(j,X,Y,Q,L,6,f[56]),Q=x(Q,j,X,Y,te,10,f[57]),Y=x(Y,Q,j,X,N,15,f[58]),X=x(X,Y,Q,j,H,21,f[59]),j=x(j,X,Y,Q,O,6,f[60]),Q=x(Q,j,X,Y,R,10,f[61]),Y=x(Y,Q,j,X,B,15,f[62]),X=x(X,Y,Q,j,k,21,f[63]),C[0]=C[0]+j|0,C[1]=C[1]+X|0,C[2]=C[2]+Y|0,C[3]=C[3]+Q|0},_doFinalize:function(){var _=this._data,y=_.words,m=this._nDataBytes*8,w=_.sigBytes*8;y[w>>>5]|=128<<24-w%32;var D=r.floor(m/4294967296),C=m;y[(w+64>>>9<<4)+15]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,y[(w+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,_.sigBytes=(y.length+1)*4,this._process();for(var b=this._hash,F=b.words,B=0;B<4;B++){var M=F[B];F[B]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var _=u.clone.call(this);return _._hash=this._hash.clone(),_}});function d(_,y,m,w,D,C,b){var F=_+(y&m|~y&w)+D+b;return(F<<C|F>>>32-C)+y}function p(_,y,m,w,D,C,b){var F=_+(y&w|m&~w)+D+b;return(F<<C|F>>>32-C)+y}function v(_,y,m,w,D,C,b){var F=_+(y^m^w)+D+b;return(F<<C|F>>>32-C)+y}function x(_,y,m,w,D,C,b){var F=_+(m^(y|~w))+D+b;return(F<<C|F>>>32-C)+y}n.MD5=u._createHelper(h),n.HmacMD5=u._createHmacHelper(h)}(Math),t.MD5})}(cu)),cu.exports}var hu={exports:{}},rh;function nh(){return rh||(rh=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=n.Hasher,u=r.algo,c=[],f=u.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(h,d){for(var p=this._hash.words,v=p[0],x=p[1],_=p[2],y=p[3],m=p[4],w=0;w<80;w++){if(w<16)c[w]=h[d+w]|0;else{var D=c[w-3]^c[w-8]^c[w-14]^c[w-16];c[w]=D<<1|D>>>31}var C=(v<<5|v>>>27)+m+c[w];w<20?C+=(x&_|~x&y)+1518500249:w<40?C+=(x^_^y)+1859775393:w<60?C+=(x&_|x&y|_&y)-1894007588:C+=(x^_^y)-899497514,m=y,y=_,_=x<<30|x>>>2,x=v,v=C}p[0]=p[0]+v|0,p[1]=p[1]+x|0,p[2]=p[2]+_|0,p[3]=p[3]+y|0,p[4]=p[4]+m|0},_doFinalize:function(){var h=this._data,d=h.words,p=this._nDataBytes*8,v=h.sigBytes*8;return d[v>>>5]|=128<<24-v%32,d[(v+64>>>9<<4)+14]=Math.floor(p/4294967296),d[(v+64>>>9<<4)+15]=p,h.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});r.SHA1=a._createHelper(f),r.HmacSHA1=a._createHmacHelper(f)}(),t.SHA1})}(hu)),hu.exports}var du={exports:{}},ih;function pu(){return ih||(ih=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,c=n.algo,f=[],h=[];(function(){function v(m){for(var w=r.sqrt(m),D=2;D<=w;D++)if(!(m%D))return!1;return!0}function x(m){return(m-(m|0))*4294967296|0}for(var _=2,y=0;y<64;)v(_)&&(y<8&&(f[y]=x(r.pow(_,1/2))),h[y]=x(r.pow(_,1/3)),y++),_++})();var d=[],p=c.SHA256=u.extend({_doReset:function(){this._hash=new a.init(f.slice(0))},_doProcessBlock:function(v,x){for(var _=this._hash.words,y=_[0],m=_[1],w=_[2],D=_[3],C=_[4],b=_[5],F=_[6],B=_[7],M=0;M<64;M++){if(M<16)d[M]=v[x+M]|0;else{var O=d[M-15],A=(O<<25|O>>>7)^(O<<14|O>>>18)^O>>>3,N=d[M-2],I=(N<<15|N>>>17)^(N<<13|N>>>19)^N>>>10;d[M]=A+d[M-7]+I+d[M-16]}var L=C&b^~C&F,k=y&m^y&w^m&w,z=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),R=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),G=B+R+L+h[M]+d[M],H=z+k;B=F,F=b,b=C,C=D+G|0,D=w,w=m,m=y,y=G+H|0}_[0]=_[0]+y|0,_[1]=_[1]+m|0,_[2]=_[2]+w|0,_[3]=_[3]+D|0,_[4]=_[4]+C|0,_[5]=_[5]+b|0,_[6]=_[6]+F|0,_[7]=_[7]+B|0},_doFinalize:function(){var v=this._data,x=v.words,_=this._nDataBytes*8,y=v.sigBytes*8;return x[y>>>5]|=128<<24-y%32,x[(y+64>>>9<<4)+14]=r.floor(_/4294967296),x[(y+64>>>9<<4)+15]=_,v.sigBytes=x.length*4,this._process(),this._hash},clone:function(){var v=u.clone.call(this);return v._hash=this._hash.clone(),v}});n.SHA256=u._createHelper(p),n.HmacSHA256=u._createHmacHelper(p)}(Math),t.SHA256})}(du)),du.exports}var _u={exports:{}},sh;function kD(){return sh||(sh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),pu())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=r.algo,u=a.SHA256,c=a.SHA224=u.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var f=u._doFinalize.call(this);return f.sigBytes-=4,f}});r.SHA224=u._createHelper(c),r.HmacSHA224=u._createHmacHelper(c)}(),t.SHA224})}(_u)),_u.exports}var vu={exports:{}},oh;function ah(){return oh||(oh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.Hasher,a=r.x64,u=a.Word,c=a.WordArray,f=r.algo;function h(){return u.create.apply(u,arguments)}var d=[h(1116352408,3609767458),h(1899447441,602891725),h(3049323471,3964484399),h(3921009573,2173295548),h(961987163,4081628472),h(1508970993,3053834265),h(2453635748,2937671579),h(2870763221,3664609560),h(3624381080,2734883394),h(310598401,1164996542),h(607225278,1323610764),h(1426881987,3590304994),h(1925078388,4068182383),h(2162078206,991336113),h(2614888103,633803317),h(3248222580,3479774868),h(3835390401,2666613458),h(4022224774,944711139),h(264347078,2341262773),h(604807628,2007800933),h(770255983,1495990901),h(1249150122,1856431235),h(1555081692,3175218132),h(1996064986,2198950837),h(2554220882,3999719339),h(2821834349,766784016),h(2952996808,2566594879),h(3210313671,3203337956),h(3336571891,1034457026),h(3584528711,2466948901),h(113926993,3758326383),h(338241895,168717936),h(666307205,1188179964),h(773529912,1546045734),h(1294757372,1522805485),h(1396182291,2643833823),h(1695183700,2343527390),h(1986661051,1014477480),h(2177026350,1206759142),h(2456956037,344077627),h(2730485921,1290863460),h(2820302411,3158454273),h(3259730800,3505952657),h(3345764771,106217008),h(3516065817,3606008344),h(3600352804,1432725776),h(4094571909,1467031594),h(275423344,851169720),h(430227734,3100823752),h(506948616,1363258195),h(659060556,3750685593),h(883997877,3785050280),h(958139571,3318307427),h(1322822218,3812723403),h(1537002063,2003034995),h(1747873779,3602036899),h(1955562222,1575990012),h(2024104815,1125592928),h(2227730452,2716904306),h(2361852424,442776044),h(2428436474,593698344),h(2756734187,3733110249),h(3204031479,2999351573),h(3329325298,3815920427),h(3391569614,3928383900),h(3515267271,566280711),h(3940187606,3454069534),h(4118630271,4000239992),h(116418474,1914138554),h(174292421,2731055270),h(289380356,3203993006),h(460393269,320620315),h(685471733,587496836),h(852142971,1086792851),h(1017036298,365543100),h(1126000580,2618297676),h(1288033470,3409855158),h(1501505948,4234509866),h(1607167915,987167468),h(1816402316,1246189591)],p=[];(function(){for(var x=0;x<80;x++)p[x]=h()})();var v=f.SHA512=i.extend({_doReset:function(){this._hash=new c.init([new u.init(1779033703,4089235720),new u.init(3144134277,2227873595),new u.init(1013904242,4271175723),new u.init(2773480762,1595750129),new u.init(1359893119,2917565137),new u.init(2600822924,725511199),new u.init(528734635,4215389547),new u.init(1541459225,327033209)])},_doProcessBlock:function(x,_){for(var y=this._hash.words,m=y[0],w=y[1],D=y[2],C=y[3],b=y[4],F=y[5],B=y[6],M=y[7],O=m.high,A=m.low,N=w.high,I=w.low,L=D.high,k=D.low,z=C.high,R=C.low,G=b.high,H=b.low,ee=F.high,te=F.low,j=B.high,X=B.low,Y=M.high,Q=M.low,pe=O,De=A,we=N,be=I,Oe=L,Fe=k,nt=z,Ye=R,Ie=G,Le=H,xt=ee,Ut=te,Et=j,lr=X,Rr=Y,fr=Q,yt=0;yt<80;yt++){var Ot,P,V=p[yt];if(yt<16)P=V.high=x[_+yt*2]|0,Ot=V.low=x[_+yt*2+1]|0;else{var J=p[yt-15],ie=J.high,ue=J.low,se=(ie>>>1|ue<<31)^(ie>>>8|ue<<24)^ie>>>7,_e=(ue>>>1|ie<<31)^(ue>>>8|ie<<24)^(ue>>>7|ie<<25),he=p[yt-2],de=he.high,ce=he.low,Xe=(de>>>19|ce<<13)^(de<<3|ce>>>29)^de>>>6,et=(ce>>>19|de<<13)^(ce<<3|de>>>29)^(ce>>>6|de<<26),ht=p[yt-7],kt=ht.high,It=ht.low,rr=p[yt-16],cr=rr.high,en=rr.low;Ot=_e+It,P=se+kt+(Ot>>>0<_e>>>0?1:0),Ot=Ot+et,P=P+Xe+(Ot>>>0<et>>>0?1:0),Ot=Ot+en,P=P+cr+(Ot>>>0<en>>>0?1:0),V.high=P,V.low=Ot}var Dn=Ie&xt^~Ie&Et,li=Le&Ut^~Le&lr,vs=pe&we^pe&Oe^we&Oe,gs=De&be^De&Fe^be&Fe,ms=(pe>>>28|De<<4)^(pe<<30|De>>>2)^(pe<<25|De>>>7),Ri=(De>>>28|pe<<4)^(De<<30|pe>>>2)^(De<<25|pe>>>7),Pi=(Ie>>>14|Le<<18)^(Ie>>>18|Le<<14)^(Ie<<23|Le>>>9),xs=(Le>>>14|Ie<<18)^(Le>>>18|Ie<<14)^(Le<<23|Ie>>>9),ki=d[yt],ys=ki.high,zn=ki.low,Xt=fr+xs,mr=Rr+Pi+(Xt>>>0<fr>>>0?1:0),Xt=Xt+li,mr=mr+Dn+(Xt>>>0<li>>>0?1:0),Xt=Xt+zn,mr=mr+ys+(Xt>>>0<zn>>>0?1:0),Xt=Xt+Ot,mr=mr+P+(Xt>>>0<Ot>>>0?1:0),zi=Ri+gs,Ds=ms+vs+(zi>>>0<Ri>>>0?1:0);Rr=Et,fr=lr,Et=xt,lr=Ut,xt=Ie,Ut=Le,Le=Ye+Xt|0,Ie=nt+mr+(Le>>>0<Ye>>>0?1:0)|0,nt=Oe,Ye=Fe,Oe=we,Fe=be,we=pe,be=De,De=Xt+zi|0,pe=mr+Ds+(De>>>0<Xt>>>0?1:0)|0}A=m.low=A+De,m.high=O+pe+(A>>>0<De>>>0?1:0),I=w.low=I+be,w.high=N+we+(I>>>0<be>>>0?1:0),k=D.low=k+Fe,D.high=L+Oe+(k>>>0<Fe>>>0?1:0),R=C.low=R+Ye,C.high=z+nt+(R>>>0<Ye>>>0?1:0),H=b.low=H+Le,b.high=G+Ie+(H>>>0<Le>>>0?1:0),te=F.low=te+Ut,F.high=ee+xt+(te>>>0<Ut>>>0?1:0),X=B.low=X+lr,B.high=j+Et+(X>>>0<lr>>>0?1:0),Q=M.low=Q+fr,M.high=Y+Rr+(Q>>>0<fr>>>0?1:0)},_doFinalize:function(){var x=this._data,_=x.words,y=this._nDataBytes*8,m=x.sigBytes*8;_[m>>>5]|=128<<24-m%32,_[(m+128>>>10<<5)+30]=Math.floor(y/4294967296),_[(m+128>>>10<<5)+31]=y,x.sigBytes=_.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var x=i.clone.call(this);return x._hash=this._hash.clone(),x},blockSize:1024/32});r.SHA512=i._createHelper(v),r.HmacSHA512=i._createHmacHelper(v)}(),t.SHA512})}(vu)),vu.exports}var gu={exports:{}},uh;function zD(){return uh||(uh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo(),ah())})(ye,function(t){return function(){var r=t,n=r.x64,i=n.Word,a=n.WordArray,u=r.algo,c=u.SHA512,f=u.SHA384=c.extend({_doReset:function(){this._hash=new a.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var h=c._doFinalize.call(this);return h.sigBytes-=16,h}});r.SHA384=c._createHelper(f),r.HmacSHA384=c._createHmacHelper(f)}(),t.SHA384})}(gu)),gu.exports}var mu={exports:{}},lh;function qD(){return lh||(lh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,c=n.x64,f=c.Word,h=n.algo,d=[],p=[],v=[];(function(){for(var y=1,m=0,w=0;w<24;w++){d[y+5*m]=(w+1)*(w+2)/2%64;var D=m%5,C=(2*y+3*m)%5;y=D,m=C}for(var y=0;y<5;y++)for(var m=0;m<5;m++)p[y+5*m]=m+(2*y+3*m)%5*5;for(var b=1,F=0;F<24;F++){for(var B=0,M=0,O=0;O<7;O++){if(b&1){var A=(1<<O)-1;A<32?M^=1<<A:B^=1<<A-32}b&128?b=b<<1^113:b<<=1}v[F]=f.create(B,M)}})();var x=[];(function(){for(var y=0;y<25;y++)x[y]=f.create()})();var _=h.SHA3=u.extend({cfg:u.cfg.extend({outputLength:512}),_doReset:function(){for(var y=this._state=[],m=0;m<25;m++)y[m]=new f.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(y,m){for(var w=this._state,D=this.blockSize/2,C=0;C<D;C++){var b=y[m+2*C],F=y[m+2*C+1];b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,F=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360;var B=w[C];B.high^=F,B.low^=b}for(var M=0;M<24;M++){for(var O=0;O<5;O++){for(var A=0,N=0,I=0;I<5;I++){var B=w[O+5*I];A^=B.high,N^=B.low}var L=x[O];L.high=A,L.low=N}for(var O=0;O<5;O++)for(var k=x[(O+4)%5],z=x[(O+1)%5],R=z.high,G=z.low,A=k.high^(R<<1|G>>>31),N=k.low^(G<<1|R>>>31),I=0;I<5;I++){var B=w[O+5*I];B.high^=A,B.low^=N}for(var H=1;H<25;H++){var A,N,B=w[H],ee=B.high,te=B.low,j=d[H];j<32?(A=ee<<j|te>>>32-j,N=te<<j|ee>>>32-j):(A=te<<j-32|ee>>>64-j,N=ee<<j-32|te>>>64-j);var X=x[p[H]];X.high=A,X.low=N}var Y=x[0],Q=w[0];Y.high=Q.high,Y.low=Q.low;for(var O=0;O<5;O++)for(var I=0;I<5;I++){var H=O+5*I,B=w[H],pe=x[H],De=x[(O+1)%5+5*I],we=x[(O+2)%5+5*I];B.high=pe.high^~De.high&we.high,B.low=pe.low^~De.low&we.low}var B=w[0],be=v[M];B.high^=be.high,B.low^=be.low}},_doFinalize:function(){var y=this._data,m=y.words;this._nDataBytes*8;var w=y.sigBytes*8,D=this.blockSize*32;m[w>>>5]|=1<<24-w%32,m[(r.ceil((w+1)/D)*D>>>5)-1]|=128,y.sigBytes=m.length*4,this._process();for(var C=this._state,b=this.cfg.outputLength/8,F=b/8,B=[],M=0;M<F;M++){var O=C[M],A=O.high,N=O.low;A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,B.push(N),B.push(A)}return new a.init(B,b)},clone:function(){for(var y=u.clone.call(this),m=y._state=this._state.slice(0),w=0;w<25;w++)m[w]=m[w].clone();return y}});n.SHA3=u._createHelper(_),n.HmacSHA3=u._createHmacHelper(_)}(Math),t.SHA3})}(mu)),mu.exports}var xu={exports:{}},fh;function UD(){return fh||(fh=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){/** @preserve
63
63
  (c) 2012 by Cédric Mesnil. All rights reserved.
64
64
 
65
65
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -68,13 +68,13 @@ ${Ff}`)}function oy(s,e,t){return(s>=0&&t?` ${Mf(s,e-1)}`:Mf(s,e)).padEnd(e)}fun
68
68
  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
69
69
 
70
70
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71
- */return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,f=n.algo,c=a.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=a.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=a.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),p=a.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),v=a.create([0,1518500249,1859775393,2400959708,2840853838]),x=a.create([1352829926,1548603684,1836072691,2053994217,0]),_=f.RIPEMD160=u.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(F,B){for(var M=0;M<16;M++){var O=B+M,A=F[O];F[O]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var N=this._hash.words,I=v.words,R=x.words,k=c.words,z=h.words,L=d.words,G=p.words,H,ee,te,j,X,Y,Q,pe,De,we;Y=H=N[0],Q=ee=N[1],pe=te=N[2],De=j=N[3],we=X=N[4];for(var be,M=0;M<80;M+=1)be=H+F[B+k[M]]|0,M<16?be+=y(ee,te,j)+I[0]:M<32?be+=m(ee,te,j)+I[1]:M<48?be+=w(ee,te,j)+I[2]:M<64?be+=D(ee,te,j)+I[3]:be+=C(ee,te,j)+I[4],be=be|0,be=b(be,L[M]),be=be+X|0,H=X,X=j,j=b(te,10),te=ee,ee=be,be=Y+F[B+z[M]]|0,M<16?be+=C(Q,pe,De)+R[0]:M<32?be+=D(Q,pe,De)+R[1]:M<48?be+=w(Q,pe,De)+R[2]:M<64?be+=m(Q,pe,De)+R[3]:be+=y(Q,pe,De)+R[4],be=be|0,be=b(be,G[M]),be=be+we|0,Y=we,we=De,De=b(pe,10),pe=Q,Q=be;be=N[1]+te+De|0,N[1]=N[2]+j+we|0,N[2]=N[3]+X+Y|0,N[3]=N[4]+H+Q|0,N[4]=N[0]+ee+pe|0,N[0]=be},_doFinalize:function(){var F=this._data,B=F.words,M=this._nDataBytes*8,O=F.sigBytes*8;B[O>>>5]|=128<<24-O%32,B[(O+64>>>9<<4)+14]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,F.sigBytes=(B.length+1)*4,this._process();for(var A=this._hash,N=A.words,I=0;I<5;I++){var R=N[I];N[I]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return A},clone:function(){var F=u.clone.call(this);return F._hash=this._hash.clone(),F}});function y(F,B,M){return F^B^M}function m(F,B,M){return F&B|~F&M}function w(F,B,M){return(F|~B)^M}function D(F,B,M){return F&M|B&~M}function C(F,B,M){return F^(B|~M)}function b(F,B){return F<<B|F>>>32-B}n.RIPEMD160=u._createHelper(_),n.HmacRIPEMD160=u._createHmacHelper(_)}(),t.RIPEMD160})}(xu)),xu.exports}var yu={exports:{}},fh;function Du(){return fh||(fh=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){(function(){var r=t,n=r.lib,i=n.Base,a=r.enc,u=a.Utf8,f=r.algo;f.HMAC=i.extend({init:function(c,h){c=this._hasher=new c.init,typeof h=="string"&&(h=u.parse(h));var d=c.blockSize,p=d*4;h.sigBytes>p&&(h=c.finalize(h)),h.clamp();for(var v=this._oKey=h.clone(),x=this._iKey=h.clone(),_=v.words,y=x.words,m=0;m<d;m++)_[m]^=1549556828,y[m]^=909522486;v.sigBytes=x.sigBytes=p,this.reset()},reset:function(){var c=this._hasher;c.reset(),c.update(this._iKey)},update:function(c){return this._hasher.update(c),this},finalize:function(c){var h=this._hasher,d=h.finalize(c);h.reset();var p=h.finalize(this._oKey.clone().concat(d));return p}})})()})}(yu)),yu.exports}var wu={exports:{}},hh;function WD(){return hh||(hh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),pu(),Du())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.Base,a=n.WordArray,u=r.algo,f=u.SHA256,c=u.HMAC,h=u.PBKDF2=i.extend({cfg:i.extend({keySize:128/32,hasher:f,iterations:25e4}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,p){for(var v=this.cfg,x=c.create(v.hasher,d),_=a.create(),y=a.create([1]),m=_.words,w=y.words,D=v.keySize,C=v.iterations;m.length<D;){var b=x.update(p).finalize(y);x.reset();for(var F=b.words,B=F.length,M=b,O=1;O<C;O++){M=x.finalize(M),x.reset();for(var A=M.words,N=0;N<B;N++)F[N]^=A[N]}_.concat(b),w[0]++}return _.sigBytes=D*4,_}});r.PBKDF2=function(d,p,v){return h.create(v).compute(d,p)}}(),t.PBKDF2})}(wu)),wu.exports}var bu={exports:{}},dh;function kn(){return dh||(dh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),nh(),Du())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.Base,a=n.WordArray,u=r.algo,f=u.MD5,c=u.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:f,iterations:1}),init:function(h){this.cfg=this.cfg.extend(h)},compute:function(h,d){for(var p,v=this.cfg,x=v.hasher.create(),_=a.create(),y=_.words,m=v.keySize,w=v.iterations;y.length<m;){p&&x.update(p),p=x.update(h).finalize(d),x.reset();for(var D=1;D<w;D++)p=x.finalize(p),x.reset();_.concat(p)}return _.sigBytes=m*4,_}});r.EvpKDF=function(h,d,p){return c.create(p).compute(h,d)}}(),t.EvpKDF})}(bu)),bu.exports}var Eu={exports:{}},ph;function jt(){return ph||(ph=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),kn())})(ye,function(t){t.lib.Cipher||function(r){var n=t,i=n.lib,a=i.Base,u=i.WordArray,f=i.BufferedBlockAlgorithm,c=n.enc;c.Utf8;var h=c.Base64,d=n.algo,p=d.EvpKDF,v=i.Cipher=f.extend({cfg:a.extend(),createEncryptor:function(A,N){return this.create(this._ENC_XFORM_MODE,A,N)},createDecryptor:function(A,N){return this.create(this._DEC_XFORM_MODE,A,N)},init:function(A,N,I){this.cfg=this.cfg.extend(I),this._xformMode=A,this._key=N,this.reset()},reset:function(){f.reset.call(this),this._doReset()},process:function(A){return this._append(A),this._process()},finalize:function(A){A&&this._append(A);var N=this._doFinalize();return N},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function A(N){return typeof N=="string"?O:F}return function(N){return{encrypt:function(I,R,k){return A(R).encrypt(N,I,R,k)},decrypt:function(I,R,k){return A(R).decrypt(N,I,R,k)}}}}()});i.StreamCipher=v.extend({_doFinalize:function(){var A=this._process(!0);return A},blockSize:1});var x=n.mode={},_=i.BlockCipherMode=a.extend({createEncryptor:function(A,N){return this.Encryptor.create(A,N)},createDecryptor:function(A,N){return this.Decryptor.create(A,N)},init:function(A,N){this._cipher=A,this._iv=N}}),y=x.CBC=function(){var A=_.extend();A.Encryptor=A.extend({processBlock:function(I,R){var k=this._cipher,z=k.blockSize;N.call(this,I,R,z),k.encryptBlock(I,R),this._prevBlock=I.slice(R,R+z)}}),A.Decryptor=A.extend({processBlock:function(I,R){var k=this._cipher,z=k.blockSize,L=I.slice(R,R+z);k.decryptBlock(I,R),N.call(this,I,R,z),this._prevBlock=L}});function N(I,R,k){var z,L=this._iv;L?(z=L,this._iv=r):z=this._prevBlock;for(var G=0;G<k;G++)I[R+G]^=z[G]}return A}(),m=n.pad={},w=m.Pkcs7={pad:function(A,N){for(var I=N*4,R=I-A.sigBytes%I,k=R<<24|R<<16|R<<8|R,z=[],L=0;L<R;L+=4)z.push(k);var G=u.create(z,R);A.concat(G)},unpad:function(A){var N=A.words[A.sigBytes-1>>>2]&255;A.sigBytes-=N}};i.BlockCipher=v.extend({cfg:v.cfg.extend({mode:y,padding:w}),reset:function(){var A;v.reset.call(this);var N=this.cfg,I=N.iv,R=N.mode;this._xformMode==this._ENC_XFORM_MODE?A=R.createEncryptor:(A=R.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==A?this._mode.init(this,I&&I.words):(this._mode=A.call(R,this,I&&I.words),this._mode.__creator=A)},_doProcessBlock:function(A,N){this._mode.processBlock(A,N)},_doFinalize:function(){var A,N=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(N.pad(this._data,this.blockSize),A=this._process(!0)):(A=this._process(!0),N.unpad(A)),A},blockSize:128/32});var D=i.CipherParams=a.extend({init:function(A){this.mixIn(A)},toString:function(A){return(A||this.formatter).stringify(this)}}),C=n.format={},b=C.OpenSSL={stringify:function(A){var N,I=A.ciphertext,R=A.salt;return R?N=u.create([1398893684,1701076831]).concat(R).concat(I):N=I,N.toString(h)},parse:function(A){var N,I=h.parse(A),R=I.words;return R[0]==1398893684&&R[1]==1701076831&&(N=u.create(R.slice(2,4)),R.splice(0,4),I.sigBytes-=16),D.create({ciphertext:I,salt:N})}},F=i.SerializableCipher=a.extend({cfg:a.extend({format:b}),encrypt:function(A,N,I,R){R=this.cfg.extend(R);var k=A.createEncryptor(I,R),z=k.finalize(N),L=k.cfg;return D.create({ciphertext:z,key:I,iv:L.iv,algorithm:A,mode:L.mode,padding:L.padding,blockSize:A.blockSize,formatter:R.format})},decrypt:function(A,N,I,R){R=this.cfg.extend(R),N=this._parse(N,R.format);var k=A.createDecryptor(I,R).finalize(N.ciphertext);return k},_parse:function(A,N){return typeof A=="string"?N.parse(A,this):A}}),B=n.kdf={},M=B.OpenSSL={execute:function(A,N,I,R,k){if(R||(R=u.random(64/8)),k)var z=p.create({keySize:N+I,hasher:k}).compute(A,R);else var z=p.create({keySize:N+I}).compute(A,R);var L=u.create(z.words.slice(N),I*4);return z.sigBytes=N*4,D.create({key:z,iv:L,salt:R})}},O=i.PasswordBasedCipher=F.extend({cfg:F.cfg.extend({kdf:M}),encrypt:function(A,N,I,R){R=this.cfg.extend(R);var k=R.kdf.execute(I,A.keySize,A.ivSize,R.salt,R.hasher);R.iv=k.iv;var z=F.encrypt.call(this,A,N,k.key,R);return z.mixIn(k),z},decrypt:function(A,N,I,R){R=this.cfg.extend(R),N=this._parse(N,R.format);var k=R.kdf.execute(I,A.keySize,A.ivSize,N.salt,R.hasher);R.iv=k.iv;var z=F.decrypt.call(this,A,N,k.key,R);return z}})}()})}(Eu)),Eu.exports}var Au={exports:{}},_h;function HD(){return _h||(_h=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.CFB=function(){var r=t.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,f=u.blockSize;n.call(this,i,a,f,u),this._prevBlock=i.slice(a,a+f)}}),r.Decryptor=r.extend({processBlock:function(i,a){var u=this._cipher,f=u.blockSize,c=i.slice(a,a+f);n.call(this,i,a,f,u),this._prevBlock=c}});function n(i,a,u,f){var c,h=this._iv;h?(c=h.slice(0),this._iv=void 0):c=this._prevBlock,f.encryptBlock(c,0);for(var d=0;d<u;d++)i[a+d]^=c[d]}return r}(),t.mode.CFB})}(Au)),Au.exports}var Cu={exports:{}},vh;function jD(){return vh||(vh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.CTR=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,f=u.blockSize,c=this._iv,h=this._counter;c&&(h=this._counter=c.slice(0),this._iv=void 0);var d=h.slice(0);u.encryptBlock(d,0),h[f-1]=h[f-1]+1|0;for(var p=0;p<f;p++)i[a+p]^=d[p]}});return r.Decryptor=n,r}(),t.mode.CTR})}(Cu)),Cu.exports}var Fu={exports:{}},gh;function YD(){return gh||(gh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){/** @preserve
71
+ */return function(r){var n=t,i=n.lib,a=i.WordArray,u=i.Hasher,c=n.algo,f=a.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=a.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=a.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),p=a.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),v=a.create([0,1518500249,1859775393,2400959708,2840853838]),x=a.create([1352829926,1548603684,1836072691,2053994217,0]),_=c.RIPEMD160=u.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(F,B){for(var M=0;M<16;M++){var O=B+M,A=F[O];F[O]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var N=this._hash.words,I=v.words,L=x.words,k=f.words,z=h.words,R=d.words,G=p.words,H,ee,te,j,X,Y,Q,pe,De,we;Y=H=N[0],Q=ee=N[1],pe=te=N[2],De=j=N[3],we=X=N[4];for(var be,M=0;M<80;M+=1)be=H+F[B+k[M]]|0,M<16?be+=y(ee,te,j)+I[0]:M<32?be+=m(ee,te,j)+I[1]:M<48?be+=w(ee,te,j)+I[2]:M<64?be+=D(ee,te,j)+I[3]:be+=C(ee,te,j)+I[4],be=be|0,be=b(be,R[M]),be=be+X|0,H=X,X=j,j=b(te,10),te=ee,ee=be,be=Y+F[B+z[M]]|0,M<16?be+=C(Q,pe,De)+L[0]:M<32?be+=D(Q,pe,De)+L[1]:M<48?be+=w(Q,pe,De)+L[2]:M<64?be+=m(Q,pe,De)+L[3]:be+=y(Q,pe,De)+L[4],be=be|0,be=b(be,G[M]),be=be+we|0,Y=we,we=De,De=b(pe,10),pe=Q,Q=be;be=N[1]+te+De|0,N[1]=N[2]+j+we|0,N[2]=N[3]+X+Y|0,N[3]=N[4]+H+Q|0,N[4]=N[0]+ee+pe|0,N[0]=be},_doFinalize:function(){var F=this._data,B=F.words,M=this._nDataBytes*8,O=F.sigBytes*8;B[O>>>5]|=128<<24-O%32,B[(O+64>>>9<<4)+14]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,F.sigBytes=(B.length+1)*4,this._process();for(var A=this._hash,N=A.words,I=0;I<5;I++){var L=N[I];N[I]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return A},clone:function(){var F=u.clone.call(this);return F._hash=this._hash.clone(),F}});function y(F,B,M){return F^B^M}function m(F,B,M){return F&B|~F&M}function w(F,B,M){return(F|~B)^M}function D(F,B,M){return F&M|B&~M}function C(F,B,M){return F^(B|~M)}function b(F,B){return F<<B|F>>>32-B}n.RIPEMD160=u._createHelper(_),n.HmacRIPEMD160=u._createHmacHelper(_)}(),t.RIPEMD160})}(xu)),xu.exports}var yu={exports:{}},ch;function Du(){return ch||(ch=1,function(s,e){(function(t,r){s.exports=r(Ge())})(ye,function(t){(function(){var r=t,n=r.lib,i=n.Base,a=r.enc,u=a.Utf8,c=r.algo;c.HMAC=i.extend({init:function(f,h){f=this._hasher=new f.init,typeof h=="string"&&(h=u.parse(h));var d=f.blockSize,p=d*4;h.sigBytes>p&&(h=f.finalize(h)),h.clamp();for(var v=this._oKey=h.clone(),x=this._iKey=h.clone(),_=v.words,y=x.words,m=0;m<d;m++)_[m]^=1549556828,y[m]^=909522486;v.sigBytes=x.sigBytes=p,this.reset()},reset:function(){var f=this._hasher;f.reset(),f.update(this._iKey)},update:function(f){return this._hasher.update(f),this},finalize:function(f){var h=this._hasher,d=h.finalize(f);h.reset();var p=h.finalize(this._oKey.clone().concat(d));return p}})})()})}(yu)),yu.exports}var wu={exports:{}},hh;function WD(){return hh||(hh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),pu(),Du())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.Base,a=n.WordArray,u=r.algo,c=u.SHA256,f=u.HMAC,h=u.PBKDF2=i.extend({cfg:i.extend({keySize:128/32,hasher:c,iterations:25e4}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,p){for(var v=this.cfg,x=f.create(v.hasher,d),_=a.create(),y=a.create([1]),m=_.words,w=y.words,D=v.keySize,C=v.iterations;m.length<D;){var b=x.update(p).finalize(y);x.reset();for(var F=b.words,B=F.length,M=b,O=1;O<C;O++){M=x.finalize(M),x.reset();for(var A=M.words,N=0;N<B;N++)F[N]^=A[N]}_.concat(b),w[0]++}return _.sigBytes=D*4,_}});r.PBKDF2=function(d,p,v){return h.create(v).compute(d,p)}}(),t.PBKDF2})}(wu)),wu.exports}var bu={exports:{}},dh;function kn(){return dh||(dh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),nh(),Du())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.Base,a=n.WordArray,u=r.algo,c=u.MD5,f=u.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:c,iterations:1}),init:function(h){this.cfg=this.cfg.extend(h)},compute:function(h,d){for(var p,v=this.cfg,x=v.hasher.create(),_=a.create(),y=_.words,m=v.keySize,w=v.iterations;y.length<m;){p&&x.update(p),p=x.update(h).finalize(d),x.reset();for(var D=1;D<w;D++)p=x.finalize(p),x.reset();_.concat(p)}return _.sigBytes=m*4,_}});r.EvpKDF=function(h,d,p){return f.create(p).compute(h,d)}}(),t.EvpKDF})}(bu)),bu.exports}var Eu={exports:{}},ph;function jt(){return ph||(ph=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),kn())})(ye,function(t){t.lib.Cipher||function(r){var n=t,i=n.lib,a=i.Base,u=i.WordArray,c=i.BufferedBlockAlgorithm,f=n.enc;f.Utf8;var h=f.Base64,d=n.algo,p=d.EvpKDF,v=i.Cipher=c.extend({cfg:a.extend(),createEncryptor:function(A,N){return this.create(this._ENC_XFORM_MODE,A,N)},createDecryptor:function(A,N){return this.create(this._DEC_XFORM_MODE,A,N)},init:function(A,N,I){this.cfg=this.cfg.extend(I),this._xformMode=A,this._key=N,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(A){return this._append(A),this._process()},finalize:function(A){A&&this._append(A);var N=this._doFinalize();return N},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function A(N){return typeof N=="string"?O:F}return function(N){return{encrypt:function(I,L,k){return A(L).encrypt(N,I,L,k)},decrypt:function(I,L,k){return A(L).decrypt(N,I,L,k)}}}}()});i.StreamCipher=v.extend({_doFinalize:function(){var A=this._process(!0);return A},blockSize:1});var x=n.mode={},_=i.BlockCipherMode=a.extend({createEncryptor:function(A,N){return this.Encryptor.create(A,N)},createDecryptor:function(A,N){return this.Decryptor.create(A,N)},init:function(A,N){this._cipher=A,this._iv=N}}),y=x.CBC=function(){var A=_.extend();A.Encryptor=A.extend({processBlock:function(I,L){var k=this._cipher,z=k.blockSize;N.call(this,I,L,z),k.encryptBlock(I,L),this._prevBlock=I.slice(L,L+z)}}),A.Decryptor=A.extend({processBlock:function(I,L){var k=this._cipher,z=k.blockSize,R=I.slice(L,L+z);k.decryptBlock(I,L),N.call(this,I,L,z),this._prevBlock=R}});function N(I,L,k){var z,R=this._iv;R?(z=R,this._iv=r):z=this._prevBlock;for(var G=0;G<k;G++)I[L+G]^=z[G]}return A}(),m=n.pad={},w=m.Pkcs7={pad:function(A,N){for(var I=N*4,L=I-A.sigBytes%I,k=L<<24|L<<16|L<<8|L,z=[],R=0;R<L;R+=4)z.push(k);var G=u.create(z,L);A.concat(G)},unpad:function(A){var N=A.words[A.sigBytes-1>>>2]&255;A.sigBytes-=N}};i.BlockCipher=v.extend({cfg:v.cfg.extend({mode:y,padding:w}),reset:function(){var A;v.reset.call(this);var N=this.cfg,I=N.iv,L=N.mode;this._xformMode==this._ENC_XFORM_MODE?A=L.createEncryptor:(A=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==A?this._mode.init(this,I&&I.words):(this._mode=A.call(L,this,I&&I.words),this._mode.__creator=A)},_doProcessBlock:function(A,N){this._mode.processBlock(A,N)},_doFinalize:function(){var A,N=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(N.pad(this._data,this.blockSize),A=this._process(!0)):(A=this._process(!0),N.unpad(A)),A},blockSize:128/32});var D=i.CipherParams=a.extend({init:function(A){this.mixIn(A)},toString:function(A){return(A||this.formatter).stringify(this)}}),C=n.format={},b=C.OpenSSL={stringify:function(A){var N,I=A.ciphertext,L=A.salt;return L?N=u.create([1398893684,1701076831]).concat(L).concat(I):N=I,N.toString(h)},parse:function(A){var N,I=h.parse(A),L=I.words;return L[0]==1398893684&&L[1]==1701076831&&(N=u.create(L.slice(2,4)),L.splice(0,4),I.sigBytes-=16),D.create({ciphertext:I,salt:N})}},F=i.SerializableCipher=a.extend({cfg:a.extend({format:b}),encrypt:function(A,N,I,L){L=this.cfg.extend(L);var k=A.createEncryptor(I,L),z=k.finalize(N),R=k.cfg;return D.create({ciphertext:z,key:I,iv:R.iv,algorithm:A,mode:R.mode,padding:R.padding,blockSize:A.blockSize,formatter:L.format})},decrypt:function(A,N,I,L){L=this.cfg.extend(L),N=this._parse(N,L.format);var k=A.createDecryptor(I,L).finalize(N.ciphertext);return k},_parse:function(A,N){return typeof A=="string"?N.parse(A,this):A}}),B=n.kdf={},M=B.OpenSSL={execute:function(A,N,I,L,k){if(L||(L=u.random(64/8)),k)var z=p.create({keySize:N+I,hasher:k}).compute(A,L);else var z=p.create({keySize:N+I}).compute(A,L);var R=u.create(z.words.slice(N),I*4);return z.sigBytes=N*4,D.create({key:z,iv:R,salt:L})}},O=i.PasswordBasedCipher=F.extend({cfg:F.cfg.extend({kdf:M}),encrypt:function(A,N,I,L){L=this.cfg.extend(L);var k=L.kdf.execute(I,A.keySize,A.ivSize,L.salt,L.hasher);L.iv=k.iv;var z=F.encrypt.call(this,A,N,k.key,L);return z.mixIn(k),z},decrypt:function(A,N,I,L){L=this.cfg.extend(L),N=this._parse(N,L.format);var k=L.kdf.execute(I,A.keySize,A.ivSize,N.salt,L.hasher);L.iv=k.iv;var z=F.decrypt.call(this,A,N,k.key,L);return z}})}()})}(Eu)),Eu.exports}var Au={exports:{}},_h;function HD(){return _h||(_h=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.CFB=function(){var r=t.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,c=u.blockSize;n.call(this,i,a,c,u),this._prevBlock=i.slice(a,a+c)}}),r.Decryptor=r.extend({processBlock:function(i,a){var u=this._cipher,c=u.blockSize,f=i.slice(a,a+c);n.call(this,i,a,c,u),this._prevBlock=f}});function n(i,a,u,c){var f,h=this._iv;h?(f=h.slice(0),this._iv=void 0):f=this._prevBlock,c.encryptBlock(f,0);for(var d=0;d<u;d++)i[a+d]^=f[d]}return r}(),t.mode.CFB})}(Au)),Au.exports}var Cu={exports:{}},vh;function jD(){return vh||(vh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.CTR=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,c=u.blockSize,f=this._iv,h=this._counter;f&&(h=this._counter=f.slice(0),this._iv=void 0);var d=h.slice(0);u.encryptBlock(d,0),h[c-1]=h[c-1]+1|0;for(var p=0;p<c;p++)i[a+p]^=d[p]}});return r.Decryptor=n,r}(),t.mode.CTR})}(Cu)),Cu.exports}var Fu={exports:{}},gh;function YD(){return gh||(gh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){/** @preserve
72
72
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
73
73
  * derived from CryptoJS.mode.CTR
74
74
  * Jan Hruby jhruby.web@gmail.com
75
- */return t.mode.CTRGladman=function(){var r=t.lib.BlockCipherMode.extend();function n(u){if((u>>24&255)===255){var f=u>>16&255,c=u>>8&255,h=u&255;f===255?(f=0,c===255?(c=0,h===255?h=0:++h):++c):++f,u=0,u+=f<<16,u+=c<<8,u+=h}else u+=1<<24;return u}function i(u){return(u[0]=n(u[0]))===0&&(u[1]=n(u[1])),u}var a=r.Encryptor=r.extend({processBlock:function(u,f){var c=this._cipher,h=c.blockSize,d=this._iv,p=this._counter;d&&(p=this._counter=d.slice(0),this._iv=void 0),i(p);var v=p.slice(0);c.encryptBlock(v,0);for(var x=0;x<h;x++)u[f+x]^=v[x]}});return r.Decryptor=a,r}(),t.mode.CTRGladman})}(Fu)),Fu.exports}var Bu={exports:{}},mh;function ZD(){return mh||(mh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.OFB=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,f=u.blockSize,c=this._iv,h=this._keystream;c&&(h=this._keystream=c.slice(0),this._iv=void 0),u.encryptBlock(h,0);for(var d=0;d<f;d++)i[a+d]^=h[d]}});return r.Decryptor=n,r}(),t.mode.OFB})}(Bu)),Bu.exports}var Mu={exports:{}},xh;function VD(){return xh||(xh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.ECB=function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(n,i){this._cipher.encryptBlock(n,i)}}),r.Decryptor=r.extend({processBlock:function(n,i){this._cipher.decryptBlock(n,i)}}),r}(),t.mode.ECB})}(Mu)),Mu.exports}var Nu={exports:{}},yh;function GD(){return yh||(yh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.AnsiX923={pad:function(r,n){var i=r.sigBytes,a=n*4,u=a-i%a,f=i+u-1;r.clamp(),r.words[f>>>2]|=u<<24-f%4*8,r.sigBytes+=u},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Ansix923})}(Nu)),Nu.exports}var Su={exports:{}},Dh;function KD(){return Dh||(Dh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.Iso10126={pad:function(r,n){var i=n*4,a=i-r.sigBytes%i;r.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Iso10126})}(Su)),Su.exports}var Ou={exports:{}},wh;function XD(){return wh||(wh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.Iso97971={pad:function(r,n){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,n)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})}(Ou)),Ou.exports}var Iu={exports:{}},bh;function QD(){return bh||(bh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.ZeroPadding={pad:function(r,n){var i=n*4;r.clamp(),r.sigBytes+=i-(r.sigBytes%i||i)},unpad:function(r){for(var n=r.words,i=r.sigBytes-1,i=r.sigBytes-1;i>=0;i--)if(n[i>>>2]>>>24-i%4*8&255){r.sigBytes=i+1;break}}},t.pad.ZeroPadding})}(Iu)),Iu.exports}var Tu={exports:{}},Eh;function JD(){return Eh||(Eh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Tu)),Tu.exports}var $u={exports:{}},Ah;function ew(){return Ah||(Ah=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.CipherParams,u=n.enc,f=u.Hex,c=n.format;c.Hex={stringify:function(h){return h.ciphertext.toString(f)},parse:function(h){var d=f.parse(h);return a.create({ciphertext:d})}}}(),t.format.Hex})}($u)),$u.exports}var Ru={exports:{}},Ch;function tw(){return Ch||(Ch=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,a=r.algo,u=[],f=[],c=[],h=[],d=[],p=[],v=[],x=[],_=[],y=[];(function(){for(var D=[],C=0;C<256;C++)C<128?D[C]=C<<1:D[C]=C<<1^283;for(var b=0,F=0,C=0;C<256;C++){var B=F^F<<1^F<<2^F<<3^F<<4;B=B>>>8^B&255^99,u[b]=B,f[B]=b;var M=D[b],O=D[M],A=D[O],N=D[B]*257^B*16843008;c[b]=N<<24|N>>>8,h[b]=N<<16|N>>>16,d[b]=N<<8|N>>>24,p[b]=N;var N=A*16843009^O*65537^M*257^b*16843008;v[B]=N<<24|N>>>8,x[B]=N<<16|N>>>16,_[B]=N<<8|N>>>24,y[B]=N,b?(b=M^D[D[D[A^M]]],F^=D[D[F]]):b=F=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],w=a.AES=i.extend({_doReset:function(){var D;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var C=this._keyPriorReset=this._key,b=C.words,F=C.sigBytes/4,B=this._nRounds=F+6,M=(B+1)*4,O=this._keySchedule=[],A=0;A<M;A++)A<F?O[A]=b[A]:(D=O[A-1],A%F?F>6&&A%F==4&&(D=u[D>>>24]<<24|u[D>>>16&255]<<16|u[D>>>8&255]<<8|u[D&255]):(D=D<<8|D>>>24,D=u[D>>>24]<<24|u[D>>>16&255]<<16|u[D>>>8&255]<<8|u[D&255],D^=m[A/F|0]<<24),O[A]=O[A-F]^D);for(var N=this._invKeySchedule=[],I=0;I<M;I++){var A=M-I;if(I%4)var D=O[A];else var D=O[A-4];I<4||A<=4?N[I]=D:N[I]=v[u[D>>>24]]^x[u[D>>>16&255]]^_[u[D>>>8&255]]^y[u[D&255]]}}},encryptBlock:function(D,C){this._doCryptBlock(D,C,this._keySchedule,c,h,d,p,u)},decryptBlock:function(D,C){var b=D[C+1];D[C+1]=D[C+3],D[C+3]=b,this._doCryptBlock(D,C,this._invKeySchedule,v,x,_,y,f);var b=D[C+1];D[C+1]=D[C+3],D[C+3]=b},_doCryptBlock:function(D,C,b,F,B,M,O,A){for(var N=this._nRounds,I=D[C]^b[0],R=D[C+1]^b[1],k=D[C+2]^b[2],z=D[C+3]^b[3],L=4,G=1;G<N;G++){var H=F[I>>>24]^B[R>>>16&255]^M[k>>>8&255]^O[z&255]^b[L++],ee=F[R>>>24]^B[k>>>16&255]^M[z>>>8&255]^O[I&255]^b[L++],te=F[k>>>24]^B[z>>>16&255]^M[I>>>8&255]^O[R&255]^b[L++],j=F[z>>>24]^B[I>>>16&255]^M[R>>>8&255]^O[k&255]^b[L++];I=H,R=ee,k=te,z=j}var H=(A[I>>>24]<<24|A[R>>>16&255]<<16|A[k>>>8&255]<<8|A[z&255])^b[L++],ee=(A[R>>>24]<<24|A[k>>>16&255]<<16|A[z>>>8&255]<<8|A[I&255])^b[L++],te=(A[k>>>24]<<24|A[z>>>16&255]<<16|A[I>>>8&255]<<8|A[R&255])^b[L++],j=(A[z>>>24]<<24|A[I>>>16&255]<<16|A[R>>>8&255]<<8|A[k&255])^b[L++];D[C]=H,D[C+1]=ee,D[C+2]=te,D[C+3]=j},keySize:256/32});r.AES=i._createHelper(w)}(),t.AES})}(Ru)),Ru.exports}var Lu={exports:{}},Fh;function rw(){return Fh||(Fh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=n.BlockCipher,u=r.algo,f=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],v=u.DES=a.extend({_doReset:function(){for(var m=this._key,w=m.words,D=[],C=0;C<56;C++){var b=f[C]-1;D[C]=w[b>>>5]>>>31-b%32&1}for(var F=this._subKeys=[],B=0;B<16;B++){for(var M=F[B]=[],O=h[B],C=0;C<24;C++)M[C/6|0]|=D[(c[C]-1+O)%28]<<31-C%6,M[4+(C/6|0)]|=D[28+(c[C+24]-1+O)%28]<<31-C%6;M[0]=M[0]<<1|M[0]>>>31;for(var C=1;C<7;C++)M[C]=M[C]>>>(C-1)*4+3;M[7]=M[7]<<5|M[7]>>>27}for(var A=this._invSubKeys=[],C=0;C<16;C++)A[C]=F[15-C]},encryptBlock:function(m,w){this._doCryptBlock(m,w,this._subKeys)},decryptBlock:function(m,w){this._doCryptBlock(m,w,this._invSubKeys)},_doCryptBlock:function(m,w,D){this._lBlock=m[w],this._rBlock=m[w+1],x.call(this,4,252645135),x.call(this,16,65535),_.call(this,2,858993459),_.call(this,8,16711935),x.call(this,1,1431655765);for(var C=0;C<16;C++){for(var b=D[C],F=this._lBlock,B=this._rBlock,M=0,O=0;O<8;O++)M|=d[O][((B^b[O])&p[O])>>>0];this._lBlock=B,this._rBlock=F^M}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,x.call(this,1,1431655765),_.call(this,8,16711935),_.call(this,2,858993459),x.call(this,16,65535),x.call(this,4,252645135),m[w]=this._lBlock,m[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function x(m,w){var D=(this._lBlock>>>m^this._rBlock)&w;this._rBlock^=D,this._lBlock^=D<<m}function _(m,w){var D=(this._rBlock>>>m^this._lBlock)&w;this._lBlock^=D,this._rBlock^=D<<m}r.DES=a._createHelper(v);var y=u.TripleDES=a.extend({_doReset:function(){var m=this._key,w=m.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var D=w.slice(0,2),C=w.length<4?w.slice(0,2):w.slice(2,4),b=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=v.createEncryptor(i.create(D)),this._des2=v.createEncryptor(i.create(C)),this._des3=v.createEncryptor(i.create(b))},encryptBlock:function(m,w){this._des1.encryptBlock(m,w),this._des2.decryptBlock(m,w),this._des3.encryptBlock(m,w)},decryptBlock:function(m,w){this._des3.decryptBlock(m,w),this._des2.encryptBlock(m,w),this._des1.decryptBlock(m,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=a._createHelper(y)}(),t.TripleDES})}(Lu)),Lu.exports}var Pu={exports:{}},Bh;function nw(){return Bh||(Bh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=a.RC4=i.extend({_doReset:function(){for(var h=this._key,d=h.words,p=h.sigBytes,v=this._S=[],x=0;x<256;x++)v[x]=x;for(var x=0,_=0;x<256;x++){var y=x%p,m=d[y>>>2]>>>24-y%4*8&255;_=(_+v[x]+m)%256;var w=v[x];v[x]=v[_],v[_]=w}this._i=this._j=0},_doProcessBlock:function(h,d){h[d]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var h=this._S,d=this._i,p=this._j,v=0,x=0;x<4;x++){d=(d+1)%256,p=(p+h[d])%256;var _=h[d];h[d]=h[p],h[p]=_,v|=h[(h[d]+h[p])%256]<<24-x*8}return this._i=d,this._j=p,v}r.RC4=i._createHelper(u);var c=a.RC4Drop=u.extend({cfg:u.cfg.extend({drop:192}),_doReset:function(){u._doReset.call(this);for(var h=this.cfg.drop;h>0;h--)f.call(this)}});r.RC4Drop=i._createHelper(c)}(),t.RC4})}(Pu)),Pu.exports}var ku={exports:{}},Mh;function iw(){return Mh||(Mh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=[],f=[],c=[],h=a.Rabbit=i.extend({_doReset:function(){for(var p=this._key.words,v=this.cfg.iv,x=0;x<4;x++)p[x]=(p[x]<<8|p[x]>>>24)&16711935|(p[x]<<24|p[x]>>>8)&4278255360;var _=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],y=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var x=0;x<4;x++)d.call(this);for(var x=0;x<8;x++)y[x]^=_[x+4&7];if(v){var m=v.words,w=m[0],D=m[1],C=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,F=C>>>16|b&4294901760,B=b<<16|C&65535;y[0]^=C,y[1]^=F,y[2]^=b,y[3]^=B,y[4]^=C,y[5]^=F,y[6]^=b,y[7]^=B;for(var x=0;x<4;x++)d.call(this)}},_doProcessBlock:function(p,v){var x=this._X;d.call(this),u[0]=x[0]^x[5]>>>16^x[3]<<16,u[1]=x[2]^x[7]>>>16^x[5]<<16,u[2]=x[4]^x[1]>>>16^x[7]<<16,u[3]=x[6]^x[3]>>>16^x[1]<<16;for(var _=0;_<4;_++)u[_]=(u[_]<<8|u[_]>>>24)&16711935|(u[_]<<24|u[_]>>>8)&4278255360,p[v+_]^=u[_]},blockSize:128/32,ivSize:64/32});function d(){for(var p=this._X,v=this._C,x=0;x<8;x++)f[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<f[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<f[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<f[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<f[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<f[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<f[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<f[6]>>>0?1:0)|0,this._b=v[7]>>>0<f[7]>>>0?1:0;for(var x=0;x<8;x++){var _=p[x]+v[x],y=_&65535,m=_>>>16,w=((y*y>>>17)+y*m>>>15)+m*m,D=((_&4294901760)*_|0)+((_&65535)*_|0);c[x]=w^D}p[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,p[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,p[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,p[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,p[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,p[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,p[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,p[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}r.Rabbit=i._createHelper(h)}(),t.Rabbit})}(ku)),ku.exports}var zu={exports:{}},Nh;function sw(){return Nh||(Nh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=[],f=[],c=[],h=a.RabbitLegacy=i.extend({_doReset:function(){var p=this._key.words,v=this.cfg.iv,x=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],_=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var y=0;y<4;y++)d.call(this);for(var y=0;y<8;y++)_[y]^=x[y+4&7];if(v){var m=v.words,w=m[0],D=m[1],C=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,F=C>>>16|b&4294901760,B=b<<16|C&65535;_[0]^=C,_[1]^=F,_[2]^=b,_[3]^=B,_[4]^=C,_[5]^=F,_[6]^=b,_[7]^=B;for(var y=0;y<4;y++)d.call(this)}},_doProcessBlock:function(p,v){var x=this._X;d.call(this),u[0]=x[0]^x[5]>>>16^x[3]<<16,u[1]=x[2]^x[7]>>>16^x[5]<<16,u[2]=x[4]^x[1]>>>16^x[7]<<16,u[3]=x[6]^x[3]>>>16^x[1]<<16;for(var _=0;_<4;_++)u[_]=(u[_]<<8|u[_]>>>24)&16711935|(u[_]<<24|u[_]>>>8)&4278255360,p[v+_]^=u[_]},blockSize:128/32,ivSize:64/32});function d(){for(var p=this._X,v=this._C,x=0;x<8;x++)f[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<f[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<f[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<f[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<f[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<f[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<f[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<f[6]>>>0?1:0)|0,this._b=v[7]>>>0<f[7]>>>0?1:0;for(var x=0;x<8;x++){var _=p[x]+v[x],y=_&65535,m=_>>>16,w=((y*y>>>17)+y*m>>>15)+m*m,D=((_&4294901760)*_|0)+((_&65535)*_|0);c[x]=w^D}p[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,p[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,p[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,p[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,p[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,p[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,p[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,p[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}r.RabbitLegacy=i._createHelper(h)}(),t.RabbitLegacy})}(zu)),zu.exports}var qu={exports:{}},Sh;function ow(){return Sh||(Sh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,a=r.algo;const u=16,f=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],c=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var h={pbox:[],sbox:[]};function d(y,m){let w=m>>24&255,D=m>>16&255,C=m>>8&255,b=m&255,F=y.sbox[0][w]+y.sbox[1][D];return F=F^y.sbox[2][C],F=F+y.sbox[3][b],F}function p(y,m,w){let D=m,C=w,b;for(let F=0;F<u;++F)D=D^y.pbox[F],C=d(y,D)^C,b=D,D=C,C=b;return b=D,D=C,C=b,C=C^y.pbox[u],D=D^y.pbox[u+1],{left:D,right:C}}function v(y,m,w){let D=m,C=w,b;for(let F=u+1;F>1;--F)D=D^y.pbox[F],C=d(y,D)^C,b=D,D=C,C=b;return b=D,D=C,C=b,C=C^y.pbox[1],D=D^y.pbox[0],{left:D,right:C}}function x(y,m,w){for(let B=0;B<4;B++){y.sbox[B]=[];for(let M=0;M<256;M++)y.sbox[B][M]=c[B][M]}let D=0;for(let B=0;B<u+2;B++)y.pbox[B]=f[B]^m[D],D++,D>=w&&(D=0);let C=0,b=0,F=0;for(let B=0;B<u+2;B+=2)F=p(y,C,b),C=F.left,b=F.right,y.pbox[B]=C,y.pbox[B+1]=b;for(let B=0;B<4;B++)for(let M=0;M<256;M+=2)F=p(y,C,b),C=F.left,b=F.right,y.sbox[B][M]=C,y.sbox[B][M+1]=b;return!0}var _=a.Blowfish=i.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var y=this._keyPriorReset=this._key,m=y.words,w=y.sigBytes/4;x(h,m,w)}},encryptBlock:function(y,m){var w=p(h,y[m],y[m+1]);y[m]=w.left,y[m+1]=w.right},decryptBlock:function(y,m){var w=v(h,y[m],y[m+1]);y[m]=w.left,y[m+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=i._createHelper(_)}(),t.Blowfish})}(qu)),qu.exports}(function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo(),RD(),LD(),oi(),PD(),ai(),nh(),pu(),kD(),ah(),zD(),qD(),UD(),Du(),WD(),kn(),jt(),HD(),jD(),YD(),ZD(),VD(),GD(),KD(),XD(),QD(),JD(),ew(),tw(),rw(),nw(),iw(),sw(),ow())})(ye,function(t){return t})})(Vf);var Mo=Vf.exports;class aw{constructor(e,t){U(this,"_variables");U(this,"_scriptId");this._variables=e,this._scriptId=t}security(e,t){const r=self.workerStorage.get(`request_${this._scriptId}`);let{expression:n,paramsExpr:i=[]}=e;if(r!=null&&r.has(t)){const _=r.get(t);return this._runScripts(_,t,!0,i)}let a=[],u=1;n=Mo.AES.decrypt(n,"1234").toString(Mo.enc.Utf8);const f=JSON.parse(n),c=f.pop();let h=(c==null?void 0:c.depends)||[];if(!h.length)return this._runScripts((c==null?void 0:c.code)||"",t,!0,i);let d=[],p=[];if(this._getDependCodes(h,f,a,d,p),p.length){const _=i.length;let y=[];for(let m=_-1;m>=0;m--){const w=i[m];let D=JSON.parse(Mo.AES.decrypt(w,"1234").toString(Mo.enc.Utf8));const C=[];u!==0&&y.unshift("{"),u++,D=D.map(F=>{const{scope:B,code:M,varNames:O,dependSelf:A}=F;return B===2&&!C.includes(O)&&!A&&(F.code=`let ${M}`),O&&C.push(...O.split(",")),F});let b=p.map(F=>({...F,isArg:!1,isPreArg:!0}));p=[],this._getDependCodes(b,D,y,d,p),a=y.concat(a),y=[]}}for(a.push(`return ${c==null?void 0:c.code}`);u>1;)a.push("}"),u--;a=d.concat(a);const v=a.join(`
76
- `),x=this._runScripts(v,t,!0,i);return r==null||r.set(t,v),x}_getDependCodes(e,t,r,n,i){for(const a of e){if(!a.isArg){const u=t.filter(c=>{var h;return(h=c==null?void 0:c.depends)==null?void 0:h.some(d=>d.name===a.name&&d.scope===a.scope&&d.isAgainAssign)});for(const c of u){const{code:h,depends:d}=c;r.includes(h)||(r.unshift(h),d!=null&&d.length&&this._getDependCodes(d,t,r,n,i))}const f=t.find(c=>{var h;return((h=c.varNames)==null?void 0:h.split(", ").includes(a.name))&&(!a.isPreArg||a.isPreArg&&c.methodName===a.functionName)||c.funcName===a.name});if(f){const{code:c,depends:h}=f,d=r.findIndex(p=>p===c);d!==-1&&r.splice(d,1),r.unshift(c),h!=null&&h.length&&this._getDependCodes(h,t,r,n,i);continue}}i.some(u=>u.name===a.name)||i.push(a)}}_runScripts(e,t,r,n,i){const a=`${this._scriptId}_${t}`;let{builtInGather:u,buildinConstants:f,buildInFunctions:c,tradingvueFunc:h}=self.workerStorage.get(a)||{};return r&&(u=new Oh(a),f=new Uf,c=new Zf(this._variables.mintick||1e-4,u,this._scriptId),h=new Function("$_var","$_const","$_func","$paramsExpr","$posStr",e),self.workerStorage.set(a,{builtInGather:u,buildinConstants:f,buildInFunctions:c,tradingvueFunc:h})),h(u,f,c,n||[],t)}}let uw=class{constructor(){}prefix(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[0])||""}ticker(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[1])||""}};class lw{constructor(e){U(this,"_logs");U(this,"_variables");U(this,"_intlFormat");this._variables=e,this._logs=[],this._intlFormat=new Intl.NumberFormat("en-US")}get logs(){return this._logs}clearLogs(){this._logs=[]}info(e,t,r){this._addLog(e,t,"info",r)}error(e,t,r){this._addLog(e,t,"error",r)}warning(e,t,r){this._addLog(e,t,"warning",r)}_addLog(e,t,r,n){if(typeof t=="string"&&(n=t),n.startsWith("export"))return;const{message:i,formatString:a}=e,{time:u,bar_index:f}=this._variables;let c=i;a&&Array.isArray(t)&&t.length&&(c=a.replace(/{(\d+)}/g,(h,d)=>{let p=t[d];return typeof p=="number"&&(p=this._intlFormat.format(parseFloat(p.toFixed(3)))),p!==void 0?p:h})),c&&this._logs.push({message:`[${ot(u).format()}]: ${c}`,time:u,barIndex:f,type:r})}}class cw{constructor(e){U(this,"_errorListener");this._errorListener=e}error({message:e},t){t.startsWith("export")||this._errorListener.addError(e,t,Ve.Error)}}class fw{constructor(){U(this,"_errors");this._errors=new Map}clear(){this._errors.clear()}get errors(){return Yr.flatMap([...this._errors.values()])}addError(e,t,r,n=0){const[i,a]=t.split("_").slice(-2),u=this._errors.get(t),f={message:e,endLineNumber:Number(i),startColumn:Number(a)+1,endColumn:Number(a)+n+1,startLineNumber:Number(i),type:r};u?u.push(f):this._errors.set(t,[f])}}class hw{constructor(){U(this,"_isMarketOpen");U(this,"_currentBarIndex");U(this,"_totalBarIndex");U(this,"_isRealTimeBar");U(this,"_preBarIndex");this._currentBarIndex=0,this._totalBarIndex=0,this._isRealTimeBar=!1,this._preBarIndex=0,this._isMarketOpen=!0}update(e,t,r,n){this._preBarIndex=this._currentBarIndex,this._currentBarIndex=e,this._totalBarIndex=t,this._isRealTimeBar=r,this._isMarketOpen=n}get isnew(){return!this._isRealTimeBar||this._preBarIndex!==this._currentBarIndex}get islast(){return this._currentBarIndex===this._totalBarIndex}get isfirst(){return this._currentBarIndex===0}get ishistory(){return!this._isRealTimeBar}get isrealtime(){return this._isRealTimeBar}get isconfirmed(){return!this._isRealTimeBar}get islastconfirmedhistory(){return this._isMarketOpen?this._currentBarIndex===this._totalBarIndex-1:this._currentBarIndex===this._totalBarIndex}}class dw{constructor(e){U(this,"_variables");this._variables=e}get isfirstbar(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get isfirstbar_regular(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get islastbar(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get islastbar_regular(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get ismarket(){return!0}get ispostmarket(){return!1}get ispremarket(){return!1}}class pw{constructor(e){U(this,"_orders");U(this,"_historyOrders");U(this,"_options");U(this,"_max_contracts_held_all",0);U(this,"_max_contracts_held_long",0);U(this,"_max_contracts_held_short",0);U(this,"_max_drawdown",0);U(this,"_max_runup",0);U(this,"_max_runup_percent",0);U(this,"_max_drawdown_percent",0);U(this,"_variables");U(this,"_netprofit",0);U(this,"_eventrades",0);U(this,"_avg_trade_percent");U(this,"_closedtrades",0);U(this,"_losstrades",0);U(this,"_grossloss",0);U(this,"_grossloss_percent",0);U(this,"_grossprofit",0);U(this,"_grossprofit_percent",0);U(this,"_wintrades",0);U(this,"_opentrades_capital_held",0);U(this,"_position_avg_price",0);U(this,"_position_size",0);this._orders=[],this._historyOrders=[],this._variables=e}update(){this._calcMaxDrawdownAndMaxRunup()}_calcMaxDrawdownAndMaxRunup(){let e=0,t=0;const{high:r,low:n}=this._variables;for(const c of this._orders){const{in_price:h,qty:d=0,commission:p=0,original_qty:v=0,direction:x}=c,_=x===gt.long?1:-1,y=(r-h)*d,m=(n-h)*d,w=_===1?y:-m,D=_===1?-m:y;e+=D+p*d/v,t+=w+p*d/v}const[i,a]=this._historyOrders.reduce((c,h)=>{let[d,p]=c;const{profit:v=0,commission:x=0}=h;return d+=v,p+=v-x,[d,p]},[0,0]);e-=i,t+=a;const u=e/(this.initial_capital+this.netprofit)*100;this._max_drawdown<e&&(this._max_drawdown=e),u>this._max_drawdown_percent&&(this._max_drawdown_percent=u);const f=t/(this.initial_capital+this.netprofit)*100;t>this._max_runup&&(this._max_runup=t),f>this._max_runup_percent&&(this._max_runup_percent=f)}updateOrders(e){this._orders=e,this._calcMaxContracts()}_calcMaxContracts(){const e=this._orders.length;if(!e)return;const[t,r,n,i,a,u]=this._orders.reduce(([f,c,h,d,p,v],x)=>{const{direction:_,qty:y=0,in_price:m}=x;return _===gt.long?(f+=y,c+=y,v+=y):(f+=y,h+=y,v-=y),d+=y*m,p+=m,[f,c,h,d,p,v]},[0,0,0,0,0,0]);this._position_size=u,this._position_avg_price=a/e,this._opentrades_capital_held=i,this._max_contracts_held_all=Math.max(t,this._max_contracts_held_all),this._max_contracts_held_long=Math.max(r,this._max_contracts_held_long),this._max_contracts_held_short=Math.max(n,this._max_contracts_held_short)}updateHistoryOrders(e){this._historyOrders=e;const t=this._historyOrders.length;this._closedtrades=t;const[r,n,i,a,u,f]=this._historyOrders.reduce((c,h)=>{let[d,p,v,x,_,y]=c;const{profit:m=0,profit_percent:w=0}=h;return d+=m,p+=w,m<0?(v+=m,x+=w):(_+=m,y+=w),[d,p,v,x,_,y]},[0,0,0,0,0,0]);this._avg_trade_percent=t?n/t:void 0,this._netprofit=r,this._grossloss=i,this._grossloss_percent=a,this._grossprofit=u,this._grossprofit_percent=f,this._eventrades=this._historyOrders.filter(c=>c.profit===0).length,this._losstrades=this._historyOrders.filter(c=>(c.profit||0)<0).length,this._wintrades=this._historyOrders.filter(c=>(c.profit||0)>0).length}updateStrategyOptions(e){this._options=e}get long(){return"long"}get short(){return"short"}get account_currency(){return"USD"}get closedtrades(){return this._closedtrades}get opentrades(){return{opentrades:this._orders.length,capital_held:this._opentrades_capital_held}}get avg_losing_trade(){const e=this.losstrades;return e?Math.abs(this.grossloss/e):void 0}get avg_losing_trade_percent(){const e=this.losstrades;return e?Math.abs(this.grossloss_percent/e):void 0}get avg_trade(){if(this.closedtrades)return Math.abs(this.netprofit/this.closedtrades)}get equity(){return this.initial_capital+this.netprofit+this.openprofit}get netprofit(){return this._netprofit}get eventrades(){return this._eventrades}get openprofit(){return this._orders.reduce((e,t)=>{const{profit:r=0}=t;return e+r},0)}get avg_trade_percent(){return this._avg_trade_percent}get avg_winning_trade(){const e=this.wintrades;return e?Math.abs(this.grossprofit/e):void 0}get avg_winning_trade_percent(){const e=this.wintrades;return e?Math.abs(this.grossprofit_percent/e):void 0}get initial_capital(){var e;return((e=this._options)==null?void 0:e.initial_capital)||0}get losstrades(){return this._losstrades}get grossloss(){return this._grossloss}get grossloss_percent(){return this._grossloss_percent}get grossprofit(){return this._grossprofit}get grossprofit_percent(){return this._grossprofit_percent}get wintrades(){return this._wintrades}get margin_liquidation_price(){if(!this._options)return;const{initial_capital:e,margin_long:t=0,margin_short:r=0,commission_type:n,commission_value:i=0}=this._options,a=this._orders[0].direction===gt.long?1:-1,u=(a===1?t:r)/100;if(u<=0)return;const{close:f}=this._variables,[c,h]=this._orders.reduce((d,p)=>{let[v,x]=d;const{in_price:_,qty:y=0,original_qty:m=0}=p,w=_*y;if(v+=w,i){let D=0;switch(n){case Ir.percent:D=(w+y*f)*i/100;break;case Ir.cashPerContract:D=y*i*2;break;case Ir.cashPerOrder:D=y/m*i+i;break}x+=D}return[v,x]},[0,0]);return(c-(e+this.netprofit-h))*a/this.position_size/(1-a*u)}get max_contracts_held_all(){return this._max_contracts_held_all}get max_contracts_held_long(){return this._max_contracts_held_long}get max_contracts_held_short(){return this._max_contracts_held_short}get max_drawdown(){return this._max_drawdown}get max_runup(){return this._max_runup}get max_runup_percent(){return this._max_runup_percent}get max_drawdown_percent(){return this._max_drawdown_percent}get netprofit_percent(){return this.netprofit/this.initial_capital*100}get openprofit_percent(){return this.openprofit/(this.initial_capital+this.netprofit)*100}get position_avg_price(){return this._position_avg_price}get position_entry_name(){if(this._orders.length)return this._orders[0].id}get position_size(){return this._position_size}}class _w{constructor(e){U(this,"_preAccdist");U(this,"_preNvi");U(this,"_prePvi");U(this,"_preObv");U(this,"_prePvt");U(this,"_preWad");U(this,"_preVwap");U(this,"_preValue");U(this,"_currentData");U(this,"_preData");U(this,"_id");this._preAccdist=0,this._preNvi=0,this._prePvi=0,this._preObv=0,this._prePvt=0,this._preWad=0,this._preVwap={},this._preValue={},this._currentData={},this._preData={},this._id=e}update(e){this._preValue={},e.barIndex!==this._currentData.barIndex&&(this._preData={...this._currentData}),this._currentData={...e}}get isRealTime(){return this._preData.barIndex===this._currentData.barIndex}get accdist(){if(this._preValue.accdist)return this._preValue.accdist;const{close:e,low:t,high:r,volume:n}=this._currentData;if(r===t)return this._preAccdist;const i=(e-t-(r-e))/(r-t)*n+this._preAccdist;return!this.isRealTime&&(this._preAccdist=i),this._preValue.accdist=i,i}get iii(){if(this._preValue.iii)return this._preValue.iii;const{close:e,low:t,high:r,volume:n}=this._currentData,i=(2*e-r-t)/((r-t)*n);return this._preValue.iii=i,i}get nvi(){return this._preValue.nvi?this._preValue.nvi:this._getNvi()}get wvad(){if(this._preValue.wvad)return this._preValue.wvad;const{close:e,low:t,high:r,volume:n,open:i}=this._currentData,a=(e-i)/(r-t)*n;return this._preValue.wvad=a,a}get obv(){if(this._preValue.obv)return this._preValue.obv;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._preObv=0;return}const n=Math.sign(e-r)*t+this._preObv;return!this.isRealTime&&(this._preObv=n),this._preValue.obv=n,n}get pvi(){return this._preValue.pvi?this._preValue.pvi:this._getPvi()}get tr(){if(this._preValue.tr)return this._preValue.tr;const{low:e,high:t}=this._currentData,{close:r}=this._preData;if(r===void 0)return;const n=Math.max(t-e,Math.abs(t-r),Math.abs(e-r));return this._preValue.tr=n,n}get pvt(){if(this._preValue.pvt)return this._preValue.pvt;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._prePvt=0;return}const n=(e-r)/r*t+this._prePvt;return!this.isRealTime&&(this._prePvt=n),this._preValue.pvt=n,n}get wad(){if(this._preValue.wad)return this._preValue.wad;const{close:e,high:t,low:r}=this._currentData,{close:n}=this._preData;if(n===void 0)return this._preWad=0,0;const i=Math.max(t,n),a=Math.min(r,n),u=e-n,c=(u>0?e-a:u<0?e-i:0)+this._preWad;return!this.isRealTime&&(this._preWad=c),this._preValue.wad=c,c}get vwap(){var h,d;if(this._preValue.vwap)return this._preValue.vwap;const{hlc3:e,volume:t}=this._currentData;let{sum:r=0,sumV:n=0,isReset:i}=this._preVwap;if(((d=(h=self.workerStorage)==null?void 0:h.get(this._id))==null?void 0:d.buildInFunctions.timeframe.change({timeframe:"1D"},"vwap_buildin"))&&(i=!0,r=n=0),!i)return;const u=e*t+r,f=t+n;!this.isRealTime&&(this._preVwap={sum:u,sumV:f,isReset:i});const c=u/f;return this._preValue.vwap=c,c}_getNvi(){const e=this._preNvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i<r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._preNvi=a),this._preValue.nvi=a,a}_getPvi(){const e=this._prePvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i>r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._prePvi=a),this._preValue.pvi=a,a}}class vw{constructor(){U(this,"_period");U(this,"_multiplier");U(this,"_unit");this._period="1",this._multiplier=1,this._unit="m"}update(e){if(!e)return;this._period=e;const[t,r]=Ls(e);this._multiplier=t,this._unit=r}get isdaily(){return this._unit==="d"}get isdwm(){return["d","w","M"].includes(this._unit)}get isintraday(){return["s","m","h"].includes(this._unit)}get isminutes(){return this._unit==="m"}get ismonthly(){return this._unit==="M"}get isseconds(){return this._unit==="s"}get isweekly(){return this._unit==="w"}get multiplier(){return this._multiplier}get period(){return this._period}}class gw{constructor(e){U(this,"_variables");this._variables=e}get bg_color(){}get fg_color(){}get is_heikinashi(){return!1}get is_kagi(){return!1}get is_linebreak(){return!1}get is_pnf(){return!1}get is_range(){return!1}get is_renko(){return!1}get is_standard(){return!1}get left_visible_bar_time(){return this._variables.time}get right_visible_bar_time(){return this._variables.time}}class mw{constructor(e){U(this,"_variables");this._variables=e}get basecurrency(){return""}get country(){}get currency(){return"CNY"}get description(){return""}get employees(){return 100}get expiration_date(){}get industry(){}get minmove(){}get mintick(){}get pointvalue(){}get prefix(){}get pricescale(){}get recommendations_buy(){}get recommendations_buy_strong(){}get recommendations_date(){}get recommendations_hold(){}get recommendations_sell(){}get recommendations_sell_strong(){}get recommendations_total(){}get root(){return""}get sector(){}get session(){return qs.regular}get shareholders(){}get shares_outstanding_float(){}get shares_outstanding_total(){}get target_price_average(){}get target_price_date(){}get target_price_estimates(){}get target_price_high(){}get target_price_low(){}get target_price_median(){}get ticker(){}get tickerid(){}get timezone(){}get type(){}get volumetype(){return"n/a"}}class xw{constructor(e){U(this,"_variables");this._variables=e}get future_amount(){}get future_ex_date(){}get future_pay_date(){}}class yw{constructor(e){U(this,"_variables");this._variables=e}get future_eps(){}get future_period_end_time(){}get future_revenue(){}get future_time(){}}ot.extend(_1),ot.extend(yl),ot.extend(d1);class Oh{constructor(e){U(this,"_cacheData");U(this,"_barIndex");U(this,"_isRealTimeBar");U(this,"_barstate");U(this,"_priceVariables");U(this,"_lastBarIndex");U(this,"_currentBarTime");U(this,"_lastBarTime");U(this,"_period");U(this,"_offsetTime");U(this,"_timeframe");U(this,"_ta");U(this,"_polyline");U(this,"_label");U(this,"_line");U(this,"_linefill");U(this,"_box");U(this,"_table");U(this,"_strategy");U(this,"_session");U(this,"syminfo");U(this,"chart");U(this,"earnings");U(this,"dividends");U(this,"_timeTradingday");U(this,"_mintick");this._cacheData={varData:{},varNewData:{},varipData:{}},this._barIndex=0,this._lastBarIndex=0,this._currentBarTime=0,this._lastBarTime=0,this._offsetTime=0,this._period="",this._isRealTimeBar=!1,this._barstate=new hw,this._timeframe=new vw,this._priceVariables={close:0,open:0,low:0,high:0,volume:0},this._ta=new _w(e),this._polyline=new Ti,this._label=new Ti,this._line=new Ti,this._linefill=new Ti,this._box=new Ti,this._table=new Ti(1),this._strategy=new pw(this),this._session=new dw(this),this.syminfo=new mw(this),this.chart=new gw(this),this.earnings=new yw(this),this.dividends=new xw(this)}get table(){return this._table}get box(){return this._box}get linefill(){return this._linefill}get line(){return this._line}get polyline(){return this._polyline}get label(){return this._label}get ta(){return this._ta}get strategy(){return this._strategy}get session(){return this._session}get na(){}get last_bar_index(){return this._lastBarIndex}get bar_index(){return this._barIndex}get barstate(){return this._barstate}get close(){return this._priceVariables.close}get low(){return this._priceVariables.low}get open(){return this._priceVariables.open}get high(){return this._priceVariables.high}get volume(){return this._priceVariables.volume}get ohlc4(){const{close:e,open:t,high:r,low:n}=this._priceVariables;return(e+t+r+n)/4}get hl2(){const{high:e,low:t}=this._priceVariables;return(e+t)/2}get hlc3(){const{close:e,high:t,low:r}=this._priceVariables;return(e+t+r)/3}get hlcc4(){const{close:e,high:t,low:r}=this._priceVariables;return(e*2+t+r)/4}get hour(){return ot(this._currentBarTime).subtract(this._offsetTime,"hour").hour()}get minute(){return ot(this._currentBarTime).minute()}get second(){return ot(this._currentBarTime).second()}get month(){return ot(this._currentBarTime).month()+1}get year(){return ot(this._currentBarTime).year()}get dayofweek(){return ot(this._currentBarTime).day()+1}get dayofmonth(){return ot(this._currentBarTime).date()}get weekofyear(){return ot(this._currentBarTime).week()}get last_bar_time(){return this._lastBarTime}get time(){return this._currentBarTime}get time_close(){const[e,t]=Ls(this._period);return this._isRealTimeBar?void 0:ot(this._currentBarTime).add(e,t).valueOf()}get timenow(){return Date.now()}get time_tradingday(){return this._timeTradingday||this.getTimeTradingday(this._currentBarTime,this._period)}get timeframe(){return this._timeframe}get mintick(){return this._mintick}updateMaxLength(e){const{max_lines_count:t,max_labels_count:r,max_boxes_count:n,max_polylines_count:i}=e;n&&this._box.setMaxLen(n),r&&this._label.setMaxLen(r),t&&this._line.setMaxLen(t),i&&this._polyline.setMaxLen(i)}getTimeTradingday(e,t){const[r,n]=Ls(t),i=ot(e);return["M","w","y","d"].includes(n)?i.valueOf():(i.subtract(this._offsetTime,"h"),i.startOf("d").add(this._offsetTime,"h").valueOf())}updateOptions(e){const{interval:t="1D",offsetTime:r=5,mintick:n}=e;this._period=t,this._mintick=n,this._offsetTime=r,this._timeframe.update(t)}updateData(e){const{barIndex:t,c:r,o:n,h:i,l:a,volume:u,time:f,lastBarIndex:c,lastBarTime:h,complete:d,time_tradingday:p}=e;this._priceVariables={close:Number(r),open:Number(n),high:Number(i),low:Number(a),volume:Number(u)},this._isRealTimeBar=d,t>this._barIndex&&this._isRealTimeBar&&(this._cacheData.varData=this._cacheData.varNewData,this._cacheData.varNewData={}),this._timeTradingday=p,this._currentBarTime=f*1e3,this._lastBarIndex=c,this._barIndex=t,this._lastBarTime=h*1e3,this._barstate.update(t,c,d,!1),this.ta.update({...this._priceVariables,hlc3:this.hlc3,barIndex:t})}getCacheData(e,t,r){const n=this.setCacheData(e,r);return n[n.length-1-t]}setCacheData(e,t){let r=this._cacheData[e]||{barIndex:-1,data:[]};return r.barIndex>this._barIndex||(r.barIndex===this._barIndex?r.data[r.data.length-1]=t:r.data.push(t),r.barIndex=this._barIndex,this._cacheData[e]=r),r.data}getTypeInstance(e,t){return new l1(e,t)}getVarValue(e,t,r){const n=`${e}_${t}`,i=r==="var"?this._cacheData.varData[n]:this._cacheData.varipData[n];if(i)return i}setVarValue(e,t,r,n){const i=`${e}_${t}`;let a;switch(typeof r=="object"&&r&&(n="var",a=r.varipKeys),n){case"var":if(this._isRealTimeBar){const u=Yr.cloneDeep(r);if(this._cacheData.varNewData[i]=u,a&&a.length)for(const f of a)this._cacheData.varData[i][f]=u[f]}else this._cacheData.varData[i]=r;break;case"varip":this._cacheData.varipData[i]=r;break}return r}add(e,t){return Array.isArray(e)&&Array.isArray(t)?Yr.uniq([...e,...t]):typeof e=="number"||typeof t=="number"?Number(e)+Number(t):e+t}sub(e,t){return Array.isArray(e)&&Array.isArray(t)?e.filter(r=>!t.includes(r)):Number(e)-Number(t)}againAssignParse(e,t){var n;if(t)return;const r=(n=e==null?void 0:e.constructor)==null?void 0:n.name;if(r)switch(r){case hs.name:case Wf.name:case ps.name:case iu.name:case ds.name:case Fo.name:e==null||e.delete();break}}}class Ti{constructor(e=50){U(this,"_all");U(this,"_allInstance");U(this,"_pseudoArrayAll");U(this,"_maxLength");this._all=new Map,this._allInstance=new Map,this._pseudoArrayAll=new it,this._maxLength=e}setMaxLen(e){this._maxLength=e}get data(){return[...this._all.values()]}get all(){return this._pseudoArrayAll._value=[...this._allInstance.values()],this._pseudoArrayAll}add(e,t,r){if(this._all.set(e,t),this._allInstance.set(e,r),this._all.size>this._maxLength){const n=this._all.keys().next().value;n&&this.delete(n)}}getValOfBarIndex(e){let t=[];const r=[...this._all.keys()];for(const n of e){const i=r.filter(a=>a.endsWith(`_${n}`));for(const a of i){const u=this._all.get(a);u&&t.push(u)}}return t.length?t:void 0}get(e){return this._all.get(e)}getInstance(e){return this._allInstance.get(e)}delete(e){this._all.delete(e),this._allInstance.delete(e)}}/**
75
+ */return t.mode.CTRGladman=function(){var r=t.lib.BlockCipherMode.extend();function n(u){if((u>>24&255)===255){var c=u>>16&255,f=u>>8&255,h=u&255;c===255?(c=0,f===255?(f=0,h===255?h=0:++h):++f):++c,u=0,u+=c<<16,u+=f<<8,u+=h}else u+=1<<24;return u}function i(u){return(u[0]=n(u[0]))===0&&(u[1]=n(u[1])),u}var a=r.Encryptor=r.extend({processBlock:function(u,c){var f=this._cipher,h=f.blockSize,d=this._iv,p=this._counter;d&&(p=this._counter=d.slice(0),this._iv=void 0),i(p);var v=p.slice(0);f.encryptBlock(v,0);for(var x=0;x<h;x++)u[c+x]^=v[x]}});return r.Decryptor=a,r}(),t.mode.CTRGladman})}(Fu)),Fu.exports}var Bu={exports:{}},mh;function ZD(){return mh||(mh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.OFB=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,c=u.blockSize,f=this._iv,h=this._keystream;f&&(h=this._keystream=f.slice(0),this._iv=void 0),u.encryptBlock(h,0);for(var d=0;d<c;d++)i[a+d]^=h[d]}});return r.Decryptor=n,r}(),t.mode.OFB})}(Bu)),Bu.exports}var Mu={exports:{}},xh;function VD(){return xh||(xh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.mode.ECB=function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(n,i){this._cipher.encryptBlock(n,i)}}),r.Decryptor=r.extend({processBlock:function(n,i){this._cipher.decryptBlock(n,i)}}),r}(),t.mode.ECB})}(Mu)),Mu.exports}var Nu={exports:{}},yh;function GD(){return yh||(yh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.AnsiX923={pad:function(r,n){var i=r.sigBytes,a=n*4,u=a-i%a,c=i+u-1;r.clamp(),r.words[c>>>2]|=u<<24-c%4*8,r.sigBytes+=u},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Ansix923})}(Nu)),Nu.exports}var Su={exports:{}},Dh;function KD(){return Dh||(Dh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.Iso10126={pad:function(r,n){var i=n*4,a=i-r.sigBytes%i;r.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Iso10126})}(Su)),Su.exports}var Ou={exports:{}},wh;function XD(){return wh||(wh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.Iso97971={pad:function(r,n){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,n)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})}(Ou)),Ou.exports}var Iu={exports:{}},bh;function QD(){return bh||(bh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.ZeroPadding={pad:function(r,n){var i=n*4;r.clamp(),r.sigBytes+=i-(r.sigBytes%i||i)},unpad:function(r){for(var n=r.words,i=r.sigBytes-1,i=r.sigBytes-1;i>=0;i--)if(n[i>>>2]>>>24-i%4*8&255){r.sigBytes=i+1;break}}},t.pad.ZeroPadding})}(Iu)),Iu.exports}var Tu={exports:{}},Eh;function JD(){return Eh||(Eh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Tu)),Tu.exports}var $u={exports:{}},Ah;function ew(){return Ah||(Ah=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),jt())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.CipherParams,u=n.enc,c=u.Hex,f=n.format;f.Hex={stringify:function(h){return h.ciphertext.toString(c)},parse:function(h){var d=c.parse(h);return a.create({ciphertext:d})}}}(),t.format.Hex})}($u)),$u.exports}var Lu={exports:{}},Ch;function tw(){return Ch||(Ch=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,a=r.algo,u=[],c=[],f=[],h=[],d=[],p=[],v=[],x=[],_=[],y=[];(function(){for(var D=[],C=0;C<256;C++)C<128?D[C]=C<<1:D[C]=C<<1^283;for(var b=0,F=0,C=0;C<256;C++){var B=F^F<<1^F<<2^F<<3^F<<4;B=B>>>8^B&255^99,u[b]=B,c[B]=b;var M=D[b],O=D[M],A=D[O],N=D[B]*257^B*16843008;f[b]=N<<24|N>>>8,h[b]=N<<16|N>>>16,d[b]=N<<8|N>>>24,p[b]=N;var N=A*16843009^O*65537^M*257^b*16843008;v[B]=N<<24|N>>>8,x[B]=N<<16|N>>>16,_[B]=N<<8|N>>>24,y[B]=N,b?(b=M^D[D[D[A^M]]],F^=D[D[F]]):b=F=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],w=a.AES=i.extend({_doReset:function(){var D;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var C=this._keyPriorReset=this._key,b=C.words,F=C.sigBytes/4,B=this._nRounds=F+6,M=(B+1)*4,O=this._keySchedule=[],A=0;A<M;A++)A<F?O[A]=b[A]:(D=O[A-1],A%F?F>6&&A%F==4&&(D=u[D>>>24]<<24|u[D>>>16&255]<<16|u[D>>>8&255]<<8|u[D&255]):(D=D<<8|D>>>24,D=u[D>>>24]<<24|u[D>>>16&255]<<16|u[D>>>8&255]<<8|u[D&255],D^=m[A/F|0]<<24),O[A]=O[A-F]^D);for(var N=this._invKeySchedule=[],I=0;I<M;I++){var A=M-I;if(I%4)var D=O[A];else var D=O[A-4];I<4||A<=4?N[I]=D:N[I]=v[u[D>>>24]]^x[u[D>>>16&255]]^_[u[D>>>8&255]]^y[u[D&255]]}}},encryptBlock:function(D,C){this._doCryptBlock(D,C,this._keySchedule,f,h,d,p,u)},decryptBlock:function(D,C){var b=D[C+1];D[C+1]=D[C+3],D[C+3]=b,this._doCryptBlock(D,C,this._invKeySchedule,v,x,_,y,c);var b=D[C+1];D[C+1]=D[C+3],D[C+3]=b},_doCryptBlock:function(D,C,b,F,B,M,O,A){for(var N=this._nRounds,I=D[C]^b[0],L=D[C+1]^b[1],k=D[C+2]^b[2],z=D[C+3]^b[3],R=4,G=1;G<N;G++){var H=F[I>>>24]^B[L>>>16&255]^M[k>>>8&255]^O[z&255]^b[R++],ee=F[L>>>24]^B[k>>>16&255]^M[z>>>8&255]^O[I&255]^b[R++],te=F[k>>>24]^B[z>>>16&255]^M[I>>>8&255]^O[L&255]^b[R++],j=F[z>>>24]^B[I>>>16&255]^M[L>>>8&255]^O[k&255]^b[R++];I=H,L=ee,k=te,z=j}var H=(A[I>>>24]<<24|A[L>>>16&255]<<16|A[k>>>8&255]<<8|A[z&255])^b[R++],ee=(A[L>>>24]<<24|A[k>>>16&255]<<16|A[z>>>8&255]<<8|A[I&255])^b[R++],te=(A[k>>>24]<<24|A[z>>>16&255]<<16|A[I>>>8&255]<<8|A[L&255])^b[R++],j=(A[z>>>24]<<24|A[I>>>16&255]<<16|A[L>>>8&255]<<8|A[k&255])^b[R++];D[C]=H,D[C+1]=ee,D[C+2]=te,D[C+3]=j},keySize:256/32});r.AES=i._createHelper(w)}(),t.AES})}(Lu)),Lu.exports}var Ru={exports:{}},Fh;function rw(){return Fh||(Fh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=n.BlockCipher,u=r.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],f=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],v=u.DES=a.extend({_doReset:function(){for(var m=this._key,w=m.words,D=[],C=0;C<56;C++){var b=c[C]-1;D[C]=w[b>>>5]>>>31-b%32&1}for(var F=this._subKeys=[],B=0;B<16;B++){for(var M=F[B]=[],O=h[B],C=0;C<24;C++)M[C/6|0]|=D[(f[C]-1+O)%28]<<31-C%6,M[4+(C/6|0)]|=D[28+(f[C+24]-1+O)%28]<<31-C%6;M[0]=M[0]<<1|M[0]>>>31;for(var C=1;C<7;C++)M[C]=M[C]>>>(C-1)*4+3;M[7]=M[7]<<5|M[7]>>>27}for(var A=this._invSubKeys=[],C=0;C<16;C++)A[C]=F[15-C]},encryptBlock:function(m,w){this._doCryptBlock(m,w,this._subKeys)},decryptBlock:function(m,w){this._doCryptBlock(m,w,this._invSubKeys)},_doCryptBlock:function(m,w,D){this._lBlock=m[w],this._rBlock=m[w+1],x.call(this,4,252645135),x.call(this,16,65535),_.call(this,2,858993459),_.call(this,8,16711935),x.call(this,1,1431655765);for(var C=0;C<16;C++){for(var b=D[C],F=this._lBlock,B=this._rBlock,M=0,O=0;O<8;O++)M|=d[O][((B^b[O])&p[O])>>>0];this._lBlock=B,this._rBlock=F^M}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,x.call(this,1,1431655765),_.call(this,8,16711935),_.call(this,2,858993459),x.call(this,16,65535),x.call(this,4,252645135),m[w]=this._lBlock,m[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function x(m,w){var D=(this._lBlock>>>m^this._rBlock)&w;this._rBlock^=D,this._lBlock^=D<<m}function _(m,w){var D=(this._rBlock>>>m^this._lBlock)&w;this._lBlock^=D,this._rBlock^=D<<m}r.DES=a._createHelper(v);var y=u.TripleDES=a.extend({_doReset:function(){var m=this._key,w=m.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var D=w.slice(0,2),C=w.length<4?w.slice(0,2):w.slice(2,4),b=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=v.createEncryptor(i.create(D)),this._des2=v.createEncryptor(i.create(C)),this._des3=v.createEncryptor(i.create(b))},encryptBlock:function(m,w){this._des1.encryptBlock(m,w),this._des2.decryptBlock(m,w),this._des3.encryptBlock(m,w)},decryptBlock:function(m,w){this._des3.decryptBlock(m,w),this._des2.encryptBlock(m,w),this._des1.decryptBlock(m,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=a._createHelper(y)}(),t.TripleDES})}(Ru)),Ru.exports}var Pu={exports:{}},Bh;function nw(){return Bh||(Bh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=a.RC4=i.extend({_doReset:function(){for(var h=this._key,d=h.words,p=h.sigBytes,v=this._S=[],x=0;x<256;x++)v[x]=x;for(var x=0,_=0;x<256;x++){var y=x%p,m=d[y>>>2]>>>24-y%4*8&255;_=(_+v[x]+m)%256;var w=v[x];v[x]=v[_],v[_]=w}this._i=this._j=0},_doProcessBlock:function(h,d){h[d]^=c.call(this)},keySize:256/32,ivSize:0});function c(){for(var h=this._S,d=this._i,p=this._j,v=0,x=0;x<4;x++){d=(d+1)%256,p=(p+h[d])%256;var _=h[d];h[d]=h[p],h[p]=_,v|=h[(h[d]+h[p])%256]<<24-x*8}return this._i=d,this._j=p,v}r.RC4=i._createHelper(u);var f=a.RC4Drop=u.extend({cfg:u.cfg.extend({drop:192}),_doReset:function(){u._doReset.call(this);for(var h=this.cfg.drop;h>0;h--)c.call(this)}});r.RC4Drop=i._createHelper(f)}(),t.RC4})}(Pu)),Pu.exports}var ku={exports:{}},Mh;function iw(){return Mh||(Mh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=[],c=[],f=[],h=a.Rabbit=i.extend({_doReset:function(){for(var p=this._key.words,v=this.cfg.iv,x=0;x<4;x++)p[x]=(p[x]<<8|p[x]>>>24)&16711935|(p[x]<<24|p[x]>>>8)&4278255360;var _=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],y=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var x=0;x<4;x++)d.call(this);for(var x=0;x<8;x++)y[x]^=_[x+4&7];if(v){var m=v.words,w=m[0],D=m[1],C=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,F=C>>>16|b&4294901760,B=b<<16|C&65535;y[0]^=C,y[1]^=F,y[2]^=b,y[3]^=B,y[4]^=C,y[5]^=F,y[6]^=b,y[7]^=B;for(var x=0;x<4;x++)d.call(this)}},_doProcessBlock:function(p,v){var x=this._X;d.call(this),u[0]=x[0]^x[5]>>>16^x[3]<<16,u[1]=x[2]^x[7]>>>16^x[5]<<16,u[2]=x[4]^x[1]>>>16^x[7]<<16,u[3]=x[6]^x[3]>>>16^x[1]<<16;for(var _=0;_<4;_++)u[_]=(u[_]<<8|u[_]>>>24)&16711935|(u[_]<<24|u[_]>>>8)&4278255360,p[v+_]^=u[_]},blockSize:128/32,ivSize:64/32});function d(){for(var p=this._X,v=this._C,x=0;x<8;x++)c[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<c[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<c[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<c[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<c[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<c[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<c[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<c[6]>>>0?1:0)|0,this._b=v[7]>>>0<c[7]>>>0?1:0;for(var x=0;x<8;x++){var _=p[x]+v[x],y=_&65535,m=_>>>16,w=((y*y>>>17)+y*m>>>15)+m*m,D=((_&4294901760)*_|0)+((_&65535)*_|0);f[x]=w^D}p[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,p[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,p[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,p[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,p[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,p[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,p[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,p[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}r.Rabbit=i._createHelper(h)}(),t.Rabbit})}(ku)),ku.exports}var zu={exports:{}},Nh;function sw(){return Nh||(Nh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=[],c=[],f=[],h=a.RabbitLegacy=i.extend({_doReset:function(){var p=this._key.words,v=this.cfg.iv,x=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],_=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var y=0;y<4;y++)d.call(this);for(var y=0;y<8;y++)_[y]^=x[y+4&7];if(v){var m=v.words,w=m[0],D=m[1],C=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,F=C>>>16|b&4294901760,B=b<<16|C&65535;_[0]^=C,_[1]^=F,_[2]^=b,_[3]^=B,_[4]^=C,_[5]^=F,_[6]^=b,_[7]^=B;for(var y=0;y<4;y++)d.call(this)}},_doProcessBlock:function(p,v){var x=this._X;d.call(this),u[0]=x[0]^x[5]>>>16^x[3]<<16,u[1]=x[2]^x[7]>>>16^x[5]<<16,u[2]=x[4]^x[1]>>>16^x[7]<<16,u[3]=x[6]^x[3]>>>16^x[1]<<16;for(var _=0;_<4;_++)u[_]=(u[_]<<8|u[_]>>>24)&16711935|(u[_]<<24|u[_]>>>8)&4278255360,p[v+_]^=u[_]},blockSize:128/32,ivSize:64/32});function d(){for(var p=this._X,v=this._C,x=0;x<8;x++)c[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<c[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<c[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<c[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<c[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<c[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<c[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<c[6]>>>0?1:0)|0,this._b=v[7]>>>0<c[7]>>>0?1:0;for(var x=0;x<8;x++){var _=p[x]+v[x],y=_&65535,m=_>>>16,w=((y*y>>>17)+y*m>>>15)+m*m,D=((_&4294901760)*_|0)+((_&65535)*_|0);f[x]=w^D}p[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,p[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,p[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,p[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,p[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,p[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,p[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,p[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}r.RabbitLegacy=i._createHelper(h)}(),t.RabbitLegacy})}(zu)),zu.exports}var qu={exports:{}},Sh;function ow(){return Sh||(Sh=1,function(s,e){(function(t,r,n){s.exports=r(Ge(),oi(),ai(),kn(),jt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,a=r.algo;const u=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],f=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var h={pbox:[],sbox:[]};function d(y,m){let w=m>>24&255,D=m>>16&255,C=m>>8&255,b=m&255,F=y.sbox[0][w]+y.sbox[1][D];return F=F^y.sbox[2][C],F=F+y.sbox[3][b],F}function p(y,m,w){let D=m,C=w,b;for(let F=0;F<u;++F)D=D^y.pbox[F],C=d(y,D)^C,b=D,D=C,C=b;return b=D,D=C,C=b,C=C^y.pbox[u],D=D^y.pbox[u+1],{left:D,right:C}}function v(y,m,w){let D=m,C=w,b;for(let F=u+1;F>1;--F)D=D^y.pbox[F],C=d(y,D)^C,b=D,D=C,C=b;return b=D,D=C,C=b,C=C^y.pbox[1],D=D^y.pbox[0],{left:D,right:C}}function x(y,m,w){for(let B=0;B<4;B++){y.sbox[B]=[];for(let M=0;M<256;M++)y.sbox[B][M]=f[B][M]}let D=0;for(let B=0;B<u+2;B++)y.pbox[B]=c[B]^m[D],D++,D>=w&&(D=0);let C=0,b=0,F=0;for(let B=0;B<u+2;B+=2)F=p(y,C,b),C=F.left,b=F.right,y.pbox[B]=C,y.pbox[B+1]=b;for(let B=0;B<4;B++)for(let M=0;M<256;M+=2)F=p(y,C,b),C=F.left,b=F.right,y.sbox[B][M]=C,y.sbox[B][M+1]=b;return!0}var _=a.Blowfish=i.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var y=this._keyPriorReset=this._key,m=y.words,w=y.sigBytes/4;x(h,m,w)}},encryptBlock:function(y,m){var w=p(h,y[m],y[m+1]);y[m]=w.left,y[m+1]=w.right},decryptBlock:function(y,m){var w=v(h,y[m],y[m+1]);y[m]=w.left,y[m+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=i._createHelper(_)}(),t.Blowfish})}(qu)),qu.exports}(function(s,e){(function(t,r,n){s.exports=r(Ge(),Bo(),LD(),RD(),oi(),PD(),ai(),nh(),pu(),kD(),ah(),zD(),qD(),UD(),Du(),WD(),kn(),jt(),HD(),jD(),YD(),ZD(),VD(),GD(),KD(),XD(),QD(),JD(),ew(),tw(),rw(),nw(),iw(),sw(),ow())})(ye,function(t){return t})})(Vc);var Mo=Vc.exports;class aw{constructor(e,t){U(this,"_variables");U(this,"_scriptId");this._variables=e,this._scriptId=t}security(e,t){const r=self.workerStorage.get(`request_${this._scriptId}`);let{expression:n,paramsExpr:i=[]}=e;if(r!=null&&r.has(t)){const _=r.get(t);return this._runScripts(_,t,!0,i)}let a=[],u=1;n=Mo.AES.decrypt(n,"1234").toString(Mo.enc.Utf8);const c=JSON.parse(n),f=c.pop();let h=(f==null?void 0:f.depends)||[];if(!h.length)return this._runScripts((f==null?void 0:f.code)||"",t,!0,i);let d=[],p=[];if(this._getDependCodes(h,c,a,d,p),p.length){const _=i.length;let y=[];for(let m=_-1;m>=0;m--){const w=i[m];let D=JSON.parse(Mo.AES.decrypt(w,"1234").toString(Mo.enc.Utf8));const C=[];u!==0&&y.unshift("{"),u++,D=D.map(F=>{const{scope:B,code:M,varNames:O,dependSelf:A}=F;return B===2&&!C.includes(O)&&!A&&(F.code=`let ${M}`),O&&C.push(...O.split(",")),F});let b=p.map(F=>({...F,isArg:!1,isPreArg:!0}));p=[],this._getDependCodes(b,D,y,d,p),a=y.concat(a),y=[]}}for(a.push(`return ${f==null?void 0:f.code}`);u>1;)a.push("}"),u--;a=d.concat(a);const v=a.join(`
76
+ `),x=this._runScripts(v,t,!0,i);return r==null||r.set(t,v),x}_getDependCodes(e,t,r,n,i){for(const a of e){if(!a.isArg){const u=t.filter(f=>{var h;return(h=f==null?void 0:f.depends)==null?void 0:h.some(d=>d.name===a.name&&d.scope===a.scope&&d.isAgainAssign)});for(const f of u){const{code:h,depends:d}=f;r.includes(h)||(r.unshift(h),d!=null&&d.length&&this._getDependCodes(d,t,r,n,i))}const c=t.find(f=>{var h;return((h=f.varNames)==null?void 0:h.split(", ").includes(a.name))&&(!a.isPreArg||a.isPreArg&&f.methodName===a.functionName)||f.funcName===a.name});if(c){const{code:f,depends:h}=c,d=r.findIndex(p=>p===f);d!==-1&&r.splice(d,1),r.unshift(f),h!=null&&h.length&&this._getDependCodes(h,t,r,n,i);continue}}i.some(u=>u.name===a.name)||i.push(a)}}_runScripts(e,t,r,n,i){const a=`${this._scriptId}_${t}`;let{builtInGather:u,buildinConstants:c,buildInFunctions:f,tradingvueFunc:h}=self.workerStorage.get(a)||{};return r&&(u=new Oh(a),c=new Uc,f=new Zc(this._variables.mintick||1e-4,u,this._scriptId),h=new Function("$_var","$_const","$_func","$paramsExpr","$posStr",e),self.workerStorage.set(a,{builtInGather:u,buildinConstants:c,buildInFunctions:f,tradingvueFunc:h})),h(u,c,f,n||[],t)}}let uw=class{constructor(){}prefix(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[0])||""}ticker(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[1])||""}};class lw{constructor(e){U(this,"_logs");U(this,"_variables");U(this,"_intlFormat");this._variables=e,this._logs=[],this._intlFormat=new Intl.NumberFormat("en-US")}get logs(){return this._logs}clearLogs(){this._logs=[]}info(e,t,r){this._addLog(e,t,"info",r)}error(e,t,r){this._addLog(e,t,"error",r)}warning(e,t,r){this._addLog(e,t,"warning",r)}_addLog(e,t,r,n){if(typeof t=="string"&&(n=t),n.startsWith("export"))return;const{message:i,formatString:a}=e,{time:u,bar_index:c}=this._variables;let f=i;a&&Array.isArray(t)&&t.length&&(f=a.replace(/{(\d+)}/g,(h,d)=>{let p=t[d];return typeof p=="number"&&(p=this._intlFormat.format(parseFloat(p.toFixed(3)))),p!==void 0?p:h})),f&&this._logs.push({message:`[${ot(u).format()}]: ${f}`,time:u,barIndex:c,type:r})}}class fw{constructor(e){U(this,"_errorListener");this._errorListener=e}error({message:e},t){t.startsWith("export")||this._errorListener.addError(e,t,Ve.Error)}}class cw{constructor(){U(this,"_errors");this._errors=new Map}clear(){this._errors.clear()}get errors(){return Yr.flatMap([...this._errors.values()])}addError(e,t,r,n=0){const[i,a]=t.split("_").slice(-2),u=this._errors.get(t),c={message:e,endLineNumber:Number(i),startColumn:Number(a)+1,endColumn:Number(a)+n+1,startLineNumber:Number(i),type:r};u?u.push(c):this._errors.set(t,[c])}}class hw{constructor(){U(this,"_isMarketOpen");U(this,"_currentBarIndex");U(this,"_totalBarIndex");U(this,"_isRealTimeBar");U(this,"_preBarIndex");this._currentBarIndex=0,this._totalBarIndex=0,this._isRealTimeBar=!1,this._preBarIndex=0,this._isMarketOpen=!0}update(e,t,r,n){this._preBarIndex=this._currentBarIndex,this._currentBarIndex=e,this._totalBarIndex=t,this._isRealTimeBar=r,this._isMarketOpen=n}get isnew(){return!this._isRealTimeBar||this._preBarIndex!==this._currentBarIndex}get islast(){return this._currentBarIndex===this._totalBarIndex}get isfirst(){return this._currentBarIndex===0}get ishistory(){return!this._isRealTimeBar}get isrealtime(){return this._isRealTimeBar}get isconfirmed(){return!this._isRealTimeBar}get islastconfirmedhistory(){return this._isMarketOpen?this._currentBarIndex===this._totalBarIndex-1:this._currentBarIndex===this._totalBarIndex}}class dw{constructor(e){U(this,"_variables");this._variables=e}get isfirstbar(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get isfirstbar_regular(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get islastbar(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get islastbar_regular(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get ismarket(){return!0}get ispostmarket(){return!1}get ispremarket(){return!1}}class pw{constructor(e){U(this,"_orders");U(this,"_historyOrders");U(this,"_options");U(this,"_max_contracts_held_all",0);U(this,"_max_contracts_held_long",0);U(this,"_max_contracts_held_short",0);U(this,"_max_drawdown",0);U(this,"_max_runup",0);U(this,"_max_runup_percent",0);U(this,"_max_drawdown_percent",0);U(this,"_variables");U(this,"_netprofit",0);U(this,"_eventrades",0);U(this,"_avg_trade_percent");U(this,"_closedtrades",0);U(this,"_losstrades",0);U(this,"_grossloss",0);U(this,"_grossloss_percent",0);U(this,"_grossprofit",0);U(this,"_grossprofit_percent",0);U(this,"_wintrades",0);U(this,"_opentrades_capital_held",0);U(this,"_position_avg_price",0);U(this,"_position_size",0);this._orders=[],this._historyOrders=[],this._variables=e}update(){this._calcMaxDrawdownAndMaxRunup()}_calcMaxDrawdownAndMaxRunup(){let e=0,t=0;const{high:r,low:n}=this._variables;for(const f of this._orders){const{in_price:h,qty:d=0,commission:p=0,original_qty:v=0,direction:x}=f,_=x===gt.long?1:-1,y=(r-h)*d,m=(n-h)*d,w=_===1?y:-m,D=_===1?-m:y;e+=D+p*d/v,t+=w+p*d/v}const[i,a]=this._historyOrders.reduce((f,h)=>{let[d,p]=f;const{profit:v=0,commission:x=0}=h;return d+=v,p+=v-x,[d,p]},[0,0]);e-=i,t+=a;const u=e/(this.initial_capital+this.netprofit)*100;this._max_drawdown<e&&(this._max_drawdown=e),u>this._max_drawdown_percent&&(this._max_drawdown_percent=u);const c=t/(this.initial_capital+this.netprofit)*100;t>this._max_runup&&(this._max_runup=t),c>this._max_runup_percent&&(this._max_runup_percent=c)}updateOrders(e){this._orders=e,this._calcMaxContracts()}_calcMaxContracts(){const e=this._orders.length;if(!e)return;const[t,r,n,i,a,u]=this._orders.reduce(([c,f,h,d,p,v],x)=>{const{direction:_,qty:y=0,in_price:m}=x;return _===gt.long?(c+=y,f+=y,v+=y):(c+=y,h+=y,v-=y),d+=y*m,p+=m,[c,f,h,d,p,v]},[0,0,0,0,0,0]);this._position_size=u,this._position_avg_price=a/e,this._opentrades_capital_held=i,this._max_contracts_held_all=Math.max(t,this._max_contracts_held_all),this._max_contracts_held_long=Math.max(r,this._max_contracts_held_long),this._max_contracts_held_short=Math.max(n,this._max_contracts_held_short)}updateHistoryOrders(e){this._historyOrders=e;const t=this._historyOrders.length;this._closedtrades=t;const[r,n,i,a,u,c]=this._historyOrders.reduce((f,h)=>{let[d,p,v,x,_,y]=f;const{profit:m=0,profit_percent:w=0}=h;return d+=m,p+=w,m<0?(v+=m,x+=w):(_+=m,y+=w),[d,p,v,x,_,y]},[0,0,0,0,0,0]);this._avg_trade_percent=t?n/t:void 0,this._netprofit=r,this._grossloss=i,this._grossloss_percent=a,this._grossprofit=u,this._grossprofit_percent=c,this._eventrades=this._historyOrders.filter(f=>f.profit===0).length,this._losstrades=this._historyOrders.filter(f=>(f.profit||0)<0).length,this._wintrades=this._historyOrders.filter(f=>(f.profit||0)>0).length}updateStrategyOptions(e){this._options=e}get long(){return"long"}get short(){return"short"}get account_currency(){return"USD"}get closedtrades(){return this._closedtrades}get opentrades(){return{opentrades:this._orders.length,capital_held:this._opentrades_capital_held}}get avg_losing_trade(){const e=this.losstrades;return e?Math.abs(this.grossloss/e):void 0}get avg_losing_trade_percent(){const e=this.losstrades;return e?Math.abs(this.grossloss_percent/e):void 0}get avg_trade(){if(this.closedtrades)return Math.abs(this.netprofit/this.closedtrades)}get equity(){return this.initial_capital+this.netprofit+this.openprofit}get netprofit(){return this._netprofit}get eventrades(){return this._eventrades}get openprofit(){return this._orders.reduce((e,t)=>{const{profit:r=0}=t;return e+r},0)}get avg_trade_percent(){return this._avg_trade_percent}get avg_winning_trade(){const e=this.wintrades;return e?Math.abs(this.grossprofit/e):void 0}get avg_winning_trade_percent(){const e=this.wintrades;return e?Math.abs(this.grossprofit_percent/e):void 0}get initial_capital(){var e;return((e=this._options)==null?void 0:e.initial_capital)||0}get losstrades(){return this._losstrades}get grossloss(){return this._grossloss}get grossloss_percent(){return this._grossloss_percent}get grossprofit(){return this._grossprofit}get grossprofit_percent(){return this._grossprofit_percent}get wintrades(){return this._wintrades}get margin_liquidation_price(){if(!this._options)return;const{initial_capital:e,margin_long:t=0,margin_short:r=0,commission_type:n,commission_value:i=0}=this._options,a=this._orders[0].direction===gt.long?1:-1,u=(a===1?t:r)/100;if(u<=0)return;const{close:c}=this._variables,[f,h]=this._orders.reduce((d,p)=>{let[v,x]=d;const{in_price:_,qty:y=0,original_qty:m=0}=p,w=_*y;if(v+=w,i){let D=0;switch(n){case Ir.percent:D=(w+y*c)*i/100;break;case Ir.cashPerContract:D=y*i*2;break;case Ir.cashPerOrder:D=y/m*i+i;break}x+=D}return[v,x]},[0,0]);return(f-(e+this.netprofit-h))*a/this.position_size/(1-a*u)}get max_contracts_held_all(){return this._max_contracts_held_all}get max_contracts_held_long(){return this._max_contracts_held_long}get max_contracts_held_short(){return this._max_contracts_held_short}get max_drawdown(){return this._max_drawdown}get max_runup(){return this._max_runup}get max_runup_percent(){return this._max_runup_percent}get max_drawdown_percent(){return this._max_drawdown_percent}get netprofit_percent(){return this.netprofit/this.initial_capital*100}get openprofit_percent(){return this.openprofit/(this.initial_capital+this.netprofit)*100}get position_avg_price(){return this._position_avg_price}get position_entry_name(){if(this._orders.length)return this._orders[0].id}get position_size(){return this._position_size}}class _w{constructor(e){U(this,"_preAccdist");U(this,"_preNvi");U(this,"_prePvi");U(this,"_preObv");U(this,"_prePvt");U(this,"_preWad");U(this,"_preVwap");U(this,"_preValue");U(this,"_currentData");U(this,"_preData");U(this,"_id");this._preAccdist=0,this._preNvi=0,this._prePvi=0,this._preObv=0,this._prePvt=0,this._preWad=0,this._preVwap={},this._preValue={},this._currentData={},this._preData={},this._id=e}update(e){this._preValue={},e.barIndex!==this._currentData.barIndex&&(this._preData={...this._currentData}),this._currentData={...e}}get isRealTime(){return this._preData.barIndex===this._currentData.barIndex}get accdist(){if(this._preValue.accdist)return this._preValue.accdist;const{close:e,low:t,high:r,volume:n}=this._currentData;if(r===t)return this._preAccdist;const i=(e-t-(r-e))/(r-t)*n+this._preAccdist;return!this.isRealTime&&(this._preAccdist=i),this._preValue.accdist=i,i}get iii(){if(this._preValue.iii)return this._preValue.iii;const{close:e,low:t,high:r,volume:n}=this._currentData,i=(2*e-r-t)/((r-t)*n);return this._preValue.iii=i,i}get nvi(){return this._preValue.nvi?this._preValue.nvi:this._getNvi()}get wvad(){if(this._preValue.wvad)return this._preValue.wvad;const{close:e,low:t,high:r,volume:n,open:i}=this._currentData,a=(e-i)/(r-t)*n;return this._preValue.wvad=a,a}get obv(){if(this._preValue.obv)return this._preValue.obv;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._preObv=0;return}const n=Math.sign(e-r)*t+this._preObv;return!this.isRealTime&&(this._preObv=n),this._preValue.obv=n,n}get pvi(){return this._preValue.pvi?this._preValue.pvi:this._getPvi()}get tr(){if(this._preValue.tr)return this._preValue.tr;const{low:e,high:t}=this._currentData,{close:r}=this._preData;if(r===void 0)return;const n=Math.max(t-e,Math.abs(t-r),Math.abs(e-r));return this._preValue.tr=n,n}get pvt(){if(this._preValue.pvt)return this._preValue.pvt;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._prePvt=0;return}const n=(e-r)/r*t+this._prePvt;return!this.isRealTime&&(this._prePvt=n),this._preValue.pvt=n,n}get wad(){if(this._preValue.wad)return this._preValue.wad;const{close:e,high:t,low:r}=this._currentData,{close:n}=this._preData;if(n===void 0)return this._preWad=0,0;const i=Math.max(t,n),a=Math.min(r,n),u=e-n,f=(u>0?e-a:u<0?e-i:0)+this._preWad;return!this.isRealTime&&(this._preWad=f),this._preValue.wad=f,f}get vwap(){var h,d;if(this._preValue.vwap)return this._preValue.vwap;const{hlc3:e,volume:t}=this._currentData;let{sum:r=0,sumV:n=0,isReset:i}=this._preVwap;if(((d=(h=self.workerStorage)==null?void 0:h.get(this._id))==null?void 0:d.buildInFunctions.timeframe.change({timeframe:"1D"},"vwap_buildin"))&&(i=!0,r=n=0),!i)return;const u=e*t+r,c=t+n;!this.isRealTime&&(this._preVwap={sum:u,sumV:c,isReset:i});const f=u/c;return this._preValue.vwap=f,f}_getNvi(){const e=this._preNvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i<r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._preNvi=a),this._preValue.nvi=a,a}_getPvi(){const e=this._prePvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i>r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._prePvi=a),this._preValue.pvi=a,a}}class vw{constructor(){U(this,"_period");U(this,"_multiplier");U(this,"_unit");this._period="1",this._multiplier=1,this._unit="m"}update(e){if(!e)return;this._period=e;const[t,r]=Rs(e);this._multiplier=t,this._unit=r}get isdaily(){return this._unit==="d"}get isdwm(){return["d","w","M"].includes(this._unit)}get isintraday(){return["s","m","h"].includes(this._unit)}get isminutes(){return this._unit==="m"}get ismonthly(){return this._unit==="M"}get isseconds(){return this._unit==="s"}get isweekly(){return this._unit==="w"}get multiplier(){return this._multiplier}get period(){return this._period}}class gw{constructor(e){U(this,"_variables");this._variables=e}get bg_color(){}get fg_color(){}get is_heikinashi(){return!1}get is_kagi(){return!1}get is_linebreak(){return!1}get is_pnf(){return!1}get is_range(){return!1}get is_renko(){return!1}get is_standard(){return!1}get left_visible_bar_time(){return this._variables.time}get right_visible_bar_time(){return this._variables.time}}class mw{constructor(e){U(this,"_variables");this._variables=e}get basecurrency(){return""}get country(){}get currency(){return"CNY"}get description(){return""}get employees(){return 100}get expiration_date(){}get industry(){}get minmove(){}get mintick(){}get pointvalue(){}get prefix(){}get pricescale(){}get recommendations_buy(){}get recommendations_buy_strong(){}get recommendations_date(){}get recommendations_hold(){}get recommendations_sell(){}get recommendations_sell_strong(){}get recommendations_total(){}get root(){return""}get sector(){}get session(){return qs.regular}get shareholders(){}get shares_outstanding_float(){}get shares_outstanding_total(){}get target_price_average(){}get target_price_date(){}get target_price_estimates(){}get target_price_high(){}get target_price_low(){}get target_price_median(){}get ticker(){}get tickerid(){}get timezone(){}get type(){}get volumetype(){return"n/a"}}class xw{constructor(e){U(this,"_variables");this._variables=e}get future_amount(){}get future_ex_date(){}get future_pay_date(){}}class yw{constructor(e){U(this,"_variables");this._variables=e}get future_eps(){}get future_period_end_time(){}get future_revenue(){}get future_time(){}}ot.extend(_1),ot.extend(yl),ot.extend(d1);class Oh{constructor(e){U(this,"_cacheData");U(this,"_barIndex");U(this,"_isRealTimeBar");U(this,"_barstate");U(this,"_priceVariables");U(this,"_lastBarIndex");U(this,"_currentBarTime");U(this,"_lastBarTime");U(this,"_period");U(this,"_offsetTime");U(this,"_timeframe");U(this,"_ta");U(this,"_polyline");U(this,"_label");U(this,"_line");U(this,"_linefill");U(this,"_box");U(this,"_table");U(this,"_strategy");U(this,"_session");U(this,"syminfo");U(this,"chart");U(this,"earnings");U(this,"dividends");U(this,"_timeTradingday");U(this,"_mintick");this._cacheData={varData:{},varNewData:{},varipData:{}},this._barIndex=0,this._lastBarIndex=0,this._currentBarTime=0,this._lastBarTime=0,this._offsetTime=0,this._period="",this._isRealTimeBar=!1,this._barstate=new hw,this._timeframe=new vw,this._priceVariables={close:0,open:0,low:0,high:0,volume:0},this._ta=new _w(e),this._polyline=new Ti,this._label=new Ti,this._line=new Ti,this._linefill=new Ti,this._box=new Ti,this._table=new Ti(1),this._strategy=new pw(this),this._session=new dw(this),this.syminfo=new mw(this),this.chart=new gw(this),this.earnings=new yw(this),this.dividends=new xw(this)}get table(){return this._table}get box(){return this._box}get linefill(){return this._linefill}get line(){return this._line}get polyline(){return this._polyline}get label(){return this._label}get ta(){return this._ta}get strategy(){return this._strategy}get session(){return this._session}get na(){}get last_bar_index(){return this._lastBarIndex}get bar_index(){return this._barIndex}get barstate(){return this._barstate}get close(){return this._priceVariables.close}get low(){return this._priceVariables.low}get open(){return this._priceVariables.open}get high(){return this._priceVariables.high}get volume(){return this._priceVariables.volume}get ohlc4(){const{close:e,open:t,high:r,low:n}=this._priceVariables;return(e+t+r+n)/4}get hl2(){const{high:e,low:t}=this._priceVariables;return(e+t)/2}get hlc3(){const{close:e,high:t,low:r}=this._priceVariables;return(e+t+r)/3}get hlcc4(){const{close:e,high:t,low:r}=this._priceVariables;return(e*2+t+r)/4}get hour(){return ot(this._currentBarTime).subtract(this._offsetTime,"hour").hour()}get minute(){return ot(this._currentBarTime).minute()}get second(){return ot(this._currentBarTime).second()}get month(){return ot(this._currentBarTime).month()+1}get year(){return ot(this._currentBarTime).year()}get dayofweek(){return ot(this._currentBarTime).day()+1}get dayofmonth(){return ot(this._currentBarTime).date()}get weekofyear(){return ot(this._currentBarTime).week()}get last_bar_time(){return this._lastBarTime}get time(){return this._currentBarTime}get time_close(){const[e,t]=Rs(this._period);return this._isRealTimeBar?void 0:ot(this._currentBarTime).add(e,t).valueOf()}get timenow(){return Date.now()}get time_tradingday(){return this._timeTradingday||this.getTimeTradingday(this._currentBarTime,this._period)}get timeframe(){return this._timeframe}get mintick(){return this._mintick}updateMaxLength(e){const{max_lines_count:t,max_labels_count:r,max_boxes_count:n,max_polylines_count:i}=e;n&&this._box.setMaxLen(n),r&&this._label.setMaxLen(r),t&&this._line.setMaxLen(t),i&&this._polyline.setMaxLen(i)}getTimeTradingday(e,t){const[r,n]=Rs(t),i=ot(e);return["M","w","y","d"].includes(n)?i.valueOf():(i.subtract(this._offsetTime,"h"),i.startOf("d").add(this._offsetTime,"h").valueOf())}updateOptions(e){const{interval:t="1D",offsetTime:r=5,mintick:n}=e;this._period=t,this._mintick=n,this._offsetTime=r,this._timeframe.update(t)}updateData(e){const{barIndex:t,c:r,o:n,h:i,l:a,volume:u,time:c,lastBarIndex:f,lastBarTime:h,complete:d,time_tradingday:p}=e;this._priceVariables={close:Number(r),open:Number(n),high:Number(i),low:Number(a),volume:Number(u)},this._isRealTimeBar=d,t>this._barIndex&&this._isRealTimeBar&&(this._cacheData.varData=this._cacheData.varNewData,this._cacheData.varNewData={}),this._timeTradingday=p,this._currentBarTime=c*1e3,this._lastBarIndex=f,this._barIndex=t,this._lastBarTime=h*1e3,this._barstate.update(t,f,d,!1),this.ta.update({...this._priceVariables,hlc3:this.hlc3,barIndex:t})}getCacheData(e,t,r){const n=this.setCacheData(e,r);return n[n.length-1-t]}setCacheData(e,t){let r=this._cacheData[e]||{barIndex:-1,data:[]};return r.barIndex>this._barIndex||(r.barIndex===this._barIndex?r.data[r.data.length-1]=t:r.data.push(t),r.barIndex=this._barIndex,this._cacheData[e]=r),r.data}getTypeInstance(e,t){return new l1(e,t)}getVarValue(e,t,r){const n=`${e}_${t}`,i=r==="var"?this._cacheData.varData[n]:this._cacheData.varipData[n];if(i)return i}setVarValue(e,t,r,n){const i=`${e}_${t}`;let a;switch(typeof r=="object"&&r&&(n="var",a=r.varipKeys),n){case"var":if(this._isRealTimeBar){const u=Yr.cloneDeep(r);if(this._cacheData.varNewData[i]=u,a&&a.length)for(const c of a)this._cacheData.varData[i][c]=u[c]}else this._cacheData.varData[i]=r;break;case"varip":this._cacheData.varipData[i]=r;break}return r}add(e,t){return Array.isArray(e)&&Array.isArray(t)?Yr.uniq([...e,...t]):typeof e=="number"||typeof t=="number"?Number(e)+Number(t):e+t}sub(e,t){return Array.isArray(e)&&Array.isArray(t)?e.filter(r=>!t.includes(r)):Number(e)-Number(t)}againAssignParse(e,t){var n;if(t)return;const r=(n=e==null?void 0:e.constructor)==null?void 0:n.name;if(r)switch(r){case hs.name:case Wc.name:case ps.name:case iu.name:case ds.name:case Fo.name:e==null||e.delete();break}}}class Ti{constructor(e=50){U(this,"_all");U(this,"_allInstance");U(this,"_pseudoArrayAll");U(this,"_maxLength");this._all=new Map,this._allInstance=new Map,this._pseudoArrayAll=new it,this._maxLength=e}setMaxLen(e){this._maxLength=e}get data(){return[...this._all.values()]}get all(){return this._pseudoArrayAll._value=[...this._allInstance.values()],this._pseudoArrayAll}add(e,t,r){if(this._all.set(e,t),this._allInstance.set(e,r),this._all.size>this._maxLength){const n=this._all.keys().next().value;n&&this.delete(n)}}getValOfBarIndex(e){let t=[];const r=[...this._all.keys()];for(const n of e){const i=r.filter(a=>a.endsWith(`_${n}`));for(const a of i){const u=this._all.get(a);u&&t.push(u)}}return t.length?t:void 0}get(e){return this._all.get(e)}getInstance(e){return this._allInstance.get(e)}delete(e){this._all.delete(e),this._allInstance.delete(e)}}/**
77
77
  * @license
78
78
  * Copyright 2019 Google LLC
79
79
  * SPDX-License-Identifier: Apache-2.0
80
- */const Ih=Symbol("Comlink.proxy"),Dw=Symbol("Comlink.endpoint"),ww=Symbol("Comlink.releaseProxy"),Uu=Symbol("Comlink.finalizer"),No=Symbol("Comlink.thrown"),Th=s=>typeof s=="object"&&s!==null||typeof s=="function",bw={canHandle:s=>Th(s)&&s[Ih],serialize(s){const{port1:e,port2:t}=new MessageChannel;return Wu(s,e),[t,[t]]},deserialize(s){return s.start(),Fw(s)}},Ew={canHandle:s=>Th(s)&&No in s,serialize({value:s}){let e;return s instanceof Error?e={isError:!0,value:{message:s.message,name:s.name,stack:s.stack}}:e={isError:!1,value:s},[e,[]]},deserialize(s){throw s.isError?Object.assign(new Error(s.value.message),s.value):s.value}},$h=new Map([["proxy",bw],["throw",Ew]]);function Aw(s,e){for(const t of s)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function Wu(s,e=globalThis,t=["*"]){e.addEventListener("message",function r(n){if(!n||!n.data)return;if(!Aw(t,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}const{id:i,type:a,path:u}=Object.assign({path:[]},n.data),f=(n.data.argumentList||[]).map(ui);let c;try{const h=u.slice(0,-1).reduce((p,v)=>p[v],s),d=u.reduce((p,v)=>p[v],s);switch(a){case"GET":c=d;break;case"SET":h[u.slice(-1)[0]]=ui(n.data.value),c=!0;break;case"APPLY":c=d.apply(h,f);break;case"CONSTRUCT":{const p=new d(...f);c=Ow(p)}break;case"ENDPOINT":{const{port1:p,port2:v}=new MessageChannel;Wu(s,v),c=Sw(p,[p])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[No]:0}}Promise.resolve(c).catch(h=>({value:h,[No]:0})).then(h=>{const[d,p]=To(h);e.postMessage(Object.assign(Object.assign({},d),{id:i}),p),a==="RELEASE"&&(e.removeEventListener("message",r),Rh(e),Uu in s&&typeof s[Uu]=="function"&&s[Uu]())}).catch(h=>{const[d,p]=To({value:new TypeError("Unserializable return value"),[No]:0});e.postMessage(Object.assign(Object.assign({},d),{id:i}),p)})}),e.start&&e.start()}function Cw(s){return s.constructor.name==="MessagePort"}function Rh(s){Cw(s)&&s.close()}function Fw(s,e){return Hu(s,[],e)}function So(s){if(s)throw new Error("Proxy has been released and is not useable")}function Lh(s){return $i(s,{type:"RELEASE"}).then(()=>{Rh(s)})}const Oo=new WeakMap,Io="FinalizationRegistry"in globalThis&&new FinalizationRegistry(s=>{const e=(Oo.get(s)||0)-1;Oo.set(s,e),e===0&&Lh(s)});function Bw(s,e){const t=(Oo.get(e)||0)+1;Oo.set(e,t),Io&&Io.register(s,e,s)}function Mw(s){Io&&Io.unregister(s)}function Hu(s,e=[],t=function(){}){let r=!1;const n=new Proxy(t,{get(i,a){if(So(r),a===ww)return()=>{Mw(n),Lh(s),r=!0};if(a==="then"){if(e.length===0)return{then:()=>n};const u=$i(s,{type:"GET",path:e.map(f=>f.toString())}).then(ui);return u.then.bind(u)}return Hu(s,[...e,a])},set(i,a,u){So(r);const[f,c]=To(u);return $i(s,{type:"SET",path:[...e,a].map(h=>h.toString()),value:f},c).then(ui)},apply(i,a,u){So(r);const f=e[e.length-1];if(f===Dw)return $i(s,{type:"ENDPOINT"}).then(ui);if(f==="bind")return Hu(s,e.slice(0,-1));const[c,h]=Ph(u);return $i(s,{type:"APPLY",path:e.map(d=>d.toString()),argumentList:c},h).then(ui)},construct(i,a){So(r);const[u,f]=Ph(a);return $i(s,{type:"CONSTRUCT",path:e.map(c=>c.toString()),argumentList:u},f).then(ui)}});return Bw(n,s),n}function Nw(s){return Array.prototype.concat.apply([],s)}function Ph(s){const e=s.map(To);return[e.map(t=>t[0]),Nw(e.map(t=>t[1]))]}const kh=new WeakMap;function Sw(s,e){return kh.set(s,e),s}function Ow(s){return Object.assign(s,{[Ih]:!0})}function To(s){for(const[e,t]of $h)if(t.canHandle(s)){const[r,n]=t.serialize(s);return[{type:"HANDLER",name:e,value:r},n]}return[{type:"RAW",value:s},kh.get(s)||[]]}function ui(s){switch(s.type){case"HANDLER":return $h.get(s.name).deserialize(s.value);case"RAW":return s.value}}function $i(s,e,t){return new Promise(r=>{const n=Iw();s.addEventListener("message",function i(a){!a.data||!a.data.id||a.data.id!==n||(s.removeEventListener("message",i),r(a.data))}),s.start&&s.start(),s.postMessage(Object.assign({id:n},e),t)})}function Iw(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class Tw{constructor(){U(this,"_cache");this._cache=new Map}set(e,t){this._cache.set(e,t)}setValue(e,t,r){const n=this._cache.get(e)||{};n[t]=r,this._cache.set(e,n)}updateValue(e,t,r){const n=this._cache.get(e)||{};this._cache.set(e,Object.assign(n[t]||{},r))}get(e){return this._cache.get(e)}has(e){return this._cache.has(e)}delete(e){this._cache.delete(e)}clear(){this._cache.clear()}}function $w(s,e,t){const{data:r,isPreParser:n,id:i="default",syminfo:a,interval:u,inputs:f}=e;self.workerStorage||(self.workerStorage=new Tw);let{builtInGather:c,buildinConstants:h,buildInFunctions:d,tradingvueFunc:p}=self.workerStorage.get(i)||{},v=[];if(t&&(c=new Oh(i),h=new Uf,d=new Zf((a==null?void 0:a.mintick)||1e-4,c,i),p=new Function("$_var","$_const","$_func",s),self.workerStorage.set(i,{builtInGather:c,buildinConstants:h,buildInFunctions:d,tradingvueFunc:p}),self.workerStorage.set(`request_${i}`,new Map)),n)p(c,h,d);else if(r&&r.length){const _=r.length-1;c.updateOptions({interval:u,mintick:(a==null?void 0:a.mintick)||1e-4}),d.updateOptions({inputs:f});for(const[y,m]of r.entries()){const{barindex:w}=m;!t&&(w||w===0)&&(v.push(w),c.clearDrawCache(w)),c.updateData(Object.assign(m,{barIndex:w||y,lastBarIndex:r[_].bar_index||_,lastBarTime:r[_].time})),d.update({barIndex:w||y}),p(c,h,d),d.endExecution();const D=d.errors;if(D.length&&D.some(C=>C.type===Ve.Error))return{status:1,errors:D}}}const x=d.errors;return x.length&&x.some(_=>_.type===Ve.Error)?{status:1,errors:x}:{status:0,options:{...d.options(v),id:i}}}function Rw(s){self==null||self.workerStorage.delete(s),self==null||self.workerStorage.delete(`inputs_${s}`)}Wu({runScript:$w,removeScript:Rw})})();
80
+ */const Ih=Symbol("Comlink.proxy"),Dw=Symbol("Comlink.endpoint"),ww=Symbol("Comlink.releaseProxy"),Uu=Symbol("Comlink.finalizer"),No=Symbol("Comlink.thrown"),Th=s=>typeof s=="object"&&s!==null||typeof s=="function",bw={canHandle:s=>Th(s)&&s[Ih],serialize(s){const{port1:e,port2:t}=new MessageChannel;return Wu(s,e),[t,[t]]},deserialize(s){return s.start(),Fw(s)}},Ew={canHandle:s=>Th(s)&&No in s,serialize({value:s}){let e;return s instanceof Error?e={isError:!0,value:{message:s.message,name:s.name,stack:s.stack}}:e={isError:!1,value:s},[e,[]]},deserialize(s){throw s.isError?Object.assign(new Error(s.value.message),s.value):s.value}},$h=new Map([["proxy",bw],["throw",Ew]]);function Aw(s,e){for(const t of s)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function Wu(s,e=globalThis,t=["*"]){e.addEventListener("message",function r(n){if(!n||!n.data)return;if(!Aw(t,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}const{id:i,type:a,path:u}=Object.assign({path:[]},n.data),c=(n.data.argumentList||[]).map(ui);let f;try{const h=u.slice(0,-1).reduce((p,v)=>p[v],s),d=u.reduce((p,v)=>p[v],s);switch(a){case"GET":f=d;break;case"SET":h[u.slice(-1)[0]]=ui(n.data.value),f=!0;break;case"APPLY":f=d.apply(h,c);break;case"CONSTRUCT":{const p=new d(...c);f=Ow(p)}break;case"ENDPOINT":{const{port1:p,port2:v}=new MessageChannel;Wu(s,v),f=Sw(p,[p])}break;case"RELEASE":f=void 0;break;default:return}}catch(h){f={value:h,[No]:0}}Promise.resolve(f).catch(h=>({value:h,[No]:0})).then(h=>{const[d,p]=To(h);e.postMessage(Object.assign(Object.assign({},d),{id:i}),p),a==="RELEASE"&&(e.removeEventListener("message",r),Lh(e),Uu in s&&typeof s[Uu]=="function"&&s[Uu]())}).catch(h=>{const[d,p]=To({value:new TypeError("Unserializable return value"),[No]:0});e.postMessage(Object.assign(Object.assign({},d),{id:i}),p)})}),e.start&&e.start()}function Cw(s){return s.constructor.name==="MessagePort"}function Lh(s){Cw(s)&&s.close()}function Fw(s,e){return Hu(s,[],e)}function So(s){if(s)throw new Error("Proxy has been released and is not useable")}function Rh(s){return $i(s,{type:"RELEASE"}).then(()=>{Lh(s)})}const Oo=new WeakMap,Io="FinalizationRegistry"in globalThis&&new FinalizationRegistry(s=>{const e=(Oo.get(s)||0)-1;Oo.set(s,e),e===0&&Rh(s)});function Bw(s,e){const t=(Oo.get(e)||0)+1;Oo.set(e,t),Io&&Io.register(s,e,s)}function Mw(s){Io&&Io.unregister(s)}function Hu(s,e=[],t=function(){}){let r=!1;const n=new Proxy(t,{get(i,a){if(So(r),a===ww)return()=>{Mw(n),Rh(s),r=!0};if(a==="then"){if(e.length===0)return{then:()=>n};const u=$i(s,{type:"GET",path:e.map(c=>c.toString())}).then(ui);return u.then.bind(u)}return Hu(s,[...e,a])},set(i,a,u){So(r);const[c,f]=To(u);return $i(s,{type:"SET",path:[...e,a].map(h=>h.toString()),value:c},f).then(ui)},apply(i,a,u){So(r);const c=e[e.length-1];if(c===Dw)return $i(s,{type:"ENDPOINT"}).then(ui);if(c==="bind")return Hu(s,e.slice(0,-1));const[f,h]=Ph(u);return $i(s,{type:"APPLY",path:e.map(d=>d.toString()),argumentList:f},h).then(ui)},construct(i,a){So(r);const[u,c]=Ph(a);return $i(s,{type:"CONSTRUCT",path:e.map(f=>f.toString()),argumentList:u},c).then(ui)}});return Bw(n,s),n}function Nw(s){return Array.prototype.concat.apply([],s)}function Ph(s){const e=s.map(To);return[e.map(t=>t[0]),Nw(e.map(t=>t[1]))]}const kh=new WeakMap;function Sw(s,e){return kh.set(s,e),s}function Ow(s){return Object.assign(s,{[Ih]:!0})}function To(s){for(const[e,t]of $h)if(t.canHandle(s)){const[r,n]=t.serialize(s);return[{type:"HANDLER",name:e,value:r},n]}return[{type:"RAW",value:s},kh.get(s)||[]]}function ui(s){switch(s.type){case"HANDLER":return $h.get(s.name).deserialize(s.value);case"RAW":return s.value}}function $i(s,e,t){return new Promise(r=>{const n=Iw();s.addEventListener("message",function i(a){!a.data||!a.data.id||a.data.id!==n||(s.removeEventListener("message",i),r(a.data))}),s.start&&s.start(),s.postMessage(Object.assign({id:n},e),t)})}function Iw(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class Tw{constructor(){U(this,"_cache");this._cache=new Map}set(e,t){this._cache.set(e,t)}setValue(e,t,r){const n=this._cache.get(e)||{};n[t]=r,this._cache.set(e,n)}updateValue(e,t,r){const n=this._cache.get(e)||{};this._cache.set(e,Object.assign(n[t]||{},r))}get(e){return this._cache.get(e)}has(e){return this._cache.has(e)}delete(e){this._cache.delete(e)}clear(){this._cache.clear()}}function $w(s,e,t){const{data:r,isPreParser:n,id:i="default",syminfo:a,interval:u,inputs:c}=e;self.workerStorage||(self.workerStorage=new Tw);let{builtInGather:f,buildinConstants:h,buildInFunctions:d,tradingvueFunc:p}=self.workerStorage.get(i)||{},v=[];if(t&&(f=new Oh(i),h=new Uc,d=new Zc((a==null?void 0:a.mintick)||1e-4,f,i),p=new Function("$_var","$_const","$_func",s),self.workerStorage.set(i,{builtInGather:f,buildinConstants:h,buildInFunctions:d,tradingvueFunc:p}),self.workerStorage.set(`request_${i}`,new Map)),n)p(f,h,d);else if(r&&r.length){const _=r.length-1;f.updateOptions({interval:u,mintick:(a==null?void 0:a.mintick)||1e-4}),d.updateOptions({inputs:c});for(const[y,m]of r.entries()){const{barindex:w}=m;!t&&(w||w===0)&&(v.push(w),f.clearDrawCache(w)),f.updateData(Object.assign(m,{barIndex:w||y,lastBarIndex:r[_].bar_index||_,lastBarTime:r[_].time})),d.update({barIndex:w||y}),p(f,h,d),d.endExecution();const D=d.errors;if(D.length&&D.some(C=>C.type===Ve.Error))return{status:1,errors:D}}}const x=d.errors;return x.length&&x.some(_=>_.type===Ve.Error)?{status:1,errors:x}:{status:0,options:{...d.options(v),id:i}}}function Lw(s){self==null||self.workerStorage.delete(s),self==null||self.workerStorage.delete(`inputs_${s}`)}Wu({runScript:$w,removeScript:Lw})})();