st-comp 0.0.242 → 0.0.244
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ConfigProvider.cjs +1 -1
- package/es/ConfigProvider.js +1 -1
- package/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +262 -261
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +1 -1
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +1 -1
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +1 -1
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +1 -1
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +1 -1
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +3 -3
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/User.cjs +1 -1
- package/es/User.js +1 -1
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +2 -2
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +1 -1
- package/es/VarietySearch.cjs +19 -19
- package/es/VarietySearch.js +1359 -1352
- package/es/{VarietySelect-2fd501da.cjs → VarietySelect-031bf077.cjs} +1 -1
- package/es/{VarietySelect-5a9dd50b.js → VarietySelect-ae0c48b2.js} +1 -1
- package/es/{index-2375023e.cjs → index-1f939868.cjs} +2 -2
- package/es/{index-8901a38c.cjs → index-2c456130.cjs} +40 -40
- package/es/{index-ac98a4d8.js → index-4b01552e.js} +3 -3
- package/es/{index-7ed0999e.js → index-edabe380.js} +5574 -5487
- package/es/{python-a914569a.js → python-7ce6f0b1.js} +3 -3
- package/es/{python-c67c8901.cjs → python-c8abd4f5.cjs} +1 -1
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +174 -174
- package/lib/{index-0c373441.js → index-200db55b.js} +19734 -19640
- package/lib/{python-4e746381.js → python-9540022d.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +5 -2
- package/packages/VarietySearch/components/AddTag/index.vue +4 -4
- package/packages/VarietySearch/components/CompositeOrder/index.vue +4 -0
- package/packages/VarietySearch/components/FactorScreen/index.vue +7 -0
- package/packages/VarietySearch/config.js +4 -5
- package/packages/VarietySearch/index.vue +10 -11
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";const qt=(e,t)=>{let r=e.length;return t<=1||t>r?new Array(r).fill(null):[...new Array(t-1).fill(null),...e.slice(0,r-t+1)]},Po=e=>{const t=e.reduce((n,i)=>n+i,0)/e.length,r=e.map(n=>Math.pow(n-t,2)).reduce((n,i)=>n+i,0)/e.length;return Math.sqrt(r)},Vo=(e,t)=>[...new Array(t).fill(null),...e.slice(0,e.length-t)],Jw=e=>{const t=e.reduce((r,n)=>r+n,0)/e.length;return e.reduce((r,n)=>r+Math.abs(n-t),0)/e.length},$f=(e,t,r)=>{const n=[(e[0]*r+e[0]*(t-r))/t];for(let i=1;i<e.length;i++)n[i]=(e[i]*r+n[i-1]*(t-r))/t;return n},Gw=(e,t)=>{const r=Number(e.substr(1).split("天")[0]),n=e.split(" ")[1],i=Number(t.substr(1).split("天")[0]),a=t.split(" ")[1],o=new Date().getFullYear(),u=new Date(`${o} ${n}`),c=new Date(`${o} ${a}`);let l=0,s=0;return[["20:00:00","24:00:00"],["00:00:00","03:00:00"],["03:00:00","20:00:00"]].forEach((f,p)=>{u>=new Date(`${o} ${f[0]}`)&&u<=new Date(`${o} ${f[1]}`)&&(l=p),c>=new Date(`${o} ${f[0]}`)&&c<=new Date(`${o} ${f[1]}`)&&(s=p)}),r>i?!0:r<i?!1:l===s?u>=c:l>=s},ic=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-2;for(;i>=0&&a>=0;)(e[i].startsWith("第")&&!Gw(e[i],t[a])||new Date(e[i])<new Date(t[a]))&&(a+=-1),n[i]=r[a],i+=-1;return n},ac=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-1;for(;i>=0&&a>=0;)!e[i].startsWith("第")&&new Date(`${e[i].split(" ")[0]} 00:00:00`)>=new Date(`${t[a].split(" ")[0]} 00:00:00`)||e[i].startsWith("第")&&Number(e[i].split("天")[0].split("第")[1])>=Number(t[a].split("天")[0].split("第")[1])||(a+=-1),n[i]=r[a-1],i+=-1;return n},Ce={DKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((c,l)=>(n[l]*3+i[l]+a[l]+c)/6),{output:u}=e.WMA({inReal:o,timePeriod:20});return qt(u,20)},MADKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((l,s)=>(n[s]*3+i[s]+a[s]+l)/6),u=e.WMA({inReal:o,timePeriod:20}),{output:c}=e.SMA({inReal:u.output,timePeriod:10});return qt(c,29)},EMA:(e,t,r)=>{const{close:n}=t,{output:i}=e.EMA({inReal:n,timePeriod:r});return qt(i,r)},HHV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MAX({inReal:n,timePeriod:r});return qt(i,r)},LLV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MIN({inReal:n,timePeriod:r});return qt(i,r)},MA:(e,t,r)=>{const{close:n}=t,{output:i}=e.SMA({inReal:n,timePeriod:r});return qt(i,r)},BBI:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},BBIBOLL:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},DWN:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n-6*Po(r.slice(i-10,i+1)))},UPR:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n+6*Po(r.slice(i-10,i+1)))},MID:(e,t)=>Ce.MA(e,t,20),UPPER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n+2*Po(r.slice(i-19,i+1)))},LOWER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n-2*Po(r.slice(i-19,i+1)))},TQA_H:(e,t)=>{const{high:r}=t,{output:n}=e.MAX({inReal:r,timePeriod:20});return Vo(qt(n,20),1)},TQA_L:(e,t)=>{const{low:r}=t,{output:n}=e.MIN({inReal:r,timePeriod:10});return Vo(qt(n,10),1)},DKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return ac(t.time,r.time,qt(c,20))},MADKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return ac(t.time,r.time,qt(l,29))},EMA_D:(e,t,r,n)=>ac(t.time,r.time,Ce.EMA(e,r,n)),DKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return ic(t.time,r.time,qt(c,20))},MADKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return ic(t.time,r.time,qt(l,29))},EMA_H:(e,t,r,n)=>ic(t.time,r.time,Ce.EMA(e,r,n)),MAVOL:(e,t,r)=>{const{originData:n}=t,{output:i}=e.SMA({inReal:n.map(a=>a[5]),timePeriod:r});return qt(i,r)},MACCL:(e,t)=>{const{originData:r}=t,{output:n}=e.SMA({inReal:r.map(i=>i[7]),timePeriod:10});return qt(n,10)},MAAMO:(e,t,r)=>{const{originData:n}=t,{output:i}=e.MA({inReal:n.map(a=>a[6]),timePeriod:r});return qt(i,r)},DIF:(e,t)=>{const r=Ce.EMA(e,t,12),n=Ce.EMA(e,t,26);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return o-u})},DEA:(e,t)=>{const r=Ce.DIF(e,t),{output:n}=e.EMA({inReal:r,timePeriod:9});return qt(n,9)},MACD:(e,t)=>{const r=Ce.DIF(e,t),n=Ce.DEA(e,t);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return(o-u)*2})},MTR:(e,t)=>{const{close:r,high:n,low:i}=t,a=Vo(r,1);return n.map((o,u)=>{const c=o,l=i[u],s=a[u];return Math.max(Math.max(c-l,Math.abs(s-c)),Math.abs(s-l))})},ATR:(e,t)=>{const r=Ce.MTR(e,t),{output:n}=e.MA({inReal:r,timePeriod:14});return qt(n,14)},CCI:(e,t)=>{const{close:r,high:n,low:i}=t,a=n.map((c,l)=>(c+i[l]+r[l])/3),{output:o}=e.MA({inReal:a,timePeriod:14}),u=qt(o,14);return a.map((c,l)=>{if(l<12)return 0;const s=Jw(a.slice(l-13,l+1));return(c-u[l])*1e3/(15*s)})},RSI:(e,t,r)=>{const{close:n}=t,i=Vo(n,1),a=i.map((l,s)=>Math.max(n[s]-l,0)),o=i.map((l,s)=>Math.abs(n[s]-l)),u=$f(a,r,1),c=$f(o,r,1);return u.map((l,s)=>c[s]?l/c[s]*100:null)}},Ww={DKX:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.DKX(e,t)},MADKX:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MADKX(e,t)},EMA30:{color:"#FF0000",calculationFn:(e,t)=>Ce.EMA(e,t,30)},EMA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.EMA(e,t,60)},EMA120:{color:"#E4007F",calculationFn:(e,t)=>Ce.EMA(e,t,120)},EMA240:{color:"#999999",calculationFn:(e,t)=>Ce.EMA(e,t,240)},EMA360:{color:"#CFCFC4",calculationFn:(e,t)=>Ce.EMA(e,t,360)},EMA720:{color:"#00FFFF",calculationFn:(e,t)=>Ce.EMA(e,t,720)},DKX_D:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_D(e,t,r)},EMA60_D:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,60)},EMA120_D:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,120)},EMA240_D:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,240)},MADKX_D:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_D(e,t,r)},DKX_H:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_H(e,t,r)},EMA60_H:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,60)},EMA120_H:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,120)},EMA240_H:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,240)},MADKX_H:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_H(e,t,r)},BBI:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBI(e,t)},BBIBOLL:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBIBOLL(e,t)},DWN:{color:"#FF00FF",calculationFn:(e,t)=>Ce.DWN(e,t)},UPR:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPR(e,t)},LOWER:{color:"#FF00FF",calculationFn:(e,t)=>Ce.LOWER(e,t)},MID:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MID(e,t)},UPPER:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPPER(e,t)},MA5:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MA(e,t,5)},MA10:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MA(e,t,10)},MA20:{color:"#FF00FF",calculationFn:(e,t)=>Ce.MA(e,t,20)},MA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.MA(e,t,60)},HHV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.HHV(e,t,30)},LLV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.LLV(e,t,30)},TQA_H:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.TQA_H(e,t)},TQA_L:{color:"#FFFF00",calculationFn:(e,t)=>Ce.TQA_L(e,t)}},Kw={main:[{key:"BBI",config:["BBI"]},{key:"BBIBOLL",config:["BBIBOLL","DWN","UPR"]},{key:"BOLL",config:["LOWER","MID","UPPER"]},{key:"DKX",config:["DKX","MADKX"]},{key:"DKX_EMA",config:["DKX","EMA30","EMA60","EMA120","EMA240","MADKX","EMA720"]},{key:"DKX_EMA_D",showFreq:["1m","5m","15m","60m"],mergeFreq:"1d",config:["DKX","MADKX","EMA60","DKX_D","EMA60_D","EMA120_D","EMA240_D","MADKX_D"]},{key:"DKX_EMA_H",showFreq:["1m","5m","15m"],mergeFreq:"60m",config:["DKX","MADKX","EMA60","DKX_H","EMA60_H","EMA120_H","EMA240_H","MADKX_H"]},{key:"DKX_MA",config:["DKX","HHV30","LLV30","MA60","MADKX"]},{key:"EMA_BIG",config:["EMA30","EMA60","EMA120","EMA240","EMA360","EMA720"]},{key:"MA",config:["MA5","MA10","MA20","MA60"]},{key:"TQA",config:["TQA_H","TQA_L"]}],sub:[{key:"AMOUNT",series:"bar",source:"origin",dataIndex:6,color:"kline",config:[{key:"AMO",color:"#FF0000",source:"origin",series:"base",dataIndex:6},{key:"MAAMO1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,5)},{key:"MAAMO2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,10)}]},{key:"ATR",series:"none",config:[{key:"ATR",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.ATR(e,t)},{key:"MTR",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MTR(e,t)}]},{key:"CCI",series:"none",config:[{key:"CCI",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.CCI(e,t)}]},{key:"VOL",series:"bar",source:"origin",dataIndex:5,color:"kline",rightYAxisRange:"cover",config:[{key:"MAVOL1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,5)},{key:"MAVOL2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,10)},{key:"VOLUME",color:"#FF0000",source:"origin",series:"base",dataIndex:5},{key:"CCL",color:"#FFFFFF",source:"origin",series:"line",dataIndex:7,yAxis:"right"}]},{key:"CCL",series:"none",leftYAxisRange:"cover",config:[{key:"CCL",color:"#524c75",source:"origin",series:"line",dataIndex:7},{key:"MACCL",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MACCL(e,t)}]},{key:"MACD",series:"bar",source:"calculation",dataIndex:"MACD",color:"value",leftYAxisRange:"cover",config:[{key:"DEA",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DEA(e,t)},{key:"DIF",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DIF(e,t)},{key:"MACD",color:"#FF0000",source:"calculation",series:"bar",calculationFn:(e,t)=>Ce.MACD(e,t)}]},{key:"RSI",series:"none",leftYAxisRange:"cover",config:[{key:"RSI1",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,6)},{key:"RS2",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,12)},{key:"RS3",color:"#a5a0c4",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,24)}]}]};Kw.main.map(({key:e,showFreq:t,mergeFreq:r,config:n})=>({label:e,value:e,showFreq:t,mergeFreq:r,config:n.map(i=>({key:i,...Ww[i]}))}));const Lg=(e,t,r=null)=>{localStorage.setItem(`expires-${e}`,JSON.stringify({value:t,expires:r}))},Pg=e=>{const t=localStorage.getItem(`expires-${e}`);if(!t)return null;const{value:r,expires:n}=JSON.parse(t);return n===null||new Date().getTime()<n?r:(localStorage.removeItem(`expires-${e}`),null)},Hf=e=>{localStorage.removeItem(`expires-${e}`)};function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ot.apply(null,arguments)}var Vg={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Ue(e){return typeof e=="number"}function $e(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function wn(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function bo(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Cr(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Qt(e){return typeof e=="string"}var st=Array.isArray;function ke(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Fr(e){return Array.isArray(e)||ke(e)}function _s(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function wi(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function wl(e){return e&&e.constructor.prototype.isRange===!0||!1}function fu(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Qw(e){return typeof e=="boolean"}function Zw(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function Ug(e){return e&&e.constructor.prototype.isHelp===!0||!1}function Xw(e){return typeof e=="function"}function Yw(e){return e instanceof Date}function eN(e){return e instanceof RegExp}function pu(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wn(e)&&!bo(e))}function tN(e){return e===null}function rN(e){return e===void 0}function Ti(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sr(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function nN(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function iN(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function aN(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function nt(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function Oc(e){return nt(e)||Ct(e)&&e.args.length===1&&nt(e.args[0])&&"-+~".includes(e.op)}function xo(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Zn(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Da(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function ft(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function mu(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ct(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function An(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function oN(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function sN(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function zt(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function $g(e){return e&&e.constructor.prototype.isChain===!0||!1}function dt(e){var t=typeof e;return t==="object"?e===null?"null":$e(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function ze(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return ze(r)});if(e instanceof Date)return new Date(e.valueOf());if($e(e))return e;if(pu(e))return uN(e,ze);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function uN(e,t){var r={};for(var n in e)Me(e,n)&&(r[n]=t(e[n]));return r}function Hg(e,t){for(var r in t)Me(t,r)&&(e[r]=t[r]);return e}function Oi(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!Oi(e[n],t[n]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!Oi(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}else return e===t}}function cN(e,t,r){var n=!0,i;Object.defineProperty(e,t,{get:function(){return n&&(i=r(),n=!1),i},set:function(a){i=a,n=!1},configurable:!0,enumerable:!0})}function Me(e,t){return e&&Object.hasOwnProperty.call(e,t)}function lN(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];a!==void 0&&(r[i]=a)}return r}var fN=["Matrix","Array"],pN=["number","BigNumber","Fraction"],ve=function(e){if(e)throw new Error(`The global config is readonly.
|
|
1
|
+
"use strict";const qt=(e,t)=>{let r=e.length;return t<=1||t>r?new Array(r).fill(null):[...new Array(t-1).fill(null),...e.slice(0,r-t+1)]},Ho=e=>{const t=e.reduce((n,i)=>n+i,0)/e.length,r=e.map(n=>Math.pow(n-t,2)).reduce((n,i)=>n+i,0)/e.length;return Math.sqrt(r)},Jo=(e,t)=>[...new Array(t).fill(null),...e.slice(0,e.length-t)],tN=e=>{const t=e.reduce((r,n)=>r+n,0)/e.length;return e.reduce((r,n)=>r+Math.abs(n-t),0)/e.length},Xf=(e,t,r)=>{const n=[(e[0]*r+e[0]*(t-r))/t];for(let i=1;i<e.length;i++)n[i]=(e[i]*r+n[i-1]*(t-r))/t;return n},rN=(e,t)=>{const r=Number(e.substr(1).split("天")[0]),n=e.split(" ")[1],i=Number(t.substr(1).split("天")[0]),a=t.split(" ")[1],o=new Date().getFullYear(),u=new Date(`${o} ${n}`),c=new Date(`${o} ${a}`);let l=0,s=0;return[["20:00:00","24:00:00"],["00:00:00","03:00:00"],["03:00:00","20:00:00"]].forEach((f,p)=>{u>=new Date(`${o} ${f[0]}`)&&u<=new Date(`${o} ${f[1]}`)&&(l=p),c>=new Date(`${o} ${f[0]}`)&&c<=new Date(`${o} ${f[1]}`)&&(s=p)}),r>i?!0:r<i?!1:l===s?u>=c:l>=s},cc=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-2;for(;i>=0&&a>=0;)(e[i].startsWith("第")&&!rN(e[i],t[a])||new Date(e[i])<new Date(t[a]))&&(a+=-1),n[i]=r[a],i+=-1;return n},lc=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-1;for(;i>=0&&a>=0;)!e[i].startsWith("第")&&new Date(`${e[i].split(" ")[0]} 00:00:00`)>=new Date(`${t[a].split(" ")[0]} 00:00:00`)||e[i].startsWith("第")&&Number(e[i].split("天")[0].split("第")[1])>=Number(t[a].split("天")[0].split("第")[1])||(a+=-1),n[i]=r[a-1],i+=-1;return n},Ce={DKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((c,l)=>(n[l]*3+i[l]+a[l]+c)/6),{output:u}=e.WMA({inReal:o,timePeriod:20});return qt(u,20)},MADKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((l,s)=>(n[s]*3+i[s]+a[s]+l)/6),u=e.WMA({inReal:o,timePeriod:20}),{output:c}=e.SMA({inReal:u.output,timePeriod:10});return qt(c,29)},EMA:(e,t,r)=>{const{close:n}=t,{output:i}=e.EMA({inReal:n,timePeriod:r});return qt(i,r)},HHV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MAX({inReal:n,timePeriod:r});return qt(i,r)},LLV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MIN({inReal:n,timePeriod:r});return qt(i,r)},MA:(e,t,r)=>{const{close:n}=t,{output:i}=e.SMA({inReal:n,timePeriod:r});return qt(i,r)},BBI:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},BBIBOLL:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},DWN:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n-6*Ho(r.slice(i-10,i+1)))},UPR:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n+6*Ho(r.slice(i-10,i+1)))},MID:(e,t)=>Ce.MA(e,t,20),UPPER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n+2*Ho(r.slice(i-19,i+1)))},LOWER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n-2*Ho(r.slice(i-19,i+1)))},TQA_H:(e,t)=>{const{high:r}=t,{output:n}=e.MAX({inReal:r,timePeriod:20});return Jo(qt(n,20),1)},TQA_L:(e,t)=>{const{low:r}=t,{output:n}=e.MIN({inReal:r,timePeriod:10});return Jo(qt(n,10),1)},DKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return lc(t.time,r.time,qt(c,20))},MADKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return lc(t.time,r.time,qt(l,29))},EMA_D:(e,t,r,n)=>lc(t.time,r.time,Ce.EMA(e,r,n)),DKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return cc(t.time,r.time,qt(c,20))},MADKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return cc(t.time,r.time,qt(l,29))},EMA_H:(e,t,r,n)=>cc(t.time,r.time,Ce.EMA(e,r,n)),MAVOL:(e,t,r)=>{const{originData:n}=t,{output:i}=e.SMA({inReal:n.map(a=>a[5]),timePeriod:r});return qt(i,r)},MACCL:(e,t)=>{const{originData:r}=t,{output:n}=e.SMA({inReal:r.map(i=>i[7]),timePeriod:10});return qt(n,10)},MAAMO:(e,t,r)=>{const{originData:n}=t,{output:i}=e.MA({inReal:n.map(a=>a[6]),timePeriod:r});return qt(i,r)},DIF:(e,t)=>{const r=Ce.EMA(e,t,12),n=Ce.EMA(e,t,26);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return o-u})},DEA:(e,t)=>{const r=Ce.DIF(e,t),{output:n}=e.EMA({inReal:r,timePeriod:9});return qt(n,9)},MACD:(e,t)=>{const r=Ce.DIF(e,t),n=Ce.DEA(e,t);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return(o-u)*2})},MTR:(e,t)=>{const{close:r,high:n,low:i}=t,a=Jo(r,1);return n.map((o,u)=>{const c=o,l=i[u],s=a[u];return Math.max(Math.max(c-l,Math.abs(s-c)),Math.abs(s-l))})},ATR:(e,t)=>{const r=Ce.MTR(e,t),{output:n}=e.MA({inReal:r,timePeriod:14});return qt(n,14)},CCI:(e,t)=>{const{close:r,high:n,low:i}=t,a=n.map((c,l)=>(c+i[l]+r[l])/3),{output:o}=e.MA({inReal:a,timePeriod:14}),u=qt(o,14);return a.map((c,l)=>{if(l<12)return 0;const s=tN(a.slice(l-13,l+1));return(c-u[l])*1e3/(15*s)})},RSI:(e,t,r)=>{const{close:n}=t,i=Jo(n,1),a=i.map((l,s)=>Math.max(n[s]-l,0)),o=i.map((l,s)=>Math.abs(n[s]-l)),u=Xf(a,r,1),c=Xf(o,r,1);return u.map((l,s)=>c[s]?l/c[s]*100:null)}},nN={DKX:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.DKX(e,t)},MADKX:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MADKX(e,t)},EMA30:{color:"#FF0000",calculationFn:(e,t)=>Ce.EMA(e,t,30)},EMA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.EMA(e,t,60)},EMA120:{color:"#E4007F",calculationFn:(e,t)=>Ce.EMA(e,t,120)},EMA240:{color:"#999999",calculationFn:(e,t)=>Ce.EMA(e,t,240)},EMA360:{color:"#CFCFC4",calculationFn:(e,t)=>Ce.EMA(e,t,360)},EMA720:{color:"#00FFFF",calculationFn:(e,t)=>Ce.EMA(e,t,720)},DKX_D:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_D(e,t,r)},EMA60_D:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,60)},EMA120_D:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,120)},EMA240_D:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,240)},MADKX_D:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_D(e,t,r)},DKX_H:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_H(e,t,r)},EMA60_H:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,60)},EMA120_H:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,120)},EMA240_H:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,240)},MADKX_H:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_H(e,t,r)},BBI:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBI(e,t)},BBIBOLL:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBIBOLL(e,t)},DWN:{color:"#FF00FF",calculationFn:(e,t)=>Ce.DWN(e,t)},UPR:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPR(e,t)},LOWER:{color:"#FF00FF",calculationFn:(e,t)=>Ce.LOWER(e,t)},MID:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MID(e,t)},UPPER:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPPER(e,t)},MA5:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MA(e,t,5)},MA10:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MA(e,t,10)},MA20:{color:"#FF00FF",calculationFn:(e,t)=>Ce.MA(e,t,20)},MA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.MA(e,t,60)},HHV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.HHV(e,t,30)},LLV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.LLV(e,t,30)},TQA_H:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.TQA_H(e,t)},TQA_L:{color:"#FFFF00",calculationFn:(e,t)=>Ce.TQA_L(e,t)}},iN={main:[{key:"BBI",config:["BBI"]},{key:"BBIBOLL",config:["BBIBOLL","DWN","UPR"]},{key:"BOLL",config:["LOWER","MID","UPPER"]},{key:"DKX",config:["DKX","MADKX"]},{key:"DKX_EMA",config:["DKX","EMA30","EMA60","EMA120","EMA240","MADKX","EMA720"]},{key:"DKX_EMA_D",showFreq:["1m","5m","15m","60m"],mergeFreq:"1d",config:["DKX","MADKX","EMA60","DKX_D","EMA60_D","EMA120_D","EMA240_D","MADKX_D"]},{key:"DKX_EMA_H",showFreq:["1m","5m","15m"],mergeFreq:"60m",config:["DKX","MADKX","EMA60","DKX_H","EMA60_H","EMA120_H","EMA240_H","MADKX_H"]},{key:"DKX_MA",config:["DKX","HHV30","LLV30","MA60","MADKX"]},{key:"EMA_BIG",config:["EMA30","EMA60","EMA120","EMA240","EMA360","EMA720"]},{key:"MA",config:["MA5","MA10","MA20","MA60"]},{key:"TQA",config:["TQA_H","TQA_L"]}],sub:[{key:"AMOUNT",series:"bar",source:"origin",dataIndex:6,color:"kline",config:[{key:"AMO",color:"#FF0000",source:"origin",series:"base",dataIndex:6},{key:"MAAMO1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,5)},{key:"MAAMO2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,10)}]},{key:"ATR",series:"none",config:[{key:"ATR",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.ATR(e,t)},{key:"MTR",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MTR(e,t)}]},{key:"CCI",series:"none",config:[{key:"CCI",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.CCI(e,t)}]},{key:"VOL",series:"bar",source:"origin",dataIndex:5,color:"kline",rightYAxisRange:"cover",config:[{key:"MAVOL1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,5)},{key:"MAVOL2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,10)},{key:"VOLUME",color:"#FF0000",source:"origin",series:"base",dataIndex:5},{key:"CCL",color:"#FFFFFF",source:"origin",series:"line",dataIndex:7,yAxis:"right"}]},{key:"CCL",series:"none",leftYAxisRange:"cover",config:[{key:"CCL",color:"#524c75",source:"origin",series:"line",dataIndex:7},{key:"MACCL",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MACCL(e,t)}]},{key:"MACD",series:"bar",source:"calculation",dataIndex:"MACD",color:"value",leftYAxisRange:"cover",config:[{key:"DEA",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DEA(e,t)},{key:"DIF",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DIF(e,t)},{key:"MACD",color:"#FF0000",source:"calculation",series:"bar",calculationFn:(e,t)=>Ce.MACD(e,t)}]},{key:"RSI",series:"none",leftYAxisRange:"cover",config:[{key:"RSI1",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,6)},{key:"RS2",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,12)},{key:"RS3",color:"#a5a0c4",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,24)}]}]};iN.main.map(({key:e,showFreq:t,mergeFreq:r,config:n})=>({label:e,value:e,showFreq:t,mergeFreq:r,config:n.map(i=>({key:i,...nN[i]}))}));const Qg=(e,t,r=null)=>{localStorage.setItem(`expires-${e}`,JSON.stringify({value:t,expires:r}))},Sl=e=>{const t=localStorage.getItem(`expires-${e}`);if(!t)return null;const{value:r,expires:n}=JSON.parse(t);return n===null||new Date().getTime()<n?r:(localStorage.removeItem(`expires-${e}`),null)},Yf=e=>{localStorage.removeItem(`expires-${e}`)};function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ot.apply(null,arguments)}var Zg={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Ue(e){return typeof e=="number"}function $e(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function wn(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function Do(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Cr(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Qt(e){return typeof e=="string"}var st=Array.isArray;function ke(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Fr(e){return Array.isArray(e)||ke(e)}function ks(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Ni(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Cl(e){return e&&e.constructor.prototype.isRange===!0||!1}function gu(e){return e&&e.constructor.prototype.isIndex===!0||!1}function aN(e){return typeof e=="boolean"}function oN(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function Xg(e){return e&&e.constructor.prototype.isHelp===!0||!1}function sN(e){return typeof e=="function"}function uN(e){return e instanceof Date}function cN(e){return e instanceof RegExp}function vu(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wn(e)&&!Do(e))}function lN(e){return e===null}function fN(e){return e===void 0}function Bi(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sr(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function pN(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function mN(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function dN(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function nt(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function qc(e){return nt(e)||Ct(e)&&e.args.length===1&&nt(e.args[0])&&"-+~".includes(e.op)}function Eo(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Zn(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sa(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function ft(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function yu(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ct(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function An(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function hN(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function gN(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function zt(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function Yg(e){return e&&e.constructor.prototype.isChain===!0||!1}function dt(e){var t=typeof e;return t==="object"?e===null?"null":$e(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function ze(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return ze(r)});if(e instanceof Date)return new Date(e.valueOf());if($e(e))return e;if(vu(e))return vN(e,ze);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function vN(e,t){var r={};for(var n in e)Me(e,n)&&(r[n]=t(e[n]));return r}function ev(e,t){for(var r in t)Me(t,r)&&(e[r]=t[r]);return e}function ki(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!ki(e[n],t[n]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!ki(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}else return e===t}}function yN(e,t,r){var n=!0,i;Object.defineProperty(e,t,{get:function(){return n&&(i=r(),n=!1),i},set:function(a){i=a,n=!1},configurable:!0,enumerable:!0})}function Me(e,t){return e&&Object.hasOwnProperty.call(e,t)}function bN(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];a!==void 0&&(r[i]=a)}return r}var xN=["Matrix","Array"],wN=["number","BigNumber","Fraction"],ve=function(e){if(e)throw new Error(`The global config is readonly.
|
|
2
2
|
Please create a mathjs instance if you want to change the default configuration.
|
|
3
3
|
Example:
|
|
4
4
|
|
|
5
5
|
import { create, all } from 'mathjs';
|
|
6
6
|
const mathjs = create(all);
|
|
7
7
|
mathjs.config({ number: 'BigNumber' });
|
|
8
|
-
`);return Object.freeze(Vg)};Ot(ve,Vg,{MATRIX_OPTIONS:fN,NUMBER_OPTIONS:pN});function Jf(){return!0}function Er(){return!1}function Qi(){}const Gf="Argument is not a typed-function.";function Jg(){function e(B){return typeof B=="object"&&B!==null&&B.constructor===Object}const t=[{name:"number",test:function(B){return typeof B=="number"}},{name:"string",test:function(B){return typeof B=="string"}},{name:"boolean",test:function(B){return typeof B=="boolean"}},{name:"Function",test:function(B){return typeof B=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(B){return B instanceof Date}},{name:"RegExp",test:function(B){return B instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(B){return B===null}},{name:"undefined",test:function(B){return B===void 0}}],r={name:"any",test:Jf,isAny:!0};let n,i,a=0,o={createCount:0};function u(B){const j=n.get(B);if(j)return j;let Q='Unknown type "'+B+'"';const Z=B.toLowerCase();let ie;for(ie of i)if(ie.toLowerCase()===Z){Q+='. Did you mean "'+ie+'" ?';break}throw new TypeError(Q)}function c(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const Q=j?u(j).index:i.length,Z=[];for(let oe=0;oe<B.length;++oe){if(!B[oe]||typeof B[oe].name!="string"||typeof B[oe].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const ye=B[oe].name;if(n.has(ye))throw new TypeError('Duplicate type name "'+ye+'"');Z.push(ye),n.set(ye,{name:ye,test:B[oe].test,isAny:B[oe].isAny,index:Q+oe,conversionsTo:[]})}const ie=i.slice(Q);i=i.slice(0,Q).concat(Z).concat(ie);for(let oe=Q+Z.length;oe<i.length;++oe)n.get(i[oe]).index=oe}function l(){n=new Map,i=[],a=0,c([r],!1)}l(),c(t);function s(){let B;for(B of i)n.get(B).conversionsTo=[];a=0}function f(B){const j=i.filter(Q=>{const Z=n.get(Q);return!Z.isAny&&Z.test(B)});return j.length?j:["any"]}function p(B){return B&&typeof B=="function"&&"_typedFunctionData"in B}function m(B,j,Q){if(!p(B))throw new TypeError(Gf);const Z=Q&&Q.exact,ie=Array.isArray(j)?j.join(","):j,oe=b(ie),ye=w(oe);if(!Z||ye in B.signatures){const je=B._typedFunctionData.signatureMap.get(ye);if(je)return je}const fe=oe.length;let De;if(Z){De=[];let je;for(je in B.signatures)De.push(B._typedFunctionData.signatureMap.get(je))}else De=B._typedFunctionData.signatures;for(let je=0;je<fe;++je){const Ze=oe[je],_e=[];let wt;for(wt of De){const M=A(wt.params,je);if(!(!M||Ze.restParam&&!M.restParam)){if(!M.hasAny){const X=g(M);if(Ze.types.some(pe=>!X.has(pe.name)))continue}_e.push(wt)}}if(De=_e,De.length===0)break}let Ne;for(Ne of De)if(Ne.params.length<=fe)return Ne;throw new TypeError("Signature not found (signature: "+(B.name||"unnamed")+"("+w(oe,", ")+"))")}function d(B,j,Q){return m(B,j,Q).implementation}function h(B,j){const Q=u(j);if(Q.test(B))return B;const Z=Q.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+j+" defined.");for(let ie=0;ie<Z.length;ie++)if(u(Z[ie].from).test(B))return Z[ie].convert(B);throw new Error("Cannot convert "+B+" to "+j)}function w(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return B.map(Q=>Q.name).join(j)}function v(B){const j=B.indexOf("...")===0,Q=(j?B.length>3?B.slice(3):"any":B).split("|").map(oe=>u(oe.trim()));let Z=!1,ie=j?"...":"";return{types:Q.map(function(oe){return Z=oe.isAny||Z,ie+=oe.name+"|",{name:oe.name,typeIndex:oe.index,test:oe.test,isAny:oe.isAny,conversion:null,conversionIndex:-1}}),name:ie.slice(0,-1),hasAny:Z,hasConversion:!1,restParam:j}}function x(B){const j=B.types.map(ye=>ye.name),Q=F(j);let Z=B.hasAny,ie=B.name;const oe=Q.map(function(ye){const fe=u(ye.from);return Z=fe.isAny||Z,ie+="|"+ye.from,{name:ye.from,typeIndex:fe.index,test:fe.test,isAny:fe.isAny,conversion:ye,conversionIndex:ye.index}});return{types:B.types.concat(oe),name:ie,hasAny:Z,hasConversion:oe.length>0,restParam:B.restParam}}function g(B){return B.typeSet||(B.typeSet=new Set,B.types.forEach(j=>B.typeSet.add(j.name))),B.typeSet}function b(B){const j=[];if(typeof B!="string")throw new TypeError("Signatures must be strings");const Q=B.trim();if(Q==="")return j;const Z=Q.split(",");for(let ie=0;ie<Z.length;++ie){const oe=v(Z[ie].trim());if(oe.restParam&&ie!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ie]+'": only allowed for the last parameter');if(oe.types.length===0)return null;j.push(oe)}return j}function y(B){const j=ne(B);return j?j.restParam:!1}function N(B){if(!B||B.types.length===0)return Jf;if(B.types.length===1)return u(B.types[0].name).test;if(B.types.length===2){const j=u(B.types[0].name).test,Q=u(B.types[1].name).test;return function(Z){return j(Z)||Q(Z)}}else{const j=B.types.map(function(Q){return u(Q.name).test});return function(Q){for(let Z=0;Z<j.length;Z++)if(j[Z](Q))return!0;return!1}}}function E(B){let j,Q,Z;if(y(B)){j=de(B).map(N);const ie=j.length,oe=N(ne(B)),ye=function(fe){for(let De=ie;De<fe.length;De++)if(!oe(fe[De]))return!1;return!0};return function(fe){for(let De=0;De<j.length;De++)if(!j[De](fe[De]))return!1;return ye(fe)&&fe.length>=ie+1}}else return B.length===0?function(ie){return ie.length===0}:B.length===1?(Q=N(B[0]),function(ie){return Q(ie[0])&&ie.length===1}):B.length===2?(Q=N(B[0]),Z=N(B[1]),function(ie){return Q(ie[0])&&Z(ie[1])&&ie.length===2}):(j=B.map(N),function(ie){for(let oe=0;oe<j.length;oe++)if(!j[oe](ie[oe]))return!1;return ie.length===j.length})}function A(B,j){return j<B.length?B[j]:y(B)?ne(B):null}function D(B,j){const Q=A(B,j);return Q?g(Q):new Set}function S(B){return B.conversion===null||B.conversion===void 0}function C(B,j){const Q=new Set;return B.forEach(Z=>{const ie=D(Z.params,j);let oe;for(oe of ie)Q.add(oe)}),Q.has("any")?["any"]:Array.from(Q)}function _(B,j,Q){let Z,ie;const oe=B||"unnamed";let ye=Q,fe;for(fe=0;fe<j.length;fe++){const Ze=[];if(ye.forEach(_e=>{const wt=A(_e.params,fe),M=N(wt);(fe<_e.params.length||y(_e.params))&&M(j[fe])&&Ze.push(_e)}),Ze.length===0){if(ie=C(ye,fe),ie.length>0){const _e=f(j[fe]);return Z=new TypeError("Unexpected type of argument in function "+oe+" (expected: "+ie.join(" or ")+", actual: "+_e.join(" | ")+", index: "+fe+")"),Z.data={category:"wrongType",fn:oe,index:fe,actual:_e,expected:ie},Z}}else ye=Ze}const De=ye.map(function(Ze){return y(Ze.params)?1/0:Ze.params.length});if(j.length<Math.min.apply(null,De))return ie=C(ye,fe),Z=new TypeError("Too few arguments in function "+oe+" (expected: "+ie.join(" or ")+", index: "+j.length+")"),Z.data={category:"tooFewArgs",fn:oe,index:j.length,expected:ie},Z;const Ne=Math.max.apply(null,De);if(j.length>Ne)return Z=new TypeError("Too many arguments in function "+oe+" (expected: "+Ne+", actual: "+j.length+")"),Z.data={category:"tooManyArgs",fn:oe,index:j.length,expectedLength:Ne},Z;const je=[];for(let Ze=0;Ze<j.length;++Ze)je.push(f(j[Ze]).join("|"));return Z=new TypeError('Arguments of type "'+je.join(", ")+'" do not match any of the defined signatures of function '+oe+"."),Z.data={category:"mismatch",actual:je},Z}function R(B){let j=i.length+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])&&(j=Math.min(j,B.types[Q].typeIndex));return j}function P(B){let j=a+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])||(j=Math.min(j,B.types[Q].conversionIndex));return j}function I(B,j){if(B.hasAny){if(!j.hasAny)return 1}else if(j.hasAny)return-1;if(B.restParam){if(!j.restParam)return 1}else if(j.restParam)return-1;if(B.hasConversion){if(!j.hasConversion)return 1}else if(j.hasConversion)return-1;const Q=R(B)-R(j);if(Q<0)return-1;if(Q>0)return 1;const Z=P(B)-P(j);return Z<0?-1:Z>0?1:0}function O(B,j){const Q=B.params,Z=j.params,ie=ne(Q),oe=ne(Z),ye=y(Q),fe=y(Z);if(ye&&ie.hasAny){if(!fe||!oe.hasAny)return 1}else if(fe&&oe.hasAny)return-1;let De=0,Ne=0,je;for(je of Q)je.hasAny&&++De,je.hasConversion&&++Ne;let Ze=0,_e=0;for(je of Z)je.hasAny&&++Ze,je.hasConversion&&++_e;if(De!==Ze)return De-Ze;if(ye&&ie.hasConversion){if(!fe||!oe.hasConversion)return 1}else if(fe&&oe.hasConversion)return-1;if(Ne!==_e)return Ne-_e;if(ye){if(!fe)return 1}else if(fe)return-1;const wt=(Q.length-Z.length)*(ye?-1:1);if(wt!==0)return wt;const M=[];let X=0;for(let Ee=0;Ee<Q.length;++Ee){const Re=I(Q[Ee],Z[Ee]);M.push(Re),X+=Re}if(X!==0)return X;let pe;for(pe of M)if(pe!==0)return pe;return 0}function F(B){if(B.length===0)return[];const j=B.map(u);B.length>1&&j.sort((ie,oe)=>ie.index-oe.index);let Q=j[0].conversionsTo;if(B.length===1)return Q;Q=Q.concat([]);const Z=new Set(B);for(let ie=1;ie<j.length;++ie){let oe;for(oe of j[ie].conversionsTo)Z.has(oe.from)||(Q.push(oe),Z.add(oe.from))}return Q}function q(B,j){let Q=j;if(B.some(ie=>ie.hasConversion)){const ie=y(B),oe=B.map(k);Q=function(){const ye=[],fe=ie?arguments.length-1:arguments.length;for(let De=0;De<fe;De++)ye[De]=oe[De](arguments[De]);return ie&&(ye[fe]=arguments[fe].map(oe[fe])),j.apply(this,ye)}}let Z=Q;if(y(B)){const ie=B.length-1;Z=function(){return Q.apply(this,ce(arguments,0,ie).concat([ce(arguments,ie)]))}}return Z}function k(B){let j,Q,Z,ie;const oe=[],ye=[];switch(B.types.forEach(function(fe){fe.conversion&&(oe.push(u(fe.conversion.from).test),ye.push(fe.conversion.convert))}),ye.length){case 0:return function(fe){return fe};case 1:return j=oe[0],Z=ye[0],function(fe){return j(fe)?Z(fe):fe};case 2:return j=oe[0],Q=oe[1],Z=ye[0],ie=ye[1],function(fe){return j(fe)?Z(fe):Q(fe)?ie(fe):fe};default:return function(fe){for(let De=0;De<ye.length;De++)if(oe[De](fe))return ye[De](fe);return fe}}}function te(B){function j(Q,Z,ie){if(Z<Q.length){const oe=Q[Z];let ye=[];if(oe.restParam){const fe=oe.types.filter(S);fe.length<oe.types.length&&ye.push({types:fe,name:"..."+fe.map(De=>De.name).join("|"),hasAny:fe.some(De=>De.isAny),hasConversion:!1,restParam:!0}),ye.push(oe)}else ye=oe.types.map(function(fe){return{types:[fe],name:fe.name,hasAny:fe.isAny,hasConversion:fe.conversion,restParam:!1}});return he(ye,function(fe){return j(Q,Z+1,ie.concat([fe]))})}else return[ie]}return j(B,0,[])}function se(B,j){const Q=Math.max(B.length,j.length);for(let fe=0;fe<Q;fe++){const De=D(B,fe),Ne=D(j,fe);let je=!1,Ze;for(Ze of Ne)if(De.has(Ze)){je=!0;break}if(!je)return!1}const Z=B.length,ie=j.length,oe=y(B),ye=y(j);return oe?ye?Z===ie:ie>=Z:ye?Z>=ie:Z===ie}function K(B){return B.map(j=>J(j)?T(j.referToSelf.callback):z(j)?$(j.referTo.references,j.referTo.callback):j)}function V(B,j,Q){const Z=[];let ie;for(ie of B){let oe=Q[ie];if(typeof oe!="number")throw new TypeError('No definition for referenced signature "'+ie+'"');if(oe=j[oe],typeof oe!="function")return!1;Z.push(oe)}return Z}function ue(B,j,Q){const Z=K(B),ie=new Array(Z.length).fill(!1);let oe=!0;for(;oe;){oe=!1;let ye=!0;for(let fe=0;fe<Z.length;++fe){if(ie[fe])continue;const De=Z[fe];if(J(De))Z[fe]=De.referToSelf.callback(Q),Z[fe].referToSelf=De.referToSelf,ie[fe]=!0,ye=!1;else if(z(De)){const Ne=V(De.referTo.references,Z,j);Ne?(Z[fe]=De.referTo.callback.apply(this,Ne),Z[fe].referTo=De.referTo,ie[fe]=!0,ye=!1):oe=!0}}if(ye&&oe)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function me(B){const j=/\bthis(\(|\.signatures\b)/;Object.keys(B).forEach(Q=>{const Z=B[Q];if(j.test(Z.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 re(B,j){if(o.createCount++,Object.keys(j).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&me(j);const Q=[],Z=[],ie={},oe=[];let ye;for(ye in j){if(!Object.prototype.hasOwnProperty.call(j,ye))continue;const ut=b(ye);if(!ut)continue;Q.forEach(function(Ua){if(se(Ua,ut))throw new TypeError('Conflicting signatures "'+w(Ua)+'" and "'+w(ut)+'".')}),Q.push(ut);const mn=Z.length;Z.push(j[ye]);const $w=ut.map(x);let Lo;for(Lo of te($w)){const Ua=w(Lo);oe.push({params:Lo,name:Ua,fn:mn}),Lo.every(Hw=>!Hw.hasConversion)&&(ie[Ua]=mn)}}oe.sort(O);const fe=ue(Z,ie,Va);let De;for(De in ie)Object.prototype.hasOwnProperty.call(ie,De)&&(ie[De]=fe[ie[De]]);const Ne=[],je=new Map;for(De of oe)je.has(De.name)||(De.fn=fe[De.fn],Ne.push(De),je.set(De.name,De));const Ze=Ne[0]&&Ne[0].params.length<=2&&!y(Ne[0].params),_e=Ne[1]&&Ne[1].params.length<=2&&!y(Ne[1].params),wt=Ne[2]&&Ne[2].params.length<=2&&!y(Ne[2].params),M=Ne[3]&&Ne[3].params.length<=2&&!y(Ne[3].params),X=Ne[4]&&Ne[4].params.length<=2&&!y(Ne[4].params),pe=Ne[5]&&Ne[5].params.length<=2&&!y(Ne[5].params),Ee=Ze&&_e&&wt&&M&&X&&pe;for(let ut=0;ut<Ne.length;++ut)Ne[ut].test=E(Ne[ut].params);const Re=Ze?N(Ne[0].params[0]):Er,Je=_e?N(Ne[1].params[0]):Er,vr=wt?N(Ne[2].params[0]):Er,nc=M?N(Ne[3].params[0]):Er,bw=X?N(Ne[4].params[0]):Er,xw=pe?N(Ne[5].params[0]):Er,ww=Ze?N(Ne[0].params[1]):Er,Nw=_e?N(Ne[1].params[1]):Er,Dw=wt?N(Ne[2].params[1]):Er,Ew=M?N(Ne[3].params[1]):Er,Aw=X?N(Ne[4].params[1]):Er,Sw=pe?N(Ne[5].params[1]):Er;for(let ut=0;ut<Ne.length;++ut)Ne[ut].implementation=q(Ne[ut].params,Ne[ut].fn);const Cw=Ze?Ne[0].implementation:Qi,Mw=_e?Ne[1].implementation:Qi,_w=wt?Ne[2].implementation:Qi,Fw=M?Ne[3].implementation:Qi,Tw=X?Ne[4].implementation:Qi,Ow=pe?Ne[5].implementation:Qi,Bw=Ze?Ne[0].params.length:-1,kw=_e?Ne[1].params.length:-1,Iw=wt?Ne[2].params.length:-1,Rw=M?Ne[3].params.length:-1,qw=X?Ne[4].params.length:-1,zw=pe?Ne[5].params.length:-1,jw=Ee?6:0,Lw=Ne.length,Pw=Ne.map(ut=>ut.test),Vw=Ne.map(ut=>ut.implementation),Uw=function(){for(let ut=jw;ut<Lw;ut++)if(Pw[ut](arguments))return Vw[ut].apply(this,arguments);return o.onMismatch(B,arguments,Ne)};function Va(ut,mn){return arguments.length===Bw&&Re(ut)&&ww(mn)?Cw.apply(this,arguments):arguments.length===kw&&Je(ut)&&Nw(mn)?Mw.apply(this,arguments):arguments.length===Iw&&vr(ut)&&Dw(mn)?_w.apply(this,arguments):arguments.length===Rw&&nc(ut)&&Ew(mn)?Fw.apply(this,arguments):arguments.length===qw&&bw(ut)&&Aw(mn)?Tw.apply(this,arguments):arguments.length===zw&&xw(ut)&&Sw(mn)?Ow.apply(this,arguments):Uw.apply(this,arguments)}try{Object.defineProperty(Va,"name",{value:B})}catch{}return Va.signatures=ie,Va._typedFunctionData={signatures:Ne,signatureMap:je},Va}function ae(B,j,Q){throw _(B,j,Q)}function de(B){return ce(B,0,B.length-1)}function ne(B){return B[B.length-1]}function ce(B,j,Q){return Array.prototype.slice.call(B,j,Q)}function le(B,j){for(let Q=0;Q<B.length;Q++)if(j(B[Q]))return B[Q]}function he(B,j){return Array.prototype.concat.apply([],B.map(j))}function xe(){const B=de(arguments).map(Q=>w(b(Q))),j=ne(arguments);if(typeof j!="function")throw new TypeError("Callback function expected as last argument");return $(B,j)}function $(B,j){return{referTo:{references:B,callback:j}}}function T(B){if(typeof B!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:B}}}function z(B){return B&&typeof B.referTo=="object"&&Array.isArray(B.referTo.references)&&typeof B.referTo.callback=="function"}function J(B){return B&&typeof B.referToSelf=="object"&&typeof B.referToSelf.callback=="function"}function L(B,j){if(!B)return j;if(j&&j!==B){const Q=new Error("Function names do not match (expected: "+B+", actual: "+j+")");throw Q.data={actual:j,expected:B},Q}return B}function H(B){let j;for(const Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(p(B[Q])||typeof B[Q].signature=="string")&&(j=L(j,B[Q].name));return j}function G(B,j){let Q;for(Q in j)if(Object.prototype.hasOwnProperty.call(j,Q)){if(Q in B&&j[Q]!==B[Q]){const Z=new Error('Signature "'+Q+'" is defined twice');throw Z.data={signature:Q,sourceFunction:j[Q],destFunction:B[Q]},Z}B[Q]=j[Q]}}const Y=o;o=function(B){const j=typeof B=="string",Q=j?1:0;let Z=j?B:"";const ie={};for(let oe=Q;oe<arguments.length;++oe){const ye=arguments[oe];let fe={},De;if(typeof ye=="function"?(De=ye.name,typeof ye.signature=="string"?fe[ye.signature]=ye:p(ye)&&(fe=ye.signatures)):e(ye)&&(fe=ye,j||(De=H(ye))),Object.keys(fe).length===0){const Ne=new TypeError("Argument to 'typed' at index "+oe+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw Ne.data={index:oe,argument:ye},Ne}j||(Z=L(Z,De)),G(ie,fe)}return re(Z||"",ie)},o.create=Jg,o.createCount=Y.createCount,o.onMismatch=ae,o.throwMismatchError=ae,o.createError=_,o.clear=l,o.clearConversions=s,o.addTypes=c,o._findType=u,o.referTo=xe,o.referToSelf=T,o.convert=h,o.findSignature=m,o.find=d,o.isTypedFunction=p,o.warnAgainstDeprecatedThis=!0,o.addType=function(B,j){let Q="any";j!==!1&&n.has("Object")&&(Q="Object"),o.addTypes([B],Q)};function ee(B){if(!B||typeof B.from!="string"||typeof B.to!="string"||typeof B.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(B.to===B.from)throw new SyntaxError('Illegal to define conversion from "'+B.from+'" to itself.')}return o.addConversion=function(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ee(B);const Q=u(B.to),Z=Q.conversionsTo.find(ie=>ie.from===B.from);if(Z)if(j&&j.override)o.removeConversion({from:Z.from,to:B.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+B.from+'" to "'+Q.name+'"');Q.conversionsTo.push({from:B.from,convert:B.convert,index:a++})},o.addConversions=function(B,j){B.forEach(Q=>o.addConversion(Q,j))},o.removeConversion=function(B){ee(B);const j=u(B.to),Q=le(j.conversionsTo,ie=>ie.from===B.from);if(!Q)throw new Error("Attempt to remove nonexistent conversion from "+B.from+" to "+B.to);if(Q.convert!==B.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=j.conversionsTo.indexOf(Q);j.conversionsTo.splice(Z,1)},o.resolve=function(B,j){if(!p(B))throw new TypeError(Gf);const Q=B._typedFunctionData.signatures;for(let Z=0;Z<Q.length;++Z)if(Q[Z].test(j))return Q[Z];return null},o}const ta=Jg();function Fe(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Wn=Math.sign||function(e){return e>0?1:e<0?-1:0},mN=Math.log2||function(e){return Math.log(e)/Math.LN2},dN=Math.log10||function(e){return Math.log(e)/Math.LN10},hN=Math.log1p||function(e){return Math.log(e+1)},gN=Math.cbrt||function(e){if(e===0)return e;var t=e<0,r;return t&&(e=-e),isFinite(e)?(r=Math.exp(Math.log(e)/3),r=(e/(r*r)+2*r)/3):r=e,t?-r:r},vN=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function oc(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Fe(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),a="i".concat(r)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Di(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=Gg(t);switch(r){case"fixed":return Wg(e,n);case"exponential":return Kg(e,n);case"engineering":return yN(e,n);case"bin":return oc(e,2,i);case"oct":return oc(e,8,i);case"hex":return oc(e,16,i);case"auto":return bN(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Gg(e){var t="auto",r,n;if(e!==void 0)if(Ue(e))r=e;else if($e(e))r=e.toNumber();else if(pu(e))e.precision!==void 0&&(r=Wf(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=Wf(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function wo(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function yN(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=wo(e),n=du(r,t),i=n.exponent,a=n.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ue(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),c=0;c<u;c++)a.push(0);for(var l=Math.abs(i-o),s=1;l>0;)s++,l--;var f=a.slice(s).join(""),p=Ue(t)&&f.length||f.match(/[1-9]/)?"."+f:"",m=a.slice(0,s).join("")+p+"e"+(i>=0?"+":"")+o.toString();return n.sign+m}function Wg(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=wo(e),n=typeof t=="number"?du(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(ia(o-i.length))),a<0&&(i=ia(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),n.sign+i.join("")}function Kg(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=wo(e),n=t?du(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(ia(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function bN(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=Kf(r==null?void 0:r.lowerExp,-3),i=Kf(r==null?void 0:r.upperExp,5),a=wo(e),o=t?du(a,t):a;if(o.exponent<n||o.exponent>=i)return Kg(e,t);var u=o.coefficients,c=o.exponent;u.length<t&&(u=u.concat(ia(t-u.length))),u=u.concat(ia(c-u.length+1+(u.length<t?t-u.length:0))),u=ia(-c).concat(u);var l=c>0?c:0;return l<u.length-1&&u.splice(l+1,0,"."),o.sign+u.join("")}function du(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t){var i=n.splice(t,n.length-t);if(i[0]>=5){var a=t-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r}function ia(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function xN(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var wN=Number.EPSILON||2220446049250313e-31;function sr(e,t,r){if(r==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<=wN?!0:n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}var NN=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},DN=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},EN=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},AN=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},SN=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},CN=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function MN(e,t){var r=!0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function Wf(e,t){if(Ue(e))return e;if($e(e))return e.toNumber();t()}function Kf(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function U(e,t,r,n){function i(a){var o=lN(a,t.map(TN));return _N(e,t,a),r(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function _N(e,t,r){var n=t.filter(a=>!FN(a)).every(a=>r[a]!==void 0);if(!n){var i=t.filter(a=>r[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function FN(e){return e&&e[0]==="?"}function TN(e){return e&&e[0]==="?"?e.slice(1):e}function nr(e,t){if(Zg(e)&&Qg(e,t))return e[t];throw typeof e[t]=="function"&&Nl(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function pa(e,t,r){if(Zg(e)&&Qg(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function ON(e,t){return t in e}function Qg(e,t){return!e||typeof e!="object"?!1:Me(kN,t)?!0:!(t in Object.prototype||t in Function.prototype)}function BN(e,t){if(!Nl(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function Nl(e,t){return e==null||typeof e[t]!="function"||Me(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Me(IN,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Zg(e){return typeof e=="object"&&e&&e.constructor===Object}var kN={length:!0,name:!0},IN={toString:!0,valueOf:!0,toLocaleString:!0};class hu{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return nr(this.wrappedObject,t)}set(t,r){return pa(this.wrappedObject,t,r),this}has(t){return ON(this.wrappedObject,t)}entries(){return Yg(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}class Xg{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Yg(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function Yg(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function ao(){return new Map}function aa(e){if(!e)return ao();if(ev(e))return e;if(pu(e))return new hu(e);throw new Error("createMap can create maps from objects or Maps")}function RN(e){if(e instanceof hu)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);pa(t,r,n)}return t}function ev(e){return e?e instanceof Map||e instanceof hu||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var tv=function(){return tv=ta.create,ta},qN=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],zN=U("typed",qN,function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=tv();return a.clear(),a.addTypes([{name:"number",test:Ue},{name:"Complex",test:wn},{name:"BigNumber",test:$e},{name:"Fraction",test:bo},{name:"Unit",test:Cr},{name:"identifier",test:o=>Qt&&/^(?:[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(o)},{name:"string",test:Qt},{name:"Chain",test:$g},{name:"Array",test:st},{name:"Matrix",test:ke},{name:"DenseMatrix",test:_s},{name:"SparseMatrix",test:wi},{name:"Range",test:wl},{name:"Index",test:fu},{name:"boolean",test:Qw},{name:"ResultSet",test:Zw},{name:"Help",test:Ug},{name:"function",test:Xw},{name:"Date",test:Yw},{name:"RegExp",test:eN},{name:"null",test:tN},{name:"undefined",test:rN},{name:"AccessorNode",test:Ti},{name:"ArrayNode",test:Sr},{name:"AssignmentNode",test:nN},{name:"BlockNode",test:iN},{name:"ConditionalNode",test:aN},{name:"ConstantNode",test:nt},{name:"FunctionNode",test:Zn},{name:"FunctionAssignmentNode",test:xo},{name:"IndexNode",test:Da},{name:"Node",test:ft},{name:"ObjectNode",test:mu},{name:"OperatorNode",test:Ct},{name:"ParenthesisNode",test:An},{name:"RangeNode",test:oN},{name:"RelationalNode",test:sN},{name:"SymbolNode",test:zt},{name:"Map",test:ev},{name:"Object",test:pu}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(o){if(t||sc(o),xN(o)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+o+"). Use function bignumber(x) to convert to BigNumber.");return new t(o)}},{from:"number",to:"Complex",convert:function(o){return r||Uo(o),new r(o,0)}},{from:"BigNumber",to:"Complex",convert:function(o){return r||Uo(o),new r(o.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(o){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(o){return r||Uo(o),new r(o.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(o){i||uc(o);var u=new i(o);if(u.valueOf()!==o)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+o+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(o){var u=Number(o);if(isNaN(u))throw new Error('Cannot convert "'+o+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(o){t||sc(o);try{return new t(o)}catch{throw new Error('Cannot convert "'+o+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(o){i||uc(o);try{return new i(o)}catch{throw new Error('Cannot convert "'+o+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(o){r||Uo(o);try{return new r(o)}catch{throw new Error('Cannot convert "'+o+'" to Complex')}}},{from:"boolean",to:"number",convert:function(o){return+o}},{from:"boolean",to:"BigNumber",convert:function(o){return t||sc(o),new t(+o)}},{from:"boolean",to:"Fraction",convert:function(o){return i||uc(o),new i(+o)}},{from:"boolean",to:"string",convert:function(o){return String(o)}},{from:"Array",to:"Matrix",convert:function(o){return n||jN(),new n(o)}},{from:"Matrix",to:"Array",convert:function(o){return o.valueOf()}}]),a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a});function sc(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Uo(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function jN(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function uc(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var LN="ResultSet",PN=[],VN=U(LN,PN,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});/*!
|
|
8
|
+
`);return Object.freeze(Zg)};Ot(ve,Zg,{MATRIX_OPTIONS:xN,NUMBER_OPTIONS:wN});function ep(){return!0}function Er(){return!1}function Xi(){}const tp="Argument is not a typed-function.";function tv(){function e(B){return typeof B=="object"&&B!==null&&B.constructor===Object}const t=[{name:"number",test:function(B){return typeof B=="number"}},{name:"string",test:function(B){return typeof B=="string"}},{name:"boolean",test:function(B){return typeof B=="boolean"}},{name:"Function",test:function(B){return typeof B=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(B){return B instanceof Date}},{name:"RegExp",test:function(B){return B instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(B){return B===null}},{name:"undefined",test:function(B){return B===void 0}}],r={name:"any",test:ep,isAny:!0};let n,i,a=0,o={createCount:0};function u(B){const j=n.get(B);if(j)return j;let Q='Unknown type "'+B+'"';const Z=B.toLowerCase();let ie;for(ie of i)if(ie.toLowerCase()===Z){Q+='. Did you mean "'+ie+'" ?';break}throw new TypeError(Q)}function c(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const Q=j?u(j).index:i.length,Z=[];for(let oe=0;oe<B.length;++oe){if(!B[oe]||typeof B[oe].name!="string"||typeof B[oe].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const ye=B[oe].name;if(n.has(ye))throw new TypeError('Duplicate type name "'+ye+'"');Z.push(ye),n.set(ye,{name:ye,test:B[oe].test,isAny:B[oe].isAny,index:Q+oe,conversionsTo:[]})}const ie=i.slice(Q);i=i.slice(0,Q).concat(Z).concat(ie);for(let oe=Q+Z.length;oe<i.length;++oe)n.get(i[oe]).index=oe}function l(){n=new Map,i=[],a=0,c([r],!1)}l(),c(t);function s(){let B;for(B of i)n.get(B).conversionsTo=[];a=0}function f(B){const j=i.filter(Q=>{const Z=n.get(Q);return!Z.isAny&&Z.test(B)});return j.length?j:["any"]}function p(B){return B&&typeof B=="function"&&"_typedFunctionData"in B}function m(B,j,Q){if(!p(B))throw new TypeError(tp);const Z=Q&&Q.exact,ie=Array.isArray(j)?j.join(","):j,oe=b(ie),ye=w(oe);if(!Z||ye in B.signatures){const je=B._typedFunctionData.signatureMap.get(ye);if(je)return je}const fe=oe.length;let De;if(Z){De=[];let je;for(je in B.signatures)De.push(B._typedFunctionData.signatureMap.get(je))}else De=B._typedFunctionData.signatures;for(let je=0;je<fe;++je){const Ze=oe[je],_e=[];let wt;for(wt of De){const M=A(wt.params,je);if(!(!M||Ze.restParam&&!M.restParam)){if(!M.hasAny){const X=g(M);if(Ze.types.some(pe=>!X.has(pe.name)))continue}_e.push(wt)}}if(De=_e,De.length===0)break}let Ne;for(Ne of De)if(Ne.params.length<=fe)return Ne;throw new TypeError("Signature not found (signature: "+(B.name||"unnamed")+"("+w(oe,", ")+"))")}function d(B,j,Q){return m(B,j,Q).implementation}function h(B,j){const Q=u(j);if(Q.test(B))return B;const Z=Q.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+j+" defined.");for(let ie=0;ie<Z.length;ie++)if(u(Z[ie].from).test(B))return Z[ie].convert(B);throw new Error("Cannot convert "+B+" to "+j)}function w(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return B.map(Q=>Q.name).join(j)}function v(B){const j=B.indexOf("...")===0,Q=(j?B.length>3?B.slice(3):"any":B).split("|").map(oe=>u(oe.trim()));let Z=!1,ie=j?"...":"";return{types:Q.map(function(oe){return Z=oe.isAny||Z,ie+=oe.name+"|",{name:oe.name,typeIndex:oe.index,test:oe.test,isAny:oe.isAny,conversion:null,conversionIndex:-1}}),name:ie.slice(0,-1),hasAny:Z,hasConversion:!1,restParam:j}}function x(B){const j=B.types.map(ye=>ye.name),Q=F(j);let Z=B.hasAny,ie=B.name;const oe=Q.map(function(ye){const fe=u(ye.from);return Z=fe.isAny||Z,ie+="|"+ye.from,{name:ye.from,typeIndex:fe.index,test:fe.test,isAny:fe.isAny,conversion:ye,conversionIndex:ye.index}});return{types:B.types.concat(oe),name:ie,hasAny:Z,hasConversion:oe.length>0,restParam:B.restParam}}function g(B){return B.typeSet||(B.typeSet=new Set,B.types.forEach(j=>B.typeSet.add(j.name))),B.typeSet}function b(B){const j=[];if(typeof B!="string")throw new TypeError("Signatures must be strings");const Q=B.trim();if(Q==="")return j;const Z=Q.split(",");for(let ie=0;ie<Z.length;++ie){const oe=v(Z[ie].trim());if(oe.restParam&&ie!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ie]+'": only allowed for the last parameter');if(oe.types.length===0)return null;j.push(oe)}return j}function y(B){const j=ne(B);return j?j.restParam:!1}function N(B){if(!B||B.types.length===0)return ep;if(B.types.length===1)return u(B.types[0].name).test;if(B.types.length===2){const j=u(B.types[0].name).test,Q=u(B.types[1].name).test;return function(Z){return j(Z)||Q(Z)}}else{const j=B.types.map(function(Q){return u(Q.name).test});return function(Q){for(let Z=0;Z<j.length;Z++)if(j[Z](Q))return!0;return!1}}}function E(B){let j,Q,Z;if(y(B)){j=de(B).map(N);const ie=j.length,oe=N(ne(B)),ye=function(fe){for(let De=ie;De<fe.length;De++)if(!oe(fe[De]))return!1;return!0};return function(fe){for(let De=0;De<j.length;De++)if(!j[De](fe[De]))return!1;return ye(fe)&&fe.length>=ie+1}}else return B.length===0?function(ie){return ie.length===0}:B.length===1?(Q=N(B[0]),function(ie){return Q(ie[0])&&ie.length===1}):B.length===2?(Q=N(B[0]),Z=N(B[1]),function(ie){return Q(ie[0])&&Z(ie[1])&&ie.length===2}):(j=B.map(N),function(ie){for(let oe=0;oe<j.length;oe++)if(!j[oe](ie[oe]))return!1;return ie.length===j.length})}function A(B,j){return j<B.length?B[j]:y(B)?ne(B):null}function D(B,j){const Q=A(B,j);return Q?g(Q):new Set}function S(B){return B.conversion===null||B.conversion===void 0}function C(B,j){const Q=new Set;return B.forEach(Z=>{const ie=D(Z.params,j);let oe;for(oe of ie)Q.add(oe)}),Q.has("any")?["any"]:Array.from(Q)}function _(B,j,Q){let Z,ie;const oe=B||"unnamed";let ye=Q,fe;for(fe=0;fe<j.length;fe++){const Ze=[];if(ye.forEach(_e=>{const wt=A(_e.params,fe),M=N(wt);(fe<_e.params.length||y(_e.params))&&M(j[fe])&&Ze.push(_e)}),Ze.length===0){if(ie=C(ye,fe),ie.length>0){const _e=f(j[fe]);return Z=new TypeError("Unexpected type of argument in function "+oe+" (expected: "+ie.join(" or ")+", actual: "+_e.join(" | ")+", index: "+fe+")"),Z.data={category:"wrongType",fn:oe,index:fe,actual:_e,expected:ie},Z}}else ye=Ze}const De=ye.map(function(Ze){return y(Ze.params)?1/0:Ze.params.length});if(j.length<Math.min.apply(null,De))return ie=C(ye,fe),Z=new TypeError("Too few arguments in function "+oe+" (expected: "+ie.join(" or ")+", index: "+j.length+")"),Z.data={category:"tooFewArgs",fn:oe,index:j.length,expected:ie},Z;const Ne=Math.max.apply(null,De);if(j.length>Ne)return Z=new TypeError("Too many arguments in function "+oe+" (expected: "+Ne+", actual: "+j.length+")"),Z.data={category:"tooManyArgs",fn:oe,index:j.length,expectedLength:Ne},Z;const je=[];for(let Ze=0;Ze<j.length;++Ze)je.push(f(j[Ze]).join("|"));return Z=new TypeError('Arguments of type "'+je.join(", ")+'" do not match any of the defined signatures of function '+oe+"."),Z.data={category:"mismatch",actual:je},Z}function R(B){let j=i.length+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])&&(j=Math.min(j,B.types[Q].typeIndex));return j}function P(B){let j=a+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])||(j=Math.min(j,B.types[Q].conversionIndex));return j}function I(B,j){if(B.hasAny){if(!j.hasAny)return 1}else if(j.hasAny)return-1;if(B.restParam){if(!j.restParam)return 1}else if(j.restParam)return-1;if(B.hasConversion){if(!j.hasConversion)return 1}else if(j.hasConversion)return-1;const Q=R(B)-R(j);if(Q<0)return-1;if(Q>0)return 1;const Z=P(B)-P(j);return Z<0?-1:Z>0?1:0}function O(B,j){const Q=B.params,Z=j.params,ie=ne(Q),oe=ne(Z),ye=y(Q),fe=y(Z);if(ye&&ie.hasAny){if(!fe||!oe.hasAny)return 1}else if(fe&&oe.hasAny)return-1;let De=0,Ne=0,je;for(je of Q)je.hasAny&&++De,je.hasConversion&&++Ne;let Ze=0,_e=0;for(je of Z)je.hasAny&&++Ze,je.hasConversion&&++_e;if(De!==Ze)return De-Ze;if(ye&&ie.hasConversion){if(!fe||!oe.hasConversion)return 1}else if(fe&&oe.hasConversion)return-1;if(Ne!==_e)return Ne-_e;if(ye){if(!fe)return 1}else if(fe)return-1;const wt=(Q.length-Z.length)*(ye?-1:1);if(wt!==0)return wt;const M=[];let X=0;for(let Ee=0;Ee<Q.length;++Ee){const Re=I(Q[Ee],Z[Ee]);M.push(Re),X+=Re}if(X!==0)return X;let pe;for(pe of M)if(pe!==0)return pe;return 0}function F(B){if(B.length===0)return[];const j=B.map(u);B.length>1&&j.sort((ie,oe)=>ie.index-oe.index);let Q=j[0].conversionsTo;if(B.length===1)return Q;Q=Q.concat([]);const Z=new Set(B);for(let ie=1;ie<j.length;++ie){let oe;for(oe of j[ie].conversionsTo)Z.has(oe.from)||(Q.push(oe),Z.add(oe.from))}return Q}function q(B,j){let Q=j;if(B.some(ie=>ie.hasConversion)){const ie=y(B),oe=B.map(k);Q=function(){const ye=[],fe=ie?arguments.length-1:arguments.length;for(let De=0;De<fe;De++)ye[De]=oe[De](arguments[De]);return ie&&(ye[fe]=arguments[fe].map(oe[fe])),j.apply(this,ye)}}let Z=Q;if(y(B)){const ie=B.length-1;Z=function(){return Q.apply(this,ce(arguments,0,ie).concat([ce(arguments,ie)]))}}return Z}function k(B){let j,Q,Z,ie;const oe=[],ye=[];switch(B.types.forEach(function(fe){fe.conversion&&(oe.push(u(fe.conversion.from).test),ye.push(fe.conversion.convert))}),ye.length){case 0:return function(fe){return fe};case 1:return j=oe[0],Z=ye[0],function(fe){return j(fe)?Z(fe):fe};case 2:return j=oe[0],Q=oe[1],Z=ye[0],ie=ye[1],function(fe){return j(fe)?Z(fe):Q(fe)?ie(fe):fe};default:return function(fe){for(let De=0;De<ye.length;De++)if(oe[De](fe))return ye[De](fe);return fe}}}function te(B){function j(Q,Z,ie){if(Z<Q.length){const oe=Q[Z];let ye=[];if(oe.restParam){const fe=oe.types.filter(S);fe.length<oe.types.length&&ye.push({types:fe,name:"..."+fe.map(De=>De.name).join("|"),hasAny:fe.some(De=>De.isAny),hasConversion:!1,restParam:!0}),ye.push(oe)}else ye=oe.types.map(function(fe){return{types:[fe],name:fe.name,hasAny:fe.isAny,hasConversion:fe.conversion,restParam:!1}});return he(ye,function(fe){return j(Q,Z+1,ie.concat([fe]))})}else return[ie]}return j(B,0,[])}function se(B,j){const Q=Math.max(B.length,j.length);for(let fe=0;fe<Q;fe++){const De=D(B,fe),Ne=D(j,fe);let je=!1,Ze;for(Ze of Ne)if(De.has(Ze)){je=!0;break}if(!je)return!1}const Z=B.length,ie=j.length,oe=y(B),ye=y(j);return oe?ye?Z===ie:ie>=Z:ye?Z>=ie:Z===ie}function W(B){return B.map(j=>J(j)?T(j.referToSelf.callback):z(j)?$(j.referTo.references,j.referTo.callback):j)}function V(B,j,Q){const Z=[];let ie;for(ie of B){let oe=Q[ie];if(typeof oe!="number")throw new TypeError('No definition for referenced signature "'+ie+'"');if(oe=j[oe],typeof oe!="function")return!1;Z.push(oe)}return Z}function ue(B,j,Q){const Z=W(B),ie=new Array(Z.length).fill(!1);let oe=!0;for(;oe;){oe=!1;let ye=!0;for(let fe=0;fe<Z.length;++fe){if(ie[fe])continue;const De=Z[fe];if(J(De))Z[fe]=De.referToSelf.callback(Q),Z[fe].referToSelf=De.referToSelf,ie[fe]=!0,ye=!1;else if(z(De)){const Ne=V(De.referTo.references,Z,j);Ne?(Z[fe]=De.referTo.callback.apply(this,Ne),Z[fe].referTo=De.referTo,ie[fe]=!0,ye=!1):oe=!0}}if(ye&&oe)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function me(B){const j=/\bthis(\(|\.signatures\b)/;Object.keys(B).forEach(Q=>{const Z=B[Q];if(j.test(Z.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 re(B,j){if(o.createCount++,Object.keys(j).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&me(j);const Q=[],Z=[],ie={},oe=[];let ye;for(ye in j){if(!Object.prototype.hasOwnProperty.call(j,ye))continue;const ut=b(ye);if(!ut)continue;Q.forEach(function(Ja){if(se(Ja,ut))throw new TypeError('Conflicting signatures "'+w(Ja)+'" and "'+w(ut)+'".')}),Q.push(ut);const mn=Z.length;Z.push(j[ye]);const Yw=ut.map(x);let $o;for($o of te(Yw)){const Ja=w($o);oe.push({params:$o,name:Ja,fn:mn}),$o.every(eN=>!eN.hasConversion)&&(ie[Ja]=mn)}}oe.sort(O);const fe=ue(Z,ie,Ha);let De;for(De in ie)Object.prototype.hasOwnProperty.call(ie,De)&&(ie[De]=fe[ie[De]]);const Ne=[],je=new Map;for(De of oe)je.has(De.name)||(De.fn=fe[De.fn],Ne.push(De),je.set(De.name,De));const Ze=Ne[0]&&Ne[0].params.length<=2&&!y(Ne[0].params),_e=Ne[1]&&Ne[1].params.length<=2&&!y(Ne[1].params),wt=Ne[2]&&Ne[2].params.length<=2&&!y(Ne[2].params),M=Ne[3]&&Ne[3].params.length<=2&&!y(Ne[3].params),X=Ne[4]&&Ne[4].params.length<=2&&!y(Ne[4].params),pe=Ne[5]&&Ne[5].params.length<=2&&!y(Ne[5].params),Ee=Ze&&_e&&wt&&M&&X&&pe;for(let ut=0;ut<Ne.length;++ut)Ne[ut].test=E(Ne[ut].params);const Re=Ze?N(Ne[0].params[0]):Er,Je=_e?N(Ne[1].params[0]):Er,vr=wt?N(Ne[2].params[0]):Er,uc=M?N(Ne[3].params[0]):Er,Mw=X?N(Ne[4].params[0]):Er,_w=pe?N(Ne[5].params[0]):Er,Fw=Ze?N(Ne[0].params[1]):Er,Tw=_e?N(Ne[1].params[1]):Er,Ow=wt?N(Ne[2].params[1]):Er,Bw=M?N(Ne[3].params[1]):Er,kw=X?N(Ne[4].params[1]):Er,Iw=pe?N(Ne[5].params[1]):Er;for(let ut=0;ut<Ne.length;++ut)Ne[ut].implementation=q(Ne[ut].params,Ne[ut].fn);const Rw=Ze?Ne[0].implementation:Xi,qw=_e?Ne[1].implementation:Xi,zw=wt?Ne[2].implementation:Xi,jw=M?Ne[3].implementation:Xi,Lw=X?Ne[4].implementation:Xi,Pw=pe?Ne[5].implementation:Xi,Vw=Ze?Ne[0].params.length:-1,Uw=_e?Ne[1].params.length:-1,$w=wt?Ne[2].params.length:-1,Hw=M?Ne[3].params.length:-1,Jw=X?Ne[4].params.length:-1,Gw=pe?Ne[5].params.length:-1,Kw=Ee?6:0,Ww=Ne.length,Qw=Ne.map(ut=>ut.test),Zw=Ne.map(ut=>ut.implementation),Xw=function(){for(let ut=Kw;ut<Ww;ut++)if(Qw[ut](arguments))return Zw[ut].apply(this,arguments);return o.onMismatch(B,arguments,Ne)};function Ha(ut,mn){return arguments.length===Vw&&Re(ut)&&Fw(mn)?Rw.apply(this,arguments):arguments.length===Uw&&Je(ut)&&Tw(mn)?qw.apply(this,arguments):arguments.length===$w&&vr(ut)&&Ow(mn)?zw.apply(this,arguments):arguments.length===Hw&&uc(ut)&&Bw(mn)?jw.apply(this,arguments):arguments.length===Jw&&Mw(ut)&&kw(mn)?Lw.apply(this,arguments):arguments.length===Gw&&_w(ut)&&Iw(mn)?Pw.apply(this,arguments):Xw.apply(this,arguments)}try{Object.defineProperty(Ha,"name",{value:B})}catch{}return Ha.signatures=ie,Ha._typedFunctionData={signatures:Ne,signatureMap:je},Ha}function ae(B,j,Q){throw _(B,j,Q)}function de(B){return ce(B,0,B.length-1)}function ne(B){return B[B.length-1]}function ce(B,j,Q){return Array.prototype.slice.call(B,j,Q)}function le(B,j){for(let Q=0;Q<B.length;Q++)if(j(B[Q]))return B[Q]}function he(B,j){return Array.prototype.concat.apply([],B.map(j))}function xe(){const B=de(arguments).map(Q=>w(b(Q))),j=ne(arguments);if(typeof j!="function")throw new TypeError("Callback function expected as last argument");return $(B,j)}function $(B,j){return{referTo:{references:B,callback:j}}}function T(B){if(typeof B!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:B}}}function z(B){return B&&typeof B.referTo=="object"&&Array.isArray(B.referTo.references)&&typeof B.referTo.callback=="function"}function J(B){return B&&typeof B.referToSelf=="object"&&typeof B.referToSelf.callback=="function"}function L(B,j){if(!B)return j;if(j&&j!==B){const Q=new Error("Function names do not match (expected: "+B+", actual: "+j+")");throw Q.data={actual:j,expected:B},Q}return B}function H(B){let j;for(const Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(p(B[Q])||typeof B[Q].signature=="string")&&(j=L(j,B[Q].name));return j}function G(B,j){let Q;for(Q in j)if(Object.prototype.hasOwnProperty.call(j,Q)){if(Q in B&&j[Q]!==B[Q]){const Z=new Error('Signature "'+Q+'" is defined twice');throw Z.data={signature:Q,sourceFunction:j[Q],destFunction:B[Q]},Z}B[Q]=j[Q]}}const Y=o;o=function(B){const j=typeof B=="string",Q=j?1:0;let Z=j?B:"";const ie={};for(let oe=Q;oe<arguments.length;++oe){const ye=arguments[oe];let fe={},De;if(typeof ye=="function"?(De=ye.name,typeof ye.signature=="string"?fe[ye.signature]=ye:p(ye)&&(fe=ye.signatures)):e(ye)&&(fe=ye,j||(De=H(ye))),Object.keys(fe).length===0){const Ne=new TypeError("Argument to 'typed' at index "+oe+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw Ne.data={index:oe,argument:ye},Ne}j||(Z=L(Z,De)),G(ie,fe)}return re(Z||"",ie)},o.create=tv,o.createCount=Y.createCount,o.onMismatch=ae,o.throwMismatchError=ae,o.createError=_,o.clear=l,o.clearConversions=s,o.addTypes=c,o._findType=u,o.referTo=xe,o.referToSelf=T,o.convert=h,o.findSignature=m,o.find=d,o.isTypedFunction=p,o.warnAgainstDeprecatedThis=!0,o.addType=function(B,j){let Q="any";j!==!1&&n.has("Object")&&(Q="Object"),o.addTypes([B],Q)};function ee(B){if(!B||typeof B.from!="string"||typeof B.to!="string"||typeof B.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(B.to===B.from)throw new SyntaxError('Illegal to define conversion from "'+B.from+'" to itself.')}return o.addConversion=function(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ee(B);const Q=u(B.to),Z=Q.conversionsTo.find(ie=>ie.from===B.from);if(Z)if(j&&j.override)o.removeConversion({from:Z.from,to:B.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+B.from+'" to "'+Q.name+'"');Q.conversionsTo.push({from:B.from,convert:B.convert,index:a++})},o.addConversions=function(B,j){B.forEach(Q=>o.addConversion(Q,j))},o.removeConversion=function(B){ee(B);const j=u(B.to),Q=le(j.conversionsTo,ie=>ie.from===B.from);if(!Q)throw new Error("Attempt to remove nonexistent conversion from "+B.from+" to "+B.to);if(Q.convert!==B.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=j.conversionsTo.indexOf(Q);j.conversionsTo.splice(Z,1)},o.resolve=function(B,j){if(!p(B))throw new TypeError(tp);const Q=B._typedFunctionData.signatures;for(let Z=0;Z<Q.length;++Z)if(Q[Z].test(j))return Q[Z];return null},o}const ia=tv();function Fe(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Kn=Math.sign||function(e){return e>0?1:e<0?-1:0},NN=Math.log2||function(e){return Math.log(e)/Math.LN2},DN=Math.log10||function(e){return Math.log(e)/Math.LN10},EN=Math.log1p||function(e){return Math.log(e+1)},AN=Math.cbrt||function(e){if(e===0)return e;var t=e<0,r;return t&&(e=-e),isFinite(e)?(r=Math.exp(Math.log(e)/3),r=(e/(r*r)+2*r)/3):r=e,t?-r:r},SN=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function fc(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Fe(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),a="i".concat(r)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Ei(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=rv(t);switch(r){case"fixed":return nv(e,n);case"exponential":return iv(e,n);case"engineering":return CN(e,n);case"bin":return fc(e,2,i);case"oct":return fc(e,8,i);case"hex":return fc(e,16,i);case"auto":return MN(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function rv(e){var t="auto",r,n;if(e!==void 0)if(Ue(e))r=e;else if($e(e))r=e.toNumber();else if(vu(e))e.precision!==void 0&&(r=rp(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=rp(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function Ao(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function CN(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=Ao(e),n=bu(r,t),i=n.exponent,a=n.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ue(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),c=0;c<u;c++)a.push(0);for(var l=Math.abs(i-o),s=1;l>0;)s++,l--;var f=a.slice(s).join(""),p=Ue(t)&&f.length||f.match(/[1-9]/)?"."+f:"",m=a.slice(0,s).join("")+p+"e"+(i>=0?"+":"")+o.toString();return n.sign+m}function nv(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=Ao(e),n=typeof t=="number"?bu(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(sa(o-i.length))),a<0&&(i=sa(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),n.sign+i.join("")}function iv(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=Ao(e),n=t?bu(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(sa(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function MN(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=np(r==null?void 0:r.lowerExp,-3),i=np(r==null?void 0:r.upperExp,5),a=Ao(e),o=t?bu(a,t):a;if(o.exponent<n||o.exponent>=i)return iv(e,t);var u=o.coefficients,c=o.exponent;u.length<t&&(u=u.concat(sa(t-u.length))),u=u.concat(sa(c-u.length+1+(u.length<t?t-u.length:0))),u=sa(-c).concat(u);var l=c>0?c:0;return l<u.length-1&&u.splice(l+1,0,"."),o.sign+u.join("")}function bu(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t){var i=n.splice(t,n.length-t);if(i[0]>=5){var a=t-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r}function sa(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function _N(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var FN=Number.EPSILON||2220446049250313e-31;function sr(e,t,r){if(r==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<=FN?!0:n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}var TN=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},ON=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},BN=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},kN=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},IN=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},RN=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function qN(e,t){var r=!0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function rp(e,t){if(Ue(e))return e;if($e(e))return e.toNumber();t()}function np(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function U(e,t,r,n){function i(a){var o=bN(a,t.map(LN));return zN(e,t,a),r(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function zN(e,t,r){var n=t.filter(a=>!jN(a)).every(a=>r[a]!==void 0);if(!n){var i=t.filter(a=>r[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function jN(e){return e&&e[0]==="?"}function LN(e){return e&&e[0]==="?"?e.slice(1):e}function nr(e,t){if(ov(e)&&av(e,t))return e[t];throw typeof e[t]=="function"&&Ml(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function ha(e,t,r){if(ov(e)&&av(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function PN(e,t){return t in e}function av(e,t){return!e||typeof e!="object"?!1:Me(UN,t)?!0:!(t in Object.prototype||t in Function.prototype)}function VN(e,t){if(!Ml(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function Ml(e,t){return e==null||typeof e[t]!="function"||Me(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Me($N,t)?!0:!(t in Object.prototype||t in Function.prototype)}function ov(e){return typeof e=="object"&&e&&e.constructor===Object}var UN={length:!0,name:!0},$N={toString:!0,valueOf:!0,toLocaleString:!0};class xu{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return nr(this.wrappedObject,t)}set(t,r){return ha(this.wrappedObject,t,r),this}has(t){return PN(this.wrappedObject,t)}entries(){return uv(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}class sv{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return uv(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function uv(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function co(){return new Map}function ua(e){if(!e)return co();if(cv(e))return e;if(vu(e))return new xu(e);throw new Error("createMap can create maps from objects or Maps")}function HN(e){if(e instanceof xu)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);ha(t,r,n)}return t}function cv(e){return e?e instanceof Map||e instanceof xu||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var lv=function(){return lv=ia.create,ia},JN=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],GN=U("typed",JN,function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=lv();return a.clear(),a.addTypes([{name:"number",test:Ue},{name:"Complex",test:wn},{name:"BigNumber",test:$e},{name:"Fraction",test:Do},{name:"Unit",test:Cr},{name:"identifier",test:o=>Qt&&/^(?:[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(o)},{name:"string",test:Qt},{name:"Chain",test:Yg},{name:"Array",test:st},{name:"Matrix",test:ke},{name:"DenseMatrix",test:ks},{name:"SparseMatrix",test:Ni},{name:"Range",test:Cl},{name:"Index",test:gu},{name:"boolean",test:aN},{name:"ResultSet",test:oN},{name:"Help",test:Xg},{name:"function",test:sN},{name:"Date",test:uN},{name:"RegExp",test:cN},{name:"null",test:lN},{name:"undefined",test:fN},{name:"AccessorNode",test:Bi},{name:"ArrayNode",test:Sr},{name:"AssignmentNode",test:pN},{name:"BlockNode",test:mN},{name:"ConditionalNode",test:dN},{name:"ConstantNode",test:nt},{name:"FunctionNode",test:Zn},{name:"FunctionAssignmentNode",test:Eo},{name:"IndexNode",test:Sa},{name:"Node",test:ft},{name:"ObjectNode",test:yu},{name:"OperatorNode",test:Ct},{name:"ParenthesisNode",test:An},{name:"RangeNode",test:hN},{name:"RelationalNode",test:gN},{name:"SymbolNode",test:zt},{name:"Map",test:cv},{name:"Object",test:vu}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(o){if(t||pc(o),_N(o)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+o+"). Use function bignumber(x) to convert to BigNumber.");return new t(o)}},{from:"number",to:"Complex",convert:function(o){return r||Go(o),new r(o,0)}},{from:"BigNumber",to:"Complex",convert:function(o){return r||Go(o),new r(o.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(o){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(o){return r||Go(o),new r(o.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(o){i||mc(o);var u=new i(o);if(u.valueOf()!==o)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+o+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(o){var u=Number(o);if(isNaN(u))throw new Error('Cannot convert "'+o+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(o){t||pc(o);try{return new t(o)}catch{throw new Error('Cannot convert "'+o+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(o){i||mc(o);try{return new i(o)}catch{throw new Error('Cannot convert "'+o+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(o){r||Go(o);try{return new r(o)}catch{throw new Error('Cannot convert "'+o+'" to Complex')}}},{from:"boolean",to:"number",convert:function(o){return+o}},{from:"boolean",to:"BigNumber",convert:function(o){return t||pc(o),new t(+o)}},{from:"boolean",to:"Fraction",convert:function(o){return i||mc(o),new i(+o)}},{from:"boolean",to:"string",convert:function(o){return String(o)}},{from:"Array",to:"Matrix",convert:function(o){return n||KN(),new n(o)}},{from:"Matrix",to:"Array",convert:function(o){return o.valueOf()}}]),a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a});function pc(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Go(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function KN(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function mc(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var WN="ResultSet",QN=[],ZN=U(WN,QN,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});/*!
|
|
9
9
|
* decimal.js v10.4.3
|
|
10
10
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
11
11
|
* https://github.com/MikeMcl/decimal.js
|
|
12
12
|
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
13
13
|
* MIT Licence
|
|
14
|
-
*/var ra=9e15,ni=1e9,Bc="0123456789abcdef",Fs="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ts="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",kc={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ra,maxE:ra,crypto:!1},rv,bn,Le=!0,gu="[DecimalError] ",Xn=gu+"Invalid argument: ",nv=gu+"Precision limit exceeded",iv=gu+"crypto unavailable",av="[object Decimal]",Yt=Math.floor,Tt=Math.pow,UN=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$N=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,HN=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ov=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lr=1e7,Ie=7,JN=9007199254740991,GN=Fs.length-1,Ic=Ts.length-1,be={toStringTag:av};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Te(e)};be.ceil=function(){return Te(new this.constructor(this),this.e+1,2)};be.clampedTo=be.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Xn+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};be.comparedTo=be.cmp=function(e){var t,r,n,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!u)return!c||!l?NaN:c!==l?c:o===u?0:!o^c<0?1:-1;if(!o[0]||!u[0])return o[0]?c:u[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(n=o.length,i=u.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==u[t])return o[t]>u[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};be.cosine=be.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=WN(n,fv(n,r)),n.precision=e,n.rounding=t,Te(bn==2||bn==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};be.cubeRoot=be.cbrt=function(){var e,t,r,n,i,a,o,u,c,l,s=this,f=s.constructor;if(!s.isFinite()||s.isZero())return new f(s);for(Le=!1,a=s.s*Tt(s.s*s,1/3),!a||Math.abs(a)==1/0?(r=Vt(s.d),e=s.e,(a=(e-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Tt(r,1/3),e=Yt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?r="5e"+e:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=s.s):n=new f(a.toString()),o=(e=f.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(s),n=bt(l.plus(s).times(u),l.plus(c),o+2,1),Vt(u.d).slice(0,o)===(r=Vt(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(Te(u,e+1,0),u.times(u).times(u).eq(s))){n=u;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Te(n,e+1,1),t=!n.times(n).times(n).eq(s));break}return Le=!0,Te(n,e,f.rounding,t)};be.decimalPlaces=be.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Yt(this.e/Ie))*Ie,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};be.dividedBy=be.div=function(e){return bt(this,new this.constructor(e))};be.dividedToIntegerBy=be.divToInt=function(e){var t=this,r=t.constructor;return Te(bt(t,new r(e),0,1,1),r.precision,r.rounding)};be.equals=be.eq=function(e){return this.cmp(e)===0};be.floor=function(){return Te(new this.constructor(this),this.e+1,3)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){var t=this.cmp(e);return t==1||t===0};be.hyperbolicCosine=be.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/yu(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=ma(o,1,a.times(t),new o(1),!0);for(var c,l=e,s=new o(8);l--;)c=a.times(a),a=u.minus(c.times(s.minus(c.times(s))));return Te(a,o.precision=r,o.rounding=n,!0)};be.hyperbolicSine=be.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=ma(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/yu(5,e)),i=ma(a,2,i,i,!0);for(var o,u=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=r,Te(i,t,r,!0)};be.hyperbolicTangent=be.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,bt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};be.inverseCosine=be.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return n!==-1?n===0?t.isNeg()?zr(r,i,a):new r(0):new r(NaN):t.isZero()?zr(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=zr(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))};be.inverseHyperbolicCosine=be.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,Le=!1,r=r.times(r).minus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};be.inverseHyperbolicSine=be.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,Le=!1,r=r.times(r).plus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln())};be.inverseHyperbolicTangent=be.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Te(new a(i),e,t,!0):(a.precision=r=n-i.e,i=bt(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)};be.inverseSine=be.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,t!==-1?t===0?(e=zr(a,r+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};be.inverseTangent=be.atan=function(){var e,t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding;if(l.isFinite()){if(l.isZero())return new s(l);if(l.abs().eq(1)&&f+4<=Ic)return o=zr(s,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new s(NaN);if(f+4<=Ic)return o=zr(s,f+4,p).times(.5),o.s=l.s,o}for(s.precision=u=f+10,s.rounding=1,r=Math.min(28,u/Ie+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Le=!1,t=Math.ceil(u/Ie),n=1,c=l.times(l),o=new s(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(n+=2)),i=i.times(c),o=a.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),Le=!0,Te(o,s.precision=f,s.rounding=p,!0)};be.isFinite=function(){return!!this.d};be.isInteger=be.isInt=function(){return!!this.d&&Yt(this.e/Ie)>this.d.length-2};be.isNaN=function(){return!this.s};be.isNegative=be.isNeg=function(){return this.s<0};be.isPositive=be.isPos=function(){return this.s>0};be.isZero=function(){return!!this.d&&this.d[0]===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding,m=5;if(e==null)e=new s(10),t=!0;else{if(e=new s(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new s(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new s(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(Le=!1,u=f+m,o=Kn(l,u),n=t?Os(s,u+10):Kn(e,u),c=bt(o,n,u,1),oo(c.d,i=f,p))do if(u+=10,o=Kn(l,u),n=t?Os(s,u+10):Kn(e,u),c=bt(o,n,u,1),!a){+Vt(c.d).slice(i+1,i+15)+1==1e14&&(c=Te(c,f+1,0));break}while(oo(c.d,i+=10,p));return Le=!0,Te(c,f,p)};be.minus=be.sub=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return!m.s||!e.s?e=new d(NaN):m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(l=m.d,p=e.d,u=d.precision,c=d.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new d(m);else return new d(c===3?-0:0);return Le?Te(e,u,c):e}if(r=Yt(e.e/Ie),s=Yt(m.e/Ie),l=l.slice(),a=s-r,a){for(f=a<0,f?(t=l,a=-a,o=p.length):(t=p,r=s,o=l.length),n=Math.max(Math.ceil(u/Ie),o)+2,a>n&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}a=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>a;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Lr-1;--l[i],l[n]+=Lr}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=vu(l,r),Le?Te(e,u,c):e):new d(c===3?-0:0)};be.modulo=be.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?Te(new n(r),n.precision,n.rounding):(Le=!1,n.modulo==9?(t=bt(r,e.abs(),0,3,1),t.s*=e.s):t=bt(r,e,0,n.modulo,1),t=t.times(e),Le=!0,r.minus(t))};be.naturalExponential=be.exp=function(){return Rc(this)};be.naturalLogarithm=be.ln=function(){return Kn(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Te(e)};be.plus=be.add=function(e){var t,r,n,i,a,o,u,c,l,s,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,s=e.d,u=p.precision,c=p.rounding,!l[0]||!s[0])return s[0]||(e=new p(f)),Le?Te(e,u,c):e;if(a=Yt(f.e/Ie),n=Yt(e.e/Ie),l=l.slice(),i=a-n,i){for(i<0?(r=l,i=-i,o=s.length):(r=s,n=a,o=l.length),a=Math.ceil(u/Ie),o=a>o?a+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=s.length,o-i<0&&(i=o,r=s,s=l,l=r),t=0;i;)t=(l[--i]=l[i]+s[i]+t)/Lr|0,l[i]%=Lr;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=vu(l,n),Le?Te(e,u,c):e};be.precision=be.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xn+e);return r.d?(t=sv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};be.round=function(){var e=this,t=e.constructor;return Te(new t(e),e.e+1,t.rounding)};be.sine=be.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=QN(n,fv(n,r)),n.precision=e,n.rounding=t,Te(bn>2?r.neg():r,e,t,!0)):new n(NaN)};be.squareRoot=be.sqrt=function(){var e,t,r,n,i,a,o=this,u=o.d,c=o.e,l=o.s,s=o.constructor;if(l!==1||!u||!u[0])return new s(!l||l<0&&(!u||u[0])?NaN:u?o:1/0);for(Le=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Vt(u),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Yt((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new s(t)):n=new s(l.toString()),r=(c=s.precision)+3;;)if(a=n,n=a.plus(bt(o,a,r+2,1)).times(.5),Vt(a.d).slice(0,r)===(t=Vt(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(Te(a,c+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Te(n,c+1,1),e=!n.times(n).eq(o));break}return Le=!0,Te(n,c,s.rounding,e)};be.tangent=be.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=bt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Te(bn==2||bn==4?r.neg():r,e,t,!0)):new n(NaN)};be.times=be.mul=function(e){var t,r,n,i,a,o,u,c,l,s=this,f=s.constructor,p=s.d,m=(e=new f(e)).d;if(e.s*=s.s,!p||!p[0]||!m||!m[0])return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:!p||!m?e.s/0:e.s*0);for(r=Yt(s.e/Ie)+Yt(e.e/Ie),c=p.length,l=m.length,c<l&&(a=p,p=m,m=a,o=c,c=l,l=o),a=[],o=c+l,n=o;n--;)a.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)u=a[i]+m[n]*p[i-n-1]+t,a[i--]=u%Lr|0,t=u/Lr|0;a[i]=(a[i]+t)%Lr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=vu(a,r),Le?Te(e,f.precision,f.rounding):e};be.toBinary=function(e,t){return Dl(this,2,e,t)};be.toDecimalPlaces=be.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(gr(e,0,ni),t===void 0?t=n.rounding:gr(t,0,8),Te(r,e+r.e+1,t))};be.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,!0):(gr(e,0,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e+1,t),r=on(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};be.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?r=on(i):(gr(e,0,ni),t===void 0?t=a.rounding:gr(t,0,8),n=Te(new a(i),e+i.e+1,t),r=on(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};be.toFraction=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.d,h=m.constructor;if(!d)return new h(m);if(l=r=new h(1),n=c=new h(0),t=new h(n),a=t.e=sv(d)-m.e-1,o=a%Ie,t.d[0]=Tt(10,o<0?Ie+o:o),e==null)e=a>0?t:l;else{if(u=new h(e),!u.isInt()||u.lt(l))throw Error(Xn+u);e=u.gt(t)?a>0?t:l:u}for(Le=!1,u=new h(Vt(d)),s=h.precision,h.precision=a=d.length*Ie*2;f=bt(u,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=u.minus(f.times(i)),u=i;return i=bt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=m.s,p=bt(l,n,a,1).minus(m).abs().cmp(bt(c,r,a,1).minus(m).abs())<1?[l,n]:[c,r],h.precision=s,Le=!0,p};be.toHexadecimal=be.toHex=function(e,t){return Dl(this,16,e,t)};be.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:gr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(Le=!1,r=bt(r,e,0,t,1).times(e),Le=!0,Te(r)):(e.s=r.s,r=e),r};be.toNumber=function(){return+this};be.toOctal=function(e,t){return Dl(this,8,e,t)};be.toPower=be.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,l=+(e=new c(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new c(Tt(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,a=c.rounding,e.eq(1))return Te(u,n,a);if(t=Yt(e.e/Ie),t>=e.d.length-1&&(r=l<0?-l:l)<=JN)return i=uv(c,u,r,n),e.s<0?new c(1).div(i):Te(i,n,a);if(o=u.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return r=Tt(+u,l),t=r==0||!isFinite(r)?Yt(l*(Math.log("0."+Vt(u.d))/Math.LN10+u.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(Le=!1,c.rounding=u.s=1,r=Math.min(12,(t+"").length),i=Rc(e.times(Kn(u,n+r)),n),i.d&&(i=Te(i,n+5,1),oo(i.d,n,a)&&(t=n+10,i=Te(Rc(e.times(Kn(u,t+r)),t),t+5,1),+Vt(i.d).slice(n+1,n+15)+1==1e14&&(i=Te(i,n+1,0)))),i.s=o,Le=!0,c.rounding=a,Te(i,n,a))};be.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(gr(e,1,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e,t),r=on(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};be.toSignificantDigits=be.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(gr(e,1,ni),t===void 0?t=n.rounding:gr(t,0,8)),Te(new n(r),e,t)};be.toString=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};be.truncated=be.trunc=function(){return Te(new this.constructor(this),this.e+1,1)};be.valueOf=be.toJSON=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",r=Ie-n.length,r&&(a+=Pn(r)),a+=n;o=e[t],n=o+"",r=Ie-n.length,r&&(a+=Pn(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function gr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xn+e)}function oo(e,t,r,n){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=Ie,i=0):(i=Math.ceil((t+1)/Ie),t%=Ie),a=Tt(10,Ie-t),u=e[i]%a|0,n==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):o=(r<4&&u+1==a||r>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Tt(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(n||r<4)&&u==9999||!n&&r>3&&u==4999):o=((n||r<4)&&u+1==a||!n&&r>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Tt(10,t-3)-1,o}function vs(e,t,r){for(var n,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Bc.indexOf(e.charAt(o++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function WN(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/yu(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ma(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var bt=function(){function e(n,i,a){var o,u=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+u,n[c]=o%a|0,u=o/a|0;return u&&n.unshift(u),n}function t(n,i,a,o){var u,c;if(a!=o)c=a>o?1:-1;else for(u=c=0;u<a;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}function r(n,i,a,o){for(var u=0;a--;)n[a]-=u,u=n[a]<i[a]?1:0,n[a]=u*o+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o,u,c){var l,s,f,p,m,d,h,w,v,x,g,b,y,N,E,A,D,S,C,_,R=n.constructor,P=n.s==i.s?1:-1,I=n.d,O=i.d;if(!I||!I[0]||!O||!O[0])return new R(!n.s||!i.s||(I?O&&I[0]==O[0]:!O)?NaN:I&&I[0]==0||!O?P*0:P/0);for(c?(m=1,s=n.e-i.e):(c=Lr,m=Ie,s=Yt(n.e/m)-Yt(i.e/m)),C=O.length,D=I.length,v=new R(P),x=v.d=[],f=0;O[f]==(I[f]||0);f++);if(O[f]>(I[f]||0)&&s--,a==null?(N=a=R.precision,o=R.rounding):u?N=a+(n.e-i.e)+1:N=a,N<0)x.push(1),d=!0;else{if(N=N/m+2|0,f=0,C==1){for(p=0,O=O[0],N++;(f<D||p)&&N--;f++)E=p*c+(I[f]||0),x[f]=E/O|0,p=E%O|0;d=p||f<D}else{for(p=c/(O[0]+1)|0,p>1&&(O=e(O,p,c),I=e(I,p,c),C=O.length,D=I.length),A=C,g=I.slice(0,C),b=g.length;b<C;)g[b++]=0;_=O.slice(),_.unshift(0),S=O[0],O[1]>=c/2&&++S;do p=0,l=t(O,g,C,b),l<0?(y=g[0],C!=b&&(y=y*c+(g[1]||0)),p=y/S|0,p>1?(p>=c&&(p=c-1),h=e(O,p,c),w=h.length,b=g.length,l=t(h,g,w,b),l==1&&(p--,r(h,C<w?_:O,w,c))):(p==0&&(l=p=1),h=O.slice()),w=h.length,w<b&&h.unshift(0),r(g,h,b,c),l==-1&&(b=g.length,l=t(O,g,C,b),l<1&&(p++,r(g,C<b?_:O,b,c))),b=g.length):l===0&&(p++,g=[0]),x[f++]=p,l&&g[0]?g[b++]=I[A]||0:(g=[I[A]],b=1);while((A++<D||g[0]!==void 0)&&N--);d=g[0]!==void 0}x[0]||x.shift()}if(m==1)v.e=s,rv=d;else{for(f=1,p=x[0];p>=10;p/=10)f++;v.e=f+s*m-1,Te(v,u?a+v.e+1:a,o,d)}return v}}();function Te(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=Ie,o=t,s=f[p=0],c=s/Tt(10,i-o-1)%10|0;else if(p=Math.ceil((a+1)/Ie),u=f.length,p>=u)if(n){for(;u++<=p;)f.push(0);s=c=0,i=1,a%=Ie,o=a-Ie+1}else break e;else{for(s=u=f[p],i=1;u>=10;u/=10)i++;a%=Ie,o=a-Ie+i,c=o<0?0:s/Tt(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?s:s%Tt(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(a>0?o>0?s/Tt(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=Tt(10,(Ie-t%Ie)%Ie),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=p,u=1,p--):(f.length=p+1,u=Tt(10,Ie-a),f[p]=o>0?(s/Tt(10,i-o)%Tt(10,o)|0)*u:0),l)for(;;)if(p==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==Lr&&(f[0]=1));break}else{if(f[p]+=u,f[p]!=Lr)break;f[p--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Le&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function on(e,t,r){if(!e.isFinite())return lv(e);var n,i=e.e,a=Vt(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Pn(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Pn(-i-1)+a,r&&(n=r-o)>0&&(a+=Pn(n))):i>=o?(a+=Pn(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Pn(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Pn(n))),a}function vu(e,t){var r=e[0];for(t*=Ie;r>=10;r/=10)t++;return t}function Os(e,t,r){if(t>GN)throw Le=!0,r&&(e.precision=r),Error(nv);return Te(new e(Fs),t,1,!0)}function zr(e,t,r){if(t>Ic)throw Error(nv);return Te(new e(Ts),t,r,!0)}function sv(e){var t=e.length-1,r=t*Ie+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Pn(e){for(var t="";e--;)t+="0";return t}function uv(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/Ie+4);for(Le=!1;;){if(r%2&&(a=a.times(t),Zf(a.d,o)&&(i=!0)),r=Yt(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}t=t.times(t),Zf(t.d,o)}return Le=!0,a}function Qf(e){return e.d[e.d.length-1]&1}function cv(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;)if(n=new e(t[a]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function Rc(e,t){var r,n,i,a,o,u,c,l=0,s=0,f=0,p=e.constructor,m=p.rounding,d=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Le=!1,c=d):c=t,u=new p(.03125);e.e>-2;)e=e.times(u),f+=5;for(n=Math.log(Tt(2,f))/Math.LN10*2+5|0,c+=n,r=a=o=new p(1),p.precision=c;;){if(a=Te(a.times(e),c,1),r=r.times(++s),u=o.plus(bt(a,r,c,1)),Vt(u.d).slice(0,c)===Vt(o.d).slice(0,c)){for(i=f;i--;)o=Te(o.times(o),c,1);if(t==null)if(l<3&&oo(o.d,c-n,m,l))p.precision=c+=10,r=a=u=new p(1),s=0,l++;else return Te(o,p.precision=d,m,Le=!0);else return p.precision=d,o}o=u}}function Kn(e,t){var r,n,i,a,o,u,c,l,s,f,p,m=1,d=10,h=e,w=h.d,v=h.constructor,x=v.rounding,g=v.precision;if(h.s<0||!w||!w[0]||!h.e&&w[0]==1&&w.length==1)return new v(w&&!w[0]?-1/0:h.s!=1?NaN:w?0:h);if(t==null?(Le=!1,s=g):s=t,v.precision=s+=d,r=Vt(w),n=r.charAt(0),Math.abs(a=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Vt(h.d),n=r.charAt(0),m++;a=h.e,n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=Os(v,s+2,g).times(a+""),h=Kn(new v(n+"."+r.slice(1)),s-d).plus(l),v.precision=g,t==null?Te(h,g,x,Le=!0):h;for(f=h,c=o=h=bt(h.minus(1),h.plus(1),s,1),p=Te(h.times(h),s,1),i=3;;){if(o=Te(o.times(p),s,1),l=c.plus(bt(o,new v(i),s,1)),Vt(l.d).slice(0,s)===Vt(c.d).slice(0,s))if(c=c.times(2),a!==0&&(c=c.plus(Os(v,s+2,g).times(a+""))),c=bt(c,new v(m),s,1),t==null)if(oo(c.d,s-d,x,u))v.precision=s+=d,l=o=h=bt(f.minus(1),f.plus(1),s,1),p=Te(h.times(h),s,1),i=u=1;else return Te(c,v.precision=g,x,Le=!0);else return v.precision=g,c;c=l,i+=2}}function lv(e){return String(e.s*e.s/0)}function qc(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Ie,r<0&&(n+=Ie),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Ie;n<i;)e.d.push(+t.slice(n,n+=Ie));t=t.slice(n),n=Ie-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),Le&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function KN(e,t){var r,n,i,a,o,u,c,l,s;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ov.test(t))return qc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if($N.test(t))r=16,t=t.toLowerCase();else if(UN.test(t))r=2;else if(HN.test(t))r=8;else throw Error(Xn+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,n=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=uv(n,new n(r),a,a*2)),l=vs(t,r,Lr),s=l.length-1,a=s;l[a]===0;--a)l.pop();return a<0?new n(e.s*0):(e.e=vu(l,s),e.d=l,Le=!1,o&&(e=bt(e,i,u*4)),c&&(e=e.times(Math.abs(c)<54?Tt(2,c):Yn.pow(2,c))),Le=!0,e)}function QN(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ma(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/yu(5,r)),t=ma(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function ma(e,t,r,n,i){var a,o,u,c,l=e.precision,s=Math.ceil(l/Ie);for(Le=!1,c=r.times(r),u=new e(n);;){if(o=bt(u.times(c),new e(t++*t++),l,1),u=i?n.plus(o):n.minus(o),n=bt(o.times(c),new e(t++*t++),l,1),o=u.plus(n),o.d[s]!==void 0){for(a=s;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=n,n=o,o=a}return Le=!0,o.d.length=s+1,o}function yu(e,t){for(var r=e;--t;)r*=e;return r}function fv(e,t){var r,n=t.s<0,i=zr(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return bn=n?4:1,t;if(r=t.divToInt(i),r.isZero())bn=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(a))return bn=Qf(r)?n?2:3:n?4:1,t;bn=Qf(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Dl(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor,d=r!==void 0;if(d?(gr(r,1,ni),n===void 0?n=m.rounding:gr(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())s=lv(e);else{for(s=on(e),o=s.indexOf("."),d?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(s=s.replace(".",""),p=new m(1),p.e=s.length-o,p.d=vs(on(p),10,i),p.e=p.d.length),f=vs(s,10,i),a=c=f.length;f[--c]==0;)f.pop();if(!f[0])s=d?"0p+0":"0";else{if(o<0?a--:(e=new m(e),e.d=f,e.e=a,e=bt(e,p,r,n,0,i),f=e.d,a=e.e,l=rv),o=f[r],u=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>u||o===u&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,s="";o<c;o++)s+=Bc.charAt(f[o]);if(d){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)s+="0";for(f=vs(s,i,t),c=f.length;!f[c-1];--c);for(o=1,s="1.";o<c;o++)s+=Bc.charAt(f[o])}else s=s.charAt(0)+"."+s.slice(1);s=s+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)s="0"+s;s="0."+s}else if(++a>c)for(a-=c;a--;)s+="0";else a<c&&(s=s.slice(0,a)+"."+s.slice(a))}s=(t==16?"0x":t==2?"0b":t==8?"0o":"")+s}return e.s<0?"-"+s:s}function Zf(e,t){if(e.length>t)return e.length=t,!0}function ZN(e){return new this(e).abs()}function XN(e){return new this(e).acos()}function YN(e){return new this(e).acosh()}function e2(e,t){return new this(e).plus(t)}function t2(e){return new this(e).asin()}function r2(e){return new this(e).asinh()}function n2(e){return new this(e).atan()}function i2(e){return new this(e).atanh()}function a2(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=zr(this,a,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?zr(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=zr(this,a,1).times(.5),r.s=e.s):t.s<0?(this.precision=a,this.rounding=1,r=this.atan(bt(e,t,a,1)),t=zr(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(bt(e,t,a,1)),r}function o2(e){return new this(e).cbrt()}function s2(e){return Te(e=new this(e),e.e+1,2)}function u2(e,t,r){return new this(e).clamp(t,r)}function c2(e){if(!e||typeof e!="object")throw Error(gu+"Object expected");var t,r,n,i=e.defaults===!0,a=["precision",1,ni,"rounding",0,8,"toExpNeg",-ra,0,"toExpPos",0,ra,"maxE",0,ra,"minE",-ra,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=kc[r]),(n=e[r])!==void 0)if(Yt(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Xn+r+": "+n);if(r="crypto",i&&(this[r]=kc[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(iv);else this[r]=!1;else throw Error(Xn+r+": "+n);return this}function l2(e){return new this(e).cos()}function f2(e){return new this(e).cosh()}function pv(e){var t,r,n;function i(a){var o,u,c,l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,Xf(a)){l.s=a.s,Le?!a.d||a.e>i.maxE?(l.e=NaN,l.d=null):a.e<i.minE?(l.e=0,l.d=[0]):(l.e=a.e,l.d=a.d.slice()):(l.e=a.e,l.d=a.d?a.d.slice():a.d);return}if(c=typeof a,c==="number"){if(a===0){l.s=1/a<0?-1:1,l.e=0,l.d=[0];return}if(a<0?(a=-a,l.s=-1):l.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Le?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[a]):(l.e=o,l.d=[a]);return}else if(a*0!==0){a||(l.s=NaN),l.e=NaN,l.d=null;return}return qc(l,a.toString())}else if(c!=="string")throw Error(Xn+a);return(u=a.charCodeAt(0))===45?(a=a.slice(1),l.s=-1):(u===43&&(a=a.slice(1)),l.s=1),ov.test(a)?qc(l,a):KN(l,a)}if(i.prototype=be,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=c2,i.clone=pv,i.isDecimal=Xf,i.abs=ZN,i.acos=XN,i.acosh=YN,i.add=e2,i.asin=t2,i.asinh=r2,i.atan=n2,i.atanh=i2,i.atan2=a2,i.cbrt=o2,i.ceil=s2,i.clamp=u2,i.cos=l2,i.cosh=f2,i.div=p2,i.exp=m2,i.floor=d2,i.hypot=h2,i.ln=g2,i.log=v2,i.log10=b2,i.log2=y2,i.max=x2,i.min=w2,i.mod=N2,i.mul=D2,i.pow=E2,i.random=A2,i.round=S2,i.sign=C2,i.sin=M2,i.sinh=_2,i.sqrt=F2,i.sub=T2,i.sum=O2,i.tan=B2,i.tanh=k2,i.trunc=I2,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function p2(e,t){return new this(e).div(t)}function m2(e){return new this(e).exp()}function d2(e){return Te(e=new this(e),e.e+1,3)}function h2(){var e,t,r=new this(0);for(Le=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return Le=!0,new this(1/0);r=t}return Le=!0,r.sqrt()}function Xf(e){return e instanceof Yn||e&&e.toStringTag===av||!1}function g2(e){return new this(e).ln()}function v2(e,t){return new this(e).log(t)}function y2(e){return new this(e).log(2)}function b2(e){return new this(e).log(10)}function x2(){return cv(this,arguments,"lt")}function w2(){return cv(this,arguments,"gt")}function N2(e,t){return new this(e).mod(t)}function D2(e,t){return new this(e).mul(t)}function E2(e,t){return new this(e).pow(t)}function A2(e){var t,r,n,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:gr(e,1,ni),n=Math.ceil(e/Ie),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);a<n;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=n/4}else throw Error(iv);else for(;a<n;)u[a++]=Math.random()*1e7|0;for(n=u[--a],e%=Ie,n&&e&&(i=Tt(10,Ie-e),u[a]=(n/i|0)*i);u[a]===0;a--)u.pop();if(a<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=Ie)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Ie&&(r-=Ie-n)}return o.e=r,o.d=u,o}function S2(e){return Te(e=new this(e),e.e+1,this.rounding)}function C2(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function M2(e){return new this(e).sin()}function _2(e){return new this(e).sinh()}function F2(e){return new this(e).sqrt()}function T2(e,t){return new this(e).sub(t)}function O2(){var e=0,t=arguments,r=new this(t[e]);for(Le=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return Le=!0,Te(r,this.precision,this.rounding)}function B2(e){return new this(e).tan()}function k2(e){return new this(e).tanh()}function I2(e){return Te(e=new this(e),e.e+1,1)}be[Symbol.for("nodejs.util.inspect.custom")]=be.toString;be[Symbol.toStringTag]="Decimal";var Yn=be.constructor=pv(kc);Fs=new Yn(Fs);Ts=new Yn(Ts);var R2="BigNumber",q2=["?on","config"],z2=U(R2,q2,e=>{var{on:t,config:r}=e,n=Yn.clone({precision:r.precision,modulo:Yn.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function No(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j2(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var mv={exports:{}};/**
|
|
14
|
+
*/var aa=9e15,ni=1e9,zc="0123456789abcdef",Is="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Rs="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",jc={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-aa,maxE:aa,crypto:!1},fv,bn,Le=!0,wu="[DecimalError] ",Xn=wu+"Invalid argument: ",pv=wu+"Precision limit exceeded",mv=wu+"crypto unavailable",dv="[object Decimal]",Yt=Math.floor,Tt=Math.pow,XN=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,YN=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,e2=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,hv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lr=1e7,Ie=7,t2=9007199254740991,r2=Is.length-1,Lc=Rs.length-1,be={toStringTag:dv};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Te(e)};be.ceil=function(){return Te(new this.constructor(this),this.e+1,2)};be.clampedTo=be.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Xn+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};be.comparedTo=be.cmp=function(e){var t,r,n,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!u)return!c||!l?NaN:c!==l?c:o===u?0:!o^c<0?1:-1;if(!o[0]||!u[0])return o[0]?c:u[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(n=o.length,i=u.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==u[t])return o[t]>u[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};be.cosine=be.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=n2(n,xv(n,r)),n.precision=e,n.rounding=t,Te(bn==2||bn==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};be.cubeRoot=be.cbrt=function(){var e,t,r,n,i,a,o,u,c,l,s=this,f=s.constructor;if(!s.isFinite()||s.isZero())return new f(s);for(Le=!1,a=s.s*Tt(s.s*s,1/3),!a||Math.abs(a)==1/0?(r=Vt(s.d),e=s.e,(a=(e-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Tt(r,1/3),e=Yt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?r="5e"+e:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=s.s):n=new f(a.toString()),o=(e=f.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(s),n=bt(l.plus(s).times(u),l.plus(c),o+2,1),Vt(u.d).slice(0,o)===(r=Vt(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(Te(u,e+1,0),u.times(u).times(u).eq(s))){n=u;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Te(n,e+1,1),t=!n.times(n).times(n).eq(s));break}return Le=!0,Te(n,e,f.rounding,t)};be.decimalPlaces=be.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Yt(this.e/Ie))*Ie,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};be.dividedBy=be.div=function(e){return bt(this,new this.constructor(e))};be.dividedToIntegerBy=be.divToInt=function(e){var t=this,r=t.constructor;return Te(bt(t,new r(e),0,1,1),r.precision,r.rounding)};be.equals=be.eq=function(e){return this.cmp(e)===0};be.floor=function(){return Te(new this.constructor(this),this.e+1,3)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){var t=this.cmp(e);return t==1||t===0};be.hyperbolicCosine=be.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/Du(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=ga(o,1,a.times(t),new o(1),!0);for(var c,l=e,s=new o(8);l--;)c=a.times(a),a=u.minus(c.times(s.minus(c.times(s))));return Te(a,o.precision=r,o.rounding=n,!0)};be.hyperbolicSine=be.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=ga(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Du(5,e)),i=ga(a,2,i,i,!0);for(var o,u=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=r,Te(i,t,r,!0)};be.hyperbolicTangent=be.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,bt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};be.inverseCosine=be.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return n!==-1?n===0?t.isNeg()?zr(r,i,a):new r(0):new r(NaN):t.isZero()?zr(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=zr(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))};be.inverseHyperbolicCosine=be.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,Le=!1,r=r.times(r).minus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};be.inverseHyperbolicSine=be.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,Le=!1,r=r.times(r).plus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln())};be.inverseHyperbolicTangent=be.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Te(new a(i),e,t,!0):(a.precision=r=n-i.e,i=bt(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)};be.inverseSine=be.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,t!==-1?t===0?(e=zr(a,r+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};be.inverseTangent=be.atan=function(){var e,t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding;if(l.isFinite()){if(l.isZero())return new s(l);if(l.abs().eq(1)&&f+4<=Lc)return o=zr(s,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new s(NaN);if(f+4<=Lc)return o=zr(s,f+4,p).times(.5),o.s=l.s,o}for(s.precision=u=f+10,s.rounding=1,r=Math.min(28,u/Ie+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Le=!1,t=Math.ceil(u/Ie),n=1,c=l.times(l),o=new s(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(n+=2)),i=i.times(c),o=a.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),Le=!0,Te(o,s.precision=f,s.rounding=p,!0)};be.isFinite=function(){return!!this.d};be.isInteger=be.isInt=function(){return!!this.d&&Yt(this.e/Ie)>this.d.length-2};be.isNaN=function(){return!this.s};be.isNegative=be.isNeg=function(){return this.s<0};be.isPositive=be.isPos=function(){return this.s>0};be.isZero=function(){return!!this.d&&this.d[0]===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding,m=5;if(e==null)e=new s(10),t=!0;else{if(e=new s(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new s(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new s(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(Le=!1,u=f+m,o=Wn(l,u),n=t?qs(s,u+10):Wn(e,u),c=bt(o,n,u,1),lo(c.d,i=f,p))do if(u+=10,o=Wn(l,u),n=t?qs(s,u+10):Wn(e,u),c=bt(o,n,u,1),!a){+Vt(c.d).slice(i+1,i+15)+1==1e14&&(c=Te(c,f+1,0));break}while(lo(c.d,i+=10,p));return Le=!0,Te(c,f,p)};be.minus=be.sub=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return!m.s||!e.s?e=new d(NaN):m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(l=m.d,p=e.d,u=d.precision,c=d.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new d(m);else return new d(c===3?-0:0);return Le?Te(e,u,c):e}if(r=Yt(e.e/Ie),s=Yt(m.e/Ie),l=l.slice(),a=s-r,a){for(f=a<0,f?(t=l,a=-a,o=p.length):(t=p,r=s,o=l.length),n=Math.max(Math.ceil(u/Ie),o)+2,a>n&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}a=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>a;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Lr-1;--l[i],l[n]+=Lr}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=Nu(l,r),Le?Te(e,u,c):e):new d(c===3?-0:0)};be.modulo=be.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?Te(new n(r),n.precision,n.rounding):(Le=!1,n.modulo==9?(t=bt(r,e.abs(),0,3,1),t.s*=e.s):t=bt(r,e,0,n.modulo,1),t=t.times(e),Le=!0,r.minus(t))};be.naturalExponential=be.exp=function(){return Pc(this)};be.naturalLogarithm=be.ln=function(){return Wn(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Te(e)};be.plus=be.add=function(e){var t,r,n,i,a,o,u,c,l,s,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,s=e.d,u=p.precision,c=p.rounding,!l[0]||!s[0])return s[0]||(e=new p(f)),Le?Te(e,u,c):e;if(a=Yt(f.e/Ie),n=Yt(e.e/Ie),l=l.slice(),i=a-n,i){for(i<0?(r=l,i=-i,o=s.length):(r=s,n=a,o=l.length),a=Math.ceil(u/Ie),o=a>o?a+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=s.length,o-i<0&&(i=o,r=s,s=l,l=r),t=0;i;)t=(l[--i]=l[i]+s[i]+t)/Lr|0,l[i]%=Lr;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=Nu(l,n),Le?Te(e,u,c):e};be.precision=be.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xn+e);return r.d?(t=gv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};be.round=function(){var e=this,t=e.constructor;return Te(new t(e),e.e+1,t.rounding)};be.sine=be.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=a2(n,xv(n,r)),n.precision=e,n.rounding=t,Te(bn>2?r.neg():r,e,t,!0)):new n(NaN)};be.squareRoot=be.sqrt=function(){var e,t,r,n,i,a,o=this,u=o.d,c=o.e,l=o.s,s=o.constructor;if(l!==1||!u||!u[0])return new s(!l||l<0&&(!u||u[0])?NaN:u?o:1/0);for(Le=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Vt(u),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Yt((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new s(t)):n=new s(l.toString()),r=(c=s.precision)+3;;)if(a=n,n=a.plus(bt(o,a,r+2,1)).times(.5),Vt(a.d).slice(0,r)===(t=Vt(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(Te(a,c+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Te(n,c+1,1),e=!n.times(n).eq(o));break}return Le=!0,Te(n,c,s.rounding,e)};be.tangent=be.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=bt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Te(bn==2||bn==4?r.neg():r,e,t,!0)):new n(NaN)};be.times=be.mul=function(e){var t,r,n,i,a,o,u,c,l,s=this,f=s.constructor,p=s.d,m=(e=new f(e)).d;if(e.s*=s.s,!p||!p[0]||!m||!m[0])return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:!p||!m?e.s/0:e.s*0);for(r=Yt(s.e/Ie)+Yt(e.e/Ie),c=p.length,l=m.length,c<l&&(a=p,p=m,m=a,o=c,c=l,l=o),a=[],o=c+l,n=o;n--;)a.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)u=a[i]+m[n]*p[i-n-1]+t,a[i--]=u%Lr|0,t=u/Lr|0;a[i]=(a[i]+t)%Lr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=Nu(a,r),Le?Te(e,f.precision,f.rounding):e};be.toBinary=function(e,t){return _l(this,2,e,t)};be.toDecimalPlaces=be.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(gr(e,0,ni),t===void 0?t=n.rounding:gr(t,0,8),Te(r,e+r.e+1,t))};be.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,!0):(gr(e,0,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e+1,t),r=on(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};be.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?r=on(i):(gr(e,0,ni),t===void 0?t=a.rounding:gr(t,0,8),n=Te(new a(i),e+i.e+1,t),r=on(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};be.toFraction=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.d,h=m.constructor;if(!d)return new h(m);if(l=r=new h(1),n=c=new h(0),t=new h(n),a=t.e=gv(d)-m.e-1,o=a%Ie,t.d[0]=Tt(10,o<0?Ie+o:o),e==null)e=a>0?t:l;else{if(u=new h(e),!u.isInt()||u.lt(l))throw Error(Xn+u);e=u.gt(t)?a>0?t:l:u}for(Le=!1,u=new h(Vt(d)),s=h.precision,h.precision=a=d.length*Ie*2;f=bt(u,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=u.minus(f.times(i)),u=i;return i=bt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=m.s,p=bt(l,n,a,1).minus(m).abs().cmp(bt(c,r,a,1).minus(m).abs())<1?[l,n]:[c,r],h.precision=s,Le=!0,p};be.toHexadecimal=be.toHex=function(e,t){return _l(this,16,e,t)};be.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:gr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(Le=!1,r=bt(r,e,0,t,1).times(e),Le=!0,Te(r)):(e.s=r.s,r=e),r};be.toNumber=function(){return+this};be.toOctal=function(e,t){return _l(this,8,e,t)};be.toPower=be.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,l=+(e=new c(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new c(Tt(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,a=c.rounding,e.eq(1))return Te(u,n,a);if(t=Yt(e.e/Ie),t>=e.d.length-1&&(r=l<0?-l:l)<=t2)return i=vv(c,u,r,n),e.s<0?new c(1).div(i):Te(i,n,a);if(o=u.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return r=Tt(+u,l),t=r==0||!isFinite(r)?Yt(l*(Math.log("0."+Vt(u.d))/Math.LN10+u.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(Le=!1,c.rounding=u.s=1,r=Math.min(12,(t+"").length),i=Pc(e.times(Wn(u,n+r)),n),i.d&&(i=Te(i,n+5,1),lo(i.d,n,a)&&(t=n+10,i=Te(Pc(e.times(Wn(u,t+r)),t),t+5,1),+Vt(i.d).slice(n+1,n+15)+1==1e14&&(i=Te(i,n+1,0)))),i.s=o,Le=!0,c.rounding=a,Te(i,n,a))};be.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(gr(e,1,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e,t),r=on(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};be.toSignificantDigits=be.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(gr(e,1,ni),t===void 0?t=n.rounding:gr(t,0,8)),Te(new n(r),e,t)};be.toString=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};be.truncated=be.trunc=function(){return Te(new this.constructor(this),this.e+1,1)};be.valueOf=be.toJSON=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",r=Ie-n.length,r&&(a+=Pn(r)),a+=n;o=e[t],n=o+"",r=Ie-n.length,r&&(a+=Pn(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function gr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xn+e)}function lo(e,t,r,n){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=Ie,i=0):(i=Math.ceil((t+1)/Ie),t%=Ie),a=Tt(10,Ie-t),u=e[i]%a|0,n==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):o=(r<4&&u+1==a||r>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Tt(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(n||r<4)&&u==9999||!n&&r>3&&u==4999):o=((n||r<4)&&u+1==a||!n&&r>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Tt(10,t-3)-1,o}function Ns(e,t,r){for(var n,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=zc.indexOf(e.charAt(o++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function n2(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Du(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ga(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var bt=function(){function e(n,i,a){var o,u=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+u,n[c]=o%a|0,u=o/a|0;return u&&n.unshift(u),n}function t(n,i,a,o){var u,c;if(a!=o)c=a>o?1:-1;else for(u=c=0;u<a;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}function r(n,i,a,o){for(var u=0;a--;)n[a]-=u,u=n[a]<i[a]?1:0,n[a]=u*o+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o,u,c){var l,s,f,p,m,d,h,w,v,x,g,b,y,N,E,A,D,S,C,_,R=n.constructor,P=n.s==i.s?1:-1,I=n.d,O=i.d;if(!I||!I[0]||!O||!O[0])return new R(!n.s||!i.s||(I?O&&I[0]==O[0]:!O)?NaN:I&&I[0]==0||!O?P*0:P/0);for(c?(m=1,s=n.e-i.e):(c=Lr,m=Ie,s=Yt(n.e/m)-Yt(i.e/m)),C=O.length,D=I.length,v=new R(P),x=v.d=[],f=0;O[f]==(I[f]||0);f++);if(O[f]>(I[f]||0)&&s--,a==null?(N=a=R.precision,o=R.rounding):u?N=a+(n.e-i.e)+1:N=a,N<0)x.push(1),d=!0;else{if(N=N/m+2|0,f=0,C==1){for(p=0,O=O[0],N++;(f<D||p)&&N--;f++)E=p*c+(I[f]||0),x[f]=E/O|0,p=E%O|0;d=p||f<D}else{for(p=c/(O[0]+1)|0,p>1&&(O=e(O,p,c),I=e(I,p,c),C=O.length,D=I.length),A=C,g=I.slice(0,C),b=g.length;b<C;)g[b++]=0;_=O.slice(),_.unshift(0),S=O[0],O[1]>=c/2&&++S;do p=0,l=t(O,g,C,b),l<0?(y=g[0],C!=b&&(y=y*c+(g[1]||0)),p=y/S|0,p>1?(p>=c&&(p=c-1),h=e(O,p,c),w=h.length,b=g.length,l=t(h,g,w,b),l==1&&(p--,r(h,C<w?_:O,w,c))):(p==0&&(l=p=1),h=O.slice()),w=h.length,w<b&&h.unshift(0),r(g,h,b,c),l==-1&&(b=g.length,l=t(O,g,C,b),l<1&&(p++,r(g,C<b?_:O,b,c))),b=g.length):l===0&&(p++,g=[0]),x[f++]=p,l&&g[0]?g[b++]=I[A]||0:(g=[I[A]],b=1);while((A++<D||g[0]!==void 0)&&N--);d=g[0]!==void 0}x[0]||x.shift()}if(m==1)v.e=s,fv=d;else{for(f=1,p=x[0];p>=10;p/=10)f++;v.e=f+s*m-1,Te(v,u?a+v.e+1:a,o,d)}return v}}();function Te(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=Ie,o=t,s=f[p=0],c=s/Tt(10,i-o-1)%10|0;else if(p=Math.ceil((a+1)/Ie),u=f.length,p>=u)if(n){for(;u++<=p;)f.push(0);s=c=0,i=1,a%=Ie,o=a-Ie+1}else break e;else{for(s=u=f[p],i=1;u>=10;u/=10)i++;a%=Ie,o=a-Ie+i,c=o<0?0:s/Tt(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?s:s%Tt(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(a>0?o>0?s/Tt(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=Tt(10,(Ie-t%Ie)%Ie),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=p,u=1,p--):(f.length=p+1,u=Tt(10,Ie-a),f[p]=o>0?(s/Tt(10,i-o)%Tt(10,o)|0)*u:0),l)for(;;)if(p==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==Lr&&(f[0]=1));break}else{if(f[p]+=u,f[p]!=Lr)break;f[p--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Le&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function on(e,t,r){if(!e.isFinite())return bv(e);var n,i=e.e,a=Vt(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Pn(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Pn(-i-1)+a,r&&(n=r-o)>0&&(a+=Pn(n))):i>=o?(a+=Pn(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Pn(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Pn(n))),a}function Nu(e,t){var r=e[0];for(t*=Ie;r>=10;r/=10)t++;return t}function qs(e,t,r){if(t>r2)throw Le=!0,r&&(e.precision=r),Error(pv);return Te(new e(Is),t,1,!0)}function zr(e,t,r){if(t>Lc)throw Error(pv);return Te(new e(Rs),t,r,!0)}function gv(e){var t=e.length-1,r=t*Ie+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Pn(e){for(var t="";e--;)t+="0";return t}function vv(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/Ie+4);for(Le=!1;;){if(r%2&&(a=a.times(t),ap(a.d,o)&&(i=!0)),r=Yt(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}t=t.times(t),ap(t.d,o)}return Le=!0,a}function ip(e){return e.d[e.d.length-1]&1}function yv(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;)if(n=new e(t[a]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function Pc(e,t){var r,n,i,a,o,u,c,l=0,s=0,f=0,p=e.constructor,m=p.rounding,d=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Le=!1,c=d):c=t,u=new p(.03125);e.e>-2;)e=e.times(u),f+=5;for(n=Math.log(Tt(2,f))/Math.LN10*2+5|0,c+=n,r=a=o=new p(1),p.precision=c;;){if(a=Te(a.times(e),c,1),r=r.times(++s),u=o.plus(bt(a,r,c,1)),Vt(u.d).slice(0,c)===Vt(o.d).slice(0,c)){for(i=f;i--;)o=Te(o.times(o),c,1);if(t==null)if(l<3&&lo(o.d,c-n,m,l))p.precision=c+=10,r=a=u=new p(1),s=0,l++;else return Te(o,p.precision=d,m,Le=!0);else return p.precision=d,o}o=u}}function Wn(e,t){var r,n,i,a,o,u,c,l,s,f,p,m=1,d=10,h=e,w=h.d,v=h.constructor,x=v.rounding,g=v.precision;if(h.s<0||!w||!w[0]||!h.e&&w[0]==1&&w.length==1)return new v(w&&!w[0]?-1/0:h.s!=1?NaN:w?0:h);if(t==null?(Le=!1,s=g):s=t,v.precision=s+=d,r=Vt(w),n=r.charAt(0),Math.abs(a=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Vt(h.d),n=r.charAt(0),m++;a=h.e,n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=qs(v,s+2,g).times(a+""),h=Wn(new v(n+"."+r.slice(1)),s-d).plus(l),v.precision=g,t==null?Te(h,g,x,Le=!0):h;for(f=h,c=o=h=bt(h.minus(1),h.plus(1),s,1),p=Te(h.times(h),s,1),i=3;;){if(o=Te(o.times(p),s,1),l=c.plus(bt(o,new v(i),s,1)),Vt(l.d).slice(0,s)===Vt(c.d).slice(0,s))if(c=c.times(2),a!==0&&(c=c.plus(qs(v,s+2,g).times(a+""))),c=bt(c,new v(m),s,1),t==null)if(lo(c.d,s-d,x,u))v.precision=s+=d,l=o=h=bt(f.minus(1),f.plus(1),s,1),p=Te(h.times(h),s,1),i=u=1;else return Te(c,v.precision=g,x,Le=!0);else return v.precision=g,c;c=l,i+=2}}function bv(e){return String(e.s*e.s/0)}function Vc(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Ie,r<0&&(n+=Ie),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Ie;n<i;)e.d.push(+t.slice(n,n+=Ie));t=t.slice(n),n=Ie-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),Le&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function i2(e,t){var r,n,i,a,o,u,c,l,s;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),hv.test(t))return Vc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(YN.test(t))r=16,t=t.toLowerCase();else if(XN.test(t))r=2;else if(e2.test(t))r=8;else throw Error(Xn+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,n=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=vv(n,new n(r),a,a*2)),l=Ns(t,r,Lr),s=l.length-1,a=s;l[a]===0;--a)l.pop();return a<0?new n(e.s*0):(e.e=Nu(l,s),e.d=l,Le=!1,o&&(e=bt(e,i,u*4)),c&&(e=e.times(Math.abs(c)<54?Tt(2,c):Yn.pow(2,c))),Le=!0,e)}function a2(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ga(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Du(5,r)),t=ga(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function ga(e,t,r,n,i){var a,o,u,c,l=e.precision,s=Math.ceil(l/Ie);for(Le=!1,c=r.times(r),u=new e(n);;){if(o=bt(u.times(c),new e(t++*t++),l,1),u=i?n.plus(o):n.minus(o),n=bt(o.times(c),new e(t++*t++),l,1),o=u.plus(n),o.d[s]!==void 0){for(a=s;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=n,n=o,o=a}return Le=!0,o.d.length=s+1,o}function Du(e,t){for(var r=e;--t;)r*=e;return r}function xv(e,t){var r,n=t.s<0,i=zr(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return bn=n?4:1,t;if(r=t.divToInt(i),r.isZero())bn=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(a))return bn=ip(r)?n?2:3:n?4:1,t;bn=ip(r)?n?1:4:n?3:2}return t.minus(i).abs()}function _l(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor,d=r!==void 0;if(d?(gr(r,1,ni),n===void 0?n=m.rounding:gr(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())s=bv(e);else{for(s=on(e),o=s.indexOf("."),d?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(s=s.replace(".",""),p=new m(1),p.e=s.length-o,p.d=Ns(on(p),10,i),p.e=p.d.length),f=Ns(s,10,i),a=c=f.length;f[--c]==0;)f.pop();if(!f[0])s=d?"0p+0":"0";else{if(o<0?a--:(e=new m(e),e.d=f,e.e=a,e=bt(e,p,r,n,0,i),f=e.d,a=e.e,l=fv),o=f[r],u=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>u||o===u&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,s="";o<c;o++)s+=zc.charAt(f[o]);if(d){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)s+="0";for(f=Ns(s,i,t),c=f.length;!f[c-1];--c);for(o=1,s="1.";o<c;o++)s+=zc.charAt(f[o])}else s=s.charAt(0)+"."+s.slice(1);s=s+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)s="0"+s;s="0."+s}else if(++a>c)for(a-=c;a--;)s+="0";else a<c&&(s=s.slice(0,a)+"."+s.slice(a))}s=(t==16?"0x":t==2?"0b":t==8?"0o":"")+s}return e.s<0?"-"+s:s}function ap(e,t){if(e.length>t)return e.length=t,!0}function o2(e){return new this(e).abs()}function s2(e){return new this(e).acos()}function u2(e){return new this(e).acosh()}function c2(e,t){return new this(e).plus(t)}function l2(e){return new this(e).asin()}function f2(e){return new this(e).asinh()}function p2(e){return new this(e).atan()}function m2(e){return new this(e).atanh()}function d2(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=zr(this,a,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?zr(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=zr(this,a,1).times(.5),r.s=e.s):t.s<0?(this.precision=a,this.rounding=1,r=this.atan(bt(e,t,a,1)),t=zr(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(bt(e,t,a,1)),r}function h2(e){return new this(e).cbrt()}function g2(e){return Te(e=new this(e),e.e+1,2)}function v2(e,t,r){return new this(e).clamp(t,r)}function y2(e){if(!e||typeof e!="object")throw Error(wu+"Object expected");var t,r,n,i=e.defaults===!0,a=["precision",1,ni,"rounding",0,8,"toExpNeg",-aa,0,"toExpPos",0,aa,"maxE",0,aa,"minE",-aa,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=jc[r]),(n=e[r])!==void 0)if(Yt(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Xn+r+": "+n);if(r="crypto",i&&(this[r]=jc[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(mv);else this[r]=!1;else throw Error(Xn+r+": "+n);return this}function b2(e){return new this(e).cos()}function x2(e){return new this(e).cosh()}function wv(e){var t,r,n;function i(a){var o,u,c,l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,op(a)){l.s=a.s,Le?!a.d||a.e>i.maxE?(l.e=NaN,l.d=null):a.e<i.minE?(l.e=0,l.d=[0]):(l.e=a.e,l.d=a.d.slice()):(l.e=a.e,l.d=a.d?a.d.slice():a.d);return}if(c=typeof a,c==="number"){if(a===0){l.s=1/a<0?-1:1,l.e=0,l.d=[0];return}if(a<0?(a=-a,l.s=-1):l.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Le?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[a]):(l.e=o,l.d=[a]);return}else if(a*0!==0){a||(l.s=NaN),l.e=NaN,l.d=null;return}return Vc(l,a.toString())}else if(c!=="string")throw Error(Xn+a);return(u=a.charCodeAt(0))===45?(a=a.slice(1),l.s=-1):(u===43&&(a=a.slice(1)),l.s=1),hv.test(a)?Vc(l,a):i2(l,a)}if(i.prototype=be,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=y2,i.clone=wv,i.isDecimal=op,i.abs=o2,i.acos=s2,i.acosh=u2,i.add=c2,i.asin=l2,i.asinh=f2,i.atan=p2,i.atanh=m2,i.atan2=d2,i.cbrt=h2,i.ceil=g2,i.clamp=v2,i.cos=b2,i.cosh=x2,i.div=w2,i.exp=N2,i.floor=D2,i.hypot=E2,i.ln=A2,i.log=S2,i.log10=M2,i.log2=C2,i.max=_2,i.min=F2,i.mod=T2,i.mul=O2,i.pow=B2,i.random=k2,i.round=I2,i.sign=R2,i.sin=q2,i.sinh=z2,i.sqrt=j2,i.sub=L2,i.sum=P2,i.tan=V2,i.tanh=U2,i.trunc=$2,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function w2(e,t){return new this(e).div(t)}function N2(e){return new this(e).exp()}function D2(e){return Te(e=new this(e),e.e+1,3)}function E2(){var e,t,r=new this(0);for(Le=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return Le=!0,new this(1/0);r=t}return Le=!0,r.sqrt()}function op(e){return e instanceof Yn||e&&e.toStringTag===dv||!1}function A2(e){return new this(e).ln()}function S2(e,t){return new this(e).log(t)}function C2(e){return new this(e).log(2)}function M2(e){return new this(e).log(10)}function _2(){return yv(this,arguments,"lt")}function F2(){return yv(this,arguments,"gt")}function T2(e,t){return new this(e).mod(t)}function O2(e,t){return new this(e).mul(t)}function B2(e,t){return new this(e).pow(t)}function k2(e){var t,r,n,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:gr(e,1,ni),n=Math.ceil(e/Ie),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);a<n;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=n/4}else throw Error(mv);else for(;a<n;)u[a++]=Math.random()*1e7|0;for(n=u[--a],e%=Ie,n&&e&&(i=Tt(10,Ie-e),u[a]=(n/i|0)*i);u[a]===0;a--)u.pop();if(a<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=Ie)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Ie&&(r-=Ie-n)}return o.e=r,o.d=u,o}function I2(e){return Te(e=new this(e),e.e+1,this.rounding)}function R2(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function q2(e){return new this(e).sin()}function z2(e){return new this(e).sinh()}function j2(e){return new this(e).sqrt()}function L2(e,t){return new this(e).sub(t)}function P2(){var e=0,t=arguments,r=new this(t[e]);for(Le=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return Le=!0,Te(r,this.precision,this.rounding)}function V2(e){return new this(e).tan()}function U2(e){return new this(e).tanh()}function $2(e){return Te(e=new this(e),e.e+1,1)}be[Symbol.for("nodejs.util.inspect.custom")]=be.toString;be[Symbol.toStringTag]="Decimal";var Yn=be.constructor=wv(jc);Is=new Yn(Is);Rs=new Yn(Rs);var H2="BigNumber",J2=["?on","config"],G2=U(H2,J2,e=>{var{on:t,config:r}=e,n=Yn.clone({precision:r.precision,modulo:Yn.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),ji=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function So(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function K2(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Nv={exports:{}};/**
|
|
15
15
|
* @license Complex.js v2.1.1 12/05/2020
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
|
|
18
18
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
19
19
|
**/(function(e,t){(function(r){var n=Math.cosh||function(f){return Math.abs(f)<1e-9?1-f:(Math.exp(f)+Math.exp(-f))*.5},i=Math.sinh||function(f){return Math.abs(f)<1e-9?f:(Math.exp(f)-Math.exp(-f))*.5},a=function(f){var p=Math.PI/4;if(-p>f||f>p)return Math.cos(f)-1;var m=f*f;return m*(m*(m*(m*(m*(m*(m*(m/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},o=function(f,p){var m=Math.abs(f),d=Math.abs(p);return m<3e3&&d<3e3?Math.sqrt(m*m+d*d):(m<d?(m=d,d=f/p):d=p/f,m*Math.sqrt(1+d*d))},u=function(){throw SyntaxError("Invalid Param")};function c(f,p){var m=Math.abs(f),d=Math.abs(p);return f===0?Math.log(d):p===0?Math.log(m):m<3e3&&d<3e3?Math.log(f*f+p*p)*.5:(f=f/2,p=p/2,.5*Math.log(f*f+p*p)+Math.LN2)}var l=function(f,p){var m={re:0,im:0};if(f==null)m.re=m.im=0;else if(p!==void 0)m.re=f,m.im=p;else switch(typeof f){case"object":if("im"in f&&"re"in f)m.re=f.re,m.im=f.im;else if("abs"in f&&"arg"in f){if(!Number.isFinite(f.abs)&&Number.isFinite(f.arg))return s.INFINITY;m.re=f.abs*Math.cos(f.arg),m.im=f.abs*Math.sin(f.arg)}else if("r"in f&&"phi"in f){if(!Number.isFinite(f.r)&&Number.isFinite(f.phi))return s.INFINITY;m.re=f.r*Math.cos(f.phi),m.im=f.r*Math.sin(f.phi)}else f.length===2?(m.re=f[0],m.im=f[1]):u();break;case"string":m.im=m.re=0;var d=f.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),h=1,w=0;d===null&&u();for(var v=0;v<d.length;v++){var x=d[v];x===" "||x===" "||x===`
|
|
20
|
-
`||(x==="+"?h++:x==="-"?w++:x==="i"||x==="I"?(h+w===0&&u(),d[v+1]!==" "&&!isNaN(d[v+1])?(m.im+=parseFloat((w%2?"-":"")+d[v+1]),v++):m.im+=parseFloat((w%2?"-":"")+"1"),h=w=0):((h+w===0||isNaN(x))&&u(),d[v+1]==="i"||d[v+1]==="I"?(m.im+=parseFloat((w%2?"-":"")+x),v++):m.re+=parseFloat((w%2?"-":"")+x),h=w=0))}h+w>0&&u();break;case"number":m.im=0,m.re=f;break;default:u()}return isNaN(m.re)||isNaN(m.im),m};function s(f,p){if(!(this instanceof s))return new s(f,p);var m=l(f,p);this.re=m.re,this.im=m.im}s.prototype={re:0,im:0,sign:function(){var f=this.abs();return new s(this.re/f,this.im/f)},add:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:new s(this.re+m.re,this.im+m.im)},sub:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:new s(this.re-m.re,this.im-m.im)},mul:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isZero()||this.isZero()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:m.im===0&&this.im===0?new s(this.re*m.re,0):new s(this.re*m.re-this.im*m.im,this.re*m.im+this.im*m.re)},div:function(f,p){var m=new s(f,p);if(this.isZero()&&m.isZero()||this.isInfinite()&&m.isInfinite())return s.NAN;if(this.isInfinite()||m.isZero())return s.INFINITY;if(this.isZero()||m.isInfinite())return s.ZERO;f=this.re,p=this.im;var d=m.re,h=m.im,w,v;return h===0?new s(f/d,p/d):Math.abs(d)<Math.abs(h)?(v=d/h,w=d*v+h,new s((f*v+p)/w,(p*v-f)/w)):(v=h/d,w=h*v+d,new s((f+p*v)/w,(p-f*v)/w))},pow:function(f,p){var m=new s(f,p);if(f=this.re,p=this.im,m.isZero())return s.ONE;if(m.im===0){if(p===0&&f>0)return new s(Math.pow(f,m.re),0);if(f===0)switch((m.re%4+4)%4){case 0:return new s(Math.pow(p,m.re),0);case 1:return new s(0,Math.pow(p,m.re));case 2:return new s(-Math.pow(p,m.re),0);case 3:return new s(0,-Math.pow(p,m.re))}}if(f===0&&p===0&&m.re>0&&m.im>=0)return s.ZERO;var d=Math.atan2(p,f),h=c(f,p);return f=Math.exp(m.re*h-m.im*d),p=m.im*h+m.re*d,new s(f*Math.cos(p),f*Math.sin(p))},sqrt:function(){var f=this.re,p=this.im,m=this.abs(),d,h;if(f>=0){if(p===0)return new s(Math.sqrt(f),0);d=.5*Math.sqrt(2*(m+f))}else d=Math.abs(p)/Math.sqrt(2*(m-f));return f<=0?h=.5*Math.sqrt(2*(m-f)):h=Math.abs(p)/Math.sqrt(2*(m+f)),new s(d,p<0?-h:h)},exp:function(){var f=Math.exp(this.re);return this.im,new s(f*Math.cos(this.im),f*Math.sin(this.im))},expm1:function(){var f=this.re,p=this.im;return new s(Math.expm1(f)*Math.cos(p)+a(p),Math.exp(f)*Math.sin(p))},log:function(){var f=this.re,p=this.im;return new s(c(f,p),Math.atan2(p,f))},abs:function(){return o(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var f=this.re,p=this.im;return new s(Math.sin(f)*n(p),Math.cos(f)*i(p))},cos:function(){var f=this.re,p=this.im;return new s(Math.cos(f)*n(p),-Math.sin(f)*i(p))},tan:function(){var f=2*this.re,p=2*this.im,m=Math.cos(f)+n(p);return new s(Math.sin(f)/m,i(p)/m)},cot:function(){var f=2*this.re,p=2*this.im,m=Math.cos(f)-n(p);return new s(-Math.sin(f)/m,i(p)/m)},sec:function(){var f=this.re,p=this.im,m=.5*n(2*p)+.5*Math.cos(2*f);return new s(Math.cos(f)*n(p)/m,Math.sin(f)*i(p)/m)},csc:function(){var f=this.re,p=this.im,m=.5*n(2*p)-.5*Math.cos(2*f);return new s(Math.sin(f)*n(p)/m,-Math.cos(f)*i(p)/m)},asin:function(){var f=this.re,p=this.im,m=new s(p*p-f*f+1,-2*f*p).sqrt(),d=new s(m.re-p,m.im+f).log();return new s(d.im,-d.re)},acos:function(){var f=this.re,p=this.im,m=new s(p*p-f*f+1,-2*f*p).sqrt(),d=new s(m.re-p,m.im+f).log();return new s(Math.PI/2-d.im,d.re)},atan:function(){var f=this.re,p=this.im;if(f===0){if(p===1)return new s(0,1/0);if(p===-1)return new s(0,-1/0)}var m=f*f+(1-p)*(1-p),d=new s((1-p*p-f*f)/m,-2*f/m).log();return new s(-.5*d.im,.5*d.re)},acot:function(){var f=this.re,p=this.im;if(p===0)return new s(Math.atan2(1,f),0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).atan():new s(f!==0?f/0:0,p!==0?-p/0:0).atan()},asec:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(0,1/0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).acos():new s(f!==0?f/0:0,p!==0?-p/0:0).acos()},acsc:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(Math.PI/2,1/0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).asin():new s(f!==0?f/0:0,p!==0?-p/0:0).asin()},sinh:function(){var f=this.re,p=this.im;return new s(i(f)*Math.cos(p),n(f)*Math.sin(p))},cosh:function(){var f=this.re,p=this.im;return new s(n(f)*Math.cos(p),i(f)*Math.sin(p))},tanh:function(){var f=2*this.re,p=2*this.im,m=n(f)+Math.cos(p);return new s(i(f)/m,Math.sin(p)/m)},coth:function(){var f=2*this.re,p=2*this.im,m=n(f)-Math.cos(p);return new s(i(f)/m,-Math.sin(p)/m)},csch:function(){var f=this.re,p=this.im,m=Math.cos(2*p)-n(2*f);return new s(-2*i(f)*Math.cos(p)/m,2*n(f)*Math.sin(p)/m)},sech:function(){var f=this.re,p=this.im,m=Math.cos(2*p)+n(2*f);return new s(2*n(f)*Math.cos(p)/m,-2*i(f)*Math.sin(p)/m)},asinh:function(){var f=this.im;this.im=-this.re,this.re=f;var p=this.asin();return this.re=-this.im,this.im=f,f=p.re,p.re=-p.im,p.im=f,p},acosh:function(){var f=this.acos();if(f.im<=0){var p=f.re;f.re=-f.im,f.im=p}else{var p=f.im;f.im=-f.re,f.re=p}return f},atanh:function(){var f=this.re,p=this.im,m=f>1&&p===0,d=1-f,h=1+f,w=d*d+p*p,v=w!==0?new s((h*d-p*p)/w,(p*d+h*p)/w):new s(f!==-1?f/0:0,p!==0?p/0:0),x=v.re;return v.re=c(v.re,v.im)/2,v.im=Math.atan2(v.im,x)/2,m&&(v.im=-v.im),v},acoth:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(0,Math.PI/2);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).atanh():new s(f!==0?f/0:0,p!==0?-p/0:0).atanh()},acsch:function(){var f=this.re,p=this.im;if(p===0)return new s(f!==0?Math.log(f+Math.sqrt(f*f+1)):1/0,0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).asinh():new s(f!==0?f/0:0,p!==0?-p/0:0).asinh()},asech:function(){var f=this.re,p=this.im;if(this.isZero())return s.INFINITY;var m=f*f+p*p;return m!==0?new s(f/m,-p/m).acosh():new s(f!==0?f/0:0,p!==0?-p/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var f=this.re,p=this.im,m=f*f+p*p;return new s(f/m,-p/m)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(f){return f=Math.pow(10,f||0),new s(Math.ceil(this.re*f)/f,Math.ceil(this.im*f)/f)},floor:function(f){return f=Math.pow(10,f||0),new s(Math.floor(this.re*f)/f,Math.floor(this.im*f)/f)},round:function(f){return f=Math.pow(10,f||0),new s(Math.round(this.re*f)/f,Math.round(this.im*f)/f)},equals:function(f,p){var m=new s(f,p);return Math.abs(m.re-this.re)<=s.EPSILON&&Math.abs(m.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var f=this.re,p=this.im,m="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(f)<s.EPSILON&&(f=0),Math.abs(p)<s.EPSILON&&(p=0),p===0?m+f:(f!==0?(m+=f,m+=" ",p<0?(p=-p,m+="-"):m+="+",m+=" "):p<0&&(p=-p,m+="-"),p!==1&&(m+=p),m+"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())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-15,Object.defineProperty(s,"__esModule",{value:!0}),s.default=s,s.Complex=s,e.exports=s})()})(
|
|
20
|
+
`||(x==="+"?h++:x==="-"?w++:x==="i"||x==="I"?(h+w===0&&u(),d[v+1]!==" "&&!isNaN(d[v+1])?(m.im+=parseFloat((w%2?"-":"")+d[v+1]),v++):m.im+=parseFloat((w%2?"-":"")+"1"),h=w=0):((h+w===0||isNaN(x))&&u(),d[v+1]==="i"||d[v+1]==="I"?(m.im+=parseFloat((w%2?"-":"")+x),v++):m.re+=parseFloat((w%2?"-":"")+x),h=w=0))}h+w>0&&u();break;case"number":m.im=0,m.re=f;break;default:u()}return isNaN(m.re)||isNaN(m.im),m};function s(f,p){if(!(this instanceof s))return new s(f,p);var m=l(f,p);this.re=m.re,this.im=m.im}s.prototype={re:0,im:0,sign:function(){var f=this.abs();return new s(this.re/f,this.im/f)},add:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:new s(this.re+m.re,this.im+m.im)},sub:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:new s(this.re-m.re,this.im-m.im)},mul:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isZero()||this.isZero()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:m.im===0&&this.im===0?new s(this.re*m.re,0):new s(this.re*m.re-this.im*m.im,this.re*m.im+this.im*m.re)},div:function(f,p){var m=new s(f,p);if(this.isZero()&&m.isZero()||this.isInfinite()&&m.isInfinite())return s.NAN;if(this.isInfinite()||m.isZero())return s.INFINITY;if(this.isZero()||m.isInfinite())return s.ZERO;f=this.re,p=this.im;var d=m.re,h=m.im,w,v;return h===0?new s(f/d,p/d):Math.abs(d)<Math.abs(h)?(v=d/h,w=d*v+h,new s((f*v+p)/w,(p*v-f)/w)):(v=h/d,w=h*v+d,new s((f+p*v)/w,(p-f*v)/w))},pow:function(f,p){var m=new s(f,p);if(f=this.re,p=this.im,m.isZero())return s.ONE;if(m.im===0){if(p===0&&f>0)return new s(Math.pow(f,m.re),0);if(f===0)switch((m.re%4+4)%4){case 0:return new s(Math.pow(p,m.re),0);case 1:return new s(0,Math.pow(p,m.re));case 2:return new s(-Math.pow(p,m.re),0);case 3:return new s(0,-Math.pow(p,m.re))}}if(f===0&&p===0&&m.re>0&&m.im>=0)return s.ZERO;var d=Math.atan2(p,f),h=c(f,p);return f=Math.exp(m.re*h-m.im*d),p=m.im*h+m.re*d,new s(f*Math.cos(p),f*Math.sin(p))},sqrt:function(){var f=this.re,p=this.im,m=this.abs(),d,h;if(f>=0){if(p===0)return new s(Math.sqrt(f),0);d=.5*Math.sqrt(2*(m+f))}else d=Math.abs(p)/Math.sqrt(2*(m-f));return f<=0?h=.5*Math.sqrt(2*(m-f)):h=Math.abs(p)/Math.sqrt(2*(m+f)),new s(d,p<0?-h:h)},exp:function(){var f=Math.exp(this.re);return this.im,new s(f*Math.cos(this.im),f*Math.sin(this.im))},expm1:function(){var f=this.re,p=this.im;return new s(Math.expm1(f)*Math.cos(p)+a(p),Math.exp(f)*Math.sin(p))},log:function(){var f=this.re,p=this.im;return new s(c(f,p),Math.atan2(p,f))},abs:function(){return o(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var f=this.re,p=this.im;return new s(Math.sin(f)*n(p),Math.cos(f)*i(p))},cos:function(){var f=this.re,p=this.im;return new s(Math.cos(f)*n(p),-Math.sin(f)*i(p))},tan:function(){var f=2*this.re,p=2*this.im,m=Math.cos(f)+n(p);return new s(Math.sin(f)/m,i(p)/m)},cot:function(){var f=2*this.re,p=2*this.im,m=Math.cos(f)-n(p);return new s(-Math.sin(f)/m,i(p)/m)},sec:function(){var f=this.re,p=this.im,m=.5*n(2*p)+.5*Math.cos(2*f);return new s(Math.cos(f)*n(p)/m,Math.sin(f)*i(p)/m)},csc:function(){var f=this.re,p=this.im,m=.5*n(2*p)-.5*Math.cos(2*f);return new s(Math.sin(f)*n(p)/m,-Math.cos(f)*i(p)/m)},asin:function(){var f=this.re,p=this.im,m=new s(p*p-f*f+1,-2*f*p).sqrt(),d=new s(m.re-p,m.im+f).log();return new s(d.im,-d.re)},acos:function(){var f=this.re,p=this.im,m=new s(p*p-f*f+1,-2*f*p).sqrt(),d=new s(m.re-p,m.im+f).log();return new s(Math.PI/2-d.im,d.re)},atan:function(){var f=this.re,p=this.im;if(f===0){if(p===1)return new s(0,1/0);if(p===-1)return new s(0,-1/0)}var m=f*f+(1-p)*(1-p),d=new s((1-p*p-f*f)/m,-2*f/m).log();return new s(-.5*d.im,.5*d.re)},acot:function(){var f=this.re,p=this.im;if(p===0)return new s(Math.atan2(1,f),0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).atan():new s(f!==0?f/0:0,p!==0?-p/0:0).atan()},asec:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(0,1/0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).acos():new s(f!==0?f/0:0,p!==0?-p/0:0).acos()},acsc:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(Math.PI/2,1/0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).asin():new s(f!==0?f/0:0,p!==0?-p/0:0).asin()},sinh:function(){var f=this.re,p=this.im;return new s(i(f)*Math.cos(p),n(f)*Math.sin(p))},cosh:function(){var f=this.re,p=this.im;return new s(n(f)*Math.cos(p),i(f)*Math.sin(p))},tanh:function(){var f=2*this.re,p=2*this.im,m=n(f)+Math.cos(p);return new s(i(f)/m,Math.sin(p)/m)},coth:function(){var f=2*this.re,p=2*this.im,m=n(f)-Math.cos(p);return new s(i(f)/m,-Math.sin(p)/m)},csch:function(){var f=this.re,p=this.im,m=Math.cos(2*p)-n(2*f);return new s(-2*i(f)*Math.cos(p)/m,2*n(f)*Math.sin(p)/m)},sech:function(){var f=this.re,p=this.im,m=Math.cos(2*p)+n(2*f);return new s(2*n(f)*Math.cos(p)/m,-2*i(f)*Math.sin(p)/m)},asinh:function(){var f=this.im;this.im=-this.re,this.re=f;var p=this.asin();return this.re=-this.im,this.im=f,f=p.re,p.re=-p.im,p.im=f,p},acosh:function(){var f=this.acos();if(f.im<=0){var p=f.re;f.re=-f.im,f.im=p}else{var p=f.im;f.im=-f.re,f.re=p}return f},atanh:function(){var f=this.re,p=this.im,m=f>1&&p===0,d=1-f,h=1+f,w=d*d+p*p,v=w!==0?new s((h*d-p*p)/w,(p*d+h*p)/w):new s(f!==-1?f/0:0,p!==0?p/0:0),x=v.re;return v.re=c(v.re,v.im)/2,v.im=Math.atan2(v.im,x)/2,m&&(v.im=-v.im),v},acoth:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(0,Math.PI/2);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).atanh():new s(f!==0?f/0:0,p!==0?-p/0:0).atanh()},acsch:function(){var f=this.re,p=this.im;if(p===0)return new s(f!==0?Math.log(f+Math.sqrt(f*f+1)):1/0,0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).asinh():new s(f!==0?f/0:0,p!==0?-p/0:0).asinh()},asech:function(){var f=this.re,p=this.im;if(this.isZero())return s.INFINITY;var m=f*f+p*p;return m!==0?new s(f/m,-p/m).acosh():new s(f!==0?f/0:0,p!==0?-p/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var f=this.re,p=this.im,m=f*f+p*p;return new s(f/m,-p/m)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(f){return f=Math.pow(10,f||0),new s(Math.ceil(this.re*f)/f,Math.ceil(this.im*f)/f)},floor:function(f){return f=Math.pow(10,f||0),new s(Math.floor(this.re*f)/f,Math.floor(this.im*f)/f)},round:function(f){return f=Math.pow(10,f||0),new s(Math.round(this.re*f)/f,Math.round(this.im*f)/f)},equals:function(f,p){var m=new s(f,p);return Math.abs(m.re-this.re)<=s.EPSILON&&Math.abs(m.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var f=this.re,p=this.im,m="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(f)<s.EPSILON&&(f=0),Math.abs(p)<s.EPSILON&&(p=0),p===0?m+f:(f!==0?(m+=f,m+=" ",p<0?(p=-p,m+="-"):m+="+",m+=" "):p<0&&(p=-p,m+="-"),p!==1&&(m+=p),m+"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())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-15,Object.defineProperty(s,"__esModule",{value:!0}),s.default=s,s.Complex=s,e.exports=s})()})(Nv);var W2=Nv.exports;const Pt=So(W2);var Q2="Complex",Z2=[],X2=U(Q2,Z2,()=>(Object.defineProperty(Pt,"name",{value:"Complex"}),Pt.prototype.constructor=Pt,Pt.prototype.type="Complex",Pt.prototype.isComplex=!0,Pt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Pt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Pt.prototype.format=function(e){var t="",r=this.im,n=this.re,i=Ei(this.re,e),a=Ei(this.im,e),o=Ue(e)?e:e?e.precision:null;if(o!==null){var u=Math.pow(10,-o);Math.abs(n/r)<u&&(n=0),Math.abs(r/n)<u&&(r=0)}return r===0?t=i:n===0?r===1?t="i":r===-1?t="-i":t=a+"i":r<0?r===-1?t=i+" - i":t=i+" - "+a.substring(1)+"i":r===1?t=i+" + i":t=i+" + "+a+"i",t},Pt.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return Pt(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var r=arguments[0],n=arguments[1];if(Ue(r)){if(Cr(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),Ue(n))return new Pt({r,phi:n});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")}},Pt.prototype.valueOf=Pt.prototype.toString,Pt.fromJSON=function(e){return new Pt(e)},Pt.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},Pt),{isClass:!0}),Dv={exports:{}};/**
|
|
21
21
|
* @license Fraction.js v4.3.0 20/08/2023
|
|
22
22
|
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
23
23
|
*
|
|
24
24
|
* Copyright (c) 2023, Robert Eisele (robert@raw.org)
|
|
25
25
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
26
|
-
**/(function(e,t){(function(r){var n=2e3,i={s:1,n:0,d:1};function a(v,x){if(isNaN(v=parseInt(v,10)))throw h();return v*x}function o(v,x){if(x===0)throw d();var g=Object.create(m.prototype);g.s=v<0?-1:1,v=v<0?-v:v;var b=p(v,x);return g.n=v/b,g.d=x/b,g}function u(v){for(var x={},g=v,b=2,y=4;y<=g;){for(;g%b===0;)g/=b,x[b]=(x[b]||0)+1;y+=1+2*b++}return g!==v?g>1&&(x[g]=(x[g]||0)+1):x[v]=(x[v]||0)+1,x}var c=function(v,x){var g=0,b=1,y=1,N=0,E=0,A=0,D=1,S=1,C=0,_=1,R=1,P=1,I=1e7,O;if(v!=null)if(x!==void 0){if(g=v,b=x,y=g*b,g%1!==0||b%1!==0)throw w()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)g=v.n,b=v.d,"s"in v&&(g*=v.s);else if(0 in v)g=v[0],1 in v&&(b=v[1]);else throw h();y=g*b;break}case"number":{if(v<0&&(y=v,v=-v),v%1===0)g=v;else if(v>0){for(v>=1&&(S=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=S);_<=I&&P<=I;)if(O=(C+R)/(_+P),v===O){_+P<=I?(g=C+R,b=_+P):P>_?(g=R,b=P):(g=C,b=_);break}else v>O?(C+=R,_+=P):(R+=C,P+=_),_>I?(g=R,b=P):(g=C,b=_);g*=S}else(isNaN(v)||isNaN(x))&&(b=g=NaN);break}case"string":{if(_=v.match(/\d+|./g),_===null)throw h();if(_[C]==="-"?(y=-1,C++):_[C]==="+"&&C++,_.length===C+1?E=a(_[C++],y):_[C+1]==="."||_[C]==="."?(_[C]!=="."&&(N=a(_[C++],y)),C++,(C+1===_.length||_[C+1]==="("&&_[C+3]===")"||_[C+1]==="'"&&_[C+3]==="'")&&(E=a(_[C],y),D=Math.pow(10,_[C].length),C++),(_[C]==="("&&_[C+2]===")"||_[C]==="'"&&_[C+2]==="'")&&(A=a(_[C+1],y),S=Math.pow(10,_[C+1].length)-1,C+=3)):_[C+1]==="/"||_[C+1]===":"?(E=a(_[C],y),D=a(_[C+2],1),C+=3):_[C+3]==="/"&&_[C+1]===" "&&(N=a(_[C],y),E=a(_[C+2],y),D=a(_[C+4],1),C+=5),_.length<=C){b=D*S,y=g=A+b*N+S*E;break}}default:throw h()}if(b===0)throw d();i.s=y<0?-1:1,i.n=Math.abs(g),i.d=Math.abs(b)};function l(v,x,g){for(var b=1;x>0;v=v*v%g,x>>=1)x&1&&(b=b*v%g);return b}function s(v,x){for(;x%2===0;x/=2);for(;x%5===0;x/=5);if(x===1)return 0;for(var g=10%x,b=1;g!==1;b++)if(g=g*10%x,b>n)return 0;return b}function f(v,x,g){for(var b=1,y=l(10,g,x),N=0;N<300;N++){if(b===y)return N;b=b*10%x,y=y*10%x}return 0}function p(v,x){if(!v)return x;if(!x)return v;for(;;){if(v%=x,!v)return x;if(x%=v,!x)return v}}function m(v,x){if(c(v,x),this instanceof m)v=p(i.d,i.n),this.s=i.s,this.n=i.n/v,this.d=i.d/v;else return o(i.s*i.n,i.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},w=function(){return new Error("Parameters must be integer")};m.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(v,x){return c(v,x),o(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(v,x){return c(v,x),o(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(v,x){return c(v,x),o(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(v,x){return c(v,x),o(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(v,x){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(v===void 0)return o(this.s*this.n%this.d,1);if(c(v,x),i.n===0&&this.d===0)throw d();return o(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(v,x){return c(v,x),o(p(i.n,this.n)*p(i.d,this.d),i.d*this.d)},lcm:function(v,x){return c(v,x),i.n===0&&this.n===0?o(0,1):o(i.n*this.n,p(i.n,this.n)*p(i.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(v,x){if(c(v,x),i.d===1)return i.s<0?o(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):o(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var g=u(this.n),b=u(this.d),y=1,N=1;for(var E in g)if(E!=="1"){if(E==="0"){y=0;break}if(g[E]*=i.n,g[E]%i.d===0)g[E]/=i.d;else return null;y*=Math.pow(E,g[E])}for(var E in b)if(E!=="1"){if(b[E]*=i.n,b[E]%i.d===0)b[E]/=i.d;else return null;N*=Math.pow(E,b[E])}return i.s<0?o(N,y):o(y,N)},equals:function(v,x){return c(v,x),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(v,x){c(v,x);var g=this.s*this.n*i.d-i.s*i.n*this.d;return(0<g)-(g<0)},simplify:function(v){if(isNaN(this.n)||isNaN(this.d))return this;v=v||.001;for(var x=this.abs(),g=x.toContinued(),b=1;b<g.length;b++){for(var y=o(g[b-1],1),N=b-2;N>=0;N--)y=y.inverse().add(g[N]);if(Math.abs(y.sub(x).valueOf())<v)return y.mul(this.s)}return this},divisible:function(v,x){return c(v,x),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(v){var x,g="",b=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=b:(v&&(x=Math.floor(b/y))>0&&(g+=x,g+=" ",b%=y),g+=b,g+="/",g+=y),g},toLatex:function(v){var x,g="",b=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=b:(v&&(x=Math.floor(b/y))>0&&(g+=x,b%=y),g+="\\frac{",g+=b,g+="}{",g+=y,g+="}"),g},toContinued:function(){var v,x=this.n,g=this.d,b=[];if(isNaN(x)||isNaN(g))return b;do b.push(Math.floor(x/g)),v=x%g,x=g,g=v;while(x!==1);return b},toString:function(v){var x=this.n,g=this.d;if(isNaN(x)||isNaN(g))return"NaN";v=v||15;var b=s(x,g),y=f(x,g,b),N=this.s<0?"-":"";if(N+=x/g|0,x%=g,x*=10,x&&(N+="."),b){for(var E=y;E--;)N+=x/g|0,x%=g,x*=10;N+="(";for(var E=b;E--;)N+=x/g|0,x%=g,x*=10;N+=")"}else for(var E=v;x&&E--;)N+=x/g|0,x%=g,x*=10;return N}},Object.defineProperty(m,"__esModule",{value:!0}),m.default=m,m.Fraction=m,e.exports=m})()})(dv);var $2=dv.exports;const dn=No($2);var H2="Fraction",J2=[],G2=U(H2,J2,()=>(Object.defineProperty(dn,"name",{value:"Fraction"}),dn.prototype.constructor=dn,dn.prototype.type="Fraction",dn.prototype.isFraction=!0,dn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},dn.fromJSON=function(e){return new dn(e)},dn),{isClass:!0}),W2="Range",K2=[],Q2=U(W2,K2,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,a=r!=null,o=n!=null;if(i){if($e(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(a){if($e(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(o){if($e(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=a?parseFloat(r):0,this.step=o?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,a=i-r;return Wn(n)===Wn(a)?t=Math.ceil(a/n):a===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;r<i;)t(r,[a],this),r+=n,a++;else if(n<0)for(;r>i;)t(r,[a],this),r+=n,a++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,a){r[i[0]]=t(n,i,a)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=Di(this.start,t);return this.step!==1&&(r+=":"+Di(this.step,t)),r+=":"+Di(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0}),Z2="Matrix",X2=[],Y2=U(Z2,X2,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function cc(e,t,r){var n=e.constructor,i=new n(2),a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),a="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function eD(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=Gg(t);switch(r){case"fixed":return rD(e,n);case"exponential":return Yf(e,n);case"engineering":return tD(e,n);case"bin":return cc(e,2,i);case"oct":return cc(e,8,i);case"hex":return cc(e,16,i);case"auto":{var a=ep(t==null?void 0:t.lowerExp,-3),o=ep(t==null?void 0:t.upperExp,5);if(e.isZero())return"0";var u,c=e.toSignificantDigits(n),l=c.e;return l>=a&&l<o?u=c.toFixed():u=Yf(e,n),u.replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],f=arguments[4];return s!=="."?s+f:f})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function tD(e,t){var r=e.e,n=r%3===0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(r>=0?"+":"")+n.toString()}function Yf(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function rD(e,t){return e.toFixed(t)}function ep(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function nD(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Ge(e,t){var r=iD(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function iD(e,t){if(typeof e=="number")return Di(e,t);if($e(e))return eD(e,t);if(aD(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return hv(e,t);if(Qt(e))return na(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>na(n)+": "+Ge(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function na(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in tp?tp[i]:i,n++}return'"'+r+'"'}var tp={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function Mr(e){var t=String(e);return t=t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t}function hv(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)i!==0&&(r+=", "),r+=hv(e[i],t);return r+="]",r}else return Ge(e,t)}function aD(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function zc(e,t){if(!Qt(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(e)+", index: 0)");if(!Qt(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(t)+", index: 1)");return e===t?0:e>t?1:-1}function Ke(e,t,r){if(!(this instanceof Ke))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Ke.prototype=new RangeError;Ke.prototype.constructor=RangeError;Ke.prototype.name="DimensionError";Ke.prototype.isDimensionError=!0;function $r(e,t,r){if(!(this instanceof $r))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),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}$r.prototype=new RangeError;$r.prototype.constructor=RangeError;$r.prototype.name="IndexError";$r.prototype.isIndexError=!0;function Ve(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function gv(e,t,r){var n,i=e.length;if(i!==t[r])throw new Ke(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new Ke(t.length-1,t.length,"<");gv(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new Ke(t.length+1,t.length,">")}function rp(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Ke(e.length,0)}else gv(e,t,0)}function Bs(e,t){var r=e.isMatrix?e._size:Ve(e),n=t._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==r[a])throw new Ke(i,r[a])})}function pt(e,t){if(e!==void 0){if(!Ue(e)||!Fe(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new $r(e,t)}}function da(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&st(r._data)){if(r._size[0]===0)return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(Qt(r)&&r.length===0)return!0}return!1}function ha(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!Ue(i)||!Fe(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(t)+")")}),(Ue(e)||$e(e))&&(e=[e]);var n=r!==void 0?r:0;return jc(e,t,0,n),e}function jc(e,t,r,n){var i,a,o=e.length,u=t[r],c=Math.min(o,u);if(e.length=u,r<t.length-1){var l=r+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),jc(a,t,l,n);for(i=c;i<u;i++)a=[],e[i]=a,jc(a,t,l,n)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<u;i++)e[i]=n}}function El(e,t){var r=ot(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Ke(0,n,"!=");t=Al(t,n);var i=vv(t);if(n!==i)throw new Ke(i,n,"!=");try{return oD(r,t)}catch(a){throw a instanceof Ke?new Ke(i,n,"!="):a}}function Al(e,t){var r=vv(e),n=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,c=t%r===0;if(u)if(c)n[a]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function vv(e){return e.reduce((t,r)=>t*r,1)}function oD(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var a=t[i];n=[];for(var o=r.length/a,u=0;u<o;u++)n.push(r.slice(u*a,(u+1)*a));r=n}return r}function ks(e,t){for(var r=Ve(e);Array.isArray(e)&&e.length===1;)e=e[0],r.shift();for(var n=r.length;r[n-1]===1;)n--;return n<r.length&&(e=yv(e,n,0),r.length=n),e}function yv(e,t,r){var n,i;if(r<t){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=yv(e[n],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function bv(e,t,r,n){var i=n||Ve(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=xv(e,t,0);i.length<t;)i.push(1);return e}function xv(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=xv(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function ot(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function r(n){Array.isArray(n)?n.forEach(r):t.push(n)}),t}function Nn(e,t){return Array.prototype.map.call(e,t)}function bu(e,t){Array.prototype.forEach.call(e,t)}function wv(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function Is(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,r=>t.test(r))}function np(e,t){return Array.prototype.join.call(e,t)}function ga(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function Rs(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function so(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(n=a.length),o&&a.length!==n)return;var u=o?so(a,t):t(a);if(r===void 0)r=u;else if(r!==u)return"mixed"}return r}function Nv(e,t,r,n){if(n<r){if(e.length!==t.length)throw new Ke(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=Nv(e[a],t[a],r,n+1);return i}else return e.concat(t)}function Dv(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(r,n){return Nv(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function sD(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(p=>p.length),i=Math.max(...n),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],c=n[o],l=0;l<c;l++){var s=i-c+l;u[l]>a[s]&&(a[s]=u[l])}for(var f=0;f<t.length;f++)qs(t[f],a);return a}function qs(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function ip(e,t){var r=Ve(e);if(Oi(r,t))return e;qs(r,t);var n=sD(r,t),i=n.length,a=[...Array(i-r.length).fill(1),...r],o=cD(e);r.length<i&&(o=El(o,a),r=Ve(o));for(var u=0;u<i;u++)r[u]<n[u]&&(o=uD(o,n[u],u),r=Ve(o));return o}function uD(e,t,r){return Dv(...Array(t).fill(e),r)}function cD(e){return Ot([],e)}function lD(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(u){var c=i[u];if(c&&(delete n[c],delete i[u],--t,r===c)){if(!t){a=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(u){var c=i[u],l=++a;if(n[l]=u,i[u]=l,!c)return++t,t<=e?void 0:(u=n[r],o(u),u);if(delete n[c],r===c)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function Do(e){var{hasher:t,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:lD(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t(i);if(n.cache.values.has(o))return n.cache.lru.hit(o),n.cache.values.get(o);var u=e.apply(e,i);return n.cache.values.set(o,u),n.cache.values.delete(n.cache.lru.hit(o)),u}}function Ev(e){return Object.keys(e.signatures||{}).reduce(function(t,r){var n=(r.match(/,/g)||[]).length+1;return Math.max(t,n)},-1)}var fD="DenseMatrix",pD=["Matrix"],mD=U(fD,pD,e=>{var{Matrix:t}=e;function r(s,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Qt(f))throw new Error("Invalid datatype: "+f);if(ke(s))s.type==="DenseMatrix"?(this._data=ze(s._data),this._size=ze(s._size),this._datatype=f||s._datatype):(this._data=s.toArray(),this._size=s.size(),this._datatype=f||s._datatype);else if(s&&st(s.data)&&st(s.size))this._data=s.data,this._size=s.size,rp(this._data,this._size),this._datatype=f||s.datatype;else if(st(s))this._data=l(s),this._size=Ve(this._data),rp(this._data,this._size),this._datatype=f;else{if(s)throw new TypeError("Unsupported type of data ("+dt(s)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new t,r.prototype.createDenseMatrix=function(s,f){return new r(s,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return so(this._data,dt)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(s,f){return new r(s,f)},r.prototype.subset=function(s,f,p){switch(arguments.length){case 1:return n(this,s);case 2:case 3:return a(this,s,f,p);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(s){if(!st(s))throw new TypeError("Array expected");if(s.length!==this._size.length)throw new Ke(s.length,this._size.length);for(var f=0;f<s.length;f++)pt(s[f],this._size[f]);for(var p=this._data,m=0,d=s.length;m<d;m++){var h=s[m];pt(h,p.length),p=p[h]}return p},r.prototype.set=function(s,f,p){if(!st(s))throw new TypeError("Array expected");if(s.length<this._size.length)throw new Ke(s.length,this._size.length,"<");var m,d,h,w=s.map(function(x){return x+1});c(this,w,p);var v=this._data;for(m=0,d=s.length-1;m<d;m++)h=s[m],pt(h,v.length),v=v[h];return h=s[s.length-1],pt(h,v.length),v[h]=f,this};function n(s,f){if(!fu(f))throw new TypeError("Invalid index");var p=f.isScalar();if(p)return s.get(f.min());var m=f.size();if(m.length!==s._size.length)throw new Ke(m.length,s._size.length);for(var d=f.min(),h=f.max(),w=0,v=s._size.length;w<v;w++)pt(d[w],s._size[w]),pt(h[w],s._size[w]);return new r(i(s._data,f,m.length,0),s._datatype)}function i(s,f,p,m){var d=m===p-1,h=f.dimension(m);return d?h.map(function(w){return pt(w,s.length),s[w]}).valueOf():h.map(function(w){pt(w,s.length);var v=s[w];return i(v,f,p,m+1)}).valueOf()}function a(s,f,p,m){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var d=f.size(),h=f.isScalar(),w;if(ke(p)?(w=p.size(),p=p.valueOf()):w=Ve(p),h){if(w.length!==0)throw new TypeError("Scalar expected");s.set(f.min(),p,m)}else{if(!Oi(w,d))try{w.length===0?p=ip([p],d):p=ip(p,d),w=Ve(p)}catch{}if(d.length<s._size.length)throw new Ke(d.length,s._size.length,"<");if(w.length<d.length){for(var v=0,x=0;d[v]===1&&w[v]===1;)v++;for(;d[v]===1;)x++,v++;p=bv(p,d.length,x,w)}if(!Oi(d,w))throw new Ke(d,w,">");var g=f.max().map(function(N){return N+1});c(s,g,m);var b=d.length,y=0;o(s._data,f,p,b,y)}return s}function o(s,f,p,m,d){var h=d===m-1,w=f.dimension(d);h?w.forEach(function(v,x){pt(v),s[v]=p[x[0]]}):w.forEach(function(v,x){pt(v),o(s[v],f,p[x[0]],m,d+1)})}r.prototype.resize=function(s,f,p){if(!Fr(s))throw new TypeError("Array or Matrix expected");var m=s.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),d=p?this.clone():this;return u(d,m,f)};function u(s,f,p){if(f.length===0){for(var m=s._data;st(m);)m=m[0];return m}return s._size=f.slice(0),s._data=ha(s._data,s._size,p),s}r.prototype.reshape=function(s,f){var p=f?this.clone():this;p._data=El(p._data,s);var m=p._size.reduce((d,h)=>d*h);return p._size=Al(s,m),p};function c(s,f,p){for(var m=s._size.slice(0),d=!1;m.length<f.length;)m.push(0),d=!0;for(var h=0,w=f.length;h<w;h++)f[h]>m[h]&&(m[h]=f[h],d=!0);d&&u(s,m,p)}r.prototype.clone=function(){var s=new r({data:ze(this._data),size:ze(this._size),datatype:this._datatype});return s},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(s){var f=this,p=Ev(s),m=function w(v,x){return st(v)?v.map(function(g,b){return w(g,x.concat(b))}):p===1?s(v):p===2?s(v,x):s(v,x,f)},d=m(this._data,[]),h=this._datatype!==void 0?so(d,dt):void 0;return new r(d,h)},r.prototype.forEach=function(s){var f=this,p=function m(d,h){st(d)?d.forEach(function(w,v){m(w,h.concat(v))}):s(d,h,f)};p(this._data,[])},r.prototype[Symbol.iterator]=function*(){var s=function*f(p,m){if(st(p))for(var d=0;d<p.length;d++)yield*f(p[d],m.concat(d));else yield{value:p,index:m}};yield*s(this._data,[])},r.prototype.rows=function(){var s=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var p=this._data;for(var m of p)s.push(new r([m],this._datatype));return s},r.prototype.columns=function(){var s=this,f=[],p=this.size();if(p.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var m=this._data,d=function(w){var v=m.map(x=>[x[w]]);f.push(new r(v,s._datatype))},h=0;h<p[1];h++)d(h);return f},r.prototype.toArray=function(){return ze(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(s){return Ge(this._data,s)},r.prototype.toString=function(){return Ge(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(s){if(s){if($e(s)&&(s=s.toNumber()),!Ue(s)||!Fe(s))throw new TypeError("The parameter k must be an integer number")}else s=0;for(var f=s>0?s:0,p=s<0?-s:0,m=this._size[0],d=this._size[1],h=Math.min(m-p,d-f),w=[],v=0;v<h;v++)w[v]=this._data[v+p][v+f];return new r({data:w,size:[h],datatype:this._datatype})},r.diagonal=function(s,f,p,m){if(!st(s))throw new TypeError("Array expected, size parameter");if(s.length!==2)throw new Error("Only two dimensions matrix are supported");if(s=s.map(function(E){if($e(E)&&(E=E.toNumber()),!Ue(E)||!Fe(E)||E<1)throw new Error("Size values must be positive integers");return E}),p){if($e(p)&&(p=p.toNumber()),!Ue(p)||!Fe(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var d=p>0?p:0,h=p<0?-p:0,w=s[0],v=s[1],x=Math.min(w-h,v-d),g;if(st(f)){if(f.length!==x)throw new Error("Invalid value array length");g=function(E){return f[E]}}else if(ke(f)){var b=f.size();if(b.length!==1||b[0]!==x)throw new Error("Invalid matrix length");g=function(E){return f.get([E])}}else g=function(){return f};m||(m=$e(g(0))?g(0).mul(0):0);var y=[];if(s.length>0){y=ha(y,s,m);for(var N=0;N<x;N++)y[N+h][N+d]=g(N)}return new r({data:y,size:[w,v]})},r.fromJSON=function(s){return new r(s)},r.prototype.swapRows=function(s,f){if(!Ue(s)||!Fe(s)||!Ue(f)||!Fe(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(s,this._size[0]),pt(f,this._size[0]),r._swapRows(s,f,this._data),this},r._swapRows=function(s,f,p){var m=p[s];p[s]=p[f],p[f]=m};function l(s){return ke(s)?l(s.valueOf()):st(s)?s.map(l):s}return r},{isClass:!0}),ap="clone",dD=["typed"],hD=U(ap,dD,e=>{var{typed:t}=e;return t(ap,{any:ze})});function Av(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}function Ea(e){for(var t=0;t<e.length;t++)if(Fr(e[t]))return!0;return!1}function Sn(e,t){ke(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?Sn(i,t):t(i)}}function Qe(e,t,r){return e&&typeof e.map=="function"?e.map(function(n){return Qe(n,t)}):t(e)}function xu(e,t,r){var n=Array.isArray(e)?Ve(e):e.size();if(t<0||t>=n.length)throw new $r(t,n.length);return ke(e)?e.create(zs(e.valueOf(),t,r)):zs(e,t,r)}function zs(e,t,r){var n,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=Av(e),i=[],n=0;n<o.length;n++)i[n]=zs(o[n],t-1,r);return i}else{for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}else{for(i=[],n=0;n<e.length;n++)i[n]=zs(e[n],t-1,r);return i}}function op(e,t,r,n,i,a,o,u,c,l,s){var f=e._values,p=e._index,m=e._ptr,d,h,w,v;if(n)for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v),n[v]=f[d]):(n[v]=u(n[v],f[d]),i[v]=a);else for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v)):i[v]=a}var sp="isInteger",gD=["typed"],vD=U(sp,gD,e=>{var{typed:t}=e;return t(sp,{number:Fe,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Hr="number",Aa="number, number";function Sv(e){return Math.abs(e)}Sv.signature=Hr;function Cv(e,t){return e+t}Cv.signature=Aa;function Mv(e,t){return e-t}Mv.signature=Aa;function _v(e,t){return e*t}_v.signature=Aa;function Fv(e){return-e}Fv.signature=Hr;function Tv(e){return e}Tv.signature=Hr;function Za(e){return gN(e)}Za.signature=Hr;function Ov(e){return e*e*e}Ov.signature=Hr;function Bv(e){return Math.exp(e)}Bv.signature=Hr;function kv(e){return vN(e)}kv.signature=Hr;function Iv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}Iv.signature=Aa;function yD(e,t){return Math.log(e)}function Rv(e){return dN(e)}Rv.signature=Hr;function qv(e){return mN(e)}qv.signature=Hr;function up(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function Lc(e){return Wn(e)}Lc.signature=Hr;function zv(e){return e*e}zv.signature=Hr;function jv(e,t){var r,n,i,a=0,o=1,u=1,c=0;if(!Fe(e)||!Fe(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=a,a=o-n*a,o=r,r=u,u=c-n*u,c=r,e=t,t=i;var l;return e<0?l=[-e,-o,-c]:l=[e,e?o:0,c],l}jv.signature=Aa;function Lv(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}Lv.signature=Aa;function $a(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Fe(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Wg(e,t))}var bD="number",Sa="number, number";function Pv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitAnd");return e&t}Pv.signature=Sa;function Vv(e){if(!Fe(e))throw new Error("Integer expected in function bitNot");return~e}Vv.signature=bD;function Uv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitOr");return e|t}Uv.signature=Sa;function $v(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitXor");return e^t}$v.signature=Sa;function Hv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function leftShift");return e<<t}Hv.signature=Sa;function Jv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightArithShift");return e>>t}Jv.signature=Sa;function Gv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}Gv.signature=Sa;function xn(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return xn(e,r)*xn(r+1,t)}function Wv(e,t){if(!Fe(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Fe(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t<r?r+1:t+1,a=2,o=t<r?t:r,u=i;u<=e;++u)for(n*=u;a<=o&&n%a===0;)n/=a,++a;return a<=o&&(n/=xn(a,o)),n}Wv.signature="number, number";var xD=Math.PI,wD=2*Math.PI,ND=Math.E,DD=1.618033988749895,ED="number",Sl="number, number";function Kv(e){return!e}Kv.signature=ED;function Qv(e,t){return!!(e||t)}Qv.signature=Sl;function Zv(e,t){return!!e!=!!t}Zv.signature=Sl;function Xv(e,t){return!!(e&&t)}Xv.signature=Sl;function js(e){var t;if(Fe(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:xn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*js(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=oa[0];for(var o=1;o<oa.length;++o)t+=oa[o]/(e+o);var u=e+Yv+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*t}js.signature="number";var Yv=4.7421875,oa=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],ey=.9189385332046728,AD=5,SD=7,cp=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Ls(e){if(e<0)return NaN;if(e===0)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Ls(1-e);e=e-1;for(var t=e+AD+.5,r=cp[0],n=SD-1;n>=1;n--)r+=cp[n]/(e+n);return ey+(e+.5)*Math.log(t)-t+Math.log(r)}Ls.signature="number";var er="number";function ty(e){return NN(e)}ty.signature=er;function ry(e){return Math.atan(1/e)}ry.signature=er;function ny(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}ny.signature=er;function iy(e){return Math.asin(1/e)}iy.signature=er;function ay(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}ay.signature=er;function oy(e){return Math.acos(1/e)}oy.signature=er;function sy(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}sy.signature=er;function uy(e){return DN(e)}uy.signature=er;function cy(e){return EN(e)}cy.signature=er;function ly(e){return 1/Math.tan(e)}ly.signature=er;function fy(e){var t=Math.exp(2*e);return(t+1)/(t-1)}fy.signature=er;function py(e){return 1/Math.sin(e)}py.signature=er;function my(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Wn(e)}my.signature=er;function dy(e){return 1/Math.cos(e)}dy.signature=er;function hy(e){return 2/(Math.exp(e)+Math.exp(-e))}hy.signature=er;function gy(e){return SN(e)}gy.signature=er;var wu="number";function vy(e){return e<0}vy.signature=wu;function yy(e){return e>0}yy.signature=wu;function by(e){return e===0}by.signature=wu;function xy(e){return Number.isNaN(e)}xy.signature=wu;var lp="isNegative",CD=["typed"],MD=U(lp,CD,e=>{var{typed:t}=e;return t(lp,{number:vy,BigNumber:function(r){return r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s<0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),fp="isNumeric",_D=["typed"],FD=U(fp,_D,e=>{var{typed:t}=e;return t(fp,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),pp="hasNumericValue",TD=["typed","isNumeric"],OD=U(pp,TD,e=>{var{typed:t,isNumeric:r}=e;return t(pp,{boolean:()=>!0,string:function(n){return n.trim().length>0&&!isNaN(Number(n))},any:function(n){return r(n)}})}),mp="isPositive",BD=["typed"],kD=U(mp,BD,e=>{var{typed:t}=e;return t(mp,{number:yy,BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),dp="isZero",ID=["typed"],RD=U(dp,ID,e=>{var{typed:t}=e;return t(dp,{number:by,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:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),hp="isNaN",qD=["typed"],zD=U(hp,qD,e=>{var{typed:t}=e;return t(hp,{number:xy,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":t.referToSelf(r=>n=>Qe(n,r))})}),gp="typeOf",jD=["typed"],LD=U(gp,jD,e=>{var{typed:t}=e;return t(gp,{any:dt})});function Tr(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}function PD(e,t,r){return sr(e.re,t.re,r)&&sr(e.im,t.im,r)}var Ca=U("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Ps="equalScalar",VD=["typed","config"],UD=U(Ps,VD,e=>{var{typed:t,config:r}=e,n=Ca({typed:t});return t(Ps,{"boolean, boolean":function(i,a){return i===a},"number, number":function(i,a){return sr(i,a,r.epsilon)},"BigNumber, BigNumber":function(i,a){return i.eq(a)||Tr(i,a,r.epsilon)},"Fraction, Fraction":function(i,a){return i.equals(a)},"Complex, Complex":function(i,a){return PD(i,a,r.epsilon)}},n)});U(Ps,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ps,{"number, number":function(n,i){return sr(n,i,r.epsilon)}})});var $D="SparseMatrix",HD=["typed","equalScalar","Matrix"],JD=U($D,HD,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(h,w){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(w&&!Qt(w))throw new Error("Invalid datatype: "+w);if(ke(h))a(this,h,w);else if(h&&st(h.index)&&st(h.ptr)&&st(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=w||h.datatype;else if(st(h))o(this,h,w);else{if(h)throw new TypeError("Unsupported type of data ("+dt(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=w}}function a(h,w,v){w.type==="SparseMatrix"?(h._values=w._values?ze(w._values):void 0,h._index=ze(w._index),h._ptr=ze(w._ptr),h._size=ze(w._size),h._datatype=v||w._datatype):o(h,w.valueOf(),v||w._datatype)}function o(h,w,v){h._values=[],h._index=[],h._ptr=[],h._datatype=v;var x=w.length,g=0,b=r,y=0;if(Qt(v)&&(b=t.find(r,[v,v])||r,y=t.convert(0,v)),x>0){var N=0;do{h._ptr.push(h._index.length);for(var E=0;E<x;E++){var A=w[E];if(st(A)){if(N===0&&g<A.length&&(g=A.length),N<A.length){var D=A[N];b(D,y)||(h._values.push(D),h._index.push(E))}}else N===0&&g<1&&(g=1),b(A,y)||(h._values.push(A),h._index.push(E))}N++}while(N<g)}h._ptr.push(h._index.length),h._size=[x,g]}i.prototype=new n,i.prototype.createSparseMatrix=function(h,w){return new i(h,w)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return so(this._values,dt)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(h,w){return new i(h,w)},i.prototype.density=function(){var h=this._size[0],w=this._size[1];return h!==0&&w!==0?this._index.length/(h*w):0},i.prototype.subset=function(h,w,v){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,h);case 2:case 3:return c(this,h,w,v);default:throw new SyntaxError("Wrong number of arguments")}};function u(h,w){if(!fu(w))throw new TypeError("Invalid index");var v=w.isScalar();if(v)return h.get(w.min());var x=w.size();if(x.length!==h._size.length)throw new Ke(x.length,h._size.length);var g,b,y,N,E=w.min(),A=w.max();for(g=0,b=h._size.length;g<b;g++)pt(E[g],h._size[g]),pt(A[g],h._size[g]);var D=h._values,S=h._index,C=h._ptr,_=w.dimension(0),R=w.dimension(1),P=[],I=[];_.forEach(function(k,te){I[k]=te[0],P[k]=!0});var O=D?[]:void 0,F=[],q=[];return R.forEach(function(k){for(q.push(F.length),y=C[k],N=C[k+1];y<N;y++)g=S[y],P[g]===!0&&(F.push(I[g]),O&&O.push(D[y]))}),q.push(F.length),new i({values:O,index:F,ptr:q,size:x,datatype:h._datatype})}function c(h,w,v,x){if(!w||w.isIndex!==!0)throw new TypeError("Invalid index");var g=w.size(),b=w.isScalar(),y;if(ke(v)?(y=v.size(),v=v.toArray()):y=Ve(v),b){if(y.length!==0)throw new TypeError("Scalar expected");h.set(w.min(),v,x)}else{if(g.length!==1&&g.length!==2)throw new Ke(g.length,h._size.length,"<");if(y.length<g.length){for(var N=0,E=0;g[N]===1&&y[N]===1;)N++;for(;g[N]===1;)E++,N++;v=bv(v,g.length,E,y)}if(!Oi(g,y))throw new Ke(g,y,">");if(g.length===1){var A=w.dimension(0);A.forEach(function(C,_){pt(C),h.set([C,0],v[_[0]],x)})}else{var D=w.dimension(0),S=w.dimension(1);D.forEach(function(C,_){pt(C),S.forEach(function(R,P){pt(R),h.set([C,R],v[_[0]][P[0]],x)})})}}return h}i.prototype.get=function(h){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new Ke(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var w=h[0],v=h[1];pt(w,this._size[0]),pt(v,this._size[1]);var x=l(w,this._ptr[v],this._ptr[v+1],this._index);return x<this._ptr[v+1]&&this._index[x]===w?this._values[x]:0},i.prototype.set=function(h,w,v){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new Ke(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var x=h[0],g=h[1],b=this._size[0],y=this._size[1],N=r,E=0;Qt(this._datatype)&&(N=t.find(r,[this._datatype,this._datatype])||r,E=t.convert(0,this._datatype)),(x>b-1||g>y-1)&&(p(this,Math.max(x+1,b),Math.max(g+1,y),v),b=this._size[0],y=this._size[1]),pt(x,b),pt(g,y);var A=l(x,this._ptr[g],this._ptr[g+1],this._index);return A<this._ptr[g+1]&&this._index[A]===x?N(w,E)?s(A,g,this._values,this._index,this._ptr):this._values[A]=w:N(w,E)||f(A,x,g,w,this._values,this._index,this._ptr),this};function l(h,w,v,x){if(v-w===0)return v;for(var g=w;g<v;g++)if(x[g]===h)return g;return w}function s(h,w,v,x,g){v.splice(h,1),x.splice(h,1);for(var b=w+1;b<g.length;b++)g[b]--}function f(h,w,v,x,g,b,y){g.splice(h,0,x),b.splice(h,0,w);for(var N=v+1;N<y.length;N++)y[N]++}i.prototype.resize=function(h,w,v){if(!Fr(h))throw new TypeError("Array or Matrix expected");var x=h.valueOf().map(b=>Array.isArray(b)&&b.length===1?b[0]:b);if(x.length!==2)throw new Error("Only two dimensions matrix are supported");x.forEach(function(b){if(!Ue(b)||!Fe(b)||b<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(x)+")")});var g=v?this.clone():this;return p(g,x[0],x[1],w)};function p(h,w,v,x){var g=x||0,b=r,y=0;Qt(h._datatype)&&(b=t.find(r,[h._datatype,h._datatype])||r,y=t.convert(0,h._datatype),g=t.convert(g,h._datatype));var N=!b(g,y),E=h._size[0],A=h._size[1],D,S,C;if(v>A){for(S=A;S<v;S++)if(h._ptr[S]=h._values.length,N)for(D=0;D<E;D++)h._values.push(g),h._index.push(D);h._ptr[v]=h._values.length}else v<A&&(h._ptr.splice(v+1,A-v),h._values.splice(h._ptr[v],h._values.length),h._index.splice(h._ptr[v],h._index.length));if(A=v,w>E){if(N){var _=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]+_,C=h._ptr[S+1]+_;var R=0;for(D=E;D<w;D++,R++)h._values.splice(C+R,0,g),h._index.splice(C+R,0,D),_++}h._ptr[A]=h._values.length}}else if(w<E){var P=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]-P;var I=h._ptr[S],O=h._ptr[S+1]-P;for(C=I;C<O;C++)D=h._index[C],D>w-1&&(h._values.splice(C,1),h._index.splice(C,1),P++)}h._ptr[S]=h._values.length}return h._size[0]=w,h._size[1]=v,h}i.prototype.reshape=function(h,w){if(!st(h))throw new TypeError("Array expected");if(h.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");h.forEach(function(k){if(!Ue(k)||!Fe(k)||k<=-2||k===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ge(h)+")")});var v=this._size[0]*this._size[1];h=Al(h,v);var x=h[0]*h[1];if(v!==x)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var g=w?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return g;for(var b=[],y=0;y<g._ptr.length;y++)for(var N=0;N<g._ptr[y+1]-g._ptr[y];N++)b.push(y);for(var E=g._values.slice(),A=g._index.slice(),D=0;D<g._index.length;D++){var S=A[D],C=b[D],_=S*g._size[1]+C;b[D]=_%h[1],A[D]=Math.floor(_/h[1])}g._values.length=0,g._index.length=0,g._ptr.length=h[1]+1,g._size=h.slice();for(var R=0;R<g._ptr.length;R++)g._ptr[R]=0;for(var P=0;P<E.length;P++){var I=A[P],O=b[P],F=E[P],q=l(I,g._ptr[O],g._ptr[O+1],g._index);f(q,I,O,F,g._values,g._index,g._ptr)}return g},i.prototype.clone=function(){var h=new i({values:this._values?ze(this._values):void 0,index:ze(this._index),ptr:ze(this._ptr),size:ze(this._size),datatype:this._datatype});return h},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(h,w){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var v=this,x=this._size[0],g=this._size[1],b=Ev(h),y=function(N,E,A){return b===1?h(N):b===2?h(N,[E,A]):h(N,[E,A],v)};return m(this,0,x-1,0,g-1,y,w)};function m(h,w,v,x,g,b,y){var N=[],E=[],A=[],D=r,S=0;Qt(h._datatype)&&(D=t.find(r,[h._datatype,h._datatype])||r,S=t.convert(0,h._datatype));for(var C=function(K,V,ue){K=b(K,V,ue),D(K,S)||(N.push(K),E.push(V))},_=x;_<=g;_++){A.push(N.length);var R=h._ptr[_],P=h._ptr[_+1];if(y)for(var I=R;I<P;I++){var O=h._index[I];O>=w&&O<=v&&C(h._values[I],O-w,_-x)}else{for(var F={},q=R;q<P;q++){var k=h._index[q];F[k]=h._values[q]}for(var te=w;te<=v;te++){var se=te in F?F[te]:0;C(se,te-w,_-x)}}}return A.push(N.length),new i({values:N,index:E,ptr:A,size:[v-w+1,g-x+1]})}i.prototype.forEach=function(h,w){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var v=this,x=this._size[0],g=this._size[1],b=0;b<g;b++){var y=this._ptr[b],N=this._ptr[b+1];if(w)for(var E=y;E<N;E++){var A=this._index[E];h(this._values[E],[A,b],v)}else{for(var D={},S=y;S<N;S++){var C=this._index[S];D[C]=this._values[S]}for(var _=0;_<x;_++){var R=_ in D?D[_]:0;h(R,[_,b],v)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var h=this._size[1],w=0;w<h;w++)for(var v=this._ptr[w],x=this._ptr[w+1],g=v;g<x;g++){var b=this._index[g];yield{value:this._values[g],index:[b,w]}}},i.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)};function d(h,w,v,x,g){var b=x[0],y=x[1],N=[],E,A;for(E=0;E<b;E++)for(N[E]=[],A=0;A<y;A++)N[E][A]=0;for(A=0;A<y;A++)for(var D=v[A],S=v[A+1],C=D;C<S;C++)E=w[C],N[E][A]=h?g?ze(h[C]):h[C]:1;return N}return i.prototype.format=function(h){for(var w=this._size[0],v=this._size[1],x=this.density(),g="Sparse Matrix ["+Ge(w,h)+" x "+Ge(v,h)+"] density: "+Ge(x,h)+`
|
|
26
|
+
**/(function(e,t){(function(r){var n=2e3,i={s:1,n:0,d:1};function a(v,x){if(isNaN(v=parseInt(v,10)))throw h();return v*x}function o(v,x){if(x===0)throw d();var g=Object.create(m.prototype);g.s=v<0?-1:1,v=v<0?-v:v;var b=p(v,x);return g.n=v/b,g.d=x/b,g}function u(v){for(var x={},g=v,b=2,y=4;y<=g;){for(;g%b===0;)g/=b,x[b]=(x[b]||0)+1;y+=1+2*b++}return g!==v?g>1&&(x[g]=(x[g]||0)+1):x[v]=(x[v]||0)+1,x}var c=function(v,x){var g=0,b=1,y=1,N=0,E=0,A=0,D=1,S=1,C=0,_=1,R=1,P=1,I=1e7,O;if(v!=null)if(x!==void 0){if(g=v,b=x,y=g*b,g%1!==0||b%1!==0)throw w()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)g=v.n,b=v.d,"s"in v&&(g*=v.s);else if(0 in v)g=v[0],1 in v&&(b=v[1]);else throw h();y=g*b;break}case"number":{if(v<0&&(y=v,v=-v),v%1===0)g=v;else if(v>0){for(v>=1&&(S=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=S);_<=I&&P<=I;)if(O=(C+R)/(_+P),v===O){_+P<=I?(g=C+R,b=_+P):P>_?(g=R,b=P):(g=C,b=_);break}else v>O?(C+=R,_+=P):(R+=C,P+=_),_>I?(g=R,b=P):(g=C,b=_);g*=S}else(isNaN(v)||isNaN(x))&&(b=g=NaN);break}case"string":{if(_=v.match(/\d+|./g),_===null)throw h();if(_[C]==="-"?(y=-1,C++):_[C]==="+"&&C++,_.length===C+1?E=a(_[C++],y):_[C+1]==="."||_[C]==="."?(_[C]!=="."&&(N=a(_[C++],y)),C++,(C+1===_.length||_[C+1]==="("&&_[C+3]===")"||_[C+1]==="'"&&_[C+3]==="'")&&(E=a(_[C],y),D=Math.pow(10,_[C].length),C++),(_[C]==="("&&_[C+2]===")"||_[C]==="'"&&_[C+2]==="'")&&(A=a(_[C+1],y),S=Math.pow(10,_[C+1].length)-1,C+=3)):_[C+1]==="/"||_[C+1]===":"?(E=a(_[C],y),D=a(_[C+2],1),C+=3):_[C+3]==="/"&&_[C+1]===" "&&(N=a(_[C],y),E=a(_[C+2],y),D=a(_[C+4],1),C+=5),_.length<=C){b=D*S,y=g=A+b*N+S*E;break}}default:throw h()}if(b===0)throw d();i.s=y<0?-1:1,i.n=Math.abs(g),i.d=Math.abs(b)};function l(v,x,g){for(var b=1;x>0;v=v*v%g,x>>=1)x&1&&(b=b*v%g);return b}function s(v,x){for(;x%2===0;x/=2);for(;x%5===0;x/=5);if(x===1)return 0;for(var g=10%x,b=1;g!==1;b++)if(g=g*10%x,b>n)return 0;return b}function f(v,x,g){for(var b=1,y=l(10,g,x),N=0;N<300;N++){if(b===y)return N;b=b*10%x,y=y*10%x}return 0}function p(v,x){if(!v)return x;if(!x)return v;for(;;){if(v%=x,!v)return x;if(x%=v,!x)return v}}function m(v,x){if(c(v,x),this instanceof m)v=p(i.d,i.n),this.s=i.s,this.n=i.n/v,this.d=i.d/v;else return o(i.s*i.n,i.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},w=function(){return new Error("Parameters must be integer")};m.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(v,x){return c(v,x),o(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(v,x){return c(v,x),o(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(v,x){return c(v,x),o(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(v,x){return c(v,x),o(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(v,x){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(v===void 0)return o(this.s*this.n%this.d,1);if(c(v,x),i.n===0&&this.d===0)throw d();return o(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(v,x){return c(v,x),o(p(i.n,this.n)*p(i.d,this.d),i.d*this.d)},lcm:function(v,x){return c(v,x),i.n===0&&this.n===0?o(0,1):o(i.n*this.n,p(i.n,this.n)*p(i.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(v,x){if(c(v,x),i.d===1)return i.s<0?o(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):o(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var g=u(this.n),b=u(this.d),y=1,N=1;for(var E in g)if(E!=="1"){if(E==="0"){y=0;break}if(g[E]*=i.n,g[E]%i.d===0)g[E]/=i.d;else return null;y*=Math.pow(E,g[E])}for(var E in b)if(E!=="1"){if(b[E]*=i.n,b[E]%i.d===0)b[E]/=i.d;else return null;N*=Math.pow(E,b[E])}return i.s<0?o(N,y):o(y,N)},equals:function(v,x){return c(v,x),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(v,x){c(v,x);var g=this.s*this.n*i.d-i.s*i.n*this.d;return(0<g)-(g<0)},simplify:function(v){if(isNaN(this.n)||isNaN(this.d))return this;v=v||.001;for(var x=this.abs(),g=x.toContinued(),b=1;b<g.length;b++){for(var y=o(g[b-1],1),N=b-2;N>=0;N--)y=y.inverse().add(g[N]);if(Math.abs(y.sub(x).valueOf())<v)return y.mul(this.s)}return this},divisible:function(v,x){return c(v,x),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(v){var x,g="",b=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=b:(v&&(x=Math.floor(b/y))>0&&(g+=x,g+=" ",b%=y),g+=b,g+="/",g+=y),g},toLatex:function(v){var x,g="",b=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=b:(v&&(x=Math.floor(b/y))>0&&(g+=x,b%=y),g+="\\frac{",g+=b,g+="}{",g+=y,g+="}"),g},toContinued:function(){var v,x=this.n,g=this.d,b=[];if(isNaN(x)||isNaN(g))return b;do b.push(Math.floor(x/g)),v=x%g,x=g,g=v;while(x!==1);return b},toString:function(v){var x=this.n,g=this.d;if(isNaN(x)||isNaN(g))return"NaN";v=v||15;var b=s(x,g),y=f(x,g,b),N=this.s<0?"-":"";if(N+=x/g|0,x%=g,x*=10,x&&(N+="."),b){for(var E=y;E--;)N+=x/g|0,x%=g,x*=10;N+="(";for(var E=b;E--;)N+=x/g|0,x%=g,x*=10;N+=")"}else for(var E=v;x&&E--;)N+=x/g|0,x%=g,x*=10;return N}},Object.defineProperty(m,"__esModule",{value:!0}),m.default=m,m.Fraction=m,e.exports=m})()})(Dv);var Y2=Dv.exports;const dn=So(Y2);var eD="Fraction",tD=[],rD=U(eD,tD,()=>(Object.defineProperty(dn,"name",{value:"Fraction"}),dn.prototype.constructor=dn,dn.prototype.type="Fraction",dn.prototype.isFraction=!0,dn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},dn.fromJSON=function(e){return new dn(e)},dn),{isClass:!0}),nD="Range",iD=[],aD=U(nD,iD,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,a=r!=null,o=n!=null;if(i){if($e(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(a){if($e(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(o){if($e(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=a?parseFloat(r):0,this.step=o?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,a=i-r;return Kn(n)===Kn(a)?t=Math.ceil(a/n):a===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;r<i;)t(r,[a],this),r+=n,a++;else if(n<0)for(;r>i;)t(r,[a],this),r+=n,a++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,a){r[i[0]]=t(n,i,a)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=Ei(this.start,t);return this.step!==1&&(r+=":"+Ei(this.step,t)),r+=":"+Ei(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0}),oD="Matrix",sD=[],uD=U(oD,sD,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function dc(e,t,r){var n=e.constructor,i=new n(2),a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),a="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function cD(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=rv(t);switch(r){case"fixed":return fD(e,n);case"exponential":return sp(e,n);case"engineering":return lD(e,n);case"bin":return dc(e,2,i);case"oct":return dc(e,8,i);case"hex":return dc(e,16,i);case"auto":{var a=up(t==null?void 0:t.lowerExp,-3),o=up(t==null?void 0:t.upperExp,5);if(e.isZero())return"0";var u,c=e.toSignificantDigits(n),l=c.e;return l>=a&&l<o?u=c.toFixed():u=sp(e,n),u.replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],f=arguments[4];return s!=="."?s+f:f})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function lD(e,t){var r=e.e,n=r%3===0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(r>=0?"+":"")+n.toString()}function sp(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function fD(e,t){return e.toFixed(t)}function up(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function pD(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Ge(e,t){var r=mD(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function mD(e,t){if(typeof e=="number")return Ei(e,t);if($e(e))return cD(e,t);if(dD(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return Ev(e,t);if(Qt(e))return oa(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>oa(n)+": "+Ge(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function oa(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in cp?cp[i]:i,n++}return'"'+r+'"'}var cp={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function Mr(e){var t=String(e);return t=t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t}function Ev(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)i!==0&&(r+=", "),r+=Ev(e[i],t);return r+="]",r}else return Ge(e,t)}function dD(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function Uc(e,t){if(!Qt(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(e)+", index: 0)");if(!Qt(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(t)+", index: 1)");return e===t?0:e>t?1:-1}function We(e,t,r){if(!(this instanceof We))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}We.prototype=new RangeError;We.prototype.constructor=RangeError;We.prototype.name="DimensionError";We.prototype.isDimensionError=!0;function $r(e,t,r){if(!(this instanceof $r))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),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}$r.prototype=new RangeError;$r.prototype.constructor=RangeError;$r.prototype.name="IndexError";$r.prototype.isIndexError=!0;function Ve(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Av(e,t,r){var n,i=e.length;if(i!==t[r])throw new We(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new We(t.length-1,t.length,"<");Av(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new We(t.length+1,t.length,">")}function lp(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new We(e.length,0)}else Av(e,t,0)}function zs(e,t){var r=e.isMatrix?e._size:Ve(e),n=t._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==r[a])throw new We(i,r[a])})}function pt(e,t){if(e!==void 0){if(!Ue(e)||!Fe(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new $r(e,t)}}function va(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&st(r._data)){if(r._size[0]===0)return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(Qt(r)&&r.length===0)return!0}return!1}function ya(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!Ue(i)||!Fe(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(t)+")")}),(Ue(e)||$e(e))&&(e=[e]);var n=r!==void 0?r:0;return $c(e,t,0,n),e}function $c(e,t,r,n){var i,a,o=e.length,u=t[r],c=Math.min(o,u);if(e.length=u,r<t.length-1){var l=r+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),$c(a,t,l,n);for(i=c;i<u;i++)a=[],e[i]=a,$c(a,t,l,n)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<u;i++)e[i]=n}}function Fl(e,t){var r=ot(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new We(0,n,"!=");t=Tl(t,n);var i=Sv(t);if(n!==i)throw new We(i,n,"!=");try{return hD(r,t)}catch(a){throw a instanceof We?new We(i,n,"!="):a}}function Tl(e,t){var r=Sv(e),n=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,c=t%r===0;if(u)if(c)n[a]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function Sv(e){return e.reduce((t,r)=>t*r,1)}function hD(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var a=t[i];n=[];for(var o=r.length/a,u=0;u<o;u++)n.push(r.slice(u*a,(u+1)*a));r=n}return r}function js(e,t){for(var r=Ve(e);Array.isArray(e)&&e.length===1;)e=e[0],r.shift();for(var n=r.length;r[n-1]===1;)n--;return n<r.length&&(e=Cv(e,n,0),r.length=n),e}function Cv(e,t,r){var n,i;if(r<t){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=Cv(e[n],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function Mv(e,t,r,n){var i=n||Ve(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=_v(e,t,0);i.length<t;)i.push(1);return e}function _v(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=_v(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function ot(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function r(n){Array.isArray(n)?n.forEach(r):t.push(n)}),t}function Nn(e,t){return Array.prototype.map.call(e,t)}function Eu(e,t){Array.prototype.forEach.call(e,t)}function Fv(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function Ls(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,r=>t.test(r))}function fp(e,t){return Array.prototype.join.call(e,t)}function ba(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function Ps(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function fo(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(n=a.length),o&&a.length!==n)return;var u=o?fo(a,t):t(a);if(r===void 0)r=u;else if(r!==u)return"mixed"}return r}function Tv(e,t,r,n){if(n<r){if(e.length!==t.length)throw new We(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=Tv(e[a],t[a],r,n+1);return i}else return e.concat(t)}function Ov(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(r,n){return Tv(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function gD(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(p=>p.length),i=Math.max(...n),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],c=n[o],l=0;l<c;l++){var s=i-c+l;u[l]>a[s]&&(a[s]=u[l])}for(var f=0;f<t.length;f++)Vs(t[f],a);return a}function Vs(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function pp(e,t){var r=Ve(e);if(ki(r,t))return e;Vs(r,t);var n=gD(r,t),i=n.length,a=[...Array(i-r.length).fill(1),...r],o=yD(e);r.length<i&&(o=Fl(o,a),r=Ve(o));for(var u=0;u<i;u++)r[u]<n[u]&&(o=vD(o,n[u],u),r=Ve(o));return o}function vD(e,t,r){return Ov(...Array(t).fill(e),r)}function yD(e){return Ot([],e)}function bD(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(u){var c=i[u];if(c&&(delete n[c],delete i[u],--t,r===c)){if(!t){a=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(u){var c=i[u],l=++a;if(n[l]=u,i[u]=l,!c)return++t,t<=e?void 0:(u=n[r],o(u),u);if(delete n[c],r===c)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function Co(e){var{hasher:t,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:bD(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t(i);if(n.cache.values.has(o))return n.cache.lru.hit(o),n.cache.values.get(o);var u=e.apply(e,i);return n.cache.values.set(o,u),n.cache.values.delete(n.cache.lru.hit(o)),u}}function Bv(e){return Object.keys(e.signatures||{}).reduce(function(t,r){var n=(r.match(/,/g)||[]).length+1;return Math.max(t,n)},-1)}var xD="DenseMatrix",wD=["Matrix"],ND=U(xD,wD,e=>{var{Matrix:t}=e;function r(s,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Qt(f))throw new Error("Invalid datatype: "+f);if(ke(s))s.type==="DenseMatrix"?(this._data=ze(s._data),this._size=ze(s._size),this._datatype=f||s._datatype):(this._data=s.toArray(),this._size=s.size(),this._datatype=f||s._datatype);else if(s&&st(s.data)&&st(s.size))this._data=s.data,this._size=s.size,lp(this._data,this._size),this._datatype=f||s.datatype;else if(st(s))this._data=l(s),this._size=Ve(this._data),lp(this._data,this._size),this._datatype=f;else{if(s)throw new TypeError("Unsupported type of data ("+dt(s)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new t,r.prototype.createDenseMatrix=function(s,f){return new r(s,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return fo(this._data,dt)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(s,f){return new r(s,f)},r.prototype.subset=function(s,f,p){switch(arguments.length){case 1:return n(this,s);case 2:case 3:return a(this,s,f,p);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(s){if(!st(s))throw new TypeError("Array expected");if(s.length!==this._size.length)throw new We(s.length,this._size.length);for(var f=0;f<s.length;f++)pt(s[f],this._size[f]);for(var p=this._data,m=0,d=s.length;m<d;m++){var h=s[m];pt(h,p.length),p=p[h]}return p},r.prototype.set=function(s,f,p){if(!st(s))throw new TypeError("Array expected");if(s.length<this._size.length)throw new We(s.length,this._size.length,"<");var m,d,h,w=s.map(function(x){return x+1});c(this,w,p);var v=this._data;for(m=0,d=s.length-1;m<d;m++)h=s[m],pt(h,v.length),v=v[h];return h=s[s.length-1],pt(h,v.length),v[h]=f,this};function n(s,f){if(!gu(f))throw new TypeError("Invalid index");var p=f.isScalar();if(p)return s.get(f.min());var m=f.size();if(m.length!==s._size.length)throw new We(m.length,s._size.length);for(var d=f.min(),h=f.max(),w=0,v=s._size.length;w<v;w++)pt(d[w],s._size[w]),pt(h[w],s._size[w]);return new r(i(s._data,f,m.length,0),s._datatype)}function i(s,f,p,m){var d=m===p-1,h=f.dimension(m);return d?h.map(function(w){return pt(w,s.length),s[w]}).valueOf():h.map(function(w){pt(w,s.length);var v=s[w];return i(v,f,p,m+1)}).valueOf()}function a(s,f,p,m){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var d=f.size(),h=f.isScalar(),w;if(ke(p)?(w=p.size(),p=p.valueOf()):w=Ve(p),h){if(w.length!==0)throw new TypeError("Scalar expected");s.set(f.min(),p,m)}else{if(!ki(w,d))try{w.length===0?p=pp([p],d):p=pp(p,d),w=Ve(p)}catch{}if(d.length<s._size.length)throw new We(d.length,s._size.length,"<");if(w.length<d.length){for(var v=0,x=0;d[v]===1&&w[v]===1;)v++;for(;d[v]===1;)x++,v++;p=Mv(p,d.length,x,w)}if(!ki(d,w))throw new We(d,w,">");var g=f.max().map(function(N){return N+1});c(s,g,m);var b=d.length,y=0;o(s._data,f,p,b,y)}return s}function o(s,f,p,m,d){var h=d===m-1,w=f.dimension(d);h?w.forEach(function(v,x){pt(v),s[v]=p[x[0]]}):w.forEach(function(v,x){pt(v),o(s[v],f,p[x[0]],m,d+1)})}r.prototype.resize=function(s,f,p){if(!Fr(s))throw new TypeError("Array or Matrix expected");var m=s.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),d=p?this.clone():this;return u(d,m,f)};function u(s,f,p){if(f.length===0){for(var m=s._data;st(m);)m=m[0];return m}return s._size=f.slice(0),s._data=ya(s._data,s._size,p),s}r.prototype.reshape=function(s,f){var p=f?this.clone():this;p._data=Fl(p._data,s);var m=p._size.reduce((d,h)=>d*h);return p._size=Tl(s,m),p};function c(s,f,p){for(var m=s._size.slice(0),d=!1;m.length<f.length;)m.push(0),d=!0;for(var h=0,w=f.length;h<w;h++)f[h]>m[h]&&(m[h]=f[h],d=!0);d&&u(s,m,p)}r.prototype.clone=function(){var s=new r({data:ze(this._data),size:ze(this._size),datatype:this._datatype});return s},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(s){var f=this,p=Bv(s),m=function w(v,x){return st(v)?v.map(function(g,b){return w(g,x.concat(b))}):p===1?s(v):p===2?s(v,x):s(v,x,f)},d=m(this._data,[]),h=this._datatype!==void 0?fo(d,dt):void 0;return new r(d,h)},r.prototype.forEach=function(s){var f=this,p=function m(d,h){st(d)?d.forEach(function(w,v){m(w,h.concat(v))}):s(d,h,f)};p(this._data,[])},r.prototype[Symbol.iterator]=function*(){var s=function*f(p,m){if(st(p))for(var d=0;d<p.length;d++)yield*f(p[d],m.concat(d));else yield{value:p,index:m}};yield*s(this._data,[])},r.prototype.rows=function(){var s=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var p=this._data;for(var m of p)s.push(new r([m],this._datatype));return s},r.prototype.columns=function(){var s=this,f=[],p=this.size();if(p.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var m=this._data,d=function(w){var v=m.map(x=>[x[w]]);f.push(new r(v,s._datatype))},h=0;h<p[1];h++)d(h);return f},r.prototype.toArray=function(){return ze(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(s){return Ge(this._data,s)},r.prototype.toString=function(){return Ge(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(s){if(s){if($e(s)&&(s=s.toNumber()),!Ue(s)||!Fe(s))throw new TypeError("The parameter k must be an integer number")}else s=0;for(var f=s>0?s:0,p=s<0?-s:0,m=this._size[0],d=this._size[1],h=Math.min(m-p,d-f),w=[],v=0;v<h;v++)w[v]=this._data[v+p][v+f];return new r({data:w,size:[h],datatype:this._datatype})},r.diagonal=function(s,f,p,m){if(!st(s))throw new TypeError("Array expected, size parameter");if(s.length!==2)throw new Error("Only two dimensions matrix are supported");if(s=s.map(function(E){if($e(E)&&(E=E.toNumber()),!Ue(E)||!Fe(E)||E<1)throw new Error("Size values must be positive integers");return E}),p){if($e(p)&&(p=p.toNumber()),!Ue(p)||!Fe(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var d=p>0?p:0,h=p<0?-p:0,w=s[0],v=s[1],x=Math.min(w-h,v-d),g;if(st(f)){if(f.length!==x)throw new Error("Invalid value array length");g=function(E){return f[E]}}else if(ke(f)){var b=f.size();if(b.length!==1||b[0]!==x)throw new Error("Invalid matrix length");g=function(E){return f.get([E])}}else g=function(){return f};m||(m=$e(g(0))?g(0).mul(0):0);var y=[];if(s.length>0){y=ya(y,s,m);for(var N=0;N<x;N++)y[N+h][N+d]=g(N)}return new r({data:y,size:[w,v]})},r.fromJSON=function(s){return new r(s)},r.prototype.swapRows=function(s,f){if(!Ue(s)||!Fe(s)||!Ue(f)||!Fe(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(s,this._size[0]),pt(f,this._size[0]),r._swapRows(s,f,this._data),this},r._swapRows=function(s,f,p){var m=p[s];p[s]=p[f],p[f]=m};function l(s){return ke(s)?l(s.valueOf()):st(s)?s.map(l):s}return r},{isClass:!0}),mp="clone",DD=["typed"],ED=U(mp,DD,e=>{var{typed:t}=e;return t(mp,{any:ze})});function kv(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}function Ca(e){for(var t=0;t<e.length;t++)if(Fr(e[t]))return!0;return!1}function Sn(e,t){ke(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?Sn(i,t):t(i)}}function Qe(e,t,r){return e&&typeof e.map=="function"?e.map(function(n){return Qe(n,t)}):t(e)}function Au(e,t,r){var n=Array.isArray(e)?Ve(e):e.size();if(t<0||t>=n.length)throw new $r(t,n.length);return ke(e)?e.create(Us(e.valueOf(),t,r)):Us(e,t,r)}function Us(e,t,r){var n,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=kv(e),i=[],n=0;n<o.length;n++)i[n]=Us(o[n],t-1,r);return i}else{for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}else{for(i=[],n=0;n<e.length;n++)i[n]=Us(e[n],t-1,r);return i}}function dp(e,t,r,n,i,a,o,u,c,l,s){var f=e._values,p=e._index,m=e._ptr,d,h,w,v;if(n)for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v),n[v]=f[d]):(n[v]=u(n[v],f[d]),i[v]=a);else for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v)):i[v]=a}var hp="isInteger",AD=["typed"],SD=U(hp,AD,e=>{var{typed:t}=e;return t(hp,{number:Fe,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Hr="number",Ma="number, number";function Iv(e){return Math.abs(e)}Iv.signature=Hr;function Rv(e,t){return e+t}Rv.signature=Ma;function qv(e,t){return e-t}qv.signature=Ma;function zv(e,t){return e*t}zv.signature=Ma;function jv(e){return-e}jv.signature=Hr;function Lv(e){return e}Lv.signature=Hr;function to(e){return AN(e)}to.signature=Hr;function Pv(e){return e*e*e}Pv.signature=Hr;function Vv(e){return Math.exp(e)}Vv.signature=Hr;function Uv(e){return SN(e)}Uv.signature=Hr;function $v(e,t){if(!Fe(e)||!Fe(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}$v.signature=Ma;function CD(e,t){return Math.log(e)}function Hv(e){return DN(e)}Hv.signature=Hr;function Jv(e){return NN(e)}Jv.signature=Hr;function gp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function Hc(e){return Kn(e)}Hc.signature=Hr;function Gv(e){return e*e}Gv.signature=Hr;function Kv(e,t){var r,n,i,a=0,o=1,u=1,c=0;if(!Fe(e)||!Fe(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=a,a=o-n*a,o=r,r=u,u=c-n*u,c=r,e=t,t=i;var l;return e<0?l=[-e,-o,-c]:l=[e,e?o:0,c],l}Kv.signature=Ma;function Wv(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}Wv.signature=Ma;function Ga(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Fe(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(nv(e,t))}var MD="number",_a="number, number";function Qv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitAnd");return e&t}Qv.signature=_a;function Zv(e){if(!Fe(e))throw new Error("Integer expected in function bitNot");return~e}Zv.signature=MD;function Xv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitOr");return e|t}Xv.signature=_a;function Yv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitXor");return e^t}Yv.signature=_a;function ey(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function leftShift");return e<<t}ey.signature=_a;function ty(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightArithShift");return e>>t}ty.signature=_a;function ry(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}ry.signature=_a;function xn(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return xn(e,r)*xn(r+1,t)}function ny(e,t){if(!Fe(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Fe(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t<r?r+1:t+1,a=2,o=t<r?t:r,u=i;u<=e;++u)for(n*=u;a<=o&&n%a===0;)n/=a,++a;return a<=o&&(n/=xn(a,o)),n}ny.signature="number, number";var _D=Math.PI,FD=2*Math.PI,TD=Math.E,OD=1.618033988749895,BD="number",Ol="number, number";function iy(e){return!e}iy.signature=BD;function ay(e,t){return!!(e||t)}ay.signature=Ol;function oy(e,t){return!!e!=!!t}oy.signature=Ol;function sy(e,t){return!!(e&&t)}sy.signature=Ol;function $s(e){var t;if(Fe(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:xn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*$s(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=ca[0];for(var o=1;o<ca.length;++o)t+=ca[o]/(e+o);var u=e+uy+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*t}$s.signature="number";var uy=4.7421875,ca=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],cy=.9189385332046728,kD=5,ID=7,vp=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Hs(e){if(e<0)return NaN;if(e===0)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Hs(1-e);e=e-1;for(var t=e+kD+.5,r=vp[0],n=ID-1;n>=1;n--)r+=vp[n]/(e+n);return cy+(e+.5)*Math.log(t)-t+Math.log(r)}Hs.signature="number";var er="number";function ly(e){return TN(e)}ly.signature=er;function fy(e){return Math.atan(1/e)}fy.signature=er;function py(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}py.signature=er;function my(e){return Math.asin(1/e)}my.signature=er;function dy(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}dy.signature=er;function hy(e){return Math.acos(1/e)}hy.signature=er;function gy(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}gy.signature=er;function vy(e){return ON(e)}vy.signature=er;function yy(e){return BN(e)}yy.signature=er;function by(e){return 1/Math.tan(e)}by.signature=er;function xy(e){var t=Math.exp(2*e);return(t+1)/(t-1)}xy.signature=er;function wy(e){return 1/Math.sin(e)}wy.signature=er;function Ny(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Kn(e)}Ny.signature=er;function Dy(e){return 1/Math.cos(e)}Dy.signature=er;function Ey(e){return 2/(Math.exp(e)+Math.exp(-e))}Ey.signature=er;function Ay(e){return IN(e)}Ay.signature=er;var Su="number";function Sy(e){return e<0}Sy.signature=Su;function Cy(e){return e>0}Cy.signature=Su;function My(e){return e===0}My.signature=Su;function _y(e){return Number.isNaN(e)}_y.signature=Su;var yp="isNegative",RD=["typed"],qD=U(yp,RD,e=>{var{typed:t}=e;return t(yp,{number:Sy,BigNumber:function(r){return r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s<0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),bp="isNumeric",zD=["typed"],jD=U(bp,zD,e=>{var{typed:t}=e;return t(bp,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),xp="hasNumericValue",LD=["typed","isNumeric"],PD=U(xp,LD,e=>{var{typed:t,isNumeric:r}=e;return t(xp,{boolean:()=>!0,string:function(n){return n.trim().length>0&&!isNaN(Number(n))},any:function(n){return r(n)}})}),wp="isPositive",VD=["typed"],UD=U(wp,VD,e=>{var{typed:t}=e;return t(wp,{number:Cy,BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Np="isZero",$D=["typed"],HD=U(Np,$D,e=>{var{typed:t}=e;return t(Np,{number:My,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:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Dp="isNaN",JD=["typed"],GD=U(Dp,JD,e=>{var{typed:t}=e;return t(Dp,{number:_y,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":t.referToSelf(r=>n=>Qe(n,r))})}),Ep="typeOf",KD=["typed"],WD=U(Ep,KD,e=>{var{typed:t}=e;return t(Ep,{any:dt})});function Tr(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}function QD(e,t,r){return sr(e.re,t.re,r)&&sr(e.im,t.im,r)}var Fa=U("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Js="equalScalar",ZD=["typed","config"],XD=U(Js,ZD,e=>{var{typed:t,config:r}=e,n=Fa({typed:t});return t(Js,{"boolean, boolean":function(i,a){return i===a},"number, number":function(i,a){return sr(i,a,r.epsilon)},"BigNumber, BigNumber":function(i,a){return i.eq(a)||Tr(i,a,r.epsilon)},"Fraction, Fraction":function(i,a){return i.equals(a)},"Complex, Complex":function(i,a){return QD(i,a,r.epsilon)}},n)});U(Js,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Js,{"number, number":function(n,i){return sr(n,i,r.epsilon)}})});var YD="SparseMatrix",eE=["typed","equalScalar","Matrix"],tE=U(YD,eE,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(h,w){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(w&&!Qt(w))throw new Error("Invalid datatype: "+w);if(ke(h))a(this,h,w);else if(h&&st(h.index)&&st(h.ptr)&&st(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=w||h.datatype;else if(st(h))o(this,h,w);else{if(h)throw new TypeError("Unsupported type of data ("+dt(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=w}}function a(h,w,v){w.type==="SparseMatrix"?(h._values=w._values?ze(w._values):void 0,h._index=ze(w._index),h._ptr=ze(w._ptr),h._size=ze(w._size),h._datatype=v||w._datatype):o(h,w.valueOf(),v||w._datatype)}function o(h,w,v){h._values=[],h._index=[],h._ptr=[],h._datatype=v;var x=w.length,g=0,b=r,y=0;if(Qt(v)&&(b=t.find(r,[v,v])||r,y=t.convert(0,v)),x>0){var N=0;do{h._ptr.push(h._index.length);for(var E=0;E<x;E++){var A=w[E];if(st(A)){if(N===0&&g<A.length&&(g=A.length),N<A.length){var D=A[N];b(D,y)||(h._values.push(D),h._index.push(E))}}else N===0&&g<1&&(g=1),b(A,y)||(h._values.push(A),h._index.push(E))}N++}while(N<g)}h._ptr.push(h._index.length),h._size=[x,g]}i.prototype=new n,i.prototype.createSparseMatrix=function(h,w){return new i(h,w)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return fo(this._values,dt)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(h,w){return new i(h,w)},i.prototype.density=function(){var h=this._size[0],w=this._size[1];return h!==0&&w!==0?this._index.length/(h*w):0},i.prototype.subset=function(h,w,v){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,h);case 2:case 3:return c(this,h,w,v);default:throw new SyntaxError("Wrong number of arguments")}};function u(h,w){if(!gu(w))throw new TypeError("Invalid index");var v=w.isScalar();if(v)return h.get(w.min());var x=w.size();if(x.length!==h._size.length)throw new We(x.length,h._size.length);var g,b,y,N,E=w.min(),A=w.max();for(g=0,b=h._size.length;g<b;g++)pt(E[g],h._size[g]),pt(A[g],h._size[g]);var D=h._values,S=h._index,C=h._ptr,_=w.dimension(0),R=w.dimension(1),P=[],I=[];_.forEach(function(k,te){I[k]=te[0],P[k]=!0});var O=D?[]:void 0,F=[],q=[];return R.forEach(function(k){for(q.push(F.length),y=C[k],N=C[k+1];y<N;y++)g=S[y],P[g]===!0&&(F.push(I[g]),O&&O.push(D[y]))}),q.push(F.length),new i({values:O,index:F,ptr:q,size:x,datatype:h._datatype})}function c(h,w,v,x){if(!w||w.isIndex!==!0)throw new TypeError("Invalid index");var g=w.size(),b=w.isScalar(),y;if(ke(v)?(y=v.size(),v=v.toArray()):y=Ve(v),b){if(y.length!==0)throw new TypeError("Scalar expected");h.set(w.min(),v,x)}else{if(g.length!==1&&g.length!==2)throw new We(g.length,h._size.length,"<");if(y.length<g.length){for(var N=0,E=0;g[N]===1&&y[N]===1;)N++;for(;g[N]===1;)E++,N++;v=Mv(v,g.length,E,y)}if(!ki(g,y))throw new We(g,y,">");if(g.length===1){var A=w.dimension(0);A.forEach(function(C,_){pt(C),h.set([C,0],v[_[0]],x)})}else{var D=w.dimension(0),S=w.dimension(1);D.forEach(function(C,_){pt(C),S.forEach(function(R,P){pt(R),h.set([C,R],v[_[0]][P[0]],x)})})}}return h}i.prototype.get=function(h){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new We(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var w=h[0],v=h[1];pt(w,this._size[0]),pt(v,this._size[1]);var x=l(w,this._ptr[v],this._ptr[v+1],this._index);return x<this._ptr[v+1]&&this._index[x]===w?this._values[x]:0},i.prototype.set=function(h,w,v){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new We(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var x=h[0],g=h[1],b=this._size[0],y=this._size[1],N=r,E=0;Qt(this._datatype)&&(N=t.find(r,[this._datatype,this._datatype])||r,E=t.convert(0,this._datatype)),(x>b-1||g>y-1)&&(p(this,Math.max(x+1,b),Math.max(g+1,y),v),b=this._size[0],y=this._size[1]),pt(x,b),pt(g,y);var A=l(x,this._ptr[g],this._ptr[g+1],this._index);return A<this._ptr[g+1]&&this._index[A]===x?N(w,E)?s(A,g,this._values,this._index,this._ptr):this._values[A]=w:N(w,E)||f(A,x,g,w,this._values,this._index,this._ptr),this};function l(h,w,v,x){if(v-w===0)return v;for(var g=w;g<v;g++)if(x[g]===h)return g;return w}function s(h,w,v,x,g){v.splice(h,1),x.splice(h,1);for(var b=w+1;b<g.length;b++)g[b]--}function f(h,w,v,x,g,b,y){g.splice(h,0,x),b.splice(h,0,w);for(var N=v+1;N<y.length;N++)y[N]++}i.prototype.resize=function(h,w,v){if(!Fr(h))throw new TypeError("Array or Matrix expected");var x=h.valueOf().map(b=>Array.isArray(b)&&b.length===1?b[0]:b);if(x.length!==2)throw new Error("Only two dimensions matrix are supported");x.forEach(function(b){if(!Ue(b)||!Fe(b)||b<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(x)+")")});var g=v?this.clone():this;return p(g,x[0],x[1],w)};function p(h,w,v,x){var g=x||0,b=r,y=0;Qt(h._datatype)&&(b=t.find(r,[h._datatype,h._datatype])||r,y=t.convert(0,h._datatype),g=t.convert(g,h._datatype));var N=!b(g,y),E=h._size[0],A=h._size[1],D,S,C;if(v>A){for(S=A;S<v;S++)if(h._ptr[S]=h._values.length,N)for(D=0;D<E;D++)h._values.push(g),h._index.push(D);h._ptr[v]=h._values.length}else v<A&&(h._ptr.splice(v+1,A-v),h._values.splice(h._ptr[v],h._values.length),h._index.splice(h._ptr[v],h._index.length));if(A=v,w>E){if(N){var _=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]+_,C=h._ptr[S+1]+_;var R=0;for(D=E;D<w;D++,R++)h._values.splice(C+R,0,g),h._index.splice(C+R,0,D),_++}h._ptr[A]=h._values.length}}else if(w<E){var P=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]-P;var I=h._ptr[S],O=h._ptr[S+1]-P;for(C=I;C<O;C++)D=h._index[C],D>w-1&&(h._values.splice(C,1),h._index.splice(C,1),P++)}h._ptr[S]=h._values.length}return h._size[0]=w,h._size[1]=v,h}i.prototype.reshape=function(h,w){if(!st(h))throw new TypeError("Array expected");if(h.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");h.forEach(function(k){if(!Ue(k)||!Fe(k)||k<=-2||k===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ge(h)+")")});var v=this._size[0]*this._size[1];h=Tl(h,v);var x=h[0]*h[1];if(v!==x)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var g=w?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return g;for(var b=[],y=0;y<g._ptr.length;y++)for(var N=0;N<g._ptr[y+1]-g._ptr[y];N++)b.push(y);for(var E=g._values.slice(),A=g._index.slice(),D=0;D<g._index.length;D++){var S=A[D],C=b[D],_=S*g._size[1]+C;b[D]=_%h[1],A[D]=Math.floor(_/h[1])}g._values.length=0,g._index.length=0,g._ptr.length=h[1]+1,g._size=h.slice();for(var R=0;R<g._ptr.length;R++)g._ptr[R]=0;for(var P=0;P<E.length;P++){var I=A[P],O=b[P],F=E[P],q=l(I,g._ptr[O],g._ptr[O+1],g._index);f(q,I,O,F,g._values,g._index,g._ptr)}return g},i.prototype.clone=function(){var h=new i({values:this._values?ze(this._values):void 0,index:ze(this._index),ptr:ze(this._ptr),size:ze(this._size),datatype:this._datatype});return h},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(h,w){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var v=this,x=this._size[0],g=this._size[1],b=Bv(h),y=function(N,E,A){return b===1?h(N):b===2?h(N,[E,A]):h(N,[E,A],v)};return m(this,0,x-1,0,g-1,y,w)};function m(h,w,v,x,g,b,y){var N=[],E=[],A=[],D=r,S=0;Qt(h._datatype)&&(D=t.find(r,[h._datatype,h._datatype])||r,S=t.convert(0,h._datatype));for(var C=function(W,V,ue){W=b(W,V,ue),D(W,S)||(N.push(W),E.push(V))},_=x;_<=g;_++){A.push(N.length);var R=h._ptr[_],P=h._ptr[_+1];if(y)for(var I=R;I<P;I++){var O=h._index[I];O>=w&&O<=v&&C(h._values[I],O-w,_-x)}else{for(var F={},q=R;q<P;q++){var k=h._index[q];F[k]=h._values[q]}for(var te=w;te<=v;te++){var se=te in F?F[te]:0;C(se,te-w,_-x)}}}return A.push(N.length),new i({values:N,index:E,ptr:A,size:[v-w+1,g-x+1]})}i.prototype.forEach=function(h,w){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var v=this,x=this._size[0],g=this._size[1],b=0;b<g;b++){var y=this._ptr[b],N=this._ptr[b+1];if(w)for(var E=y;E<N;E++){var A=this._index[E];h(this._values[E],[A,b],v)}else{for(var D={},S=y;S<N;S++){var C=this._index[S];D[C]=this._values[S]}for(var _=0;_<x;_++){var R=_ in D?D[_]:0;h(R,[_,b],v)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var h=this._size[1],w=0;w<h;w++)for(var v=this._ptr[w],x=this._ptr[w+1],g=v;g<x;g++){var b=this._index[g];yield{value:this._values[g],index:[b,w]}}},i.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)};function d(h,w,v,x,g){var b=x[0],y=x[1],N=[],E,A;for(E=0;E<b;E++)for(N[E]=[],A=0;A<y;A++)N[E][A]=0;for(A=0;A<y;A++)for(var D=v[A],S=v[A+1],C=D;C<S;C++)E=w[C],N[E][A]=h?g?ze(h[C]):h[C]:1;return N}return i.prototype.format=function(h){for(var w=this._size[0],v=this._size[1],x=this.density(),g="Sparse Matrix ["+Ge(w,h)+" x "+Ge(v,h)+"] density: "+Ge(x,h)+`
|
|
27
27
|
`,b=0;b<v;b++)for(var y=this._ptr[b],N=this._ptr[b+1],E=y;E<N;E++){var A=this._index[E];g+=`
|
|
28
|
-
(`+Ge(A,h)+", "+Ge(b,h)+") ==> "+(this._values?Ge(this._values[E],h):"X")}return g},i.prototype.toString=function(){return Ge(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(h){if(h){if($e(h)&&(h=h.toNumber()),!Ue(h)||!Fe(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var w=h>0?h:0,v=h<0?-h:0,x=this._size[0],g=this._size[1],b=Math.min(x-v,g-w),y=[],N=[],E=[];E[0]=0;for(var A=w;A<g&&y.length<b;A++)for(var D=this._ptr[A],S=this._ptr[A+1],C=D;C<S;C++){var _=this._index[C];if(_===A-w+v){y.push(this._values[C]),N[y.length-1]=_-v;break}}return E.push(y.length),new i({values:y,index:N,ptr:E,size:[b,1]})},i.fromJSON=function(h){return new i(h)},i.diagonal=function(h,w,v,x,g){if(!st(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(k){if($e(k)&&(k=k.toNumber()),!Ue(k)||!Fe(k)||k<1)throw new Error("Size values must be positive integers");return k}),v){if($e(v)&&(v=v.toNumber()),!Ue(v)||!Fe(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var b=r,y=0;Qt(g)&&(b=t.find(r,[g,g])||r,y=t.convert(0,g));var N=v>0?v:0,E=v<0?-v:0,A=h[0],D=h[1],S=Math.min(A-E,D-N),C;if(st(w)){if(w.length!==S)throw new Error("Invalid value array length");C=function(k){return w[k]}}else if(ke(w)){var _=w.size();if(_.length!==1||_[0]!==S)throw new Error("Invalid matrix length");C=function(k){return w.get([k])}}else C=function(){return w};for(var R=[],P=[],I=[],O=0;O<D;O++){I.push(R.length);var F=O-N;if(F>=0&&F<S){var q=C(F);b(q,y)||(P.push(F+E),R.push(q))}}return I.push(R.length),new i({values:R,index:P,ptr:I,size:[A,D]})},i.prototype.swapRows=function(h,w){if(!Ue(h)||!Fe(h)||!Ue(w)||!Fe(w))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(h,this._size[0]),pt(w,this._size[0]),i._swapRows(h,w,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(h,w,v,x,g){for(var b=x[h],y=x[h+1],N=b;N<y;N++)g(v[N],w[N])},i._swapRows=function(h,w,v,x,g,b){for(var y=0;y<v;y++){var N=b[y],E=b[y+1],A=l(h,N,E,g),D=l(w,N,E,g);if(A<E&&D<E&&g[A]===h&&g[D]===w){if(x){var S=x[A];x[A]=x[D],x[D]=S}continue}if(A<E&&g[A]===h&&(D>=E||g[D]!==w)){var C=x?x[A]:void 0;g.splice(D,0,w),x&&x.splice(D,0,C),g.splice(D<=A?A+1:A,1),x&&x.splice(D<=A?A+1:A,1);continue}if(D<E&&g[D]===w&&(A>=E||g[A]!==h)){var _=x?x[D]:void 0;g.splice(A,0,h),x&&x.splice(A,0,_),g.splice(A<=D?D+1:D,1),x&&x.splice(A<=D?D+1:D,1)}}},i},{isClass:!0}),GD="number",WD=["typed"];function KD(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function QD(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++){var i=parseInt(e.fractionalPart[n],e.radix);r+=i/Math.pow(e.radix,n+1)}var a=t+r;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var ZD=U(GD,WD,e=>{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var i=KD(n);if(i)return QD(i);var a=0,o=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(a=Number(o[2]),n=o[1]);var u=Number(n);if(isNaN(u))throw new SyntaxError('String "'+n+'" is not a valid number');if(o){if(u>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));u>=2**(a-1)&&(u=u-2**a)}return u},BigNumber:function(n){return n.toNumber()},Fraction:function(n){return n.valueOf()},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(n){return 0},"Unit, string | Unit":function(n,i){return n.toNumber(i)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),vp="string",XD=["typed"],YD=U(vp,XD,e=>{var{typed:t}=e;return t(vp,{"":function(){return""},number:Di,null:function(r){return"null"},boolean:function(r){return r+""},string:function(r){return r},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r)),any:function(r){return String(r)}})}),yp="boolean",eE=["typed"],tE=U(yp,eE,e=>{var{typed:t}=e;return t(yp,{"":function(){return!1},boolean:function(r){return r},number:function(r){return!!r},null:function(r){return!1},BigNumber:function(r){return!r.isZero()},string:function(r){var n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;var i=Number(r);if(r!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+r+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),rE="bignumber",nE=["typed","BigNumber"],iE=U(rE,nE,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(n){return new r(n+"")},string:function(n){var i=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var a=i[2],o=r(i[1]),u=new r(2).pow(Number(a));if(o.gt(u.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var c=new r(2).pow(Number(a)-1);return o.gte(c)?o.sub(u):o}return new r(n)},BigNumber:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(n){return new r(n.n).div(n.d).times(n.s)},null:function(n){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),aE="complex",oE=["typed","Complex"],sE=U(aE,oE,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(n){return new r(n,0)},"number, number":function(n,i){return new r(n,i)},"BigNumber, BigNumber":function(n,i){return new r(n.toNumber(),i.toNumber())},Fraction:function(n){return new r(n.valueOf(),0)},Complex:function(n){return n.clone()},string:function(n){return r(n)},null:function(n){return r(0)},Object:function(n){if("re"in n&&"im"in n)return new r(n.re,n.im);if("r"in n&&"phi"in n||"abs"in n&&"arg"in n)return new r(n);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),uE="fraction",cE=["typed","Fraction"],lE=U(uE,cE,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r(n)},string:function(n){return new r(n)},"number, number":function(n,i){return new r(n,i)},null:function(n){return new r(0)},BigNumber:function(n){return new r(n.toString())},Fraction:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),bp="matrix",fE=["typed","Matrix","DenseMatrix","SparseMatrix"],pE=U(bp,fE,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(bp,{"":function(){return a([])},string:function(o){return a([],o)},"string, string":function(o,u){return a([],o,u)},Array:function(o){return a(o)},Matrix:function(o){return a(o,o.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,c){if(u==="dense"||u==="default"||u===void 0)return new n(o,c);if(u==="sparse")return new i(o,c);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),xp="matrixFromFunction",mE=["typed","matrix","isZero"],dE=U(xp,mE,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(xp,{"Array | Matrix, function, string, string":function(a,o,u,c){return i(a,o,u,c)},"Array | Matrix, function, string":function(a,o,u){return i(a,o,u)},"Matrix, function":function(a,o){return i(a,o,"dense")},"Array, function":function(a,o){return i(a,o,"dense").toArray()},"Array | Matrix, string, function":function(a,o,u){return i(a,u,o)},"Array | Matrix, string, string, function":function(a,o,u,c){return i(a,c,o,u)}});function i(a,o,u,c){var l;return c!==void 0?l=r(u,c):l=r(u),l.resize(a),l.forEach(function(s,f){var p=o(f);n(p)||l.set(f,p)}),l}}),wp="matrixFromRows",hE=["typed","matrix","flatten","size"],gE=U(wp,hE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(wp,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var c=o(u[0]),l=[];for(var s of u){var f=o(s);if(f!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(f|0));l.push(n(s))}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Np="matrixFromColumns",vE=["typed","matrix","flatten","size"],yE=U(Np,vE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(Np,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var c=o(u[0]),l=[],s=0;s<c;s++)l[s]=[];for(var f of u){var p=o(f);if(p!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(p|0));for(var m=n(f),d=0;d<c;d++)l[d].push(m[d])}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Dp="splitUnit",bE=["typed"],xE=U(Dp,bE,e=>{var{typed:t}=e;return t(Dp,{"Unit, Array":function(r,n){return r.splitUnit(n)}})}),Ep="unaryMinus",wE=["typed"],NE=U(Ep,wE,e=>{var{typed:t}=e;return t(Ep,{number:Fv,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Ap="unaryPlus",DE=["typed","config","BigNumber"],EE=U(Ap,DE,e=>{var{typed:t,config:r,BigNumber:n}=e;return t(Ap,{number:Tv,Complex:function(i){return i},BigNumber:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i)),"boolean | string":function(i){return r.number==="BigNumber"?new n(+i):+i}})}),Sp="abs",AE=["typed"],SE=U(Sp,AE,e=>{var{typed:t}=e;return t(Sp,{number:Sv,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Cp="apply",CE=["typed","isInteger"],Cl=U(Cp,CE,e=>{var{typed:t,isInteger:r}=e;return t(Cp,{"Array | Matrix, number | BigNumber, function":function(n,i,a){if(!r(i))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(n)?Ve(n):n.size();if(i<0||i>=o.length)throw new $r(i,o.length);return ke(n)?n.create(Vs(n.valueOf(),i,a)):Vs(n,i,a)}})});function Vs(e,t,r){var n,i,a;if(t<=0)if(Array.isArray(e[0])){for(a=ME(e),i=[],n=0;n<a.length;n++)i[n]=Vs(a[n],t-1,r);return i}else return r(e);else{for(i=[],n=0;n<e.length;n++)i[n]=Vs(e[n],t-1,r);return i}}function ME(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}var Mp="addScalar",_E=["typed"],FE=U(Mp,_E,e=>{var{typed:t}=e;return t(Mp,{"number, number":Cv,"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":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),_p="subtractScalar",TE=["typed"],OE=U(_p,TE,e=>{var{typed:t}=e;return t(_p,{"number, number":Mv,"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":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Fp="cbrt",BE=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],kE=U(Fp,BE,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:o,BigNumber:u,Fraction:c}=e;return r(Fp,{number:Za,Complex:l,"Complex, boolean":l,BigNumber:function(f){return f.cbrt()},Unit:s});function l(f,p){var m=f.arg()/3,d=f.abs(),h=new o(Za(d),0).mul(new o(0,m).exp());if(p){var w=[h,new o(Za(d),0).mul(new o(0,m+Math.PI*2/3).exp()),new o(Za(d),0).mul(new o(0,m-Math.PI*2/3).exp())];return t.matrix==="Array"?w:a(w)}else return h}function s(f){if(f.value&&wn(f.value)){var p=f.clone();return p.value=1,p=p.pow(1/3),p.value=l(f.value),p}else{var m=n(f.value);m&&(f.value=i(f.value));var d;$e(f.value)?d=new u(1).div(3):bo(f.value)?d=new c(1,3):d=1/3;var h=f.pow(d);return m&&(h.value=i(h.value)),h}}}),IE="matAlgo11xS0s",RE=["typed","equalScalar"],Jt=U(IE,RE,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=r,w=0,v=a;typeof f=="string"&&(d=f,h=t.find(r,[d,d]),w=t.convert(0,d),i=t.convert(i,d),v=t.find(a,[d,d]));for(var x=[],g=[],b=[],y=0;y<m;y++){b[y]=g.length;for(var N=l[y],E=l[y+1],A=N;A<E;A++){var D=c[A],S=o?v(i,u[A]):v(u[A],i);h(S,w)||(g.push(D),x.push(S))}}return b[m]=g.length,n.createSparseMatrix({values:x,index:g,ptr:b,size:[p,m],datatype:d})}}),qE="matAlgo12xSfs",zE=["typed","DenseMatrix"],It=U(qE,zE,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],x=[],g=0;g<m;g++){for(var b=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],x[A]=b}for(var D=0;D<p;D++)g===0&&(w[D]=[]),x[D]===b?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=o?h(i,0):h(0,i)}return new r({data:w,size:[p,m],datatype:d})}}),jE="matAlgo14xDs",LE=["typed"],Jr=U(jE,LE,e=>{var{typed:t}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype,s,f=a;typeof l=="string"&&(s=l,i=t.convert(i,s),f=t.find(a,[s,s]));var p=c.length>0?r(f,0,c,c[0],u,i,o):[];return n.createDenseMatrix({data:p,size:ze(c),datatype:s})};function r(n,i,a,o,u,c,l){var s=[];if(i===a.length-1)for(var f=0;f<o;f++)s[f]=l?n(c,u[f]):n(u[f],c);else for(var p=0;p<o;p++)s[p]=r(n,i+1,a,a[i+1],u[p],c,l);return s}}),Pc="ceil",PE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],VE=U(Pc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(Pc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.ceil(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.ceil(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),UE=U(Pc,PE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=VE({typed:t,config:r,round:n});return t("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,m){return p.ceil(m)},"Complex, BigNumber":function(p,m){return p.ceil(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,m){return p.ceil(m)},"Fraction, BigNumber":function(p,m){return p.ceil(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),Tp="cube",$E=["typed"],HE=U(Tp,$E,e=>{var{typed:t}=e;return t(Tp,{number:Ov,Complex:function(r){return r.mul(r).mul(r)},BigNumber:function(r){return r.times(r).times(r)},Fraction:function(r){return r.pow(3)},Unit:function(r){return r.pow(3)}})}),Op="exp",JE=["typed"],GE=U(Op,JE,e=>{var{typed:t}=e;return t(Op,{number:Bv,Complex:function(r){return r.exp()},BigNumber:function(r){return r.exp()}})}),Bp="expm1",WE=["typed","Complex"],KE=U(Bp,WE,e=>{var{typed:t,Complex:r}=e;return t(Bp,{number:kv,Complex:function(n){var i=Math.exp(n.re);return new r(i*Math.cos(n.im)-1,i*Math.sin(n.im))},BigNumber:function(n){return n.exp().minus(1)}})}),Vc="fix",QE=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],ZE=U(Vc,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(Vc,{number:function(i){return i>0?n(i):r(i)},"number, number":function(i,a){return i>0?n(i,a):r(i,a)}})}),XE=U(Vc,QE,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:u,DenseMatrix:c}=e,l=It({typed:t,DenseMatrix:c}),s=Jr({typed:t}),f=ZE({typed:t,ceil:i,floor:a});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,m){return new r(p.re>0?a(p.re,m):i(p.re,m),p.im>0?a(p.im,m):i(p.im,m))},"Complex, BigNumber":function(p,m){var d=m.toNumber();return new r(p.re>0?a(p.re,d):i(p.re,d),p.im>0?a(p.im,d):i(p.im,d))},BigNumber:function(p){return p.isNegative()?i(p):a(p)},"BigNumber, number | BigNumber":function(p,m){return p.isNegative()?i(p,m):a(p,m)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,m){return p.s<0?i(p,m):a(p,m)},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array | Matrix, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>o(m,0)?u(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),Uc="floor",YE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],eA=U(Uc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(Uc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.floor(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.floor(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),wy=U(Uc,YE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=eA({typed:t,config:r,round:n});return t("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,m){return p.floor(m)},"Complex, BigNumber":function(p,m){return p.floor(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.floor()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,m){return p.floor(m)},"Fraction, BigNumber":function(p,m){return p.floor(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),tA="matAlgo02xDS0",rA=["typed","equalScalar"],Gr=U(tA,rA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype||n.getDataType(),s=i._values,f=i._index,p=i._ptr,m=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new Ke(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=c[0],w=c[1],v,x=r,g=0,b=a;typeof l=="string"&&l===d&&l!=="mixed"&&(v=l,x=t.find(r,[v,v]),g=t.convert(0,v),b=t.find(a,[v,v]));for(var y=[],N=[],E=[],A=0;A<w;A++){E[A]=N.length;for(var D=p[A],S=p[A+1],C=D;C<S;C++){var _=f[C],R=o?b(s[C],u[_][A]):b(u[_][A],s[C]);x(R,g)||(N.push(_),y.push(R))}}return E[w]=N.length,i.createSparseMatrix({values:y,index:N,ptr:E,size:[h,w],datatype:l===n._datatype&&d===i._datatype?v:void 0})}}),nA="matAlgo03xDSf",iA=["typed"],cr=U(nA,iA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new Ke(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w,v=0,x=i;typeof c=="string"&&c===m&&c!=="mixed"&&(w=c,v=t.convert(0,w),x=t.find(i,[w,w]));for(var g=[],b=0;b<d;b++)g[b]=[];for(var y=[],N=[],E=0;E<h;E++){for(var A=E+1,D=f[E],S=f[E+1],C=D;C<S;C++){var _=s[C];y[_]=a?x(l[C],o[_][E]):x(o[_][E],l[C]),N[_]=A}for(var R=0;R<d;R++)N[R]===A?g[R][E]=y[R]:g[R][E]=a?x(v,o[R][E]):x(o[R][E],v)}return r.createDenseMatrix({data:g,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),aA="matAlgo05xSfSf",oA=["typed","equalScalar"],Nu=U(aA,oA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=N?[]:void 0,C=[],_=[],R,P,I,O;for(P=0;P<v;P++){A[P]=E.length;var F=P+1;for(I=c[P],O=c[P+1];I<O;I++)R=u[I],E.push(R),C[R]=F,D&&(D[R]=o[I]);for(I=m[P],O=m[P+1];I<O;I++)R=p[I],C[R]!==F&&E.push(R),_[R]=F,S&&(S[R]=f[I]);if(N)for(I=A[P];I<E.length;){R=E[I];var q=C[R],k=_[R];if(q===F||k===F){var te=q===F?D[R]:b,se=k===F?S[R]:b,K=y(te,se);g(K,b)?E.splice(I,1):(N.push(K),I++)}}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),sA="matAlgo13xDD",uA=["typed"],cA=U(sA,uA,e=>{var{typed:t}=e;return function(n,i,a){var o=n._data,u=n._size,c=n._datatype,l=i._data,s=i._size,f=i._datatype,p=[];if(u.length!==s.length)throw new Ke(u.length,s.length);for(var m=0;m<u.length;m++){if(u[m]!==s[m])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");p[m]=u[m]}var d,h=a;typeof c=="string"&&c===f&&(d=c,h=t.find(a,[d,d]));var w=p.length>0?r(h,0,p,p[0],o,l):[];return n.createDenseMatrix({data:w,size:p,datatype:d})};function r(n,i,a,o,u,c){var l=[];if(i===a.length-1)for(var s=0;s<o;s++)l[s]=n(u[s],c[s]);else for(var f=0;f<o;f++)l[f]=r(n,i+1,a,a[i+1],u[f],c[f]);return l}}),lA="broadcast",fA=["concat"],pA=U(lA,fA,e=>{var{concat:t}=e;return function(i,a){var o=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((d,h)=>d===a._size[h]))return[i,a];for(var u=r(i._size,o,0),c=r(a._size,o,0),l=[],s=0;s<o;s++)l[s]=Math.max(u[s],c[s]);qs(u,l),qs(c,l);var f=i.clone(),p=a.clone();f._size.length<o?f.reshape(r(f._size,o,1)):p._size.length<o&&p.reshape(r(p._size,o,1));for(var m=0;m<o;m++)f._size[m]<l[m]&&(f=n(f,l[m],m)),p._size[m]<l[m]&&(p=n(p,l[m],m));return[f,p]};function r(i,a,o){return[...Array(a-i.length).fill(o),...i]}function n(i,a,o){return t(...Array(a).fill(i),o)}}),mA="matrixAlgorithmSuite",dA=["typed","matrix","concat"],gt=U(mA,dA,e=>{var{typed:t,matrix:r,concat:n}=e,i=cA({typed:t}),a=Jr({typed:t}),o=pA({concat:n});return function(u){var c=u.elop,l=u.SD||u.DS,s;c?(s={"DenseMatrix, DenseMatrix":(d,h)=>i(...o(d,h),c),"Array, Array":(d,h)=>i(...o(r(d),r(h)),c).valueOf(),"Array, DenseMatrix":(d,h)=>i(...o(r(d),h),c),"DenseMatrix, Array":(d,h)=>i(...o(d,r(h)),c)},u.SS&&(s["SparseMatrix, SparseMatrix"]=(d,h)=>u.SS(...o(d,h),c,!1)),u.DS&&(s["DenseMatrix, SparseMatrix"]=(d,h)=>u.DS(...o(d,h),c,!1),s["Array, SparseMatrix"]=(d,h)=>u.DS(...o(r(d),h),c,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(d,h)=>l(...o(h,d),c,!0),s["SparseMatrix, Array"]=(d,h)=>l(...o(r(h),d),c,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(h,w),d)),"Array, Array":t.referToSelf(d=>(h,w)=>i(...o(r(h),r(w)),d).valueOf()),"Array, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(r(h),w),d)),"DenseMatrix, Array":t.referToSelf(d=>(h,w)=>i(...o(h,r(w)),d))},u.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.SS(...o(h,w),d,!1))),u.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(h,w),d,!1)),s["Array, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(r(h),w),d,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(d=>(h,w)=>l(...o(w,h),d,!0)),s["SparseMatrix, Array"]=t.referToSelf(d=>(h,w)=>l(...o(r(w),h),d,!0))));var f=u.scalar||"any",p=u.Ds||u.Ss;p&&(c?(s["DenseMatrix,"+f]=(d,h)=>a(d,h,c,!1),s[f+", DenseMatrix"]=(d,h)=>a(h,d,c,!0),s["Array,"+f]=(d,h)=>a(r(d),h,c,!1).valueOf(),s[f+", Array"]=(d,h)=>a(r(h),d,c,!0).valueOf()):(s["DenseMatrix,"+f]=t.referToSelf(d=>(h,w)=>a(h,w,d,!1)),s[f+", DenseMatrix"]=t.referToSelf(d=>(h,w)=>a(w,h,d,!0)),s["Array,"+f]=t.referToSelf(d=>(h,w)=>a(r(h),w,d,!1).valueOf()),s[f+", Array"]=t.referToSelf(d=>(h,w)=>a(r(w),h,d,!0).valueOf())));var m=u.sS!==void 0?u.sS:u.Ss;return c?(u.Ss&&(s["SparseMatrix,"+f]=(d,h)=>u.Ss(d,h,c,!1)),m&&(s[f+", SparseMatrix"]=(d,h)=>m(h,d,c,!0))):(u.Ss&&(s["SparseMatrix,"+f]=t.referToSelf(d=>(h,w)=>u.Ss(h,w,d,!1))),m&&(s[f+", SparseMatrix"]=t.referToSelf(d=>(h,w)=>m(w,h,d,!0)))),c&&c.signatures&&Hg(s,c.signatures),s}}),kp="mod",hA=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Ny=U(kp,hA,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u,concat:c}=e,l=wy({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}),s=Gr({typed:t,equalScalar:a}),f=cr({typed:t}),p=Nu({typed:t,equalScalar:a}),m=Jt({typed:t,equalScalar:a}),d=It({typed:t,DenseMatrix:u}),h=gt({typed:t,matrix:i,concat:c});return t(kp,{"number, number":w,"BigNumber, BigNumber":function(v,x){return x.isZero()?v:v.sub(x.mul(l(v.div(x))))},"Fraction, Fraction":function(v,x){return x.equals(0)?v:v.sub(x.mul(l(v.div(x))))}},h({SS:p,DS:f,SD:s,Ss:m,sS:d}));function w(v,x){return x===0?v:v-x*l(v/x)}}),gA="matAlgo01xDSid",vA=["typed"],ii=U(gA,vA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new Ke(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w=typeof c=="string"&&c!=="mixed"&&c===m?c:void 0,v=w?t.find(i,[w,w]):i,x,g,b=[];for(x=0;x<d;x++)b[x]=[];var y=[],N=[];for(g=0;g<h;g++){for(var E=g+1,A=f[g],D=f[g+1],S=A;S<D;S++)x=s[S],y[x]=a?v(l[S],o[x][g]):v(o[x][g],l[S]),N[x]=E;for(x=0;x<d;x++)N[x]===E?b[x][g]=y[x]:b[x][g]=o[x][g]}return r.createDenseMatrix({data:b,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),yA="matAlgo04xSidSid",bA=["typed","equalScalar"],Ml=U(yA,bA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=o&&f?[]:void 0,S=o&&f?[]:void 0,C=[],_=[],R,P,I,O,F;for(P=0;P<v;P++){A[P]=E.length;var q=P+1;for(O=c[P],F=c[P+1],I=O;I<F;I++)R=u[I],E.push(R),C[R]=q,D&&(D[R]=o[I]);for(O=m[P],F=m[P+1],I=O;I<F;I++)if(R=p[I],C[R]===q){if(D){var k=y(D[R],f[I]);g(k,b)?C[R]=null:D[R]=k}}else E.push(R),_[R]=q,S&&(S[R]=f[I]);if(D&&S)for(I=A[P];I<E.length;)R=E[I],C[R]===q?(N[I]=D[R],I++):_[R]===q?(N[I]=S[R],I++):E.splice(I,1)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),xA="matAlgo10xSids",wA=["typed","DenseMatrix"],zi=U(xA,wA,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],x=[],g=0;g<m;g++){for(var b=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],x[A]=b}for(var D=0;D<p;D++)g===0&&(w[D]=[]),x[D]===b?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=i}return new r({data:w,size:[p,m],datatype:d})}});function ji(e,t,r,n){if(!(this instanceof ji))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(n!=null?"-"+n:"")+" expected)",this.stack=new Error().stack}ji.prototype=new Error;ji.prototype.constructor=Error;ji.prototype.name="ArgumentsError";ji.prototype.isArgumentsError=!0;var Ip="gcd",NA=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],lc="number | BigNumber | Fraction | Matrix | Array",DA="".concat(lc,", ").concat(lc,", ...").concat(lc);function Rp(e){return!e.some(t=>Array.isArray(t))}var EA=U(Ip,NA,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:u,DenseMatrix:c,concat:l}=e,s=Ny({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:c,concat:l}),f=ii({typed:t}),p=Ml({typed:t,equalScalar:a}),m=zi({typed:t,DenseMatrix:c}),d=gt({typed:t,matrix:r,concat:l});return t(Ip,{"number, number":h,"BigNumber, BigNumber":w,"Fraction, Fraction":(v,x)=>v.gcd(x)},d({SS:p,DS:f,Ss:m}),{[DA]:t.referToSelf(v=>(x,g,b)=>{for(var y=v(x,g),N=0;N<b.length;N++)y=v(y,b[N]);return y}),Array:t.referToSelf(v=>x=>{if(x.length===1&&Array.isArray(x[0])&&Rp(x[0]))return v(...x[0]);if(Rp(x))return v(...x);throw new ji("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(v=>x=>v(x.toArray()))});function h(v,x){if(!Fe(v)||!Fe(x))throw new Error("Parameters in function gcd must be integer numbers");for(var g;x!==0;)g=s(v,x),v=x,x=g;return v<0?-v:v}function w(v,x){if(!v.isInt()||!x.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var g=new u(0);!x.isZero();){var b=s(v,x);v=x,x=b}return v.lt(g)?v.neg():v}}),AA="matAlgo06xS0S0",SA=["typed","equalScalar"],Du=U(AA,SA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._size,c=n._datatype||n._data===void 0?n._datatype:n.getDataType(),l=i._values,s=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==s.length)throw new Ke(u.length,s.length);if(u[0]!==s[0]||u[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");var p=u[0],m=u[1],d,h=r,w=0,v=a;typeof c=="string"&&c===f&&c!=="mixed"&&(d=c,h=t.find(r,[d,d]),w=t.convert(0,d),v=t.find(a,[d,d]));for(var x=o&&l?[]:void 0,g=[],b=[],y=x?[]:void 0,N=[],E=[],A=0;A<m;A++){b[A]=g.length;var D=A+1;if(op(n,A,N,y,E,D,g,v),op(i,A,N,y,E,D,g,v),y)for(var S=b[A];S<g.length;){var C=g[S];if(E[C]===D){var _=y[C];h(_,w)?g.splice(S,1):(x.push(_),S++)}else g.splice(S,1)}else for(var R=b[A];R<g.length;){var P=g[R];E[P]!==D?g.splice(R,1):R++}}return b[m]=g.length,n.createSparseMatrix({values:x,index:g,ptr:b,size:[p,m],datatype:c===n._datatype&&f===i._datatype?d:void 0})}}),qp="lcm",CA=["typed","matrix","equalScalar","concat"],MA=U(qp,CA,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Du({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i}),l="number | BigNumber | Fraction | Matrix | Array",s={};return s["".concat(l,", ").concat(l,", ...").concat(l)]=t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w}),t(qp,{"number, number":Iv,"BigNumber, BigNumber":f,"Fraction, Fraction":(p,m)=>p.lcm(m)},c({SS:o,DS:a,Ss:u}),s);function f(p,m){if(!p.isInt()||!m.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(p.isZero())return p;if(m.isZero())return m;for(var d=p.times(m);!m.isZero();){var h=m;m=p.mod(h),p=h}return d.div(p).abs()}}),zp="log10",_A=["typed","config","Complex"],FA=U(zp,_A,e=>{var{typed:t,config:r,Complex:n}=e;return t(zp,{number:function(i){return i>=0||r.predictable?Rv(i):new n(i,0).log().div(Math.LN10)},Complex:function(i){return new n(i).log().div(Math.LN10)},BigNumber:function(i){return!i.isNegative()||r.predictable?i.log():new n(i.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i))})}),jp="log2",TA=["typed","config","Complex"],OA=U(jp,TA,e=>{var{typed:t,config:r,Complex:n}=e;return t(jp,{number:function(a){return a>=0||r.predictable?qv(a):i(new n(a,0))},Complex:i,BigNumber:function(a){return!a.isNegative()||r.predictable?a.log(2):i(new n(a.toNumber(),0))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function i(a){var o=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(o):Math.log(o)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}}),BA="multiplyScalar",kA=["typed"],IA=U(BA,kA,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":_v,"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":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),Lp="multiply",RA=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],qA=U(Lp,RA,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,u=Jt({typed:t,equalScalar:a}),c=Jr({typed:t});function l(y,N){switch(y.length){case 1:switch(N.length){case 1:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+y[0]+") must match Matrix rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;case 2:switch(N.length){case 1:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+y[1]+") must match Vector length ("+N[0]+")");break;case 2:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+y[1]+") must match Matrix B rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+y.length+" dimensions)")}}function s(y,N,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return o(y,N)}function f(y,N){if(N.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return p(y,N)}function p(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=C[1],I,O=n,F=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&(I=D,O=t.find(n,[I,I]),F=t.find(i,[I,I]));for(var q=[],k=0;k<P;k++){for(var te=F(E[0],S[0][k]),se=1;se<R;se++)te=O(te,F(E[se],S[se][k]));q[k]=te}return y.createDenseMatrix({data:q,size:[P],datatype:D===y._datatype&&_===N._datatype?I:void 0})}var m=t("_multiplyMatrixVector",{"DenseMatrix, any":h,"SparseMatrix, any":x}),d=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":w,"DenseMatrix, SparseMatrix":v,"SparseMatrix, DenseMatrix":g,"SparseMatrix, SparseMatrix":b});function h(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._datatype||N.getDataType(),_=A[0],R=A[1],P,I=n,O=i;D&&C&&D===C&&typeof D=="string"&&D!=="mixed"&&(P=D,I=t.find(n,[P,P]),O=t.find(i,[P,P]));for(var F=[],q=0;q<_;q++){for(var k=E[q],te=O(k[0],S[0]),se=1;se<R;se++)te=I(te,O(k[se],S[se]));F[q]=te}return y.createDenseMatrix({data:F,size:[_],datatype:D===y._datatype&&C===N._datatype?P:void 0})}function w(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=A[1],I=C[1],O,F=n,q=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&D!=="mixed"&&(O=D,F=t.find(n,[O,O]),q=t.find(i,[O,O]));for(var k=[],te=0;te<R;te++){var se=E[te];k[te]=[];for(var K=0;K<I;K++){for(var V=q(se[0],S[0][K]),ue=1;ue<P;ue++)V=F(V,q(se[ue],S[ue][K]));k[te][K]=V}}return y.createDenseMatrix({data:k,size:[R,I],datatype:D===y._datatype&&_===N._datatype?O:void 0})}function v(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._values,C=N._index,_=N._ptr,R=N._size,P=N._datatype||N._data===void 0?N._datatype:N.getDataType();if(!S)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var I=A[0],O=R[1],F,q=n,k=i,te=a,se=0;D&&P&&D===P&&typeof D=="string"&&D!=="mixed"&&(F=D,q=t.find(n,[F,F]),k=t.find(i,[F,F]),te=t.find(a,[F,F]),se=t.convert(0,F));for(var K=[],V=[],ue=[],me=N.createSparseMatrix({values:K,index:V,ptr:ue,size:[I,O],datatype:D===y._datatype&&P===N._datatype?F:void 0}),re=0;re<O;re++){ue[re]=V.length;var ae=_[re],de=_[re+1];if(de>ae)for(var ne=0,ce=0;ce<I;ce++){for(var le=ce+1,he=void 0,xe=ae;xe<de;xe++){var $=C[xe];ne!==le?(he=k(E[ce][$],S[xe]),ne=le):he=q(he,k(E[ce][$],S[xe]))}ne===le&&!te(he,se)&&(V.push(ce),K.push(he))}}return ue[O]=V.length,me}function x(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=[],O=[],F=[],q,k=n,te=i,se=a,K=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]),se=t.find(a,[q,q]),K=t.convert(0,q));var V=[],ue=[];F[0]=0;for(var me=0;me<P;me++){var re=C[me];if(!se(re,K))for(var ae=D[me],de=D[me+1],ne=ae;ne<de;ne++){var ce=A[ne];ue[ce]?V[ce]=k(V[ce],te(re,E[ne])):(ue[ce]=!0,O.push(ce),V[ce]=te(re,E[ne]))}}for(var le=O.length,he=0;he<le;he++){var xe=O[he];I[he]=V[xe]}return F[1]=O.length,y.createSparseMatrix({values:I,index:O,ptr:F,size:[R,1],datatype:S===y._datatype&&_===N._datatype?q:void 0})}function g(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=N._size[1],O,F=n,q=i,k=a,te=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(O=S,F=t.find(n,[O,O]),q=t.find(i,[O,O]),k=t.find(a,[O,O]),te=t.convert(0,O));for(var se=[],K=[],V=[],ue=y.createSparseMatrix({values:se,index:K,ptr:V,size:[R,I],datatype:S===y._datatype&&_===N._datatype?O:void 0}),me=[],re=[],ae=0;ae<I;ae++){V[ae]=K.length;for(var de=ae+1,ne=0;ne<P;ne++){var ce=C[ne][ae];if(!k(ce,te))for(var le=D[ne],he=D[ne+1],xe=le;xe<he;xe++){var $=A[xe];re[$]!==de?(re[$]=de,K.push($),me[$]=q(ce,E[xe])):me[$]=F(me[$],q(ce,E[xe]))}}for(var T=V[ae],z=K.length,J=T;J<z;J++){var L=K[J];se[J]=me[L]}}return V[I]=K.length,ue}function b(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType(),C=N._values,_=N._index,R=N._ptr,P=N._datatype||N._data===void 0?N._datatype:N.getDataType(),I=y._size[0],O=N._size[1],F=E&&C,q,k=n,te=i;S&&P&&S===P&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]));for(var se=F?[]:void 0,K=[],V=[],ue=y.createSparseMatrix({values:se,index:K,ptr:V,size:[I,O],datatype:S===y._datatype&&P===N._datatype?q:void 0}),me=F?[]:void 0,re=[],ae,de,ne,ce,le,he,xe,$,T=0;T<O;T++){V[T]=K.length;var z=T+1;for(le=R[T],he=R[T+1],ce=le;ce<he;ce++)if($=_[ce],F)for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)xe=A[ae],re[xe]!==z?(re[xe]=z,K.push(xe),me[xe]=te(C[ce],E[ae])):me[xe]=k(me[xe],te(C[ce],E[ae]));else for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)xe=A[ae],re[xe]!==z&&(re[xe]=z,K.push(xe));if(F)for(var J=V[T],L=K.length,H=J;H<L;H++){var G=K[H];se[H]=me[G]}}return V[O]=K.length,ue}return t(Lp,i,{"Array, Array":t.referTo("Matrix, Matrix",y=>(N,E)=>{l(Ve(N),Ve(E));var A=y(r(N),r(E));return ke(A)?A.valueOf():A}),"Matrix, Matrix":function(y,N){var E=y.size(),A=N.size();return l(E,A),E.length===1?A.length===1?s(y,N,E[0]):f(y,N):A.length===1?m(y,N):d(y,N)},"Matrix, Array":t.referTo("Matrix,Matrix",y=>(N,E)=>y(N,r(E))),"Array, Matrix":t.referToSelf(y=>(N,E)=>y(r(N,E.storage()),E)),"SparseMatrix, any":function(y,N){return u(y,N,i,!1)},"DenseMatrix, any":function(y,N){return c(y,N,i,!1)},"any, SparseMatrix":function(y,N){return u(N,y,i,!0)},"any, DenseMatrix":function(y,N){return c(N,y,i,!0)},"Array, any":function(y,N){return c(r(y),N,i,!1).valueOf()},"any, Array":function(y,N){return c(r(N),y,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(y=>(N,E,A)=>{for(var D=y(N,E),S=0;S<A.length;S++)D=y(D,A[S]);return D})})}),Pp="nthRoot",zA=["typed","matrix","equalScalar","BigNumber","concat"],jA=U(Pp,zA,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:a}=e,o=ii({typed:t}),u=Gr({typed:t,equalScalar:n}),c=Du({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=gt({typed:t,matrix:r,concat:a});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(Pp,{number:up,"number, number":up,BigNumber:m=>p(m,new i(2)),"BigNumber, BigNumber":p,Complex:f,"Complex, number":f,Array:t.referTo("DenseMatrix,number",m=>d=>m(r(d),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",m=>d=>m(d,2)),SparseMatrix:t.referTo("SparseMatrix,number",m=>d=>m(d,2)),"SparseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return c(d,h,m);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return o(d,h,m,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",m=>(d,h)=>m(r(d),h)),"number | BigNumber, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return l(h,d,m,!0);throw new Error("Root must be non-zero")})},s({scalar:"number | BigNumber",SD:u,Ss:l,sS:!1}));function p(m,d){var h=i.precision,w=i.clone({precision:h+2}),v=new i(0),x=new w(1),g=d.isNegative();if(g&&(d=d.neg()),d.isZero())throw new Error("Root must be non-zero");if(m.isNegative()&&!d.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(m.isZero())return g?new w(1/0):0;if(!m.isFinite())return g?v:m;var b=m.abs().pow(x.div(d));return b=m.isNeg()?b.neg():b,new i((g?x.div(b):b).toPrecision(h))}}),Vp="sign",LA=["typed","BigNumber","Fraction","complex"],PA=U(Vp,LA,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Vp,{number:Lc,Complex:function(a){return a.im===0?n(Lc(a.re)):a.sign()},BigNumber:function(a){return new r(a.cmp(0))},Fraction:function(a){return new i(a.s,1)},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),VA="sqrt",UA=["config","typed","Complex"],$A=U(VA,UA,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(a){return a.sqrt()},BigNumber:function(a){return!a.isNegative()||t.predictable?a.sqrt():i(a.toNumber())},Unit:function(a){return a.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new n(a,0).sqrt()}}),Up="square",HA=["typed"],JA=U(Up,HA,e=>{var{typed:t}=e;return t(Up,{number:zv,Complex:function(r){return r.mul(r)},BigNumber:function(r){return r.times(r)},Fraction:function(r){return r.mul(r)},Unit:function(r){return r.pow(2)}})}),$p="subtract",GA=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],WA=U($p,GA,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,c=ii({typed:t}),l=cr({typed:t}),s=Nu({typed:t,equalScalar:n}),f=zi({typed:t,DenseMatrix:o}),p=It({typed:t,DenseMatrix:o}),m=gt({typed:t,matrix:r,concat:u});return t($p,{"any, any":i},m({elop:i,SS:s,DS:c,SD:l,Ss:p,sS:f}))}),Hp="xgcd",KA=["typed","config","matrix","BigNumber"],QA=U(Hp,KA,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Hp,{"number, number":function(o,u){var c=jv(o,u);return r.matrix==="Array"?c:n(c)},"BigNumber, BigNumber":a});function a(o,u){var c,l,s,f=new i(0),p=new i(1),m=f,d=p,h=p,w=f;if(!o.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)l=o.div(u).floor(),s=o.mod(u),c=m,m=d.minus(l.times(m)),d=c,c=h,h=w.minus(l.times(h)),w=c,o=u,u=s;var v;return o.lt(f)?v=[o.neg(),d.neg(),w.neg()]:v=[o,o.isZero()?0:d,w],r.matrix==="Array"?v:n(v)}}),Jp="invmod",ZA=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],XA=U(Jp,ZA,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:a,smaller:o,mod:u,add:c,isInteger:l}=e;return t(Jp,{"number, number":s,"BigNumber, BigNumber":s});function s(f,p){if(!l(f)||!l(p))throw new Error("Parameters in function invmod must be integer numbers");if(f=u(f,p),a(p,0))throw new Error("Divisor must be non zero");var m=i(f,p);m=m.valueOf();var[d,h]=m;return a(d,n(1))?(h=u(h,p),o(h,n(0))&&(h=c(h,p)),h):NaN}}),YA="matAlgo09xS0Sf",eS=["typed","equalScalar"],Dy=U(YA,eS,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=[],C,_,R,P,I;for(_=0;_<v;_++){A[_]=E.length;var O=_+1;if(D)for(P=m[_],I=m[_+1],R=P;R<I;R++)C=p[R],S[C]=O,D[C]=f[R];for(P=c[_],I=c[_+1],R=P;R<I;R++)if(C=u[R],D){var F=S[C]===O?D[C]:b,q=y(o[R],F);g(q,b)||(E.push(C),N.push(q))}else E.push(C)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),Gp="dotMultiply",tS=["typed","matrix","equalScalar","multiplyScalar","concat"],rS=U(Gp,tS,e=>{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e,o=Gr({typed:t,equalScalar:n}),u=Dy({typed:t,equalScalar:n}),c=Jt({typed:t,equalScalar:n}),l=gt({typed:t,matrix:r,concat:a});return t(Gp,l({elop:i,SS:u,DS:o,Ss:c}))});function nS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return _l(e,t,function(n,i){return n&i})}function uo(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function iS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:_l(e,t,function(i,a){return i|a})}function _l(e,t,r){var n=e.constructor,i,a,o=+(e.s<0),u=+(t.s<0);if(o){i=$o(uo(e));for(var c=0;c<i.length;++c)i[c]^=1}else i=$o(e);if(u){a=$o(uo(t));for(var l=0;l<a.length;++l)a[l]^=1}else a=$o(t);var s,f,p;i.length<=a.length?(s=i,f=a,p=o):(s=a,f=i,p=u);var m=s.length,d=f.length,h=r(o,u)^1,w=new n(h^1),v=new n(1),x=new n(2),g=n.precision;for(n.config({precision:1e9});m>0;)r(s[--m],f[--d])===h&&(w=w.plus(v)),v=v.times(x);for(;d>0;)r(p,f[--d])===h&&(w=w.plus(v)),v=v.times(x);return n.config({precision:g}),h===0&&(w.s=-w.s),w}function $o(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;r.charAt(o)==="0";)o--;var u=e.e,c=r.slice(0,o+1||1),l=c.length;if(u>0)if(++u>l)for(u-=l;u--;)c+="0";else u<l&&(c=c.slice(0,u)+"."+c.slice(u));for(var s=[0],f=0;f<c.length;){for(var p=s.length;p--;)s[p]*=10;s[0]+=parseInt(c.charAt(f++));for(var m=0;m<s.length;++m)s[m]>1&&((s[m+1]===null||s[m+1]===void 0)&&(s[m+1]=0),s[m+1]+=s[m]>>1,s[m]&=1)}return s.reverse()}function aS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?uo(t):t.eq(n)?uo(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):_l(e,t,function(i,a){return i^a})}function oS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function sS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Wp="bitAnd",uS=["typed","matrix","equalScalar","concat"],Ey=U(Wp,uS,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Du({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i});return t(Wp,{"number, number":Pv,"BigNumber, BigNumber":nS},c({SS:o,DS:a,Ss:u}))}),Kp="bitNot",cS=["typed"],lS=U(Kp,cS,e=>{var{typed:t}=e;return t(Kp,{number:Vv,BigNumber:uo,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Qp="bitOr",fS=["typed","matrix","equalScalar","DenseMatrix","concat"],Ay=U(Qp,fS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ii({typed:t}),u=Ml({typed:t,equalScalar:n}),c=zi({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(Qp,{"number, number":Uv,"BigNumber, BigNumber":iS},l({SS:u,DS:o,Ss:c}))}),pS="matAlgo07xSSf",mS=["typed","DenseMatrix"],cn=U(pS,mS,e=>{var{typed:t,DenseMatrix:r}=e;return function(i,a,o){var u=i._size,c=i._datatype||i._data===void 0?i._datatype:i.getDataType(),l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==l.length)throw new Ke(u.length,l.length);if(u[0]!==l[0]||u[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+l+")");var f=u[0],p=u[1],m,d=0,h=o;typeof c=="string"&&c===s&&c!=="mixed"&&(m=c,d=t.convert(0,m),h=t.find(o,[m,m]));var w,v,x=[];for(w=0;w<f;w++)x[w]=[];var g=[],b=[],y=[],N=[];for(v=0;v<p;v++){var E=v+1;for(n(i,v,y,g,E),n(a,v,N,b,E),w=0;w<f;w++){var A=y[w]===E?g[w]:d,D=N[w]===E?b[w]:d;x[w][v]=h(A,D)}}return new r({data:x,size:[f,p],datatype:c===i._datatype&&s===a._datatype?m:void 0})};function n(i,a,o,u,c){for(var l=i._values,s=i._index,f=i._ptr,p=f[a],m=f[a+1];p<m;p++){var d=s[p];o[d]=c,u[d]=l[p]}}}),Zp="bitXor",dS=["typed","matrix","DenseMatrix","concat"],hS=U(Zp,dS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(Zp,{"number, number":$v,"BigNumber, BigNumber":aS},c({SS:o,DS:a,Ss:u}))}),Xp="arg",gS=["typed"],vS=U(Xp,gS,e=>{var{typed:t}=e;return t(Xp,{number:function(r){return Math.atan2(0,r)},BigNumber:function(r){return r.constructor.atan2(0,r)},Complex:function(r){return r.arg()},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Yp="conj",yS=["typed"],bS=U(Yp,yS,e=>{var{typed:t}=e;return t(Yp,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),em="im",xS=["typed"],wS=U(em,xS,e=>{var{typed:t}=e;return t(em,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),tm="re",NS=["typed"],DS=U(tm,NS,e=>{var{typed:t}=e;return t(tm,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),rm="not",ES=["typed"],AS=U(rm,ES,e=>{var{typed:t}=e;return t(rm,{"null | undefined":()=>!0,number:Kv,Complex:function(r){return r.re===0&&r.im===0},BigNumber:function(r){return r.isZero()||r.isNaN()},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),nm="or",SS=["typed","matrix","equalScalar","DenseMatrix","concat"],Sy=U(nm,SS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=Nu({typed:t,equalScalar:n}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(nm,{"number, number":Qv,"Complex, Complex":function(s,f){return s.re!==0||s.im!==0||f.re!==0||f.im!==0},"BigNumber, BigNumber":function(s,f){return!s.isZero()&&!s.isNaN()||!f.isZero()&&!f.isNaN()},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},l({SS:u,DS:o,Ss:c}))}),im="xor",CS=["typed","matrix","DenseMatrix","concat"],MS=U(im,CS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(im,{"number, number":Zv,"Complex, Complex":function(l,s){return(l.re!==0||l.im!==0)!=(s.re!==0||s.im!==0)},"BigNumber, BigNumber":function(l,s){return(!l.isZero()&&!l.isNaN())!=(!s.isZero()&&!s.isNaN())},"Unit, Unit":t.referToSelf(l=>(s,f)=>l(s.value||0,f.value||0))},c({SS:o,DS:a,Ss:u}))}),am="concat",_S=["typed","matrix","isInteger"],Cy=U(am,_S,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(am,{"...Array | Matrix | number | BigNumber":function(i){var a,o=i.length,u=-1,c,l=!1,s=[];for(a=0;a<o;a++){var f=i[a];if(ke(f)&&(l=!0),Ue(f)||$e(f)){if(a!==o-1)throw new Error("Dimension must be specified as last argument");if(c=u,u=f.valueOf(),!n(u))throw new TypeError("Integer number expected for dimension");if(u<0||a>0&&u>c)throw new $r(u,c+1)}else{var p=ze(f).valueOf(),m=Ve(p);if(s[a]=p,c=u,u=m.length-1,a>0&&u!==c)throw new Ke(c+1,u+1)}}if(s.length===0)throw new SyntaxError("At least one matrix expected");for(var d=s.shift();s.length;)d=Dv(d,s.shift(),u);return l?r(d):d},"...string":function(i){return i.join("")}})}),om="column",FS=["typed","Index","matrix","range"],My=U(om,FS,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(om,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[1]);var c=i(0,o.size()[0]),l=new r(c,u),s=o.subset(l);return ke(s)?s:n([[s]])}}),sm="count",TS=["typed","size","prod"],OS=U(sm,TS,e=>{var{typed:t,size:r,prod:n}=e;return t(sm,{string:function(i){return i.length},"Matrix | Array":function(i){return n(r(i))}})}),um="cross",BS=["typed","matrix","subtract","multiply"],kS=U(um,BS,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(um,{"Matrix, Matrix":function(o,u){return r(a(o.toArray(),u.toArray()))},"Matrix, Array":function(o,u){return r(a(o.toArray(),u))},"Array, Matrix":function(o,u){return r(a(o,u.toArray()))},"Array, Array":a});function a(o,u){var c=Math.max(Ve(o).length,Ve(u).length);o=ks(o),u=ks(u);var l=Ve(o),s=Ve(u);if(l.length!==1||s.length!==1||l[0]!==3||s[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+l.join(", ")+"], B = ["+s.join(", ")+"])");var f=[n(i(o[1],u[2]),i(o[2],u[1])),n(i(o[2],u[0]),i(o[0],u[2])),n(i(o[0],u[1]),i(o[1],u[0]))];return c>1?[f]:f}}),cm="diag",IS=["typed","matrix","DenseMatrix","SparseMatrix"],RS=U(cm,IS,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(cm,{Array:function(c){return a(c,0,Ve(c),null)},"Array, number":function(c,l){return a(c,l,Ve(c),null)},"Array, BigNumber":function(c,l){return a(c,l.toNumber(),Ve(c),null)},"Array, string":function(c,l){return a(c,0,Ve(c),l)},"Array, number, string":function(c,l,s){return a(c,l,Ve(c),s)},"Array, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),Ve(c),s)},Matrix:function(c){return a(c,0,c.size(),c.storage())},"Matrix, number":function(c,l){return a(c,l,c.size(),c.storage())},"Matrix, BigNumber":function(c,l){return a(c,l.toNumber(),c.size(),c.storage())},"Matrix, string":function(c,l){return a(c,0,c.size(),l)},"Matrix, number, string":function(c,l,s){return a(c,l,c.size(),s)},"Matrix, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),c.size(),s)}});function a(c,l,s,f){if(!Fe(l))throw new TypeError("Second parameter in function diag must be an integer");var p=l>0?l:0,m=l<0?-l:0;switch(s.length){case 1:return o(c,l,f,s[0],m,p);case 2:return u(c,l,f,s,m,p)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(c,l,s,f,p,m){var d=[f+p,f+m];if(s&&s!=="sparse"&&s!=="dense")throw new TypeError("Unknown matrix type ".concat(s,'"'));var h=s==="sparse"?i.diagonal(d,c,l):n.diagonal(d,c,l);return s!==null?h:h.valueOf()}function u(c,l,s,f,p,m){if(ke(c)){var d=c.diagonal(l);return s!==null?s!==d.storage()?r(d,s):d:d.valueOf()}for(var h=Math.min(f[0]-p,f[1]-m),w=[],v=0;v<h;v++)w[v]=c[v+p][v+m];return s!==null?r(w):w}});function Ma(e,t,r,n,i){if(ta.isTypedFunction(e)){var a=[t,r,n],o=ta.resolve(e,a);if(o)return f(o.implementation,a);var u=[t,r],c=ta.resolve(e,u);if(c)return f(c.implementation,u);var l=[t],s=ta.resolve(e,l);return s?f(s.implementation,l):f(e,a)}else return e(t,r,n);function f(p,m){try{return p.apply(p,m)}catch(w){var d;if(w instanceof TypeError&&((d=w.data)===null||d===void 0?void 0:d.category)==="wrongType"){var h=[];throw h.push("value: ".concat(dt(t))),m.length>=2&&h.push("index: ".concat(dt(r))),m.length>=3&&h.push("array: ".concat(dt(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(h.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(w.message))}}}var qS="filter",zS=["typed"],jS=U(qS,zS,e=>{var{typed:t}=e;return t("filter",{"Array, function":lm,"Matrix, function":function(r,n){return r.create(lm(r.toArray(),n))},"Array, RegExp":Is,"Matrix, RegExp":function(r,n){return r.create(Is(r.toArray(),n))}})});function lm(e,t){return wv(e,function(r,n,i){return Ma(t,r,[n],i,"filter")})}var fm="flatten",LS=["typed","matrix"],PS=U(fm,LS,e=>{var{typed:t,matrix:r}=e;return t(fm,{Array:function(n){return ot(n)},Matrix:function(n){var i=ot(n.toArray());return r(i)}})}),pm="forEach",VS=["typed"],US=U(pm,VS,e=>{var{typed:t}=e;return t(pm,{"Array, function":$S,"Matrix, function":function(r,n){r.forEach(n)}})});function $S(e,t){var r=function n(i,a){if(Array.isArray(i))bu(i,function(o,u){n(o,a.concat(u))});else return Ma(t,i,a,e,"forEach")};r(e,[])}var mm="getMatrixDataType",HS=["typed"],JS=U(mm,HS,e=>{var{typed:t}=e;return t(mm,{Array:function(r){return so(r,dt)},Matrix:function(r){return r.getDataType()}})}),dm="identity",GS=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],WS=U(dm,GS,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(dm,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(l){return n(l)},"number | BigNumber":function(l){return c(l,l,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(l,s){return c(l,l,s)},"number | BigNumber, number | BigNumber":function(l,s){return c(l,s,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(l,s,f){return c(l,s,f)},Array:function(l){return u(l)},"Array, string":function(l,s){return u(l,s)},Matrix:function(l){return u(l.valueOf(),l.storage())},"Matrix, string":function(l,s){return u(l.valueOf(),s)}});function u(l,s){switch(l.length){case 0:return s?n(s):[];case 1:return c(l[0],l[0],s);case 2:return c(l[0],l[1],s);default:throw new Error("Vector containing two values expected")}}function c(l,s,f){var p=$e(l)||$e(s)?i:null;if($e(l)&&(l=l.toNumber()),$e(s)&&(s=s.toNumber()),!Fe(l)||l<1)throw new Error("Parameters in function identity must be positive integers");if(!Fe(s)||s<1)throw new Error("Parameters in function identity must be positive integers");var m=p?new i(1):1,d=p?new p(0):0,h=[l,s];if(f){if(f==="sparse")return o.diagonal(h,m,0,d);if(f==="dense")return a.diagonal(h,m,0,d);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var w=ha([],h,d),v=l<s?l:s,x=0;x<v;x++)w[x][x]=m;return w}}),hm="kron",KS=["typed","matrix","multiplyScalar"],QS=U(hm,KS,e=>{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(hm,{"Matrix, Matrix":function(a,o){return r(i(a.toArray(),o.toArray()))},"Matrix, Array":function(a,o){return r(i(a.toArray(),o))},"Array, Matrix":function(a,o){return r(i(a,o.toArray()))},"Array, Array":i});function i(a,o){if(Ve(a).length===1&&(a=[a]),Ve(o).length===1&&(o=[o]),Ve(a).length>2||Ve(o).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(o.length)+")");var u=[],c=[];return a.map(function(l){return o.map(function(s){return c=[],u.push(c),l.map(function(f){return s.map(function(p){return c.push(n(f,p))})})})})&&u}}),gm="map",ZS=["typed"],XS=U(gm,ZS,e=>{var{typed:t}=e;return t(gm,{"Array, function":YS,"Matrix, function":function(r,n){return r.map(n)}})});function YS(e,t){var r=function n(i,a){return Array.isArray(i)?i.map(function(o,u){return n(o,a.concat(u))}):Ma(t,i,a,e,"map")};return r(e,[])}var vm="diff",eC=["typed","matrix","subtract","number"],_y=U(vm,eC,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(vm,{"Array | Matrix":function(l){return ke(l)?r(o(l.toArray())):o(l)},"Array | Matrix, number":function(l,s){if(!Fe(s))throw new RangeError("Dimension must be a whole number");return ke(l)?r(a(l.toArray(),s)):a(l,s)},"Array, BigNumber":t.referTo("Array,number",l=>(s,f)=>l(s,i(f))),"Matrix, BigNumber":t.referTo("Matrix,number",l=>(s,f)=>l(s,i(f)))});function a(l,s){if(ke(l)&&(l=l.toArray()),!Array.isArray(l))throw RangeError("Array/Matrix does not have that many dimensions");if(s>0){var f=[];return l.forEach(p=>{f.push(a(p,s-1))}),f}else{if(s===0)return o(l);throw RangeError("Cannot have negative dimension")}}function o(l){for(var s=[],f=l.length,p=1;p<f;p++)s.push(u(l[p-1],l[p]));return s}function u(l,s){ke(l)&&(l=l.toArray()),ke(s)&&(s=s.toArray());var f=Array.isArray(l),p=Array.isArray(s);if(f&&p)return c(l,s);if(!f&&!p)return n(s,l);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function c(l,s){if(l.length!==s.length)throw RangeError("Not all sub-arrays have the same length");for(var f=[],p=l.length,m=0;m<p;m++)f.push(u(l[m],s[m]));return f}}),tC="ones",rC=["typed","config","matrix","BigNumber"],nC=U(tC,rC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(1):1;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?ha(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function ones must be positive integers")})}});function Fl(){throw new Error('No "bignumber" implementation available')}function Fy(){throw new Error('No "fraction" implementation available')}function Ty(){throw new Error('No "matrix" implementation available')}var ym="range",iC=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Oy=U(ym,iC,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e;return t(ym,{string:p,"string, boolean":p,"number, number":function(h,w){return f(m(h,w,1,!1))},"number, number, number":function(h,w,v){return f(m(h,w,v,!1))},"number, number, boolean":function(h,w,v){return f(m(h,w,1,v))},"number, number, number, boolean":function(h,w,v,x){return f(m(h,w,v,x))},"BigNumber, BigNumber":function(h,w){var v=h.constructor;return f(m(h,w,new v(1),!1))},"BigNumber, BigNumber, BigNumber":function(h,w,v){return f(m(h,w,v,!1))},"BigNumber, BigNumber, boolean":function(h,w,v){var x=h.constructor;return f(m(h,w,new x(1),v))},"BigNumber, BigNumber, BigNumber, boolean":function(h,w,v,x){return f(m(h,w,v,x))},"Unit, Unit, Unit":function(h,w,v){return f(m(h,w,v,!1))},"Unit, Unit, Unit, boolean":function(h,w,v,x){return f(m(h,w,v,x))}});function f(h){return r.matrix==="Matrix"?n?n(h):Ty():h}function p(h,w){var v=d(h);if(!v)throw new SyntaxError('String "'+h+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Fl(),f(m(i(v.start),i(v.end),i(v.step)))):f(m(v.start,v.end,v.step,w))}function m(h,w,v,x){for(var g=[],b=s(v)?x?o:a:x?c:u,y=h;b(y,w);)g.push(y),y=l(y,v);return g}function d(h){var w=h.split(":"),v=w.map(function(g){return Number(g)}),x=v.some(function(g){return isNaN(g)});if(x)return null;switch(v.length){case 2:return{start:v[0],end:v[1],step:1};case 3:return{start:v[0],end:v[2],step:v[1]};default:return null}}}),bm="reshape",aC=["typed","isInteger","matrix"],oC=U(bm,aC,e=>{var{typed:t,isInteger:r}=e;return t(bm,{"Matrix, Array":function(n,i){return n.reshape(i,!0)},"Array, Array":function(n,i){return i.forEach(function(a){if(!r(a))throw new TypeError("Invalid size for dimension: "+a)}),El(n,i)}})}),sC="resize",uC=["config","matrix"],cC=U(sC,uC,e=>{var{config:t,matrix:r}=e;return function(i,a,o){if(arguments.length!==2&&arguments.length!==3)throw new ji("resize",arguments.length,2,3);if(ke(a)&&(a=a.valueOf()),$e(a[0])&&(a=a.map(function(l){return $e(l)?l.toNumber():l})),ke(i))return i.resize(a,o,!0);if(typeof i=="string")return n(i,a,o);var u=Array.isArray(i)?!1:t.matrix!=="Array";if(a.length===0){for(;Array.isArray(i);)i=i[0];return ze(i)}else{Array.isArray(i)||(i=[i]),i=ze(i);var c=ha(i,a,o);return u?r(c):c}};function n(i,a,o){if(o!==void 0){if(typeof o!="string"||o.length!==1)throw new TypeError("Single character expected as defaultValue")}else o=" ";if(a.length!==1)throw new Ke(a.length,1);var u=a[0];if(typeof u!="number"||!Fe(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(a)+")");if(i.length>u)return i.substring(0,u);if(i.length<u){for(var c=i,l=0,s=u-i.length;l<s;l++)c+=o;return c}else return i}}),xm="rotate",lC=["typed","multiply","rotationMatrix"],fC=U(xm,lC,e=>{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(xm,{"Array , number | BigNumber | Complex | Unit":function(a,o){i(a,2);var u=r(n(o),a);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(a,o){return i(a,2),r(n(o),a)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){i(a,3);var c=r(n(o,u),a);return c},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){return i(a,3),r(n(o,u),a)}});function i(a,o){var u=Array.isArray(a)?Ve(a):a.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u[0]!==o)throw new RangeError("Vector must be of dimensions 1x".concat(o))}}),wm="rotationMatrix",pC=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],mC=U(wm,pC,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:o,BigNumber:u,matrix:c,DenseMatrix:l,SparseMatrix:s,cos:f,sin:p}=e;return t(wm,{"":function(){return r.matrix==="Matrix"?c([]):[]},string:function(x){return c(x)},"number | BigNumber | Complex | Unit":function(x){return m(x,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(x,g){return m(x,g)},"number | BigNumber | Complex | Unit, Array":function(x,g){var b=c(g);return d(b),v(x,b,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(x,g){d(g);var b=g.storage()||(r.matrix==="Matrix"?"dense":void 0);return v(x,g,b)},"number | BigNumber | Complex | Unit, Array, string":function(x,g,b){var y=c(g);return d(y),v(x,y,b)},"number | BigNumber | Complex | Unit, Matrix, string":function(x,g,b){return d(g),v(x,g,b)}});function m(x,g){var b=$e(x),y=b?new u(-1):-1,N=f(x),E=p(x),A=[[N,n(y,E)],[E,N]];return w(A,g)}function d(x){var g=x.size();if(g.length<1||g[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(x){return x.reduce((g,b)=>n(g,b))}function w(x,g){if(g){if(g==="sparse")return new s(x);if(g==="dense")return new l(x);throw new TypeError('Unknown matrix type "'.concat(g,'"'))}return x}function v(x,g,b){var y=o(g);if(y===0)throw new RangeError("Rotation around zero vector");var N=$e(x)?u:null,E=N?new N(1):1,A=N?new N(-1):-1,D=N?new N(g.get([0])/y):g.get([0])/y,S=N?new N(g.get([1])/y):g.get([1])/y,C=N?new N(g.get([2])/y):g.get([2])/y,_=f(x),R=i(E,a(_)),P=p(x),I=i(_,h([D,D,R])),O=i(h([D,S,R]),h([A,C,P])),F=i(h([D,C,R]),h([S,P])),q=i(h([D,S,R]),h([C,P])),k=i(_,h([S,S,R])),te=i(h([S,C,R]),h([A,D,P])),se=i(h([D,C,R]),h([A,S,P])),K=i(h([S,C,R]),h([D,P])),V=i(_,h([C,C,R])),ue=[[I,O,F],[q,k,te],[se,K,V]];return w(ue,b)}}),Nm="row",dC=["typed","Index","matrix","range"],By=U(Nm,dC,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(Nm,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[0]);var c=i(0,o.size()[1]),l=new r(u,c),s=o.subset(l);return ke(s)?s:n([[s]])}}),Dm="size",hC=["typed","config","?matrix"],gC=U(Dm,hC,e=>{var{typed:t,config:r,matrix:n}=e;return t(Dm,{Matrix:function(i){return i.create(i.size())},Array:Ve,string:function(i){return r.matrix==="Array"?[i.length]:n([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return r.matrix==="Array"?[]:n?n([]):Ty()}})}),Em="squeeze",vC=["typed","matrix"],yC=U(Em,vC,e=>{var{typed:t,matrix:r}=e;return t(Em,{Array:function(n){return ks(ze(n))},Matrix:function(n){var i=ks(n.toArray());return Array.isArray(i)?r(i):i},any:function(n){return ze(n)}})}),Am="subset",bC=["typed","matrix","zeros","add"],ky=U(Am,bC,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(Am,{"Matrix, Index":function(o,u){return da(u)?r():(Bs(o,u),o.subset(u))},"Array, Index":t.referTo("Matrix, Index",function(o){return function(u,c){var l=o(r(u),c);return c.isScalar()?l:l.valueOf()}}),"Object, Index":wC,"string, Index":xC,"Matrix, Index, any, any":function(o,u,c,l){return da(u)?o:(Bs(o,u),o.clone().subset(u,a(c,u),l))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l,s){var f=o(r(u),c,l,s);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(r(u),c,l,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(u,c,l,void 0)}}),"string, Index, string":Sm,"string, Index, string, string":Sm,"Object, Index, any":NC});function a(o,u){if(typeof o=="string")throw new Error("can't boradcast a string");if(u._isScalar)return o;var c=u.size();if(c.every(l=>l>0))try{return i(o,n(c))}catch{return o}else return o}});function xC(e,t){if(!fu(t))throw new TypeError("Index expected");if(da(t))return"";if(Bs(Array.from(e),t),t.size().length!==1)throw new Ke(t.size().length,1);var r=e.length;pt(t.min()[0],r),pt(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function Sm(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(da(t))return e;if(Bs(Array.from(e),t),t.size().length!==1)throw new Ke(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),a=i.size()[0];if(a!==r.length)throw new Ke(i.size()[0],r.length);var o=e.length;pt(t.min()[0]),pt(t.max()[0]);for(var u=[],c=0;c<o;c++)u[c]=e.charAt(c);if(i.forEach(function(f,p){u[f]=r.charAt(p[0])}),u.length>o)for(var l=o-1,s=u.length;l<s;l++)u[l]||(u[l]=n);return u.join("")}function wC(e,t){if(!da(t)){if(t.size().length!==1)throw new Ke(t.size(),1);var r=t.dimension(0);if(typeof r!="string")throw new TypeError("String expected as index to retrieve an object property");return nr(e,r)}}function NC(e,t,r){if(da(t))return e;if(t.size().length!==1)throw new Ke(t.size(),1);var n=t.dimension(0);if(typeof n!="string")throw new TypeError("String expected as index to retrieve an object property");var i=ze(e);return pa(i,n,r),i}var Cm="transpose",DC=["typed","matrix"],EC=U(Cm,DC,e=>{var{typed:t,matrix:r}=e;return t(Cm,{Array:o=>n(r(o)).valueOf(),Matrix:n,any:ze});function n(o){var u=o.size(),c;switch(u.length){case 1:c=o.clone();break;case 2:{var l=u[0],s=u[1];if(s===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ge(u)+")");switch(o.storage()){case"dense":c=i(o,l,s);break;case"sparse":c=a(o,l,s);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ge(u)+")")}return c}function i(o,u,c){for(var l=o._data,s=[],f,p=0;p<c;p++){f=s[p]=[];for(var m=0;m<u;m++)f[m]=ze(l[m][p])}return o.createDenseMatrix({data:s,size:[c,u],datatype:o._datatype})}function a(o,u,c){for(var l=o._values,s=o._index,f=o._ptr,p=l?[]:void 0,m=[],d=[],h=[],w=0;w<u;w++)h[w]=0;var v,x,g;for(v=0,x=s.length;v<x;v++)h[s[v]]++;for(var b=0,y=0;y<u;y++)d.push(b),b+=h[y],h[y]=d[y];for(d.push(b),g=0;g<c;g++)for(var N=f[g],E=f[g+1],A=N;A<E;A++){var D=h[s[A]]++;m[D]=g,l&&(p[D]=ze(l[A]))}return o.createSparseMatrix({values:p,index:m,ptr:d,size:[c,u],datatype:o._datatype})}}),Mm="ctranspose",AC=["typed","transpose","conj"],SC=U(Mm,AC,e=>{var{typed:t,transpose:r,conj:n}=e;return t(Mm,{any:function(i){return n(r(i))}})}),_m="zeros",CC=["typed","config","matrix","BigNumber"],MC=U(_m,CC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(_m,{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(0):0;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?ha(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function zeros must be positive integers")})}}),Fm="fft",_C=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],FC=U(Fm,_C,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:o,tau:u,i:c,dotDivide:l,conj:s,pow:f,ceil:p,log2:m}=e;return t(Fm,{Array:d,Matrix:function(x){return x.create(d(x.toArray()))}});function d(x){var g=Ve(x);return g.length===1?v(x,g[0]):h(x.map(b=>d(b,g.slice(1))),0)}function h(x,g){var b=Ve(x);if(g!==0)return new Array(b[0]).fill(0).map((N,E)=>h(x[E],g-1));if(b.length===1)return v(x);function y(N){var E=Ve(N);return new Array(E[1]).fill(0).map((A,D)=>new Array(E[0]).fill(0).map((S,C)=>N[C][D]))}return y(h(y(x),1))}function w(x){for(var g=x.length,b=o(a(i(-1,i(c,u)),g)),y=[],N=1-g;N<g;N++)y.push(f(b,a(f(N,2),2)));for(var E=f(2,p(m(g+g-1))),A=[...new Array(g).fill(0).map((O,F)=>i(x[F],y[g-1+F])),...new Array(E-g).fill(0)],D=[...new Array(g+g-1).fill(0).map((O,F)=>a(1,y[F])),...new Array(E-(g+g-1)).fill(0)],S=v(A),C=v(D),_=new Array(E).fill(0).map((O,F)=>i(S[F],C[F])),R=l(s(d(s(_))),E),P=[],I=g-1;I<g+g-1;I++)P.push(i(R[I],y[I]));return P}function v(x){var g=x.length;if(g===1)return[x[0]];if(g%2===0){for(var b=[...v(x.filter((A,D)=>D%2===0)),...v(x.filter((A,D)=>D%2===1))],y=0;y<g/2;y++){var N=b[y],E=i(b[y+g/2],o(i(i(u,c),a(-y,g))));b[y]=n(N,E),b[y+g/2]=n(N,i(-1,E))}return b}else return w(x)}}),Tm="ifft",TC=["typed","fft","dotDivide","conj"],OC=U(Tm,TC,e=>{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(Tm,{"Array | Matrix":function(a){var o=ke(a)?a.size():Ve(a);return n(i(r(i(a))),o.reduce((u,c)=>u*c,1))}})});function co(e){"@babel/helpers - typeof";return co=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(e)}function BC(e,t){if(co(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(co(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kC(e){var t=BC(e,"string");return co(t)=="symbol"?t:t+""}function kt(e,t,r){return(t=kC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Om(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function IC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Om(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Om(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var RC="solveODE",qC=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],zC=U(RC,qC,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,max:o,map:u,abs:c,isPositive:l,isNegative:s,larger:f,smaller:p,matrix:m,bignumber:d,unaryMinus:h}=e;function w(A){return function(D,S,C,_){var R=!(S.length===2&&(S.every(N)||S.every(Cr)));if(R)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var P=S[0],I=S[1],O=f(I,P),F=_.firstStep;if(F!==void 0&&!l(F))throw new Error('"firstStep" must be positive');var q=_.maxStep;if(q!==void 0&&!l(q))throw new Error('"maxStep" must be positive');var k=_.minStep;if(k&&s(k))throw new Error('"minStep" must be positive or zero');var te=[P,I,F,k,q].filter(B=>B!==void 0);if(!(te.every(N)||te.every(Cr)))throw new Error('Inconsistent type of "t" dependant variables');for(var se=1,K=_.tol?_.tol:1e-4,V=_.minDelta?_.minDelta:.2,ue=_.maxDelta?_.maxDelta:5,me=_.maxIter?_.maxIter:1e4,re=[P,I,...C,q,k].some($e),[ae,de,ne,ce]=re?[d(A.a),d(A.c),d(A.b),d(A.bp)]:[A.a,A.c,A.b,A.bp],le=F?O?F:h(F):a(n(I,P),se),he=[P],xe=[C],$=n(ne,ce),T=0,z=0,J=b(O),L=y(O);J(he[T],I);){var H=[];le=L(he[T],I,le),H.push(D(he[T],xe[T]));for(var G=1;G<de.length;++G)H.push(D(r(he[T],i(de[G],le)),r(xe[T],i(le,ae[G],H))));var Y=o(c(u(i($,H),B=>Cr(B)?B.value:B)));Y<K&&K/Y>1/4&&(he.push(r(he[T],le)),xe.push(r(xe[T],i(le,ne,H))),T++);var ee=.84*(K/Y)**(1/5);if(p(ee,V)?ee=V:f(ee,ue)&&(ee=ue),ee=re?d(ee):ee,le=i(le,ee),q&&f(c(le),q)?le=O?q:h(q):k&&p(c(le),k)&&(le=O?k:h(k)),z++,z>me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:he,y:xe}}}function v(A,D,S,C){var _=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],R=[null,1/2,3/4,1],P=[2/9,1/3,4/9,0],I=[7/24,1/4,1/3,1/8],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function x(A,D,S,C){var _=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],R=[null,1/5,3/10,4/5,8/9,1,1],P=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],I=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function g(A,D,S,C){var _=C.method?C.method:"RK45",R={RK23:v,RK45:x};if(_.toUpperCase()in R){var P=IC({},C);return delete P.method,R[_.toUpperCase()](A,D,S,P)}else{var I=Object.keys(R).map(F=>'"'.concat(F,'"')),O="".concat(I.slice(0,-1).join(", ")," and ").concat(I.slice(-1));throw new Error('Unavailable method "'.concat(_,'". Available methods are ').concat(O))}}function b(A){return A?p:f}function y(A){var D=A?f:p;return function(S,C,_){var R=r(S,_);return D(R,C)?n(C,S):_}}function N(A){return $e(A)||Ue(A)}function E(A,D,S,C){var _=g(A,D.toArray(),S.toArray(),C);return{t:m(_.t),y:m(_.y)}}return t("solveODE",{"function, Array, Array, Object":g,"function, Matrix, Matrix, Object":E,"function, Array, Array":(A,D,S)=>g(A,D,S,{}),"function, Matrix, Matrix":(A,D,S)=>E(A,D,S,{}),"function, Array, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D,[S],{});return{t:C.t,y:C.y.map(_=>_[0])}},"function, Matrix, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D.toArray(),[S],{});return{t:m(C.t),y:m(C.y.map(_=>_[0]))}},"function, Array, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D,[S],C);return{t:_.t,y:_.y.map(R=>R[0])}},"function, Matrix, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D.toArray(),[S],C);return{t:m(_.t),y:m(_.y.map(R=>R[0]))}}})}),jC="erf",LC=["typed"],PC=U(jC,LC,e=>{var{typed:t}=e;return t("name",{number:function(a){var o=Math.abs(a);return o>=$C?Wn(a):o<=VC?Wn(a)*r(o):o<=4?Wn(a)*(1-n(o)):Wn(a)*(1-i(o))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function r(a){var o=a*a,u=hn[0][4]*o,c=o,l;for(l=0;l<3;l+=1)u=(u+hn[0][l])*o,c=(c+Zi[0][l])*o;return a*(u+hn[0][3])/(c+Zi[0][3])}function n(a){var o=hn[1][8]*a,u=a,c;for(c=0;c<7;c+=1)o=(o+hn[1][c])*a,u=(u+Zi[1][c])*a;var l=(o+hn[1][7])/(u+Zi[1][7]),s=parseInt(a*16)/16,f=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-f)*l}function i(a){var o=1/(a*a),u=hn[2][5]*o,c=o,l;for(l=0;l<4;l+=1)u=(u+hn[2][l])*o,c=(c+Zi[2][l])*o;var s=o*(u+hn[2][4])/(c+Zi[2][4]);s=(UC-s)/a,o=parseInt(a*16)/16;var f=(a-o)*(a+o);return Math.exp(-o*o)*Math.exp(-f)*s}}),VC=.46875,UC=.5641895835477563,hn=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Zi=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],$C=Math.pow(2,53),Bm="zeta",HC=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],JC=U(Bm,HC,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:a,factorial:o,equal:u,smallerEq:c,isNegative:l,gamma:s,sin:f,subtract:p,add:m,Complex:d,BigNumber:h,pi:w}=e;return t(Bm,{number:N=>v(N,E=>E,()=>20),BigNumber:N=>v(N,E=>new h(E),()=>Math.abs(Math.log10(r.epsilon))),Complex:x});function v(N,E,A){return u(N,0)?E(-.5):u(N,1)?E(NaN):isFinite(N)?g(N,E,A,D=>D):l(N)?E(NaN):E(1)}function x(N){return N.re===0&&N.im===0?new d(-.5):N.re===1?new d(NaN,NaN):N.re===1/0&&N.im===0?new d(1):N.im===1/0||N.re===-1/0?new d(NaN,NaN):g(N,E=>E,E=>Math.round(1.3*15+.9*Math.abs(E.im)),E=>E.re)}function g(N,E,A,D){var S=A(N);if(D(N)>-(S-1)/2)return y(N,E(S),E);var C=n(i(2,N),i(E(w),p(N,1)));return C=n(C,f(n(a(E(w),2),N))),C=n(C,s(p(1,N))),n(C,g(p(1,N),E,A,D))}function b(N,E){for(var A=N,D=N;c(D,E);D=m(D,1)){var S=a(n(o(m(E,p(D,1))),i(4,D)),n(o(p(E,D)),o(n(2,D))));A=m(A,S)}return n(E,A)}function y(N,E,A){for(var D=a(1,n(b(A(0),E),p(1,i(2,p(1,N))))),S=A(0),C=A(1);c(C,E);C=m(C,1))S=m(S,a(n((-1)**(C-1),b(C,E)),i(C,N)));return n(D,S)}}),km="mode",GC=["typed","isNaN","isNumeric"],WC=U(km,GC,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(km,{"Array | Matrix":i,"...":function(a){return i(a)}});function i(a){a=ot(a.valueOf());var o=a.length;if(o===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},c=[],l=0,s=0;s<a.length;s++){var f=a[s];if(n(f)&&r(f))throw new Error("Cannot calculate mode of an array containing NaN values");f in u||(u[f]=0),u[f]++,u[f]===l?c.push(f):u[f]>l&&(l=u[f],c=[f])}return c}});function ur(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Im="prod",KC=["typed","config","multiplyScalar","numeric"],QC=U(Im,KC,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(Im,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(o,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(o){return a(o)}});function a(o){var u;if(Sn(o,function(c){try{u=u===void 0?c:n(u,c)}catch(l){throw ur(l,"prod",c)}}),typeof u=="string"&&(u=i(u,r.number)),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),Rm="format",ZC=["typed"],XC=U(Rm,ZC,e=>{var{typed:t}=e;return t(Rm,{any:Ge,"any, Object | function | number | BigNumber":Ge})}),qm="bin",YC=["typed","format"],eM=U(qm,YC,e=>{var{typed:t,format:r}=e;return t(qm,{"number | BigNumber":function(n){return r(n,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"bin",wordSize:i})}})}),zm="oct",tM=["typed","format"],rM=U(zm,tM,e=>{var{typed:t,format:r}=e;return t(zm,{"number | BigNumber":function(n){return r(n,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"oct",wordSize:i})}})}),jm="hex",nM=["typed","format"],iM=U(jm,nM,e=>{var{typed:t,format:r}=e;return t(jm,{"number | BigNumber":function(n){return r(n,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"hex",wordSize:i})}})}),Iy=/\$([\w.]+)/g,Lm="print",aM=["typed"],Ry=U(Lm,aM,e=>{var{typed:t}=e;return t(Lm,{"string, Object | Array":Pm,"string, Object | Array, number | Object":Pm})});function Pm(e,t,r){return e.replace(Iy,function(n,i){var a=i.split("."),o=t[a.shift()];for(o!==void 0&&o.isMatrix&&(o=o.toArray());a.length&&o!==void 0;){var u=a.shift();o=u?o[u]:o+"."}return o!==void 0?Qt(o)?o:Ge(o,r):n})}var Vm="to",oM=["typed","matrix","concat"],sM=U(Vm,oM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(Vm,{"Unit, Unit | string":(a,o)=>a.to(o)},i({Ds:!0}))}),Um="isPrime",uM=["typed"],cM=U(Um,uM,e=>{var{typed:t}=e;return t(Um,{number:function(r){if(r*0!==0)return!1;if(r<=3)return r>1;if(r%2===0||r%3===0)return!1;for(var n=5;n*n<=r;n+=6)if(r%n===0||r%(n+2)===0)return!1;return!0},BigNumber:function(r){if(r.toNumber()*0!==0)return!1;if(r.lte(3))return r.gt(1);if(r.mod(2).eq(0)||r.mod(3).eq(0))return!1;if(r.lt(Math.pow(2,32))){for(var n=r.toNumber(),i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0}function a(v,x,g){for(var b=1;!x.eq(0);)x.mod(2).eq(0)?(x=x.div(2),v=v.mul(v).mod(g)):(x=x.sub(1),b=v.mul(b).mod(g));return b}var o=r.constructor.clone({precision:r.toFixed(0).length*2});r=new o(r);for(var u=0,c=r.sub(1);c.mod(2).eq(0);)c=c.div(2),u+=1;var l=null;if(r.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(v=>v<r);else{var s=Math.min(r.toNumber()-2,Math.floor(2*Math.pow(r.toFixed(0).length*Math.log(10),2)));l=[];for(var f=2;f<=s;f+=1)l.push(s)}for(var p=0;p<l.length;p+=1){var m=l[p],d=a(r.sub(r).add(m),c,r);if(!d.eq(1)){for(var h=0,w=d;!w.eq(r.sub(1));h+=1,w=w.mul(w).mod(r))if(h===u-1)return!1}}return!0},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),lM="numeric",fM=["number","?bignumber","?fraction"],pM=U(lM,fM,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:r?o=>r(o):Fl,Fraction:n?o=>n(o):Fy};return function(o){var u=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 l=dt(o);if(!(l in i))throw new TypeError("Cannot convert "+o+' of type "'+l+'"; valid input types are '+Object.keys(i).join(", "));if(!(u in a))throw new TypeError("Cannot convert "+o+' to type "'+u+'"; valid output types are '+Object.keys(a).join(", "));return u===l?o:a[u](o)}}),$m="divideScalar",mM=["typed","numeric"],dM=U($m,mM,e=>{var{typed:t,numeric:r}=e;return t($m,{"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":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),Hm="pow",hM=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],gM=U(Hm,hM,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:a,inv:o,number:u,fraction:c,Complex:l}=e;return t(Hm,{"number, number":s,"Complex, Complex":function(m,d){return m.pow(d)},"BigNumber, BigNumber":function(m,d){return d.isInteger()||m>=0||r.predictable?m.pow(d):new l(m.toNumber(),0).pow(d.toNumber(),0)},"Fraction, Fraction":function(m,d){var h=m.pow(d);if(h!=null)return h;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return s(m.valueOf(),d.valueOf())},"Array, number":f,"Array, BigNumber":function(m,d){return f(m,d.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(m,d){return p(m,d.toNumber())},"Unit, number | BigNumber":function(m,d){return m.pow(d)}});function s(m,d){if(r.predictable&&!Fe(d)&&m<0)try{var h=c(d),w=u(h);if((d===w||Math.abs((d-w)/d)<1e-14)&&h.d%2===1)return(h.n%2===0?1:-1)*Math.pow(-m,d)}catch{}return r.predictable&&(m<-1&&d===1/0||m>-1&&m<0&&d===-1/0)?NaN:Fe(d)||m>=0||r.predictable?Lv(m,d):m*m<1&&d===1/0||m*m>1&&d===-1/0?0:new l(m,0).pow(d,0)}function f(m,d){if(!Fe(d))throw new TypeError("For A^b, b must be an integer (value is "+d+")");var h=Ve(m);if(h.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+h.length+" dimensions)");if(h[0]!==h[1])throw new Error("For A^b, A must be square (size is "+h[0]+"x"+h[1]+")");if(d<0)try{return f(o(m),-d)}catch(x){throw x.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 "+d+")"):x}for(var w=n(h[0]).valueOf(),v=m;d>=1;)(d&1)===1&&(w=i(v,w)),d>>=1,v=i(v,v);return w}function p(m,d){return a(f(m.valueOf(),d))}}),Xi="Number of decimals in function round must be an integer",Jm="round",vM=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],yM=U(Jm,vM,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:i}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t});function f(p){return Math.abs(wo(p).exponent)}return t(Jm,{number:function(p){var m=$a(p,f(r.epsilon)),d=sr(p,m,r.epsilon)?m:p;return $a(d)},"number, number":function(p,m){var d=f(r.epsilon);if(m>=d)return $a(p,m);var h=$a(p,d),w=sr(p,h,r.epsilon)?h:p;return $a(w,m)},"number, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);return new o(p).toDecimalPlaces(m.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,m){if(m%1)throw new TypeError(Xi);return p.round(m)},"Complex, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);var d=m.toNumber();return p.round(d)},BigNumber:function(p){var m=new o(p).toDecimalPlaces(f(r.epsilon)),d=Tr(p,m,r.epsilon)?m:p;return d.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);var d=f(r.epsilon);if(m>=d)return p.toDecimalPlaces(m.toNumber());var h=p.toDecimalPlaces(d),w=Tr(p,h,r.epsilon)?h:p;return w.toDecimalPlaces(m.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,m){if(m%1)throw new TypeError(Xi);return p.round(m)},"Fraction, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);return p.round(m.toNumber())},"Unit, number, Unit":t.referToSelf(p=>function(m,d,h){var w=m.toNumeric(h);return h.multiply(p(w,d))}),"Unit, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix, number, Unit":t.referToSelf(p=>(m,d,h)=>Qe(m,w=>p(w,d,h))),"Array | Matrix, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Array | Matrix, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>s(n(m),d,p,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):l(d,m,p,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):s(d,m,p,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf())})}),Gm="log",bM=["config","typed","divideScalar","Complex"],xM=U(Gm,bM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(Gm,{number:function(a){return a>=0||r.predictable?yD(a):new i(a,0).log()},Complex:function(a){return a.log()},BigNumber:function(a){return!a.isNegative()||r.predictable?a.ln():new i(a.toNumber(),0).log()},"any, any":t.referToSelf(a=>(o,u)=>n(a(o),a(u)))})}),Wm="log1p",wM=["typed","config","divideScalar","log","Complex"],NM=U(Wm,wM,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(Wm,{number:function(u){return u>=-1||r.predictable?hN(u):o(new a(u,0))},Complex:o,BigNumber:function(u){var c=u.plus(1);return!c.isNegative()||r.predictable?c.ln():o(new a(u.toNumber(),0))},"Array | Matrix":t.referToSelf(u=>c=>Qe(c,u)),"any, any":t.referToSelf(u=>(c,l)=>n(u(c),i(l)))});function o(u){var c=u.re+1;return new a(Math.log(Math.sqrt(c*c+u.im*u.im)),Math.atan2(u.im,c))}}),Km="nthRoots",DM=["config","typed","divideScalar","Complex"],EM=U(Km,DM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,a=[function(u){return new i(u,0)},function(u){return new i(0,u)},function(u){return new i(-u,0)},function(u){return new i(0,-u)}];function o(u,c){if(c<0)throw new Error("Root must be greater than zero");if(c===0)throw new Error("Root must be non-zero");if(c%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new i(0,0)];var l=typeof u=="number",s;(l||u.re===0||u.im===0)&&(l?s=2*+(u<0):u.im===0?s=2*+(u.re<0):s=2*+(u.im<0)+1);for(var f=u.arg(),p=u.abs(),m=[],d=Math.pow(p,1/c),h=0;h<c;h++){var w=(s+4*h)/c;if(w===Math.round(w)){m.push(a[w%4](d));continue}m.push(new i({r:d,phi:(f+2*Math.PI*h)/c}))}return m}return t(Km,{Complex:function(u){return o(u,2)},"Complex, number":o})}),Qm="dotPow",AM=["typed","equalScalar","matrix","pow","DenseMatrix","concat"],SM=U(Qm,AM,e=>{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=Jt({typed:t,equalScalar:r}),s=It({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:n,concat:o}),p={};for(var m in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,m)&&!m.includes("Matrix")&&!m.includes("Array")&&(p[m]=i.signatures[m]);var d=t(p);return t(Qm,f({elop:d,SS:c,DS:u,Ss:l,sS:s}))}),Zm="dotDivide",CM=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],MM=U(Zm,CM,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=cn({typed:t,DenseMatrix:a}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Zm,p({elop:i,SS:l,DS:c,SD:u,Ss:s,sS:f}))});function Eo(e){var{DenseMatrix:t}=e;return function(r,n,i){var a=r.size();if(a.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ge(a)+")");var o=a[0],u=a[1];if(o!==u)throw new RangeError("Matrix must be square (size: "+Ge(a)+")");var c=[];if(ke(n)){var l=n.size(),s=n._data;if(l.length===1){if(l[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var f=0;f<o;f++)c[f]=[s[f]];return new t({data:c,size:[o,1],datatype:n._datatype})}if(l.length===2){if(l[0]!==o||l[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(_s(n)){if(i){c=[];for(var p=0;p<o;p++)c[p]=[s[p][0]];return new t({data:c,size:[o,1],datatype:n._datatype})}return n}if(wi(n)){for(var m=0;m<o;m++)c[m]=[0];for(var d=n._values,h=n._index,w=n._ptr,v=w[1],x=w[0];x<v;x++){var g=h[x];c[g][0]=d[x]}return new t({data:c,size:[o,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(st(n)){var b=Ve(n);if(b.length===1){if(b[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var y=0;y<o;y++)c[y]=[n[y]];return new t({data:c,size:[o,1]})}if(b.length===2){if(b[0]!==o||b[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var N=0;N<o;N++)c[N]=[n[N][0]];return new t({data:c,size:[o,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Xm="lsolve",_M=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],FM=U(Xm,_M,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(Xm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,x=0;x<h;x++){var g=m[x][0]||0,b=void 0;if(o(g,0))b=0;else{var y=v[x][x];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");b=n(g,y);for(var N=x+1;N<d;N++)m[N]=[a(m[N][0]||0,i(b,v[N][x]))]}w[x]=[b]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=[],b=0;b<h;b++){var y=m[b][0]||0;if(o(y,0))g[b]=[0];else{for(var N=0,E=[],A=[],D=x[b],S=x[b+1],C=D;C<S;C++){var _=v[C];_===b?N=w[C]:_>b&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0]||0,i(R,E[P]))]}g[b]=[R]}}return new u({data:g,size:[d,1]})}}),Ym="usolve",TM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],OM=U(Ym,TM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(Ym,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,x=h-1;x>=0;x--){var g=m[x][0]||0,b=void 0;if(o(g,0))b=0;else{var y=v[x][x];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");b=n(g,y);for(var N=x-1;N>=0;N--)m[N]=[a(m[N][0]||0,i(b,v[N][x]))]}w[x]=[b]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=[],b=h-1;b>=0;b--){var y=m[b][0]||0;if(o(y,0))g[b]=[0];else{for(var N=0,E=[],A=[],D=x[b],S=x[b+1],C=S-1;C>=D;C--){var _=v[C];_===b?N=w[C]:_<b&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0],i(R,E[P]))]}g[b]=[R]}}return new u({data:g,size:[d,1]})}}),ed="lsolveAll",BM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],kM=U(ed,BM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(ed,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=0;v<w;v++)for(var x=m.length,g=0;g<x;g++){var b=m[g];if(o(d[v][v],0))if(o(b[v],0)){if(g===0){var y=[...b];y[v]=1;for(var N=v+1;N<w;N++)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,x-=1}else{b[v]=n(b[v],d[v][v]);for(var E=v+1;E<w;E++)b[E]=a(b[E],i(b[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=0;g<h;g++)for(var b=m.length,y=0;y<b;y++){for(var N=m[y],E=[],A=[],D=x[g],S=x[g+1],C=0,_=D;_<S;_++){var R=v[_];R===g?C=w[_]:R>g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,b-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(K=>[K]),size:[d,1]}))}}),td="usolveAll",IM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],RM=U(td,IM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(td,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=w-1;v>=0;v--)for(var x=m.length,g=0;g<x;g++){var b=m[g];if(o(d[v][v],0))if(o(b[v],0)){if(g===0){var y=[...b];y[v]=1;for(var N=v-1;N>=0;N--)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,x-=1}else{b[v]=n(b[v],d[v][v]);for(var E=v-1;E>=0;E--)b[E]=a(b[E],i(b[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=h-1;g>=0;g--)for(var b=m.length,y=0;y<b;y++){for(var N=m[y],E=[],A=[],D=x[g],S=x[g+1],C=0,_=S-1;_>=D;_--){var R=v[_];R===g?C=w[_]:R<g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,b-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(K=>[K]),size:[d,1]}))}}),qM="matAlgo08xS0Sid",zM=["typed","equalScalar"],Tl=U(qM,zM,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");if(!o||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));for(var N=[],E=[],A=[],D=[],S=[],C,_,R,P,I=0;I<v;I++){A[I]=E.length;var O=I+1;for(_=c[I],R=c[I+1],C=_;C<R;C++)P=u[C],S[P]=O,D[P]=o[C],E.push(P);for(_=m[I],R=m[I+1],C=_;C<R;C++)P=p[C],S[P]===O&&(D[P]=y(D[P],f[C]));for(C=A[I];C<E.length;){P=E[C];var F=D[P];g(F,b)?E.splice(C,1):(N.push(F),C++)}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),Ol=U("useMatrixForArrayScalar",["typed","matrix"],e=>{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,a)=>n(r(i),a).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(r(i),a).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf())}}),rd="leftShift",jM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],LM=U(rd,jM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=Tl({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=Ol({typed:t,matrix:r});return t(rd,{"number, number":Hv,"BigNumber, BigNumber":oS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),nd="rightArithShift",PM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],VM=U(nd,PM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=Tl({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=Ol({typed:t,matrix:r});return t(nd,{"number, number":Jv,"BigNumber, BigNumber":sS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),id="rightLogShift",UM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],$M=U(id,UM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=Tl({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=Ol({typed:t,matrix:r});return t(id,{"number, number":Gv,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),ad="and",HM=["typed","matrix","equalScalar","zeros","not","concat"],qy=U(ad,HM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=Du({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=Jr({typed:t}),f=gt({typed:t,matrix:r,concat:o});return t(ad,{"number, number":Xv,"Complex, Complex":function(p,m){return(p.re!==0||p.im!==0)&&(m.re!==0||m.im!==0)},"BigNumber, BigNumber":function(p,m){return!p.isZero()&&!m.isZero()&&!p.isNaN()&&!m.isNaN()},"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m.value||0,d.value||0)),"SparseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):l(m,d,p,!1)),"DenseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):s(m,d,p,!1)),"any, SparseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):l(d,m,p,!0)),"any, DenseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):s(d,m,p,!0)),"Array, any":t.referToSelf(p=>(m,d)=>p(r(m),d).valueOf()),"any, Array":t.referToSelf(p=>(m,d)=>p(m,r(d)).valueOf())},f({SS:c,DS:u}))}),Us="compare",JM=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],GM=U(Us,JM,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:u,concat:c}=e,l=cr({typed:t}),s=Nu({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:u}),p=gt({typed:t,matrix:i,concat:c}),m=Ca({typed:t});return t(Us,WM({typed:t,config:r}),{"boolean, boolean":function(d,h){return d===h?0:d>h?1:-1},"BigNumber, BigNumber":function(d,h){return Tr(d,h,r.epsilon)?new a(0):new a(d.cmp(h))},"Fraction, Fraction":function(d,h){return new o(d.compare(h))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:s,DS:l,Ss:f}))}),WM=U(Us,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Us,{"number, number":function(n,i){return sr(n,i,r.epsilon)?0:n>i?1:-1}})}),KM=function e(t,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,o=/^0x[0-9a-f]+$/i,u=/^0/,c=function(g){return e.insensitive&&(""+g).toLowerCase()||""+g},l=c(t).replace(i,"")||"",s=c(r).replace(i,"")||"",f=l.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(l.match(o),16)||f.length!==1&&l.match(a)&&Date.parse(l),d=parseInt(s.match(o),16)||m&&s.match(a)&&Date.parse(s)||null,h,w;if(d){if(m<d)return-1;if(m>d)return 1}for(var v=0,x=Math.max(f.length,p.length);v<x;v++){if(h=!(f[v]||"").match(u)&&parseFloat(f[v])||f[v]||0,w=!(p[v]||"").match(u)&&parseFloat(p[v])||p[v]||0,isNaN(h)!==isNaN(w))return isNaN(h)?1:-1;if(typeof h!=typeof w&&(h+="",w+=""),h<w)return-1;if(h>w)return 1}return 0};const Yi=No(KM);var od="compareNatural",QM=["typed","compare"],ZM=U(od,QM,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(od,{"any, any":i});function i(c,l){var s=dt(c),f=dt(l),p;if((s==="number"||s==="BigNumber"||s==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return p=r(c,l),p.toString()!=="0"?p>0?1:-1:Yi(s,f);var m=["Array","DenseMatrix","SparseMatrix"];if(m.includes(s)||m.includes(f))return p=a(i,c,l),p!==0?p:Yi(s,f);if(s!==f)return Yi(s,f);if(s==="Complex")return XM(c,l);if(s==="Unit")return c.equalBase(l)?i(c.value,l.value):o(i,c.formatUnits(),l.formatUnits());if(s==="boolean")return n(c,l);if(s==="string")return Yi(c,l);if(s==="Object")return u(i,c,l);if(s==="null"||s==="undefined")return 0;throw new TypeError('Unsupported type of value "'+s+'"')}function a(c,l,s){return wi(l)&&wi(s)?o(c,l.toJSON().values,s.toJSON().values):wi(l)?a(c,l.toArray(),s):wi(s)?a(c,l,s.toArray()):_s(l)?a(c,l.toJSON().data,s):_s(s)?a(c,l,s.toJSON().data):Array.isArray(l)?Array.isArray(s)?o(c,l,s):a(c,l,[s]):a(c,[l],s)}function o(c,l,s){for(var f=0,p=Math.min(l.length,s.length);f<p;f++){var m=c(l[f],s[f]);if(m!==0)return m}return l.length>s.length?1:l.length<s.length?-1:0}function u(c,l,s){var f=Object.keys(l),p=Object.keys(s);f.sort(Yi),p.sort(Yi);var m=o(c,f,p);if(m!==0)return m;for(var d=0;d<f.length;d++){var h=c(l[f[d]],s[p[d]]);if(h!==0)return h}return 0}});function XM(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}var sd="compareText",YM=["typed","matrix","concat"];zc.signature="any, any";var e_=U(sd,YM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(sd,zc,i({elop:zc,Ds:!0}))}),$s="equal",t_=["typed","matrix","equalScalar","DenseMatrix","concat"],r_=U($s,t_,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t($s,n_({typed:t,equalScalar:n}),l({elop:n,SS:u,DS:o,Ss:c}))}),n_=U($s,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t($s,{"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:r(n,i)}})}),ud="equalText",i_=["typed","compareText","isZero"],a_=U(ud,i_,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(ud,{"any, any":function(i,a){return n(r(i,a))}})}),Hs="smaller",o_=["typed","config","matrix","DenseMatrix","concat"],s_=U(Hs,o_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Hs,u_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<p,"BigNumber, BigNumber":function(f,p){return f.lt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===-1,"Complex, Complex":function(f,p){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),u_=U(Hs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Hs,{"number, number":function(n,i){return n<i&&!sr(n,i,r.epsilon)}})}),Js="smallerEq",c_=["typed","config","matrix","DenseMatrix","concat"],l_=U(Js,c_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Js,f_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<=p,"BigNumber, BigNumber":function(f,p){return f.lte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),f_=U(Js,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Js,{"number, number":function(n,i){return n<=i||sr(n,i,r.epsilon)}})}),Gs="larger",p_=["typed","config","matrix","DenseMatrix","concat"],m_=U(Gs,p_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Gs,d_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>p,"BigNumber, BigNumber":function(f,p){return f.gt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),d_=U(Gs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Gs,{"number, number":function(n,i){return n>i&&!sr(n,i,r.epsilon)}})}),Ws="largerEq",h_=["typed","config","matrix","DenseMatrix","concat"],g_=U(Ws,h_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Ws,v_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>=p,"BigNumber, BigNumber":function(f,p){return f.gte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),v_=U(Ws,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ws,{"number, number":function(n,i){return n>=i||sr(n,i,r.epsilon)}})}),cd="deepEqual",y_=["typed","equal"],b_=U(cd,y_,e=>{var{typed:t,equal:r}=e;return t(cd,{"any, any":function(i,a){return n(i.valueOf(),a.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var o=i.length;if(o!==a.length)return!1;for(var u=0;u<o;u++)if(!n(i[u],a[u]))return!1;return!0}else return!1;else return Array.isArray(a)?!1:r(i,a)}}),Ks="unequal",x_=["typed","config","equalScalar","matrix","DenseMatrix","concat"],w_=U(Ks,x_,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=It({typed:t,DenseMatrix:a}),s=gt({typed:t,matrix:i,concat:o});return t(Ks,N_({typed:t,equalScalar:n}),s({elop:f,SS:c,DS:u,Ss:l}));function f(p,m){return!n(p,m)}}),N_=U(Ks,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Ks,{"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:!r(n,i)}})}),ld="partitionSelect",D_=["typed","isNumeric","isNaN","compare"],E_=U(ld,D_,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,a=i,o=(l,s)=>-i(l,s);return t(ld,{"Array | Matrix, number":function(l,s){return u(l,s,a)},"Array | Matrix, number, string":function(l,s,f){if(f==="asc")return u(l,s,a);if(f==="desc")return u(l,s,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(l,s,f){if(!Fe(s)||s<0)throw new Error("k must be a non-negative integer");if(ke(l)){var p=l.size();if(p.length>1)throw new Error("Only one dimensional matrices supported");return c(l.valueOf(),s,f)}if(Array.isArray(l))return c(l,s,f)}function c(l,s,f){if(s>=l.length)throw new Error("k out of bounds");for(var p=0;p<l.length;p++)if(r(l[p])&&n(l[p]))return l[p];for(var m=0,d=l.length-1;m<d;){for(var h=m,w=d,v=l[Math.floor(Math.random()*(d-m+1))+m];h<w;)if(f(l[h],v)>=0){var x=l[w];l[w]=l[h],l[h]=x,--w}else++h;f(l[h],v)>0&&--h,s<=h?d=h:m=h+1}return l[s]}}),fd="sort",A_=["typed","matrix","compare","compareNatural"],S_=U(fd,A_,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,a=n,o=(s,f)=>-n(s,f);return t(fd,{Array:function(s){return c(s),s.sort(a)},Matrix:function(s){return l(s),r(s.toArray().sort(a),s.storage())},"Array, function":function(s,f){return c(s),s.sort(f)},"Matrix, function":function(s,f){return l(s),r(s.toArray().sort(f),s.storage())},"Array, string":function(s,f){return c(s),s.sort(u(f))},"Matrix, string":function(s,f){return l(s),r(s.toArray().sort(u(f)),s.storage())}});function u(s){if(s==="asc")return a;if(s==="desc")return o;if(s==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function c(s){if(Ve(s).length!==1)throw new Error("One dimensional array expected")}function l(s){if(s.size().length!==1)throw new Error("One dimensional matrix expected")}}),pd="max",C_=["typed","config","numeric","larger"],zy=U(pd,C_,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(pd,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return xu(u,c.valueOf(),a)},"...":function(u){if(Ea(u))throw new TypeError("Scalar values expected in function max");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"max",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"max",l)}}),c===void 0)throw new Error("Cannot calculate max of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),md="min",M_=["typed","config","numeric","smaller"],jy=U(md,M_,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(md,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return xu(u,c.valueOf(),a)},"...":function(u){if(Ea(u))throw new TypeError("Scalar values expected in function min");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"min",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"min",l)}}),c===void 0)throw new Error("Cannot calculate min of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),__="ImmutableDenseMatrix",F_=["smaller","DenseMatrix"],T_=U(__,F_,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Qt(a))throw new Error("Invalid datatype: "+a);if(ke(i)||st(i)){var o=new r(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&st(i.data)&&st(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+dt(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=r.prototype.subset.call(this,i);return ke(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:ze(this._data),size:ze(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0}),O_="Index",B_=["ImmutableDenseMatrix","getMatrixDataType"],k_=U(O_,B_,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var c=arguments[o],l=st(c),s=ke(c),f=null;if(wl(c))this._dimensions.push(c),this._isScalar=!1;else if(l||s){var p=void 0;r(c)==="boolean"?(l&&(p=i(dd(c).valueOf())),s&&(p=i(dd(c._data).valueOf())),f=c.valueOf().length):p=i(c.valueOf()),this._dimensions.push(p);var m=p.size();(m.length!==1||m[0]!==1||f!==null)&&(this._isScalar=!1)}else if(typeof c=="number")this._dimensions.push(i([c]));else if(typeof c=="string")this._dimensions.push(c);else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._sourceSize.push(f)}}n.prototype.type="Index",n.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!Fe(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return n.prototype.clone=function(){var a=new n;return a._dimensions=ze(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},n.create=function(a){var o=new n;return n.apply(o,a),o},n.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?1:c.size()[0]}return a},n.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.max()}return a},n.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.min()}return a},n.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},n.prototype.dimension=function(a){return this._dimensions[a]||null},n.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a.push(typeof c=="string"?c:c.toArray())}return a},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];typeof c=="string"?a.push(JSON.stringify(c)):a.push(c.toString())}return"["+a.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(a){return n.create(a.dimensions)},n},{isClass:!0});function dd(e){var t=[];return e.forEach((r,n)=>{r&&t.push(n)}),t}var I_="FibonacciHeap",R_=["smaller","larger"],q_=U(I_,R_,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(s,f){var p={key:s,value:f,degree:0};if(this._minimum){var m=this._minimum;p.left=m,p.right=m.right,m.right=p,p.right.left=p,t(s,m.key)&&(this._minimum=p)}else p.left=p,p.right=p,this._minimum=p;return this._size++,p},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var s=this._minimum;if(s===null)return s;for(var f=this._minimum,p=s.degree,m=s.child;p>0;){var d=m.right;m.left.right=m.right,m.right.left=m.left,m.left=f,m.right=f.right,f.right=m,m.right.left=m,m.parent=null,m=d,p--}return s.left.right=s.right,s.right.left=s.left,s===s.right?f=null:(f=s.right,f=l(f,this._size)),this._size--,this._minimum=f,s},i.prototype.remove=function(s){this._minimum=a(this._minimum,s,-1),this.extractMinimum()};function a(s,f,p){f.key=p;var m=f.parent;return m&&t(f.key,m.key)&&(o(s,f,m),u(s,m)),t(f.key,s.key)&&(s=f),s}function o(s,f,p){f.left.right=f.right,f.right.left=f.left,p.degree--,p.child===f&&(p.child=f.right),p.degree===0&&(p.child=null),f.left=s,f.right=s.right,s.right=f,f.right.left=f,f.parent=null,f.mark=!1}function u(s,f){var p=f.parent;p&&(f.mark?(o(s,f,p),u(p)):f.mark=!0)}var c=function(s,f){s.left.right=s.right,s.right.left=s.left,s.parent=f,f.child?(s.left=f.child,s.right=f.child.right,f.child.right=s,s.right.left=s):(f.child=s,s.right=s,s.left=s),f.degree++,s.mark=!1};function l(s,f){var p=Math.floor(Math.log(f)*n)+1,m=new Array(p),d=0,h=s;if(h)for(d++,h=h.right;h!==s;)d++,h=h.right;for(var w;d>0;){for(var v=h.degree,x=h.right;w=m[v],!!w;){if(r(h.key,w.key)){var g=w;w=h,h=g}c(w,h),m[v]=null,v++}m[v]=h,h=x,d--}s=null;for(var b=0;b<p;b++)w=m[b],w&&(s?(w.left.right=w.right,w.right.left=w.left,w.left=s,w.right=s.right,s.right=w,w.right.left=w,t(w.key,s.key)&&(s=w)):s=w);return s}return i},{isClass:!0}),z_="Spa",j_=["addScalar","equalScalar","FibonacciHeap"],L_=U(z_,j_,e=>{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,o){if(this._values[a])this._values[a].value=o;else{var u=this._heap.insert(a,o);this._values[a]=u}},i.prototype.get=function(a){var o=this._values[a];return o?o.value:0},i.prototype.accumulate=function(a,o){var u=this._values[a];u?u.value=t(u.value,o):(u=this._heap.insert(a,o),this._values[a]=u)},i.prototype.forEach=function(a,o,u){var c=this._heap,l=this._values,s=[],f=c.extractMinimum();for(f&&s.push(f);f&&f.key<=o;)f.key>=a&&(r(f.value,0)||u(f.key,f.value,this)),f=c.extractMinimum(),f&&s.push(f);for(var p=0;p<s.length;p++){var m=s[p];f=c.insert(m.key,m.value),l[f.key]=f}},i.prototype.swap=function(a,o){var u=this._values[a],c=this._values[o];if(!u&&c)u=this._heap.insert(a,c.value),this._heap.remove(c),this._values[a]=u,this._values[o]=void 0;else if(u&&!c)c=this._heap.insert(o,u.value),this._heap.remove(u),this._values[o]=c,this._values[a]=void 0;else if(u&&c){var l=u.value;u.value=c.value,c.value=l}},i},{isClass:!0}),P_=Do(function(e){return new e(1).exp()},{hasher:Eu}),V_=Do(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:Eu}),Bl=Do(function(e){return e.acos(-1)},{hasher:Eu}),U_=Do(function(e){return Bl(e).times(2)},{hasher:Eu});function Eu(e){return e[0].precision}function hd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hd(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var $_="Unit",H_=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],J_=U($_,H_,e=>{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:o,pow:u,abs:c,fix:l,round:s,equal:f,isNumeric:p,format:m,number:d,Complex:h,BigNumber:w,Fraction:v}=e,x=d;function g(T,z){if(!(this instanceof g))throw new Error("Constructor must be called with the new operator");if(!(T==null||p(T)||wn(T)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,z===void 0)this.units=[],this.dimensions=q.map(L=>0);else if(typeof z=="string"){var J=g.parse(z);this.units=J.units,this.dimensions=J.dimensions}else if(Cr(z)&&z.value===null)this.fixPrefix=z.fixPrefix,this.skipAutomaticSimplification=z.skipAutomaticSimplification,this.dimensions=z.dimensions.slice(0),this.units=z.units.map(L=>Ot({},L));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(T)}Object.defineProperty(g,"name",{value:"Unit"}),g.prototype.constructor=g,g.prototype.type="Unit",g.prototype.isUnit=!0;var b,y,N;function E(){for(;N===" "||N===" ";)S()}function A(T){return T>="0"&&T<="9"||T==="."}function D(T){return T>="0"&&T<="9"}function S(){y++,N=b.charAt(y)}function C(T){y=T,N=b.charAt(y)}function _(){var T="",z=y;if(N==="+"?S():N==="-"&&(T+=N,S()),!A(N))return C(z),null;if(N==="."){if(T+=N,S(),!D(N))return C(z),null}else{for(;D(N);)T+=N,S();N==="."&&(T+=N,S())}for(;D(N);)T+=N,S();if(N==="E"||N==="e"){var J="",L=y;if(J+=N,S(),(N==="+"||N==="-")&&(J+=N,S()),!D(N))return C(L),T;for(T=T+J;D(N);)T+=N,S()}return T}function R(){for(var T="";D(N)||g.isValidAlpha(N);)T+=N,S();var z=T.charAt(0);return g.isValidAlpha(z)?T:null}function P(T){return N===T?(S(),T):null}g.parse=function(T,z){if(z=z||{},b=T,y=-1,N="",typeof b!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var J=new g;J.units=[];var L=1,H=!1;S(),E();var G=_(),Y=null;if(G){if(r.number==="BigNumber")Y=new w(G);else if(r.number==="Fraction")try{Y=new v(G)}catch{Y=parseFloat(G)}else Y=parseFloat(G);E(),P("*")?(L=1,H=!0):P("/")&&(L=-1,H=!0)}for(var ee=[],B=1;;){for(E();N==="(";)ee.push(L),B*=L,L=1,S(),E();var j=void 0;if(N){var Q=N;if(j=R(),j===null)throw new SyntaxError('Unexpected "'+Q+'" in "'+b+'" at index '+y.toString())}else break;var Z=I(j);if(Z===null)throw new SyntaxError('Unit "'+j+'" not found.');var ie=L*B;if(E(),P("^")){E();var oe=_();if(oe===null)throw new SyntaxError('In "'+T+'", "^" must be followed by a floating-point number');ie*=oe}J.units.push({unit:Z.unit,prefix:Z.prefix,power:ie});for(var ye=0;ye<q.length;ye++)J.dimensions[ye]+=(Z.unit.dimensions[ye]||0)*ie;for(E();N===")";){if(ee.length===0)throw new SyntaxError('Unmatched ")" in "'+b+'" at index '+y.toString());B/=ee.pop(),S(),E()}if(H=!1,P("*")?(L=1,H=!0):P("/")?(L=-1,H=!0):L=1,Z.unit.base){var fe=Z.unit.base.key;re.auto[fe]={unit:Z.unit,prefix:Z.prefix}}}if(E(),N)throw new SyntaxError('Could not parse: "'+T+'"');if(H)throw new SyntaxError('Trailing characters: "'+T+'"');if(ee.length!==0)throw new SyntaxError('Unmatched "(" in "'+b+'"');if(J.units.length===0&&!z.allowNoUnits)throw new SyntaxError('"'+T+'" contains no units');return J.value=Y!==void 0?J._normalize(Y):null,J},g.prototype.clone=function(){var T=new g;T.fixPrefix=this.fixPrefix,T.skipAutomaticSimplification=this.skipAutomaticSimplification,T.value=ze(this.value),T.dimensions=this.dimensions.slice(0),T.units=[];for(var z=0;z<this.units.length;z++){T.units[z]={};for(var J in this.units[z])Me(this.units[z],J)&&(T.units[z][J]=this.units[z][J])}return T},g.prototype.valueType=function(){return dt(this.value)},g.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},g.prototype._normalize=function(T){if(T==null||this.units.length===0)return T;for(var z=T,J=g._getNumberConverter(dt(T)),L=0;L<this.units.length;L++){var H=J(this.units[L].unit.value),G=J(this.units[L].prefix.value),Y=J(this.units[L].power);z=a(z,u(a(H,G),Y))}return z},g.prototype._denormalize=function(T,z){if(T==null||this.units.length===0)return T;for(var J=T,L=g._getNumberConverter(dt(T)),H=0;H<this.units.length;H++){var G=L(this.units[H].unit.value),Y=L(this.units[H].prefix.value),ee=L(this.units[H].power);J=o(J,u(a(G,Y),ee))}return J};var I=Do(T=>{if(Me(V,T)){var z=V[T],J=z.prefixes[""];return{unit:z,prefix:J}}for(var L in V)if(Me(V,L)&&nD(T,L)){var H=V[L],G=T.length-L.length,Y=T.substring(0,G),ee=Me(H.prefixes,Y)?H.prefixes[Y]:void 0;if(ee!==void 0)return{unit:H,prefix:ee}}return null},{hasher:T=>T[0],limit:100});g.isValuelessUnit=function(T){return I(T)!==null},g.prototype.hasBase=function(T){if(typeof T=="string"&&(T=k[T]),!T)return!1;for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equalBase=function(T){for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equals=function(T){return this.equalBase(T)&&f(this.value,T.value)},g.prototype.multiply=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)+(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=fc({},J.units[H]);z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=a(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.divideInto=function(T){return new g(T).divide(this)},g.prototype.divide=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)-(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=fc(fc({},J.units[H]),{},{power:-J.units[H].power});z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=o(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.pow=function(T){for(var z=this.clone(),J=0;J<q.length;J++)z.dimensions[J]=(this.dimensions[J]||0)*T;for(var L=0;L<z.units.length;L++)z.units[L].power*=T;return z.value!==null?z.value=u(z.value,T):z.value=null,z.skipAutomaticSimplification=!1,O(z)};function O(T){return T.equalBase(k.NONE)&&T.value!==null&&!r.predictable?T.value:T}g.prototype.abs=function(){var T=this.clone();if(T.value!==null)if(T._isDerived()||T.units.length===0||T.units[0].unit.offset===0)T.value=c(T.value);else{var z=T._numberConverter(),J=z(T.units[0].unit.value),L=z(T.units[0].unit.offset),H=a(J,L);T.value=i(c(n(T.value,H)),H)}for(var G in T.units)(T.units[G].unit.name==="VA"||T.units[G].unit.name==="VAR")&&(T.units[G].unit=V.W);return T},g.prototype.to=function(T){var z=this.value===null?this._normalize(1):this.value,J;if(typeof T=="string")J=g.parse(T);else if(Cr(T))J=T.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(J))throw new Error("Units do not match ('".concat(J.toString(),"' != '").concat(this.toString(),"')"));if(J.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||J.units.length===0||this.units[0].unit.offset===J.units[0].unit.offset)J.value=ze(z);else{var L=g._getNumberConverter(dt(z)),H=this.units[0].unit.value,G=this.units[0].unit.offset,Y=a(H,G),ee=J.units[0].unit.value,B=J.units[0].unit.offset,j=a(ee,B);J.value=n(z,L(i(Y,j)))}return J.fixPrefix=!0,J.skipAutomaticSimplification=!0,J},g.prototype.toNumber=function(T){return x(this.toNumeric(T))},g.prototype.toNumeric=function(T){var z;return T?z=this.to(T):z=this.clone(),z._isDerived()||z.units.length===0?z._denormalize(z.value):z._denormalize(z.value,z.units[0].prefix.value)},g.prototype.toString=function(){return this.format()},g.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},g.fromJSON=function(T){var z,J=new g(T.value,(z=T.unit)!==null&&z!==void 0?z:void 0);return J.fixPrefix=T.fixPrefix||!1,J},g.prototype.valueOf=g.prototype.toString,g.prototype.simplify=function(){var T=this.clone(),z=[],J;for(var L in ae)if(Me(ae,L)&&T.hasBase(k[L])){J=L;break}if(J==="NONE")T.units=[];else{var H;if(J&&Me(ae,J)&&(H=ae[J]),H)T.units=[{unit:H.unit,prefix:H.prefix,power:1}];else{for(var G=!1,Y=0;Y<q.length;Y++){var ee=q[Y];Math.abs(T.dimensions[Y]||0)>1e-12&&(Me(ae,ee)?z.push({unit:ae[ee].unit,prefix:ae[ee].prefix,power:T.dimensions[Y]||0}):G=!0)}z.length<T.units.length&&!G&&(T.units=z)}}return T},g.prototype.toSI=function(){for(var T=this.clone(),z=[],J=0;J<q.length;J++){var L=q[J];if(Math.abs(T.dimensions[J]||0)>1e-12)if(Me(re.si,L))z.push({unit:re.si[L].unit,prefix:re.si[L].prefix,power:T.dimensions[J]||0});else throw new Error("Cannot express custom unit "+L+" in SI units")}return T.units=z,T.fixPrefix=!0,T.skipAutomaticSimplification=!0,this.value!==null?(T.value=null,this.to(T)):T},g.prototype.formatUnits=function(){for(var T="",z="",J=0,L=0,H=0;H<this.units.length;H++)this.units[H].power>0?(J++,T+=" "+this.units[H].prefix.name+this.units[H].unit.name,Math.abs(this.units[H].power-1)>1e-15&&(T+="^"+this.units[H].power)):this.units[H].power<0&&L++;if(L>0)for(var G=0;G<this.units.length;G++)this.units[G].power<0&&(J>0?(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,Math.abs(this.units[G].power+1)>1e-15&&(z+="^"+-this.units[G].power)):(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,z+="^"+this.units[G].power));T=T.substr(1),z=z.substr(1),J>1&&L>0&&(T="("+T+")"),L>1&&J>0&&(z="("+z+")");var Y=T;return J>0&&L>0&&(Y+=" / "),Y+=z,Y},g.prototype.format=function(T){var z=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),J=!1;typeof z.value<"u"&&z.value!==null&&wn(z.value)&&(J=Math.abs(z.value.re)<1e-14);for(var L in z.units)Me(z.units,L)&&z.units[L].unit&&(z.units[L].unit.name==="VA"&&J?z.units[L].unit=V.VAR:z.units[L].unit.name==="VAR"&&!J&&(z.units[L].unit=V.VA));z.units.length===1&&!z.fixPrefix&&Math.abs(z.units[0].power-Math.round(z.units[0].power))<1e-14&&(z.units[0].prefix=z._bestPrefix());var H=z._denormalize(z.value),G=z.value!==null?m(H,T||{}):"",Y=z.formatUnits();return z.value&&wn(z.value)&&(G="("+G+")"),Y.length>0&&G.length>0&&(G+=" "),G+=Y,G},g.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var T=this.value!==null?c(this.value):0,z=c(this.units[0].unit.value),J=this.units[0].prefix;if(T===0)return J;var L=this.units[0].power,H=Math.log(T/Math.pow(J.value*z,L))/Math.LN10-1.2;if(H>-2.200001&&H<1.800001)return J;H=Math.abs(H);var G=this.units[0].unit.prefixes;for(var Y in G)if(Me(G,Y)){var ee=G[Y];if(ee.scientific){var B=Math.abs(Math.log(T/Math.pow(ee.value*z,L))/Math.LN10-1.2);(B<H||B===H&&ee.name.length<J.name.length)&&(J=ee,H=B)}}return J},g.prototype.splitUnit=function(T){for(var z=this.clone(),J=[],L=0;L<T.length&&(z=z.to(T[L]),L!==T.length-1);L++){var H=z.toNumeric(),G=s(H),Y=void 0,ee=f(G,H);ee?Y=G:Y=l(z.toNumeric());var B=new g(Y,T[L].toString());J.push(B),z=i(z,B)}for(var j=0,Q=0;Q<J.length;Q++)j=n(j,J[Q].value);return f(j,this.value)&&(z.value=0),J.push(z),J};var F={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};F.SHORTLONG=Ot({},F.SHORT,F.LONG),F.BINARY_SHORT=Ot({},F.BINARY_SHORT_SI,F.BINARY_SHORT_IEC),F.BINARY_LONG=Ot({},F.BINARY_LONG_SI,F.BINARY_LONG_IEC);var q=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var te in k)Me(k,te)&&(k[te].key=te);var se={},K={name:"",base:se,value:1,offset:0,dimensions:q.map(T=>0)},V={meter:{name:"meter",base:k.LENGTH,prefixes:F.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:F.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:F.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:F.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:F.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:F.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:F.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:F.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:F.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:F.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:F.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:F.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:F.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:F.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:F.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:F.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:F.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:F.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:F.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:F.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:F.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:F.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:F.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:F.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:F.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:F.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:F.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:F.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:F.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:F.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:F.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:F.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:F.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:F.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:F.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:F.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:F.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:F.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:F.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:F.NONE,value:7*86400,offset:0},month:{name:"month",base:k.TIME,prefixes:F.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:F.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:F.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:F.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:F.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:F.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:F.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:F.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:F.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:F.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:F.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:F.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:F.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:F.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:F.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:F.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:F.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:F.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:F.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:F.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:F.LONG,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:F.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:F.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:F.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:F.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:F.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:F.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:F.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:F.SHORT,value:h.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:F.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:F.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:F.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:F.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:F.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:F.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:F.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:F.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:F.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:F.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:F.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:F.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:F.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:F.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:F.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:F.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:F.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:F.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:F.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:F.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:F.BINARY_LONG,value:8,offset:0}},ue={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function me(T){if(T.number==="BigNumber"){var z=Bl(w);V.rad.value=new w(1),V.deg.value=z.div(180),V.grad.value=z.div(200),V.cycle.value=z.times(2),V.arcsec.value=z.div(648e3),V.arcmin.value=z.div(10800)}else V.rad.value=1,V.deg.value=Math.PI/180,V.grad.value=Math.PI/200,V.cycle.value=Math.PI*2,V.arcsec.value=Math.PI/648e3,V.arcmin.value=Math.PI/10800;V.radian.value=V.rad.value,V.degree.value=V.deg.value,V.gradian.value=V.grad.value}me(r),t&&t("config",function(T,z){T.number!==z.number&&me(T)});var re={si:{NONE:{unit:K,prefix:F.NONE[""]},LENGTH:{unit:V.m,prefix:F.SHORT[""]},MASS:{unit:V.g,prefix:F.SHORT.k},TIME:{unit:V.s,prefix:F.SHORT[""]},CURRENT:{unit:V.A,prefix:F.SHORT[""]},TEMPERATURE:{unit:V.K,prefix:F.SHORT[""]},LUMINOUS_INTENSITY:{unit:V.cd,prefix:F.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:V.mol,prefix:F.SHORT[""]},ANGLE:{unit:V.rad,prefix:F.SHORT[""]},BIT:{unit:V.bits,prefix:F.SHORT[""]},FORCE:{unit:V.N,prefix:F.SHORT[""]},ENERGY:{unit:V.J,prefix:F.SHORT[""]},POWER:{unit:V.W,prefix:F.SHORT[""]},PRESSURE:{unit:V.Pa,prefix:F.SHORT[""]},ELECTRIC_CHARGE:{unit:V.C,prefix:F.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:V.F,prefix:F.SHORT[""]},ELECTRIC_POTENTIAL:{unit:V.V,prefix:F.SHORT[""]},ELECTRIC_RESISTANCE:{unit:V.ohm,prefix:F.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:V.H,prefix:F.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:V.S,prefix:F.SHORT[""]},MAGNETIC_FLUX:{unit:V.Wb,prefix:F.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:V.T,prefix:F.SHORT[""]},FREQUENCY:{unit:V.Hz,prefix:F.SHORT[""]}}};re.cgs=JSON.parse(JSON.stringify(re.si)),re.cgs.LENGTH={unit:V.m,prefix:F.SHORT.c},re.cgs.MASS={unit:V.g,prefix:F.SHORT[""]},re.cgs.FORCE={unit:V.dyn,prefix:F.SHORT[""]},re.cgs.ENERGY={unit:V.erg,prefix:F.NONE[""]},re.us=JSON.parse(JSON.stringify(re.si)),re.us.LENGTH={unit:V.ft,prefix:F.NONE[""]},re.us.MASS={unit:V.lbm,prefix:F.NONE[""]},re.us.TEMPERATURE={unit:V.degF,prefix:F.NONE[""]},re.us.FORCE={unit:V.lbf,prefix:F.NONE[""]},re.us.ENERGY={unit:V.BTU,prefix:F.BTU[""]},re.us.POWER={unit:V.hp,prefix:F.NONE[""]},re.us.PRESSURE={unit:V.psi,prefix:F.NONE[""]},re.auto=JSON.parse(JSON.stringify(re.si));var ae=re.auto;g.setUnitSystem=function(T){if(Me(re,T))ae=re[T];else throw new Error("Unit system "+T+" does not exist. Choices are: "+Object.keys(re).join(", "))},g.getUnitSystem=function(){for(var T in re)if(Me(re,T)&&re[T]===ae)return T},g.typeConverters={BigNumber:function(T){return T!=null&&T.isFraction?new w(T.n).div(T.d).times(T.s):new w(T+"")},Fraction:function(T){return new v(T)},Complex:function(T){return T},number:function(T){return T!=null&&T.isFraction?d(T):T}},g.prototype._numberConverter=function(){var T=g.typeConverters[this.valueType()];if(T)return T;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},g._getNumberConverter=function(T){if(!g.typeConverters[T])throw new TypeError('Unsupported type "'+T+'"');return g.typeConverters[T]};for(var de in V)if(Me(V,de)){var ne=V[de];ne.dimensions=ne.base.dimensions}for(var ce in ue)if(Me(ue,ce)){var le=V[ue[ce]],he={};for(var xe in le)Me(le,xe)&&(he[xe]=le[xe]);he.name=ce,V[ce]=he}g.isValidAlpha=function(T){return/^[a-zA-Z]$/.test(T)};function $(T){for(var z=0;z<T.length;z++){if(N=T.charAt(z),z===0&&!g.isValidAlpha(N))throw new Error('Invalid unit name (must begin with alpha character): "'+T+'"');if(z>0&&!(g.isValidAlpha(N)||D(N)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+T+'"')}}return g.createUnit=function(T,z){if(typeof T!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(z&&z.override){for(var J in T)if(Me(T,J)&&g.deleteUnit(J),T[J].aliases)for(var L=0;L<T[J].aliases.length;L++)g.deleteUnit(T[J].aliases[L])}var H;for(var G in T)Me(T,G)&&(H=g.createUnitSingle(G,T[G]));return H},g.createUnitSingle=function(T,z){if((typeof z>"u"||z===null)&&(z={}),typeof T!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Me(V,T))throw new Error('Cannot create unit "'+T+'": a unit with that name already exists');$(T);var J=null,L=[],H=0,G,Y,ee;if(z&&z.type==="Unit")J=z.clone();else if(typeof z=="string")z!==""&&(G=z);else if(typeof z=="object")G=z.definition,Y=z.prefixes,H=z.offset,ee=z.baseName,z.aliases&&(L=z.aliases.valueOf());else throw new TypeError('Cannot create unit "'+T+'" from "'+z.toString()+'": expecting "string" or "Unit" or "Object"');if(L){for(var B=0;B<L.length;B++)if(Me(V,L[B]))throw new Error('Cannot create alias "'+L[B]+'": a unit with that name already exists')}if(G&&typeof G=="string"&&!J)try{J=g.parse(G,{allowNoUnits:!0})}catch(M){throw M.message='Could not create unit "'+T+'" from "'+G+'": '+M.message,M}else G&&G.type==="Unit"&&(J=G.clone());L=L||[],H=H||0,Y&&Y.toUpperCase?Y=F[Y.toUpperCase()]||F.NONE:Y=F.NONE;var j={};if(J){j={name:T,value:J.value,dimensions:J.dimensions.slice(0),prefixes:Y,offset:H};var Q=!1;for(var Z in k)if(Me(k,Z)){for(var ie=!0,oe=0;oe<q.length;oe++)if(Math.abs((j.dimensions[oe]||0)-(k[Z].dimensions[oe]||0))>1e-12){ie=!1;break}if(ie){Q=!0,j.base=k[Z];break}}if(!Q){ee=ee||T+"_STUFF";var ye={dimensions:J.dimensions.slice(0)};ye.key=ee,k[ee]=ye,ae[ee]={unit:j,prefix:F.NONE[""]},j.base=k[ee]}}else{if(ee=ee||T+"_STUFF",q.indexOf(ee)>=0)throw new Error('Cannot create new base unit "'+T+'": a base unit with that name already exists (and cannot be overridden)');q.push(ee);for(var fe in k)Me(k,fe)&&(k[fe].dimensions[q.length-1]=0);for(var De={dimensions:[]},Ne=0;Ne<q.length;Ne++)De.dimensions[Ne]=0;De.dimensions[q.length-1]=1,De.key=ee,k[ee]=De,j={name:T,value:1,dimensions:k[ee].dimensions.slice(0),prefixes:Y,offset:H,base:k[ee]},ae[ee]={unit:j,prefix:F.NONE[""]}}g.UNITS[T]=j;for(var je=0;je<L.length;je++){var Ze=L[je],_e={};for(var wt in j)Me(j,wt)&&(_e[wt]=j[wt]);_e.name=Ze,g.UNITS[Ze]=_e}return delete I.cache,new g(null,T)},g.deleteUnit=function(T){delete g.UNITS[T],delete I.cache},g.PREFIXES=F,g.BASE_DIMENSIONS=q,g.BASE_UNITS=k,g.UNIT_SYSTEMS=re,g.UNITS=V,g},{isClass:!0}),gd="unit",G_=["typed","Unit"],W_=U(gd,G_,e=>{var{typed:t,Unit:r}=e;return t(gd,{Unit:function(n){return n.clone()},string:function(n){return r.isValuelessUnit(n)?new r(null,n):r.parse(n,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(n,i){return new r(n,i)},"number | BigNumber | Fraction":function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),vd="sparse",K_=["typed","SparseMatrix"],Q_=U(vd,K_,e=>{var{typed:t,SparseMatrix:r}=e;return t(vd,{"":function(){return new r([])},string:function(n){return new r([],n)},"Array | Matrix":function(n){return new r(n)},"Array | Matrix, string":function(n,i){return new r(n,i)}})}),yd="createUnit",Z_=["typed","Unit"],X_=U(yd,Z_,e=>{var{typed:t,Unit:r}=e;return t(yd,{"Object, Object":function(n,i){return r.createUnit(n,i)},Object:function(n){return r.createUnit(n,{})},"string, Unit | string | Object, Object":function(n,i,a){var o={};return o[n]=i,r.createUnit(o,a)},"string, Unit | string | Object":function(n,i){var a={};return a[n]=i,r.createUnit(a,{})},string:function(n){var i={};return i[n]={},r.createUnit(i,{})}})}),bd="acos",Y_=["typed","config","Complex"],e3=U(bd,Y_,e=>{var{typed:t,config:r,Complex:n}=e;return t(bd,{number:function(i){return i>=-1&&i<=1||r.predictable?Math.acos(i):new n(i,0).acos()},Complex:function(i){return i.acos()},BigNumber:function(i){return i.acos()}})}),xd="acosh",t3=["typed","config","Complex"],r3=U(xd,t3,e=>{var{typed:t,config:r,Complex:n}=e;return t(xd,{number:function(i){return i>=1||r.predictable?ty(i):i<=-1?new n(Math.log(Math.sqrt(i*i-1)-i),Math.PI):new n(i,0).acosh()},Complex:function(i){return i.acosh()},BigNumber:function(i){return i.acosh()}})}),wd="acot",n3=["typed","BigNumber"],i3=U(wd,n3,e=>{var{typed:t,BigNumber:r}=e;return t(wd,{number:ry,Complex:function(n){return n.acot()},BigNumber:function(n){return new r(1).div(n).atan()}})}),Nd="acoth",a3=["typed","config","Complex","BigNumber"],o3=U(Nd,a3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Nd,{number:function(a){return a>=1||a<=-1||r.predictable?ny(a):new n(a,0).acoth()},Complex:function(a){return a.acoth()},BigNumber:function(a){return new i(1).div(a).atanh()}})}),Dd="acsc",s3=["typed","config","Complex","BigNumber"],u3=U(Dd,s3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Dd,{number:function(a){return a<=-1||a>=1||r.predictable?iy(a):new n(a,0).acsc()},Complex:function(a){return a.acsc()},BigNumber:function(a){return new i(1).div(a).asin()}})}),Ed="acsch",c3=["typed","BigNumber"],l3=U(Ed,c3,e=>{var{typed:t,BigNumber:r}=e;return t(Ed,{number:ay,Complex:function(n){return n.acsch()},BigNumber:function(n){return new r(1).div(n).asinh()}})}),Ad="asec",f3=["typed","config","Complex","BigNumber"],p3=U(Ad,f3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Ad,{number:function(a){return a<=-1||a>=1||r.predictable?oy(a):new n(a,0).asec()},Complex:function(a){return a.asec()},BigNumber:function(a){return new i(1).div(a).acos()}})}),Sd="asech",m3=["typed","config","Complex","BigNumber"],d3=U(Sd,m3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Sd,{number:function(a){if(a<=1&&a>=-1||r.predictable){var o=1/a;if(o>0||r.predictable)return sy(a);var u=Math.sqrt(o*o-1);return new n(Math.log(u-o),Math.PI)}return new n(a,0).asech()},Complex:function(a){return a.asech()},BigNumber:function(a){return new i(1).div(a).acosh()}})}),Cd="asin",h3=["typed","config","Complex"],g3=U(Cd,h3,e=>{var{typed:t,config:r,Complex:n}=e;return t(Cd,{number:function(i){return i>=-1&&i<=1||r.predictable?Math.asin(i):new n(i,0).asin()},Complex:function(i){return i.asin()},BigNumber:function(i){return i.asin()}})}),v3="asinh",y3=["typed"],b3=U(v3,y3,e=>{var{typed:t}=e;return t("asinh",{number:uy,Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()}})}),x3="atan",w3=["typed"],N3=U(x3,w3,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),Md="atan2",D3=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],E3=U(Md,D3,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=Dy({typed:t,equalScalar:n}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Md,{"number, number":Math.atan2,"BigNumber, BigNumber":(m,d)=>i.atan2(m,d)},p({scalar:"number | BigNumber",SS:l,DS:c,SD:u,Ss:s,sS:f}))}),_d="atanh",A3=["typed","config","Complex"],S3=U(_d,A3,e=>{var{typed:t,config:r,Complex:n}=e;return t(_d,{number:function(i){return i<=1&&i>=-1||r.predictable?cy(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})}),_a=U("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}}),Fd="cos",C3=["typed"],M3=U(Fd,C3,e=>{var{typed:t}=e,r=_a({typed:t});return t(Fd,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),Td="cosh",_3=["typed"],F3=U(Td,_3,e=>{var{typed:t}=e;return t(Td,{number:AN,"Complex | BigNumber":r=>r.cosh()})}),Od="cot",T3=["typed","BigNumber"],O3=U(Od,T3,e=>{var{typed:t,BigNumber:r}=e,n=_a({typed:t});return t(Od,{number:ly,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)}),Bd="coth",B3=["typed","BigNumber"],k3=U(Bd,B3,e=>{var{typed:t,BigNumber:r}=e;return t(Bd,{number:fy,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),kd="csc",I3=["typed","BigNumber"],R3=U(kd,I3,e=>{var{typed:t,BigNumber:r}=e,n=_a({typed:t});return t(kd,{number:py,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)}),Id="csch",q3=["typed","BigNumber"],z3=U(Id,q3,e=>{var{typed:t,BigNumber:r}=e;return t(Id,{number:my,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),Rd="sec",j3=["typed","BigNumber"],L3=U(Rd,j3,e=>{var{typed:t,BigNumber:r}=e,n=_a({typed:t});return t(Rd,{number:dy,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)}),qd="sech",P3=["typed","BigNumber"],V3=U(qd,P3,e=>{var{typed:t,BigNumber:r}=e;return t(qd,{number:hy,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),zd="sin",U3=["typed"],$3=U(zd,U3,e=>{var{typed:t}=e,r=_a({typed:t});return t(zd,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),jd="sinh",H3=["typed"],J3=U(jd,H3,e=>{var{typed:t}=e;return t(jd,{number:gy,"Complex | BigNumber":r=>r.sinh()})}),Ld="tan",G3=["typed"],W3=U(Ld,G3,e=>{var{typed:t}=e,r=_a({typed:t});return t(Ld,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),K3="tanh",Q3=["typed"],Z3=U(K3,Q3,e=>{var{typed:t}=e;return t("tanh",{number:CN,"Complex | BigNumber":r=>r.tanh()})}),Pd="setCartesian",X3=["typed","size","subset","compareNatural","Index","DenseMatrix"],Y3=U(Pd,X3,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Pd,{"Array | Matrix, Array | Matrix":function(u,c){var l=[];if(n(r(u),new a(0))!==0&&n(r(c),new a(0))!==0){var s=ot(Array.isArray(u)?u:u.toArray()).sort(i),f=ot(Array.isArray(c)?c:c.toArray()).sort(i);l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)l.push([s[p],f[m]])}return Array.isArray(u)&&Array.isArray(c)?l:new o(l)}})}),Vd="setDifference",e4=["typed","size","subset","compareNatural","Index","DenseMatrix"],t4=U(Vd,e4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Vd,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0)l=[];else{if(n(r(c),new a(0))===0)return ot(u.toArray());var s=ga(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ga(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p,m=0;m<s.length;m++){p=!1;for(var d=0;d<f.length;d++)if(i(s[m].value,f[d].value)===0&&s[m].identifier===f[d].identifier){p=!0;break}p||l.push(s[m])}}return Array.isArray(u)&&Array.isArray(c)?Rs(l):new o(Rs(l))}})}),Ud="setDistinct",r4=["typed","size","subset","compareNatural","Index","DenseMatrix"],n4=U(Ud,r4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Ud,{"Array | Matrix":function(u){var c;if(n(r(u),new a(0))===0)c=[];else{var l=ot(Array.isArray(u)?u:u.toArray()).sort(i);c=[],c.push(l[0]);for(var s=1;s<l.length;s++)i(l[s],l[s-1])!==0&&c.push(l[s])}return Array.isArray(u)?c:new o(c)}})}),$d="setIntersect",i4=["typed","size","subset","compareNatural","Index","DenseMatrix"],a4=U($d,i4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t($d,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0||n(r(c),new a(0))===0)l=[];else{var s=ga(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ga(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)if(i(s[p].value,f[m].value)===0&&s[p].identifier===f[m].identifier){l.push(s[p]);break}}return Array.isArray(u)&&Array.isArray(c)?Rs(l):new o(Rs(l))}})}),Hd="setIsSubset",o4=["typed","size","subset","compareNatural","Index"],s4=U(Hd,o4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Hd,{"Array | Matrix, Array | Matrix":function(o,u){if(n(r(o),new a(0))===0)return!0;if(n(r(u),new a(0))===0)return!1;for(var c=ga(ot(Array.isArray(o)?o:o.toArray()).sort(i)),l=ga(ot(Array.isArray(u)?u:u.toArray()).sort(i)),s,f=0;f<c.length;f++){s=!1;for(var p=0;p<l.length;p++)if(i(c[f].value,l[p].value)===0&&c[f].identifier===l[p].identifier){s=!0;break}if(s===!1)return!1}return!0}})}),Jd="setMultiplicity",u4=["typed","size","subset","compareNatural","Index"],c4=U(Jd,u4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Jd,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(o,u){if(n(r(u),new a(0))===0)return 0;for(var c=ot(Array.isArray(u)?u:u.toArray()),l=0,s=0;s<c.length;s++)i(c[s],o)===0&&l++;return l}})}),Gd="setPowerset",l4=["typed","size","subset","compareNatural","Index"],f4=U(Gd,l4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Gd,{"Array | Matrix":function(c){if(n(r(c),new a(0))===0)return[];for(var l=ot(Array.isArray(c)?c:c.toArray()).sort(i),s=[],f=0;f.toString(2).length<=l.length;)s.push(o(l,f.toString(2).split("").reverse())),f++;return u(s)}});function o(c,l){for(var s=[],f=0;f<l.length;f++)l[f]==="1"&&s.push(c[f]);return s}function u(c){for(var l=[],s=c.length-1;s>0;s--)for(var f=0;f<s;f++)c[f].length>c[f+1].length&&(l=c[f],c[f]=c[f+1],c[f+1]=l);return c}}),Wd="setSize",p4=["typed","compareNatural"],m4=U(Wd,p4,e=>{var{typed:t,compareNatural:r}=e;return t(Wd,{"Array | Matrix":function(n){return Array.isArray(n)?ot(n).length:ot(n.toArray()).length},"Array | Matrix, boolean":function(n,i){if(i===!1||n.length===0)return Array.isArray(n)?ot(n).length:ot(n.toArray()).length;for(var a=ot(Array.isArray(n)?n:n.toArray()).sort(r),o=1,u=1;u<a.length;u++)r(a[u],a[u-1])!==0&&o++;return o}})}),Kd="setSymDifference",d4=["typed","size","concat","subset","setDifference","Index"],h4=U(Kd,d4,e=>{var{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(Kd,{"Array | Matrix, Array | Matrix":function(u,c){if(i(r(u),new o(0))===0)return ot(c);if(i(r(c),new o(0))===0)return ot(u);var l=ot(u),s=ot(c);return n(a(l,s),a(s,l))}})}),Qd="setUnion",g4=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],v4=U(Qd,g4,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:u}=e;return t(Qd,{"Array | Matrix, Array | Matrix":function(c,l){if(i(r(c),new u(0))===0)return ot(l);if(i(r(l),new u(0))===0)return ot(c);var s=ot(c),f=ot(l);return n(o(s,f),a(s,f))}})}),Zd="add",y4=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],b4=U(Zd,y4,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,c=ii({typed:t}),l=Ml({typed:t,equalScalar:i}),s=zi({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:r,concat:u});return t(Zd,{"any, any":n,"any, any, ...any":t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w})},f({elop:n,DS:c,SS:l,Ss:s}))}),Xd="hypot",x4=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],w4=U(Xd,x4,e=>{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:u,isPositive:c}=e;return t(Xd,{"... number | BigNumber":l,Array:l,Matrix:s=>l(ot(s.toArray()))});function l(s){for(var f=0,p=0,m=0;m<s.length;m++){if(wn(s[m]))throw new TypeError("Unexpected type of argument to hypot");var d=r(s[m]);u(p,d)?(f=a(f,a(i(p,d),i(p,d))),f=n(f,1),p=d):f=n(f,c(d)?a(i(d,p),i(d,p)):d)}return a(p,o(f))}}),Yd="norm",N4=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],D4=U(Yd,N4,e=>{var{typed:t,abs:r,add:n,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:c,larger:l,smaller:s,matrix:f,ctranspose:p,eigs:m}=e;return t(Yd,{number:Math.abs,Complex:function(E){return E.abs()},BigNumber:function(E){return E.abs()},boolean:function(E){return Math.abs(E)},Array:function(E){return N(f(E),2)},Matrix:function(E){return N(E,2)},"Array, number | BigNumber | string":function(E,A){return N(f(E),A)},"Matrix, number | BigNumber | string":function(E,A){return N(E,A)}});function d(E){var A=0;return E.forEach(function(D){var S=r(D);l(S,A)&&(A=S)},!0),A}function h(E){var A;return E.forEach(function(D){var S=r(D);(!A||s(S,A))&&(A=S)},!0),A||0}function w(E,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return d(E);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return h(E);if(A==="fro")return N(E,2);if(typeof A=="number"&&!isNaN(A)){if(!c(A,0)){var D=0;return E.forEach(function(S){D=n(i(r(S),A),D)},!0),i(D,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function v(E){var A=0;return E.forEach(function(D,S){A=n(A,u(D,a(D)))}),r(o(A))}function x(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[1],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function g(E){var A=E.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var D=p(E),S=u(D,E),C=m(S).values.toArray(),_=C[C.length-1];return r(o(_))}function b(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[0],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function y(E,A){if(A===1)return x(E);if(A===Number.POSITIVE_INFINITY||A==="inf")return b(E);if(A==="fro")return v(E);if(A===2)return g(E);throw new Error("Unsupported parameter value "+A)}function N(E,A){var D=E.size();if(D.length===1)return w(E,A);if(D.length===2){if(D[0]&&D[1])return y(E,A);throw new RangeError("Invalid matrix dimensions")}}}),eh="dot",E4=["typed","addScalar","multiplyScalar","conj","size"],A4=U(eh,E4,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:a}=e;return t(eh,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":c});function o(s,f){var p=l(s),m=l(f),d,h;if(p.length===1)d=p[0];else if(p.length===2&&p[1]===1)d=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(m.length===1)h=m[0];else if(m.length===2&&m[1]===1)h=m[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+m.join(", ")+")");if(d!==h)throw new RangeError("Vectors must have equal length ("+d+" != "+h+")");if(d===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return d}function u(s,f){var p=o(s,f),m=ke(s)?s._data:s,d=ke(s)?s._datatype||s.getDataType():void 0,h=ke(f)?f._data:f,w=ke(f)?f._datatype||f.getDataType():void 0,v=l(s).length===2,x=l(f).length===2,g=r,b=n;if(d&&w&&d===w&&typeof d=="string"&&d!=="mixed"){var y=d;g=t.find(r,[y,y]),b=t.find(n,[y,y])}if(!v&&!x){for(var N=b(i(m[0]),h[0]),E=1;E<p;E++)N=g(N,b(i(m[E]),h[E]));return N}if(!v&&x){for(var A=b(i(m[0]),h[0][0]),D=1;D<p;D++)A=g(A,b(i(m[D]),h[D][0]));return A}if(v&&!x){for(var S=b(i(m[0][0]),h[0]),C=1;C<p;C++)S=g(S,b(i(m[C][0]),h[C]));return S}if(v&&x){for(var _=b(i(m[0][0]),h[0][0]),R=1;R<p;R++)_=g(_,b(i(m[R][0]),h[R][0]));return _}}function c(s,f){o(s,f);for(var p=s._index,m=s._values,d=f._index,h=f._values,w=0,v=r,x=n,g=0,b=0;g<p.length&&b<d.length;){var y=p[g],N=d[b];if(y<N){g++;continue}if(y>N){b++;continue}y===N&&(w=v(w,x(m[g],h[b])),g++,b++)}return w}function l(s){return ke(s)?s.size():a(s)}}),S4="trace",C4=["typed","matrix","add"],M4=U(S4,C4,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(o){return i(r(o))},SparseMatrix:a,DenseMatrix:i,any:ze});function i(o){var u=o._size,c=o._data;switch(u.length){case 1:if(u[0]===1)return ze(c[0]);throw new RangeError("Matrix must be square (size: "+Ge(u)+")");case 2:{var l=u[0],s=u[1];if(l===s){for(var f=0,p=0;p<l;p++)f=n(f,c[p][p]);return f}else throw new RangeError("Matrix must be square (size: "+Ge(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(u)+")")}}function a(o){var u=o._values,c=o._index,l=o._ptr,s=o._size,f=s[0],p=s[1];if(f===p){var m=0;if(u.length>0)for(var d=0;d<p;d++)for(var h=l[d],w=l[d+1],v=h;v<w;v++){var x=c[v];if(x===d){m=n(m,u[v]);break}if(x>d)break}return m}throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}}),th="index",_4=["typed","Index"],F4=U(th,_4,e=>{var{typed:t,Index:r}=e;return t(th,{"...number | string | BigNumber | Range | Array | Matrix":function(n){var i=n.map(function(o){return $e(o)?o.toNumber():st(o)||ke(o)?o.map(function(u){return $e(u)?u.toNumber():u}):o}),a=new r;return r.apply(a,i),a}})}),Ly=new Set(["end"]),T4="Node",O4=["mathWithTransform"],B4=U(T4,O4,e=>{var{mathWithTransform:t}=e;function r(i){for(var a of[...Ly])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(t,{}),o={},u=null;function c(l){var s=aa(l);return r(s),a(s,o,u)}return{evaluate:c}}_compile(a,o){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!ft(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function o(u,c){u.forEach(function(l,s,f){c(l,s,f),o(l,c)})}o(this,a)}transform(a){function o(u,c,l){var s=a(u,c,l);return s!==u?s:u.map(o)}return o(this,null,null)}filter(a){var o=[];return this.traverse(function(u,c,l){a(u,c,l)&&o.push(u)}),o}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&Oi(this,a):!1}toString(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lr(e){return e&&e.isIndexError?new $r(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function Py(e){var{subset:t}=e;return function(r,n){try{if(Array.isArray(r))return t(r,n);if(r&&typeof r.subset=="function")return r.subset(n);if(typeof r=="string")return t(r,n);if(typeof r=="object"){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return nr(r,n.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw lr(i)}}}var Ho="AccessorNode",k4=["subset","Node"],I4=U(Ho,k4,e=>{var{subset:t,Node:r}=e,n=Py({subset:t});function i(o){return!(Ti(o)||Sr(o)||nt(o)||Zn(o)||mu(o)||An(o)||zt(o))}class a extends r{constructor(u,c){if(super(),!ft(u))throw new TypeError('Node expected for parameter "object"');if(!Da(c))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=c}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Ho}get isAccessorNode(){return!0}_compile(u,c){var l=this.object._compile(u,c),s=this.index._compile(u,c);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,m,d){return nr(l(p,m,d),f)}}else return function(p,m,d){var h=l(p,m,d),w=s(p,m,h);return n(h,w)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new a(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(u){var c=this.object.toString(u);return i(this.object)&&(c="("+c+")"),c+this.index.toString(u)}_toHTML(u){var c=this.object.toHTML(u);return i(this.object)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+this.index.toHTML(u)}_toTex(u){var c=this.object.toTex(u);return i(this.object)&&(c="\\left(' + object + '\\right)"),c+this.index.toTex(u)}toJSON(){return{mathjs:Ho,object:this.object,index:this.index}}static fromJSON(u){return new a(u.object,u.index)}}return kt(a,"name",Ho),a},{isClass:!0,isNode:!0}),Jo="ArrayNode",R4=["Node"],q4=U(Jo,R4,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(ft))throw new TypeError("Array containing Nodes expected")}get type(){return Jo}get isArrayNode(){return!0}_compile(i,a){var o=Nn(this.items,function(l){return l._compile(i,a)}),u=i.config.matrix!=="Array";if(u){var c=i.matrix;return function(l,s,f){return c(Nn(o,function(p){return p(l,s,f)}))}}else return function(l,s,f){return Nn(o,function(p){return p(l,s,f)})}}forEach(i){for(var a=0;a<this.items.length;a++){var o=this.items[a];i(o,"items["+a+"]",this)}}map(i){for(var a=[],o=0;o<this.items.length;o++)a[o]=this._ifNode(i(this.items[o],"items["+o+"]",this));return new r(a)}clone(){return new r(this.items.slice(0))}_toString(i){var a=this.items.map(function(o){return o.toString(i)});return"["+a.join(", ")+"]"}toJSON(){return{mathjs:Jo,items:this.items}}static fromJSON(i){return new r(i.items)}_toHTML(i){var a=this.items.map(function(o){return o.toHTML(i)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(i){function a(o,u){var c=o.some(Sr)&&!o.every(Sr),l=u||c,s=l?"&":"\\\\",f=o.map(function(p){return p.items?a(p.items,!u):p.toTex(i)}).join(s);return c||!l||l&&!u?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return a(this.items,!1)}}return kt(r,"name",Jo),r},{isClass:!0,isNode:!0});function z4(e){var{subset:t,matrix:r}=e;return function(n,i,a){try{if(Array.isArray(n)){var o=r(n).subset(i,a).valueOf();return o.forEach((u,c)=>{n[c]=u}),n}else{if(n&&typeof n.subset=="function")return n.subset(i,a);if(typeof n=="string")return t(n,i,a);if(typeof n=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return pa(n,i.getObjectProperty(),a),n}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw lr(u)}}}var Ir=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Go(e,t){if(!t||t!=="auto")return e;for(var r=e;An(r);)r=r.content;return r}function mt(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,u=0;u<Ir.length;u++)if(a in Ir[u]){o=u;break}if(a==="OperatorNode:multiply"&&i.implicit&&r!=="show"){var c=Go(i.args[0],t);!(nt(c)&&n&&n.getIdentifier()==="OperatorNode:divide"&&Oc(Go(n.args[0],t)))&&!(c.getIdentifier()==="OperatorNode:divide"&&Oc(Go(c.args[0],t))&&nt(Go(c.args[1])))&&(o+=1)}return o}function Ha(e,t){var r=e;t!=="keep"&&(r=e.getContent());var n=r.getIdentifier(),i=mt(r,t);if(i===null)return null;var a=Ir[i][n];if(Me(a,"associativity")){if(a.associativity==="left")return"left";if(a.associativity==="right")return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function pc(e,t,r){var n=r!=="keep"?e.getContent():e,i=r!=="keep"?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),u=mt(n,r);if(u===null)return null;var c=Ir[u][a];if(Me(c,"associativeWith")&&c.associativeWith instanceof Array){for(var l=0;l<c.associativeWith.length;l++)if(c.associativeWith[l]===o)return!0;return!1}return null}function j4(e){var t="OperatorNode:"+e;for(var r of Ir)if(t in r)return r[t].op;return null}var Wo="AssignmentNode",L4=["subset","?matrix","Node"],P4=U(Wo,L4,e=>{var{subset:t,matrix:r,Node:n}=e,i=Py({subset:t}),a=z4({subset:t,matrix:r});function o(c,l,s){l||(l="keep");var f=mt(c,l,s),p=mt(c.value,l,s);return l==="all"||p!==null&&p<=f}class u extends n{constructor(l,s,f){if(super(),this.object=l,this.index=f?s:null,this.value=f||s,!zt(l)&&!Ti(l))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(zt(l)&&l.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Da(this.index))throw new TypeError('IndexNode expected as "index"');if(!ft(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Wo}get isAssignmentNode(){return!0}_compile(l,s){var f=this.object._compile(l,s),p=this.index?this.index._compile(l,s):null,m=this.value._compile(l,s),d=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(g,b,y){var N=f(g,b,y),E=m(g,b,y);return pa(N,h,E),E}}else{if(zt(this.object))return function(g,b,y){var N=f(g,b,y),E=m(g,b,y),A=p(g,b,N);return g.set(d,a(N,A,E)),E};var w=this.object.object._compile(l,s);if(this.object.index.isObjectProperty()){var v=this.object.index.getObjectProperty();return function(g,b,y){var N=w(g,b,y),E=nr(N,v),A=p(g,b,E),D=m(g,b,y);return pa(N,v,a(E,A,D)),D}}else{var x=this.object.index._compile(l,s);return function(g,b,y){var N=w(g,b,y),E=x(g,b,N),A=i(N,E),D=p(g,b,A),S=m(g,b,y);return a(N,E,a(A,D,S)),S}}}else{if(!zt(this.object))throw new TypeError("SymbolNode expected as object");return function(g,b,y){var N=m(g,b,y);return g.set(d,N),N}}}forEach(l){l(this.object,"object",this),this.index&&l(this.index,"index",this),l(this.value,"value",this)}map(l){var s=this._ifNode(l(this.object,"object",this)),f=this.index?this._ifNode(l(this.index,"index",this)):null,p=this._ifNode(l(this.value,"value",this));return new u(s,f,p)}clone(){return new u(this.object,this.index,this.value)}_toString(l){var s=this.object.toString(l),f=this.index?this.index.toString(l):"",p=this.value.toString(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="("+p+")"),s+f+" = "+p}toJSON(){return{mathjs:Wo,object:this.object,index:this.index,value:this.value}}static fromJSON(l){return new u(l.object,l.index,l.value)}_toHTML(l){var s=this.object.toHTML(l),f=this.index?this.index.toHTML(l):"",p=this.value.toHTML(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p='<span class="math-paranthesis math-round-parenthesis">(</span>'+p+'<span class="math-paranthesis math-round-parenthesis">)</span>'),s+f+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+p}_toTex(l){var s=this.object.toTex(l),f=this.index?this.index.toTex(l):"",p=this.value.toTex(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="\\left(".concat(p,"\\right)")),s+f+"="+p}}return kt(u,"name",Wo),u},{isClass:!0,isNode:!0}),Ko="BlockNode",V4=["ResultSet","Node"],U4=U(Ko,V4,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(o){var u=o&&o.node,c=o&&o.visible!==void 0?o.visible:!0;if(!ft(u))throw new TypeError('Property "node" must be a Node');if(typeof c!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:c}})}get type(){return Ko}get isBlockNode(){return!0}_compile(a,o){var u=Nn(this.blocks,function(c){return{evaluate:c.node._compile(a,o),visible:c.visible}});return function(c,l,s){var f=[];return bu(u,function(p){var m=p.evaluate(c,l,s);p.visible&&f.push(m)}),new t(f)}}forEach(a){for(var o=0;o<this.blocks.length;o++)a(this.blocks[o].node,"blocks["+o+"].node",this)}map(a){for(var o=[],u=0;u<this.blocks.length;u++){var c=this.blocks[u],l=this._ifNode(a(c.node,"blocks["+u+"].node",this));o[u]={node:l,visible:c.visible}}return new n(o)}clone(){var a=this.blocks.map(function(o){return{node:o.node,visible:o.visible}});return new n(a)}_toString(a){return this.blocks.map(function(o){return o.node.toString(a)+(o.visible?"":";")}).join(`
|
|
29
|
-
`)}toJSON(){return{mathjs:
|
|
30
|
-
`)}}return kt(n,"name",Ko),n},{isClass:!0,isNode:!0}),Qo="ConditionalNode",$4=["Node"],H4=U(Qo,$4,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if($e(i))return!i.isZero();if(wn(i))return!!(i.re||i.im);if(Cr(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+dt(i)+'"')}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Parameter condition must be a Node");if(!ft(o))throw new TypeError("Parameter trueExpr must be a Node");if(!ft(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=o,this.falseExpr=u}get type(){return Qo}get isConditionalNode(){return!0}_compile(a,o){var u=this.condition._compile(a,o),c=this.trueExpr._compile(a,o),l=this.falseExpr._compile(a,o);return function(s,f,p){return r(u(s,f,p))?c(s,f,p):l(s,f,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toString(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c="("+c+")");var s=this.trueExpr.toString(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s="("+s+")");var p=this.falseExpr.toString(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p="("+p+")"),c+" ? "+s+" : "+p}toJSON(){return{mathjs:Qo,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toHTML(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.trueExpr.toHTML(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');var p=this.falseExpr.toHTML(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+p}_toTex(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return kt(n,"name",Qo),n},{isClass:!0,isNode:!0}),$c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J4={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},G4={"–":"\\--","—":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},W4=function(e,t){return $c({},e,t)},K4=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,a=i===void 0?W4:i,o=String(e),u="",c=a($c({},J4),n?$c({},G4):{}),l=Object.keys(c),s=function(){var f=!1;l.forEach(function(p,m){f||o.length>=p.length&&o.slice(0,p.length)===p&&(u+=c[l[m]],o=o.slice(p.length,o.length),f=!0)}),f||(u+=o.slice(0,1),o=o.slice(1,o.length))};o;)s();return u};const Q4=No(K4);var Hc={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},at={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},rh={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(at.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(at.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(at.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(at.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(at.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(at.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(at.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(at.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(at.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(at.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(at.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(at.bitAnd,"${args[1]}\\right)")},bitNot:{1:at.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(at.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(at.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(at.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(at.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(at.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(at.and,"${args[1]}\\right)")},not:{1:at.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(at.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(at.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(at.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(at.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(at.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(at.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(at.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(at.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(at.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(at.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(at.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(at.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(at.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Hc.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},Z4="\\mathrm{${name}}\\left(${args}\\right)",nh={deg:"^\\circ"};function Jc(e){return Q4(e,{preserveFormatting:!0})}function Vy(e,t){return t=typeof t>"u"?!1:t,t?Me(nh,e)?nh[e]:"\\mathrm{"+Jc(e)+"}":Me(Hc,e)?Hc[e]:Jc(e)}var Zo="ConstantNode",X4=["Node"],Y4=U(Zo,X4,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Zo}get isConstantNode(){return!0}_compile(i,a){var o=this.value;return function(){return o}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Ge(this.value,i)}_toHTML(i){var a=this._toString(i);switch(dt(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+a+"</span>";case"string":return'<span class="math-string">'+a+"</span>";case"boolean":return'<span class="math-boolean">'+a+"</span>";case"null":return'<span class="math-null-symbol">'+a+"</span>";case"undefined":return'<span class="math-undefined">'+a+"</span>";default:return'<span class="math-symbol">'+a+"</span>"}}toJSON(){return{mathjs:Zo,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var a=this._toString(i),o=dt(this.value);switch(o){case"string":return"\\mathtt{"+Jc(a)+"}";case"number":case"BigNumber":{var u=o==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var c=a.toLowerCase().indexOf("e");return c!==-1?a.substring(0,c)+"\\cdot10^{"+a.substring(c+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return kt(r,"name",Zo),r},{isClass:!0,isNode:!0}),Xo="FunctionAssignmentNode",eF=["typed","Node"],tF=U(Xo,eF,e=>{var{typed:t,Node:r}=e;function n(a,o,u){var c=mt(a,o,u),l=mt(a.expr,o,u);return o==="all"||l!==null&&l<=c}class i extends r{constructor(o,u,c){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!ft(c))throw new TypeError('Node expected for parameter "expr"');if(Ly.has(o))throw new Error('Illegal function name, "'+o+'" is a reserved keyword');var l=new Set;for(var s of u){var f=typeof s=="string"?s:s.name;if(l.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));l.add(f)}this.name=o,this.params=u.map(function(p){return p&&p.name||p}),this.types=u.map(function(p){return p&&p.type||"any"}),this.expr=c}get type(){return Xo}get isFunctionAssignmentNode(){return!0}_compile(o,u){var c=Object.create(u);bu(this.params,function(d){c[d]=!0});var l=this.expr._compile(o,c),s=this.name,f=this.params,p=np(this.types,","),m=s+"("+np(this.params,", ")+")";return function(d,h,w){var v={};v[p]=function(){for(var g=Object.create(h),b=0;b<f.length;b++)g[f[b]]=arguments[b];return l(d,g,w)};var x=t(s,v);return x.syntax=m,d.set(s,x),x}}forEach(o){o(this.expr,"expr",this)}map(o){var u=this._ifNode(o(this.expr,"expr",this));return new i(this.name,this.params.slice(0),u)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toString(o);return n(this,u,o&&o.implicit)&&(c="("+c+")"),this.name+"("+this.params.join(", ")+") = "+c}toJSON(){var o=this.types;return{mathjs:Xo,name:this.name,params:this.params.map(function(u,c){return{name:u,type:o[c]}}),expr:this.expr}}static fromJSON(o){return new i(o.name,o.params,o.expr)}_toHTML(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",c=[],l=0;l<this.params.length;l++)c.push('<span class="math-symbol math-parameter">'+Mr(this.params[l])+"</span>");var s=this.expr.toHTML(o);return n(this,u,o&&o.implicit)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Mr(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+c.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+s}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toTex(o);return n(this,u,o&&o.implicit)&&(c="\\left(".concat(c,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Vy).join(",")+"\\right)="+c}}return kt(i,"name",Xo),i},{isClass:!0,isNode:!0}),Yo="IndexNode",rF=["Node","size"],nF=U(Yo,rF,e=>{var{Node:t,size:r}=e;class n extends t{constructor(a,o){if(super(),this.dimensions=a,this.dotNotation=o||!1,!Array.isArray(a)||!a.every(ft))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Yo}get isIndexNode(){return!0}_compile(a,o){var u=Nn(this.dimensions,function(l,s){var f=l.filter(d=>d.isSymbolNode&&d.name==="end").length>0;if(f){var p=Object.create(o);p.end=!0;var m=l._compile(a,p);return function(d,h,w){if(!ke(w)&&!st(w)&&!Qt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+dt(w));var v=r(w).valueOf(),x=Object.create(h);return x.end=v[s],m(d,x,w)}}else return l._compile(a,o)}),c=nr(a,"index");return function(l,s,f){var p=Nn(u,function(m){return m(l,s,f)});return c(...p)}}forEach(a){for(var o=0;o<this.dimensions.length;o++)a(this.dimensions[o],"dimensions["+o+"]",this)}map(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this._ifNode(a(this.dimensions[u],"dimensions["+u+"]",this));return new n(o,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&nt(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(a){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:Yo,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(a){return new n(a.dimensions,a.dotNotation)}_toHTML(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this.dimensions[u].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Mr(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+o.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(a){var o=this.dimensions.map(function(u){return u.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+o.join(",")+"}"}}return kt(n,"name",Yo),n},{isClass:!0,isNode:!0}),es="ObjectNode",iF=["Node"],aF=U(es,iF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return ft(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return es}get isObjectNode(){return!0}_compile(i,a){var o={};for(var u in this.properties)if(Me(this.properties,u)){var c=na(u),l=JSON.parse(c),s=nr(this.properties,u);o[l]=s._compile(i,a)}return function(f,p,m){var d={};for(var h in o)Me(o,h)&&(d[h]=o[h](f,p,m));return d}}forEach(i){for(var a in this.properties)Me(this.properties,a)&&i(this.properties[a],"properties["+na(a)+"]",this)}map(i){var a={};for(var o in this.properties)Me(this.properties,o)&&(a[o]=this._ifNode(i(this.properties[o],"properties["+na(o)+"]",this)));return new r(a)}clone(){var i={};for(var a in this.properties)Me(this.properties,a)&&(i[a]=this.properties[a]);return new r(i)}_toString(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push(na(o)+": "+this.properties[o].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:es,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push('<span class="math-symbol math-property">'+Mr(o)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[o].toHTML(i));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push("\\mathbf{"+o+":} & "+this.properties[o].toTex(i)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+a.join(`
|
|
31
|
-
`)+"\\end{array}\\right\\}";return u}}return kt(r,"name",es),r},{isClass:!0,isNode:!0});function Xa(e,t){return new Xg(e,new hu(t),new Set(Object.keys(t)))}var ts="OperatorNode",oF=["Node"],sF=U(ts,oF,e=>{var{Node:t}=e;function r(a,o){var u=a;if(o==="auto")for(;An(u);)u=u.content;return nt(u)?!0:Ct(u)?r(u.args[0],o):!1}function n(a,o,u,c,l){var s=mt(a,o,u),f=Ha(a,o);if(o==="all"||c.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return c.map(function(S){switch(S.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var p;switch(c.length){case 0:p=[];break;case 1:{var m=mt(c[0],o,u,a);if(l&&m!==null){var d,h;if(o==="keep"?(d=c[0].getIdentifier(),h=a.getIdentifier()):(d=c[0].getContent().getIdentifier(),h=a.getContent().getIdentifier()),Ir[s][h].latexLeftParens===!1){p=[!1];break}if(Ir[m][d].latexParens===!1){p=[!1];break}}if(m===null){p=[!1];break}if(m<=s){p=[!0];break}p=[!1]}break;case 2:{var w,v=mt(c[0],o,u,a),x=pc(a,c[0],o);v===null?w=!1:v===s&&f==="right"&&!x||v<s?w=!0:w=!1;var g,b=mt(c[1],o,u,a),y=pc(a,c[1],o);if(b===null?g=!1:b===s&&f==="left"&&!y||b<s?g=!0:g=!1,l){var N,E,A;o==="keep"?(N=a.getIdentifier(),E=a.args[0].getIdentifier(),A=a.args[1].getIdentifier()):(N=a.getContent().getIdentifier(),E=a.args[0].getContent().getIdentifier(),A=a.args[1].getContent().getIdentifier()),v!==null&&(Ir[s][N].latexLeftParens===!1&&(w=!1),Ir[v][E].latexParens===!1&&(w=!1)),b!==null&&(Ir[s][N].latexRightParens===!1&&(g=!1),Ir[b][A].latexParens===!1&&(g=!1))}p=[w,g]}break;default:(a.getIdentifier()==="OperatorNode:add"||a.getIdentifier()==="OperatorNode:multiply")&&(p=c.map(function(S){var C=mt(S,o,u,a),_=pc(a,S,o),R=Ha(S,o);return C===null?!1:s===C&&f===R&&!_?!0:C<s}));break}if(c.length>=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&o!=="all"&&u==="hide")for(var D=1;D<p.length;++D)r(c[D],o)&&!p[D-1]&&(o!=="keep"||!An(c[D-1]))&&(p[D]=!0);return p}class i extends t{constructor(o,u,c,l,s){if(super(),typeof o!="string")throw new TypeError('string expected for parameter "op"');if(typeof u!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(c)||!c.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=l===!0,this.isPercentage=s===!0,this.op=o,this.fn=u,this.args=c||[]}get type(){return ts}get isOperatorNode(){return!0}_compile(o,u){if(typeof this.fn!="string"||!Nl(o,this.fn))throw o[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var c=nr(o,this.fn),l=Nn(this.args,function(d){return d._compile(o,u)});if(typeof c=="function"&&c.rawArgs===!0){var s=this.args;return function(d,h,w){return c(s,o,Xa(d,h))}}else if(l.length===1){var f=l[0];return function(d,h,w){return c(f(d,h,w))}}else if(l.length===2){var p=l[0],m=l[1];return function(d,h,w){return c(p(d,h,w),m(d,h,w))}}else return function(d,h,w){return c.apply(null,Nn(l,function(v){return v(d,h,w)}))}}forEach(o){for(var u=0;u<this.args.length;u++)o(this.args[u],"args["+u+"]",this)}map(o){for(var u=[],c=0;c<this.args.length;c++)u[c]=this._ifNode(o(this.args[c],"args["+c+"]",this));return new i(this.op,this.fn,u,this.implicit,this.isPercentage)}clone(){return new i(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return this.args.length===1}isBinary(){return this.args.length===2}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=Ha(this,u),p=l[0].toString(o);s[0]&&(p="("+p+")");var m=/[a-zA-Z]+/.test(this.op);return f==="right"?this.op+(m?" ":"")+p:f==="left"?p+(m?" ":"")+this.op:p+this.op}else if(l.length===2){var d=l[0].toString(o),h=l[1].toString(o);return s[0]&&(d="("+d+")"),s[1]&&(h="("+h+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?d+" "+h:d+" "+this.op+" "+h}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var w=l.map(function(v,x){return v=v.toString(o),s[x]&&(v="("+v+")"),v});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?w.join(" "):w.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:ts,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(o){return new i(o.op,o.fn,o.args,o.implicit,o.isPercentage)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=Ha(this,u),p=l[0].toHTML(o);return s[0]&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),f==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Mr(this.op)+"</span>"+p:p+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Mr(this.op)+"</span>"}else if(l.length===2){var m=l[0].toHTML(o),d=l[1].toHTML(o);return s[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),s[1]&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?m+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+d:m+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"+d}else{var h=l.map(function(w,v){return w=w.toHTML(o),s[v]&&(w='<span class="math-parenthesis math-round-parenthesis">(</span>'+w+'<span class="math-parenthesis math-round-parenthesis">)</span>'),w});return l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?h.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):h.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"):'<span class="math-function">'+Mr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+h.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!0),f=at[this.fn];if(f=typeof f>"u"?this.op:f,l.length===1){var p=Ha(this,u),m=l[0].toTex(o);return s[0]&&(m="\\left(".concat(m,"\\right)")),p==="right"?f+m:m+f}else if(l.length===2){var d=l[0],h=d.toTex(o);s[0]&&(h="\\left(".concat(h,"\\right)"));var w=l[1],v=w.toTex(o);s[1]&&(v="\\left(".concat(v,"\\right)"));var x;switch(u==="keep"?x=d.getIdentifier():x=d.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+h+"}{"+v+"}";case"OperatorNode:pow":switch(h="{"+h+"}",v="{"+v+"}",x){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&c==="hide")return h+"~"+v}return h+f+v}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=l.map(function(b,y){return b=b.toTex(o),s[y]&&(b="\\left(".concat(b,"\\right)")),b});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&c==="hide"?g.join("~"):g.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+l.map(function(b){return b.toTex(o)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return kt(i,"name",ts),i},{isClass:!0,isNode:!0}),rs="ParenthesisNode",uF=["Node"],cF=U(rs,uF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!ft(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return rs}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new r(a)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:rs,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(i)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return kt(r,"name",rs),r},{isClass:!0,isNode:!0}),ns="RangeNode",lF=["Node"],fF=U(ns,lF,e=>{var{Node:t}=e;function r(i,a,o){var u=mt(i,a,o),c={},l=mt(i.start,a,o);if(c.start=l!==null&&l<=u||a==="all",i.step){var s=mt(i.step,a,o);c.step=s!==null&&s<=u||a==="all"}var f=mt(i.end,a,o);return c.end=f!==null&&f<=u||a==="all",c}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Node expected");if(!ft(o))throw new TypeError("Node expected");if(u&&!ft(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=o,this.step=u||null}get type(){return ns}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(o){return zt(o)&&o.name==="end"});return a.length>0}_compile(a,o){var u=a.range,c=this.start._compile(a,o),l=this.end._compile(a,o);if(this.step){var s=this.step._compile(a,o);return function(f,p,m){return u(c(f,p,m),l(f,p,m),s(f,p,m))}}else return function(f,p,m){return u(c(f,p,m),l(f,p,m))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toString(a);if(u.start&&(l="("+l+")"),c=l,this.step){var s=this.step.toString(a);u.step&&(s="("+s+")"),c+=":"+s}var f=this.end.toString(a);return u.end&&(f="("+f+")"),c+=":"+f,c}toJSON(){return{mathjs:ns,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toHTML(a);if(u.start&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c=l,this.step){var s=this.step.toHTML(a);u.step&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+s}var f=this.end.toHTML(a);return u.end&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+f,c}_toTex(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c=this.start.toTex(a);if(u.start&&(c="\\left(".concat(c,"\\right)")),this.step){var l=this.step.toTex(a);u.step&&(l="\\left(".concat(l,"\\right)")),c+=":"+l}var s=this.end.toTex(a);return u.end&&(s="\\left(".concat(s,"\\right)")),c+=":"+s,c}}return kt(n,"name",ns),n},{isClass:!0,isNode:!0}),is="RelationalNode",pF=["Node"],mF=U(is,pF,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(a,o){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(o))throw new TypeError("Parameter params must be an array");if(a.length!==o.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=o}get type(){return is}get isRelationalNode(){return!0}_compile(a,o){var u=this,c=this.params.map(l=>l._compile(a,o));return function(l,s,f){for(var p,m=c[0](l,s,f),d=0;d<u.conditionals.length;d++){p=m,m=c[d+1](l,s,f);var h=nr(a,u.conditionals[d]);if(!h(p,m))return!1}return!0}}forEach(a){this.params.forEach((o,u)=>a(o,"params["+u+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((o,u)=>this._ifNode(a(o,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"("+f.toString(a)+")":f.toString(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=" "+r[this.conditionals[s]],l+=" "+c[s+1];return l}toJSON(){return{mathjs:is,conditionals:this.conditionals,params:this.params}}static fromJSON(a){return new n(a.conditionals,a.params)}_toHTML(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?'<span class="math-parenthesis math-round-parenthesis">(</span>'+f.toHTML(a)+'<span class="math-parenthesis math-round-parenthesis">)</span>':f.toHTML(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(r[this.conditionals[s]])+"</span>"+c[s+1];return l}_toTex(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"\\left("+f.toTex(a)+"\right)":f.toTex(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=at[this.conditionals[s]]+c[s+1];return l}}return kt(n,"name",is),n},{isClass:!0,isNode:!0}),dF="SymbolNode",hF=["math","?Unit","Node"],gF=U(dF,hF,e=>{var{math:t,Unit:r,Node:n}=e;function i(o){return r?r.isValuelessUnit(o):!1}class a extends n{constructor(u){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');this.name=u}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(u,c){var l=this.name;if(c[l]===!0)return function(f,p,m){return nr(p,l)};if(l in u)return function(f,p,m){return f.has(l)?f.get(l):nr(u,l)};var s=i(l);return function(f,p,m){return f.has(l)?f.get(l):s?new r(null,l):a.onUndefinedSymbol(l)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new a(this.name)}_toString(u){return this.name}_toHTML(u){var c=Mr(this.name);return c==="true"||c==="false"?'<span class="math-symbol math-boolean">'+c+"</span>":c==="i"?'<span class="math-symbol math-imaginary-symbol">'+c+"</span>":c==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+c+"</span>":c==="NaN"?'<span class="math-symbol math-nan-symbol">'+c+"</span>":c==="null"?'<span class="math-symbol math-null-symbol">'+c+"</span>":c==="undefined"?'<span class="math-symbol math-undefined-symbol">'+c+"</span>":'<span class="math-symbol">'+c+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new a(u.name)}_toTex(u){var c=!1;typeof t[this.name]>"u"&&i(this.name)&&(c=!0);var l=Vy(this.name,c);return l[0]==="\\"?l:" "+l}}return a},{isClass:!0,isNode:!0}),as="FunctionNode",vF=["math","Node","SymbolNode"],yF=U(as,vF,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,a=c=>Ge(c,{truncate:78});function o(c,l,s){for(var f="",p=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,m=0,d;(d=p.exec(c))!==null;)if(f+=c.substring(m,d.index),m=d.index,d[0]==="$$")f+="$",m++;else{m+=d[0].length;var h=l[d[1]];if(!h)throw new ReferenceError("Template: Property "+d[1]+" does not exist.");if(d[2]===void 0)switch(typeof h){case"string":f+=h;break;case"object":if(ft(h))f+=h.toTex(s);else if(Array.isArray(h))f+=h.map(function(w,v){if(ft(w))return w.toTex(s);throw new TypeError("Template: "+d[1]+"["+v+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes")}else if(ft(h[d[2]]&&h[d[2]]))f+=h[d[2]].toTex(s);else throw new TypeError("Template: "+d[1]+"["+d[2]+"] is not a Node.")}return f+=c.slice(m),f}class u extends n{constructor(l,s){if(super(),typeof l=="string"&&(l=new i(l)),!ft(l))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(s)||!s.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=l,this.args=s||[]}get name(){return this.fn.name||""}get type(){return as}get isFunctionNode(){return!0}_compile(l,s){var f=this.args.map(A=>A._compile(l,s));if(zt(this.fn)){var p=this.fn.name;if(s[p]){var m=this.args;return function(A,D,S){var C=nr(D,p);if(typeof C!="function")throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(a(C)));if(C.rawArgs)return C(m,l,Xa(A,D));var _=f.map(R=>R(A,D,S));return C.apply(C,_)}}else{var d=p in l?nr(l,p):void 0,h=typeof d=="function"&&d.rawArgs===!0,w=A=>{var D;if(A.has(p))D=A.get(p);else if(p in l)D=nr(l,p);else return u.onUndefinedFunction(p);if(typeof D=="function")return D;throw new TypeError("'".concat(p,`' is not a function; its value is:
|
|
32
|
-
`).concat(a(D)))};if(h){var v=this.args;return function(A,D,S){var C=w(A);return C(v,l,
|
|
33
|
-
`.concat(a(C)));if(C.rawArgs)return C(E,l,
|
|
28
|
+
(`+Ge(A,h)+", "+Ge(b,h)+") ==> "+(this._values?Ge(this._values[E],h):"X")}return g},i.prototype.toString=function(){return Ge(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(h){if(h){if($e(h)&&(h=h.toNumber()),!Ue(h)||!Fe(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var w=h>0?h:0,v=h<0?-h:0,x=this._size[0],g=this._size[1],b=Math.min(x-v,g-w),y=[],N=[],E=[];E[0]=0;for(var A=w;A<g&&y.length<b;A++)for(var D=this._ptr[A],S=this._ptr[A+1],C=D;C<S;C++){var _=this._index[C];if(_===A-w+v){y.push(this._values[C]),N[y.length-1]=_-v;break}}return E.push(y.length),new i({values:y,index:N,ptr:E,size:[b,1]})},i.fromJSON=function(h){return new i(h)},i.diagonal=function(h,w,v,x,g){if(!st(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(k){if($e(k)&&(k=k.toNumber()),!Ue(k)||!Fe(k)||k<1)throw new Error("Size values must be positive integers");return k}),v){if($e(v)&&(v=v.toNumber()),!Ue(v)||!Fe(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var b=r,y=0;Qt(g)&&(b=t.find(r,[g,g])||r,y=t.convert(0,g));var N=v>0?v:0,E=v<0?-v:0,A=h[0],D=h[1],S=Math.min(A-E,D-N),C;if(st(w)){if(w.length!==S)throw new Error("Invalid value array length");C=function(k){return w[k]}}else if(ke(w)){var _=w.size();if(_.length!==1||_[0]!==S)throw new Error("Invalid matrix length");C=function(k){return w.get([k])}}else C=function(){return w};for(var R=[],P=[],I=[],O=0;O<D;O++){I.push(R.length);var F=O-N;if(F>=0&&F<S){var q=C(F);b(q,y)||(P.push(F+E),R.push(q))}}return I.push(R.length),new i({values:R,index:P,ptr:I,size:[A,D]})},i.prototype.swapRows=function(h,w){if(!Ue(h)||!Fe(h)||!Ue(w)||!Fe(w))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(h,this._size[0]),pt(w,this._size[0]),i._swapRows(h,w,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(h,w,v,x,g){for(var b=x[h],y=x[h+1],N=b;N<y;N++)g(v[N],w[N])},i._swapRows=function(h,w,v,x,g,b){for(var y=0;y<v;y++){var N=b[y],E=b[y+1],A=l(h,N,E,g),D=l(w,N,E,g);if(A<E&&D<E&&g[A]===h&&g[D]===w){if(x){var S=x[A];x[A]=x[D],x[D]=S}continue}if(A<E&&g[A]===h&&(D>=E||g[D]!==w)){var C=x?x[A]:void 0;g.splice(D,0,w),x&&x.splice(D,0,C),g.splice(D<=A?A+1:A,1),x&&x.splice(D<=A?A+1:A,1);continue}if(D<E&&g[D]===w&&(A>=E||g[A]!==h)){var _=x?x[D]:void 0;g.splice(A,0,h),x&&x.splice(A,0,_),g.splice(A<=D?D+1:D,1),x&&x.splice(A<=D?D+1:D,1)}}},i},{isClass:!0}),rE="number",nE=["typed"];function iE(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function aE(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++){var i=parseInt(e.fractionalPart[n],e.radix);r+=i/Math.pow(e.radix,n+1)}var a=t+r;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var oE=U(rE,nE,e=>{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var i=iE(n);if(i)return aE(i);var a=0,o=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(a=Number(o[2]),n=o[1]);var u=Number(n);if(isNaN(u))throw new SyntaxError('String "'+n+'" is not a valid number');if(o){if(u>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));u>=2**(a-1)&&(u=u-2**a)}return u},BigNumber:function(n){return n.toNumber()},Fraction:function(n){return n.valueOf()},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(n){return 0},"Unit, string | Unit":function(n,i){return n.toNumber(i)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),Ap="string",sE=["typed"],uE=U(Ap,sE,e=>{var{typed:t}=e;return t(Ap,{"":function(){return""},number:Ei,null:function(r){return"null"},boolean:function(r){return r+""},string:function(r){return r},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r)),any:function(r){return String(r)}})}),Sp="boolean",cE=["typed"],lE=U(Sp,cE,e=>{var{typed:t}=e;return t(Sp,{"":function(){return!1},boolean:function(r){return r},number:function(r){return!!r},null:function(r){return!1},BigNumber:function(r){return!r.isZero()},string:function(r){var n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;var i=Number(r);if(r!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+r+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),fE="bignumber",pE=["typed","BigNumber"],mE=U(fE,pE,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(n){return new r(n+"")},string:function(n){var i=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var a=i[2],o=r(i[1]),u=new r(2).pow(Number(a));if(o.gt(u.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var c=new r(2).pow(Number(a)-1);return o.gte(c)?o.sub(u):o}return new r(n)},BigNumber:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(n){return new r(n.n).div(n.d).times(n.s)},null:function(n){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),dE="complex",hE=["typed","Complex"],gE=U(dE,hE,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(n){return new r(n,0)},"number, number":function(n,i){return new r(n,i)},"BigNumber, BigNumber":function(n,i){return new r(n.toNumber(),i.toNumber())},Fraction:function(n){return new r(n.valueOf(),0)},Complex:function(n){return n.clone()},string:function(n){return r(n)},null:function(n){return r(0)},Object:function(n){if("re"in n&&"im"in n)return new r(n.re,n.im);if("r"in n&&"phi"in n||"abs"in n&&"arg"in n)return new r(n);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),vE="fraction",yE=["typed","Fraction"],bE=U(vE,yE,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r(n)},string:function(n){return new r(n)},"number, number":function(n,i){return new r(n,i)},null:function(n){return new r(0)},BigNumber:function(n){return new r(n.toString())},Fraction:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),Cp="matrix",xE=["typed","Matrix","DenseMatrix","SparseMatrix"],wE=U(Cp,xE,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(Cp,{"":function(){return a([])},string:function(o){return a([],o)},"string, string":function(o,u){return a([],o,u)},Array:function(o){return a(o)},Matrix:function(o){return a(o,o.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,c){if(u==="dense"||u==="default"||u===void 0)return new n(o,c);if(u==="sparse")return new i(o,c);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),Mp="matrixFromFunction",NE=["typed","matrix","isZero"],DE=U(Mp,NE,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(Mp,{"Array | Matrix, function, string, string":function(a,o,u,c){return i(a,o,u,c)},"Array | Matrix, function, string":function(a,o,u){return i(a,o,u)},"Matrix, function":function(a,o){return i(a,o,"dense")},"Array, function":function(a,o){return i(a,o,"dense").toArray()},"Array | Matrix, string, function":function(a,o,u){return i(a,u,o)},"Array | Matrix, string, string, function":function(a,o,u,c){return i(a,c,o,u)}});function i(a,o,u,c){var l;return c!==void 0?l=r(u,c):l=r(u),l.resize(a),l.forEach(function(s,f){var p=o(f);n(p)||l.set(f,p)}),l}}),_p="matrixFromRows",EE=["typed","matrix","flatten","size"],AE=U(_p,EE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(_p,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var c=o(u[0]),l=[];for(var s of u){var f=o(s);if(f!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(f|0));l.push(n(s))}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Fp="matrixFromColumns",SE=["typed","matrix","flatten","size"],CE=U(Fp,SE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(Fp,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var c=o(u[0]),l=[],s=0;s<c;s++)l[s]=[];for(var f of u){var p=o(f);if(p!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(p|0));for(var m=n(f),d=0;d<c;d++)l[d].push(m[d])}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Tp="splitUnit",ME=["typed"],_E=U(Tp,ME,e=>{var{typed:t}=e;return t(Tp,{"Unit, Array":function(r,n){return r.splitUnit(n)}})}),Op="unaryMinus",FE=["typed"],TE=U(Op,FE,e=>{var{typed:t}=e;return t(Op,{number:jv,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Bp="unaryPlus",OE=["typed","config","BigNumber"],BE=U(Bp,OE,e=>{var{typed:t,config:r,BigNumber:n}=e;return t(Bp,{number:Lv,Complex:function(i){return i},BigNumber:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i)),"boolean | string":function(i){return r.number==="BigNumber"?new n(+i):+i}})}),kp="abs",kE=["typed"],IE=U(kp,kE,e=>{var{typed:t}=e;return t(kp,{number:Iv,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Ip="apply",RE=["typed","isInteger"],Bl=U(Ip,RE,e=>{var{typed:t,isInteger:r}=e;return t(Ip,{"Array | Matrix, number | BigNumber, function":function(n,i,a){if(!r(i))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(n)?Ve(n):n.size();if(i<0||i>=o.length)throw new $r(i,o.length);return ke(n)?n.create(Gs(n.valueOf(),i,a)):Gs(n,i,a)}})});function Gs(e,t,r){var n,i,a;if(t<=0)if(Array.isArray(e[0])){for(a=qE(e),i=[],n=0;n<a.length;n++)i[n]=Gs(a[n],t-1,r);return i}else return r(e);else{for(i=[],n=0;n<e.length;n++)i[n]=Gs(e[n],t-1,r);return i}}function qE(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}var Rp="addScalar",zE=["typed"],jE=U(Rp,zE,e=>{var{typed:t}=e;return t(Rp,{"number, number":Rv,"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":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),qp="subtractScalar",LE=["typed"],PE=U(qp,LE,e=>{var{typed:t}=e;return t(qp,{"number, number":qv,"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":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),zp="cbrt",VE=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],UE=U(zp,VE,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:o,BigNumber:u,Fraction:c}=e;return r(zp,{number:to,Complex:l,"Complex, boolean":l,BigNumber:function(f){return f.cbrt()},Unit:s});function l(f,p){var m=f.arg()/3,d=f.abs(),h=new o(to(d),0).mul(new o(0,m).exp());if(p){var w=[h,new o(to(d),0).mul(new o(0,m+Math.PI*2/3).exp()),new o(to(d),0).mul(new o(0,m-Math.PI*2/3).exp())];return t.matrix==="Array"?w:a(w)}else return h}function s(f){if(f.value&&wn(f.value)){var p=f.clone();return p.value=1,p=p.pow(1/3),p.value=l(f.value),p}else{var m=n(f.value);m&&(f.value=i(f.value));var d;$e(f.value)?d=new u(1).div(3):Do(f.value)?d=new c(1,3):d=1/3;var h=f.pow(d);return m&&(h.value=i(h.value)),h}}}),$E="matAlgo11xS0s",HE=["typed","equalScalar"],Jt=U($E,HE,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=r,w=0,v=a;typeof f=="string"&&(d=f,h=t.find(r,[d,d]),w=t.convert(0,d),i=t.convert(i,d),v=t.find(a,[d,d]));for(var x=[],g=[],b=[],y=0;y<m;y++){b[y]=g.length;for(var N=l[y],E=l[y+1],A=N;A<E;A++){var D=c[A],S=o?v(i,u[A]):v(u[A],i);h(S,w)||(g.push(D),x.push(S))}}return b[m]=g.length,n.createSparseMatrix({values:x,index:g,ptr:b,size:[p,m],datatype:d})}}),JE="matAlgo12xSfs",GE=["typed","DenseMatrix"],It=U(JE,GE,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],x=[],g=0;g<m;g++){for(var b=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],x[A]=b}for(var D=0;D<p;D++)g===0&&(w[D]=[]),x[D]===b?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=o?h(i,0):h(0,i)}return new r({data:w,size:[p,m],datatype:d})}}),KE="matAlgo14xDs",WE=["typed"],Jr=U(KE,WE,e=>{var{typed:t}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype,s,f=a;typeof l=="string"&&(s=l,i=t.convert(i,s),f=t.find(a,[s,s]));var p=c.length>0?r(f,0,c,c[0],u,i,o):[];return n.createDenseMatrix({data:p,size:ze(c),datatype:s})};function r(n,i,a,o,u,c,l){var s=[];if(i===a.length-1)for(var f=0;f<o;f++)s[f]=l?n(c,u[f]):n(u[f],c);else for(var p=0;p<o;p++)s[p]=r(n,i+1,a,a[i+1],u[p],c,l);return s}}),Jc="ceil",QE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],ZE=U(Jc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(Jc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.ceil(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.ceil(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),XE=U(Jc,QE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=ZE({typed:t,config:r,round:n});return t("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,m){return p.ceil(m)},"Complex, BigNumber":function(p,m){return p.ceil(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,m){return p.ceil(m)},"Fraction, BigNumber":function(p,m){return p.ceil(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),jp="cube",YE=["typed"],eA=U(jp,YE,e=>{var{typed:t}=e;return t(jp,{number:Pv,Complex:function(r){return r.mul(r).mul(r)},BigNumber:function(r){return r.times(r).times(r)},Fraction:function(r){return r.pow(3)},Unit:function(r){return r.pow(3)}})}),Lp="exp",tA=["typed"],rA=U(Lp,tA,e=>{var{typed:t}=e;return t(Lp,{number:Vv,Complex:function(r){return r.exp()},BigNumber:function(r){return r.exp()}})}),Pp="expm1",nA=["typed","Complex"],iA=U(Pp,nA,e=>{var{typed:t,Complex:r}=e;return t(Pp,{number:Uv,Complex:function(n){var i=Math.exp(n.re);return new r(i*Math.cos(n.im)-1,i*Math.sin(n.im))},BigNumber:function(n){return n.exp().minus(1)}})}),Gc="fix",aA=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],oA=U(Gc,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(Gc,{number:function(i){return i>0?n(i):r(i)},"number, number":function(i,a){return i>0?n(i,a):r(i,a)}})}),sA=U(Gc,aA,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:u,DenseMatrix:c}=e,l=It({typed:t,DenseMatrix:c}),s=Jr({typed:t}),f=oA({typed:t,ceil:i,floor:a});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,m){return new r(p.re>0?a(p.re,m):i(p.re,m),p.im>0?a(p.im,m):i(p.im,m))},"Complex, BigNumber":function(p,m){var d=m.toNumber();return new r(p.re>0?a(p.re,d):i(p.re,d),p.im>0?a(p.im,d):i(p.im,d))},BigNumber:function(p){return p.isNegative()?i(p):a(p)},"BigNumber, number | BigNumber":function(p,m){return p.isNegative()?i(p,m):a(p,m)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,m){return p.s<0?i(p,m):a(p,m)},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array | Matrix, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>o(m,0)?u(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),Kc="floor",uA=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],cA=U(Kc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(Kc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.floor(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.floor(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),Fy=U(Kc,uA,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=cA({typed:t,config:r,round:n});return t("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,m){return p.floor(m)},"Complex, BigNumber":function(p,m){return p.floor(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.floor()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,m){return p.floor(m)},"Fraction, BigNumber":function(p,m){return p.floor(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),lA="matAlgo02xDS0",fA=["typed","equalScalar"],Gr=U(lA,fA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype||n.getDataType(),s=i._values,f=i._index,p=i._ptr,m=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new We(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=c[0],w=c[1],v,x=r,g=0,b=a;typeof l=="string"&&l===d&&l!=="mixed"&&(v=l,x=t.find(r,[v,v]),g=t.convert(0,v),b=t.find(a,[v,v]));for(var y=[],N=[],E=[],A=0;A<w;A++){E[A]=N.length;for(var D=p[A],S=p[A+1],C=D;C<S;C++){var _=f[C],R=o?b(s[C],u[_][A]):b(u[_][A],s[C]);x(R,g)||(N.push(_),y.push(R))}}return E[w]=N.length,i.createSparseMatrix({values:y,index:N,ptr:E,size:[h,w],datatype:l===n._datatype&&d===i._datatype?v:void 0})}}),pA="matAlgo03xDSf",mA=["typed"],cr=U(pA,mA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new We(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w,v=0,x=i;typeof c=="string"&&c===m&&c!=="mixed"&&(w=c,v=t.convert(0,w),x=t.find(i,[w,w]));for(var g=[],b=0;b<d;b++)g[b]=[];for(var y=[],N=[],E=0;E<h;E++){for(var A=E+1,D=f[E],S=f[E+1],C=D;C<S;C++){var _=s[C];y[_]=a?x(l[C],o[_][E]):x(o[_][E],l[C]),N[_]=A}for(var R=0;R<d;R++)N[R]===A?g[R][E]=y[R]:g[R][E]=a?x(v,o[R][E]):x(o[R][E],v)}return r.createDenseMatrix({data:g,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),dA="matAlgo05xSfSf",hA=["typed","equalScalar"],Cu=U(dA,hA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new We(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=N?[]:void 0,C=[],_=[],R,P,I,O;for(P=0;P<v;P++){A[P]=E.length;var F=P+1;for(I=c[P],O=c[P+1];I<O;I++)R=u[I],E.push(R),C[R]=F,D&&(D[R]=o[I]);for(I=m[P],O=m[P+1];I<O;I++)R=p[I],C[R]!==F&&E.push(R),_[R]=F,S&&(S[R]=f[I]);if(N)for(I=A[P];I<E.length;){R=E[I];var q=C[R],k=_[R];if(q===F||k===F){var te=q===F?D[R]:b,se=k===F?S[R]:b,W=y(te,se);g(W,b)?E.splice(I,1):(N.push(W),I++)}}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),gA="matAlgo13xDD",vA=["typed"],yA=U(gA,vA,e=>{var{typed:t}=e;return function(n,i,a){var o=n._data,u=n._size,c=n._datatype,l=i._data,s=i._size,f=i._datatype,p=[];if(u.length!==s.length)throw new We(u.length,s.length);for(var m=0;m<u.length;m++){if(u[m]!==s[m])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");p[m]=u[m]}var d,h=a;typeof c=="string"&&c===f&&(d=c,h=t.find(a,[d,d]));var w=p.length>0?r(h,0,p,p[0],o,l):[];return n.createDenseMatrix({data:w,size:p,datatype:d})};function r(n,i,a,o,u,c){var l=[];if(i===a.length-1)for(var s=0;s<o;s++)l[s]=n(u[s],c[s]);else for(var f=0;f<o;f++)l[f]=r(n,i+1,a,a[i+1],u[f],c[f]);return l}}),bA="broadcast",xA=["concat"],wA=U(bA,xA,e=>{var{concat:t}=e;return function(i,a){var o=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((d,h)=>d===a._size[h]))return[i,a];for(var u=r(i._size,o,0),c=r(a._size,o,0),l=[],s=0;s<o;s++)l[s]=Math.max(u[s],c[s]);Vs(u,l),Vs(c,l);var f=i.clone(),p=a.clone();f._size.length<o?f.reshape(r(f._size,o,1)):p._size.length<o&&p.reshape(r(p._size,o,1));for(var m=0;m<o;m++)f._size[m]<l[m]&&(f=n(f,l[m],m)),p._size[m]<l[m]&&(p=n(p,l[m],m));return[f,p]};function r(i,a,o){return[...Array(a-i.length).fill(o),...i]}function n(i,a,o){return t(...Array(a).fill(i),o)}}),NA="matrixAlgorithmSuite",DA=["typed","matrix","concat"],gt=U(NA,DA,e=>{var{typed:t,matrix:r,concat:n}=e,i=yA({typed:t}),a=Jr({typed:t}),o=wA({concat:n});return function(u){var c=u.elop,l=u.SD||u.DS,s;c?(s={"DenseMatrix, DenseMatrix":(d,h)=>i(...o(d,h),c),"Array, Array":(d,h)=>i(...o(r(d),r(h)),c).valueOf(),"Array, DenseMatrix":(d,h)=>i(...o(r(d),h),c),"DenseMatrix, Array":(d,h)=>i(...o(d,r(h)),c)},u.SS&&(s["SparseMatrix, SparseMatrix"]=(d,h)=>u.SS(...o(d,h),c,!1)),u.DS&&(s["DenseMatrix, SparseMatrix"]=(d,h)=>u.DS(...o(d,h),c,!1),s["Array, SparseMatrix"]=(d,h)=>u.DS(...o(r(d),h),c,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(d,h)=>l(...o(h,d),c,!0),s["SparseMatrix, Array"]=(d,h)=>l(...o(r(h),d),c,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(h,w),d)),"Array, Array":t.referToSelf(d=>(h,w)=>i(...o(r(h),r(w)),d).valueOf()),"Array, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(r(h),w),d)),"DenseMatrix, Array":t.referToSelf(d=>(h,w)=>i(...o(h,r(w)),d))},u.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.SS(...o(h,w),d,!1))),u.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(h,w),d,!1)),s["Array, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(r(h),w),d,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(d=>(h,w)=>l(...o(w,h),d,!0)),s["SparseMatrix, Array"]=t.referToSelf(d=>(h,w)=>l(...o(r(w),h),d,!0))));var f=u.scalar||"any",p=u.Ds||u.Ss;p&&(c?(s["DenseMatrix,"+f]=(d,h)=>a(d,h,c,!1),s[f+", DenseMatrix"]=(d,h)=>a(h,d,c,!0),s["Array,"+f]=(d,h)=>a(r(d),h,c,!1).valueOf(),s[f+", Array"]=(d,h)=>a(r(h),d,c,!0).valueOf()):(s["DenseMatrix,"+f]=t.referToSelf(d=>(h,w)=>a(h,w,d,!1)),s[f+", DenseMatrix"]=t.referToSelf(d=>(h,w)=>a(w,h,d,!0)),s["Array,"+f]=t.referToSelf(d=>(h,w)=>a(r(h),w,d,!1).valueOf()),s[f+", Array"]=t.referToSelf(d=>(h,w)=>a(r(w),h,d,!0).valueOf())));var m=u.sS!==void 0?u.sS:u.Ss;return c?(u.Ss&&(s["SparseMatrix,"+f]=(d,h)=>u.Ss(d,h,c,!1)),m&&(s[f+", SparseMatrix"]=(d,h)=>m(h,d,c,!0))):(u.Ss&&(s["SparseMatrix,"+f]=t.referToSelf(d=>(h,w)=>u.Ss(h,w,d,!1))),m&&(s[f+", SparseMatrix"]=t.referToSelf(d=>(h,w)=>m(w,h,d,!0)))),c&&c.signatures&&ev(s,c.signatures),s}}),Vp="mod",EA=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Ty=U(Vp,EA,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u,concat:c}=e,l=Fy({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}),s=Gr({typed:t,equalScalar:a}),f=cr({typed:t}),p=Cu({typed:t,equalScalar:a}),m=Jt({typed:t,equalScalar:a}),d=It({typed:t,DenseMatrix:u}),h=gt({typed:t,matrix:i,concat:c});return t(Vp,{"number, number":w,"BigNumber, BigNumber":function(v,x){return x.isZero()?v:v.sub(x.mul(l(v.div(x))))},"Fraction, Fraction":function(v,x){return x.equals(0)?v:v.sub(x.mul(l(v.div(x))))}},h({SS:p,DS:f,SD:s,Ss:m,sS:d}));function w(v,x){return x===0?v:v-x*l(v/x)}}),AA="matAlgo01xDSid",SA=["typed"],ii=U(AA,SA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new We(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w=typeof c=="string"&&c!=="mixed"&&c===m?c:void 0,v=w?t.find(i,[w,w]):i,x,g,b=[];for(x=0;x<d;x++)b[x]=[];var y=[],N=[];for(g=0;g<h;g++){for(var E=g+1,A=f[g],D=f[g+1],S=A;S<D;S++)x=s[S],y[x]=a?v(l[S],o[x][g]):v(o[x][g],l[S]),N[x]=E;for(x=0;x<d;x++)N[x]===E?b[x][g]=y[x]:b[x][g]=o[x][g]}return r.createDenseMatrix({data:b,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),CA="matAlgo04xSidSid",MA=["typed","equalScalar"],kl=U(CA,MA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new We(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=o&&f?[]:void 0,S=o&&f?[]:void 0,C=[],_=[],R,P,I,O,F;for(P=0;P<v;P++){A[P]=E.length;var q=P+1;for(O=c[P],F=c[P+1],I=O;I<F;I++)R=u[I],E.push(R),C[R]=q,D&&(D[R]=o[I]);for(O=m[P],F=m[P+1],I=O;I<F;I++)if(R=p[I],C[R]===q){if(D){var k=y(D[R],f[I]);g(k,b)?C[R]=null:D[R]=k}}else E.push(R),_[R]=q,S&&(S[R]=f[I]);if(D&&S)for(I=A[P];I<E.length;)R=E[I],C[R]===q?(N[I]=D[R],I++):_[R]===q?(N[I]=S[R],I++):E.splice(I,1)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),_A="matAlgo10xSids",FA=["typed","DenseMatrix"],Li=U(_A,FA,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],x=[],g=0;g<m;g++){for(var b=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],x[A]=b}for(var D=0;D<p;D++)g===0&&(w[D]=[]),x[D]===b?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=i}return new r({data:w,size:[p,m],datatype:d})}});function Pi(e,t,r,n){if(!(this instanceof Pi))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(n!=null?"-"+n:"")+" expected)",this.stack=new Error().stack}Pi.prototype=new Error;Pi.prototype.constructor=Error;Pi.prototype.name="ArgumentsError";Pi.prototype.isArgumentsError=!0;var Up="gcd",TA=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],hc="number | BigNumber | Fraction | Matrix | Array",OA="".concat(hc,", ").concat(hc,", ...").concat(hc);function $p(e){return!e.some(t=>Array.isArray(t))}var BA=U(Up,TA,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:u,DenseMatrix:c,concat:l}=e,s=Ty({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:c,concat:l}),f=ii({typed:t}),p=kl({typed:t,equalScalar:a}),m=Li({typed:t,DenseMatrix:c}),d=gt({typed:t,matrix:r,concat:l});return t(Up,{"number, number":h,"BigNumber, BigNumber":w,"Fraction, Fraction":(v,x)=>v.gcd(x)},d({SS:p,DS:f,Ss:m}),{[OA]:t.referToSelf(v=>(x,g,b)=>{for(var y=v(x,g),N=0;N<b.length;N++)y=v(y,b[N]);return y}),Array:t.referToSelf(v=>x=>{if(x.length===1&&Array.isArray(x[0])&&$p(x[0]))return v(...x[0]);if($p(x))return v(...x);throw new Pi("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(v=>x=>v(x.toArray()))});function h(v,x){if(!Fe(v)||!Fe(x))throw new Error("Parameters in function gcd must be integer numbers");for(var g;x!==0;)g=s(v,x),v=x,x=g;return v<0?-v:v}function w(v,x){if(!v.isInt()||!x.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var g=new u(0);!x.isZero();){var b=s(v,x);v=x,x=b}return v.lt(g)?v.neg():v}}),kA="matAlgo06xS0S0",IA=["typed","equalScalar"],Mu=U(kA,IA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._size,c=n._datatype||n._data===void 0?n._datatype:n.getDataType(),l=i._values,s=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==s.length)throw new We(u.length,s.length);if(u[0]!==s[0]||u[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");var p=u[0],m=u[1],d,h=r,w=0,v=a;typeof c=="string"&&c===f&&c!=="mixed"&&(d=c,h=t.find(r,[d,d]),w=t.convert(0,d),v=t.find(a,[d,d]));for(var x=o&&l?[]:void 0,g=[],b=[],y=x?[]:void 0,N=[],E=[],A=0;A<m;A++){b[A]=g.length;var D=A+1;if(dp(n,A,N,y,E,D,g,v),dp(i,A,N,y,E,D,g,v),y)for(var S=b[A];S<g.length;){var C=g[S];if(E[C]===D){var _=y[C];h(_,w)?g.splice(S,1):(x.push(_),S++)}else g.splice(S,1)}else for(var R=b[A];R<g.length;){var P=g[R];E[P]!==D?g.splice(R,1):R++}}return b[m]=g.length,n.createSparseMatrix({values:x,index:g,ptr:b,size:[p,m],datatype:c===n._datatype&&f===i._datatype?d:void 0})}}),Hp="lcm",RA=["typed","matrix","equalScalar","concat"],qA=U(Hp,RA,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Mu({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i}),l="number | BigNumber | Fraction | Matrix | Array",s={};return s["".concat(l,", ").concat(l,", ...").concat(l)]=t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w}),t(Hp,{"number, number":$v,"BigNumber, BigNumber":f,"Fraction, Fraction":(p,m)=>p.lcm(m)},c({SS:o,DS:a,Ss:u}),s);function f(p,m){if(!p.isInt()||!m.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(p.isZero())return p;if(m.isZero())return m;for(var d=p.times(m);!m.isZero();){var h=m;m=p.mod(h),p=h}return d.div(p).abs()}}),Jp="log10",zA=["typed","config","Complex"],jA=U(Jp,zA,e=>{var{typed:t,config:r,Complex:n}=e;return t(Jp,{number:function(i){return i>=0||r.predictable?Hv(i):new n(i,0).log().div(Math.LN10)},Complex:function(i){return new n(i).log().div(Math.LN10)},BigNumber:function(i){return!i.isNegative()||r.predictable?i.log():new n(i.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i))})}),Gp="log2",LA=["typed","config","Complex"],PA=U(Gp,LA,e=>{var{typed:t,config:r,Complex:n}=e;return t(Gp,{number:function(a){return a>=0||r.predictable?Jv(a):i(new n(a,0))},Complex:i,BigNumber:function(a){return!a.isNegative()||r.predictable?a.log(2):i(new n(a.toNumber(),0))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function i(a){var o=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(o):Math.log(o)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}}),VA="multiplyScalar",UA=["typed"],$A=U(VA,UA,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":zv,"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":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),Kp="multiply",HA=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],JA=U(Kp,HA,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,u=Jt({typed:t,equalScalar:a}),c=Jr({typed:t});function l(y,N){switch(y.length){case 1:switch(N.length){case 1:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+y[0]+") must match Matrix rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;case 2:switch(N.length){case 1:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+y[1]+") must match Vector length ("+N[0]+")");break;case 2:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+y[1]+") must match Matrix B rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+y.length+" dimensions)")}}function s(y,N,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return o(y,N)}function f(y,N){if(N.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return p(y,N)}function p(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=C[1],I,O=n,F=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&(I=D,O=t.find(n,[I,I]),F=t.find(i,[I,I]));for(var q=[],k=0;k<P;k++){for(var te=F(E[0],S[0][k]),se=1;se<R;se++)te=O(te,F(E[se],S[se][k]));q[k]=te}return y.createDenseMatrix({data:q,size:[P],datatype:D===y._datatype&&_===N._datatype?I:void 0})}var m=t("_multiplyMatrixVector",{"DenseMatrix, any":h,"SparseMatrix, any":x}),d=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":w,"DenseMatrix, SparseMatrix":v,"SparseMatrix, DenseMatrix":g,"SparseMatrix, SparseMatrix":b});function h(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._datatype||N.getDataType(),_=A[0],R=A[1],P,I=n,O=i;D&&C&&D===C&&typeof D=="string"&&D!=="mixed"&&(P=D,I=t.find(n,[P,P]),O=t.find(i,[P,P]));for(var F=[],q=0;q<_;q++){for(var k=E[q],te=O(k[0],S[0]),se=1;se<R;se++)te=I(te,O(k[se],S[se]));F[q]=te}return y.createDenseMatrix({data:F,size:[_],datatype:D===y._datatype&&C===N._datatype?P:void 0})}function w(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=A[1],I=C[1],O,F=n,q=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&D!=="mixed"&&(O=D,F=t.find(n,[O,O]),q=t.find(i,[O,O]));for(var k=[],te=0;te<R;te++){var se=E[te];k[te]=[];for(var W=0;W<I;W++){for(var V=q(se[0],S[0][W]),ue=1;ue<P;ue++)V=F(V,q(se[ue],S[ue][W]));k[te][W]=V}}return y.createDenseMatrix({data:k,size:[R,I],datatype:D===y._datatype&&_===N._datatype?O:void 0})}function v(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._values,C=N._index,_=N._ptr,R=N._size,P=N._datatype||N._data===void 0?N._datatype:N.getDataType();if(!S)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var I=A[0],O=R[1],F,q=n,k=i,te=a,se=0;D&&P&&D===P&&typeof D=="string"&&D!=="mixed"&&(F=D,q=t.find(n,[F,F]),k=t.find(i,[F,F]),te=t.find(a,[F,F]),se=t.convert(0,F));for(var W=[],V=[],ue=[],me=N.createSparseMatrix({values:W,index:V,ptr:ue,size:[I,O],datatype:D===y._datatype&&P===N._datatype?F:void 0}),re=0;re<O;re++){ue[re]=V.length;var ae=_[re],de=_[re+1];if(de>ae)for(var ne=0,ce=0;ce<I;ce++){for(var le=ce+1,he=void 0,xe=ae;xe<de;xe++){var $=C[xe];ne!==le?(he=k(E[ce][$],S[xe]),ne=le):he=q(he,k(E[ce][$],S[xe]))}ne===le&&!te(he,se)&&(V.push(ce),W.push(he))}}return ue[O]=V.length,me}function x(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=[],O=[],F=[],q,k=n,te=i,se=a,W=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]),se=t.find(a,[q,q]),W=t.convert(0,q));var V=[],ue=[];F[0]=0;for(var me=0;me<P;me++){var re=C[me];if(!se(re,W))for(var ae=D[me],de=D[me+1],ne=ae;ne<de;ne++){var ce=A[ne];ue[ce]?V[ce]=k(V[ce],te(re,E[ne])):(ue[ce]=!0,O.push(ce),V[ce]=te(re,E[ne]))}}for(var le=O.length,he=0;he<le;he++){var xe=O[he];I[he]=V[xe]}return F[1]=O.length,y.createSparseMatrix({values:I,index:O,ptr:F,size:[R,1],datatype:S===y._datatype&&_===N._datatype?q:void 0})}function g(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=N._size[1],O,F=n,q=i,k=a,te=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(O=S,F=t.find(n,[O,O]),q=t.find(i,[O,O]),k=t.find(a,[O,O]),te=t.convert(0,O));for(var se=[],W=[],V=[],ue=y.createSparseMatrix({values:se,index:W,ptr:V,size:[R,I],datatype:S===y._datatype&&_===N._datatype?O:void 0}),me=[],re=[],ae=0;ae<I;ae++){V[ae]=W.length;for(var de=ae+1,ne=0;ne<P;ne++){var ce=C[ne][ae];if(!k(ce,te))for(var le=D[ne],he=D[ne+1],xe=le;xe<he;xe++){var $=A[xe];re[$]!==de?(re[$]=de,W.push($),me[$]=q(ce,E[xe])):me[$]=F(me[$],q(ce,E[xe]))}}for(var T=V[ae],z=W.length,J=T;J<z;J++){var L=W[J];se[J]=me[L]}}return V[I]=W.length,ue}function b(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType(),C=N._values,_=N._index,R=N._ptr,P=N._datatype||N._data===void 0?N._datatype:N.getDataType(),I=y._size[0],O=N._size[1],F=E&&C,q,k=n,te=i;S&&P&&S===P&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]));for(var se=F?[]:void 0,W=[],V=[],ue=y.createSparseMatrix({values:se,index:W,ptr:V,size:[I,O],datatype:S===y._datatype&&P===N._datatype?q:void 0}),me=F?[]:void 0,re=[],ae,de,ne,ce,le,he,xe,$,T=0;T<O;T++){V[T]=W.length;var z=T+1;for(le=R[T],he=R[T+1],ce=le;ce<he;ce++)if($=_[ce],F)for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)xe=A[ae],re[xe]!==z?(re[xe]=z,W.push(xe),me[xe]=te(C[ce],E[ae])):me[xe]=k(me[xe],te(C[ce],E[ae]));else for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)xe=A[ae],re[xe]!==z&&(re[xe]=z,W.push(xe));if(F)for(var J=V[T],L=W.length,H=J;H<L;H++){var G=W[H];se[H]=me[G]}}return V[O]=W.length,ue}return t(Kp,i,{"Array, Array":t.referTo("Matrix, Matrix",y=>(N,E)=>{l(Ve(N),Ve(E));var A=y(r(N),r(E));return ke(A)?A.valueOf():A}),"Matrix, Matrix":function(y,N){var E=y.size(),A=N.size();return l(E,A),E.length===1?A.length===1?s(y,N,E[0]):f(y,N):A.length===1?m(y,N):d(y,N)},"Matrix, Array":t.referTo("Matrix,Matrix",y=>(N,E)=>y(N,r(E))),"Array, Matrix":t.referToSelf(y=>(N,E)=>y(r(N,E.storage()),E)),"SparseMatrix, any":function(y,N){return u(y,N,i,!1)},"DenseMatrix, any":function(y,N){return c(y,N,i,!1)},"any, SparseMatrix":function(y,N){return u(N,y,i,!0)},"any, DenseMatrix":function(y,N){return c(N,y,i,!0)},"Array, any":function(y,N){return c(r(y),N,i,!1).valueOf()},"any, Array":function(y,N){return c(r(N),y,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(y=>(N,E,A)=>{for(var D=y(N,E),S=0;S<A.length;S++)D=y(D,A[S]);return D})})}),Wp="nthRoot",GA=["typed","matrix","equalScalar","BigNumber","concat"],KA=U(Wp,GA,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:a}=e,o=ii({typed:t}),u=Gr({typed:t,equalScalar:n}),c=Mu({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=gt({typed:t,matrix:r,concat:a});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(Wp,{number:gp,"number, number":gp,BigNumber:m=>p(m,new i(2)),"BigNumber, BigNumber":p,Complex:f,"Complex, number":f,Array:t.referTo("DenseMatrix,number",m=>d=>m(r(d),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",m=>d=>m(d,2)),SparseMatrix:t.referTo("SparseMatrix,number",m=>d=>m(d,2)),"SparseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return c(d,h,m);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return o(d,h,m,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",m=>(d,h)=>m(r(d),h)),"number | BigNumber, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return l(h,d,m,!0);throw new Error("Root must be non-zero")})},s({scalar:"number | BigNumber",SD:u,Ss:l,sS:!1}));function p(m,d){var h=i.precision,w=i.clone({precision:h+2}),v=new i(0),x=new w(1),g=d.isNegative();if(g&&(d=d.neg()),d.isZero())throw new Error("Root must be non-zero");if(m.isNegative()&&!d.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(m.isZero())return g?new w(1/0):0;if(!m.isFinite())return g?v:m;var b=m.abs().pow(x.div(d));return b=m.isNeg()?b.neg():b,new i((g?x.div(b):b).toPrecision(h))}}),Qp="sign",WA=["typed","BigNumber","Fraction","complex"],QA=U(Qp,WA,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Qp,{number:Hc,Complex:function(a){return a.im===0?n(Hc(a.re)):a.sign()},BigNumber:function(a){return new r(a.cmp(0))},Fraction:function(a){return new i(a.s,1)},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),ZA="sqrt",XA=["config","typed","Complex"],YA=U(ZA,XA,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(a){return a.sqrt()},BigNumber:function(a){return!a.isNegative()||t.predictable?a.sqrt():i(a.toNumber())},Unit:function(a){return a.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new n(a,0).sqrt()}}),Zp="square",eS=["typed"],tS=U(Zp,eS,e=>{var{typed:t}=e;return t(Zp,{number:Gv,Complex:function(r){return r.mul(r)},BigNumber:function(r){return r.times(r)},Fraction:function(r){return r.mul(r)},Unit:function(r){return r.pow(2)}})}),Xp="subtract",rS=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],nS=U(Xp,rS,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,c=ii({typed:t}),l=cr({typed:t}),s=Cu({typed:t,equalScalar:n}),f=Li({typed:t,DenseMatrix:o}),p=It({typed:t,DenseMatrix:o}),m=gt({typed:t,matrix:r,concat:u});return t(Xp,{"any, any":i},m({elop:i,SS:s,DS:c,SD:l,Ss:p,sS:f}))}),Yp="xgcd",iS=["typed","config","matrix","BigNumber"],aS=U(Yp,iS,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Yp,{"number, number":function(o,u){var c=Kv(o,u);return r.matrix==="Array"?c:n(c)},"BigNumber, BigNumber":a});function a(o,u){var c,l,s,f=new i(0),p=new i(1),m=f,d=p,h=p,w=f;if(!o.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)l=o.div(u).floor(),s=o.mod(u),c=m,m=d.minus(l.times(m)),d=c,c=h,h=w.minus(l.times(h)),w=c,o=u,u=s;var v;return o.lt(f)?v=[o.neg(),d.neg(),w.neg()]:v=[o,o.isZero()?0:d,w],r.matrix==="Array"?v:n(v)}}),em="invmod",oS=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],sS=U(em,oS,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:a,smaller:o,mod:u,add:c,isInteger:l}=e;return t(em,{"number, number":s,"BigNumber, BigNumber":s});function s(f,p){if(!l(f)||!l(p))throw new Error("Parameters in function invmod must be integer numbers");if(f=u(f,p),a(p,0))throw new Error("Divisor must be non zero");var m=i(f,p);m=m.valueOf();var[d,h]=m;return a(d,n(1))?(h=u(h,p),o(h,n(0))&&(h=c(h,p)),h):NaN}}),uS="matAlgo09xS0Sf",cS=["typed","equalScalar"],Oy=U(uS,cS,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new We(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=[],C,_,R,P,I;for(_=0;_<v;_++){A[_]=E.length;var O=_+1;if(D)for(P=m[_],I=m[_+1],R=P;R<I;R++)C=p[R],S[C]=O,D[C]=f[R];for(P=c[_],I=c[_+1],R=P;R<I;R++)if(C=u[R],D){var F=S[C]===O?D[C]:b,q=y(o[R],F);g(q,b)||(E.push(C),N.push(q))}else E.push(C)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),tm="dotMultiply",lS=["typed","matrix","equalScalar","multiplyScalar","concat"],fS=U(tm,lS,e=>{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e,o=Gr({typed:t,equalScalar:n}),u=Oy({typed:t,equalScalar:n}),c=Jt({typed:t,equalScalar:n}),l=gt({typed:t,matrix:r,concat:a});return t(tm,l({elop:i,SS:u,DS:o,Ss:c}))});function pS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return Il(e,t,function(n,i){return n&i})}function po(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function mS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:Il(e,t,function(i,a){return i|a})}function Il(e,t,r){var n=e.constructor,i,a,o=+(e.s<0),u=+(t.s<0);if(o){i=Ko(po(e));for(var c=0;c<i.length;++c)i[c]^=1}else i=Ko(e);if(u){a=Ko(po(t));for(var l=0;l<a.length;++l)a[l]^=1}else a=Ko(t);var s,f,p;i.length<=a.length?(s=i,f=a,p=o):(s=a,f=i,p=u);var m=s.length,d=f.length,h=r(o,u)^1,w=new n(h^1),v=new n(1),x=new n(2),g=n.precision;for(n.config({precision:1e9});m>0;)r(s[--m],f[--d])===h&&(w=w.plus(v)),v=v.times(x);for(;d>0;)r(p,f[--d])===h&&(w=w.plus(v)),v=v.times(x);return n.config({precision:g}),h===0&&(w.s=-w.s),w}function Ko(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;r.charAt(o)==="0";)o--;var u=e.e,c=r.slice(0,o+1||1),l=c.length;if(u>0)if(++u>l)for(u-=l;u--;)c+="0";else u<l&&(c=c.slice(0,u)+"."+c.slice(u));for(var s=[0],f=0;f<c.length;){for(var p=s.length;p--;)s[p]*=10;s[0]+=parseInt(c.charAt(f++));for(var m=0;m<s.length;++m)s[m]>1&&((s[m+1]===null||s[m+1]===void 0)&&(s[m+1]=0),s[m+1]+=s[m]>>1,s[m]&=1)}return s.reverse()}function dS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?po(t):t.eq(n)?po(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):Il(e,t,function(i,a){return i^a})}function hS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function gS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var rm="bitAnd",vS=["typed","matrix","equalScalar","concat"],By=U(rm,vS,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Mu({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i});return t(rm,{"number, number":Qv,"BigNumber, BigNumber":pS},c({SS:o,DS:a,Ss:u}))}),nm="bitNot",yS=["typed"],bS=U(nm,yS,e=>{var{typed:t}=e;return t(nm,{number:Zv,BigNumber:po,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),im="bitOr",xS=["typed","matrix","equalScalar","DenseMatrix","concat"],ky=U(im,xS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ii({typed:t}),u=kl({typed:t,equalScalar:n}),c=Li({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(im,{"number, number":Xv,"BigNumber, BigNumber":mS},l({SS:u,DS:o,Ss:c}))}),wS="matAlgo07xSSf",NS=["typed","DenseMatrix"],cn=U(wS,NS,e=>{var{typed:t,DenseMatrix:r}=e;return function(i,a,o){var u=i._size,c=i._datatype||i._data===void 0?i._datatype:i.getDataType(),l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==l.length)throw new We(u.length,l.length);if(u[0]!==l[0]||u[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+l+")");var f=u[0],p=u[1],m,d=0,h=o;typeof c=="string"&&c===s&&c!=="mixed"&&(m=c,d=t.convert(0,m),h=t.find(o,[m,m]));var w,v,x=[];for(w=0;w<f;w++)x[w]=[];var g=[],b=[],y=[],N=[];for(v=0;v<p;v++){var E=v+1;for(n(i,v,y,g,E),n(a,v,N,b,E),w=0;w<f;w++){var A=y[w]===E?g[w]:d,D=N[w]===E?b[w]:d;x[w][v]=h(A,D)}}return new r({data:x,size:[f,p],datatype:c===i._datatype&&s===a._datatype?m:void 0})};function n(i,a,o,u,c){for(var l=i._values,s=i._index,f=i._ptr,p=f[a],m=f[a+1];p<m;p++){var d=s[p];o[d]=c,u[d]=l[p]}}}),am="bitXor",DS=["typed","matrix","DenseMatrix","concat"],ES=U(am,DS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(am,{"number, number":Yv,"BigNumber, BigNumber":dS},c({SS:o,DS:a,Ss:u}))}),om="arg",AS=["typed"],SS=U(om,AS,e=>{var{typed:t}=e;return t(om,{number:function(r){return Math.atan2(0,r)},BigNumber:function(r){return r.constructor.atan2(0,r)},Complex:function(r){return r.arg()},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),sm="conj",CS=["typed"],MS=U(sm,CS,e=>{var{typed:t}=e;return t(sm,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),um="im",_S=["typed"],FS=U(um,_S,e=>{var{typed:t}=e;return t(um,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),cm="re",TS=["typed"],OS=U(cm,TS,e=>{var{typed:t}=e;return t(cm,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),lm="not",BS=["typed"],kS=U(lm,BS,e=>{var{typed:t}=e;return t(lm,{"null | undefined":()=>!0,number:iy,Complex:function(r){return r.re===0&&r.im===0},BigNumber:function(r){return r.isZero()||r.isNaN()},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),fm="or",IS=["typed","matrix","equalScalar","DenseMatrix","concat"],Iy=U(fm,IS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=Cu({typed:t,equalScalar:n}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(fm,{"number, number":ay,"Complex, Complex":function(s,f){return s.re!==0||s.im!==0||f.re!==0||f.im!==0},"BigNumber, BigNumber":function(s,f){return!s.isZero()&&!s.isNaN()||!f.isZero()&&!f.isNaN()},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},l({SS:u,DS:o,Ss:c}))}),pm="xor",RS=["typed","matrix","DenseMatrix","concat"],qS=U(pm,RS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(pm,{"number, number":oy,"Complex, Complex":function(l,s){return(l.re!==0||l.im!==0)!=(s.re!==0||s.im!==0)},"BigNumber, BigNumber":function(l,s){return(!l.isZero()&&!l.isNaN())!=(!s.isZero()&&!s.isNaN())},"Unit, Unit":t.referToSelf(l=>(s,f)=>l(s.value||0,f.value||0))},c({SS:o,DS:a,Ss:u}))}),mm="concat",zS=["typed","matrix","isInteger"],Ry=U(mm,zS,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(mm,{"...Array | Matrix | number | BigNumber":function(i){var a,o=i.length,u=-1,c,l=!1,s=[];for(a=0;a<o;a++){var f=i[a];if(ke(f)&&(l=!0),Ue(f)||$e(f)){if(a!==o-1)throw new Error("Dimension must be specified as last argument");if(c=u,u=f.valueOf(),!n(u))throw new TypeError("Integer number expected for dimension");if(u<0||a>0&&u>c)throw new $r(u,c+1)}else{var p=ze(f).valueOf(),m=Ve(p);if(s[a]=p,c=u,u=m.length-1,a>0&&u!==c)throw new We(c+1,u+1)}}if(s.length===0)throw new SyntaxError("At least one matrix expected");for(var d=s.shift();s.length;)d=Ov(d,s.shift(),u);return l?r(d):d},"...string":function(i){return i.join("")}})}),dm="column",jS=["typed","Index","matrix","range"],qy=U(dm,jS,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(dm,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[1]);var c=i(0,o.size()[0]),l=new r(c,u),s=o.subset(l);return ke(s)?s:n([[s]])}}),hm="count",LS=["typed","size","prod"],PS=U(hm,LS,e=>{var{typed:t,size:r,prod:n}=e;return t(hm,{string:function(i){return i.length},"Matrix | Array":function(i){return n(r(i))}})}),gm="cross",VS=["typed","matrix","subtract","multiply"],US=U(gm,VS,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(gm,{"Matrix, Matrix":function(o,u){return r(a(o.toArray(),u.toArray()))},"Matrix, Array":function(o,u){return r(a(o.toArray(),u))},"Array, Matrix":function(o,u){return r(a(o,u.toArray()))},"Array, Array":a});function a(o,u){var c=Math.max(Ve(o).length,Ve(u).length);o=js(o),u=js(u);var l=Ve(o),s=Ve(u);if(l.length!==1||s.length!==1||l[0]!==3||s[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+l.join(", ")+"], B = ["+s.join(", ")+"])");var f=[n(i(o[1],u[2]),i(o[2],u[1])),n(i(o[2],u[0]),i(o[0],u[2])),n(i(o[0],u[1]),i(o[1],u[0]))];return c>1?[f]:f}}),vm="diag",$S=["typed","matrix","DenseMatrix","SparseMatrix"],HS=U(vm,$S,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(vm,{Array:function(c){return a(c,0,Ve(c),null)},"Array, number":function(c,l){return a(c,l,Ve(c),null)},"Array, BigNumber":function(c,l){return a(c,l.toNumber(),Ve(c),null)},"Array, string":function(c,l){return a(c,0,Ve(c),l)},"Array, number, string":function(c,l,s){return a(c,l,Ve(c),s)},"Array, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),Ve(c),s)},Matrix:function(c){return a(c,0,c.size(),c.storage())},"Matrix, number":function(c,l){return a(c,l,c.size(),c.storage())},"Matrix, BigNumber":function(c,l){return a(c,l.toNumber(),c.size(),c.storage())},"Matrix, string":function(c,l){return a(c,0,c.size(),l)},"Matrix, number, string":function(c,l,s){return a(c,l,c.size(),s)},"Matrix, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),c.size(),s)}});function a(c,l,s,f){if(!Fe(l))throw new TypeError("Second parameter in function diag must be an integer");var p=l>0?l:0,m=l<0?-l:0;switch(s.length){case 1:return o(c,l,f,s[0],m,p);case 2:return u(c,l,f,s,m,p)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(c,l,s,f,p,m){var d=[f+p,f+m];if(s&&s!=="sparse"&&s!=="dense")throw new TypeError("Unknown matrix type ".concat(s,'"'));var h=s==="sparse"?i.diagonal(d,c,l):n.diagonal(d,c,l);return s!==null?h:h.valueOf()}function u(c,l,s,f,p,m){if(ke(c)){var d=c.diagonal(l);return s!==null?s!==d.storage()?r(d,s):d:d.valueOf()}for(var h=Math.min(f[0]-p,f[1]-m),w=[],v=0;v<h;v++)w[v]=c[v+p][v+m];return s!==null?r(w):w}});function Ta(e,t,r,n,i){if(ia.isTypedFunction(e)){var a=[t,r,n],o=ia.resolve(e,a);if(o)return f(o.implementation,a);var u=[t,r],c=ia.resolve(e,u);if(c)return f(c.implementation,u);var l=[t],s=ia.resolve(e,l);return s?f(s.implementation,l):f(e,a)}else return e(t,r,n);function f(p,m){try{return p.apply(p,m)}catch(w){var d;if(w instanceof TypeError&&((d=w.data)===null||d===void 0?void 0:d.category)==="wrongType"){var h=[];throw h.push("value: ".concat(dt(t))),m.length>=2&&h.push("index: ".concat(dt(r))),m.length>=3&&h.push("array: ".concat(dt(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(h.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(w.message))}}}var JS="filter",GS=["typed"],KS=U(JS,GS,e=>{var{typed:t}=e;return t("filter",{"Array, function":ym,"Matrix, function":function(r,n){return r.create(ym(r.toArray(),n))},"Array, RegExp":Ls,"Matrix, RegExp":function(r,n){return r.create(Ls(r.toArray(),n))}})});function ym(e,t){return Fv(e,function(r,n,i){return Ta(t,r,[n],i,"filter")})}var bm="flatten",WS=["typed","matrix"],QS=U(bm,WS,e=>{var{typed:t,matrix:r}=e;return t(bm,{Array:function(n){return ot(n)},Matrix:function(n){var i=ot(n.toArray());return r(i)}})}),xm="forEach",ZS=["typed"],XS=U(xm,ZS,e=>{var{typed:t}=e;return t(xm,{"Array, function":YS,"Matrix, function":function(r,n){r.forEach(n)}})});function YS(e,t){var r=function n(i,a){if(Array.isArray(i))Eu(i,function(o,u){n(o,a.concat(u))});else return Ta(t,i,a,e,"forEach")};r(e,[])}var wm="getMatrixDataType",eC=["typed"],tC=U(wm,eC,e=>{var{typed:t}=e;return t(wm,{Array:function(r){return fo(r,dt)},Matrix:function(r){return r.getDataType()}})}),Nm="identity",rC=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],nC=U(Nm,rC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(Nm,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(l){return n(l)},"number | BigNumber":function(l){return c(l,l,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(l,s){return c(l,l,s)},"number | BigNumber, number | BigNumber":function(l,s){return c(l,s,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(l,s,f){return c(l,s,f)},Array:function(l){return u(l)},"Array, string":function(l,s){return u(l,s)},Matrix:function(l){return u(l.valueOf(),l.storage())},"Matrix, string":function(l,s){return u(l.valueOf(),s)}});function u(l,s){switch(l.length){case 0:return s?n(s):[];case 1:return c(l[0],l[0],s);case 2:return c(l[0],l[1],s);default:throw new Error("Vector containing two values expected")}}function c(l,s,f){var p=$e(l)||$e(s)?i:null;if($e(l)&&(l=l.toNumber()),$e(s)&&(s=s.toNumber()),!Fe(l)||l<1)throw new Error("Parameters in function identity must be positive integers");if(!Fe(s)||s<1)throw new Error("Parameters in function identity must be positive integers");var m=p?new i(1):1,d=p?new p(0):0,h=[l,s];if(f){if(f==="sparse")return o.diagonal(h,m,0,d);if(f==="dense")return a.diagonal(h,m,0,d);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var w=ya([],h,d),v=l<s?l:s,x=0;x<v;x++)w[x][x]=m;return w}}),Dm="kron",iC=["typed","matrix","multiplyScalar"],aC=U(Dm,iC,e=>{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(Dm,{"Matrix, Matrix":function(a,o){return r(i(a.toArray(),o.toArray()))},"Matrix, Array":function(a,o){return r(i(a.toArray(),o))},"Array, Matrix":function(a,o){return r(i(a,o.toArray()))},"Array, Array":i});function i(a,o){if(Ve(a).length===1&&(a=[a]),Ve(o).length===1&&(o=[o]),Ve(a).length>2||Ve(o).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(o.length)+")");var u=[],c=[];return a.map(function(l){return o.map(function(s){return c=[],u.push(c),l.map(function(f){return s.map(function(p){return c.push(n(f,p))})})})})&&u}}),Em="map",oC=["typed"],sC=U(Em,oC,e=>{var{typed:t}=e;return t(Em,{"Array, function":uC,"Matrix, function":function(r,n){return r.map(n)}})});function uC(e,t){var r=function n(i,a){return Array.isArray(i)?i.map(function(o,u){return n(o,a.concat(u))}):Ta(t,i,a,e,"map")};return r(e,[])}var Am="diff",cC=["typed","matrix","subtract","number"],zy=U(Am,cC,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(Am,{"Array | Matrix":function(l){return ke(l)?r(o(l.toArray())):o(l)},"Array | Matrix, number":function(l,s){if(!Fe(s))throw new RangeError("Dimension must be a whole number");return ke(l)?r(a(l.toArray(),s)):a(l,s)},"Array, BigNumber":t.referTo("Array,number",l=>(s,f)=>l(s,i(f))),"Matrix, BigNumber":t.referTo("Matrix,number",l=>(s,f)=>l(s,i(f)))});function a(l,s){if(ke(l)&&(l=l.toArray()),!Array.isArray(l))throw RangeError("Array/Matrix does not have that many dimensions");if(s>0){var f=[];return l.forEach(p=>{f.push(a(p,s-1))}),f}else{if(s===0)return o(l);throw RangeError("Cannot have negative dimension")}}function o(l){for(var s=[],f=l.length,p=1;p<f;p++)s.push(u(l[p-1],l[p]));return s}function u(l,s){ke(l)&&(l=l.toArray()),ke(s)&&(s=s.toArray());var f=Array.isArray(l),p=Array.isArray(s);if(f&&p)return c(l,s);if(!f&&!p)return n(s,l);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function c(l,s){if(l.length!==s.length)throw RangeError("Not all sub-arrays have the same length");for(var f=[],p=l.length,m=0;m<p;m++)f.push(u(l[m],s[m]));return f}}),lC="ones",fC=["typed","config","matrix","BigNumber"],pC=U(lC,fC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(1):1;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?ya(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function ones must be positive integers")})}});function Rl(){throw new Error('No "bignumber" implementation available')}function jy(){throw new Error('No "fraction" implementation available')}function Ly(){throw new Error('No "matrix" implementation available')}var Sm="range",mC=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Py=U(Sm,mC,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e;return t(Sm,{string:p,"string, boolean":p,"number, number":function(h,w){return f(m(h,w,1,!1))},"number, number, number":function(h,w,v){return f(m(h,w,v,!1))},"number, number, boolean":function(h,w,v){return f(m(h,w,1,v))},"number, number, number, boolean":function(h,w,v,x){return f(m(h,w,v,x))},"BigNumber, BigNumber":function(h,w){var v=h.constructor;return f(m(h,w,new v(1),!1))},"BigNumber, BigNumber, BigNumber":function(h,w,v){return f(m(h,w,v,!1))},"BigNumber, BigNumber, boolean":function(h,w,v){var x=h.constructor;return f(m(h,w,new x(1),v))},"BigNumber, BigNumber, BigNumber, boolean":function(h,w,v,x){return f(m(h,w,v,x))},"Unit, Unit, Unit":function(h,w,v){return f(m(h,w,v,!1))},"Unit, Unit, Unit, boolean":function(h,w,v,x){return f(m(h,w,v,x))}});function f(h){return r.matrix==="Matrix"?n?n(h):Ly():h}function p(h,w){var v=d(h);if(!v)throw new SyntaxError('String "'+h+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Rl(),f(m(i(v.start),i(v.end),i(v.step)))):f(m(v.start,v.end,v.step,w))}function m(h,w,v,x){for(var g=[],b=s(v)?x?o:a:x?c:u,y=h;b(y,w);)g.push(y),y=l(y,v);return g}function d(h){var w=h.split(":"),v=w.map(function(g){return Number(g)}),x=v.some(function(g){return isNaN(g)});if(x)return null;switch(v.length){case 2:return{start:v[0],end:v[1],step:1};case 3:return{start:v[0],end:v[2],step:v[1]};default:return null}}}),Cm="reshape",dC=["typed","isInteger","matrix"],hC=U(Cm,dC,e=>{var{typed:t,isInteger:r}=e;return t(Cm,{"Matrix, Array":function(n,i){return n.reshape(i,!0)},"Array, Array":function(n,i){return i.forEach(function(a){if(!r(a))throw new TypeError("Invalid size for dimension: "+a)}),Fl(n,i)}})}),gC="resize",vC=["config","matrix"],yC=U(gC,vC,e=>{var{config:t,matrix:r}=e;return function(i,a,o){if(arguments.length!==2&&arguments.length!==3)throw new Pi("resize",arguments.length,2,3);if(ke(a)&&(a=a.valueOf()),$e(a[0])&&(a=a.map(function(l){return $e(l)?l.toNumber():l})),ke(i))return i.resize(a,o,!0);if(typeof i=="string")return n(i,a,o);var u=Array.isArray(i)?!1:t.matrix!=="Array";if(a.length===0){for(;Array.isArray(i);)i=i[0];return ze(i)}else{Array.isArray(i)||(i=[i]),i=ze(i);var c=ya(i,a,o);return u?r(c):c}};function n(i,a,o){if(o!==void 0){if(typeof o!="string"||o.length!==1)throw new TypeError("Single character expected as defaultValue")}else o=" ";if(a.length!==1)throw new We(a.length,1);var u=a[0];if(typeof u!="number"||!Fe(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(a)+")");if(i.length>u)return i.substring(0,u);if(i.length<u){for(var c=i,l=0,s=u-i.length;l<s;l++)c+=o;return c}else return i}}),Mm="rotate",bC=["typed","multiply","rotationMatrix"],xC=U(Mm,bC,e=>{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(Mm,{"Array , number | BigNumber | Complex | Unit":function(a,o){i(a,2);var u=r(n(o),a);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(a,o){return i(a,2),r(n(o),a)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){i(a,3);var c=r(n(o,u),a);return c},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){return i(a,3),r(n(o,u),a)}});function i(a,o){var u=Array.isArray(a)?Ve(a):a.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u[0]!==o)throw new RangeError("Vector must be of dimensions 1x".concat(o))}}),_m="rotationMatrix",wC=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],NC=U(_m,wC,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:o,BigNumber:u,matrix:c,DenseMatrix:l,SparseMatrix:s,cos:f,sin:p}=e;return t(_m,{"":function(){return r.matrix==="Matrix"?c([]):[]},string:function(x){return c(x)},"number | BigNumber | Complex | Unit":function(x){return m(x,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(x,g){return m(x,g)},"number | BigNumber | Complex | Unit, Array":function(x,g){var b=c(g);return d(b),v(x,b,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(x,g){d(g);var b=g.storage()||(r.matrix==="Matrix"?"dense":void 0);return v(x,g,b)},"number | BigNumber | Complex | Unit, Array, string":function(x,g,b){var y=c(g);return d(y),v(x,y,b)},"number | BigNumber | Complex | Unit, Matrix, string":function(x,g,b){return d(g),v(x,g,b)}});function m(x,g){var b=$e(x),y=b?new u(-1):-1,N=f(x),E=p(x),A=[[N,n(y,E)],[E,N]];return w(A,g)}function d(x){var g=x.size();if(g.length<1||g[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(x){return x.reduce((g,b)=>n(g,b))}function w(x,g){if(g){if(g==="sparse")return new s(x);if(g==="dense")return new l(x);throw new TypeError('Unknown matrix type "'.concat(g,'"'))}return x}function v(x,g,b){var y=o(g);if(y===0)throw new RangeError("Rotation around zero vector");var N=$e(x)?u:null,E=N?new N(1):1,A=N?new N(-1):-1,D=N?new N(g.get([0])/y):g.get([0])/y,S=N?new N(g.get([1])/y):g.get([1])/y,C=N?new N(g.get([2])/y):g.get([2])/y,_=f(x),R=i(E,a(_)),P=p(x),I=i(_,h([D,D,R])),O=i(h([D,S,R]),h([A,C,P])),F=i(h([D,C,R]),h([S,P])),q=i(h([D,S,R]),h([C,P])),k=i(_,h([S,S,R])),te=i(h([S,C,R]),h([A,D,P])),se=i(h([D,C,R]),h([A,S,P])),W=i(h([S,C,R]),h([D,P])),V=i(_,h([C,C,R])),ue=[[I,O,F],[q,k,te],[se,W,V]];return w(ue,b)}}),Fm="row",DC=["typed","Index","matrix","range"],Vy=U(Fm,DC,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(Fm,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[0]);var c=i(0,o.size()[1]),l=new r(u,c),s=o.subset(l);return ke(s)?s:n([[s]])}}),Tm="size",EC=["typed","config","?matrix"],AC=U(Tm,EC,e=>{var{typed:t,config:r,matrix:n}=e;return t(Tm,{Matrix:function(i){return i.create(i.size())},Array:Ve,string:function(i){return r.matrix==="Array"?[i.length]:n([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return r.matrix==="Array"?[]:n?n([]):Ly()}})}),Om="squeeze",SC=["typed","matrix"],CC=U(Om,SC,e=>{var{typed:t,matrix:r}=e;return t(Om,{Array:function(n){return js(ze(n))},Matrix:function(n){var i=js(n.toArray());return Array.isArray(i)?r(i):i},any:function(n){return ze(n)}})}),Bm="subset",MC=["typed","matrix","zeros","add"],Uy=U(Bm,MC,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(Bm,{"Matrix, Index":function(o,u){return va(u)?r():(zs(o,u),o.subset(u))},"Array, Index":t.referTo("Matrix, Index",function(o){return function(u,c){var l=o(r(u),c);return c.isScalar()?l:l.valueOf()}}),"Object, Index":FC,"string, Index":_C,"Matrix, Index, any, any":function(o,u,c,l){return va(u)?o:(zs(o,u),o.clone().subset(u,a(c,u),l))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l,s){var f=o(r(u),c,l,s);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(r(u),c,l,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(u,c,l,void 0)}}),"string, Index, string":km,"string, Index, string, string":km,"Object, Index, any":TC});function a(o,u){if(typeof o=="string")throw new Error("can't boradcast a string");if(u._isScalar)return o;var c=u.size();if(c.every(l=>l>0))try{return i(o,n(c))}catch{return o}else return o}});function _C(e,t){if(!gu(t))throw new TypeError("Index expected");if(va(t))return"";if(zs(Array.from(e),t),t.size().length!==1)throw new We(t.size().length,1);var r=e.length;pt(t.min()[0],r),pt(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function km(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(va(t))return e;if(zs(Array.from(e),t),t.size().length!==1)throw new We(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),a=i.size()[0];if(a!==r.length)throw new We(i.size()[0],r.length);var o=e.length;pt(t.min()[0]),pt(t.max()[0]);for(var u=[],c=0;c<o;c++)u[c]=e.charAt(c);if(i.forEach(function(f,p){u[f]=r.charAt(p[0])}),u.length>o)for(var l=o-1,s=u.length;l<s;l++)u[l]||(u[l]=n);return u.join("")}function FC(e,t){if(!va(t)){if(t.size().length!==1)throw new We(t.size(),1);var r=t.dimension(0);if(typeof r!="string")throw new TypeError("String expected as index to retrieve an object property");return nr(e,r)}}function TC(e,t,r){if(va(t))return e;if(t.size().length!==1)throw new We(t.size(),1);var n=t.dimension(0);if(typeof n!="string")throw new TypeError("String expected as index to retrieve an object property");var i=ze(e);return ha(i,n,r),i}var Im="transpose",OC=["typed","matrix"],BC=U(Im,OC,e=>{var{typed:t,matrix:r}=e;return t(Im,{Array:o=>n(r(o)).valueOf(),Matrix:n,any:ze});function n(o){var u=o.size(),c;switch(u.length){case 1:c=o.clone();break;case 2:{var l=u[0],s=u[1];if(s===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ge(u)+")");switch(o.storage()){case"dense":c=i(o,l,s);break;case"sparse":c=a(o,l,s);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ge(u)+")")}return c}function i(o,u,c){for(var l=o._data,s=[],f,p=0;p<c;p++){f=s[p]=[];for(var m=0;m<u;m++)f[m]=ze(l[m][p])}return o.createDenseMatrix({data:s,size:[c,u],datatype:o._datatype})}function a(o,u,c){for(var l=o._values,s=o._index,f=o._ptr,p=l?[]:void 0,m=[],d=[],h=[],w=0;w<u;w++)h[w]=0;var v,x,g;for(v=0,x=s.length;v<x;v++)h[s[v]]++;for(var b=0,y=0;y<u;y++)d.push(b),b+=h[y],h[y]=d[y];for(d.push(b),g=0;g<c;g++)for(var N=f[g],E=f[g+1],A=N;A<E;A++){var D=h[s[A]]++;m[D]=g,l&&(p[D]=ze(l[A]))}return o.createSparseMatrix({values:p,index:m,ptr:d,size:[c,u],datatype:o._datatype})}}),Rm="ctranspose",kC=["typed","transpose","conj"],IC=U(Rm,kC,e=>{var{typed:t,transpose:r,conj:n}=e;return t(Rm,{any:function(i){return n(r(i))}})}),qm="zeros",RC=["typed","config","matrix","BigNumber"],qC=U(qm,RC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(qm,{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(0):0;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?ya(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function zeros must be positive integers")})}}),zm="fft",zC=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],jC=U(zm,zC,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:o,tau:u,i:c,dotDivide:l,conj:s,pow:f,ceil:p,log2:m}=e;return t(zm,{Array:d,Matrix:function(x){return x.create(d(x.toArray()))}});function d(x){var g=Ve(x);return g.length===1?v(x,g[0]):h(x.map(b=>d(b,g.slice(1))),0)}function h(x,g){var b=Ve(x);if(g!==0)return new Array(b[0]).fill(0).map((N,E)=>h(x[E],g-1));if(b.length===1)return v(x);function y(N){var E=Ve(N);return new Array(E[1]).fill(0).map((A,D)=>new Array(E[0]).fill(0).map((S,C)=>N[C][D]))}return y(h(y(x),1))}function w(x){for(var g=x.length,b=o(a(i(-1,i(c,u)),g)),y=[],N=1-g;N<g;N++)y.push(f(b,a(f(N,2),2)));for(var E=f(2,p(m(g+g-1))),A=[...new Array(g).fill(0).map((O,F)=>i(x[F],y[g-1+F])),...new Array(E-g).fill(0)],D=[...new Array(g+g-1).fill(0).map((O,F)=>a(1,y[F])),...new Array(E-(g+g-1)).fill(0)],S=v(A),C=v(D),_=new Array(E).fill(0).map((O,F)=>i(S[F],C[F])),R=l(s(d(s(_))),E),P=[],I=g-1;I<g+g-1;I++)P.push(i(R[I],y[I]));return P}function v(x){var g=x.length;if(g===1)return[x[0]];if(g%2===0){for(var b=[...v(x.filter((A,D)=>D%2===0)),...v(x.filter((A,D)=>D%2===1))],y=0;y<g/2;y++){var N=b[y],E=i(b[y+g/2],o(i(i(u,c),a(-y,g))));b[y]=n(N,E),b[y+g/2]=n(N,i(-1,E))}return b}else return w(x)}}),jm="ifft",LC=["typed","fft","dotDivide","conj"],PC=U(jm,LC,e=>{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(jm,{"Array | Matrix":function(a){var o=ke(a)?a.size():Ve(a);return n(i(r(i(a))),o.reduce((u,c)=>u*c,1))}})});function mo(e){"@babel/helpers - typeof";return mo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mo(e)}function VC(e,t){if(mo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UC(e){var t=VC(e,"string");return mo(t)=="symbol"?t:t+""}function kt(e,t,r){return(t=UC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $C(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lm(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var HC="solveODE",JC=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],GC=U(HC,JC,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,max:o,map:u,abs:c,isPositive:l,isNegative:s,larger:f,smaller:p,matrix:m,bignumber:d,unaryMinus:h}=e;function w(A){return function(D,S,C,_){var R=!(S.length===2&&(S.every(N)||S.every(Cr)));if(R)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var P=S[0],I=S[1],O=f(I,P),F=_.firstStep;if(F!==void 0&&!l(F))throw new Error('"firstStep" must be positive');var q=_.maxStep;if(q!==void 0&&!l(q))throw new Error('"maxStep" must be positive');var k=_.minStep;if(k&&s(k))throw new Error('"minStep" must be positive or zero');var te=[P,I,F,k,q].filter(B=>B!==void 0);if(!(te.every(N)||te.every(Cr)))throw new Error('Inconsistent type of "t" dependant variables');for(var se=1,W=_.tol?_.tol:1e-4,V=_.minDelta?_.minDelta:.2,ue=_.maxDelta?_.maxDelta:5,me=_.maxIter?_.maxIter:1e4,re=[P,I,...C,q,k].some($e),[ae,de,ne,ce]=re?[d(A.a),d(A.c),d(A.b),d(A.bp)]:[A.a,A.c,A.b,A.bp],le=F?O?F:h(F):a(n(I,P),se),he=[P],xe=[C],$=n(ne,ce),T=0,z=0,J=b(O),L=y(O);J(he[T],I);){var H=[];le=L(he[T],I,le),H.push(D(he[T],xe[T]));for(var G=1;G<de.length;++G)H.push(D(r(he[T],i(de[G],le)),r(xe[T],i(le,ae[G],H))));var Y=o(c(u(i($,H),B=>Cr(B)?B.value:B)));Y<W&&W/Y>1/4&&(he.push(r(he[T],le)),xe.push(r(xe[T],i(le,ne,H))),T++);var ee=.84*(W/Y)**(1/5);if(p(ee,V)?ee=V:f(ee,ue)&&(ee=ue),ee=re?d(ee):ee,le=i(le,ee),q&&f(c(le),q)?le=O?q:h(q):k&&p(c(le),k)&&(le=O?k:h(k)),z++,z>me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:he,y:xe}}}function v(A,D,S,C){var _=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],R=[null,1/2,3/4,1],P=[2/9,1/3,4/9,0],I=[7/24,1/4,1/3,1/8],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function x(A,D,S,C){var _=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],R=[null,1/5,3/10,4/5,8/9,1,1],P=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],I=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function g(A,D,S,C){var _=C.method?C.method:"RK45",R={RK23:v,RK45:x};if(_.toUpperCase()in R){var P=$C({},C);return delete P.method,R[_.toUpperCase()](A,D,S,P)}else{var I=Object.keys(R).map(F=>'"'.concat(F,'"')),O="".concat(I.slice(0,-1).join(", ")," and ").concat(I.slice(-1));throw new Error('Unavailable method "'.concat(_,'". Available methods are ').concat(O))}}function b(A){return A?p:f}function y(A){var D=A?f:p;return function(S,C,_){var R=r(S,_);return D(R,C)?n(C,S):_}}function N(A){return $e(A)||Ue(A)}function E(A,D,S,C){var _=g(A,D.toArray(),S.toArray(),C);return{t:m(_.t),y:m(_.y)}}return t("solveODE",{"function, Array, Array, Object":g,"function, Matrix, Matrix, Object":E,"function, Array, Array":(A,D,S)=>g(A,D,S,{}),"function, Matrix, Matrix":(A,D,S)=>E(A,D,S,{}),"function, Array, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D,[S],{});return{t:C.t,y:C.y.map(_=>_[0])}},"function, Matrix, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D.toArray(),[S],{});return{t:m(C.t),y:m(C.y.map(_=>_[0]))}},"function, Array, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D,[S],C);return{t:_.t,y:_.y.map(R=>R[0])}},"function, Matrix, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D.toArray(),[S],C);return{t:m(_.t),y:m(_.y.map(R=>R[0]))}}})}),KC="erf",WC=["typed"],QC=U(KC,WC,e=>{var{typed:t}=e;return t("name",{number:function(a){var o=Math.abs(a);return o>=YC?Kn(a):o<=ZC?Kn(a)*r(o):o<=4?Kn(a)*(1-n(o)):Kn(a)*(1-i(o))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function r(a){var o=a*a,u=hn[0][4]*o,c=o,l;for(l=0;l<3;l+=1)u=(u+hn[0][l])*o,c=(c+Yi[0][l])*o;return a*(u+hn[0][3])/(c+Yi[0][3])}function n(a){var o=hn[1][8]*a,u=a,c;for(c=0;c<7;c+=1)o=(o+hn[1][c])*a,u=(u+Yi[1][c])*a;var l=(o+hn[1][7])/(u+Yi[1][7]),s=parseInt(a*16)/16,f=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-f)*l}function i(a){var o=1/(a*a),u=hn[2][5]*o,c=o,l;for(l=0;l<4;l+=1)u=(u+hn[2][l])*o,c=(c+Yi[2][l])*o;var s=o*(u+hn[2][4])/(c+Yi[2][4]);s=(XC-s)/a,o=parseInt(a*16)/16;var f=(a-o)*(a+o);return Math.exp(-o*o)*Math.exp(-f)*s}}),ZC=.46875,XC=.5641895835477563,hn=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Yi=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],YC=Math.pow(2,53),Pm="zeta",eM=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],tM=U(Pm,eM,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:a,factorial:o,equal:u,smallerEq:c,isNegative:l,gamma:s,sin:f,subtract:p,add:m,Complex:d,BigNumber:h,pi:w}=e;return t(Pm,{number:N=>v(N,E=>E,()=>20),BigNumber:N=>v(N,E=>new h(E),()=>Math.abs(Math.log10(r.epsilon))),Complex:x});function v(N,E,A){return u(N,0)?E(-.5):u(N,1)?E(NaN):isFinite(N)?g(N,E,A,D=>D):l(N)?E(NaN):E(1)}function x(N){return N.re===0&&N.im===0?new d(-.5):N.re===1?new d(NaN,NaN):N.re===1/0&&N.im===0?new d(1):N.im===1/0||N.re===-1/0?new d(NaN,NaN):g(N,E=>E,E=>Math.round(1.3*15+.9*Math.abs(E.im)),E=>E.re)}function g(N,E,A,D){var S=A(N);if(D(N)>-(S-1)/2)return y(N,E(S),E);var C=n(i(2,N),i(E(w),p(N,1)));return C=n(C,f(n(a(E(w),2),N))),C=n(C,s(p(1,N))),n(C,g(p(1,N),E,A,D))}function b(N,E){for(var A=N,D=N;c(D,E);D=m(D,1)){var S=a(n(o(m(E,p(D,1))),i(4,D)),n(o(p(E,D)),o(n(2,D))));A=m(A,S)}return n(E,A)}function y(N,E,A){for(var D=a(1,n(b(A(0),E),p(1,i(2,p(1,N))))),S=A(0),C=A(1);c(C,E);C=m(C,1))S=m(S,a(n((-1)**(C-1),b(C,E)),i(C,N)));return n(D,S)}}),Vm="mode",rM=["typed","isNaN","isNumeric"],nM=U(Vm,rM,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(Vm,{"Array | Matrix":i,"...":function(a){return i(a)}});function i(a){a=ot(a.valueOf());var o=a.length;if(o===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},c=[],l=0,s=0;s<a.length;s++){var f=a[s];if(n(f)&&r(f))throw new Error("Cannot calculate mode of an array containing NaN values");f in u||(u[f]=0),u[f]++,u[f]===l?c.push(f):u[f]>l&&(l=u[f],c=[f])}return c}});function ur(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Um="prod",iM=["typed","config","multiplyScalar","numeric"],aM=U(Um,iM,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(Um,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(o,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(o){return a(o)}});function a(o){var u;if(Sn(o,function(c){try{u=u===void 0?c:n(u,c)}catch(l){throw ur(l,"prod",c)}}),typeof u=="string"&&(u=i(u,r.number)),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),$m="format",oM=["typed"],sM=U($m,oM,e=>{var{typed:t}=e;return t($m,{any:Ge,"any, Object | function | number | BigNumber":Ge})}),Hm="bin",uM=["typed","format"],cM=U(Hm,uM,e=>{var{typed:t,format:r}=e;return t(Hm,{"number | BigNumber":function(n){return r(n,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"bin",wordSize:i})}})}),Jm="oct",lM=["typed","format"],fM=U(Jm,lM,e=>{var{typed:t,format:r}=e;return t(Jm,{"number | BigNumber":function(n){return r(n,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"oct",wordSize:i})}})}),Gm="hex",pM=["typed","format"],mM=U(Gm,pM,e=>{var{typed:t,format:r}=e;return t(Gm,{"number | BigNumber":function(n){return r(n,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"hex",wordSize:i})}})}),$y=/\$([\w.]+)/g,Km="print",dM=["typed"],Hy=U(Km,dM,e=>{var{typed:t}=e;return t(Km,{"string, Object | Array":Wm,"string, Object | Array, number | Object":Wm})});function Wm(e,t,r){return e.replace($y,function(n,i){var a=i.split("."),o=t[a.shift()];for(o!==void 0&&o.isMatrix&&(o=o.toArray());a.length&&o!==void 0;){var u=a.shift();o=u?o[u]:o+"."}return o!==void 0?Qt(o)?o:Ge(o,r):n})}var Qm="to",hM=["typed","matrix","concat"],gM=U(Qm,hM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(Qm,{"Unit, Unit | string":(a,o)=>a.to(o)},i({Ds:!0}))}),Zm="isPrime",vM=["typed"],yM=U(Zm,vM,e=>{var{typed:t}=e;return t(Zm,{number:function(r){if(r*0!==0)return!1;if(r<=3)return r>1;if(r%2===0||r%3===0)return!1;for(var n=5;n*n<=r;n+=6)if(r%n===0||r%(n+2)===0)return!1;return!0},BigNumber:function(r){if(r.toNumber()*0!==0)return!1;if(r.lte(3))return r.gt(1);if(r.mod(2).eq(0)||r.mod(3).eq(0))return!1;if(r.lt(Math.pow(2,32))){for(var n=r.toNumber(),i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0}function a(v,x,g){for(var b=1;!x.eq(0);)x.mod(2).eq(0)?(x=x.div(2),v=v.mul(v).mod(g)):(x=x.sub(1),b=v.mul(b).mod(g));return b}var o=r.constructor.clone({precision:r.toFixed(0).length*2});r=new o(r);for(var u=0,c=r.sub(1);c.mod(2).eq(0);)c=c.div(2),u+=1;var l=null;if(r.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(v=>v<r);else{var s=Math.min(r.toNumber()-2,Math.floor(2*Math.pow(r.toFixed(0).length*Math.log(10),2)));l=[];for(var f=2;f<=s;f+=1)l.push(s)}for(var p=0;p<l.length;p+=1){var m=l[p],d=a(r.sub(r).add(m),c,r);if(!d.eq(1)){for(var h=0,w=d;!w.eq(r.sub(1));h+=1,w=w.mul(w).mod(r))if(h===u-1)return!1}}return!0},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),bM="numeric",xM=["number","?bignumber","?fraction"],wM=U(bM,xM,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:r?o=>r(o):Rl,Fraction:n?o=>n(o):jy};return function(o){var u=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 l=dt(o);if(!(l in i))throw new TypeError("Cannot convert "+o+' of type "'+l+'"; valid input types are '+Object.keys(i).join(", "));if(!(u in a))throw new TypeError("Cannot convert "+o+' to type "'+u+'"; valid output types are '+Object.keys(a).join(", "));return u===l?o:a[u](o)}}),Xm="divideScalar",NM=["typed","numeric"],DM=U(Xm,NM,e=>{var{typed:t,numeric:r}=e;return t(Xm,{"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":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),Ym="pow",EM=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],AM=U(Ym,EM,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:a,inv:o,number:u,fraction:c,Complex:l}=e;return t(Ym,{"number, number":s,"Complex, Complex":function(m,d){return m.pow(d)},"BigNumber, BigNumber":function(m,d){return d.isInteger()||m>=0||r.predictable?m.pow(d):new l(m.toNumber(),0).pow(d.toNumber(),0)},"Fraction, Fraction":function(m,d){var h=m.pow(d);if(h!=null)return h;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return s(m.valueOf(),d.valueOf())},"Array, number":f,"Array, BigNumber":function(m,d){return f(m,d.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(m,d){return p(m,d.toNumber())},"Unit, number | BigNumber":function(m,d){return m.pow(d)}});function s(m,d){if(r.predictable&&!Fe(d)&&m<0)try{var h=c(d),w=u(h);if((d===w||Math.abs((d-w)/d)<1e-14)&&h.d%2===1)return(h.n%2===0?1:-1)*Math.pow(-m,d)}catch{}return r.predictable&&(m<-1&&d===1/0||m>-1&&m<0&&d===-1/0)?NaN:Fe(d)||m>=0||r.predictable?Wv(m,d):m*m<1&&d===1/0||m*m>1&&d===-1/0?0:new l(m,0).pow(d,0)}function f(m,d){if(!Fe(d))throw new TypeError("For A^b, b must be an integer (value is "+d+")");var h=Ve(m);if(h.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+h.length+" dimensions)");if(h[0]!==h[1])throw new Error("For A^b, A must be square (size is "+h[0]+"x"+h[1]+")");if(d<0)try{return f(o(m),-d)}catch(x){throw x.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 "+d+")"):x}for(var w=n(h[0]).valueOf(),v=m;d>=1;)(d&1)===1&&(w=i(v,w)),d>>=1,v=i(v,v);return w}function p(m,d){return a(f(m.valueOf(),d))}}),ea="Number of decimals in function round must be an integer",ed="round",SM=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],CM=U(ed,SM,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:i}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t});function f(p){return Math.abs(Ao(p).exponent)}return t(ed,{number:function(p){var m=Ga(p,f(r.epsilon)),d=sr(p,m,r.epsilon)?m:p;return Ga(d)},"number, number":function(p,m){var d=f(r.epsilon);if(m>=d)return Ga(p,m);var h=Ga(p,d),w=sr(p,h,r.epsilon)?h:p;return Ga(w,m)},"number, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(ea);return new o(p).toDecimalPlaces(m.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,m){if(m%1)throw new TypeError(ea);return p.round(m)},"Complex, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(ea);var d=m.toNumber();return p.round(d)},BigNumber:function(p){var m=new o(p).toDecimalPlaces(f(r.epsilon)),d=Tr(p,m,r.epsilon)?m:p;return d.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(ea);var d=f(r.epsilon);if(m>=d)return p.toDecimalPlaces(m.toNumber());var h=p.toDecimalPlaces(d),w=Tr(p,h,r.epsilon)?h:p;return w.toDecimalPlaces(m.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,m){if(m%1)throw new TypeError(ea);return p.round(m)},"Fraction, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(ea);return p.round(m.toNumber())},"Unit, number, Unit":t.referToSelf(p=>function(m,d,h){var w=m.toNumeric(h);return h.multiply(p(w,d))}),"Unit, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix, number, Unit":t.referToSelf(p=>(m,d,h)=>Qe(m,w=>p(w,d,h))),"Array | Matrix, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Array | Matrix, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>s(n(m),d,p,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):l(d,m,p,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):s(d,m,p,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf())})}),td="log",MM=["config","typed","divideScalar","Complex"],_M=U(td,MM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(td,{number:function(a){return a>=0||r.predictable?CD(a):new i(a,0).log()},Complex:function(a){return a.log()},BigNumber:function(a){return!a.isNegative()||r.predictable?a.ln():new i(a.toNumber(),0).log()},"any, any":t.referToSelf(a=>(o,u)=>n(a(o),a(u)))})}),rd="log1p",FM=["typed","config","divideScalar","log","Complex"],TM=U(rd,FM,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(rd,{number:function(u){return u>=-1||r.predictable?EN(u):o(new a(u,0))},Complex:o,BigNumber:function(u){var c=u.plus(1);return!c.isNegative()||r.predictable?c.ln():o(new a(u.toNumber(),0))},"Array | Matrix":t.referToSelf(u=>c=>Qe(c,u)),"any, any":t.referToSelf(u=>(c,l)=>n(u(c),i(l)))});function o(u){var c=u.re+1;return new a(Math.log(Math.sqrt(c*c+u.im*u.im)),Math.atan2(u.im,c))}}),nd="nthRoots",OM=["config","typed","divideScalar","Complex"],BM=U(nd,OM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,a=[function(u){return new i(u,0)},function(u){return new i(0,u)},function(u){return new i(-u,0)},function(u){return new i(0,-u)}];function o(u,c){if(c<0)throw new Error("Root must be greater than zero");if(c===0)throw new Error("Root must be non-zero");if(c%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new i(0,0)];var l=typeof u=="number",s;(l||u.re===0||u.im===0)&&(l?s=2*+(u<0):u.im===0?s=2*+(u.re<0):s=2*+(u.im<0)+1);for(var f=u.arg(),p=u.abs(),m=[],d=Math.pow(p,1/c),h=0;h<c;h++){var w=(s+4*h)/c;if(w===Math.round(w)){m.push(a[w%4](d));continue}m.push(new i({r:d,phi:(f+2*Math.PI*h)/c}))}return m}return t(nd,{Complex:function(u){return o(u,2)},"Complex, number":o})}),id="dotPow",kM=["typed","equalScalar","matrix","pow","DenseMatrix","concat"],IM=U(id,kM,e=>{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=Jt({typed:t,equalScalar:r}),s=It({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:n,concat:o}),p={};for(var m in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,m)&&!m.includes("Matrix")&&!m.includes("Array")&&(p[m]=i.signatures[m]);var d=t(p);return t(id,f({elop:d,SS:c,DS:u,Ss:l,sS:s}))}),ad="dotDivide",RM=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],qM=U(ad,RM,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=cn({typed:t,DenseMatrix:a}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(ad,p({elop:i,SS:l,DS:c,SD:u,Ss:s,sS:f}))});function Mo(e){var{DenseMatrix:t}=e;return function(r,n,i){var a=r.size();if(a.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ge(a)+")");var o=a[0],u=a[1];if(o!==u)throw new RangeError("Matrix must be square (size: "+Ge(a)+")");var c=[];if(ke(n)){var l=n.size(),s=n._data;if(l.length===1){if(l[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var f=0;f<o;f++)c[f]=[s[f]];return new t({data:c,size:[o,1],datatype:n._datatype})}if(l.length===2){if(l[0]!==o||l[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(ks(n)){if(i){c=[];for(var p=0;p<o;p++)c[p]=[s[p][0]];return new t({data:c,size:[o,1],datatype:n._datatype})}return n}if(Ni(n)){for(var m=0;m<o;m++)c[m]=[0];for(var d=n._values,h=n._index,w=n._ptr,v=w[1],x=w[0];x<v;x++){var g=h[x];c[g][0]=d[x]}return new t({data:c,size:[o,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(st(n)){var b=Ve(n);if(b.length===1){if(b[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var y=0;y<o;y++)c[y]=[n[y]];return new t({data:c,size:[o,1]})}if(b.length===2){if(b[0]!==o||b[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var N=0;N<o;N++)c[N]=[n[N][0]];return new t({data:c,size:[o,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var od="lsolve",zM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],jM=U(od,zM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Mo({DenseMatrix:u});return t(od,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,x=0;x<h;x++){var g=m[x][0]||0,b=void 0;if(o(g,0))b=0;else{var y=v[x][x];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");b=n(g,y);for(var N=x+1;N<d;N++)m[N]=[a(m[N][0]||0,i(b,v[N][x]))]}w[x]=[b]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=[],b=0;b<h;b++){var y=m[b][0]||0;if(o(y,0))g[b]=[0];else{for(var N=0,E=[],A=[],D=x[b],S=x[b+1],C=D;C<S;C++){var _=v[C];_===b?N=w[C]:_>b&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0]||0,i(R,E[P]))]}g[b]=[R]}}return new u({data:g,size:[d,1]})}}),sd="usolve",LM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],PM=U(sd,LM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Mo({DenseMatrix:u});return t(sd,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,x=h-1;x>=0;x--){var g=m[x][0]||0,b=void 0;if(o(g,0))b=0;else{var y=v[x][x];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");b=n(g,y);for(var N=x-1;N>=0;N--)m[N]=[a(m[N][0]||0,i(b,v[N][x]))]}w[x]=[b]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=[],b=h-1;b>=0;b--){var y=m[b][0]||0;if(o(y,0))g[b]=[0];else{for(var N=0,E=[],A=[],D=x[b],S=x[b+1],C=S-1;C>=D;C--){var _=v[C];_===b?N=w[C]:_<b&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0],i(R,E[P]))]}g[b]=[R]}}return new u({data:g,size:[d,1]})}}),ud="lsolveAll",VM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],UM=U(ud,VM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Mo({DenseMatrix:u});return t(ud,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=0;v<w;v++)for(var x=m.length,g=0;g<x;g++){var b=m[g];if(o(d[v][v],0))if(o(b[v],0)){if(g===0){var y=[...b];y[v]=1;for(var N=v+1;N<w;N++)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,x-=1}else{b[v]=n(b[v],d[v][v]);for(var E=v+1;E<w;E++)b[E]=a(b[E],i(b[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=0;g<h;g++)for(var b=m.length,y=0;y<b;y++){for(var N=m[y],E=[],A=[],D=x[g],S=x[g+1],C=0,_=D;_<S;_++){var R=v[_];R===g?C=w[_]:R>g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,b-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(W=>[W]),size:[d,1]}))}}),cd="usolveAll",$M=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],HM=U(cd,$M,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Mo({DenseMatrix:u});return t(cd,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=w-1;v>=0;v--)for(var x=m.length,g=0;g<x;g++){var b=m[g];if(o(d[v][v],0))if(o(b[v],0)){if(g===0){var y=[...b];y[v]=1;for(var N=v-1;N>=0;N--)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,x-=1}else{b[v]=n(b[v],d[v][v]);for(var E=v-1;E>=0;E--)b[E]=a(b[E],i(b[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=h-1;g>=0;g--)for(var b=m.length,y=0;y<b;y++){for(var N=m[y],E=[],A=[],D=x[g],S=x[g+1],C=0,_=S-1;_>=D;_--){var R=v[_];R===g?C=w[_]:R<g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,b-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(W=>[W]),size:[d,1]}))}}),JM="matAlgo08xS0Sid",GM=["typed","equalScalar"],ql=U(JM,GM,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new We(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");if(!o||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));for(var N=[],E=[],A=[],D=[],S=[],C,_,R,P,I=0;I<v;I++){A[I]=E.length;var O=I+1;for(_=c[I],R=c[I+1],C=_;C<R;C++)P=u[C],S[P]=O,D[P]=o[C],E.push(P);for(_=m[I],R=m[I+1],C=_;C<R;C++)P=p[C],S[P]===O&&(D[P]=y(D[P],f[C]));for(C=A[I];C<E.length;){P=E[C];var F=D[P];g(F,b)?E.splice(C,1):(N.push(F),C++)}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),zl=U("useMatrixForArrayScalar",["typed","matrix"],e=>{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,a)=>n(r(i),a).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(r(i),a).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf())}}),ld="leftShift",KM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],WM=U(ld,KM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=ql({typed:t,equalScalar:n}),s=Li({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=zl({typed:t,matrix:r});return t(ld,{"number, number":ey,"BigNumber, BigNumber":hS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),fd="rightArithShift",QM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],ZM=U(fd,QM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=ql({typed:t,equalScalar:n}),s=Li({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=zl({typed:t,matrix:r});return t(fd,{"number, number":ty,"BigNumber, BigNumber":gS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),pd="rightLogShift",XM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],YM=U(pd,XM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=ql({typed:t,equalScalar:n}),s=Li({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=zl({typed:t,matrix:r});return t(pd,{"number, number":ry,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),md="and",e_=["typed","matrix","equalScalar","zeros","not","concat"],Jy=U(md,e_,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=Mu({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=Jr({typed:t}),f=gt({typed:t,matrix:r,concat:o});return t(md,{"number, number":sy,"Complex, Complex":function(p,m){return(p.re!==0||p.im!==0)&&(m.re!==0||m.im!==0)},"BigNumber, BigNumber":function(p,m){return!p.isZero()&&!m.isZero()&&!p.isNaN()&&!m.isNaN()},"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m.value||0,d.value||0)),"SparseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):l(m,d,p,!1)),"DenseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):s(m,d,p,!1)),"any, SparseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):l(d,m,p,!0)),"any, DenseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):s(d,m,p,!0)),"Array, any":t.referToSelf(p=>(m,d)=>p(r(m),d).valueOf()),"any, Array":t.referToSelf(p=>(m,d)=>p(m,r(d)).valueOf())},f({SS:c,DS:u}))}),Ks="compare",t_=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],r_=U(Ks,t_,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:u,concat:c}=e,l=cr({typed:t}),s=Cu({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:u}),p=gt({typed:t,matrix:i,concat:c}),m=Fa({typed:t});return t(Ks,n_({typed:t,config:r}),{"boolean, boolean":function(d,h){return d===h?0:d>h?1:-1},"BigNumber, BigNumber":function(d,h){return Tr(d,h,r.epsilon)?new a(0):new a(d.cmp(h))},"Fraction, Fraction":function(d,h){return new o(d.compare(h))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:s,DS:l,Ss:f}))}),n_=U(Ks,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ks,{"number, number":function(n,i){return sr(n,i,r.epsilon)?0:n>i?1:-1}})}),i_=function e(t,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,o=/^0x[0-9a-f]+$/i,u=/^0/,c=function(g){return e.insensitive&&(""+g).toLowerCase()||""+g},l=c(t).replace(i,"")||"",s=c(r).replace(i,"")||"",f=l.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(l.match(o),16)||f.length!==1&&l.match(a)&&Date.parse(l),d=parseInt(s.match(o),16)||m&&s.match(a)&&Date.parse(s)||null,h,w;if(d){if(m<d)return-1;if(m>d)return 1}for(var v=0,x=Math.max(f.length,p.length);v<x;v++){if(h=!(f[v]||"").match(u)&&parseFloat(f[v])||f[v]||0,w=!(p[v]||"").match(u)&&parseFloat(p[v])||p[v]||0,isNaN(h)!==isNaN(w))return isNaN(h)?1:-1;if(typeof h!=typeof w&&(h+="",w+=""),h<w)return-1;if(h>w)return 1}return 0};const ta=So(i_);var dd="compareNatural",a_=["typed","compare"],o_=U(dd,a_,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(dd,{"any, any":i});function i(c,l){var s=dt(c),f=dt(l),p;if((s==="number"||s==="BigNumber"||s==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return p=r(c,l),p.toString()!=="0"?p>0?1:-1:ta(s,f);var m=["Array","DenseMatrix","SparseMatrix"];if(m.includes(s)||m.includes(f))return p=a(i,c,l),p!==0?p:ta(s,f);if(s!==f)return ta(s,f);if(s==="Complex")return s_(c,l);if(s==="Unit")return c.equalBase(l)?i(c.value,l.value):o(i,c.formatUnits(),l.formatUnits());if(s==="boolean")return n(c,l);if(s==="string")return ta(c,l);if(s==="Object")return u(i,c,l);if(s==="null"||s==="undefined")return 0;throw new TypeError('Unsupported type of value "'+s+'"')}function a(c,l,s){return Ni(l)&&Ni(s)?o(c,l.toJSON().values,s.toJSON().values):Ni(l)?a(c,l.toArray(),s):Ni(s)?a(c,l,s.toArray()):ks(l)?a(c,l.toJSON().data,s):ks(s)?a(c,l,s.toJSON().data):Array.isArray(l)?Array.isArray(s)?o(c,l,s):a(c,l,[s]):a(c,[l],s)}function o(c,l,s){for(var f=0,p=Math.min(l.length,s.length);f<p;f++){var m=c(l[f],s[f]);if(m!==0)return m}return l.length>s.length?1:l.length<s.length?-1:0}function u(c,l,s){var f=Object.keys(l),p=Object.keys(s);f.sort(ta),p.sort(ta);var m=o(c,f,p);if(m!==0)return m;for(var d=0;d<f.length;d++){var h=c(l[f[d]],s[p[d]]);if(h!==0)return h}return 0}});function s_(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}var hd="compareText",u_=["typed","matrix","concat"];Uc.signature="any, any";var c_=U(hd,u_,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(hd,Uc,i({elop:Uc,Ds:!0}))}),Ws="equal",l_=["typed","matrix","equalScalar","DenseMatrix","concat"],f_=U(Ws,l_,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(Ws,p_({typed:t,equalScalar:n}),l({elop:n,SS:u,DS:o,Ss:c}))}),p_=U(Ws,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Ws,{"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:r(n,i)}})}),gd="equalText",m_=["typed","compareText","isZero"],d_=U(gd,m_,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(gd,{"any, any":function(i,a){return n(r(i,a))}})}),Qs="smaller",h_=["typed","config","matrix","DenseMatrix","concat"],g_=U(Qs,h_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Fa({typed:t});return t(Qs,v_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<p,"BigNumber, BigNumber":function(f,p){return f.lt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===-1,"Complex, Complex":function(f,p){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),v_=U(Qs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Qs,{"number, number":function(n,i){return n<i&&!sr(n,i,r.epsilon)}})}),Zs="smallerEq",y_=["typed","config","matrix","DenseMatrix","concat"],b_=U(Zs,y_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Fa({typed:t});return t(Zs,x_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<=p,"BigNumber, BigNumber":function(f,p){return f.lte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),x_=U(Zs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Zs,{"number, number":function(n,i){return n<=i||sr(n,i,r.epsilon)}})}),Xs="larger",w_=["typed","config","matrix","DenseMatrix","concat"],N_=U(Xs,w_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Fa({typed:t});return t(Xs,D_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>p,"BigNumber, BigNumber":function(f,p){return f.gt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),D_=U(Xs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Xs,{"number, number":function(n,i){return n>i&&!sr(n,i,r.epsilon)}})}),Ys="largerEq",E_=["typed","config","matrix","DenseMatrix","concat"],A_=U(Ys,E_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Fa({typed:t});return t(Ys,S_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>=p,"BigNumber, BigNumber":function(f,p){return f.gte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),S_=U(Ys,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ys,{"number, number":function(n,i){return n>=i||sr(n,i,r.epsilon)}})}),vd="deepEqual",C_=["typed","equal"],M_=U(vd,C_,e=>{var{typed:t,equal:r}=e;return t(vd,{"any, any":function(i,a){return n(i.valueOf(),a.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var o=i.length;if(o!==a.length)return!1;for(var u=0;u<o;u++)if(!n(i[u],a[u]))return!1;return!0}else return!1;else return Array.isArray(a)?!1:r(i,a)}}),eu="unequal",__=["typed","config","equalScalar","matrix","DenseMatrix","concat"],F_=U(eu,__,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=It({typed:t,DenseMatrix:a}),s=gt({typed:t,matrix:i,concat:o});return t(eu,T_({typed:t,equalScalar:n}),s({elop:f,SS:c,DS:u,Ss:l}));function f(p,m){return!n(p,m)}}),T_=U(eu,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(eu,{"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:!r(n,i)}})}),yd="partitionSelect",O_=["typed","isNumeric","isNaN","compare"],B_=U(yd,O_,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,a=i,o=(l,s)=>-i(l,s);return t(yd,{"Array | Matrix, number":function(l,s){return u(l,s,a)},"Array | Matrix, number, string":function(l,s,f){if(f==="asc")return u(l,s,a);if(f==="desc")return u(l,s,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(l,s,f){if(!Fe(s)||s<0)throw new Error("k must be a non-negative integer");if(ke(l)){var p=l.size();if(p.length>1)throw new Error("Only one dimensional matrices supported");return c(l.valueOf(),s,f)}if(Array.isArray(l))return c(l,s,f)}function c(l,s,f){if(s>=l.length)throw new Error("k out of bounds");for(var p=0;p<l.length;p++)if(r(l[p])&&n(l[p]))return l[p];for(var m=0,d=l.length-1;m<d;){for(var h=m,w=d,v=l[Math.floor(Math.random()*(d-m+1))+m];h<w;)if(f(l[h],v)>=0){var x=l[w];l[w]=l[h],l[h]=x,--w}else++h;f(l[h],v)>0&&--h,s<=h?d=h:m=h+1}return l[s]}}),bd="sort",k_=["typed","matrix","compare","compareNatural"],I_=U(bd,k_,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,a=n,o=(s,f)=>-n(s,f);return t(bd,{Array:function(s){return c(s),s.sort(a)},Matrix:function(s){return l(s),r(s.toArray().sort(a),s.storage())},"Array, function":function(s,f){return c(s),s.sort(f)},"Matrix, function":function(s,f){return l(s),r(s.toArray().sort(f),s.storage())},"Array, string":function(s,f){return c(s),s.sort(u(f))},"Matrix, string":function(s,f){return l(s),r(s.toArray().sort(u(f)),s.storage())}});function u(s){if(s==="asc")return a;if(s==="desc")return o;if(s==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function c(s){if(Ve(s).length!==1)throw new Error("One dimensional array expected")}function l(s){if(s.size().length!==1)throw new Error("One dimensional matrix expected")}}),xd="max",R_=["typed","config","numeric","larger"],Gy=U(xd,R_,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(xd,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return Au(u,c.valueOf(),a)},"...":function(u){if(Ca(u))throw new TypeError("Scalar values expected in function max");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"max",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"max",l)}}),c===void 0)throw new Error("Cannot calculate max of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),wd="min",q_=["typed","config","numeric","smaller"],Ky=U(wd,q_,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(wd,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return Au(u,c.valueOf(),a)},"...":function(u){if(Ca(u))throw new TypeError("Scalar values expected in function min");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"min",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"min",l)}}),c===void 0)throw new Error("Cannot calculate min of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),z_="ImmutableDenseMatrix",j_=["smaller","DenseMatrix"],L_=U(z_,j_,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Qt(a))throw new Error("Invalid datatype: "+a);if(ke(i)||st(i)){var o=new r(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&st(i.data)&&st(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+dt(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=r.prototype.subset.call(this,i);return ke(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:ze(this._data),size:ze(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0}),P_="Index",V_=["ImmutableDenseMatrix","getMatrixDataType"],U_=U(P_,V_,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var c=arguments[o],l=st(c),s=ke(c),f=null;if(Cl(c))this._dimensions.push(c),this._isScalar=!1;else if(l||s){var p=void 0;r(c)==="boolean"?(l&&(p=i(Nd(c).valueOf())),s&&(p=i(Nd(c._data).valueOf())),f=c.valueOf().length):p=i(c.valueOf()),this._dimensions.push(p);var m=p.size();(m.length!==1||m[0]!==1||f!==null)&&(this._isScalar=!1)}else if(typeof c=="number")this._dimensions.push(i([c]));else if(typeof c=="string")this._dimensions.push(c);else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._sourceSize.push(f)}}n.prototype.type="Index",n.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!Fe(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return n.prototype.clone=function(){var a=new n;return a._dimensions=ze(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},n.create=function(a){var o=new n;return n.apply(o,a),o},n.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?1:c.size()[0]}return a},n.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.max()}return a},n.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.min()}return a},n.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},n.prototype.dimension=function(a){return this._dimensions[a]||null},n.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a.push(typeof c=="string"?c:c.toArray())}return a},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];typeof c=="string"?a.push(JSON.stringify(c)):a.push(c.toString())}return"["+a.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(a){return n.create(a.dimensions)},n},{isClass:!0});function Nd(e){var t=[];return e.forEach((r,n)=>{r&&t.push(n)}),t}var $_="FibonacciHeap",H_=["smaller","larger"],J_=U($_,H_,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(s,f){var p={key:s,value:f,degree:0};if(this._minimum){var m=this._minimum;p.left=m,p.right=m.right,m.right=p,p.right.left=p,t(s,m.key)&&(this._minimum=p)}else p.left=p,p.right=p,this._minimum=p;return this._size++,p},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var s=this._minimum;if(s===null)return s;for(var f=this._minimum,p=s.degree,m=s.child;p>0;){var d=m.right;m.left.right=m.right,m.right.left=m.left,m.left=f,m.right=f.right,f.right=m,m.right.left=m,m.parent=null,m=d,p--}return s.left.right=s.right,s.right.left=s.left,s===s.right?f=null:(f=s.right,f=l(f,this._size)),this._size--,this._minimum=f,s},i.prototype.remove=function(s){this._minimum=a(this._minimum,s,-1),this.extractMinimum()};function a(s,f,p){f.key=p;var m=f.parent;return m&&t(f.key,m.key)&&(o(s,f,m),u(s,m)),t(f.key,s.key)&&(s=f),s}function o(s,f,p){f.left.right=f.right,f.right.left=f.left,p.degree--,p.child===f&&(p.child=f.right),p.degree===0&&(p.child=null),f.left=s,f.right=s.right,s.right=f,f.right.left=f,f.parent=null,f.mark=!1}function u(s,f){var p=f.parent;p&&(f.mark?(o(s,f,p),u(p)):f.mark=!0)}var c=function(s,f){s.left.right=s.right,s.right.left=s.left,s.parent=f,f.child?(s.left=f.child,s.right=f.child.right,f.child.right=s,s.right.left=s):(f.child=s,s.right=s,s.left=s),f.degree++,s.mark=!1};function l(s,f){var p=Math.floor(Math.log(f)*n)+1,m=new Array(p),d=0,h=s;if(h)for(d++,h=h.right;h!==s;)d++,h=h.right;for(var w;d>0;){for(var v=h.degree,x=h.right;w=m[v],!!w;){if(r(h.key,w.key)){var g=w;w=h,h=g}c(w,h),m[v]=null,v++}m[v]=h,h=x,d--}s=null;for(var b=0;b<p;b++)w=m[b],w&&(s?(w.left.right=w.right,w.right.left=w.left,w.left=s,w.right=s.right,s.right=w,w.right.left=w,t(w.key,s.key)&&(s=w)):s=w);return s}return i},{isClass:!0}),G_="Spa",K_=["addScalar","equalScalar","FibonacciHeap"],W_=U(G_,K_,e=>{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,o){if(this._values[a])this._values[a].value=o;else{var u=this._heap.insert(a,o);this._values[a]=u}},i.prototype.get=function(a){var o=this._values[a];return o?o.value:0},i.prototype.accumulate=function(a,o){var u=this._values[a];u?u.value=t(u.value,o):(u=this._heap.insert(a,o),this._values[a]=u)},i.prototype.forEach=function(a,o,u){var c=this._heap,l=this._values,s=[],f=c.extractMinimum();for(f&&s.push(f);f&&f.key<=o;)f.key>=a&&(r(f.value,0)||u(f.key,f.value,this)),f=c.extractMinimum(),f&&s.push(f);for(var p=0;p<s.length;p++){var m=s[p];f=c.insert(m.key,m.value),l[f.key]=f}},i.prototype.swap=function(a,o){var u=this._values[a],c=this._values[o];if(!u&&c)u=this._heap.insert(a,c.value),this._heap.remove(c),this._values[a]=u,this._values[o]=void 0;else if(u&&!c)c=this._heap.insert(o,u.value),this._heap.remove(u),this._values[o]=c,this._values[a]=void 0;else if(u&&c){var l=u.value;u.value=c.value,c.value=l}},i},{isClass:!0}),Q_=Co(function(e){return new e(1).exp()},{hasher:_u}),Z_=Co(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:_u}),jl=Co(function(e){return e.acos(-1)},{hasher:_u}),X_=Co(function(e){return jl(e).times(2)},{hasher:_u});function _u(e){return e[0].precision}function Dd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dd(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Y_="Unit",e3=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],t3=U(Y_,e3,e=>{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:o,pow:u,abs:c,fix:l,round:s,equal:f,isNumeric:p,format:m,number:d,Complex:h,BigNumber:w,Fraction:v}=e,x=d;function g(T,z){if(!(this instanceof g))throw new Error("Constructor must be called with the new operator");if(!(T==null||p(T)||wn(T)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,z===void 0)this.units=[],this.dimensions=q.map(L=>0);else if(typeof z=="string"){var J=g.parse(z);this.units=J.units,this.dimensions=J.dimensions}else if(Cr(z)&&z.value===null)this.fixPrefix=z.fixPrefix,this.skipAutomaticSimplification=z.skipAutomaticSimplification,this.dimensions=z.dimensions.slice(0),this.units=z.units.map(L=>Ot({},L));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(T)}Object.defineProperty(g,"name",{value:"Unit"}),g.prototype.constructor=g,g.prototype.type="Unit",g.prototype.isUnit=!0;var b,y,N;function E(){for(;N===" "||N===" ";)S()}function A(T){return T>="0"&&T<="9"||T==="."}function D(T){return T>="0"&&T<="9"}function S(){y++,N=b.charAt(y)}function C(T){y=T,N=b.charAt(y)}function _(){var T="",z=y;if(N==="+"?S():N==="-"&&(T+=N,S()),!A(N))return C(z),null;if(N==="."){if(T+=N,S(),!D(N))return C(z),null}else{for(;D(N);)T+=N,S();N==="."&&(T+=N,S())}for(;D(N);)T+=N,S();if(N==="E"||N==="e"){var J="",L=y;if(J+=N,S(),(N==="+"||N==="-")&&(J+=N,S()),!D(N))return C(L),T;for(T=T+J;D(N);)T+=N,S()}return T}function R(){for(var T="";D(N)||g.isValidAlpha(N);)T+=N,S();var z=T.charAt(0);return g.isValidAlpha(z)?T:null}function P(T){return N===T?(S(),T):null}g.parse=function(T,z){if(z=z||{},b=T,y=-1,N="",typeof b!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var J=new g;J.units=[];var L=1,H=!1;S(),E();var G=_(),Y=null;if(G){if(r.number==="BigNumber")Y=new w(G);else if(r.number==="Fraction")try{Y=new v(G)}catch{Y=parseFloat(G)}else Y=parseFloat(G);E(),P("*")?(L=1,H=!0):P("/")&&(L=-1,H=!0)}for(var ee=[],B=1;;){for(E();N==="(";)ee.push(L),B*=L,L=1,S(),E();var j=void 0;if(N){var Q=N;if(j=R(),j===null)throw new SyntaxError('Unexpected "'+Q+'" in "'+b+'" at index '+y.toString())}else break;var Z=I(j);if(Z===null)throw new SyntaxError('Unit "'+j+'" not found.');var ie=L*B;if(E(),P("^")){E();var oe=_();if(oe===null)throw new SyntaxError('In "'+T+'", "^" must be followed by a floating-point number');ie*=oe}J.units.push({unit:Z.unit,prefix:Z.prefix,power:ie});for(var ye=0;ye<q.length;ye++)J.dimensions[ye]+=(Z.unit.dimensions[ye]||0)*ie;for(E();N===")";){if(ee.length===0)throw new SyntaxError('Unmatched ")" in "'+b+'" at index '+y.toString());B/=ee.pop(),S(),E()}if(H=!1,P("*")?(L=1,H=!0):P("/")?(L=-1,H=!0):L=1,Z.unit.base){var fe=Z.unit.base.key;re.auto[fe]={unit:Z.unit,prefix:Z.prefix}}}if(E(),N)throw new SyntaxError('Could not parse: "'+T+'"');if(H)throw new SyntaxError('Trailing characters: "'+T+'"');if(ee.length!==0)throw new SyntaxError('Unmatched "(" in "'+b+'"');if(J.units.length===0&&!z.allowNoUnits)throw new SyntaxError('"'+T+'" contains no units');return J.value=Y!==void 0?J._normalize(Y):null,J},g.prototype.clone=function(){var T=new g;T.fixPrefix=this.fixPrefix,T.skipAutomaticSimplification=this.skipAutomaticSimplification,T.value=ze(this.value),T.dimensions=this.dimensions.slice(0),T.units=[];for(var z=0;z<this.units.length;z++){T.units[z]={};for(var J in this.units[z])Me(this.units[z],J)&&(T.units[z][J]=this.units[z][J])}return T},g.prototype.valueType=function(){return dt(this.value)},g.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},g.prototype._normalize=function(T){if(T==null||this.units.length===0)return T;for(var z=T,J=g._getNumberConverter(dt(T)),L=0;L<this.units.length;L++){var H=J(this.units[L].unit.value),G=J(this.units[L].prefix.value),Y=J(this.units[L].power);z=a(z,u(a(H,G),Y))}return z},g.prototype._denormalize=function(T,z){if(T==null||this.units.length===0)return T;for(var J=T,L=g._getNumberConverter(dt(T)),H=0;H<this.units.length;H++){var G=L(this.units[H].unit.value),Y=L(this.units[H].prefix.value),ee=L(this.units[H].power);J=o(J,u(a(G,Y),ee))}return J};var I=Co(T=>{if(Me(V,T)){var z=V[T],J=z.prefixes[""];return{unit:z,prefix:J}}for(var L in V)if(Me(V,L)&&pD(T,L)){var H=V[L],G=T.length-L.length,Y=T.substring(0,G),ee=Me(H.prefixes,Y)?H.prefixes[Y]:void 0;if(ee!==void 0)return{unit:H,prefix:ee}}return null},{hasher:T=>T[0],limit:100});g.isValuelessUnit=function(T){return I(T)!==null},g.prototype.hasBase=function(T){if(typeof T=="string"&&(T=k[T]),!T)return!1;for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equalBase=function(T){for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equals=function(T){return this.equalBase(T)&&f(this.value,T.value)},g.prototype.multiply=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)+(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=gc({},J.units[H]);z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=a(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.divideInto=function(T){return new g(T).divide(this)},g.prototype.divide=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)-(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=gc(gc({},J.units[H]),{},{power:-J.units[H].power});z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=o(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.pow=function(T){for(var z=this.clone(),J=0;J<q.length;J++)z.dimensions[J]=(this.dimensions[J]||0)*T;for(var L=0;L<z.units.length;L++)z.units[L].power*=T;return z.value!==null?z.value=u(z.value,T):z.value=null,z.skipAutomaticSimplification=!1,O(z)};function O(T){return T.equalBase(k.NONE)&&T.value!==null&&!r.predictable?T.value:T}g.prototype.abs=function(){var T=this.clone();if(T.value!==null)if(T._isDerived()||T.units.length===0||T.units[0].unit.offset===0)T.value=c(T.value);else{var z=T._numberConverter(),J=z(T.units[0].unit.value),L=z(T.units[0].unit.offset),H=a(J,L);T.value=i(c(n(T.value,H)),H)}for(var G in T.units)(T.units[G].unit.name==="VA"||T.units[G].unit.name==="VAR")&&(T.units[G].unit=V.W);return T},g.prototype.to=function(T){var z=this.value===null?this._normalize(1):this.value,J;if(typeof T=="string")J=g.parse(T);else if(Cr(T))J=T.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(J))throw new Error("Units do not match ('".concat(J.toString(),"' != '").concat(this.toString(),"')"));if(J.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||J.units.length===0||this.units[0].unit.offset===J.units[0].unit.offset)J.value=ze(z);else{var L=g._getNumberConverter(dt(z)),H=this.units[0].unit.value,G=this.units[0].unit.offset,Y=a(H,G),ee=J.units[0].unit.value,B=J.units[0].unit.offset,j=a(ee,B);J.value=n(z,L(i(Y,j)))}return J.fixPrefix=!0,J.skipAutomaticSimplification=!0,J},g.prototype.toNumber=function(T){return x(this.toNumeric(T))},g.prototype.toNumeric=function(T){var z;return T?z=this.to(T):z=this.clone(),z._isDerived()||z.units.length===0?z._denormalize(z.value):z._denormalize(z.value,z.units[0].prefix.value)},g.prototype.toString=function(){return this.format()},g.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},g.fromJSON=function(T){var z,J=new g(T.value,(z=T.unit)!==null&&z!==void 0?z:void 0);return J.fixPrefix=T.fixPrefix||!1,J},g.prototype.valueOf=g.prototype.toString,g.prototype.simplify=function(){var T=this.clone(),z=[],J;for(var L in ae)if(Me(ae,L)&&T.hasBase(k[L])){J=L;break}if(J==="NONE")T.units=[];else{var H;if(J&&Me(ae,J)&&(H=ae[J]),H)T.units=[{unit:H.unit,prefix:H.prefix,power:1}];else{for(var G=!1,Y=0;Y<q.length;Y++){var ee=q[Y];Math.abs(T.dimensions[Y]||0)>1e-12&&(Me(ae,ee)?z.push({unit:ae[ee].unit,prefix:ae[ee].prefix,power:T.dimensions[Y]||0}):G=!0)}z.length<T.units.length&&!G&&(T.units=z)}}return T},g.prototype.toSI=function(){for(var T=this.clone(),z=[],J=0;J<q.length;J++){var L=q[J];if(Math.abs(T.dimensions[J]||0)>1e-12)if(Me(re.si,L))z.push({unit:re.si[L].unit,prefix:re.si[L].prefix,power:T.dimensions[J]||0});else throw new Error("Cannot express custom unit "+L+" in SI units")}return T.units=z,T.fixPrefix=!0,T.skipAutomaticSimplification=!0,this.value!==null?(T.value=null,this.to(T)):T},g.prototype.formatUnits=function(){for(var T="",z="",J=0,L=0,H=0;H<this.units.length;H++)this.units[H].power>0?(J++,T+=" "+this.units[H].prefix.name+this.units[H].unit.name,Math.abs(this.units[H].power-1)>1e-15&&(T+="^"+this.units[H].power)):this.units[H].power<0&&L++;if(L>0)for(var G=0;G<this.units.length;G++)this.units[G].power<0&&(J>0?(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,Math.abs(this.units[G].power+1)>1e-15&&(z+="^"+-this.units[G].power)):(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,z+="^"+this.units[G].power));T=T.substr(1),z=z.substr(1),J>1&&L>0&&(T="("+T+")"),L>1&&J>0&&(z="("+z+")");var Y=T;return J>0&&L>0&&(Y+=" / "),Y+=z,Y},g.prototype.format=function(T){var z=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),J=!1;typeof z.value<"u"&&z.value!==null&&wn(z.value)&&(J=Math.abs(z.value.re)<1e-14);for(var L in z.units)Me(z.units,L)&&z.units[L].unit&&(z.units[L].unit.name==="VA"&&J?z.units[L].unit=V.VAR:z.units[L].unit.name==="VAR"&&!J&&(z.units[L].unit=V.VA));z.units.length===1&&!z.fixPrefix&&Math.abs(z.units[0].power-Math.round(z.units[0].power))<1e-14&&(z.units[0].prefix=z._bestPrefix());var H=z._denormalize(z.value),G=z.value!==null?m(H,T||{}):"",Y=z.formatUnits();return z.value&&wn(z.value)&&(G="("+G+")"),Y.length>0&&G.length>0&&(G+=" "),G+=Y,G},g.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var T=this.value!==null?c(this.value):0,z=c(this.units[0].unit.value),J=this.units[0].prefix;if(T===0)return J;var L=this.units[0].power,H=Math.log(T/Math.pow(J.value*z,L))/Math.LN10-1.2;if(H>-2.200001&&H<1.800001)return J;H=Math.abs(H);var G=this.units[0].unit.prefixes;for(var Y in G)if(Me(G,Y)){var ee=G[Y];if(ee.scientific){var B=Math.abs(Math.log(T/Math.pow(ee.value*z,L))/Math.LN10-1.2);(B<H||B===H&&ee.name.length<J.name.length)&&(J=ee,H=B)}}return J},g.prototype.splitUnit=function(T){for(var z=this.clone(),J=[],L=0;L<T.length&&(z=z.to(T[L]),L!==T.length-1);L++){var H=z.toNumeric(),G=s(H),Y=void 0,ee=f(G,H);ee?Y=G:Y=l(z.toNumeric());var B=new g(Y,T[L].toString());J.push(B),z=i(z,B)}for(var j=0,Q=0;Q<J.length;Q++)j=n(j,J[Q].value);return f(j,this.value)&&(z.value=0),J.push(z),J};var F={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};F.SHORTLONG=Ot({},F.SHORT,F.LONG),F.BINARY_SHORT=Ot({},F.BINARY_SHORT_SI,F.BINARY_SHORT_IEC),F.BINARY_LONG=Ot({},F.BINARY_LONG_SI,F.BINARY_LONG_IEC);var q=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var te in k)Me(k,te)&&(k[te].key=te);var se={},W={name:"",base:se,value:1,offset:0,dimensions:q.map(T=>0)},V={meter:{name:"meter",base:k.LENGTH,prefixes:F.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:F.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:F.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:F.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:F.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:F.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:F.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:F.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:F.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:F.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:F.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:F.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:F.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:F.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:F.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:F.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:F.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:F.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:F.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:F.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:F.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:F.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:F.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:F.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:F.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:F.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:F.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:F.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:F.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:F.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:F.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:F.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:F.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:F.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:F.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:F.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:F.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:F.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:F.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:F.NONE,value:7*86400,offset:0},month:{name:"month",base:k.TIME,prefixes:F.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:F.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:F.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:F.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:F.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:F.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:F.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:F.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:F.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:F.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:F.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:F.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:F.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:F.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:F.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:F.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:F.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:F.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:F.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:F.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:F.LONG,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:F.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:F.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:F.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:F.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:F.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:F.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:F.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:F.SHORT,value:h.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:F.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:F.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:F.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:F.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:F.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:F.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:F.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:F.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:F.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:F.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:F.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:F.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:F.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:F.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:F.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:F.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:F.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:F.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:F.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:F.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:F.BINARY_LONG,value:8,offset:0}},ue={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function me(T){if(T.number==="BigNumber"){var z=jl(w);V.rad.value=new w(1),V.deg.value=z.div(180),V.grad.value=z.div(200),V.cycle.value=z.times(2),V.arcsec.value=z.div(648e3),V.arcmin.value=z.div(10800)}else V.rad.value=1,V.deg.value=Math.PI/180,V.grad.value=Math.PI/200,V.cycle.value=Math.PI*2,V.arcsec.value=Math.PI/648e3,V.arcmin.value=Math.PI/10800;V.radian.value=V.rad.value,V.degree.value=V.deg.value,V.gradian.value=V.grad.value}me(r),t&&t("config",function(T,z){T.number!==z.number&&me(T)});var re={si:{NONE:{unit:W,prefix:F.NONE[""]},LENGTH:{unit:V.m,prefix:F.SHORT[""]},MASS:{unit:V.g,prefix:F.SHORT.k},TIME:{unit:V.s,prefix:F.SHORT[""]},CURRENT:{unit:V.A,prefix:F.SHORT[""]},TEMPERATURE:{unit:V.K,prefix:F.SHORT[""]},LUMINOUS_INTENSITY:{unit:V.cd,prefix:F.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:V.mol,prefix:F.SHORT[""]},ANGLE:{unit:V.rad,prefix:F.SHORT[""]},BIT:{unit:V.bits,prefix:F.SHORT[""]},FORCE:{unit:V.N,prefix:F.SHORT[""]},ENERGY:{unit:V.J,prefix:F.SHORT[""]},POWER:{unit:V.W,prefix:F.SHORT[""]},PRESSURE:{unit:V.Pa,prefix:F.SHORT[""]},ELECTRIC_CHARGE:{unit:V.C,prefix:F.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:V.F,prefix:F.SHORT[""]},ELECTRIC_POTENTIAL:{unit:V.V,prefix:F.SHORT[""]},ELECTRIC_RESISTANCE:{unit:V.ohm,prefix:F.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:V.H,prefix:F.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:V.S,prefix:F.SHORT[""]},MAGNETIC_FLUX:{unit:V.Wb,prefix:F.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:V.T,prefix:F.SHORT[""]},FREQUENCY:{unit:V.Hz,prefix:F.SHORT[""]}}};re.cgs=JSON.parse(JSON.stringify(re.si)),re.cgs.LENGTH={unit:V.m,prefix:F.SHORT.c},re.cgs.MASS={unit:V.g,prefix:F.SHORT[""]},re.cgs.FORCE={unit:V.dyn,prefix:F.SHORT[""]},re.cgs.ENERGY={unit:V.erg,prefix:F.NONE[""]},re.us=JSON.parse(JSON.stringify(re.si)),re.us.LENGTH={unit:V.ft,prefix:F.NONE[""]},re.us.MASS={unit:V.lbm,prefix:F.NONE[""]},re.us.TEMPERATURE={unit:V.degF,prefix:F.NONE[""]},re.us.FORCE={unit:V.lbf,prefix:F.NONE[""]},re.us.ENERGY={unit:V.BTU,prefix:F.BTU[""]},re.us.POWER={unit:V.hp,prefix:F.NONE[""]},re.us.PRESSURE={unit:V.psi,prefix:F.NONE[""]},re.auto=JSON.parse(JSON.stringify(re.si));var ae=re.auto;g.setUnitSystem=function(T){if(Me(re,T))ae=re[T];else throw new Error("Unit system "+T+" does not exist. Choices are: "+Object.keys(re).join(", "))},g.getUnitSystem=function(){for(var T in re)if(Me(re,T)&&re[T]===ae)return T},g.typeConverters={BigNumber:function(T){return T!=null&&T.isFraction?new w(T.n).div(T.d).times(T.s):new w(T+"")},Fraction:function(T){return new v(T)},Complex:function(T){return T},number:function(T){return T!=null&&T.isFraction?d(T):T}},g.prototype._numberConverter=function(){var T=g.typeConverters[this.valueType()];if(T)return T;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},g._getNumberConverter=function(T){if(!g.typeConverters[T])throw new TypeError('Unsupported type "'+T+'"');return g.typeConverters[T]};for(var de in V)if(Me(V,de)){var ne=V[de];ne.dimensions=ne.base.dimensions}for(var ce in ue)if(Me(ue,ce)){var le=V[ue[ce]],he={};for(var xe in le)Me(le,xe)&&(he[xe]=le[xe]);he.name=ce,V[ce]=he}g.isValidAlpha=function(T){return/^[a-zA-Z]$/.test(T)};function $(T){for(var z=0;z<T.length;z++){if(N=T.charAt(z),z===0&&!g.isValidAlpha(N))throw new Error('Invalid unit name (must begin with alpha character): "'+T+'"');if(z>0&&!(g.isValidAlpha(N)||D(N)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+T+'"')}}return g.createUnit=function(T,z){if(typeof T!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(z&&z.override){for(var J in T)if(Me(T,J)&&g.deleteUnit(J),T[J].aliases)for(var L=0;L<T[J].aliases.length;L++)g.deleteUnit(T[J].aliases[L])}var H;for(var G in T)Me(T,G)&&(H=g.createUnitSingle(G,T[G]));return H},g.createUnitSingle=function(T,z){if((typeof z>"u"||z===null)&&(z={}),typeof T!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Me(V,T))throw new Error('Cannot create unit "'+T+'": a unit with that name already exists');$(T);var J=null,L=[],H=0,G,Y,ee;if(z&&z.type==="Unit")J=z.clone();else if(typeof z=="string")z!==""&&(G=z);else if(typeof z=="object")G=z.definition,Y=z.prefixes,H=z.offset,ee=z.baseName,z.aliases&&(L=z.aliases.valueOf());else throw new TypeError('Cannot create unit "'+T+'" from "'+z.toString()+'": expecting "string" or "Unit" or "Object"');if(L){for(var B=0;B<L.length;B++)if(Me(V,L[B]))throw new Error('Cannot create alias "'+L[B]+'": a unit with that name already exists')}if(G&&typeof G=="string"&&!J)try{J=g.parse(G,{allowNoUnits:!0})}catch(M){throw M.message='Could not create unit "'+T+'" from "'+G+'": '+M.message,M}else G&&G.type==="Unit"&&(J=G.clone());L=L||[],H=H||0,Y&&Y.toUpperCase?Y=F[Y.toUpperCase()]||F.NONE:Y=F.NONE;var j={};if(J){j={name:T,value:J.value,dimensions:J.dimensions.slice(0),prefixes:Y,offset:H};var Q=!1;for(var Z in k)if(Me(k,Z)){for(var ie=!0,oe=0;oe<q.length;oe++)if(Math.abs((j.dimensions[oe]||0)-(k[Z].dimensions[oe]||0))>1e-12){ie=!1;break}if(ie){Q=!0,j.base=k[Z];break}}if(!Q){ee=ee||T+"_STUFF";var ye={dimensions:J.dimensions.slice(0)};ye.key=ee,k[ee]=ye,ae[ee]={unit:j,prefix:F.NONE[""]},j.base=k[ee]}}else{if(ee=ee||T+"_STUFF",q.indexOf(ee)>=0)throw new Error('Cannot create new base unit "'+T+'": a base unit with that name already exists (and cannot be overridden)');q.push(ee);for(var fe in k)Me(k,fe)&&(k[fe].dimensions[q.length-1]=0);for(var De={dimensions:[]},Ne=0;Ne<q.length;Ne++)De.dimensions[Ne]=0;De.dimensions[q.length-1]=1,De.key=ee,k[ee]=De,j={name:T,value:1,dimensions:k[ee].dimensions.slice(0),prefixes:Y,offset:H,base:k[ee]},ae[ee]={unit:j,prefix:F.NONE[""]}}g.UNITS[T]=j;for(var je=0;je<L.length;je++){var Ze=L[je],_e={};for(var wt in j)Me(j,wt)&&(_e[wt]=j[wt]);_e.name=Ze,g.UNITS[Ze]=_e}return delete I.cache,new g(null,T)},g.deleteUnit=function(T){delete g.UNITS[T],delete I.cache},g.PREFIXES=F,g.BASE_DIMENSIONS=q,g.BASE_UNITS=k,g.UNIT_SYSTEMS=re,g.UNITS=V,g},{isClass:!0}),Ed="unit",r3=["typed","Unit"],n3=U(Ed,r3,e=>{var{typed:t,Unit:r}=e;return t(Ed,{Unit:function(n){return n.clone()},string:function(n){return r.isValuelessUnit(n)?new r(null,n):r.parse(n,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(n,i){return new r(n,i)},"number | BigNumber | Fraction":function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),Ad="sparse",i3=["typed","SparseMatrix"],a3=U(Ad,i3,e=>{var{typed:t,SparseMatrix:r}=e;return t(Ad,{"":function(){return new r([])},string:function(n){return new r([],n)},"Array | Matrix":function(n){return new r(n)},"Array | Matrix, string":function(n,i){return new r(n,i)}})}),Sd="createUnit",o3=["typed","Unit"],s3=U(Sd,o3,e=>{var{typed:t,Unit:r}=e;return t(Sd,{"Object, Object":function(n,i){return r.createUnit(n,i)},Object:function(n){return r.createUnit(n,{})},"string, Unit | string | Object, Object":function(n,i,a){var o={};return o[n]=i,r.createUnit(o,a)},"string, Unit | string | Object":function(n,i){var a={};return a[n]=i,r.createUnit(a,{})},string:function(n){var i={};return i[n]={},r.createUnit(i,{})}})}),Cd="acos",u3=["typed","config","Complex"],c3=U(Cd,u3,e=>{var{typed:t,config:r,Complex:n}=e;return t(Cd,{number:function(i){return i>=-1&&i<=1||r.predictable?Math.acos(i):new n(i,0).acos()},Complex:function(i){return i.acos()},BigNumber:function(i){return i.acos()}})}),Md="acosh",l3=["typed","config","Complex"],f3=U(Md,l3,e=>{var{typed:t,config:r,Complex:n}=e;return t(Md,{number:function(i){return i>=1||r.predictable?ly(i):i<=-1?new n(Math.log(Math.sqrt(i*i-1)-i),Math.PI):new n(i,0).acosh()},Complex:function(i){return i.acosh()},BigNumber:function(i){return i.acosh()}})}),_d="acot",p3=["typed","BigNumber"],m3=U(_d,p3,e=>{var{typed:t,BigNumber:r}=e;return t(_d,{number:fy,Complex:function(n){return n.acot()},BigNumber:function(n){return new r(1).div(n).atan()}})}),Fd="acoth",d3=["typed","config","Complex","BigNumber"],h3=U(Fd,d3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Fd,{number:function(a){return a>=1||a<=-1||r.predictable?py(a):new n(a,0).acoth()},Complex:function(a){return a.acoth()},BigNumber:function(a){return new i(1).div(a).atanh()}})}),Td="acsc",g3=["typed","config","Complex","BigNumber"],v3=U(Td,g3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Td,{number:function(a){return a<=-1||a>=1||r.predictable?my(a):new n(a,0).acsc()},Complex:function(a){return a.acsc()},BigNumber:function(a){return new i(1).div(a).asin()}})}),Od="acsch",y3=["typed","BigNumber"],b3=U(Od,y3,e=>{var{typed:t,BigNumber:r}=e;return t(Od,{number:dy,Complex:function(n){return n.acsch()},BigNumber:function(n){return new r(1).div(n).asinh()}})}),Bd="asec",x3=["typed","config","Complex","BigNumber"],w3=U(Bd,x3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Bd,{number:function(a){return a<=-1||a>=1||r.predictable?hy(a):new n(a,0).asec()},Complex:function(a){return a.asec()},BigNumber:function(a){return new i(1).div(a).acos()}})}),kd="asech",N3=["typed","config","Complex","BigNumber"],D3=U(kd,N3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(kd,{number:function(a){if(a<=1&&a>=-1||r.predictable){var o=1/a;if(o>0||r.predictable)return gy(a);var u=Math.sqrt(o*o-1);return new n(Math.log(u-o),Math.PI)}return new n(a,0).asech()},Complex:function(a){return a.asech()},BigNumber:function(a){return new i(1).div(a).acosh()}})}),Id="asin",E3=["typed","config","Complex"],A3=U(Id,E3,e=>{var{typed:t,config:r,Complex:n}=e;return t(Id,{number:function(i){return i>=-1&&i<=1||r.predictable?Math.asin(i):new n(i,0).asin()},Complex:function(i){return i.asin()},BigNumber:function(i){return i.asin()}})}),S3="asinh",C3=["typed"],M3=U(S3,C3,e=>{var{typed:t}=e;return t("asinh",{number:vy,Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()}})}),_3="atan",F3=["typed"],T3=U(_3,F3,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),Rd="atan2",O3=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],B3=U(Rd,O3,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=Oy({typed:t,equalScalar:n}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Rd,{"number, number":Math.atan2,"BigNumber, BigNumber":(m,d)=>i.atan2(m,d)},p({scalar:"number | BigNumber",SS:l,DS:c,SD:u,Ss:s,sS:f}))}),qd="atanh",k3=["typed","config","Complex"],I3=U(qd,k3,e=>{var{typed:t,config:r,Complex:n}=e;return t(qd,{number:function(i){return i<=1&&i>=-1||r.predictable?yy(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})}),Oa=U("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}}),zd="cos",R3=["typed"],q3=U(zd,R3,e=>{var{typed:t}=e,r=Oa({typed:t});return t(zd,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),jd="cosh",z3=["typed"],j3=U(jd,z3,e=>{var{typed:t}=e;return t(jd,{number:kN,"Complex | BigNumber":r=>r.cosh()})}),Ld="cot",L3=["typed","BigNumber"],P3=U(Ld,L3,e=>{var{typed:t,BigNumber:r}=e,n=Oa({typed:t});return t(Ld,{number:by,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)}),Pd="coth",V3=["typed","BigNumber"],U3=U(Pd,V3,e=>{var{typed:t,BigNumber:r}=e;return t(Pd,{number:xy,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),Vd="csc",$3=["typed","BigNumber"],H3=U(Vd,$3,e=>{var{typed:t,BigNumber:r}=e,n=Oa({typed:t});return t(Vd,{number:wy,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)}),Ud="csch",J3=["typed","BigNumber"],G3=U(Ud,J3,e=>{var{typed:t,BigNumber:r}=e;return t(Ud,{number:Ny,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),$d="sec",K3=["typed","BigNumber"],W3=U($d,K3,e=>{var{typed:t,BigNumber:r}=e,n=Oa({typed:t});return t($d,{number:Dy,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)}),Hd="sech",Q3=["typed","BigNumber"],Z3=U(Hd,Q3,e=>{var{typed:t,BigNumber:r}=e;return t(Hd,{number:Ey,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),Jd="sin",X3=["typed"],Y3=U(Jd,X3,e=>{var{typed:t}=e,r=Oa({typed:t});return t(Jd,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),Gd="sinh",e4=["typed"],t4=U(Gd,e4,e=>{var{typed:t}=e;return t(Gd,{number:Ay,"Complex | BigNumber":r=>r.sinh()})}),Kd="tan",r4=["typed"],n4=U(Kd,r4,e=>{var{typed:t}=e,r=Oa({typed:t});return t(Kd,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),i4="tanh",a4=["typed"],o4=U(i4,a4,e=>{var{typed:t}=e;return t("tanh",{number:RN,"Complex | BigNumber":r=>r.tanh()})}),Wd="setCartesian",s4=["typed","size","subset","compareNatural","Index","DenseMatrix"],u4=U(Wd,s4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Wd,{"Array | Matrix, Array | Matrix":function(u,c){var l=[];if(n(r(u),new a(0))!==0&&n(r(c),new a(0))!==0){var s=ot(Array.isArray(u)?u:u.toArray()).sort(i),f=ot(Array.isArray(c)?c:c.toArray()).sort(i);l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)l.push([s[p],f[m]])}return Array.isArray(u)&&Array.isArray(c)?l:new o(l)}})}),Qd="setDifference",c4=["typed","size","subset","compareNatural","Index","DenseMatrix"],l4=U(Qd,c4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Qd,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0)l=[];else{if(n(r(c),new a(0))===0)return ot(u.toArray());var s=ba(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ba(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p,m=0;m<s.length;m++){p=!1;for(var d=0;d<f.length;d++)if(i(s[m].value,f[d].value)===0&&s[m].identifier===f[d].identifier){p=!0;break}p||l.push(s[m])}}return Array.isArray(u)&&Array.isArray(c)?Ps(l):new o(Ps(l))}})}),Zd="setDistinct",f4=["typed","size","subset","compareNatural","Index","DenseMatrix"],p4=U(Zd,f4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Zd,{"Array | Matrix":function(u){var c;if(n(r(u),new a(0))===0)c=[];else{var l=ot(Array.isArray(u)?u:u.toArray()).sort(i);c=[],c.push(l[0]);for(var s=1;s<l.length;s++)i(l[s],l[s-1])!==0&&c.push(l[s])}return Array.isArray(u)?c:new o(c)}})}),Xd="setIntersect",m4=["typed","size","subset","compareNatural","Index","DenseMatrix"],d4=U(Xd,m4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Xd,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0||n(r(c),new a(0))===0)l=[];else{var s=ba(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ba(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)if(i(s[p].value,f[m].value)===0&&s[p].identifier===f[m].identifier){l.push(s[p]);break}}return Array.isArray(u)&&Array.isArray(c)?Ps(l):new o(Ps(l))}})}),Yd="setIsSubset",h4=["typed","size","subset","compareNatural","Index"],g4=U(Yd,h4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Yd,{"Array | Matrix, Array | Matrix":function(o,u){if(n(r(o),new a(0))===0)return!0;if(n(r(u),new a(0))===0)return!1;for(var c=ba(ot(Array.isArray(o)?o:o.toArray()).sort(i)),l=ba(ot(Array.isArray(u)?u:u.toArray()).sort(i)),s,f=0;f<c.length;f++){s=!1;for(var p=0;p<l.length;p++)if(i(c[f].value,l[p].value)===0&&c[f].identifier===l[p].identifier){s=!0;break}if(s===!1)return!1}return!0}})}),eh="setMultiplicity",v4=["typed","size","subset","compareNatural","Index"],y4=U(eh,v4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(eh,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(o,u){if(n(r(u),new a(0))===0)return 0;for(var c=ot(Array.isArray(u)?u:u.toArray()),l=0,s=0;s<c.length;s++)i(c[s],o)===0&&l++;return l}})}),th="setPowerset",b4=["typed","size","subset","compareNatural","Index"],x4=U(th,b4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(th,{"Array | Matrix":function(c){if(n(r(c),new a(0))===0)return[];for(var l=ot(Array.isArray(c)?c:c.toArray()).sort(i),s=[],f=0;f.toString(2).length<=l.length;)s.push(o(l,f.toString(2).split("").reverse())),f++;return u(s)}});function o(c,l){for(var s=[],f=0;f<l.length;f++)l[f]==="1"&&s.push(c[f]);return s}function u(c){for(var l=[],s=c.length-1;s>0;s--)for(var f=0;f<s;f++)c[f].length>c[f+1].length&&(l=c[f],c[f]=c[f+1],c[f+1]=l);return c}}),rh="setSize",w4=["typed","compareNatural"],N4=U(rh,w4,e=>{var{typed:t,compareNatural:r}=e;return t(rh,{"Array | Matrix":function(n){return Array.isArray(n)?ot(n).length:ot(n.toArray()).length},"Array | Matrix, boolean":function(n,i){if(i===!1||n.length===0)return Array.isArray(n)?ot(n).length:ot(n.toArray()).length;for(var a=ot(Array.isArray(n)?n:n.toArray()).sort(r),o=1,u=1;u<a.length;u++)r(a[u],a[u-1])!==0&&o++;return o}})}),nh="setSymDifference",D4=["typed","size","concat","subset","setDifference","Index"],E4=U(nh,D4,e=>{var{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(nh,{"Array | Matrix, Array | Matrix":function(u,c){if(i(r(u),new o(0))===0)return ot(c);if(i(r(c),new o(0))===0)return ot(u);var l=ot(u),s=ot(c);return n(a(l,s),a(s,l))}})}),ih="setUnion",A4=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],S4=U(ih,A4,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:u}=e;return t(ih,{"Array | Matrix, Array | Matrix":function(c,l){if(i(r(c),new u(0))===0)return ot(l);if(i(r(l),new u(0))===0)return ot(c);var s=ot(c),f=ot(l);return n(o(s,f),a(s,f))}})}),ah="add",C4=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],M4=U(ah,C4,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,c=ii({typed:t}),l=kl({typed:t,equalScalar:i}),s=Li({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:r,concat:u});return t(ah,{"any, any":n,"any, any, ...any":t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w})},f({elop:n,DS:c,SS:l,Ss:s}))}),oh="hypot",_4=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],F4=U(oh,_4,e=>{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:u,isPositive:c}=e;return t(oh,{"... number | BigNumber":l,Array:l,Matrix:s=>l(ot(s.toArray()))});function l(s){for(var f=0,p=0,m=0;m<s.length;m++){if(wn(s[m]))throw new TypeError("Unexpected type of argument to hypot");var d=r(s[m]);u(p,d)?(f=a(f,a(i(p,d),i(p,d))),f=n(f,1),p=d):f=n(f,c(d)?a(i(d,p),i(d,p)):d)}return a(p,o(f))}}),sh="norm",T4=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],O4=U(sh,T4,e=>{var{typed:t,abs:r,add:n,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:c,larger:l,smaller:s,matrix:f,ctranspose:p,eigs:m}=e;return t(sh,{number:Math.abs,Complex:function(E){return E.abs()},BigNumber:function(E){return E.abs()},boolean:function(E){return Math.abs(E)},Array:function(E){return N(f(E),2)},Matrix:function(E){return N(E,2)},"Array, number | BigNumber | string":function(E,A){return N(f(E),A)},"Matrix, number | BigNumber | string":function(E,A){return N(E,A)}});function d(E){var A=0;return E.forEach(function(D){var S=r(D);l(S,A)&&(A=S)},!0),A}function h(E){var A;return E.forEach(function(D){var S=r(D);(!A||s(S,A))&&(A=S)},!0),A||0}function w(E,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return d(E);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return h(E);if(A==="fro")return N(E,2);if(typeof A=="number"&&!isNaN(A)){if(!c(A,0)){var D=0;return E.forEach(function(S){D=n(i(r(S),A),D)},!0),i(D,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function v(E){var A=0;return E.forEach(function(D,S){A=n(A,u(D,a(D)))}),r(o(A))}function x(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[1],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function g(E){var A=E.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var D=p(E),S=u(D,E),C=m(S).values.toArray(),_=C[C.length-1];return r(o(_))}function b(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[0],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function y(E,A){if(A===1)return x(E);if(A===Number.POSITIVE_INFINITY||A==="inf")return b(E);if(A==="fro")return v(E);if(A===2)return g(E);throw new Error("Unsupported parameter value "+A)}function N(E,A){var D=E.size();if(D.length===1)return w(E,A);if(D.length===2){if(D[0]&&D[1])return y(E,A);throw new RangeError("Invalid matrix dimensions")}}}),uh="dot",B4=["typed","addScalar","multiplyScalar","conj","size"],k4=U(uh,B4,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:a}=e;return t(uh,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":c});function o(s,f){var p=l(s),m=l(f),d,h;if(p.length===1)d=p[0];else if(p.length===2&&p[1]===1)d=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(m.length===1)h=m[0];else if(m.length===2&&m[1]===1)h=m[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+m.join(", ")+")");if(d!==h)throw new RangeError("Vectors must have equal length ("+d+" != "+h+")");if(d===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return d}function u(s,f){var p=o(s,f),m=ke(s)?s._data:s,d=ke(s)?s._datatype||s.getDataType():void 0,h=ke(f)?f._data:f,w=ke(f)?f._datatype||f.getDataType():void 0,v=l(s).length===2,x=l(f).length===2,g=r,b=n;if(d&&w&&d===w&&typeof d=="string"&&d!=="mixed"){var y=d;g=t.find(r,[y,y]),b=t.find(n,[y,y])}if(!v&&!x){for(var N=b(i(m[0]),h[0]),E=1;E<p;E++)N=g(N,b(i(m[E]),h[E]));return N}if(!v&&x){for(var A=b(i(m[0]),h[0][0]),D=1;D<p;D++)A=g(A,b(i(m[D]),h[D][0]));return A}if(v&&!x){for(var S=b(i(m[0][0]),h[0]),C=1;C<p;C++)S=g(S,b(i(m[C][0]),h[C]));return S}if(v&&x){for(var _=b(i(m[0][0]),h[0][0]),R=1;R<p;R++)_=g(_,b(i(m[R][0]),h[R][0]));return _}}function c(s,f){o(s,f);for(var p=s._index,m=s._values,d=f._index,h=f._values,w=0,v=r,x=n,g=0,b=0;g<p.length&&b<d.length;){var y=p[g],N=d[b];if(y<N){g++;continue}if(y>N){b++;continue}y===N&&(w=v(w,x(m[g],h[b])),g++,b++)}return w}function l(s){return ke(s)?s.size():a(s)}}),I4="trace",R4=["typed","matrix","add"],q4=U(I4,R4,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(o){return i(r(o))},SparseMatrix:a,DenseMatrix:i,any:ze});function i(o){var u=o._size,c=o._data;switch(u.length){case 1:if(u[0]===1)return ze(c[0]);throw new RangeError("Matrix must be square (size: "+Ge(u)+")");case 2:{var l=u[0],s=u[1];if(l===s){for(var f=0,p=0;p<l;p++)f=n(f,c[p][p]);return f}else throw new RangeError("Matrix must be square (size: "+Ge(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(u)+")")}}function a(o){var u=o._values,c=o._index,l=o._ptr,s=o._size,f=s[0],p=s[1];if(f===p){var m=0;if(u.length>0)for(var d=0;d<p;d++)for(var h=l[d],w=l[d+1],v=h;v<w;v++){var x=c[v];if(x===d){m=n(m,u[v]);break}if(x>d)break}return m}throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}}),ch="index",z4=["typed","Index"],j4=U(ch,z4,e=>{var{typed:t,Index:r}=e;return t(ch,{"...number | string | BigNumber | Range | Array | Matrix":function(n){var i=n.map(function(o){return $e(o)?o.toNumber():st(o)||ke(o)?o.map(function(u){return $e(u)?u.toNumber():u}):o}),a=new r;return r.apply(a,i),a}})}),Wy=new Set(["end"]),L4="Node",P4=["mathWithTransform"],V4=U(L4,P4,e=>{var{mathWithTransform:t}=e;function r(i){for(var a of[...Wy])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(t,{}),o={},u=null;function c(l){var s=ua(l);return r(s),a(s,o,u)}return{evaluate:c}}_compile(a,o){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!ft(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function o(u,c){u.forEach(function(l,s,f){c(l,s,f),o(l,c)})}o(this,a)}transform(a){function o(u,c,l){var s=a(u,c,l);return s!==u?s:u.map(o)}return o(this,null,null)}filter(a){var o=[];return this.traverse(function(u,c,l){a(u,c,l)&&o.push(u)}),o}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&ki(this,a):!1}toString(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lr(e){return e&&e.isIndexError?new $r(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function Qy(e){var{subset:t}=e;return function(r,n){try{if(Array.isArray(r))return t(r,n);if(r&&typeof r.subset=="function")return r.subset(n);if(typeof r=="string")return t(r,n);if(typeof r=="object"){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return nr(r,n.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw lr(i)}}}var Wo="AccessorNode",U4=["subset","Node"],$4=U(Wo,U4,e=>{var{subset:t,Node:r}=e,n=Qy({subset:t});function i(o){return!(Bi(o)||Sr(o)||nt(o)||Zn(o)||yu(o)||An(o)||zt(o))}class a extends r{constructor(u,c){if(super(),!ft(u))throw new TypeError('Node expected for parameter "object"');if(!Sa(c))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=c}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Wo}get isAccessorNode(){return!0}_compile(u,c){var l=this.object._compile(u,c),s=this.index._compile(u,c);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,m,d){return nr(l(p,m,d),f)}}else return function(p,m,d){var h=l(p,m,d),w=s(p,m,h);return n(h,w)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new a(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(u){var c=this.object.toString(u);return i(this.object)&&(c="("+c+")"),c+this.index.toString(u)}_toHTML(u){var c=this.object.toHTML(u);return i(this.object)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+this.index.toHTML(u)}_toTex(u){var c=this.object.toTex(u);return i(this.object)&&(c="\\left(' + object + '\\right)"),c+this.index.toTex(u)}toJSON(){return{mathjs:Wo,object:this.object,index:this.index}}static fromJSON(u){return new a(u.object,u.index)}}return kt(a,"name",Wo),a},{isClass:!0,isNode:!0}),Qo="ArrayNode",H4=["Node"],J4=U(Qo,H4,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(ft))throw new TypeError("Array containing Nodes expected")}get type(){return Qo}get isArrayNode(){return!0}_compile(i,a){var o=Nn(this.items,function(l){return l._compile(i,a)}),u=i.config.matrix!=="Array";if(u){var c=i.matrix;return function(l,s,f){return c(Nn(o,function(p){return p(l,s,f)}))}}else return function(l,s,f){return Nn(o,function(p){return p(l,s,f)})}}forEach(i){for(var a=0;a<this.items.length;a++){var o=this.items[a];i(o,"items["+a+"]",this)}}map(i){for(var a=[],o=0;o<this.items.length;o++)a[o]=this._ifNode(i(this.items[o],"items["+o+"]",this));return new r(a)}clone(){return new r(this.items.slice(0))}_toString(i){var a=this.items.map(function(o){return o.toString(i)});return"["+a.join(", ")+"]"}toJSON(){return{mathjs:Qo,items:this.items}}static fromJSON(i){return new r(i.items)}_toHTML(i){var a=this.items.map(function(o){return o.toHTML(i)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(i){function a(o,u){var c=o.some(Sr)&&!o.every(Sr),l=u||c,s=l?"&":"\\\\",f=o.map(function(p){return p.items?a(p.items,!u):p.toTex(i)}).join(s);return c||!l||l&&!u?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return a(this.items,!1)}}return kt(r,"name",Qo),r},{isClass:!0,isNode:!0});function G4(e){var{subset:t,matrix:r}=e;return function(n,i,a){try{if(Array.isArray(n)){var o=r(n).subset(i,a).valueOf();return o.forEach((u,c)=>{n[c]=u}),n}else{if(n&&typeof n.subset=="function")return n.subset(i,a);if(typeof n=="string")return t(n,i,a);if(typeof n=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return ha(n,i.getObjectProperty(),a),n}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw lr(u)}}}var Ir=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Zo(e,t){if(!t||t!=="auto")return e;for(var r=e;An(r);)r=r.content;return r}function mt(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,u=0;u<Ir.length;u++)if(a in Ir[u]){o=u;break}if(a==="OperatorNode:multiply"&&i.implicit&&r!=="show"){var c=Zo(i.args[0],t);!(nt(c)&&n&&n.getIdentifier()==="OperatorNode:divide"&&qc(Zo(n.args[0],t)))&&!(c.getIdentifier()==="OperatorNode:divide"&&qc(Zo(c.args[0],t))&&nt(Zo(c.args[1])))&&(o+=1)}return o}function Ka(e,t){var r=e;t!=="keep"&&(r=e.getContent());var n=r.getIdentifier(),i=mt(r,t);if(i===null)return null;var a=Ir[i][n];if(Me(a,"associativity")){if(a.associativity==="left")return"left";if(a.associativity==="right")return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function vc(e,t,r){var n=r!=="keep"?e.getContent():e,i=r!=="keep"?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),u=mt(n,r);if(u===null)return null;var c=Ir[u][a];if(Me(c,"associativeWith")&&c.associativeWith instanceof Array){for(var l=0;l<c.associativeWith.length;l++)if(c.associativeWith[l]===o)return!0;return!1}return null}function K4(e){var t="OperatorNode:"+e;for(var r of Ir)if(t in r)return r[t].op;return null}var Xo="AssignmentNode",W4=["subset","?matrix","Node"],Q4=U(Xo,W4,e=>{var{subset:t,matrix:r,Node:n}=e,i=Qy({subset:t}),a=G4({subset:t,matrix:r});function o(c,l,s){l||(l="keep");var f=mt(c,l,s),p=mt(c.value,l,s);return l==="all"||p!==null&&p<=f}class u extends n{constructor(l,s,f){if(super(),this.object=l,this.index=f?s:null,this.value=f||s,!zt(l)&&!Bi(l))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(zt(l)&&l.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Sa(this.index))throw new TypeError('IndexNode expected as "index"');if(!ft(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Xo}get isAssignmentNode(){return!0}_compile(l,s){var f=this.object._compile(l,s),p=this.index?this.index._compile(l,s):null,m=this.value._compile(l,s),d=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(g,b,y){var N=f(g,b,y),E=m(g,b,y);return ha(N,h,E),E}}else{if(zt(this.object))return function(g,b,y){var N=f(g,b,y),E=m(g,b,y),A=p(g,b,N);return g.set(d,a(N,A,E)),E};var w=this.object.object._compile(l,s);if(this.object.index.isObjectProperty()){var v=this.object.index.getObjectProperty();return function(g,b,y){var N=w(g,b,y),E=nr(N,v),A=p(g,b,E),D=m(g,b,y);return ha(N,v,a(E,A,D)),D}}else{var x=this.object.index._compile(l,s);return function(g,b,y){var N=w(g,b,y),E=x(g,b,N),A=i(N,E),D=p(g,b,A),S=m(g,b,y);return a(N,E,a(A,D,S)),S}}}else{if(!zt(this.object))throw new TypeError("SymbolNode expected as object");return function(g,b,y){var N=m(g,b,y);return g.set(d,N),N}}}forEach(l){l(this.object,"object",this),this.index&&l(this.index,"index",this),l(this.value,"value",this)}map(l){var s=this._ifNode(l(this.object,"object",this)),f=this.index?this._ifNode(l(this.index,"index",this)):null,p=this._ifNode(l(this.value,"value",this));return new u(s,f,p)}clone(){return new u(this.object,this.index,this.value)}_toString(l){var s=this.object.toString(l),f=this.index?this.index.toString(l):"",p=this.value.toString(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="("+p+")"),s+f+" = "+p}toJSON(){return{mathjs:Xo,object:this.object,index:this.index,value:this.value}}static fromJSON(l){return new u(l.object,l.index,l.value)}_toHTML(l){var s=this.object.toHTML(l),f=this.index?this.index.toHTML(l):"",p=this.value.toHTML(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p='<span class="math-paranthesis math-round-parenthesis">(</span>'+p+'<span class="math-paranthesis math-round-parenthesis">)</span>'),s+f+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+p}_toTex(l){var s=this.object.toTex(l),f=this.index?this.index.toTex(l):"",p=this.value.toTex(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="\\left(".concat(p,"\\right)")),s+f+"="+p}}return kt(u,"name",Xo),u},{isClass:!0,isNode:!0}),Yo="BlockNode",Z4=["ResultSet","Node"],X4=U(Yo,Z4,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(o){var u=o&&o.node,c=o&&o.visible!==void 0?o.visible:!0;if(!ft(u))throw new TypeError('Property "node" must be a Node');if(typeof c!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:c}})}get type(){return Yo}get isBlockNode(){return!0}_compile(a,o){var u=Nn(this.blocks,function(c){return{evaluate:c.node._compile(a,o),visible:c.visible}});return function(c,l,s){var f=[];return Eu(u,function(p){var m=p.evaluate(c,l,s);p.visible&&f.push(m)}),new t(f)}}forEach(a){for(var o=0;o<this.blocks.length;o++)a(this.blocks[o].node,"blocks["+o+"].node",this)}map(a){for(var o=[],u=0;u<this.blocks.length;u++){var c=this.blocks[u],l=this._ifNode(a(c.node,"blocks["+u+"].node",this));o[u]={node:l,visible:c.visible}}return new n(o)}clone(){var a=this.blocks.map(function(o){return{node:o.node,visible:o.visible}});return new n(a)}_toString(a){return this.blocks.map(function(o){return o.node.toString(a)+(o.visible?"":";")}).join(`
|
|
29
|
+
`)}toJSON(){return{mathjs:Yo,blocks:this.blocks}}static fromJSON(a){return new n(a.blocks)}_toHTML(a){return this.blocks.map(function(o){return o.node.toHTML(a)+(o.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(a){return this.blocks.map(function(o){return o.node.toTex(a)+(o.visible?"":";")}).join(`\\;\\;
|
|
30
|
+
`)}}return kt(n,"name",Yo),n},{isClass:!0,isNode:!0}),es="ConditionalNode",Y4=["Node"],eF=U(es,Y4,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if($e(i))return!i.isZero();if(wn(i))return!!(i.re||i.im);if(Cr(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+dt(i)+'"')}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Parameter condition must be a Node");if(!ft(o))throw new TypeError("Parameter trueExpr must be a Node");if(!ft(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=o,this.falseExpr=u}get type(){return es}get isConditionalNode(){return!0}_compile(a,o){var u=this.condition._compile(a,o),c=this.trueExpr._compile(a,o),l=this.falseExpr._compile(a,o);return function(s,f,p){return r(u(s,f,p))?c(s,f,p):l(s,f,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toString(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c="("+c+")");var s=this.trueExpr.toString(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s="("+s+")");var p=this.falseExpr.toString(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p="("+p+")"),c+" ? "+s+" : "+p}toJSON(){return{mathjs:es,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toHTML(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.trueExpr.toHTML(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');var p=this.falseExpr.toHTML(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+p}_toTex(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return kt(n,"name",es),n},{isClass:!0,isNode:!0}),Wc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tF={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},rF={"–":"\\--","—":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},nF=function(e,t){return Wc({},e,t)},iF=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,a=i===void 0?nF:i,o=String(e),u="",c=a(Wc({},tF),n?Wc({},rF):{}),l=Object.keys(c),s=function(){var f=!1;l.forEach(function(p,m){f||o.length>=p.length&&o.slice(0,p.length)===p&&(u+=c[l[m]],o=o.slice(p.length,o.length),f=!0)}),f||(u+=o.slice(0,1),o=o.slice(1,o.length))};o;)s();return u};const aF=So(iF);var Qc={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},at={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},lh={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(at.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(at.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(at.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(at.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(at.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(at.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(at.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(at.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(at.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(at.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(at.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(at.bitAnd,"${args[1]}\\right)")},bitNot:{1:at.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(at.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(at.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(at.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(at.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(at.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(at.and,"${args[1]}\\right)")},not:{1:at.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(at.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(at.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(at.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(at.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(at.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(at.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(at.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(at.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(at.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(at.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(at.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(at.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(at.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Qc.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},oF="\\mathrm{${name}}\\left(${args}\\right)",fh={deg:"^\\circ"};function Zc(e){return aF(e,{preserveFormatting:!0})}function Zy(e,t){return t=typeof t>"u"?!1:t,t?Me(fh,e)?fh[e]:"\\mathrm{"+Zc(e)+"}":Me(Qc,e)?Qc[e]:Zc(e)}var ts="ConstantNode",sF=["Node"],uF=U(ts,sF,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return ts}get isConstantNode(){return!0}_compile(i,a){var o=this.value;return function(){return o}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Ge(this.value,i)}_toHTML(i){var a=this._toString(i);switch(dt(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+a+"</span>";case"string":return'<span class="math-string">'+a+"</span>";case"boolean":return'<span class="math-boolean">'+a+"</span>";case"null":return'<span class="math-null-symbol">'+a+"</span>";case"undefined":return'<span class="math-undefined">'+a+"</span>";default:return'<span class="math-symbol">'+a+"</span>"}}toJSON(){return{mathjs:ts,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var a=this._toString(i),o=dt(this.value);switch(o){case"string":return"\\mathtt{"+Zc(a)+"}";case"number":case"BigNumber":{var u=o==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var c=a.toLowerCase().indexOf("e");return c!==-1?a.substring(0,c)+"\\cdot10^{"+a.substring(c+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return kt(r,"name",ts),r},{isClass:!0,isNode:!0}),rs="FunctionAssignmentNode",cF=["typed","Node"],lF=U(rs,cF,e=>{var{typed:t,Node:r}=e;function n(a,o,u){var c=mt(a,o,u),l=mt(a.expr,o,u);return o==="all"||l!==null&&l<=c}class i extends r{constructor(o,u,c){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!ft(c))throw new TypeError('Node expected for parameter "expr"');if(Wy.has(o))throw new Error('Illegal function name, "'+o+'" is a reserved keyword');var l=new Set;for(var s of u){var f=typeof s=="string"?s:s.name;if(l.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));l.add(f)}this.name=o,this.params=u.map(function(p){return p&&p.name||p}),this.types=u.map(function(p){return p&&p.type||"any"}),this.expr=c}get type(){return rs}get isFunctionAssignmentNode(){return!0}_compile(o,u){var c=Object.create(u);Eu(this.params,function(d){c[d]=!0});var l=this.expr._compile(o,c),s=this.name,f=this.params,p=fp(this.types,","),m=s+"("+fp(this.params,", ")+")";return function(d,h,w){var v={};v[p]=function(){for(var g=Object.create(h),b=0;b<f.length;b++)g[f[b]]=arguments[b];return l(d,g,w)};var x=t(s,v);return x.syntax=m,d.set(s,x),x}}forEach(o){o(this.expr,"expr",this)}map(o){var u=this._ifNode(o(this.expr,"expr",this));return new i(this.name,this.params.slice(0),u)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toString(o);return n(this,u,o&&o.implicit)&&(c="("+c+")"),this.name+"("+this.params.join(", ")+") = "+c}toJSON(){var o=this.types;return{mathjs:rs,name:this.name,params:this.params.map(function(u,c){return{name:u,type:o[c]}}),expr:this.expr}}static fromJSON(o){return new i(o.name,o.params,o.expr)}_toHTML(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",c=[],l=0;l<this.params.length;l++)c.push('<span class="math-symbol math-parameter">'+Mr(this.params[l])+"</span>");var s=this.expr.toHTML(o);return n(this,u,o&&o.implicit)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Mr(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+c.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+s}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toTex(o);return n(this,u,o&&o.implicit)&&(c="\\left(".concat(c,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Zy).join(",")+"\\right)="+c}}return kt(i,"name",rs),i},{isClass:!0,isNode:!0}),ns="IndexNode",fF=["Node","size"],pF=U(ns,fF,e=>{var{Node:t,size:r}=e;class n extends t{constructor(a,o){if(super(),this.dimensions=a,this.dotNotation=o||!1,!Array.isArray(a)||!a.every(ft))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return ns}get isIndexNode(){return!0}_compile(a,o){var u=Nn(this.dimensions,function(l,s){var f=l.filter(d=>d.isSymbolNode&&d.name==="end").length>0;if(f){var p=Object.create(o);p.end=!0;var m=l._compile(a,p);return function(d,h,w){if(!ke(w)&&!st(w)&&!Qt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+dt(w));var v=r(w).valueOf(),x=Object.create(h);return x.end=v[s],m(d,x,w)}}else return l._compile(a,o)}),c=nr(a,"index");return function(l,s,f){var p=Nn(u,function(m){return m(l,s,f)});return c(...p)}}forEach(a){for(var o=0;o<this.dimensions.length;o++)a(this.dimensions[o],"dimensions["+o+"]",this)}map(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this._ifNode(a(this.dimensions[u],"dimensions["+u+"]",this));return new n(o,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&nt(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(a){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:ns,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(a){return new n(a.dimensions,a.dotNotation)}_toHTML(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this.dimensions[u].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Mr(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+o.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(a){var o=this.dimensions.map(function(u){return u.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+o.join(",")+"}"}}return kt(n,"name",ns),n},{isClass:!0,isNode:!0}),is="ObjectNode",mF=["Node"],dF=U(is,mF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return ft(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return is}get isObjectNode(){return!0}_compile(i,a){var o={};for(var u in this.properties)if(Me(this.properties,u)){var c=oa(u),l=JSON.parse(c),s=nr(this.properties,u);o[l]=s._compile(i,a)}return function(f,p,m){var d={};for(var h in o)Me(o,h)&&(d[h]=o[h](f,p,m));return d}}forEach(i){for(var a in this.properties)Me(this.properties,a)&&i(this.properties[a],"properties["+oa(a)+"]",this)}map(i){var a={};for(var o in this.properties)Me(this.properties,o)&&(a[o]=this._ifNode(i(this.properties[o],"properties["+oa(o)+"]",this)));return new r(a)}clone(){var i={};for(var a in this.properties)Me(this.properties,a)&&(i[a]=this.properties[a]);return new r(i)}_toString(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push(oa(o)+": "+this.properties[o].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:is,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push('<span class="math-symbol math-property">'+Mr(o)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[o].toHTML(i));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push("\\mathbf{"+o+":} & "+this.properties[o].toTex(i)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+a.join(`
|
|
31
|
+
`)+"\\end{array}\\right\\}";return u}}return kt(r,"name",is),r},{isClass:!0,isNode:!0});function ro(e,t){return new sv(e,new xu(t),new Set(Object.keys(t)))}var as="OperatorNode",hF=["Node"],gF=U(as,hF,e=>{var{Node:t}=e;function r(a,o){var u=a;if(o==="auto")for(;An(u);)u=u.content;return nt(u)?!0:Ct(u)?r(u.args[0],o):!1}function n(a,o,u,c,l){var s=mt(a,o,u),f=Ka(a,o);if(o==="all"||c.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return c.map(function(S){switch(S.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var p;switch(c.length){case 0:p=[];break;case 1:{var m=mt(c[0],o,u,a);if(l&&m!==null){var d,h;if(o==="keep"?(d=c[0].getIdentifier(),h=a.getIdentifier()):(d=c[0].getContent().getIdentifier(),h=a.getContent().getIdentifier()),Ir[s][h].latexLeftParens===!1){p=[!1];break}if(Ir[m][d].latexParens===!1){p=[!1];break}}if(m===null){p=[!1];break}if(m<=s){p=[!0];break}p=[!1]}break;case 2:{var w,v=mt(c[0],o,u,a),x=vc(a,c[0],o);v===null?w=!1:v===s&&f==="right"&&!x||v<s?w=!0:w=!1;var g,b=mt(c[1],o,u,a),y=vc(a,c[1],o);if(b===null?g=!1:b===s&&f==="left"&&!y||b<s?g=!0:g=!1,l){var N,E,A;o==="keep"?(N=a.getIdentifier(),E=a.args[0].getIdentifier(),A=a.args[1].getIdentifier()):(N=a.getContent().getIdentifier(),E=a.args[0].getContent().getIdentifier(),A=a.args[1].getContent().getIdentifier()),v!==null&&(Ir[s][N].latexLeftParens===!1&&(w=!1),Ir[v][E].latexParens===!1&&(w=!1)),b!==null&&(Ir[s][N].latexRightParens===!1&&(g=!1),Ir[b][A].latexParens===!1&&(g=!1))}p=[w,g]}break;default:(a.getIdentifier()==="OperatorNode:add"||a.getIdentifier()==="OperatorNode:multiply")&&(p=c.map(function(S){var C=mt(S,o,u,a),_=vc(a,S,o),R=Ka(S,o);return C===null?!1:s===C&&f===R&&!_?!0:C<s}));break}if(c.length>=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&o!=="all"&&u==="hide")for(var D=1;D<p.length;++D)r(c[D],o)&&!p[D-1]&&(o!=="keep"||!An(c[D-1]))&&(p[D]=!0);return p}class i extends t{constructor(o,u,c,l,s){if(super(),typeof o!="string")throw new TypeError('string expected for parameter "op"');if(typeof u!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(c)||!c.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=l===!0,this.isPercentage=s===!0,this.op=o,this.fn=u,this.args=c||[]}get type(){return as}get isOperatorNode(){return!0}_compile(o,u){if(typeof this.fn!="string"||!Ml(o,this.fn))throw o[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var c=nr(o,this.fn),l=Nn(this.args,function(d){return d._compile(o,u)});if(typeof c=="function"&&c.rawArgs===!0){var s=this.args;return function(d,h,w){return c(s,o,ro(d,h))}}else if(l.length===1){var f=l[0];return function(d,h,w){return c(f(d,h,w))}}else if(l.length===2){var p=l[0],m=l[1];return function(d,h,w){return c(p(d,h,w),m(d,h,w))}}else return function(d,h,w){return c.apply(null,Nn(l,function(v){return v(d,h,w)}))}}forEach(o){for(var u=0;u<this.args.length;u++)o(this.args[u],"args["+u+"]",this)}map(o){for(var u=[],c=0;c<this.args.length;c++)u[c]=this._ifNode(o(this.args[c],"args["+c+"]",this));return new i(this.op,this.fn,u,this.implicit,this.isPercentage)}clone(){return new i(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return this.args.length===1}isBinary(){return this.args.length===2}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=Ka(this,u),p=l[0].toString(o);s[0]&&(p="("+p+")");var m=/[a-zA-Z]+/.test(this.op);return f==="right"?this.op+(m?" ":"")+p:f==="left"?p+(m?" ":"")+this.op:p+this.op}else if(l.length===2){var d=l[0].toString(o),h=l[1].toString(o);return s[0]&&(d="("+d+")"),s[1]&&(h="("+h+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?d+" "+h:d+" "+this.op+" "+h}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var w=l.map(function(v,x){return v=v.toString(o),s[x]&&(v="("+v+")"),v});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?w.join(" "):w.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:as,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(o){return new i(o.op,o.fn,o.args,o.implicit,o.isPercentage)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=Ka(this,u),p=l[0].toHTML(o);return s[0]&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),f==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Mr(this.op)+"</span>"+p:p+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Mr(this.op)+"</span>"}else if(l.length===2){var m=l[0].toHTML(o),d=l[1].toHTML(o);return s[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),s[1]&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?m+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+d:m+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"+d}else{var h=l.map(function(w,v){return w=w.toHTML(o),s[v]&&(w='<span class="math-parenthesis math-round-parenthesis">(</span>'+w+'<span class="math-parenthesis math-round-parenthesis">)</span>'),w});return l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?h.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):h.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"):'<span class="math-function">'+Mr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+h.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!0),f=at[this.fn];if(f=typeof f>"u"?this.op:f,l.length===1){var p=Ka(this,u),m=l[0].toTex(o);return s[0]&&(m="\\left(".concat(m,"\\right)")),p==="right"?f+m:m+f}else if(l.length===2){var d=l[0],h=d.toTex(o);s[0]&&(h="\\left(".concat(h,"\\right)"));var w=l[1],v=w.toTex(o);s[1]&&(v="\\left(".concat(v,"\\right)"));var x;switch(u==="keep"?x=d.getIdentifier():x=d.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+h+"}{"+v+"}";case"OperatorNode:pow":switch(h="{"+h+"}",v="{"+v+"}",x){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&c==="hide")return h+"~"+v}return h+f+v}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=l.map(function(b,y){return b=b.toTex(o),s[y]&&(b="\\left(".concat(b,"\\right)")),b});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&c==="hide"?g.join("~"):g.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+l.map(function(b){return b.toTex(o)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return kt(i,"name",as),i},{isClass:!0,isNode:!0}),os="ParenthesisNode",vF=["Node"],yF=U(os,vF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!ft(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return os}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new r(a)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:os,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(i)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return kt(r,"name",os),r},{isClass:!0,isNode:!0}),ss="RangeNode",bF=["Node"],xF=U(ss,bF,e=>{var{Node:t}=e;function r(i,a,o){var u=mt(i,a,o),c={},l=mt(i.start,a,o);if(c.start=l!==null&&l<=u||a==="all",i.step){var s=mt(i.step,a,o);c.step=s!==null&&s<=u||a==="all"}var f=mt(i.end,a,o);return c.end=f!==null&&f<=u||a==="all",c}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Node expected");if(!ft(o))throw new TypeError("Node expected");if(u&&!ft(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=o,this.step=u||null}get type(){return ss}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(o){return zt(o)&&o.name==="end"});return a.length>0}_compile(a,o){var u=a.range,c=this.start._compile(a,o),l=this.end._compile(a,o);if(this.step){var s=this.step._compile(a,o);return function(f,p,m){return u(c(f,p,m),l(f,p,m),s(f,p,m))}}else return function(f,p,m){return u(c(f,p,m),l(f,p,m))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toString(a);if(u.start&&(l="("+l+")"),c=l,this.step){var s=this.step.toString(a);u.step&&(s="("+s+")"),c+=":"+s}var f=this.end.toString(a);return u.end&&(f="("+f+")"),c+=":"+f,c}toJSON(){return{mathjs:ss,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toHTML(a);if(u.start&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c=l,this.step){var s=this.step.toHTML(a);u.step&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+s}var f=this.end.toHTML(a);return u.end&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+f,c}_toTex(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c=this.start.toTex(a);if(u.start&&(c="\\left(".concat(c,"\\right)")),this.step){var l=this.step.toTex(a);u.step&&(l="\\left(".concat(l,"\\right)")),c+=":"+l}var s=this.end.toTex(a);return u.end&&(s="\\left(".concat(s,"\\right)")),c+=":"+s,c}}return kt(n,"name",ss),n},{isClass:!0,isNode:!0}),us="RelationalNode",wF=["Node"],NF=U(us,wF,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(a,o){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(o))throw new TypeError("Parameter params must be an array");if(a.length!==o.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=o}get type(){return us}get isRelationalNode(){return!0}_compile(a,o){var u=this,c=this.params.map(l=>l._compile(a,o));return function(l,s,f){for(var p,m=c[0](l,s,f),d=0;d<u.conditionals.length;d++){p=m,m=c[d+1](l,s,f);var h=nr(a,u.conditionals[d]);if(!h(p,m))return!1}return!0}}forEach(a){this.params.forEach((o,u)=>a(o,"params["+u+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((o,u)=>this._ifNode(a(o,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"("+f.toString(a)+")":f.toString(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=" "+r[this.conditionals[s]],l+=" "+c[s+1];return l}toJSON(){return{mathjs:us,conditionals:this.conditionals,params:this.params}}static fromJSON(a){return new n(a.conditionals,a.params)}_toHTML(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?'<span class="math-parenthesis math-round-parenthesis">(</span>'+f.toHTML(a)+'<span class="math-parenthesis math-round-parenthesis">)</span>':f.toHTML(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(r[this.conditionals[s]])+"</span>"+c[s+1];return l}_toTex(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"\\left("+f.toTex(a)+"\right)":f.toTex(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=at[this.conditionals[s]]+c[s+1];return l}}return kt(n,"name",us),n},{isClass:!0,isNode:!0}),DF="SymbolNode",EF=["math","?Unit","Node"],AF=U(DF,EF,e=>{var{math:t,Unit:r,Node:n}=e;function i(o){return r?r.isValuelessUnit(o):!1}class a extends n{constructor(u){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');this.name=u}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(u,c){var l=this.name;if(c[l]===!0)return function(f,p,m){return nr(p,l)};if(l in u)return function(f,p,m){return f.has(l)?f.get(l):nr(u,l)};var s=i(l);return function(f,p,m){return f.has(l)?f.get(l):s?new r(null,l):a.onUndefinedSymbol(l)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new a(this.name)}_toString(u){return this.name}_toHTML(u){var c=Mr(this.name);return c==="true"||c==="false"?'<span class="math-symbol math-boolean">'+c+"</span>":c==="i"?'<span class="math-symbol math-imaginary-symbol">'+c+"</span>":c==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+c+"</span>":c==="NaN"?'<span class="math-symbol math-nan-symbol">'+c+"</span>":c==="null"?'<span class="math-symbol math-null-symbol">'+c+"</span>":c==="undefined"?'<span class="math-symbol math-undefined-symbol">'+c+"</span>":'<span class="math-symbol">'+c+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new a(u.name)}_toTex(u){var c=!1;typeof t[this.name]>"u"&&i(this.name)&&(c=!0);var l=Zy(this.name,c);return l[0]==="\\"?l:" "+l}}return a},{isClass:!0,isNode:!0}),cs="FunctionNode",SF=["math","Node","SymbolNode"],CF=U(cs,SF,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,a=c=>Ge(c,{truncate:78});function o(c,l,s){for(var f="",p=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,m=0,d;(d=p.exec(c))!==null;)if(f+=c.substring(m,d.index),m=d.index,d[0]==="$$")f+="$",m++;else{m+=d[0].length;var h=l[d[1]];if(!h)throw new ReferenceError("Template: Property "+d[1]+" does not exist.");if(d[2]===void 0)switch(typeof h){case"string":f+=h;break;case"object":if(ft(h))f+=h.toTex(s);else if(Array.isArray(h))f+=h.map(function(w,v){if(ft(w))return w.toTex(s);throw new TypeError("Template: "+d[1]+"["+v+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes")}else if(ft(h[d[2]]&&h[d[2]]))f+=h[d[2]].toTex(s);else throw new TypeError("Template: "+d[1]+"["+d[2]+"] is not a Node.")}return f+=c.slice(m),f}class u extends n{constructor(l,s){if(super(),typeof l=="string"&&(l=new i(l)),!ft(l))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(s)||!s.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=l,this.args=s||[]}get name(){return this.fn.name||""}get type(){return cs}get isFunctionNode(){return!0}_compile(l,s){var f=this.args.map(A=>A._compile(l,s));if(zt(this.fn)){var p=this.fn.name;if(s[p]){var m=this.args;return function(A,D,S){var C=nr(D,p);if(typeof C!="function")throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(a(C)));if(C.rawArgs)return C(m,l,ro(A,D));var _=f.map(R=>R(A,D,S));return C.apply(C,_)}}else{var d=p in l?nr(l,p):void 0,h=typeof d=="function"&&d.rawArgs===!0,w=A=>{var D;if(A.has(p))D=A.get(p);else if(p in l)D=nr(l,p);else return u.onUndefinedFunction(p);if(typeof D=="function")return D;throw new TypeError("'".concat(p,`' is not a function; its value is:
|
|
32
|
+
`).concat(a(D)))};if(h){var v=this.args;return function(A,D,S){var C=w(A);return C(v,l,ro(A,D))}}else switch(f.length){case 0:return function(A,D,S){var C=w(A);return C()};case 1:return function(A,D,S){var C=w(A),_=f[0];return C(_(A,D,S))};case 2:return function(A,D,S){var C=w(A),_=f[0],R=f[1];return C(_(A,D,S),R(A,D,S))};default:return function(A,D,S){var C=w(A),_=f.map(R=>R(A,D,S));return C(..._)}}}}else if(Bi(this.fn)&&Sa(this.fn.index)&&this.fn.index.isObjectProperty()){var x=this.fn.object._compile(l,s),g=this.fn.index.getObjectProperty(),b=this.args;return function(A,D,S){var C=x(A,D,S),_=VN(C,g);if(_!=null&&_.rawArgs)return _(b,l,ro(A,D));var R=f.map(P=>P(A,D,S));return _.apply(C,R)}}else{var y=this.fn.toString(),N=this.fn._compile(l,s),E=this.args;return function(A,D,S){var C=N(A,D,S);if(typeof C!="function")throw new TypeError("Expression '".concat(y,"' did not evaluate to a function; value is:")+`
|
|
33
|
+
`.concat(a(C)));if(C.rawArgs)return C(E,l,ro(A,D));var _=f.map(R=>R(A,D,S));return C.apply(C,_)}}}forEach(l){l(this.fn,"fn",this);for(var s=0;s<this.args.length;s++)l(this.args[s],"args["+s+"]",this)}map(l){for(var s=this._ifNode(l(this.fn,"fn",this)),f=[],p=0;p<this.args.length;p++)f[p]=this._ifNode(l(this.args[p],"args["+p+"]",this));return new u(s,f)}clone(){return new u(this.fn,this.args.slice(0))}toString(l){var s,f=this.fn.toString(l);return l&&typeof l.handler=="object"&&Me(l.handler,f)&&(s=l.handler[f](this,l)),typeof s<"u"?s:super.toString(l)}_toString(l){var s=this.args.map(function(p){return p.toString(l)}),f=Eo(this.fn)?"("+this.fn.toString(l)+")":this.fn.toString(l);return f+"("+s.join(", ")+")"}toJSON(){return{mathjs:cs,fn:this.fn,args:this.args}}_toHTML(l){var s=this.args.map(function(f){return f.toHTML(l)});return'<span class="math-function">'+Mr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+s.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(l){var s;return l&&typeof l.handler=="object"&&Me(l.handler,this.name)&&(s=l.handler[this.name](this,l)),typeof s<"u"?s:super.toTex(l)}_toTex(l){var s=this.args.map(function(m){return m.toTex(l)}),f;lh[this.name]&&(f=lh[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(f=r[this.name].toTex);var p;switch(typeof f){case"function":p=f(this,l);break;case"string":p=o(f,this,l);break;case"object":switch(typeof f[s.length]){case"function":p=f[s.length](this,l);break;case"string":p=o(f[s.length],this,l);break}}return typeof p<"u"?p:o(oF,this,l)}getIdentifier(){return this.type+":"+this.name}}return t=u,kt(u,"name",cs),kt(u,"onUndefinedFunction",function(c){throw new Error("Undefined function "+c)}),kt(u,"fromJSON",function(c){return new t(c.fn,c.args)}),u},{isClass:!0,isNode:!0}),ph="parse",MF=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],_F=U(ph,MF,e=>{var{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:o,BlockNode:u,ConditionalNode:c,ConstantNode:l,FunctionAssignmentNode:s,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:d,ParenthesisNode:h,RangeNode:w,RelationalNode:v,SymbolNode:x}=e,g=t(ph,{string:function(M){return se(M,{})},"Array | Matrix":function(M){return b(M,{})},"string, Object":function(M,X){var pe=X.nodes!==void 0?X.nodes:{};return se(M,pe)},"Array | Matrix, Object":b});function b(M){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=X.nodes!==void 0?X.nodes:{};return Qe(M,function(Ee){if(typeof Ee!="string")throw new TypeError("String expected");return se(Ee,pe)})}var y={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},E={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},D=["NaN","Infinity"],S={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
34
34
|
`,r:"\r",t:" "};function C(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:y.NULL,nestingLevel:0,conditionalLevel:null}}function _(M,X){return M.expression.substr(M.index,X)}function R(M){return _(M,1)}function P(M){M.index++}function I(M){return M.expression.charAt(M.index-1)}function O(M){return M.expression.charAt(M.index+1)}function F(M){for(M.tokenType=y.NULL,M.token="",M.comment="";;){if(R(M)==="#")for(;R(M)!==`
|
|
35
35
|
`&&R(M)!=="";)M.comment+=R(M),P(M);if(g.isWhitespace(R(M),M.nestingLevel))P(M);else break}if(R(M)===""){M.tokenType=y.DELIMITER;return}if(R(M)===`
|
|
36
36
|
`&&!M.nestingLevel){M.tokenType=y.DELIMITER,M.token=R(M),P(M);return}var X=R(M),pe=_(M,2),Ee=_(M,3);if(Ee.length===3&&N[Ee]){M.tokenType=y.DELIMITER,M.token=Ee,P(M),P(M),P(M);return}if(pe.length===2&&N[pe]){M.tokenType=y.DELIMITER,M.token=pe,P(M),P(M);return}if(N[X]){M.tokenType=y.DELIMITER,M.token=X,P(M);return}if(g.isDigitDot(X)){M.tokenType=y.NUMBER;var Re=_(M,2);if(Re==="0b"||Re==="0o"||Re==="0x"){for(M.token+=R(M),P(M),M.token+=R(M),P(M);g.isHexDigit(R(M));)M.token+=R(M),P(M);if(R(M)===".")for(M.token+=".",P(M);g.isHexDigit(R(M));)M.token+=R(M),P(M);else if(R(M)==="i")for(M.token+="i",P(M);g.isDigit(R(M));)M.token+=R(M),P(M);return}if(R(M)==="."){if(M.token+=R(M),P(M),!g.isDigit(R(M))){M.tokenType=y.DELIMITER;return}}else{for(;g.isDigit(R(M));)M.token+=R(M),P(M);g.isDecimalMark(R(M),O(M))&&(M.token+=R(M),P(M))}for(;g.isDigit(R(M));)M.token+=R(M),P(M);if(R(M)==="E"||R(M)==="e"){if(g.isDigit(O(M))||O(M)==="-"||O(M)==="+"){if(M.token+=R(M),P(M),(R(M)==="+"||R(M)==="-")&&(M.token+=R(M),P(M)),!g.isDigit(R(M)))throw _e(M,'Digit expected, got "'+R(M)+'"');for(;g.isDigit(R(M));)M.token+=R(M),P(M);if(g.isDecimalMark(R(M),O(M)))throw _e(M,'Digit expected, got "'+R(M)+'"')}else if(O(M)===".")throw P(M),_e(M,'Digit expected, got "'+R(M)+'"')}return}if(g.isAlpha(R(M),I(M),O(M))){for(;g.isAlpha(R(M),I(M),O(M))||g.isDigit(R(M));)M.token+=R(M),P(M);Me(E,M.token)?M.tokenType=y.DELIMITER:M.tokenType=y.SYMBOL;return}for(M.tokenType=y.UNKNOWN;R(M)!=="";)M.token+=R(M),P(M);throw _e(M,'Syntax error in part "'+M.token+'"')}function q(M){do F(M);while(M.token===`
|
|
37
37
|
`)}function k(M){M.nestingLevel++}function te(M){M.nestingLevel--}g.isAlpha=function(M,X,pe){return g.isValidLatinOrGreek(M)||g.isValidMathSymbol(M,pe)||g.isValidMathSymbol(X,M)},g.isValidLatinOrGreek=function(M){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(M)},g.isValidMathSymbol=function(M,X){return/^[\uD835]$/.test(M)&&/^[\uDC00-\uDFFF]$/.test(X)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(X)},g.isWhitespace=function(M,X){return M===" "||M===" "||M===`
|
|
38
|
-
`&&X>0},g.isDecimalMark=function(M,X){return M==="."&&X!=="/"&&X!=="*"&&X!=="^"},g.isDigitDot=function(M){return M>="0"&&M<="9"||M==="."},g.isDigit=function(M){return M>="0"&&M<="9"},g.isHexDigit=function(M){return M>="0"&&M<="9"||M>="a"&&M<="f"||M>="A"&&M<="F"};function se(M,X){var pe=C();Ot(pe,{expression:M,extraNodes:X}),F(pe);var Ee=
|
|
38
|
+
`&&X>0},g.isDecimalMark=function(M,X){return M==="."&&X!=="/"&&X!=="*"&&X!=="^"},g.isDigitDot=function(M){return M>="0"&&M<="9"||M==="."},g.isDigit=function(M){return M>="0"&&M<="9"},g.isHexDigit=function(M){return M>="0"&&M<="9"||M>="a"&&M<="f"||M>="A"&&M<="F"};function se(M,X){var pe=C();Ot(pe,{expression:M,extraNodes:X}),F(pe);var Ee=W(pe);if(pe.token!=="")throw pe.tokenType===y.DELIMITER?wt(pe,"Unexpected operator "+pe.token):_e(pe,'Unexpected part "'+pe.token+'"');return Ee}function W(M){var X,pe=[],Ee;for(M.token!==""&&M.token!==`
|
|
39
39
|
`&&M.token!==";"&&(X=V(M),M.comment&&(X.comment=M.comment));M.token===`
|
|
40
40
|
`||M.token===";";)pe.length===0&&X&&(Ee=M.token!==";",pe.push({node:X,visible:Ee})),F(M),M.token!==`
|
|
41
|
-
`&&M.token!==";"&&M.token!==""&&(X=V(M),M.comment&&(X.comment=M.comment),Ee=M.token!==";",pe.push({node:X,visible:Ee}));return pe.length>0?new u(pe):(X||(X=new l(void 0),M.comment&&(X.comment=M.comment)),X)}function V(M){var X,pe,Ee,Re,Je=ue(M);if(M.token==="="){if(zt(Je))return X=Je.name,q(M),Ee=V(M),new o(new x(X),Ee);if(Ti(Je))return q(M),Ee=V(M),new o(Je.object,Je.index,Ee);if(Zn(Je)&&zt(Je.fn)&&(Re=!0,pe=[],X=Je.name,Je.args.forEach(function(vr,nc){zt(vr)?pe[nc]=vr.name:Re=!1}),Re))return q(M),Ee=V(M),new s(X,pe,Ee);throw _e(M,"Invalid left hand side of assignment operator =")}return Je}function ue(M){for(var X=me(M);M.token==="?";){var pe=M.conditionalLevel;M.conditionalLevel=M.nestingLevel,q(M);var Ee=X,Re=V(M);if(M.token!==":")throw _e(M,"False part of conditional expression expected");M.conditionalLevel=null,q(M);var Je=V(M);X=new c(Ee,Re,Je),M.conditionalLevel=pe}return X}function me(M){for(var X=re(M);M.token==="or";)q(M),X=new d("or","or",[X,re(M)]);return X}function re(M){for(var X=ae(M);M.token==="xor";)q(M),X=new d("xor","xor",[X,ae(M)]);return X}function ae(M){for(var X=de(M);M.token==="and";)q(M),X=new d("and","and",[X,de(M)]);return X}function de(M){for(var X=ne(M);M.token==="|";)q(M),X=new d("|","bitOr",[X,ne(M)]);return X}function ne(M){for(var X=ce(M);M.token==="^|";)q(M),X=new d("^|","bitXor",[X,ce(M)]);return X}function ce(M){for(var X=le(M);M.token==="&";)q(M),X=new d("&","bitAnd",[X,le(M)]);return X}function le(M){for(var X=[he(M)],pe=[],Ee={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Me(Ee,M.token);){var Re={name:M.token,fn:Ee[M.token]};pe.push(Re),q(M),X.push(he(M))}return X.length===1?X[0]:X.length===2?new d(pe[0].name,pe[0].fn,X):new v(pe.map(Je=>Je.fn),X)}function he(M){var X,pe,Ee,Re;X=xe(M);for(var Je={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),Re=[X,xe(M)],X=new d(pe,Ee,Re);return X}function xe(M){var X,pe,Ee,Re;X=$(M);for(var Je={to:"to",in:"to"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="in"&&M.token===""?X=new d("*","multiply",[X,new x("in")],!0):(Re=[X,$(M)],X=new d(pe,Ee,Re));return X}function $(M){var X,pe=[];if(M.token===":"?X=new l(1):X=T(M),M.token===":"&&M.conditionalLevel!==M.nestingLevel){for(pe.push(X);M.token===":"&&pe.length<3;)q(M),M.token===")"||M.token==="]"||M.token===","||M.token===""?pe.push(new x("end")):pe.push(T(M));pe.length===3?X=new w(pe[0],pe[2],pe[1]):X=new w(pe[0],pe[1])}return X}function T(M){var X,pe,Ee,Re;X=z(M);for(var Je={"+":"add","-":"subtract"};Me(Je,M.token);){pe=M.token,Ee=Je[pe],q(M);var vr=z(M);vr.isPercentage?Re=[X,new d("*","multiply",[X,vr])]:Re=[X,vr],X=new d(pe,Ee,Re)}return X}function z(M){var X,pe,Ee,Re;X=J(M),pe=X;for(var Je={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Me(Je,M.token);)Ee=M.token,Re=Je[Ee],q(M),pe=J(M),X=new d(Ee,Re,[X,pe]);return X}function J(M){var X,pe;for(X=L(M),pe=X;M.tokenType===y.SYMBOL||M.token==="in"&&nt(X)||M.tokenType===y.NUMBER&&!nt(pe)&&(!Ct(pe)||pe.op==="!")||M.token==="(";)pe=L(M),X=new d("*","multiply",[X,pe],!0);return X}function L(M){for(var X=H(M),pe=X,Ee=[];M.token==="/"&&Oc(pe);)if(Ee.push(Ot({},M)),q(M),M.tokenType===y.NUMBER)if(Ee.push(Ot({},M)),q(M),M.tokenType===y.SYMBOL||M.token==="(")Ot(M,Ee.pop()),Ee.pop(),pe=H(M),X=new d("/","divide",[X,pe]);else{Ee.pop(),Ot(M,Ee.pop());break}else{Ot(M,Ee.pop());break}return X}function H(M){var X,pe,Ee,Re;X=G(M);for(var Je={"%":"mod",mod:"mod"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="%"&&M.tokenType===y.DELIMITER&&M.token!=="("?X=new d("/","divide",[X,new l(100)],!1,!0):(Re=[X,G(M)],X=new d(pe,Ee,Re));return X}function G(M){var X,pe,Ee,Re={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Me(Re,M.token)?(Ee=Re[M.token],X=M.token,q(M),pe=[G(M)],new d(X,Ee,pe)):Y(M)}function Y(M){var X,pe,Ee,Re;return X=ee(M),(M.token==="^"||M.token===".^")&&(pe=M.token,Ee=pe==="^"?"pow":"dotPow",q(M),Re=[X,G(M)],X=new d(pe,Ee,Re)),X}function ee(M){var X,pe,Ee,Re;X=B(M);for(var Je={"!":"factorial","'":"ctranspose"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],F(M),Re=[X],X=new d(pe,Ee,Re),X=Q(M,X);return X}function B(M){var X=[];if(M.tokenType===y.SYMBOL&&Me(M.extraNodes,M.token)){var pe=M.extraNodes[M.token];if(F(M),M.token==="("){if(X=[],k(M),F(M),M.token!==")")for(X.push(V(M));M.token===",";)F(M),X.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M)}return new pe(X)}return j(M)}function j(M){var X,pe;return M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E?(pe=M.token,F(M),Me(A,pe)?X=new l(A[pe]):D.includes(pe)?X=new l(r(pe,"number")):X=new x(pe),X=Q(M,X),X):Z(M)}function Q(M,X,pe){for(var Ee;(M.token==="("||M.token==="["||M.token===".")&&!pe;)if(Ee=[],M.token==="(")if(zt(X)||Ti(X)){if(k(M),F(M),M.token!==")")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M),X=new f(X,Ee)}else return X;else if(M.token==="["){if(k(M),F(M),M.token!=="]")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!=="]")throw _e(M,"Parenthesis ] expected");te(M),F(M),X=new i(X,new p(Ee))}else{F(M);var Re=M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E;if(!Re)throw _e(M,"Property name expected after dot");Ee.push(new l(M.token)),F(M);var Je=!0;X=new i(X,new p(Ee,Je))}return X}function Z(M){var X,pe;return M.token==='"'||M.token==="'"?(pe=ie(M,M.token),X=new l(pe),X=Q(M,X),X):oe(M)}function ie(M,X){for(var pe="";R(M)!==""&&R(M)!==X;)if(R(M)==="\\"){P(M);var Ee=R(M),Re=S[Ee];if(Re!==void 0)pe+=Re,M.index+=1;else if(Ee==="u"){var Je=M.expression.slice(M.index+1,M.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Je))pe+=String.fromCharCode(parseInt(Je,16)),M.index+=5;else throw _e(M,"Invalid unicode character \\u".concat(Je))}else throw _e(M,"Bad escape character \\".concat(Ee))}else pe+=R(M),P(M);if(F(M),M.token!==X)throw _e(M,"End of string ".concat(X," expected"));return F(M),pe}function oe(M){var X,pe,Ee,Re;if(M.token==="["){if(k(M),F(M),M.token!=="]"){var Je=ye(M);if(M.token===";"){for(Ee=1,pe=[Je];M.token===";";)F(M),M.token!=="]"&&(pe[Ee]=ye(M),Ee++);if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),Re=pe[0].items.length;for(var vr=1;vr<Ee;vr++)if(pe[vr].items.length!==Re)throw wt(M,"Column dimensions mismatch ("+pe[vr].items.length+" !== "+Re+")");X=new a(pe)}else{if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),X=Je}}else te(M),F(M),X=new a([]);return Q(M,X)}return fe(M)}function ye(M){for(var X=[V(M)],pe=1;M.token===",";)F(M),M.token!=="]"&&M.token!==";"&&(X[pe]=V(M),pe++);return new a(X)}function fe(M){if(M.token==="{"){k(M);var X,pe={};do if(F(M),M.token!=="}"){if(M.token==='"'||M.token==="'")X=ie(M,M.token);else if(M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E)X=M.token,F(M);else throw _e(M,"Symbol or string expected as object key");if(M.token!==":")throw _e(M,"Colon : expected after object key");F(M),pe[X]=V(M)}while(M.token===",");if(M.token!=="}")throw _e(M,"Comma , or bracket } expected after object value");te(M),F(M);var Ee=new m(pe);return Ee=Q(M,Ee),Ee}return De(M)}function De(M){var X;return M.tokenType===y.NUMBER?(X=M.token,F(M),new l(r(X,n.number))):Ne(M)}function Ne(M){var X;if(M.token==="("){if(k(M),F(M),X=V(M),M.token!==")")throw _e(M,"Parenthesis ) expected");return te(M),F(M),X=new h(X),X=Q(M,X),X}return je(M)}function je(M){throw M.token===""?_e(M,"Unexpected end of expression"):_e(M,"Value expected")}function Ze(M){return M.index-M.token.length+1}function _e(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}function wt(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}return t.addConversion({from:"string",to:"Node",convert:g}),g}),ah="compile",wF=["typed","parse"],NF=U(ah,wF,e=>{var{typed:t,parse:r}=e;return t(ah,{string:function(n){return r(n).compile()},"Array | Matrix":function(n){return Qe(n,function(i){return r(i).compile()})}})}),oh="evaluate",DF=["typed","parse"],EF=U(oh,DF,e=>{var{typed:t,parse:r}=e;return t(oh,{string:function(n){var i=ao();return r(n).compile().evaluate(i)},"string, Map | Object":function(n,i){return r(n).compile().evaluate(i)},"Array | Matrix":function(n){var i=ao();return Qe(n,function(a){return r(a).compile().evaluate(i)})},"Array | Matrix, Map | Object":function(n,i){return Qe(n,function(a){return r(a).compile().evaluate(i)})}})}),AF="Parser",SF=["evaluate"],CF=U(AF,SF,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:ao(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return RN(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),sh="parser",MF=["typed","Parser"],_F=U(sh,MF,e=>{var{typed:t,Parser:r}=e;return t(sh,{"":function(){return new r}})}),uh="lup",FF=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],TF=U(uh,FF,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:o,subtractScalar:u,larger:c,equalScalar:l,unaryMinus:s,DenseMatrix:f,SparseMatrix:p,Spa:m}=e;return t(uh,{DenseMatrix:function(w){return d(w)},SparseMatrix:function(w){return h(w)},Array:function(w){var v=r(w),x=d(v);return{L:x.L.valueOf(),U:x.U.valueOf(),p:x.p}}});function d(w){var v=w._size[0],x=w._size[1],g=Math.min(v,x),b=ze(w._data),y=[],N=[v,g],E=[],A=[g,x],D,S,C,_=[];for(D=0;D<v;D++)_[D]=D;for(S=0;S<x;S++){if(S>0)for(D=0;D<v;D++){var R=Math.min(D,S),P=0;for(C=0;C<R;C++)P=i(P,o(b[D][C],b[C][S]));b[D][S]=u(b[D][S],P)}var I=S,O=0,F=0;for(D=S;D<v;D++){var q=b[D][S],k=n(q);c(k,O)&&(I=D,O=k,F=q)}if(S!==I&&(_[S]=[_[I],_[I]=_[S]][0],f._swapRows(S,I,b)),S<v)for(D=S+1;D<v;D++){var te=b[D][S];l(te,0)||(b[D][S]=a(b[D][S],F))}}for(S=0;S<x;S++)for(D=0;D<v;D++){if(S===0&&(D<x&&(E[D]=[]),y[D]=[]),D<S){D<x&&(E[D][S]=b[D][S]),S<v&&(y[D][S]=0);continue}if(D===S){D<x&&(E[D][S]=b[D][S]),S<v&&(y[D][S]=1);continue}D<x&&(E[D][S]=0),S<v&&(y[D][S]=b[D][S])}var se=new f({data:y,size:N}),K=new f({data:E,size:A}),V=[];for(D=0,g=_.length;D<g;D++)V[_[D]]=D;return{L:se,U:K,p:V,toString:function(){return"L: "+this.L.toString()+`
|
|
41
|
+
`&&M.token!==";"&&M.token!==""&&(X=V(M),M.comment&&(X.comment=M.comment),Ee=M.token!==";",pe.push({node:X,visible:Ee}));return pe.length>0?new u(pe):(X||(X=new l(void 0),M.comment&&(X.comment=M.comment)),X)}function V(M){var X,pe,Ee,Re,Je=ue(M);if(M.token==="="){if(zt(Je))return X=Je.name,q(M),Ee=V(M),new o(new x(X),Ee);if(Bi(Je))return q(M),Ee=V(M),new o(Je.object,Je.index,Ee);if(Zn(Je)&&zt(Je.fn)&&(Re=!0,pe=[],X=Je.name,Je.args.forEach(function(vr,uc){zt(vr)?pe[uc]=vr.name:Re=!1}),Re))return q(M),Ee=V(M),new s(X,pe,Ee);throw _e(M,"Invalid left hand side of assignment operator =")}return Je}function ue(M){for(var X=me(M);M.token==="?";){var pe=M.conditionalLevel;M.conditionalLevel=M.nestingLevel,q(M);var Ee=X,Re=V(M);if(M.token!==":")throw _e(M,"False part of conditional expression expected");M.conditionalLevel=null,q(M);var Je=V(M);X=new c(Ee,Re,Je),M.conditionalLevel=pe}return X}function me(M){for(var X=re(M);M.token==="or";)q(M),X=new d("or","or",[X,re(M)]);return X}function re(M){for(var X=ae(M);M.token==="xor";)q(M),X=new d("xor","xor",[X,ae(M)]);return X}function ae(M){for(var X=de(M);M.token==="and";)q(M),X=new d("and","and",[X,de(M)]);return X}function de(M){for(var X=ne(M);M.token==="|";)q(M),X=new d("|","bitOr",[X,ne(M)]);return X}function ne(M){for(var X=ce(M);M.token==="^|";)q(M),X=new d("^|","bitXor",[X,ce(M)]);return X}function ce(M){for(var X=le(M);M.token==="&";)q(M),X=new d("&","bitAnd",[X,le(M)]);return X}function le(M){for(var X=[he(M)],pe=[],Ee={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Me(Ee,M.token);){var Re={name:M.token,fn:Ee[M.token]};pe.push(Re),q(M),X.push(he(M))}return X.length===1?X[0]:X.length===2?new d(pe[0].name,pe[0].fn,X):new v(pe.map(Je=>Je.fn),X)}function he(M){var X,pe,Ee,Re;X=xe(M);for(var Je={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),Re=[X,xe(M)],X=new d(pe,Ee,Re);return X}function xe(M){var X,pe,Ee,Re;X=$(M);for(var Je={to:"to",in:"to"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="in"&&M.token===""?X=new d("*","multiply",[X,new x("in")],!0):(Re=[X,$(M)],X=new d(pe,Ee,Re));return X}function $(M){var X,pe=[];if(M.token===":"?X=new l(1):X=T(M),M.token===":"&&M.conditionalLevel!==M.nestingLevel){for(pe.push(X);M.token===":"&&pe.length<3;)q(M),M.token===")"||M.token==="]"||M.token===","||M.token===""?pe.push(new x("end")):pe.push(T(M));pe.length===3?X=new w(pe[0],pe[2],pe[1]):X=new w(pe[0],pe[1])}return X}function T(M){var X,pe,Ee,Re;X=z(M);for(var Je={"+":"add","-":"subtract"};Me(Je,M.token);){pe=M.token,Ee=Je[pe],q(M);var vr=z(M);vr.isPercentage?Re=[X,new d("*","multiply",[X,vr])]:Re=[X,vr],X=new d(pe,Ee,Re)}return X}function z(M){var X,pe,Ee,Re;X=J(M),pe=X;for(var Je={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Me(Je,M.token);)Ee=M.token,Re=Je[Ee],q(M),pe=J(M),X=new d(Ee,Re,[X,pe]);return X}function J(M){var X,pe;for(X=L(M),pe=X;M.tokenType===y.SYMBOL||M.token==="in"&&nt(X)||M.tokenType===y.NUMBER&&!nt(pe)&&(!Ct(pe)||pe.op==="!")||M.token==="(";)pe=L(M),X=new d("*","multiply",[X,pe],!0);return X}function L(M){for(var X=H(M),pe=X,Ee=[];M.token==="/"&&qc(pe);)if(Ee.push(Ot({},M)),q(M),M.tokenType===y.NUMBER)if(Ee.push(Ot({},M)),q(M),M.tokenType===y.SYMBOL||M.token==="(")Ot(M,Ee.pop()),Ee.pop(),pe=H(M),X=new d("/","divide",[X,pe]);else{Ee.pop(),Ot(M,Ee.pop());break}else{Ot(M,Ee.pop());break}return X}function H(M){var X,pe,Ee,Re;X=G(M);for(var Je={"%":"mod",mod:"mod"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="%"&&M.tokenType===y.DELIMITER&&M.token!=="("?X=new d("/","divide",[X,new l(100)],!1,!0):(Re=[X,G(M)],X=new d(pe,Ee,Re));return X}function G(M){var X,pe,Ee,Re={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Me(Re,M.token)?(Ee=Re[M.token],X=M.token,q(M),pe=[G(M)],new d(X,Ee,pe)):Y(M)}function Y(M){var X,pe,Ee,Re;return X=ee(M),(M.token==="^"||M.token===".^")&&(pe=M.token,Ee=pe==="^"?"pow":"dotPow",q(M),Re=[X,G(M)],X=new d(pe,Ee,Re)),X}function ee(M){var X,pe,Ee,Re;X=B(M);for(var Je={"!":"factorial","'":"ctranspose"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],F(M),Re=[X],X=new d(pe,Ee,Re),X=Q(M,X);return X}function B(M){var X=[];if(M.tokenType===y.SYMBOL&&Me(M.extraNodes,M.token)){var pe=M.extraNodes[M.token];if(F(M),M.token==="("){if(X=[],k(M),F(M),M.token!==")")for(X.push(V(M));M.token===",";)F(M),X.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M)}return new pe(X)}return j(M)}function j(M){var X,pe;return M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E?(pe=M.token,F(M),Me(A,pe)?X=new l(A[pe]):D.includes(pe)?X=new l(r(pe,"number")):X=new x(pe),X=Q(M,X),X):Z(M)}function Q(M,X,pe){for(var Ee;(M.token==="("||M.token==="["||M.token===".")&&!pe;)if(Ee=[],M.token==="(")if(zt(X)||Bi(X)){if(k(M),F(M),M.token!==")")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M),X=new f(X,Ee)}else return X;else if(M.token==="["){if(k(M),F(M),M.token!=="]")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!=="]")throw _e(M,"Parenthesis ] expected");te(M),F(M),X=new i(X,new p(Ee))}else{F(M);var Re=M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E;if(!Re)throw _e(M,"Property name expected after dot");Ee.push(new l(M.token)),F(M);var Je=!0;X=new i(X,new p(Ee,Je))}return X}function Z(M){var X,pe;return M.token==='"'||M.token==="'"?(pe=ie(M,M.token),X=new l(pe),X=Q(M,X),X):oe(M)}function ie(M,X){for(var pe="";R(M)!==""&&R(M)!==X;)if(R(M)==="\\"){P(M);var Ee=R(M),Re=S[Ee];if(Re!==void 0)pe+=Re,M.index+=1;else if(Ee==="u"){var Je=M.expression.slice(M.index+1,M.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Je))pe+=String.fromCharCode(parseInt(Je,16)),M.index+=5;else throw _e(M,"Invalid unicode character \\u".concat(Je))}else throw _e(M,"Bad escape character \\".concat(Ee))}else pe+=R(M),P(M);if(F(M),M.token!==X)throw _e(M,"End of string ".concat(X," expected"));return F(M),pe}function oe(M){var X,pe,Ee,Re;if(M.token==="["){if(k(M),F(M),M.token!=="]"){var Je=ye(M);if(M.token===";"){for(Ee=1,pe=[Je];M.token===";";)F(M),M.token!=="]"&&(pe[Ee]=ye(M),Ee++);if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),Re=pe[0].items.length;for(var vr=1;vr<Ee;vr++)if(pe[vr].items.length!==Re)throw wt(M,"Column dimensions mismatch ("+pe[vr].items.length+" !== "+Re+")");X=new a(pe)}else{if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),X=Je}}else te(M),F(M),X=new a([]);return Q(M,X)}return fe(M)}function ye(M){for(var X=[V(M)],pe=1;M.token===",";)F(M),M.token!=="]"&&M.token!==";"&&(X[pe]=V(M),pe++);return new a(X)}function fe(M){if(M.token==="{"){k(M);var X,pe={};do if(F(M),M.token!=="}"){if(M.token==='"'||M.token==="'")X=ie(M,M.token);else if(M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E)X=M.token,F(M);else throw _e(M,"Symbol or string expected as object key");if(M.token!==":")throw _e(M,"Colon : expected after object key");F(M),pe[X]=V(M)}while(M.token===",");if(M.token!=="}")throw _e(M,"Comma , or bracket } expected after object value");te(M),F(M);var Ee=new m(pe);return Ee=Q(M,Ee),Ee}return De(M)}function De(M){var X;return M.tokenType===y.NUMBER?(X=M.token,F(M),new l(r(X,n.number))):Ne(M)}function Ne(M){var X;if(M.token==="("){if(k(M),F(M),X=V(M),M.token!==")")throw _e(M,"Parenthesis ) expected");return te(M),F(M),X=new h(X),X=Q(M,X),X}return je(M)}function je(M){throw M.token===""?_e(M,"Unexpected end of expression"):_e(M,"Value expected")}function Ze(M){return M.index-M.token.length+1}function _e(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}function wt(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}return t.addConversion({from:"string",to:"Node",convert:g}),g}),mh="compile",FF=["typed","parse"],TF=U(mh,FF,e=>{var{typed:t,parse:r}=e;return t(mh,{string:function(n){return r(n).compile()},"Array | Matrix":function(n){return Qe(n,function(i){return r(i).compile()})}})}),dh="evaluate",OF=["typed","parse"],BF=U(dh,OF,e=>{var{typed:t,parse:r}=e;return t(dh,{string:function(n){var i=co();return r(n).compile().evaluate(i)},"string, Map | Object":function(n,i){return r(n).compile().evaluate(i)},"Array | Matrix":function(n){var i=co();return Qe(n,function(a){return r(a).compile().evaluate(i)})},"Array | Matrix, Map | Object":function(n,i){return Qe(n,function(a){return r(a).compile().evaluate(i)})}})}),kF="Parser",IF=["evaluate"],RF=U(kF,IF,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:co(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return HN(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),hh="parser",qF=["typed","Parser"],zF=U(hh,qF,e=>{var{typed:t,Parser:r}=e;return t(hh,{"":function(){return new r}})}),gh="lup",jF=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],LF=U(gh,jF,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:o,subtractScalar:u,larger:c,equalScalar:l,unaryMinus:s,DenseMatrix:f,SparseMatrix:p,Spa:m}=e;return t(gh,{DenseMatrix:function(w){return d(w)},SparseMatrix:function(w){return h(w)},Array:function(w){var v=r(w),x=d(v);return{L:x.L.valueOf(),U:x.U.valueOf(),p:x.p}}});function d(w){var v=w._size[0],x=w._size[1],g=Math.min(v,x),b=ze(w._data),y=[],N=[v,g],E=[],A=[g,x],D,S,C,_=[];for(D=0;D<v;D++)_[D]=D;for(S=0;S<x;S++){if(S>0)for(D=0;D<v;D++){var R=Math.min(D,S),P=0;for(C=0;C<R;C++)P=i(P,o(b[D][C],b[C][S]));b[D][S]=u(b[D][S],P)}var I=S,O=0,F=0;for(D=S;D<v;D++){var q=b[D][S],k=n(q);c(k,O)&&(I=D,O=k,F=q)}if(S!==I&&(_[S]=[_[I],_[I]=_[S]][0],f._swapRows(S,I,b)),S<v)for(D=S+1;D<v;D++){var te=b[D][S];l(te,0)||(b[D][S]=a(b[D][S],F))}}for(S=0;S<x;S++)for(D=0;D<v;D++){if(S===0&&(D<x&&(E[D]=[]),y[D]=[]),D<S){D<x&&(E[D][S]=b[D][S]),S<v&&(y[D][S]=0);continue}if(D===S){D<x&&(E[D][S]=b[D][S]),S<v&&(y[D][S]=1);continue}D<x&&(E[D][S]=0),S<v&&(y[D][S]=b[D][S])}var se=new f({data:y,size:N}),W=new f({data:E,size:A}),V=[];for(D=0,g=_.length;D<g;D++)V[_[D]]=D;return{L:se,U:W,p:V,toString:function(){return"L: "+this.L.toString()+`
|
|
42
42
|
U: `+this.U.toString()+`
|
|
43
|
-
P: `+this.p}}}function h(w){var v=w._size[0],x=w._size[1],g=Math.min(v,x),b=w._values,y=w._index,N=w._ptr,E=[],A=[],D=[],S=[v,g],C=[],_=[],R=[],P=[g,x],I,O,F,q=[],k=[];for(I=0;I<v;I++)q[I]=I,k[I]=I;var te=function(
|
|
43
|
+
P: `+this.p}}}function h(w){var v=w._size[0],x=w._size[1],g=Math.min(v,x),b=w._values,y=w._index,N=w._ptr,E=[],A=[],D=[],S=[v,g],C=[],_=[],R=[],P=[g,x],I,O,F,q=[],k=[];for(I=0;I<v;I++)q[I]=I,k[I]=I;var te=function(W,V){var ue=k[W],me=k[V];q[ue]=V,q[me]=W,k[W]=me,k[V]=ue},se=function(){var W=new m;O<v&&(D.push(E.length),E.push(1),A.push(O)),R.push(C.length);var V=N[O],ue=N[O+1];for(F=V;F<ue;F++)I=y[F],W.set(q[I],b[F]);O>0&&W.forEach(0,O-1,function(de,ne){p._forEachRow(de,E,A,D,function(ce,le){ce>de&&W.accumulate(ce,s(o(le,ne)))})});var me=O,re=W.get(O),ae=n(re);W.forEach(O+1,v-1,function(de,ne){var ce=n(ne);c(ce,ae)&&(me=de,ae=ce,re=ne)}),O!==me&&(p._swapRows(O,me,S[1],E,A,D),p._swapRows(O,me,P[1],C,_,R),W.swap(O,me),te(O,me)),W.forEach(0,v-1,function(de,ne){de<=O?(C.push(ne),_.push(de)):(ne=a(ne,re),l(ne,0)||(E.push(ne),A.push(de)))})};for(O=0;O<x;O++)se();return R.push(C.length),D.push(E.length),{L:new p({values:E,index:A,ptr:D,size:S}),U:new p({values:C,index:_,ptr:R,size:P}),p:q,toString:function(){return"L: "+this.L.toString()+`
|
|
44
44
|
U: `+this.U.toString()+`
|
|
45
|
-
P: `+this.p}}}}),
|
|
46
|
-
R: `+this.R.toString()}}}function v(g){var b=w(g),y=b.R._data;if(g._data.length>0)for(var N=y[0][0].type==="Complex"?h(0):0,E=0;E<y.length;++E)for(var A=0;A<E&&A<(y[0]||[]).length;++A)y[E][A]=N;return b}function x(g){throw new Error("qr not implemented for sparse matrices yet")}});function
|
|
45
|
+
P: `+this.p}}}}),vh="qr",PF=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],VF=U(vh,PF,e=>{var{typed:t,matrix:r,zeros:n,identity:i,isZero:a,equal:o,sign:u,sqrt:c,conj:l,unaryMinus:s,addScalar:f,divideScalar:p,multiplyScalar:m,subtractScalar:d,complex:h}=e;return Ot(t(vh,{DenseMatrix:function(g){return v(g)},SparseMatrix:function(g){return x()},Array:function(g){var b=r(g),y=v(b);return{Q:y.Q.valueOf(),R:y.R.valueOf()}}}),{_denseQRimpl:w});function w(g){var b=g._size[0],y=g._size[1],N=i([b],"dense"),E=N._data,A=g.clone(),D=A._data,S,C,_,R=n([b],"");for(_=0;_<Math.min(y,b);++_){var P=D[_][_],I=s(o(P,0)?1:u(P)),O=l(I),F=0;for(S=_;S<b;S++)F=f(F,m(D[S][_],l(D[S][_])));var q=m(I,c(F));if(!a(q)){var k=d(P,q);for(R[_]=1,S=_+1;S<b;S++)R[S]=p(D[S][_],k);var te=s(l(p(k,q))),se=void 0;for(C=_;C<y;C++){for(se=0,S=_;S<b;S++)se=f(se,m(l(R[S]),D[S][C]));for(se=m(se,te),S=_;S<b;S++)D[S][C]=m(d(D[S][C],m(R[S],se)),O)}for(S=0;S<b;S++){for(se=0,C=_;C<b;C++)se=f(se,m(E[S][C],R[C]));for(se=m(se,te),C=_;C<b;++C)E[S][C]=p(d(E[S][C],m(se,l(R[C]))),O)}}}return{Q:N,R:A,toString:function(){return"Q: "+this.Q.toString()+`
|
|
46
|
+
R: `+this.R.toString()}}}function v(g){var b=w(g),y=b.R._data;if(g._data.length>0)for(var N=y[0][0].type==="Complex"?h(0):0,E=0;E<y.length;++E)for(var A=0;A<E&&A<(y[0]||[]).length;++A)y[E][A]=N;return b}function x(g){throw new Error("qr not implemented for sparse matrices yet")}});function UF(e,t,r,n){e._values;for(var i=e._index,a=e._ptr,o=e._size,u=e._datatype,c=o[0],l=o[1],s=null,f=[],p=[],m=0,d=0;d<l;d++){p[d]=m;for(var h=r?r[d]:d,w=a[h],v=a[h+1],x=w;x<v;x++){var g=i[x];f[m]=g,m++}}return p[l]=m,e.createSparseMatrix({values:s,index:f,ptr:p,size:[c,l],datatype:u})}function Xy(e,t,r,n,i,a,o){var u=0;for(r[o]=e;u>=0;){var c=r[o+u],l=r[n+c];l===-1?(u--,a[t++]=c):(r[n+c]=r[i+l],++u,r[o+u]=l)}return t}function $F(e,t){if(!e)return null;var r=0,n,i=[],a=[],o=0,u=t,c=2*t;for(n=0;n<t;n++)a[o+n]=-1;for(n=t-1;n>=0;n--)e[n]!==-1&&(a[u+n]=a[o+e[n]],a[o+e[n]]=n);for(n=0;n<t;n++)e[n]===-1&&(r=Xy(n,r,a,o,u,i,c));return i}function HF(e,t){if(!e)return null;var r=e._index,n=e._ptr,i=e._size,a=i[0],o=i[1],u=[],c=[],l=0,s=o,f,p;for(f=0;f<a;f++)c[s+f]=-1;for(var m=0;m<o;m++){u[m]=-1,c[l+m]=-1;for(var d=n[m],h=n[m+1],w=d;w<h;w++){var v=r[w];for(f=c[s+v];f!==-1&&f<m;f=p)p=c[l+f],c[l+f]=m,p===-1&&(u[f]=m);c[s+v]=m}}return u}function JF(e,t,r){for(var n=e._values,i=e._index,a=e._ptr,o=e._size,u=o[1],c=0,l=0;l<u;l++){var s=a[l];for(a[l]=c;s<a[l+1];s++)t(i[s],l,n?n[s]:1,r)&&(i[c]=i[s],n&&(n[c]=n[s]),c++)}return a[u]=c,i.splice(c,i.length-c),n&&n.splice(c,n.length-c),c}function Vn(e){return-e-2}var GF="csAmd",KF=["add","multiply","transpose"],WF=U(GF,KF,e=>{var{add:t,multiply:r,transpose:n}=e;return function(l,s){if(!s||l<=0||l>3)return null;var f=s._size,p=f[0],m=f[1],d=0,h=Math.max(16,10*Math.sqrt(m));h=Math.min(m-2,h);var w=i(l,s,p,m,h);JF(w,c,null);for(var v=w._index,x=w._ptr,g=x[m],b=[],y=[],N=0,E=m+1,A=2*(m+1),D=3*(m+1),S=4*(m+1),C=5*(m+1),_=6*(m+1),R=7*(m+1),P=b,I=a(m,x,y,N,D,P,A,R,E,_,S,C),O=o(m,x,y,C,S,_,h,E,D,P,A),F=0,q,k,te,se,W,V,ue,me,re,ae,de,ne,ce,le,he,xe;O<m;){for(te=-1;F<m&&(te=y[D+F])===-1;F++);y[A+te]!==-1&&(P[y[A+te]]=-1),y[D+F]=y[A+te];var $=y[S+te],T=y[E+te];O+=T;var z=0;y[E+te]=-T;var J=x[te],L=$===0?J:g,H=L;for(se=1;se<=$+1;se++){for(se>$?(V=te,ue=J,me=y[N+te]-$):(V=v[J++],ue=x[V],me=y[N+V]),W=1;W<=me;W++)q=v[ue++],!((re=y[E+q])<=0)&&(z+=re,y[E+q]=-re,v[H++]=q,y[A+q]!==-1&&(P[y[A+q]]=P[q]),P[q]!==-1?y[A+P[q]]=y[A+q]:y[D+y[C+q]]=y[A+q]);V!==te&&(x[V]=Vn(te),y[_+V]=0)}for($!==0&&(g=H),y[C+te]=z,x[te]=L,y[N+te]=H-L,y[S+te]=-2,I=u(I,d,y,_,m),ae=L;ae<H;ae++)if(q=v[ae],!((de=y[S+q])<=0)){re=-y[E+q];var G=I-re;for(J=x[q],ne=x[q]+de-1;J<=ne;J++)V=v[J],y[_+V]>=I?y[_+V]-=re:y[_+V]!==0&&(y[_+V]=y[C+V]+G)}for(ae=L;ae<H;ae++){for(q=v[ae],ne=x[q],ce=ne+y[S+q]-1,le=ne,he=0,xe=0,J=ne;J<=ce;J++)if(V=v[J],y[_+V]!==0){var Y=y[_+V]-I;Y>0?(xe+=Y,v[le++]=V,he+=V):(x[V]=Vn(te),y[_+V]=0)}y[S+q]=le-ne+1;var ee=le,B=ne+y[N+q];for(J=ce+1;J<B;J++){k=v[J];var j=y[E+k];j<=0||(xe+=j,v[le++]=k,he+=k)}xe===0?(x[q]=Vn(te),re=-y[E+q],z-=re,T+=re,O+=re,y[E+q]=0,y[S+q]=-1):(y[C+q]=Math.min(y[C+q],xe),v[le]=v[ee],v[ee]=v[ne],v[ne]=te,y[N+q]=le-ne+1,he=(he<0?-he:he)%m,y[A+q]=y[R+he],y[R+he]=q,P[q]=he)}for(y[C+te]=z,d=Math.max(d,z),I=u(I+d,d,y,_,m),ae=L;ae<H;ae++)if(q=v[ae],!(y[E+q]>=0))for(he=P[q],q=y[R+he],y[R+he]=-1;q!==-1&&y[A+q]!==-1;q=y[A+q],I++){for(me=y[N+q],de=y[S+q],J=x[q]+1;J<=x[q]+me-1;J++)y[_+v[J]]=I;var Q=q;for(k=y[A+q];k!==-1;){var Z=y[N+k]===me&&y[S+k]===de;for(J=x[k]+1;Z&&J<=x[k]+me-1;J++)y[_+v[J]]!==I&&(Z=0);Z?(x[k]=Vn(q),y[E+q]+=y[E+k],y[E+k]=0,y[S+k]=-1,k=y[A+k],y[A+Q]=k):(Q=k,k=y[A+k])}}for(J=L,ae=L;ae<H;ae++)q=v[ae],!((re=-y[E+q])<=0)&&(y[E+q]=re,xe=y[C+q]+z-re,xe=Math.min(xe,m-O-re),y[D+xe]!==-1&&(P[y[D+xe]]=q),y[A+q]=y[D+xe],P[q]=-1,y[D+xe]=q,F=Math.min(F,xe),y[C+q]=xe,v[J++]=q);y[E+te]=T,(y[N+te]=J-L)===0&&(x[te]=-1,y[_+te]=0),$!==0&&(g=J)}for(q=0;q<m;q++)x[q]=Vn(x[q]);for(k=0;k<=m;k++)y[D+k]=-1;for(k=m;k>=0;k--)y[E+k]>0||(y[A+k]=y[D+x[k]],y[D+x[k]]=k);for(V=m;V>=0;V--)y[E+V]<=0||x[V]!==-1&&(y[A+V]=y[D+x[V]],y[D+x[V]]=V);for(te=0,q=0;q<=m;q++)x[q]===-1&&(te=Xy(q,te,y,D,A,b,_));return b.splice(b.length-1,1),b};function i(l,s,f,p,m){var d=n(s);if(l===1&&p===f)return t(s,d);if(l===2){for(var h=d._index,w=d._ptr,v=0,x=0;x<f;x++){var g=w[x];if(w[x]=v,!(w[x+1]-g>m))for(var b=w[x+1];g<b;g++)h[v++]=h[g]}return w[f]=v,s=n(d),r(d,s)}return r(d,s)}function a(l,s,f,p,m,d,h,w,v,x,g,b){for(var y=0;y<l;y++)f[p+y]=s[y+1]-s[y];f[p+l]=0;for(var N=0;N<=l;N++)f[m+N]=-1,d[N]=-1,f[h+N]=-1,f[w+N]=-1,f[v+N]=1,f[x+N]=1,f[g+N]=0,f[b+N]=f[p+N];var E=u(0,0,f,x,l);return f[g+l]=-2,s[l]=-1,f[x+l]=0,E}function o(l,s,f,p,m,d,h,w,v,x,g){for(var b=0,y=0;y<l;y++){var N=f[p+y];if(N===0)f[m+y]=-2,b++,s[y]=-1,f[d+y]=0;else if(N>h)f[w+y]=0,f[m+y]=-1,b++,s[y]=Vn(l),f[w+l]++;else{var E=f[v+N];E!==-1&&(x[E]=y),f[g+y]=f[v+N],f[v+N]=y}}return b}function u(l,s,f,p,m){if(l<2||l+s<0){for(var d=0;d<m;d++)f[p+d]!==0&&(f[p+d]=1);l=2}return l}function c(l,s){return l!==s}});function QF(e,t,r,n,i,a,o){var u,c,l=0,s;if(e<=t||r[n+t]<=r[i+e])return-1;r[i+e]=r[n+t];var f=r[a+e];if(r[a+e]=t,f===-1)l=1,s=e;else{for(l=2,s=f;s!==r[o+s];s=r[o+s]);for(u=f;u!==s;u=c)c=r[o+u],r[o+u]=s}return{jleaf:l,q:s}}var ZF="csCounts",XF=["transpose"],YF=U(ZF,XF,e=>{var{transpose:t}=e;return function(r,n,i,a){if(!r||!n||!i)return null;var o=r._size,u=o[0],c=o[1],l,s,f,p,m,d,h,w=4*c+(a?c+u+1:0),v=[],x=0,g=c,b=2*c,y=3*c,N=4*c,E=5*c+1;for(f=0;f<w;f++)v[f]=-1;var A=[],D=t(r),S=D._index,C=D._ptr;for(f=0;f<c;f++)for(s=i[f],A[s]=v[y+s]===-1?1:0;s!==-1&&v[y+s]===-1;s=n[s])v[y+s]=f;if(a){for(f=0;f<c;f++)v[i[f]]=f;for(l=0;l<u;l++){for(f=c,d=C[l],h=C[l+1],m=d;m<h;m++)f=Math.min(f,v[S[m]]);v[E+l]=v[N+f],v[N+f]=l}}for(l=0;l<c;l++)v[x+l]=l;for(f=0;f<c;f++){for(s=i[f],n[s]!==-1&&A[n[s]]--,p=a?v[N+f]:s;p!==-1;p=a?v[E+p]:-1)for(m=C[p];m<C[p+1];m++){l=S[m];var _=QF(l,s,v,y,g,b,x);_.jleaf>=1&&A[s]++,_.jleaf===2&&A[_.q]--}n[s]!==-1&&(v[x+s]=n[s])}for(s=0;s<c;s++)n[s]!==-1&&(A[n[s]]+=A[s]);return A}}),eT="csSqr",tT=["add","multiply","transpose"],rT=U(eT,tT,e=>{var{add:t,multiply:r,transpose:n}=e,i=WF({add:t,multiply:r,transpose:n}),a=YF({transpose:n});return function(u,c,l){var s=c._ptr,f=c._size,p=f[1],m,d={};if(d.q=i(u,c),u&&!d.q)return null;if(l){var h=u?UF(c,null,d.q):c;d.parent=HF(h);var w=$F(d.parent,p);if(d.cp=a(h,d.parent,w,1),h&&d.parent&&d.cp&&o(h,d))for(d.unz=0,m=0;m<p;m++)d.unz+=d.cp[m]}else d.unz=4*s[p]+p,d.lnz=d.unz;return d};function o(u,c){var l=u._ptr,s=u._index,f=u._size,p=f[0],m=f[1];c.pinv=[],c.leftmost=[];var d=c.parent,h=c.pinv,w=c.leftmost,v=[],x=0,g=p,b=p+m,y=p+2*m,N,E,A,D,S;for(E=0;E<m;E++)v[g+E]=-1,v[b+E]=-1,v[y+E]=0;for(N=0;N<p;N++)w[N]=-1;for(E=m-1;E>=0;E--)for(D=l[E],S=l[E+1],A=D;A<S;A++)w[s[A]]=E;for(N=p-1;N>=0;N--)h[N]=-1,E=w[N],E!==-1&&(v[y+E]++===0&&(v[b+E]=N),v[x+N]=v[g+E],v[g+E]=N);for(c.lnz=0,c.m2=p,E=0;E<m;E++)if(N=v[g+E],c.lnz++,N<0&&(N=c.m2++),h[N]=E,!(--y[E]<=0)){c.lnz+=v[y+E];var C=d[E];C!==-1&&(v[y+C]===0&&(v[b+C]=v[b+E]),v[x+v[b+E]]=v[g+C],v[g+C]=v[x+N],v[y+C]+=v[y+E])}for(N=0;N<p;N++)h[N]<0&&(h[N]=E++);return!0}});function Xc(e,t){return e[t]<0}function Yy(e,t){e[t]=Vn(e[t])}function yh(e){return e<0?Vn(e):e}function nT(e,t,r,n,i){var a=t._index,o=t._ptr,u=t._size,c=u[1],l,s,f,p=0;for(n[0]=e;p>=0;){e=n[p];var m=i?i[e]:e;Xc(o,e)||(Yy(o,e),n[c+p]=m<0?0:yh(o[m]));var d=1;for(s=n[c+p],f=m<0?0:yh(o[m+1]);s<f;s++)if(l=a[s],!Xc(o,l)){n[c+p]=s,n[++p]=l,d=0;break}d&&(p--,n[--r]=e)}return r}function iT(e,t,r,n,i){var a=e._ptr,o=e._size,u=t._index,c=t._ptr,l=o[1],s,f,p,m=l;for(f=c[r],p=c[r+1],s=f;s<p;s++){var d=u[s];Xc(a,d)||(m=nT(d,e,m,n,i))}for(s=m;s<l;s++)Yy(a,n[s]);return m}var aT="csSpsolve",oT=["divideScalar","multiply","subtract"],sT=U(aT,oT,e=>{var{divideScalar:t,multiply:r,subtract:n}=e;return function(i,a,o,u,c,l,s){var f=i._values,p=i._index,m=i._ptr,d=i._size,h=d[1],w=a._values,v=a._index,x=a._ptr,g,b,y,N,E=iT(i,a,o,u,l);for(g=E;g<h;g++)c[u[g]]=0;for(b=x[o],y=x[o+1],g=b;g<y;g++)c[v[g]]=w[g];for(var A=E;A<h;A++){var D=u[A],S=l?l[D]:D;if(!(S<0))for(b=m[S],y=m[S+1],c[D]=t(c[D],f[s?b:y-1]),g=s?b+1:b,N=s?y:y-1;g<N;g++){var C=p[g];c[C]=n(c[C],r(f[g],c[D]))}}return E}}),uT="csLu",cT=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],lT=U(uT,cT,e=>{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:a,largerEq:o,SparseMatrix:u}=e,c=sT({divideScalar:r,multiply:n,subtract:i});return function(l,s,f){if(!l)return null;var p=l._size,m=p[1],d,h=100,w=100;s&&(d=s.q,h=s.lnz||h,w=s.unz||w);var v=[],x=[],g=[],b=new u({values:v,index:x,ptr:g,size:[m,m]}),y=[],N=[],E=[],A=new u({values:y,index:N,ptr:E,size:[m,m]}),D=[],S,C,_=[],R=[];for(S=0;S<m;S++)_[S]=0,D[S]=-1,g[S+1]=0;h=0,w=0;for(var P=0;P<m;P++){g[P]=h,E[P]=w;var I=d?d[P]:P,O=c(b,l,I,R,_,D,1),F=-1,q=-1;for(C=O;C<m;C++)if(S=R[C],D[S]<0){var k=t(_[S]);a(k,q)&&(q=k,F=S)}else N[w]=D[S],y[w++]=_[S];if(F===-1||q<=0)return null;D[I]<0&&o(t(_[I]),n(q,f))&&(F=I);var te=_[F];for(N[w]=P,y[w++]=te,D[F]=P,x[h]=F,v[h++]=1,C=O;C<m;C++)S=R[C],D[S]<0&&(x[h]=S,v[h++]=r(_[S],te)),_[S]=0}for(g[m]=h,E[m]=w,C=0;C<h;C++)x[C]=D[x[C]];return v.splice(h,v.length-h),x.splice(h,x.length-h),y.splice(w,y.length-w),N.splice(w,N.length-w),{L:b,U:A,pinv:D}}}),bh="slu",fT=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],pT=U(bh,fT,e=>{var{typed:t,abs:r,add:n,multiply:i,transpose:a,divideScalar:o,subtract:u,larger:c,largerEq:l,SparseMatrix:s}=e,f=rT({add:n,multiply:i,transpose:a}),p=lT({abs:r,divideScalar:o,multiply:i,subtract:u,larger:c,largerEq:l,SparseMatrix:s});return t(bh,{"SparseMatrix, number, number":function(m,d,h){if(!Fe(d)||d<0||d>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(h<0||h>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=f(d,m,!1),v=p(m,w,h);return{L:v.L,U:v.U,p:v.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+`
|
|
47
47
|
U: `+this.U.toString()+`
|
|
48
48
|
p: `+this.p.toString()+(this.q?`
|
|
49
49
|
q: `+this.q.toString():"")+`
|
|
50
|
-
`}}}})});function
|
|
50
|
+
`}}}})});function xh(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}var wh="lusolve",mT=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],dT=U(wh,mT,e=>{var{typed:t,matrix:r,lup:n,slu:i,usolve:a,lsolve:o,DenseMatrix:u}=e,c=Mo({DenseMatrix:u});return t(wh,{"Array, Array | Matrix":function(f,p){f=r(f);var m=n(f),d=s(m.L,m.U,m.p,null,p);return d.valueOf()},"DenseMatrix, Array | Matrix":function(f,p){var m=n(f);return s(m.L,m.U,m.p,null,p)},"SparseMatrix, Array | Matrix":function(f,p){var m=n(f);return s(m.L,m.U,m.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(f,p,m,d){var h=i(f,m,d);return s(h.L,h.U,h.p,h.q,p)},"Object, Array | Matrix":function(f,p){return s(f.L,f.U,f.p,f.q,p)}});function l(f){if(ke(f))return f;if(st(f))return r(f);throw new TypeError("Invalid Matrix LU decomposition")}function s(f,p,m,d,h){f=l(f),p=l(p),m&&(h=c(f,h,!0),h._data=xh(m,h._data));var w=o(f,h),v=a(p,w);return d&&(v._data=xh(d,v._data)),v}}),Nh="polynomialRoot",hT=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],gT=U(Nh,hT,e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:a,multiply:o,divide:u,sqrt:c,unaryMinus:l,cbrt:s,typeOf:f,im:p,re:m}=e;return t(Nh,{"number|Complex, ...number|Complex":(d,h)=>{for(var w=[d,...h];w.length>0&&r(w[w.length-1]);)w.pop();if(w.length<2)throw new RangeError("Polynomial [".concat(d,", ").concat(h,"] must have a non-zero non-constant coefficient"));switch(w.length){case 2:return[l(u(w[0],w[1]))];case 3:{var[v,x,g]=w,b=o(2,g),y=o(x,x),N=o(4,g,v);if(n(y,N))return[u(l(x),b)];var E=c(a(y,N));return[u(a(E,x),b),u(a(l(E),x),b)]}case 4:{var[A,D,S,C]=w,_=l(o(3,C)),R=o(S,S),P=o(3,C,D),I=i(o(2,S,S,S),o(27,C,C,A)),O=o(9,C,S,D);if(n(R,P)&&n(I,O))return[u(S,_)];var F=a(R,P),q=a(I,O),k=i(o(18,C,S,D,A),o(S,S,D,D)),te=i(o(4,S,S,S,A),o(4,C,D,D,D),o(27,C,C,A,A));if(n(k,te))return[u(a(o(4,C,S,D),i(o(9,C,C,A),o(S,S,S))),o(C,F)),u(a(o(9,C,A),o(S,D)),o(2,F))];var se;n(R,P)?se=q:se=u(i(q,c(a(o(q,q),o(4,F,F,F)))),2);var W=!0,V=s(se,W).toArray().map(ue=>u(i(S,ue,u(F,ue)),_));return V.map(ue=>f(ue)==="Complex"&&n(m(ue),m(ue)+p(ue))?m(ue):ue)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(w))}}})}),vT="Help",yT=["evaluate"],bT=U(vT,yT,e=>{var{evaluate:t}=e;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=`
|
|
51
51
|
`;if(n.name&&(i+="Name: "+n.name+`
|
|
52
52
|
|
|
53
53
|
`),n.category&&(i+="Category: "+n.category+`
|
|
@@ -61,52 +61,52 @@ q: `+this.q.toString():"")+`
|
|
|
61
61
|
|
|
62
62
|
`),n.examples){i+=`Examples:
|
|
63
63
|
`;for(var a=!1,o=t("config()"),u={config:f=>(a=!0,t("config(newConfig)",{newConfig:f}))},c=0;c<n.examples.length;c++){var l=n.examples[c];i+=" "+l+`
|
|
64
|
-
`;var s=void 0;try{s=t(l,u)}catch(f){s=f}s!==void 0&&!
|
|
64
|
+
`;var s=void 0;try{s=t(l,u)}catch(f){s=f}s!==void 0&&!Xg(s)&&(i+=" "+Ge(s,{precision:14})+`
|
|
65
65
|
`)}i+=`
|
|
66
66
|
`,a&&t("config(originalConfig)",{originalConfig:o})}return n.mayThrow&&n.mayThrow.length&&(i+="Throws: "+n.mayThrow.join(", ")+`
|
|
67
67
|
|
|
68
68
|
`),n.seealso&&n.seealso.length&&(i+="See also: "+n.seealso.join(", ")+`
|
|
69
|
-
`),i},r.prototype.toJSON=function(){var n=ze(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),fT="Chain",pT=["?on","math","typed"],mT=U(fT,pT,e=>{var{on:t,math:r,typed:n}=e;function i(l){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");$g(l)?this.value=l.value:this.value=l}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Ge(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(l){return new i(l.value)};function a(l,s){typeof s=="function"&&(i.prototype[l]=u(s))}function o(l,s){cN(i.prototype,l,function(){var f=s();if(typeof f=="function")return u(f)})}function u(l){return function(){if(arguments.length===0)return new i(l(this.value));for(var s=[this.value],f=0;f<arguments.length;f++)s[f+1]=arguments[f];if(n.isTypedFunction(l)){var p=n.resolve(l,s);if(p.params.length===1)throw new Error("chain function "+l.name+" cannot match rest parameter between chain value and additional arguments.");return new i(p.implementation.apply(l,s))}return new i(l.apply(l,s))}}i.createProxy=function(l,s){if(typeof l=="string")a(l,s);else{var f=function(m){Me(l,m)&&c[m]===void 0&&o(m,()=>l[m])};for(var p in l)f(p)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(l,s,f){f||o(l,s)}),i},{isClass:!0}),hh={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},dT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},hT={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},gT={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},vT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},yT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},bT={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},xT={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},wT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},NT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},DT={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},gh={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},ET={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},AT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},ST={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},CT={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},MT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},_T={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},FT={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},TT={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},OT={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},BT={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},kT={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},IT={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},RT={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},qT={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},zT={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},jT={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},LT={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},PT={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},VT={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},UT={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},$T={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},HT={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},JT={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},GT={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},WT={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},KT={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},QT={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},ZT={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},XT={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},YT={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},e5={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},t5={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},r5={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},n5={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},i5={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},a5={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},o5={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},s5={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},u5={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},c5={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},l5={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},f5={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},p5={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},m5={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},d5={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},h5={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},g5={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},v5={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},y5={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},b5={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},x5={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},w5={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},N5={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},D5={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},E5={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},A5={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},S5={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},C5={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},M5={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},_5={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},F5={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},T5={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},O5={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},B5={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},k5={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},I5={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},R5={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},q5={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},z5={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},j5={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},L5={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},P5={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},V5={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},U5={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},$5={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},H5={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},J5={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},G5={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},W5={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},K5={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},Q5={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},Z5={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},X5={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},Y5={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},eO={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},tO={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},rO={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},nO={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},iO={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},aO={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},oO={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},sO={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},uO={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},cO={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},lO={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},fO={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},pO={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},mO={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},dO={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},hO={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},gO={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},vO={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},yO={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},bO={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},xO={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},wO={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},NO={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},DO={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},EO={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},AO={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},SO={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},CO={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},MO={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},_O={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},FO={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},TO={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},OO={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},BO={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},kO={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},IO={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},RO={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},qO={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},zO={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},jO={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},LO={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},PO={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},VO={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},UO={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},$O={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},HO={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},JO={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},GO={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},WO={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},KO={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},QO={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},ZO={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},XO={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},YO={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},e8={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},t8={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},r8={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},n8={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},i8={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},a8={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},o8={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},s8={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},u8={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},c8={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},l8={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},f8={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},p8={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},m8={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},d8={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},h8={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},g8={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},v8={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},y8={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},b8={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},x8={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},w8={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},N8={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},D8={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},E8={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},A8={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},S8={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},C8={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},M8={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},_8={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},F8={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},T8={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},O8={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},B8={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},k8={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},I8={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},R8={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},q8={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},z8={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},j8={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},L8={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},P8={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},V8={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},U8={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},$8={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber.
|
|
69
|
+
`),i},r.prototype.toJSON=function(){var n=ze(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),xT="Chain",wT=["?on","math","typed"],NT=U(xT,wT,e=>{var{on:t,math:r,typed:n}=e;function i(l){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Yg(l)?this.value=l.value:this.value=l}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Ge(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(l){return new i(l.value)};function a(l,s){typeof s=="function"&&(i.prototype[l]=u(s))}function o(l,s){yN(i.prototype,l,function(){var f=s();if(typeof f=="function")return u(f)})}function u(l){return function(){if(arguments.length===0)return new i(l(this.value));for(var s=[this.value],f=0;f<arguments.length;f++)s[f+1]=arguments[f];if(n.isTypedFunction(l)){var p=n.resolve(l,s);if(p.params.length===1)throw new Error("chain function "+l.name+" cannot match rest parameter between chain value and additional arguments.");return new i(p.implementation.apply(l,s))}return new i(l.apply(l,s))}}i.createProxy=function(l,s){if(typeof l=="string")a(l,s);else{var f=function(m){Me(l,m)&&c[m]===void 0&&o(m,()=>l[m])};for(var p in l)f(p)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(l,s,f){f||o(l,s)}),i},{isClass:!0}),Dh={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},DT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},ET={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},AT={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},ST={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},CT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},MT={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},_T={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},FT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},TT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},OT={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},Eh={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},BT={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},kT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},IT={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},RT={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},qT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},zT={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},jT={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},LT={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},PT={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},VT={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},UT={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},$T={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},HT={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},JT={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},GT={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},KT={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},WT={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},QT={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},ZT={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},XT={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},YT={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},e5={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},t5={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},r5={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},n5={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},i5={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},a5={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},o5={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},s5={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},u5={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},c5={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},l5={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},f5={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},p5={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},m5={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},d5={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},h5={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},g5={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},v5={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},y5={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},b5={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},x5={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},w5={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},N5={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},D5={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},E5={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},A5={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},S5={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},C5={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},M5={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},_5={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},F5={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},T5={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},O5={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},B5={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},k5={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},I5={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},R5={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},q5={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},z5={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},j5={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},L5={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},P5={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},V5={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},U5={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},$5={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},H5={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},J5={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},G5={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},K5={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},W5={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},Q5={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},Z5={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},X5={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},Y5={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},eO={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},tO={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},rO={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},nO={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},iO={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},aO={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},oO={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},sO={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},uO={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},cO={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},lO={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},fO={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},pO={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},mO={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},dO={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},hO={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},gO={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},vO={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},yO={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},bO={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},xO={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},wO={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},NO={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},DO={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},EO={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},AO={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},SO={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},CO={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},MO={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},_O={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},FO={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},TO={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},OO={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},BO={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},kO={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},IO={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},RO={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},qO={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},zO={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},jO={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},LO={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},PO={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},VO={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},UO={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},$O={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},HO={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},JO={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},GO={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},KO={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},WO={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},QO={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},ZO={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},XO={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},YO={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},e8={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},t8={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},r8={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},n8={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},i8={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},a8={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},o8={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},s8={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},u8={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},c8={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},l8={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},f8={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},p8={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},m8={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},d8={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},h8={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},g8={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},v8={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},y8={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},b8={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},x8={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},w8={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},N8={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},D8={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},E8={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},A8={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},S8={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},C8={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},M8={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},_8={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},F8={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},T8={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},O8={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},B8={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},k8={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},I8={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},R8={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},q8={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},z8={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},j8={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},L8={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},P8={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},V8={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},U8={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},$8={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},H8={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},J8={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},G8={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},K8={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},W8={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},Q8={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},Z8={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},X8={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},Y8={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber.
|
|
70
70
|
|
|
71
|
-
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},H8={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},J8={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},G8={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},W8={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},K8={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},Q8={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},Z8={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},X8={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},Y8={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},eB={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},tB={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},rB={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},nB={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},iB={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},aB={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},oB={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},sB={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},uB={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},cB={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},lB={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},fB={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},pB={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},mB={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},dB={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},hB={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},gB={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},vB={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},yB={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},bB={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},xB={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},wB={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},NB={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},DB={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},EB={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},AB={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},SB={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},CB={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},MB={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},_B={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},FB={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},TB={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},OB={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},BB={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},kB={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},IB={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},RB={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},qB={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},zB={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},jB={bignumber:_T,boolean:FT,complex:TT,createUnit:OT,fraction:BT,index:kT,matrix:IT,number:RT,sparse:qT,splitUnit:zT,string:jT,unit:LT,e:hh,E:hh,false:dT,i:hT,Infinity:gT,LN2:yT,LN10:vT,LOG2E:xT,LOG10E:bT,NaN:wT,null:NT,pi:gh,PI:gh,phi:DT,SQRT1_2:ET,SQRT2:AT,tau:ST,true:CT,version:MT,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:$T,lsolve:JT,lsolveAll:GT,lup:WT,lusolve:KT,leafCount:HT,polynomialRoot:QT,resolve:YT,simplify:e5,simplifyConstant:t5,simplifyCore:r5,symbolicEqual:i5,rationalize:XT,slu:n5,usolve:a5,usolveAll:o5,qr:ZT,abs:s5,add:u5,cbrt:c5,ceil:l5,cube:f5,divide:p5,dotDivide:m5,dotMultiply:d5,dotPow:h5,exp:g5,expm:v5,expm1:y5,fix:b5,floor:x5,gcd:w5,hypot:N5,lcm:E5,log:A5,log2:M5,log1p:C5,log10:S5,mod:_5,multiply:F5,norm:T5,nthRoot:O5,nthRoots:B5,pow:k5,round:I5,sign:R5,sqrt:q5,sqrtm:z5,square:V5,subtract:U5,unaryMinus:$5,unaryPlus:H5,xgcd:J5,invmod:D5,bitAnd:G5,bitNot:W5,bitOr:K5,bitXor:Q5,leftShift:Z5,rightArithShift:X5,rightLogShift:Y5,bellNumbers:eO,catalan:tO,composition:rO,stirlingS2:nO,config:PT,import:VT,typed:UT,arg:iO,conj:aO,re:sO,im:oO,evaluate:uO,help:cO,distance:lO,intersect:fO,and:pO,not:mO,or:dO,xor:hO,concat:vO,count:yO,cross:bO,column:gO,ctranspose:xO,det:wO,diag:NO,diff:DO,dot:EO,getMatrixDataType:_O,identity:FO,filter:SO,flatten:CO,forEach:MO,inv:TO,pinv:OO,eigs:AO,kron:BO,matrixFromFunction:RO,matrixFromRows:qO,matrixFromColumns:IO,map:kO,ones:zO,partitionSelect:jO,range:LO,resize:VO,reshape:PO,rotate:UO,rotationMatrix:$O,row:HO,size:JO,sort:GO,squeeze:WO,subset:KO,trace:QO,transpose:ZO,zeros:XO,fft:YO,ifft:e8,sylvester:j5,schur:L5,lyap:P5,solveODE:zB,combinations:t8,combinationsWithRep:r8,factorial:n8,gamma:i8,kldivergence:o8,lgamma:a8,multinomial:s8,permutations:u8,pickRandom:c8,random:l8,randomInt:f8,compare:p8,compareNatural:m8,compareText:d8,deepEqual:h8,equal:g8,equalText:v8,larger:y8,largerEq:b8,smaller:x8,smallerEq:w8,unequal:N8,setCartesian:D8,setDifference:E8,setDistinct:A8,setIntersect:S8,setIsSubset:C8,setMultiplicity:M8,setPowerset:_8,setSize:F8,setSymDifference:T8,setUnion:O8,zpk2tf:B8,freqz:k8,erf:I8,zeta:R8,cumsum:J8,mad:q8,max:z8,mean:j8,median:L8,min:P8,mode:V8,prod:U8,quantileSeq:$8,std:H8,sum:G8,variance:W8,corr:K8,acos:Q8,acosh:Z8,acot:X8,acoth:Y8,acsc:eB,acsch:tB,asec:rB,asech:nB,asin:iB,asinh:aB,atan:oB,atanh:uB,atan2:sB,cos:cB,cosh:lB,cot:fB,coth:pB,csc:mB,csch:dB,sec:hB,sech:gB,sin:vB,sinh:yB,tan:bB,tanh:xB,to:wB,clone:DB,format:EB,bin:NB,oct:IB,hex:SB,isNaN:MB,isInteger:CB,isNegative:_B,isNumeric:FB,hasNumericValue:AB,isPositive:TB,isPrime:OB,isZero:BB,print:RB,typeOf:qB,numeric:kB},vh="help",LB=["typed","mathWithTransform","Help"],PB=U(vh,LB,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(vh,{any:function(i){var a,o=i;if(typeof i!="string"){for(a in r)if(Me(r,a)&&i===r[a]){o=a;break}}var u=nr(jB,o);if(!u){var c=typeof o=="function"?o.name:o;throw new Error('No documentation found on "'+c+'"')}return new n(u)}})}),yh="chain",VB=["typed","Chain"],UB=U(yh,VB,e=>{var{typed:t,Chain:r}=e;return t(yh,{"":function(){return new r},any:function(n){return new r(n)}})}),bh="det",$B=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],HB=U(bh,$B,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(bh,{any:function(l){return ze(l)},"Array | Matrix":function(l){var s;switch(ke(l)?s=l.size():Array.isArray(l)?(l=r(l),s=l.size()):s=[],s.length){case 0:return ze(l);case 1:if(s[0]===1)return ze(l.valueOf()[0]);if(s[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")");case 2:{var f=s[0],p=s[1];if(f===p)return c(l.clone().valueOf(),f);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(s)+")")}}});function c(l,s,f){if(s===1)return ze(l[0][0]);if(s===2)return n(i(l[0][0],l[1][1]),i(l[1][0],l[0][1]));for(var p=!1,m=new Array(s).fill(0).map((E,A)=>A),d=0;d<s;d++){var h=m[d];if(o(l[h][d])){var w=void 0;for(w=d+1;w<s;w++)if(!o(l[m[w]][d])){h=m[w],m[w]=m[d],m[d]=h,p=!p;break}if(w===s)return l[h][d]}for(var v=l[h][d],x=d===0?1:l[m[d-1]][d-1],g=d+1;g<s;g++)for(var b=m[g],y=d+1;y<s;y++)l[b][y]=a(n(i(l[b][y],v),i(l[b][d],l[h][y])),x)}var N=l[m[s-1]][s-1];return p?u(N):N}}),xh="inv",JB=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],GB=U(xh,JB,e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:c,abs:l}=e;return t(xh,{"Array | Matrix":function(f){var p=ke(f)?f.size():Ve(f);switch(p.length){case 1:if(p[0]===1)return ke(f)?r([n(1,f.valueOf()[0])]):[n(1,f[0])];throw new RangeError("Matrix must be square (size: "+Ge(p)+")");case 2:{var m=p[0],d=p[1];if(m===d)return ke(f)?r(s(f.valueOf(),m,d),f.storage()):s(f,m,d);throw new RangeError("Matrix must be square (size: "+Ge(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(p)+")")}},any:function(f){return n(1,f)}});function s(f,p,m){var d,h,w,v,x;if(p===1){if(v=f[0][0],v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,v)]]}else if(p===2){var g=u(f);if(g===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],g),n(o(f[0][1]),g)],[n(o(f[1][0]),g),n(f[0][0],g)]]}else{var b=f.concat();for(d=0;d<p;d++)b[d]=b[d].concat();for(var y=c(p).valueOf(),N=0;N<m;N++){var E=l(b[N][N]),A=N;for(d=N+1;d<p;)l(b[d][N])>E&&(E=l(b[d][N]),A=d),d++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");d=A,d!==N&&(x=b[N],b[N]=b[d],b[d]=x,x=y[N],y[N]=y[d],y[d]=x);var D=b[N],S=y[N];for(d=0;d<p;d++){var C=b[d],_=y[d];if(d!==N){if(C[N]!==0){for(w=n(o(C[N]),D[N]),h=N;h<m;h++)C[h]=i(C[h],a(w,D[h]));for(h=0;h<m;h++)_[h]=i(_[h],a(w,S[h]))}}else{for(w=D[N],h=N;h<m;h++)C[h]=n(C[h],w);for(h=0;h<m;h++)_[h]=n(_[h],w)}}}return y}}}),wh="pinv",WB=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],KB=U(wh,WB,e=>{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:o,dot:u,ctranspose:c,divideScalar:l,multiply:s,add:f,Complex:p}=e;return t(wh,{"Array | Matrix":function(x){var g=ke(x)?x.size():Ve(x);switch(g.length){case 1:return v(x)?c(x):g[0]===1?n(x):o(c(x),u(x,x));case 2:{if(v(x))return c(x);var b=g[0],y=g[1];if(b===y)try{return n(x)}catch(N){if(!(N instanceof Error&&N.message.match(/Cannot calculate inverse, determinant is zero/)))throw N}return ke(x)?r(m(x.valueOf(),b,y),x.storage()):m(x,b,y)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(g)+")")}},any:function(x){return a(x,0)?ze(x):l(1,x)}});function m(x,g,b){var{C:y,F:N}=h(x,g,b),E=s(n(s(c(y),y)),c(y)),A=s(c(N),n(s(N,c(N))));return s(A,E)}function d(x,g,b){for(var y=ze(x),N=0,E=0;E<g;E++){if(b<=N)return y;for(var A=E;w(y[A][N]);)if(A++,g===A&&(A=E,N++,b===N))return y;[y[A],y[E]]=[y[E],y[A]];for(var D=y[E][N],S=0;S<b;S++)y[E][S]=o(y[E][S],D);for(var C=0;C<g;C++)if(C!==E){D=y[C][N];for(var _=0;_<b;_++)y[C][_]=f(y[C][_],s(-1,s(D,y[E][_])))}N++}return y}function h(x,g,b){var y=d(x,g,b),N=x.map((A,D)=>A.filter((S,C)=>C<g&&!w(u(y[C],y[C])))),E=y.filter((A,D)=>!w(u(y[D],y[D])));return{C:N,F:E}}function w(x){return a(f(x,p(1,1)),f(0,p(1,1)))}function v(x){return i(f(x,p(1,1)),f(s(x,0),p(1,1)))}});function QB(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:c,bignumber:l,diag:s,size:f,reshape:p,inv:m,qr:d,usolve:h,usolveAll:w,equal:v,complex:x,larger:g,smaller:b,matrixFromColumns:y,dot:N}=e;function E(K,V,ue,me){var re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ae=A(K,V,ue,me,re);D(K,V,ue,me,re,ae);var{values:de,C:ne}=S(K,V,ue,me,re);if(re){var ce=C(K,V,ne,ae,de,ue,me);return{values:de,eigenvectors:ce}}return{values:de}}function A(K,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(0):0,ce=ae?l(1):de?x(1):1,le=ae?l(1):1,he=ae?l(10):2,xe=a(he,he),$;re&&($=Array(V).fill(ce));for(var T=!1;!T;){T=!0;for(var z=0;z<V;z++){for(var J=ne,L=ne,H=0;H<V;H++)z!==H&&(J=t(J,c(K[H][z])),L=t(L,c(K[z][H])));if(!v(J,0)&&!v(L,0)){for(var G=le,Y=J,ee=o(L,he),B=a(L,he);b(Y,ee);)Y=a(Y,xe),G=a(G,he);for(;g(Y,B);)Y=o(Y,xe),G=o(G,he);var j=b(o(t(Y,L),G),a(t(J,L),.95));if(j){T=!1;for(var Q=o(1,G),Z=0;Z<V;Z++)z!==Z&&(K[z][Z]=a(K[z][Z],Q),K[Z][z]=a(K[Z][z],G));re&&($[z]=a($[z],Q))}}}}return re?s($):null}function D(K,V,ue,me,re,ae){var de=me==="BigNumber",ne=me==="Complex",ce=de?l(0):ne?x(0):0;de&&(ue=l(ue));for(var le=0;le<V-2;le++){for(var he=0,xe=ce,$=le+1;$<V;$++){var T=K[$][le];b(c(xe),c(T))&&(xe=T,he=$)}if(!b(c(xe),ue)){if(he!==le+1){var z=K[he];K[he]=K[le+1],K[le+1]=z;for(var J=0;J<V;J++){var L=K[J][he];K[J][he]=K[J][le+1],K[J][le+1]=L}if(re){var H=ae[he];ae[he]=ae[le+1],ae[le+1]=H}}for(var G=le+2;G<V;G++){var Y=o(K[G][le],xe);if(Y!==0){for(var ee=0;ee<V;ee++)K[G][ee]=r(K[G][ee],a(Y,K[le+1][ee]));for(var B=0;B<V;B++)K[B][le+1]=t(K[B][le+1],a(Y,K[B][G]));if(re)for(var j=0;j<V;j++)ae[G][j]=r(ae[G][j],a(Y,ae[le+1][j]))}}}}return ae}function S(K,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(1):de?x(1):1;ae&&(ue=l(ue));for(var ce=ze(K),le=[],he=V,xe=[],$=re?s(Array(V).fill(ne)):void 0,T=re?s(Array(he).fill(ne)):void 0,z=0;z<=100;){z+=1;for(var J=ce[he-1][he-1],L=0;L<he;L++)ce[L][L]=r(ce[L][L],J);var{Q:H,R:G}=d(ce);ce=i(G,H);for(var Y=0;Y<he;Y++)ce[Y][Y]=t(ce[Y][Y],J);if(re&&(T=i(T,H)),he===1||b(c(ce[he-1][he-2]),ue)){z=0,le.push(ce[he-1][he-1]),re&&(xe.unshift([[1]]),P(T,V),$=i($,T),he>1&&(T=s(Array(he-1).fill(ne)))),he-=1,ce.pop();for(var ee=0;ee<he;ee++)ce[ee].pop()}else if(he===2||b(c(ce[he-2][he-3]),ue)){z=0;var B=_(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1]);le.push(...B),re&&(xe.unshift(R(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1],B[0],B[1],ue,me)),P(T,V),$=i($,T),he>2&&(T=s(Array(he-2).fill(ne)))),he-=2,ce.pop(),ce.pop();for(var j=0;j<he;j++)ce[j].pop(),ce[j].pop()}if(he===0)break}if(le.sort((ie,oe)=>+r(c(ie),c(oe))),z>100){var Q=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+le.join(", "));throw Q.values=le,Q.vectors=[],Q}var Z=re?i($,I(xe,V)):void 0;return{values:le,C:Z}}function C(K,V,ue,me,re,ae,de){var ne=m(ue),ce=i(ne,K,ue),le=de==="BigNumber",he=de==="Complex",xe=le?l(0):he?x(0):0,$=le?l(1):he?x(1):1,T=[],z=[];for(var J of re){var L=O(T,J,v);L===-1?(T.push(J),z.push(1)):z[L]+=1}for(var H=[],G=T.length,Y=Array(V).fill(xe),ee=s(Array(V).fill($)),B=function(){var Q=T[j],Z=r(ce,i(Q,ee)),ie=w(Z,Y);for(ie.shift();ie.length<z[j];){var oe=F(Z,V,ie,ae,de);if(oe===null)break;ie.push(oe)}var ye=i(m(me),ue);ie=ie.map(fe=>i(ye,fe)),H.push(...ie.map(fe=>({value:Q,vector:n(fe)})))},j=0;j<G;j++)B();return H}function _(K,V,ue,me){var re=t(K,me),ae=r(a(K,me),a(V,ue)),de=a(re,.5),ne=a(u(r(a(re,re),a(4,ae))),.5);return[t(de,ne),r(de,ne)]}function R(K,V,ue,me,re,ae,de,ne){var ce=ne==="BigNumber",le=ne==="Complex",he=ce?l(0):le?x(0):0,xe=ce?l(1):le?x(1):1;if(b(c(ue),de))return[[xe,he],[he,xe]];if(g(c(r(re,ae)),de))return[[r(re,me),r(ae,me)],[ue,ue]];var $=r(K,re),T=r(me,re);return b(c(V),de)&&b(c(T),de)?[[$,xe],[ue,he]]:[[V,he],[T,xe]]}function P(K,V){for(var ue=0;ue<K.length;ue++)K[ue].push(...Array(V-K[ue].length).fill(0));for(var me=K.length;me<V;me++)K.push(Array(V).fill(0)),K[me][me]=1;return K}function I(K,V){for(var ue=[],me=0;me<V;me++)ue[me]=Array(V).fill(0);var re=0;for(var ae of K){for(var de=ae.length,ne=0;ne<de;ne++)for(var ce=0;ce<de;ce++)ue[re+ne][re+ce]=ae[ne][ce];re+=de}return ue}function O(K,V,ue){for(var me=0;me<K.length;me++)if(ue(K[me],V))return me;return-1}function F(K,V,ue,me,re){for(var ae=re==="BigNumber"?l(1e3):1e3,de,ne=0;ne<5;++ne){de=q(V,ue,re);try{de=h(K,de)}catch{continue}if(g(te(de),ae))break}if(ne>=5)return null;for(ne=0;;){var ce=h(K,de);if(b(te(k(de,[ce])),me))break;if(++ne>=10)return null;de=se(ce)}return de}function q(K,V,ue){var me=ue==="BigNumber",re=ue==="Complex",ae=Array(K).fill(0).map(de=>2*Math.random()-1);return me&&(ae=ae.map(de=>l(de))),re&&(ae=ae.map(de=>x(de))),ae=k(ae,V),se(ae,ue)}function k(K,V){var ue=f(K);for(var me of V)me=p(me,ue),K=r(K,i(o(N(me,K),N(me,me)),me));return K}function te(K){return c(u(N(K,K)))}function se(K,V){var ue=V==="BigNumber",me=V==="Complex",re=ue?l(1):me?x(1):1;return i(o(re,te(K)),K)}return E}function ZB(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:a,cos:o,sin:u,multiplyScalar:c,inv:l,bignumber:s,multiply:f,add:p}=e;function m(D,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.epsilon,_=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(_==="number")return d(D,C,R);if(_==="BigNumber")return h(D,C,R);throw TypeError("Unsupported data type: "+_)}function d(D,S,C){var _=D.length,R=Math.abs(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=N(D);Math.abs(F[1])>=Math.abs(R);){var q=F[0][0],k=F[0][1];P=w(D[q][q],D[k][k],D[q][k]),D=y(D,P,q,k),C&&(I=x(I,P,q,k)),F=N(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function h(D,S,C){var _=D.length,R=i(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=E(D);i(F[1])>=i(R);){var q=F[0][0],k=F[0][1];P=v(D[q][q],D[k][k],D[q][k]),D=b(D,P,q,k),C&&(I=g(I,P,q,k)),F=E(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function w(D,S,C){var _=S-D;return Math.abs(_)<=t.epsilon?Math.PI/4:.5*Math.atan(2*C/(S-D))}function v(D,S,C){var _=n(S,D);return i(_)<=t.epsilon?s(-1).acos().div(4):c(.5,a(f(2,C,l(_))))}function x(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=Array(R).fill(0),F=Array(R).fill(0),q=0;q<R;q++)O[q]=P*D[q][C]-I*D[q][_],F[q]=I*D[q][C]+P*D[q][_];for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function g(D,S,C,_){for(var R=D.length,P=o(S),I=u(S),O=Array(R).fill(s(0)),F=Array(R).fill(s(0)),q=0;q<R;q++)O[q]=n(c(P,D[q][C]),c(I,D[q][_])),F[q]=r(c(I,D[q][C]),c(P,D[q][_]));for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function b(D,S,C,_){for(var R=D.length,P=s(o(S)),I=s(u(S)),O=c(P,P),F=c(I,I),q=Array(R).fill(s(0)),k=Array(R).fill(s(0)),te=f(s(2),P,I,D[C][_]),se=r(n(c(O,D[C][C]),te),c(F,D[_][_])),K=p(c(F,D[C][C]),te,c(O,D[_][_])),V=0;V<R;V++)q[V]=n(c(P,D[C][V]),c(I,D[_][V])),k[V]=r(c(I,D[C][V]),c(P,D[_][V]));D[C][C]=se,D[_][_]=K,D[C][_]=s(0),D[_][C]=s(0);for(var ue=0;ue<R;ue++)ue!==C&&ue!==_&&(D[C][ue]=q[ue],D[ue][C]=q[ue],D[_][ue]=k[ue],D[ue][_]=k[ue]);return D}function y(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=P*P,F=I*I,q=Array(R).fill(0),k=Array(R).fill(0),te=O*D[C][C]-2*P*I*D[C][_]+F*D[_][_],se=F*D[C][C]+2*P*I*D[C][_]+O*D[_][_],K=0;K<R;K++)q[K]=P*D[C][K]-I*D[_][K],k[K]=I*D[C][K]+P*D[_][K];D[C][C]=te,D[_][_]=se,D[C][_]=0,D[_][C]=0;for(var V=0;V<R;V++)V!==C&&V!==_&&(D[C][V]=q[V],D[V][C]=q[V],D[_][V]=k[V],D[V][_]=k[V]);return D}function N(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)Math.abs(C)<Math.abs(D[R][P])&&(C=Math.abs(D[R][P]),_=[R,P]);return[_,C]}function E(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)i(C)<i(D[R][P])&&(C=i(D[R][P]),_=[R,P]);return[_,C]}function A(D,S,C){var _=D.length,R=Array(_),P;if(C){P=Array(_);for(var I=0;I<_;I++)P[I]=Array(_)}for(var O=0;O<_;O++){for(var F=0,q=D[0],k=0;k<D.length;k++)i(D[k])<i(q)&&(F=k,q=D[F]);if(R[O]=D.splice(F,1)[0],C)for(var te=0;te<_;te++)P[O][te]=S[te][F],S[te].splice(F,1)}if(!C)return{values:R};var se=P.map((K,V)=>({value:R[V],vector:K}));return{values:R,eigenvectors:se}}return m}var XB="eigs",YB=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],e6=U(XB,YB,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:a,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,divideScalar:p,inv:m,bignumber:d,multiply:h,add:w,larger:v,column:x,flatten:g,number:b,complex:y,sqrt:N,diag:E,size:A,reshape:D,qr:S,usolve:C,usolveAll:_,im:R,re:P,smaller:I,matrixFromColumns:O,dot:F}=e,q=ZB({config:t,addScalar:i,subtract:a,column:x,flatten:g,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,inv:m,bignumber:d,complex:y,multiply:h,add:w}),k=QB({config:t,addScalar:i,subtract:a,multiply:h,multiplyScalar:f,flatten:g,divideScalar:p,sqrt:N,abs:u,bignumber:d,diag:E,size:A,reshape:D,qr:S,inv:m,usolve:C,usolveAll:_,equal:o,complex:y,larger:v,smaller:I,matrixFromColumns:O,dot:F});return r("eigs",{Array:function(re){return te(n(re))},"Array, number|BigNumber":function(re,ae){return te(n(re),{precision:ae})},"Array, Object"(re,ae){return te(n(re),ae)},Matrix:function(re){return te(re,{matricize:!0})},"Matrix, number|BigNumber":function(re,ae){return te(re,{precision:ae,matricize:!0})},"Matrix, Object":function(re,ae){var de={matricize:!0};return Ot(de,ae),te(re,de)}});function te(re){var ae,de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne="eigenvectors"in de?de.eigenvectors:!0,ce=(ae=de.precision)!==null&&ae!==void 0?ae:t.epsilon,le=se(re,ce,ne);return de.matricize&&(le.values=n(le.values),ne&&(le.eigenvectors=le.eigenvectors.map(he=>{var{value:xe,vector:$}=he;return{value:xe,vector:n($)}}))),ne&&Object.defineProperty(le,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),le}function se(re,ae,de){var ne=re.toArray(),ce=re.size();if(ce.length!==2||ce[0]!==ce[1])throw new RangeError("Matrix must be square (size: ".concat(Ge(ce),")"));var le=ce[0];if(V(ne,le,ae)&&(ue(ne,le),K(ne,le,ae))){var he=me(re,ne,le);return q(ne,le,ae,he,de)}var xe=me(re,ne,le);return k(ne,le,ae,xe,de)}function K(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=ne;ce<ae;ce++)if(v(d(u(a(re[ne][ce],re[ce][ne]))),de))return!1;return!0}function V(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=0;ce<ae;ce++)if(v(d(u(R(re[ne][ce]))),de))return!1;return!0}function ue(re,ae){for(var de=0;de<ae;de++)for(var ne=0;ne<ae;ne++)re[de][ne]=P(re[de][ne])}function me(re,ae,de){var ne=re.datatype();if(ne==="number"||ne==="BigNumber"||ne==="Complex")return ne;for(var ce=!1,le=!1,he=!1,xe=0;xe<de;xe++)for(var $=0;$<de;$++){var T=ae[xe][$];if(Ue(T)||bo(T))ce=!0;else if($e(T))le=!0;else if(wn(T))he=!0;else throw TypeError("Unsupported type in Matrix: "+dt(T))}if(le&&he&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),he){for(var z=0;z<de;z++)for(var J=0;J<de;J++)ae[z][J]=y(ae[z][J]);return"Complex"}if(le){for(var L=0;L<de;L++)for(var H=0;H<de;H++)ae[L][H]=d(ae[L][H]);return"BigNumber"}if(ce){for(var G=0;G<de;G++)for(var Y=0;Y<de;Y++)ae[G][Y]=b(ae[G][Y]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),Nh="expm",t6=["typed","abs","add","identity","inv","multiply"],r6=U(Nh,t6,e=>{var{typed:t,abs:r,add:n,identity:i,inv:a,multiply:o}=e;return t(Nh,{Matrix:function(s){var f=s.size();if(f.length!==2||f[0]!==f[1])throw new RangeError("Matrix must be square (size: "+Ge(f)+")");for(var p=f[0],m=1e-15,d=u(s),h=c(d,m),w=h.q,v=h.j,x=o(s,Math.pow(2,-v)),g=i(p),b=i(p),y=1,N=x,E=-1,A=1;A<=w;A++)A>1&&(N=o(N,x),E=-E),y=y*(w-A+1)/((2*w-A+1)*A),g=n(g,o(y,N)),b=n(b,o(y*E,N));for(var D=o(a(b),g),S=0;S<v;S++)D=o(D,D);return wi(s)?s.createSparseMatrix(D):D}});function u(s){for(var f=s.size()[0],p=0,m=0;m<f;m++){for(var d=0,h=0;h<f;h++)d+=r(s.get([m,h]));p=Math.max(d,p)}return p}function c(s,f){for(var p=30,m=0;m<p;m++)for(var d=0;d<=m;d++){var h=m-d;if(l(s,d,h)<f)return{q:d,j:h}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function l(s,f,p){for(var m=1,d=2;d<=f;d++)m*=d;for(var h=m,w=f+1;w<=2*f;w++)h*=w;var v=h*(2*f+1);return 8*Math.pow(s/Math.pow(2,p),2*f)*m*m/(h*v)}}),Dh="sqrtm",n6=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],i6=U(Dh,n6,e=>{var{typed:t,abs:r,add:n,multiply:i,map:a,sqrt:o,subtract:u,inv:c,size:l,max:s,identity:f}=e,p=1e3,m=1e-6;function d(h){var w,v=0,x=h,g=f(l(h));do{var b=x;if(x=i(.5,n(b,c(g))),g=i(.5,n(g,c(b))),w=s(r(u(x,b))),w>m&&++v>p)throw new Error("computing square root of matrix: iterative method could not converge")}while(w>m);return x}return t(Dh,{"Array | Matrix":function(h){var w=ke(h)?h.size():Ve(h);switch(w.length){case 1:if(w[0]===1)return a(h,o);throw new RangeError("Matrix must be square (size: "+Ge(w)+")");case 2:{var v=w[0],x=w[1];if(v===x)return d(h);throw new RangeError("Matrix must be square (size: "+Ge(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ge(w)+")")}}})}),Eh="sylvester",a6=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],o6=U(Eh,a6,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:o,concat:u,transpose:c,index:l,subset:s,add:f,subtract:p,identity:m,lusolve:d,abs:h}=e;return t(Eh,{"Matrix, Matrix, Matrix":w,"Array, Matrix, Matrix":function(v,x,g){return w(i(v),x,g)},"Array, Array, Matrix":function(v,x,g){return w(i(v),i(x),g)},"Array, Matrix, Array":function(v,x,g){return w(i(v),x,i(g))},"Matrix, Array, Matrix":function(v,x,g){return w(v,i(x),g)},"Matrix, Array, Array":function(v,x,g){return w(v,i(x),i(g))},"Matrix, Matrix, Array":function(v,x,g){return w(v,x,i(g))},"Array, Array, Array":function(v,x,g){return w(i(v),i(x),i(g)).toArray()}});function w(v,x,g){for(var b=x.size()[0],y=v.size()[0],N=r(v),E=N.T,A=N.U,D=r(a(-1,x)),S=D.T,C=D.U,_=a(a(c(A),g),C),R=o(0,y),P=[],I=(he,xe)=>u(he,xe,1),O=(he,xe)=>u(he,xe,0),F=0;F<b;F++)if(F<b-1&&h(s(S,l(F+1,F)))>1e-5){for(var q=O(s(_,l(R,F)),s(_,l(R,F+1))),k=0;k<F;k++)q=f(q,O(a(P[k],s(S,l(k,F))),a(P[k],s(S,l(k,F+1)))));var te=a(m(y),a(-1,s(S,l(F,F)))),se=a(m(y),a(-1,s(S,l(F+1,F)))),K=a(m(y),a(-1,s(S,l(F,F+1)))),V=a(m(y),a(-1,s(S,l(F+1,F+1)))),ue=O(I(f(E,te),se),I(K,f(E,V))),me=d(ue,q);P[F]=me.subset(l(o(0,y),0)),P[F+1]=me.subset(l(o(y,2*y),0)),F++}else{for(var re=s(_,l(R,F)),ae=0;ae<F;ae++)re=f(re,a(P[ae],s(S,l(ae,F))));var de=s(S,l(F,F)),ne=p(E,a(de,m(y)));P[F]=d(ne,re)}var ce=i(n(...P)),le=a(A,a(ce,c(C)));return le}}),Ah="schur",s6=["typed","matrix","identity","multiply","qr","norm","subtract"],u6=U(Ah,s6,e=>{var{typed:t,matrix:r,identity:n,multiply:i,qr:a,norm:o,subtract:u}=e;return t(Ah,{Array:function(l){var s=c(r(l));return{U:s.U.valueOf(),T:s.T.valueOf()}},Matrix:function(l){return c(l)}});function c(l){var s=l.size()[0],f=l,p=n(s),m=0,d;do{d=f;var h=a(f),w=h.Q,v=h.R;if(f=i(v,w),p=i(p,w),m++>100)break}while(o(u(f,d))>1e-4);return{U:p,T:f}}}),Sh="lyap",c6=["typed","matrix","sylvester","multiply","transpose"],l6=U(Sh,c6,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(Sh,{"Matrix, Matrix":function(o,u){return n(o,a(o),i(-1,u))},"Array, Matrix":function(o,u){return n(r(o),a(r(o)),i(-1,u))},"Matrix, Array":function(o,u){return n(o,a(r(o)),r(i(-1,u)))},"Array, Array":function(o,u){return n(r(o),a(r(o)),r(i(-1,u))).toArray()}})}),f6="divide",p6=["typed","matrix","multiply","equalScalar","divideScalar","inv"],m6=U(f6,p6,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e,u=Jt({typed:t,equalScalar:i}),c=Jr({typed:t});return t("divide",Hg({"Array | Matrix, Array | Matrix":function(l,s){return n(l,o(s))},"DenseMatrix, any":function(l,s){return c(l,s,a,!1)},"SparseMatrix, any":function(l,s){return u(l,s,a,!1)},"Array, any":function(l,s){return c(r(l),s,a,!1).valueOf()},"any, Array | Matrix":function(l,s){return n(l,o(s))}},a.signatures))}),Ch="distance",d6=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],h6=U(Ch,d6,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:u,abs:c}=e;return t(Ch,{"Array, Array, Array":function(b,y,N){if(b.length===2&&y.length===2&&N.length===2){if(!s(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(y))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(N))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(y,N))throw new TypeError("LinePoint1 should not be same with LinePoint2");var E=n(N[1],y[1]),A=n(y[0],N[0]),D=n(i(N[0],y[1]),i(y[0],N[1]));return w(b[0],b[1],E,A,D)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(b,y,N){if(Object.keys(b).length===2&&Object.keys(y).length===2&&Object.keys(N).length===2){if(!s(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(N))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(d(y),d(N)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in b&&"pointY"in b&&"lineOnePtX"in y&&"lineOnePtY"in y&&"lineTwoPtX"in N&&"lineTwoPtY"in N){var E=n(N.lineTwoPtY,y.lineOnePtY),A=n(y.lineOnePtX,N.lineTwoPtX),D=n(i(N.lineTwoPtX,y.lineOnePtY),i(y.lineOnePtX,N.lineTwoPtY));return w(b.pointX,b.pointY,E,A,D)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(b,y){if(b.length===2&&y.length===3){if(!s(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(y))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return w(b[0],b[1],y[0],y[1],y[2])}else if(b.length===3&&y.length===6){if(!f(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(y))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(b[0],b[1],b[2],y[0],y[1],y[2],y[3],y[4],y[5])}else if(b.length===y.length&&b.length>0){if(!p(b))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(y))throw new TypeError("All values of an array should be numbers or BigNumbers");return x(b,y)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(b,y){if(Object.keys(b).length===2&&Object.keys(y).length===3){if(!s(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"xCoeffLine"in y&&"yCoeffLine"in y&&"constant"in y)return w(b.pointX,b.pointY,y.xCoeffLine,y.yCoeffLine,y.constant);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===6){if(!f(b))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(y))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"x0"in y&&"y0"in y&&"z0"in y&&"a"in y&&"b"in y&&"c"in y)return v(b.pointX,b.pointY,b.pointZ,y.x0,y.y0,y.z0,y.a,y.b,y.c);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===2&&Object.keys(y).length===2){if(!s(b))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointTwoX"in y&&"pointTwoY"in y)return x([b.pointOneX,b.pointOneY],[y.pointTwoX,y.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===3){if(!f(b))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointOneZ"in b&&"pointTwoX"in y&&"pointTwoY"in y&&"pointTwoZ"in y)return x([b.pointOneX,b.pointOneY,b.pointOneZ],[y.pointTwoX,y.pointTwoY,y.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(b){if(!h(b))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return g(b)}});function l(b){return typeof b=="number"||$e(b)}function s(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])}function f(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])&&l(b[2])}function p(b){return Array.isArray(b)||(b=d(b)),b.every(l)}function m(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])&&l(b[2])&&l(b[3])&&l(b[4])&&l(b[5])}function d(b){for(var y=Object.keys(b),N=[],E=0;E<y.length;E++)N.push(b[y[E]]);return N}function h(b){if(b[0].length===2&&l(b[0][0])&&l(b[0][1])){if(b.some(y=>y.length!==2||!l(y[0])||!l(y[1])))return!1}else if(b[0].length===3&&l(b[0][0])&&l(b[0][1])&&l(b[0][2])){if(b.some(y=>y.length!==3||!l(y[0])||!l(y[1])||!l(y[2])))return!1}else return!1;return!0}function w(b,y,N,E,A){var D=c(r(r(i(N,b),i(E,y)),A)),S=u(r(i(N,N),i(E,E)));return a(D,S)}function v(b,y,N,E,A,D,S,C,_){var R=[n(i(n(A,y),_),i(n(D,N),C)),n(i(n(D,N),S),i(n(E,b),_)),n(i(n(E,b),C),i(n(A,y),S))];R=u(r(r(i(R[0],R[0]),i(R[1],R[1])),i(R[2],R[2])));var P=u(r(r(i(S,S),i(C,C)),i(_,_)));return a(R,P)}function x(b,y){for(var N=b.length,E=0,A=0,D=0;D<N;D++)A=n(b[D],y[D]),E=r(i(A,A),E);return u(E)}function g(b){for(var y=[],N=[],E=[],A=0;A<b.length-1;A++)for(var D=A+1;D<b.length;D++)b[0].length===2?(N=[b[A][0],b[A][1]],E=[b[D][0],b[D][1]]):b[0].length===3&&(N=[b[A][0],b[A][1],b[A][2]],E=[b[D][0],b[D][1],b[D][2]]),y.push(x(N,E));return y}}),g6="intersect",v6=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],y6=U(g6,v6,e=>{var{typed:t,config:r,abs:n,add:i,addScalar:a,matrix:o,multiply:u,multiplyScalar:c,divideScalar:l,subtract:s,smaller:f,equalScalar:p,flatten:m,isZero:d,isNumeric:h}=e;return t("intersect",{"Array, Array, Array":w,"Array, Array, Array, Array":v,"Matrix, Matrix, Matrix":function(S,C,_){var R=w(S.valueOf(),C.valueOf(),_.valueOf());return R===null?null:o(R)},"Matrix, Matrix, Matrix, Matrix":function(S,C,_,R){var P=v(S.valueOf(),C.valueOf(),_.valueOf(),R.valueOf());return P===null?null:o(P)}});function w(S,C,_){if(S=x(S),C=x(C),_=x(_),!b(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!y(_))throw new TypeError("Array with 4 numbers expected as third argument");return D(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],_[3])}function v(S,C,_,R){if(S=x(S),C=x(C),_=x(_),R=x(R),S.length===2){if(!g(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!g(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!g(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!g(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return N(S,C,_,R)}else if(S.length===3){if(!b(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!b(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return A(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],R[0],R[1],R[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function x(S){return S.length===1?S[0]:S.length>1&&Array.isArray(S[0])&&S.every(C=>Array.isArray(C)&&C.length===1)?m(S):S}function g(S){return S.length===2&&h(S[0])&&h(S[1])}function b(S){return S.length===3&&h(S[0])&&h(S[1])&&h(S[2])}function y(S){return S.length===4&&h(S[0])&&h(S[1])&&h(S[2])&&h(S[3])}function N(S,C,_,R){var P=S,I=_,O=s(P,C),F=s(I,R),q=s(c(O[0],F[1]),c(F[0],O[1]));if(d(q)||f(n(q),r.epsilon))return null;var k=c(F[0],P[1]),te=c(F[1],P[0]),se=c(F[0],I[1]),K=c(F[1],I[0]),V=l(a(s(s(k,te),se),K),q);return i(u(O,V),P)}function E(S,C,_,R,P,I,O,F,q,k,te,se){var K=c(s(S,C),s(_,R)),V=c(s(P,I),s(O,F)),ue=c(s(q,k),s(te,se));return a(a(K,V),ue)}function A(S,C,_,R,P,I,O,F,q,k,te,se){var K=E(S,O,k,O,C,F,te,F,_,q,se,q),V=E(k,O,R,S,te,F,P,C,se,q,I,_),ue=E(S,O,R,S,C,F,P,C,_,q,I,_),me=E(k,O,k,O,te,F,te,F,se,q,se,q),re=E(R,S,R,S,P,C,P,C,I,_,I,_),ae=s(c(K,V),c(ue,me)),de=s(c(re,me),c(V,V));if(d(de))return null;var ne=l(ae,de),ce=l(a(K,c(ne,V)),me),le=a(S,c(ne,s(R,S))),he=a(C,c(ne,s(P,C))),xe=a(_,c(ne,s(I,_))),$=a(O,c(ce,s(k,O))),T=a(F,c(ce,s(te,F))),z=a(q,c(ce,s(se,q)));return p(le,$)&&p(he,T)&&p(xe,z)?[le,he,xe]:null}function D(S,C,_,R,P,I,O,F,q,k){var te=c(S,O),se=c(R,O),K=c(C,F),V=c(P,F),ue=c(_,q),me=c(I,q),re=s(s(s(k,te),K),ue),ae=s(s(s(a(a(se,V),me),te),K),ue),de=l(re,ae),ne=a(S,c(de,s(R,S))),ce=a(C,c(de,s(P,C))),le=a(_,c(de,s(I,_)));return[ne,ce,le]}}),Mh="sum",b6=["typed","config","add","numeric"],Hy=U(Mh,b6,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(Mh,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Ea(u))throw new TypeError("Scalar values expected in function sum");return a(u)}});function a(u){var c;return Sn(u,function(l){try{c=c===void 0?l:n(c,l)}catch(s){throw ur(s,"sum",l)}}),c===void 0&&(c=i(0,r.number)),typeof c=="string"&&(c=i(c,r.number)),c}function o(u,c){try{var l=xu(u,c,n);return l}catch(s){throw ur(s,"sum")}}}),os="cumsum",x6=["typed","add","unaryPlus"],Jy=U(os,x6,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(os,{Array:i,Matrix:function(c){return c.create(i(c.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(c,l){return c.create(o(c.valueOf(),l))},"...":function(c){if(Ea(c))throw new TypeError("All values expected to be scalar in function cumsum");return i(c)}});function i(c){try{return a(c)}catch(l){throw ur(l,os)}}function a(c){if(c.length===0)return[];for(var l=[n(c[0])],s=1;s<c.length;++s)l.push(r(l[s-1],c[s]));return l}function o(c,l){var s=Ve(c);if(l<0||l>=s.length)throw new $r(l,s.length);try{return u(c,l)}catch(f){throw ur(f,os)}}function u(c,l){var s,f,p;if(l<=0){var m=c[0][0];if(Array.isArray(m)){for(p=Av(c),f=[],s=0;s<p.length;s++)f[s]=u(p[s],l-1);return f}else return a(c)}else{for(f=[],s=0;s<c.length;s++)f[s]=u(c[s],l-1);return f}}}),_h="mean",w6=["typed","add","divide"],Gy=U(_h,w6,e=>{var{typed:t,add:r,divide:n}=e;return t(_h,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(o){if(Ea(o))throw new TypeError("Scalar values expected in function mean");return a(o)}});function i(o,u){try{var c=xu(o,u,r),l=Array.isArray(o)?Ve(o):o.size();return n(c,l[u])}catch(s){throw ur(s,"mean")}}function a(o){var u,c=0;if(Sn(o,function(l){try{u=u===void 0?l:r(u,l),c++}catch(s){throw ur(s,"mean",l)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,c)}}),Fh="median",N6=["typed","add","divide","compare","partitionSelect"],D6=U(Fh,N6,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:a}=e;function o(l){try{l=ot(l.valueOf());var s=l.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var f=s/2-1,p=a(l,f+1),m=l[f],d=0;d<f;++d)i(l[d],m)>0&&(m=l[d]);return c(m,p)}else{var h=a(l,(s-1)/2);return u(h)}}catch(w){throw ur(w,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(l){return l}}),c=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(l,s){return n(r(l,s),2)}});return t(Fh,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(l,s){throw new Error("median(A, dim) is not yet supported")},"...":function(l){if(Ea(l))throw new TypeError("Scalar values expected in function median");return o(l)}})}),Th="mad",E6=["typed","abs","map","median","subtract"],A6=U(Th,E6,e=>{var{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t(Th,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(u){if(u=ot(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=i(u);return i(n(u,function(l){return r(a(l,c))}))}catch(l){throw l instanceof TypeError&&l.message.includes("median")?new TypeError(l.message.replace("median","mad")):ur(l,"mad")}}}),mc="unbiased",Oh="variance",S6=["typed","add","subtract","multiply","divide","apply","isNaN"],Wy=U(Oh,S6,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e;return t(Oh,{"Array | Matrix":function(s){return c(s,mc)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(s,f){return l(s,f,mc)},"Array | Matrix, number | BigNumber, string":l,"...":function(s){return c(s,mc)}});function c(s,f){var p,m=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Sn(s,function(w){try{p=p===void 0?w:r(p,w),m++}catch(v){throw ur(v,"variance",w)}}),m===0)throw new Error("Cannot calculate variance of an empty array");var d=a(p,m);if(p=void 0,Sn(s,function(w){var v=n(w,d);p=p===void 0?i(v,v):r(p,i(v,v))}),u(p))return p;switch(f){case"uncorrected":return a(p,m);case"biased":return a(p,m+1);case"unbiased":{var h=$e(p)?p.mul(0):0;return m===1?h:a(p,m-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(s,f,p){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(s,f,m=>c(m,p))}catch(m){throw ur(m,"variance")}}}),Bh="quantileSeq",C6=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Ky=U(Bh,C6,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=Cl({typed:t,isInteger:l});return t(Bh,{"Array | Matrix, number | BigNumber":(x,g)=>h(x,g,!1),"Array | Matrix, number | BigNumber, number":(x,g,b)=>d(x,g,!1,b,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(x,g,b,y)=>d(x,g,b,y,h),"Array | Matrix, Array | Matrix":(x,g)=>w(x,g,!1),"Array | Matrix, Array | Matrix, number":(x,g,b)=>d(x,g,!1,b,w),"Array | Matrix, Array | Matrix, boolean":w,"Array | Matrix, Array | Matrix, boolean, number":(x,g,b,y)=>d(x,g,b,y,w)});function d(x,g,b,y,N){return m(x,y,E=>N(E,g,b))}function h(x,g,b){var y,N=x.valueOf();if(s(g,0))throw new Error("N/prob must be non-negative");if(f(g,1))return Ue(g)?v(N,g,b):r(v(N,g,b));if(p(g,1)){if(!l(g))throw new Error("N must be a positive integer");if(p(g,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var E=n(g,1);y=[];for(var A=0;s(A,g);A++){var D=a(A+1,E);y.push(v(N,D,b))}return Ue(g)?y:r(y)}}function w(x,g,b){for(var y=x.valueOf(),N=g.valueOf(),E=[],A=0;A<N.length;++A)E.push(v(y,N[A],b));return E}function v(x,g,b){var y=ot(x),N=y.length;if(N===0)throw new Error("Cannot calculate quantile of an empty sequence");var E=Ue(g)?g*(N-1):g.times(N-1),A=Ue(g)?Math.floor(E):E.floor().toNumber(),D=Ue(g)?E%1:E.minus(A);if(l(E))return b?y[E]:u(y,Ue(g)?E:E.valueOf());var S,C;if(b)S=y[A],C=y[A+1];else{C=u(y,A+1),S=y[A];for(var _=0;_<A;++_)c(y[_],S)>0&&(S=y[_])}return n(o(S,i(1,D)),o(C,D))}}),kh="std",M6=["typed","map","sqrt","variance"],Qy=U(kh,M6,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(kh,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(o){return a(o)}});function a(o,u){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=i.apply(null,arguments);return Fr(c)?r(c,n):n(c)}catch(l){throw l instanceof TypeError&&l.message.includes(" variance")?new TypeError(l.message.replace(" variance"," std")):l}}}),Ih="corr",_6=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],F6=U(Ih,_6,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:a,subtract:o,multiply:u,pow:c,divide:l}=e;return t(Ih,{"Array, Array":function(p,m){return s(p,m)},"Matrix, Matrix":function(p,m){var d=s(p.toArray(),m.toArray());return Array.isArray(d)?r(d):d}});function s(p,m){var d=[];if(Array.isArray(p[0])&&Array.isArray(m[0])){if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var h=0;h<p.length;h++){if(p[h].length!==m[h].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");d.push(f(p[h],m[h]))}return d}else{if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(p,m)}}function f(p,m){var d=p.length,h=i(p),w=i(m),v=p.reduce((N,E,A)=>a(N,u(E,m[A])),0),x=i(p.map(N=>c(N,2))),g=i(m.map(N=>c(N,2))),b=o(u(d,v),u(h,w)),y=n(u(o(u(d,x),c(h,2)),o(u(d,g),c(w,2))));return l(b,y)}}),Rh="combinations",T6=["typed"],O6=U(Rh,T6,e=>{var{typed:t}=e;return t(Rh,{"number, number":Wv,"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=r.minus(n),c=new i(1);if(!qh(r)||!qh(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(r))throw new TypeError("k must be less than n in function combinations");if(a=c,n.lt(u))for(o=c;o.lte(u);o=o.plus(c))a=a.times(n.plus(o)).dividedBy(o);else for(o=c;o.lte(n);o=o.plus(c))a=a.times(u.plus(o)).dividedBy(o);return a}})});function qh(e){return e.isInteger()&&e.gte(0)}var zh="combinationsWithRep",B6=["typed"],k6=U(zh,B6,e=>{var{typed:t}=e;return t(zh,{"number, number":function(r,n){if(!Fe(r)||r<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n<r-1){var i=xn(r,r+n-1);return i/xn(1,n)}var a=xn(n+1,r+n-1);return a/xn(1,r-1)},"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=new i(1),c=r.minus(u);if(!jh(r)||!jh(n))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r.lt(u))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(a=u,n.lt(c))for(o=u;o.lte(c);o=o.plus(u))a=a.times(n.plus(o)).dividedBy(o);else for(o=u;o.lte(n);o=o.plus(u))a=a.times(c.plus(o)).dividedBy(o);return a}})});function jh(e){return e.isInteger()&&e.gte(0)}var Lh="gamma",I6=["typed","config","multiplyScalar","pow","BigNumber","Complex"],R6=U(Lh,I6,e=>{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:o}=e;function u(l){if(l.im===0)return js(l.re);if(l.re<.5){var s=new o(1-l.re,-l.im),f=new o(Math.PI*l.re,Math.PI*l.im);return new o(Math.PI).div(f.sin()).div(u(s))}l=new o(l.re-1,l.im);for(var p=new o(oa[0],0),m=1;m<oa.length;++m){var d=new o(oa[m],0);p=p.add(d.div(l.add(m)))}var h=new o(l.re+Yv+.5,l.im),w=Math.sqrt(2*Math.PI),v=h.pow(l.add(.5)),x=h.neg().exp();return p.mul(w).mul(v).mul(x)}return t(Lh,{number:js,Complex:u,BigNumber:function(l){if(l.isInteger())return l.isNegative()||l.isZero()?new a(1/0):c(l.minus(1));if(!l.isFinite())return new a(l.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function c(l){if(l<8)return new a([1,1,2,6,24,120,720,5040][l]);var s=r.precision+(Math.log(l.toNumber())|0),f=a.clone({precision:s});if(l%2===1)return l.times(c(new a(l-1)));for(var p=l,m=new f(l),d=l.toNumber();p>2;)p-=2,d+=p,m=m.times(d);return new a(m.toPrecision(a.precision))}}),Ph="lgamma",q6=["Complex","typed"],z6=U(Ph,q6,e=>{var{Complex:t,typed:r}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Ph,{number:Ls,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(l){var s=6.283185307179586,f=1.1447298858494002,p=.1;if(l.isNaN())return new t(NaN,NaN);if(l.im===0)return new t(Ls(l.re),0);if(l.re>=n||Math.abs(l.im)>=i)return u(l);if(l.re<=p){var m=MN(s,l.im)*Math.floor(.5*l.re+.25),d=l.mul(Math.PI).sin().log(),h=o(new t(1-l.re,-l.im));return new t(f,m).sub(d).sub(h)}else return l.im>=0?c(l):c(l.conjugate()).conjugate()}function u(l){for(var s=l.sub(.5).mul(l.log()).sub(l).add(ey),f=new t(1,0).div(l),p=f.div(l),m=a[0],d=a[1],h=2*p.re,w=p.re*p.re+p.im*p.im,v=2;v<8;v++){var x=d;d=-w*m+a[v],m=h*m+x}var g=f.mul(p.mul(m).add(d));return s.add(g)}function c(l){var s=0,f=0,p=l;for(l=l.add(1);l.re<=n;){p=p.mul(l);var m=p.im<0?1:0;m!==0&&f===0&&s++,f=m,l=l.add(1)}return u(l).sub(p.log()).sub(new t(0,s*2*Math.PI*1))}}),Vh="factorial",j6=["typed","gamma"],L6=U(Vh,j6,e=>{var{typed:t,gamma:r}=e;return t(Vh,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return r(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return r(n.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),Uh="kldivergence",P6=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],V6=U(Uh,P6,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:a,map:o,dotDivide:u,log:c,isNumeric:l}=e;return t(Uh,{"Array, Array":function(f,p){return s(r(f),r(p))},"Matrix, Array":function(f,p){return s(f,r(p))},"Array, Matrix":function(f,p){return s(r(f),p)},"Matrix, Matrix":function(f,p){return s(f,p)}});function s(f,p){var m=p.size().length,d=f.size().length;if(m>1)throw new Error("first object must be one dimensional");if(d>1)throw new Error("second object must be one dimensional");if(m!==d)throw new Error("Length of two vectors must be equal");var h=i(f);if(h===0)throw new Error("Sum of elements in first object must be non zero");var w=i(p);if(w===0)throw new Error("Sum of elements in second object must be non zero");var v=n(f,i(f)),x=n(p,i(p)),g=i(a(v,o(u(v,x),b=>c(b))));return l(g)?g:Number.NaN}}),$h="multinomial",U6=["typed","add","divide","multiply","factorial","isInteger","isPositive"],$6=U($h,U6,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:a,isInteger:o,isPositive:u}=e;return t($h,{"Array | Matrix":function(c){var l=0,s=1;return Sn(c,function(f){if(!o(f)||!u(f))throw new TypeError("Positive integer value expected in function multinomial");l=r(l,f),s=i(s,a(f))}),n(a(l),s)}})}),Hh="permutations",H6=["typed","factorial"],J6=U(Hh,H6,e=>{var{typed:t,factorial:r}=e;return t(Hh,{"number | BigNumber":r,"number, number":function(n,i){if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Fe(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>n)throw new TypeError("second argument k must be less than or equal to first argument n");return xn(n-i+1,n)},"BigNumber, BigNumber":function(n,i){var a,o;if(!Jh(n)||!Jh(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var u=n.mul(0).add(1);for(a=u,o=n.minus(i).plus(1);o.lte(n);o=o.plus(1))a=a.times(o);return a}})});function Jh(e){return e.isInteger()&&e.gte(0)}var Zy={exports:{}};(function(e){(function(t,r,n){function i(c){var l=this,s=u();l.next=function(){var f=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=f-(l.c=f|0)},l.c=1,l.s0=s(" "),l.s1=s(" "),l.s2=s(" "),l.s0-=s(c),l.s0<0&&(l.s0+=1),l.s1-=s(c),l.s1<0&&(l.s1+=1),l.s2-=s(c),l.s2<0&&(l.s2+=1),s=null}function a(c,l){return l.c=c.c,l.s0=c.s0,l.s1=c.s1,l.s2=c.s2,l}function o(c,l){var s=new i(c),f=l&&l.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&a(f,s),p.state=function(){return a(s,{})}),p}function u(){var c=4022871197,l=function(s){s=String(s);for(var f=0;f<s.length;f++){c+=s.charCodeAt(f);var p=.02519603282416938*c;c=p>>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=o:this.alea=o})(qi,e)})(Zy);var G6=Zy.exports,Xy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var f=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^f^f>>>8},u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor128=o})(qi,e)})(Xy);var W6=Xy.exports,Yy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(f^f<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,s==l.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c.v=u.v,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorwow=o})(qi,e)})(Yy);var K6=Yy.exports,e1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.x,f=c.i,p,m;return p=s[f],p^=p>>>7,m=p^p<<24,p=s[f+1&7],m^=p^p>>>10,p=s[f+3&7],m^=p^p>>>3,p=s[f+4&7],m^=p^p<<7,p=s[f+7&7],p=p^p<<13,m^=p^p<<9,s[f]=m,c.i=f+1&7,m};function l(s,f){var p,m=[];if(f===(f|0))m[0]=f;else for(f=""+f,p=0;p<f.length;++p)m[p&7]=m[p&7]<<15^f.charCodeAt(p)+m[p+1&7]<<13;for(;m.length<8;)m.push(0);for(p=0;p<8&&m[p]===0;++p);for(p==8?m[7]=-1:m[p],s.x=m,s.i=0,p=256;p>0;--p)s.next()}l(c,u)}function a(u,c){return c.x=u.x.slice(),c.i=u.i,c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.x&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorshift7=o})(qi,e)})(e1);var Q6=e1.exports,t1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.w,f=c.X,p=c.i,m,d;return c.w=s=s+1640531527|0,d=f[p+34&127],m=f[p=p+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=f[p]=d^m,c.i=p,d+(s^s>>>16)|0};function l(s,f){var p,m,d,h,w,v=[],x=128;for(f===(f|0)?(m=f,f=null):(f=f+"\0",m=0,x=Math.max(x,f.length)),d=0,h=-32;h<x;++h)f&&(m^=f.charCodeAt((h+32)%f.length)),h===0&&(w=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,h>=0&&(w=w+1640531527|0,p=v[h&127]^=m+w,d=p==0?d+1:0);for(d>=128&&(v[(f&&f.length||0)&127]=-1),d=127,h=4*128;h>0;--h)m=v[d+34&127],p=v[d=d+1&127],m^=m<<13,p^=p<<17,m^=m>>>15,p^=p>>>12,v[d]=m^p;s.w=w,s.X=v,s.i=d}l(c,u)}function a(u,c){return c.i=u.i,c.w=u.w,c.X=u.X.slice(),c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.X&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor4096=o})(qi,e)})(t1);var Z6=t1.exports,r1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.b,p=c.c,m=c.d,d=c.a;return f=f<<25^f>>>7^p,p=p-m|0,m=m<<24^m>>>8^d,d=d-f|0,c.b=f=f<<20^f>>>12^p,c.c=p=p-m|0,c.d=m<<16^p>>>16^d,c.a=d-f|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,u===Math.floor(u)?(c.a=u/4294967296|0,c.b=u|0):l+=u;for(var s=0;s<l.length+20;s++)c.b^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.a=u.a,c.b=u.b,c.c=u.c,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.tychei=o})(qi,e)})(r1);var X6=r1.exports,n1={exports:{}};const Y6={},e9=Object.freeze(Object.defineProperty({__proto__:null,default:Y6},Symbol.toStringTag,{value:"Module"})),t9=j2(e9);(function(e){(function(t,r,n){var i=256,a=6,o=52,u="random",c=n.pow(i,a),l=n.pow(2,o),s=l*2,f=i-1,p;function m(b,y,N){var E=[];y=y==!0?{entropy:!0}:y||{};var A=v(w(y.entropy?[b,g(r)]:b??x(),3),E),D=new d(E),S=function(){for(var C=D.g(a),_=c,R=0;C<l;)C=(C+R)*i,_*=i,R=D.g(1);for(;C>=s;)C/=2,_/=2,R>>>=1;return(C+R)/_};return S.int32=function(){return D.g(4)|0},S.quick=function(){return D.g(4)/4294967296},S.double=S,v(g(D.S),r),(y.pass||N||function(C,_,R,P){return P&&(P.S&&h(P,D),C.state=function(){return h(D,{})}),R?(n[u]=C,_):C})(S,A,"global"in y?y.global:this==n,y.state)}function d(b){var y,N=b.length,E=this,A=0,D=E.i=E.j=0,S=E.S=[];for(N||(b=[N++]);A<i;)S[A]=A++;for(A=0;A<i;A++)S[A]=S[D=f&D+b[A%N]+(y=S[A])],S[D]=y;(E.g=function(C){for(var _,R=0,P=E.i,I=E.j,O=E.S;C--;)_=O[P=f&P+1],R=R*i+O[f&(O[P]=O[I=f&I+_])+(O[I]=_)];return E.i=P,E.j=I,R})(i)}function h(b,y){return y.i=b.i,y.j=b.j,y.S=b.S.slice(),y}function w(b,y){var N=[],E=typeof b,A;if(y&&E=="object")for(A in b)try{N.push(w(b[A],y-1))}catch{}return N.length?N:E=="string"?b:b+"\0"}function v(b,y){for(var N=b+"",E,A=0;A<N.length;)y[f&A]=f&(E^=y[f&A]*19)+N.charCodeAt(A++);return g(y)}function x(){try{var b;return p&&(b=p.randomBytes)?b=b(i):(b=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(b)),g(b)}catch{var y=t.navigator,N=y&&y.plugins;return[+new Date,t,N,t.screen,g(r)]}}function g(b){return String.fromCharCode.apply(0,b)}if(v(n.random(),r),e.exports){e.exports=m;try{p=t9}catch{}}else n["seed"+u]=m})(typeof self<"u"?self:qi,[],Math)})(n1);var r9=n1.exports,n9=G6,i9=W6,a9=K6,o9=Q6,s9=Z6,u9=X6,Li=r9;Li.alea=n9;Li.xor128=i9;Li.xorwow=a9;Li.xorshift7=o9;Li.xor4096=s9;Li.tychei=u9;var c9=Li;const i1=No(c9);var l9=i1(Date.now());function va(e){var t;function r(i){t=i===null?l9:i1(String(i))}r(e);function n(){return t()}return n}var Gh="pickRandom",f9=["typed","config","?on"],p9=U(Gh,f9,e=>{var{typed:t,config:r,on:n}=e,i=va(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=va(o.randomSeed))}),t(Gh,{"Array | Matrix":function(o){return a(o,{})},"Array | Matrix, Object":function(o,u){return a(o,u)},"Array | Matrix, number":function(o,u){return a(o,{number:u})},"Array | Matrix, Array | Matrix":function(o,u){return a(o,{weights:u})},"Array | Matrix, Array | Matrix, number":function(o,u,c){return a(o,{number:c,weights:u})},"Array | Matrix, number, Array | Matrix":function(o,u,c){return a(o,{number:u,weights:c})}});function a(o,u){var{number:c,weights:l,elementWise:s=!0}=u,f=typeof c>"u";f&&(c=1);var p=ke(o)?o.create:ke(l)?l.create:null;o=o.valueOf(),l&&(l=l.valueOf()),s===!0&&(o=ot(o),l=ot(l));var m=0;if(typeof l<"u"){if(l.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var d=0,h=l.length;d<h;d++){if(!Ue(l[d])||l[d]<0)throw new Error("Weights must be an array of positive numbers");m+=l[d]}}for(var w=o.length,v=[],x;v.length<c;){if(typeof l>"u")x=o[Math.floor(i()*w)];else for(var g=i()*m,b=0,y=o.length;b<y;b++)if(g-=l[b],g<0){x=o[b];break}v.push(x)}return f?v[0]:p?p(v):v}});function kl(e,t){var r=[];if(e=e.slice(0),e.length>1)for(var n=0,i=e.shift();n<i;n++)r.push(kl(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var Wh="random",m9=["typed","config","?on"],d9=U(Wh,m9,e=>{var{typed:t,config:r,on:n}=e,i=va(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=va(u.randomSeed))}),t(Wh,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=kl(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return u+i()*(c-u)}}),Kh="randomInt",h9=["typed","config","?on"],g9=U(Kh,h9,e=>{var{typed:t,config:r,on:n}=e,i=va(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=va(u.randomSeed))}),t(Kh,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=kl(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return Math.floor(u+i()*(c-u))}}),Qh="stirlingS2",v9=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],y9=U(Qh,v9,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:o,factorial:u,combinations:c,isNegative:l,isInteger:s,number:f,bignumber:p,larger:m}=e,d=[],h=[];return t(Qh,{"number | BigNumber, number | BigNumber":function(w,v){if(!s(w)||l(w)||!s(v)||l(v))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(v,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var x=!(Ue(w)&&Ue(v)),g=x?h:d,b=x?p:f,y=f(w),N=f(v);if(g[y]&&g[y].length>N)return g[y][N];for(var E=0;E<=y;++E)if(g[E]||(g[E]=[b(E===0?1:0)]),E!==0)for(var A=g[E],D=g[E-1],S=A.length;S<=E&&S<=N;++S)S===E?A[S]=1:A[S]=r(i(b(S),D[S]),D[S-1]);return g[y][N]}})}),Zh="bellNumbers",b9=["typed","addScalar","isNegative","isInteger","stirlingS2"],x9=U(Zh,b9,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=e;return t(Zh,{"number | BigNumber":function(o){if(!i(o)||n(o))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,c=0;c<=o;c++)u=r(u,a(o,c));return u}})}),Xh="catalan",w9=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],N9=U(Xh,w9,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:u}=e;return t(Xh,{"number | BigNumber":function(c){if(!u(c)||o(c))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(c,2),c),r(c,1))}})}),Yh="composition",D9=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],E9=U(Yh,D9,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:o,larger:u}=e;return t(Yh,{"number | BigNumber, number | BigNumber":function(c,l){if(!o(c)||!i(c)||!o(l)||!i(l))throw new TypeError("Positive integer value expected in function composition");if(u(l,c))throw new TypeError("k must be less than or equal to n in function composition");return n(r(c,-1),r(l,-1))}})}),e0="leafCount",A9=["parse","typed"],S9=U(e0,A9,e=>{var{parse:t,typed:r}=e;function n(i){var a=0;return i.forEach(o=>{a+=n(o)}),a||1}return r(e0,{Node:function(i){return n(i)}})});function t0(e){return nt(e)||Ct(e)&&e.isUnary()&&nt(e.args[0])}function Qs(e){return!!(nt(e)||(Zn(e)||Ct(e))&&e.args.every(Qs)||An(e)&&Qs(e.content))}function r0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r0(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var C9="simplifyUtil",M9=["FunctionNode","OperatorNode","SymbolNode"],Il=U(C9,M9,e=>{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,a=!1,o="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},c={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function s(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,N=o;if(typeof g=="string"?N=g:Ct(g)?N=g.fn.toString():Zn(g)?N=g.name:An(g)&&(N="paren"),Me(y,N)){var E=y[N];if(Me(E,b))return E[b];if(Me(u,N))return u[N][b]}if(Me(y,o)){var A=y[o];return Me(A,b)?A[b]:u[o][b]}if(Me(u,N)){var D=u[N];if(Me(D,b))return D[b]}return u[o][b]}function f(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"commutative",b)}function p(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"associative",b)}function m(g,b){var y=dc({},g);for(var N in b)Me(g,N)?y[N]=dc(dc({},b[N]),g[N]):y[N]=b[N];return y}function d(g,b){if(!g.args||g.args.length===0)return g;g.args=h(g,b);for(var y=0;y<g.args.length;y++)d(g.args[y],b)}function h(g,b){var y,N=[],E=function A(D){for(var S=0;S<D.args.length;S++){var C=D.args[S];Ct(C)&&y===C.op?A(C):N.push(C)}};return p(g,b)?(y=g.op,E(g),N):g.args}function w(g,b){if(!(!g.args||g.args.length===0)){for(var y=x(g),N=g.args.length,E=0;E<N;E++)w(g.args[E],b);if(N>2&&p(g,b)){for(var A=g.args.pop();g.args.length>0;)A=y([g.args.pop(),A]);g.args=A.args}}}function v(g,b){if(!(!g.args||g.args.length===0)){for(var y=x(g),N=g.args.length,E=0;E<N;E++)v(g.args[E],b);if(N>2&&p(g,b)){for(var A=g.args.shift();g.args.length>0;)A=y([A,g.args.shift()]);g.args=A.args}}}function x(g){return Ct(g)?function(b){try{return new r(g.op,g.fn,b,g.implicit)}catch(y){return console.error(y),[]}}:function(b){return new t(new n(g.name),b)}}return{createMakeNodeFunction:x,hasProperty:s,isCommutative:f,isAssociative:p,mergeContext:m,flatten:d,allChildren:h,unflattenr:w,unflattenl:v,defaultContext:u,realContext:c,positiveContext:l}}),_9="simplify",F9=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],T9=U(_9,F9,e=>{var{config:t,typed:r,parse:n,add:i,subtract:a,multiply:o,divide:u,pow:c,isZero:l,equal:s,resolve:f,simplifyConstant:p,simplifyCore:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:x,ArrayNode:g,ConstantNode:b,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,ParenthesisNode:D,SymbolNode:S}=e,{hasProperty:C,isCommutative:_,isAssociative:R,mergeContext:P,flatten:I,unflattenr:O,unflattenl:F,createMakeNodeFunction:q,defaultContext:k,realContext:te,positiveContext:se}=Il({FunctionNode:y,OperatorNode:A,SymbolNode:S});r.addConversion({from:"Object",to:"Map",convert:aa});var K=r("simplify",{Node:ne,"Node, Map":(L,H)=>ne(L,!1,H),"Node, Map, Object":(L,H,G)=>ne(L,!1,H,G),"Node, Array":ne,"Node, Array, Map":ne,"Node, Array, Map, Object":ne});r.removeConversion({from:"Object",to:"Map",convert:aa}),K.defaultContext=k,K.realContext=te,K.positiveContext=se;function V(L){return L.transform(function(H,G,Y){return An(H)?V(H.content):H})}var ue={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};K.rules=[m,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},p,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},p,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function me(L,H){var G={};if(L.s){var Y=L.s.split("->");if(Y.length===2)G.l=Y[0],G.r=Y[1];else throw SyntaxError("Could not parse rule: "+L.s)}else G.l=L.l,G.r=L.r;G.l=V(n(G.l)),G.r=V(n(G.r));for(var ee of["imposeContext","repeat","assuming"])ee in L&&(G[ee]=L[ee]);if(L.evaluate&&(G.evaluate=n(L.evaluate)),R(G.l,H)){var B=!_(G.l,H),j;B&&(j=de());var Q=q(G.l),Z=de();G.expanded={},G.expanded.l=Q([G.l,Z]),I(G.expanded.l,H),O(G.expanded.l,H),G.expanded.r=Q([G.r,Z]),B&&(G.expandedNC1={},G.expandedNC1.l=Q([j,G.l]),G.expandedNC1.r=Q([j,G.r]),G.expandedNC2={},G.expandedNC2.l=Q([j,G.expanded.l]),G.expandedNC2.r=Q([j,G.expanded.r]))}return G}function re(L,H){for(var G=[],Y=0;Y<L.length;Y++){var ee=L[Y],B=void 0,j=typeof ee;switch(j){case"string":ee={s:ee};case"object":B=me(ee,H);break;case"function":B=ee;break;default:throw TypeError("Unsupported type of rule: "+j)}G.push(B)}return G}var ae=0;function de(){return new S("_p"+ae++)}function ne(L,H){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ao(),Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ee=Y.consoleDebug;H=re(H||K.rules,Y.context);var B=f(L,G);B=V(B);for(var j={},Q=B.toString({parenthesis:"all"});!j[Q];){j[Q]=!0,ae=0;var Z=Q;ee&&console.log("Working on: ",Q);for(var ie=0;ie<H.length;ie++){var oe="";if(typeof H[ie]=="function"?(B=H[ie](B,Y),ee&&(oe=H[ie].name)):(I(B,Y.context),B=le(B,H[ie],Y.context),ee&&(oe="".concat(H[ie].l.toString()," -> ").concat(H[ie].r.toString()))),ee){var ye=B.toString({parenthesis:"all"});ye!==Z&&(console.log("Applying",oe,"produced",ye),Z=ye)}F(B,Y.context)}Q=B.toString({parenthesis:"all"})}return B}function ce(L,H,G){var Y=L;if(L)for(var ee=0;ee<L.length;++ee){var B=le(L[ee],H,G);B!==L[ee]&&(Y===L&&(Y=L.slice()),Y[ee]=B)}return Y}function le(L,H,G){if(H.assuming){for(var Y in H.assuming)for(var ee in H.assuming[Y])if(C(Y,ee,G)!==H.assuming[Y][ee])return L}var B=P(H.imposeContext,G),j=L;if(j instanceof A||j instanceof y){var Q=ce(j.args,H,G);Q!==j.args&&(j=j.clone(),j.args=Q)}else if(j instanceof D){if(j.content){var Z=le(j.content,H,G);Z!==j.content&&(j=new D(Z))}}else if(j instanceof g){var ie=ce(j.items,H,G);ie!==j.items&&(j=new g(ie))}else if(j instanceof x){var oe=j.object;j.object&&(oe=le(j.object,H,G));var ye=j.index;j.index&&(ye=le(j.index,H,G)),(oe!==j.object||ye!==j.index)&&(j=new x(oe,ye))}else if(j instanceof N){var fe=ce(j.dimensions,H,G);fe!==j.dimensions&&(j=new N(fe))}else if(j instanceof E){var De=!1,Ne={};for(var je in j.properties)Ne[je]=le(j.properties[je],H,G),Ne[je]!==j.properties[je]&&(De=!0);De&&(j=new E(Ne))}var Ze=H.r,_e=z(H.l,j,B)[0];if(!_e&&H.expanded&&(Ze=H.expanded.r,_e=z(H.expanded.l,j,B)[0]),!_e&&H.expandedNC1&&(Ze=H.expandedNC1.r,_e=z(H.expandedNC1.l,j,B)[0],_e||(Ze=H.expandedNC2.r,_e=z(H.expandedNC2.l,j,B)[0])),_e){var wt=j.implicit;j=Ze.clone(),wt&&"implicit"in Ze&&(j.implicit=!0),j=j.transform(function(M){return M.isSymbolNode&&Me(_e.placeholders,M.name)?_e.placeholders[M.name].clone():M})}return H.repeat&&j!==L&&(j=le(j,H,G)),j}function he(L,H){var G=[],Y,ee,B=q(L);if(_(L,H))for(var j=0;j<L.args.length;j++)ee=L.args.slice(0),ee.splice(j,1),Y=ee.length===1?ee[0]:B(ee),G.push(B([L.args[j],Y]));else for(var Q=1;Q<L.args.length;Q++){var Z=L.args[0];Q>1&&(Z=B(L.args.slice(0,Q))),ee=L.args.slice(Q),Y=ee.length===1?ee[0]:B(ee),G.push(B([Z,Y]))}return G}function xe(L,H){var G={placeholders:{}};if(!L.placeholders&&!H.placeholders)return G;if(L.placeholders){if(!H.placeholders)return L}else return H;for(var Y in L.placeholders)if(Me(L.placeholders,Y)&&(G.placeholders[Y]=L.placeholders[Y],Me(H.placeholders,Y)&&!J(L.placeholders[Y],H.placeholders[Y])))return null;for(var ee in H.placeholders)Me(H.placeholders,ee)&&(G.placeholders[ee]=H.placeholders[ee]);return G}function $(L,H){var G=[];if(L.length===0||H.length===0)return G;for(var Y,ee=0;ee<L.length;ee++)for(var B=0;B<H.length;B++)Y=xe(L[ee],H[B]),Y&&G.push(Y);return G}function T(L){if(L.length===0)return L;for(var H=L.reduce($),G=[],Y={},ee=0;ee<H.length;ee++){var B=JSON.stringify(H[ee]);Y[B]||(Y[B]=!0,G.push(H[ee]))}return G}function z(L,H,G,Y){var ee=[{placeholders:{}}];if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return[]}else if(L instanceof y&&L.name!==H.name)return[];if(H.args.length===1&&L.args.length===1||!R(H,G)&&H.args.length===L.args.length||Y){for(var B=[],j=0;j<L.args.length;j++){var Q=z(L.args[j],H.args[j],G);if(Q.length===0)break;B.push(Q)}if(B.length!==L.args.length){if(!_(H,G)||L.args.length===1)return[];if(L.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Z=z(L.args[0],H.args[1],G);if(Z.length===0)return[];var ie=z(L.args[1],H.args[0],G);if(ie.length===0)return[];B=[Z,ie]}ee=T(B)}else if(H.args.length>=2&&L.args.length===2){for(var oe=he(H,G),ye=[],fe=0;fe<oe.length;fe++){var De=z(L,oe[fe],G,!0);ye=ye.concat(De)}return ye}else{if(L.args.length>2)throw Error("Unexpected non-binary associative function: "+L.toString());return[]}}else if(L instanceof S){if(L.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ue[L.name]){if(L.name!==H.name)return[]}else switch(L.name[1]>="a"&&L.name[1]<="z"?L.name.substring(0,2):L.name[0]){case"n":case"_p":ee[0].placeholders[L.name]=H;break;case"c":case"cl":if(nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"v":if(!nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"vl":if(zt(H))ee[0].placeholders[L.name]=H;else return[];break;case"cd":if(t0(H))ee[0].placeholders[L.name]=H;else return[];break;case"vd":if(!t0(H))ee[0].placeholders[L.name]=H;else return[];break;case"ce":if(Qs(H))ee[0].placeholders[L.name]=H;else return[];break;case"ve":if(!Qs(H))ee[0].placeholders[L.name]=H;else return[];break;default:throw new Error("Invalid symbol in rule: "+L.name)}}else if(L instanceof b){if(!s(L.value,H.value))return[]}else return[];return ee}function J(L,H){if(L instanceof b&&H instanceof b){if(!s(L.value,H.value))return!1}else if(L instanceof S&&H instanceof S){if(L.name!==H.name)return!1}else if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return!1}else if(L instanceof y&&L.name!==H.name)return!1;if(L.args.length!==H.args.length)return!1;for(var G=0;G<L.args.length;G++)if(!J(L.args[G],H.args[G]))return!1}else return!1;return!0}return K}),O9="simplifyConstant",B9=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],k9=U(O9,B9,e=>{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:a,bignumber:o,AccessorNode:u,ArrayNode:c,ConstantNode:l,FunctionNode:s,IndexNode:f,ObjectNode:p,OperatorNode:m,SymbolNode:d}=e,{isCommutative:h,isAssociative:w,allChildren:v,createMakeNodeFunction:x}=Il({FunctionNode:s,OperatorNode:m,SymbolNode:d}),g=t("simplifyConstant",{Node:I=>E(P(I,{})),"Node, Object":function(I,O){return E(P(I,O))}});function b(I){return bo(I)?I.valueOf():I instanceof Array?I.map(b):ke(I)?i(b(I.valueOf())):I}function y(I,O,F){try{return n[I].apply(null,O)}catch{return O=O.map(b),D(n[I].apply(null,O),F)}}var N=t({Fraction:C,number:function(I){return I<0?S(new l(-I)):new l(I)},BigNumber:function(I){return I<0?S(new l(-I)):new l(I)},Complex:function(I){throw new Error("Cannot convert Complex number to Node")},string:function(I){return new l(I)},Matrix:function(I){return new c(I.valueOf().map(O=>N(O)))}});function E(I){return ft(I)?I:N(I)}function A(I,O){var F=O&&O.exactFractions!==!1;if(F&&isFinite(I)&&a){var q=a(I),k=O&&typeof O.fractionsLimit=="number"?O.fractionsLimit:1/0;if(q.valueOf()===I&&q.n<k&&q.d<k)return q}return I}var D=t({"string, Object":function(I,O){if(r.number==="BigNumber")return o===void 0&&Fl(),o(I);if(r.number==="Fraction")return a===void 0&&Fy(),a(I);var F=parseFloat(I);return A(F,O)},"Fraction, Object":function(I,O){return I},"BigNumber, Object":function(I,O){return I},"number, Object":function(I,O){return A(I,O)},"Complex, Object":function(I,O){return I.im!==0?I:A(I.re,O)},"Matrix, Object":function(I,O){return i(A(I.valueOf()))},"Array, Object":function(I,O){return I.map(A)}});function S(I){return new m("-","unaryMinus",[I])}function C(I){var O,F=I.s*I.n;return F<0?O=new m("-","unaryMinus",[new l(-F)]):O=new l(F),I.d===1?O:new m("/","divide",[O,new l(I.d)])}function _(I,O,F){if(!Da(O))return new u(E(I),E(O));if(Sr(I)||ke(I)){for(var q=Array.from(O.dimensions);q.length>0;)if(nt(q[0])&&typeof q[0].value!="string"){var k=D(q.shift().value,F);Sr(I)?I=I.items[k-1]:(I=I.valueOf()[k-1],I instanceof Array&&(I=i(I)))}else if(q.length>1&&nt(q[1])&&typeof q[1].value!="string"){var te=D(q[1].value,F),se=[],K=Sr(I)?I.items:I.valueOf();for(var V of K)if(Sr(V))se.push(V.items[te-1]);else if(ke(I))se.push(V[te-1]);else break;if(se.length===K.length)Sr(I)?I=new c(se):I=i(se),q.splice(1,1);else break}else break;return q.length===O.dimensions.length?new u(E(I),O):q.length>0?(O=new f(q),new u(E(I),O)):I}if(mu(I)&&O.dimensions.length===1&&nt(O.dimensions[0])){var ue=O.dimensions[0].value;return ue in I.properties?I.properties[ue]:new l}return new u(E(I),O)}function R(I,O,F,q){var k=O.shift(),te=O.reduce((se,K)=>{if(!ft(K)){var V=se.pop();if(ft(V))return[V,K];try{return se.push(y(I,[V,K],q)),se}catch{se.push(V)}}se.push(E(se.pop()));var ue=se.length===1?se[0]:F(se);return[F([ue,E(K)])]},[k]);return te.length===1?te[0]:F([te[0],N(te[1])])}function P(I,O){switch(I.type){case"SymbolNode":return I;case"ConstantNode":switch(typeof I.value){case"number":return D(I.value,O);case"string":return I.value;default:if(!isNaN(I.value))return D(I.value,O)}return I;case"FunctionNode":if(n[I.name]&&n[I.name].rawArgs)return I;{var F=["add","multiply"];if(!F.includes(I.name)){var q=I.args.map(le=>P(le,O));if(!q.some(ft))try{return y(I.name,q,O)}catch{}if(I.name==="size"&&q.length===1&&Sr(q[0])){for(var k=[],te=q[0];Sr(te);)k.push(te.items.length),te=te.items[0];return i(k)}return new s(I.name,q.map(E))}}case"OperatorNode":{var se=I.fn.toString(),K,V,ue=x(I);if(Ct(I)&&I.isUnary())K=[P(I.args[0],O)],ft(K[0])?V=ue(K):V=y(se,K,O);else if(w(I,O.context))if(K=v(I,O.context),K=K.map(le=>P(le,O)),h(se,O.context)){for(var me=[],re=[],ae=0;ae<K.length;ae++)ft(K[ae])?re.push(K[ae]):me.push(K[ae]);me.length>1?(V=R(se,me,ue,O),re.unshift(V),V=R(se,re,ue,O)):V=R(se,K,ue,O)}else V=R(se,K,ue,O);else K=I.args.map(le=>P(le,O)),V=R(se,K,ue,O);return V}case"ParenthesisNode":return P(I.content,O);case"AccessorNode":return _(P(I.object,O),P(I.index,O),O);case"ArrayNode":{var de=I.items.map(le=>P(le,O));return de.some(ft)?new c(de.map(E)):i(de)}case"IndexNode":return new f(I.dimensions.map(le=>g(le,O)));case"ObjectNode":{var ne={};for(var ce in I.properties)ne[ce]=g(I.properties[ce],O);return new p(ne)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(I.type))}}return g}),n0="simplifyCore",I9=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],R9=U(n0,I9,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,AccessorNode:s,ArrayNode:f,ConstantNode:p,FunctionNode:m,IndexNode:d,ObjectNode:h,OperatorNode:w,ParenthesisNode:v,SymbolNode:x}=e,g=new p(0),b=new p(1),y=new p(!0),N=new p(!1);function E(C){return Ct(C)&&["and","not","or"].includes(C.op)}var{hasProperty:A,isCommutative:D}=Il({FunctionNode:m,OperatorNode:w,SymbolNode:x});function S(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=_?_.context:void 0;if(A(C,"trivial",R)){if(Zn(C)&&C.args.length===1)return S(C.args[0],_);var P=!1,I=0;if(C.forEach(re=>{++I,I===1&&(P=S(re,_))}),I===1)return P}var O=C;if(Zn(O)){var F=j4(O.name);if(F){if(O.args.length>2&&A(O,"associative",R))for(;O.args.length>2;){var q=O.args.pop(),k=O.args.pop();O.args.push(new w(F,O.name,[q,k]))}O=new w(F,O.name,O.args)}else return new m(S(O.fn),O.args.map(re=>S(re,_)))}if(Ct(O)&&O.isUnary()){var te=S(O.args[0],_);if(O.op==="~"&&Ct(te)&&te.isUnary()&&te.op==="~"||O.op==="not"&&Ct(te)&&te.isUnary()&&te.op==="not"&&E(te.args[0]))return te.args[0];var se=!0;if(O.op==="-"&&Ct(te)&&(te.isBinary()&&te.fn==="subtract"&&(O=new w("-","subtract",[te.args[1],te.args[0]]),se=!1),te.isUnary()&&te.op==="-"))return te.args[0];if(se)return new w(O.op,O.fn,[te])}if(Ct(O)&&O.isBinary()){var K=S(O.args[0],_),V=S(O.args[1],_);if(O.op==="+"){if(nt(K)&&i(K.value))return V;if(nt(V)&&i(V.value))return K;Ct(V)&&V.isUnary()&&V.op==="-"&&(V=V.args[0],O=new w("-","subtract",[K,V]))}if(O.op==="-")return Ct(V)&&V.isUnary()&&V.op==="-"?S(new w("+","add",[K,V.args[0]]),_):nt(K)&&i(K.value)?S(new w("-","unaryMinus",[V])):nt(V)&&i(V.value)?K:new w(O.op,O.fn,[K,V]);if(O.op==="*"){if(nt(K)){if(i(K.value))return g;if(n(K.value,1))return V}if(nt(V)){if(i(V.value))return g;if(n(V.value,1))return K;if(D(O,R))return new w(O.op,O.fn,[V,K],O.implicit)}return new w(O.op,O.fn,[K,V],O.implicit)}if(O.op==="/")return nt(K)&&i(K.value)?g:nt(V)&&n(V.value,1)?K:new w(O.op,O.fn,[K,V]);if(O.op==="^"&&nt(V)){if(i(V.value))return b;if(n(V.value,1))return K}if(O.op==="and"){if(nt(K))if(K.value){if(E(V))return V;if(nt(V))return V.value?y:N}else return N;if(nt(V))if(V.value){if(E(K))return K}else return N}if(O.op==="or"){if(nt(K)){if(K.value)return y;if(E(V))return V}if(nt(V)){if(V.value)return y;if(E(K))return K}}return new w(O.op,O.fn,[K,V])}if(Ct(O))return new w(O.op,O.fn,O.args.map(re=>S(re,_)));if(Sr(O))return new f(O.items.map(re=>S(re,_)));if(Ti(O))return new s(S(O.object,_),S(O.index,_));if(Da(O))return new d(O.dimensions.map(re=>S(re,_)));if(mu(O)){var ue={};for(var me in O.properties)ue[me]=S(O.properties[me],_);return new h(ue)}return O}return t(n0,{Node:S,"Node,Object":S})}),q9="resolve",z9=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],j9=U(q9,z9,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function u(c,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!l)return c;if(zt(c)){if(s.has(c.name)){var f=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var p=l.get(c.name);if(ft(p)){var m=new Set(s);return m.add(c.name),u(p,l,m)}else return typeof p=="number"?r(String(p)):p!==void 0?new n(p):c}else if(Ct(c)){var d=c.args.map(function(w){return u(w,l,s)});return new a(c.op,c.fn,d,c.implicit)}else{if(An(c))return new o(u(c.content,l,s));if(Zn(c)){var h=c.args.map(function(w){return u(w,l,s)});return new i(c.name,h)}}return c.map(w=>u(w,l,s))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(c,l)=>u(c,aa(l)),"Array | Matrix":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array | Matrix, null | undefined":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array, Object":t.referTo("Array,Map",c=>(l,s)=>c(l,aa(s))),"Matrix, Object":t.referTo("Matrix,Map",c=>(l,s)=>c(l,aa(s))),"Array | Matrix, Map":t.referToSelf(c=>(l,s)=>l.map(f=>c(f,s)))})}),i0="symbolicEqual",L9=["parse","simplify","typed","OperatorNode"],P9=U(i0,L9,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function a(o,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=new i("-","subtract",[o,u]),s=r(l,{},c);return nt(s)&&!s.value}return n(i0,{"Node, Node":a,"Node, Node, Object":a})}),a0="derivative",V9=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],U9=U(a0,V9,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:a,isZero:o,numeric:u,ConstantNode:c,FunctionNode:l,OperatorNode:s,ParenthesisNode:f,SymbolNode:p}=e;function m(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},N={};w(N,g,b.name);var E=v(g,N);return y.simplify?i(E):E}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var d=t(a0,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),d._simplify=!0,d.toTex=function(g){return h.apply(null,g.args)};var h=t("_derivTex",{"Node, SymbolNode":function(g,b){return nt(g)&&dt(g.value)==="string"?h(n(g.value).toString(),b.toString(),1):h(g.toTex(),b.toString(),1)},"Node, ConstantNode":function(g,b){if(dt(b.value)==="string")return h(g,n(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(g,b,y){return h(g.toString(),b.name,y.value)},"string, string, number":function(g,b,y){var N;return y===1?N="{d\\over d"+b+"}":N="{d^{"+y+"}\\over d"+b+"^{"+y+"}}",N+"\\left[".concat(g,"\\right]")}}),w=t("constTag",{"Object, ConstantNode, string":function(g,b){return g[b]=!0,!0},"Object, SymbolNode, string":function(g,b,y){return b.name!==y?(g[b]=!0,!0):!1},"Object, ParenthesisNode, string":function(g,b,y){return w(g,b.content,y)},"Object, FunctionAssignmentNode, string":function(g,b,y){return b.params.includes(y)?w(g,b.expr,y):(g[b]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(g,b,y){if(b.args.length>0){for(var N=w(g,b.args[0],y),E=1;E<b.args.length;++E)N=w(g,b.args[E],y)&&N;if(N)return g[b]=!0,!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(g){return x(0)},"SymbolNode, Object":function(g,b){return b[g]!==void 0?x(0):x(1)},"ParenthesisNode, Object":function(g,b){return new f(v(g.content,b))},"FunctionAssignmentNode, Object":function(g,b){return b[g]!==void 0?x(0):v(g.expr,b)},"FunctionNode, Object":function(g,b){if(b[g]!==void 0)return x(0);var y=g.args[0],N,E=!1,A=!1,D;switch(g.name){case"cbrt":E=!0,D=new s("*","multiply",[x(3),new s("^","pow",[y,new s("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(g.args.length===1)E=!0,D=new s("*","multiply",[x(2),new l("sqrt",[y])]);else if(g.args.length===2)return N=new s("/","divide",[x(1),g.args[1]]),b[N]=b[g.args[1]],v(new s("^","pow",[y,N]),b);break;case"log10":N=x(10);case"log":if(!N&&g.args.length===1)D=y.clone(),E=!0;else if(g.args.length===1&&N||g.args.length===2&&b[g.args[1]]!==void 0)D=new s("*","multiply",[y.clone(),new l("log",[N||g.args[1]])]),E=!0;else if(g.args.length===2)return v(new s("/","divide",[new l("log",[y]),new l("log",[g.args[1]])]),b);break;case"pow":if(g.args.length===2)return b[N]=b[g.args[1]],v(new s("^","pow",[y,g.args[1]]),b);break;case"exp":D=new l("exp",[y.clone()]);break;case"sin":D=new l("cos",[y.clone()]);break;case"cos":D=new s("-","unaryMinus",[new l("sin",[y.clone()])]);break;case"tan":D=new s("^","pow",[new l("sec",[y.clone()]),x(2)]);break;case"sec":D=new s("*","multiply",[g,new l("tan",[y.clone()])]);break;case"csc":A=!0,D=new s("*","multiply",[g,new l("cot",[y.clone()])]);break;case"cot":A=!0,D=new s("^","pow",[new l("csc",[y.clone()]),x(2)]);break;case"asin":E=!0,D=new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])]);break;case"acos":E=!0,A=!0,D=new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])]);break;case"atan":E=!0,D=new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)]);break;case"asec":E=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acsc":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acot":E=!0,A=!0,D=new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)]);break;case"sinh":D=new l("cosh",[y.clone()]);break;case"cosh":D=new l("sinh",[y.clone()]);break;case"tanh":D=new s("^","pow",[new l("sech",[y.clone()]),x(2)]);break;case"sech":A=!0,D=new s("*","multiply",[g,new l("tanh",[y.clone()])]);break;case"csch":A=!0,D=new s("*","multiply",[g,new l("coth",[y.clone()])]);break;case"coth":A=!0,D=new s("^","pow",[new l("csch",[y.clone()]),x(2)]);break;case"asinh":E=!0,D=new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)])]);break;case"acosh":E=!0,D=new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])]);break;case"atanh":E=!0,D=new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])]);break;case"asech":E=!0,A=!0,D=new s("*","multiply",[y.clone(),new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])])]);break;case"acsch":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acoth":E=!0,A=!0,D=new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])]);break;case"abs":D=new s("/","divide",[new l(new p("abs"),[y.clone()]),y.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+g.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var S,C;E?(S="/",C="divide"):(S="*",C="multiply");var _=v(y,b);return A&&(_=new s("-","unaryMinus",[_])),new s(S,C,[_,D])},"OperatorNode, Object":function(g,b){if(b[g]!==void 0)return x(0);if(g.op==="+")return new s(g.op,g.fn,g.args.map(function(P){return v(P,b)}));if(g.op==="-"){if(g.isUnary())return new s(g.op,g.fn,[v(g.args[0],b)]);if(g.isBinary())return new s(g.op,g.fn,[v(g.args[0],b),v(g.args[1],b)])}if(g.op==="*"){var y=g.args.filter(function(P){return b[P]!==void 0});if(y.length>0){var N=g.args.filter(function(P){return b[P]===void 0}),E=N.length===1?N[0]:new s("*","multiply",N),A=y.concat(v(E,b));return new s("*","multiply",A)}return new s("+","add",g.args.map(function(P){return new s("*","multiply",g.args.map(function(I){return I===P?v(I,b):I.clone()}))}))}if(g.op==="/"&&g.isBinary()){var D=g.args[0],S=g.args[1];return b[S]!==void 0?new s("/","divide",[v(D,b),S]):b[D]!==void 0?new s("*","multiply",[new s("-","unaryMinus",[D]),new s("/","divide",[v(S,b),new s("^","pow",[S.clone(),x(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[v(D,b),S.clone()]),new s("*","multiply",[D.clone(),v(S,b)])]),new s("^","pow",[S.clone(),x(2)])])}if(g.op==="^"&&g.isBinary()){var C=g.args[0],_=g.args[1];if(b[C]!==void 0)return nt(C)&&(o(C.value)||a(C.value,1))?x(0):new s("*","multiply",[g,new s("*","multiply",[new l("log",[C.clone()]),v(_.clone(),b)])]);if(b[_]!==void 0){if(nt(_)){if(o(_.value))return x(0);if(a(_.value,1))return v(C,b)}var R=new s("^","pow",[C.clone(),new s("-","subtract",[_,x(1)])]);return new s("*","multiply",[_.clone(),new s("*","multiply",[v(C,b),R])])}return new s("*","multiply",[new s("^","pow",[C.clone(),_.clone()]),new s("+","add",[new s("*","multiply",[v(C,b),new s("/","divide",[_.clone(),C.clone()])]),new s("*","multiply",[v(_,b),new l("log",[C.clone()])])])])}throw new Error('Cannot process operator "'+g.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function x(g,b){return new c(u(g,r.number))}return d}),o0="rationalize",$9=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],H9=U(o0,$9,e=>{var{config:t,typed:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,parse:s,simplifyConstant:f,simplifyCore:p,simplify:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:x,ArrayNode:g,ConstantNode:b,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,SymbolNode:D,ParenthesisNode:S}=e;function C(O){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,k=R(),te=_(O,F,!0,k.firstRules),se=te.variables.length,K={exactFractions:!1},V={exactFractions:!0};if(O=te.expression,se>=1){O=P(O);var ue,me,re=!0,ae=!1;O=m(O,k.firstRules,{},K);for(var de;me=re?k.distrDivRules:k.sucDivRules,O=m(O,me,{},V),re=!re,de=O.toString(),de!==ue;)ae=!0,ue=de;ae&&(O=m(O,k.firstRulesAgain,{},K)),O=m(O,k.finalRules,{},K)}var ne=[],ce={};return O.type==="OperatorNode"&&O.isBinary()&&O.op==="/"?(se===1&&(O.args[0]=I(O.args[0],ne),O.args[1]=I(O.args[1])),q&&(ce.numerator=O.args[0],ce.denominator=O.args[1])):(se===1&&(O=I(O,ne)),q&&(ce.numerator=O,ce.denominator=null)),q?(ce.coefficients=ne,ce.variables=te.variables,ce.expression=O,ce):O}return r(o0,{Node:C,"Node, boolean":(O,F)=>C(O,{},F),"Node, Object":C,"Node, Object, boolean":C});function _(O,F,q,k){var te=[],se=m(O,k,F,{exactFractions:!1});q=!!q;var K="+-*"+(q?"/":"");ue(se);var V={};return V.expression=se,V.variables=te,V;function ue(me){var re=me.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode")if(me.op==="^"){if(me.args[1].type!=="ConstantNode"||!Fe(parseFloat(me.args[1].value)))throw new Error("There is a non-integer exponent");ue(me.args[0])}else{if(!K.includes(me.op))throw new Error("Operator "+me.op+" invalid in polynomial expression");for(var ae=0;ae<me.args.length;ae++)ue(me.args[ae])}else if(re==="SymbolNode"){var de=me.name,ne=te.indexOf(de);ne===-1&&te.push(de)}else if(re==="ParenthesisNode")ue(me.content);else if(re!=="ConstantNode")throw new Error("type "+re+" is not allowed in polynomial expression")}}function R(){var O=[p,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],F=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],q=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],k=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],te={};return te.firstRules=O.concat(F,k),te.distrDivRules=q,te.sucDivRules=k,te.firstRulesAgain=O.concat(F),te.finalRules=[p,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],te}function P(O,F,q){var k=O.type,te=arguments.length>1;if(k==="OperatorNode"&&O.isBinary()){var se=!1,K;if(O.op==="^"&&(O.args[0].type==="ParenthesisNode"||O.args[0].type==="OperatorNode")&&O.args[1].type==="ConstantNode"&&(K=parseFloat(O.args[1].value),se=K>=2&&Fe(K)),se){if(K>2){var V=O.args[0],ue=new A("^","pow",[O.args[0].cloneDeep(),new b(K-1)]);O=new A("*","multiply",[V,ue])}else O=new A("*","multiply",[O.args[0],O.args[0].cloneDeep()]);te&&(q==="content"?F.content=O:F.args[q]=O)}}if(k==="ParenthesisNode")P(O.content,O,"content");else if(k!=="ConstantNode"&&k!=="SymbolNode")for(var me=0;me<O.args.length;me++)P(O.args[me],O,me);if(!te)return O}function I(O,F){F===void 0&&(F=[]),F[0]=0;var q={};q.cte=1,q.oper="+",q.fire="";var k=0,te="";de(O,null,q),k=F.length-1;for(var se=!0,K,V=k;V>=0;V--)if(F[V]!==0){var ue=new b(se?F[V]:Math.abs(F[V])),me=F[V]<0?"-":"+";if(V>0){var re=new D(te);if(V>1){var ae=new b(V);re=new A("^","pow",[re,ae])}F[V]===-1&&se?ue=new A("-","unaryMinus",[re]):Math.abs(F[V])===1?ue=re:ue=new A("*","multiply",[ue,re])}se?K=ue:me==="+"?K=new A("+","add",[K,ue]):K=new A("-","subtract",[K,ue]),se=!1}if(se)return new b(0);return K;function de(ne,ce,le){var he=ne.type;if(he==="FunctionNode")throw new Error("There is an unsolved function call");if(he==="OperatorNode"){if(!"+-*^".includes(ne.op))throw new Error("Operator "+ne.op+" invalid");if(ce!==null){if((ne.fn==="unaryMinus"||ne.fn==="pow")&&ce.fn!=="add"&&ce.fn!=="subtract"&&ce.fn!=="multiply")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="multiply")&&ce.fn!=="add"&&ce.fn!=="subtract")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="unaryMinus")&&le.noFil!==0)throw new Error("Invalid "+ne.op+" placing")}(ne.op==="^"||ne.op==="*")&&(le.fire=ne.op);for(var xe=0;xe<ne.args.length;xe++)ne.fn==="unaryMinus"&&(le.oper="-"),(ne.op==="+"||ne.fn==="subtract")&&(le.fire="",le.cte=1,le.oper=xe===0?"+":ne.op),le.noFil=xe,de(ne.args[xe],ne,le)}else if(he==="SymbolNode"){if(ne.name!==te&&te!=="")throw new Error("There is more than one variable");if(te=ne.name,ce===null){F[1]=1;return}if(ce.op==="^"&&le.noFil!==0)throw new Error("In power the variable should be the first parameter");if(ce.op==="*"&&le.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(le.fire===""||le.fire==="*")&&(k<1&&(F[1]=0),F[1]+=le.cte*(le.oper==="+"?1:-1),k=Math.max(1,k))}else if(he==="ConstantNode"){var $=parseFloat(ne.value);if(ce===null){F[0]=$;return}if(ce.op==="^"){if(le.noFil!==1)throw new Error("Constant cannot be powered");if(!Fe($)||$<=0)throw new Error("Non-integer exponent is not allowed");for(var T=k+1;T<$;T++)F[T]=0;$>k&&(F[$]=0),F[$]+=le.cte*(le.oper==="+"?1:-1),k=Math.max($,k);return}le.cte=$,le.fire===""&&(F[0]+=le.cte*(le.oper==="+"?1:-1))}else throw new Error("Type "+he+" is not allowed")}}}),s0="zpk2tf",J9=["typed","add","multiply","Complex","number"],G9=U(s0,J9,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:a}=e;return t(s0,{"Array,Array,number":function(c,l,s){return o(c,l,s)},"Array,Array":function(c,l){return o(c,l,1)},"Matrix,Matrix,number":function(c,l,s){return o(c.valueOf(),l.valueOf(),s)},"Matrix,Matrix":function(c,l){return o(c.valueOf(),l.valueOf(),1)}});function o(c,l,s){c.some(x=>x.type==="BigNumber")&&(c=c.map(x=>a(x))),l.some(x=>x.type==="BigNumber")&&(l=l.map(x=>a(x)));for(var f=[i(1,0)],p=[i(1,0)],m=0;m<c.length;m++){var d=c[m];typeof d=="number"&&(d=i(d,0)),f=u(f,[i(1,0),i(-d.re,-d.im)])}for(var h=0;h<l.length;h++){var w=l[h];typeof w=="number"&&(w=i(w,0)),p=u(p,[i(1,0),i(-w.re,-w.im)])}for(var v=0;v<f.length;v++)f[v]=n(f[v],s);return[f,p]}function u(c,l){for(var s=[],f=0;f<c.length+l.length-1;f++){s[f]=i(0,0);for(var p=0;p<c.length;p++)f-p>=0&&f-p<l.length&&(s[f]=r(s[f],n(c[p],l[f-p])))}return s}}),u0="freqz",W9=["typed","add","multiply","Complex","divide","matrix"],K9=U(u0,W9,e=>{var{typed:t,add:r,multiply:n,Complex:i,divide:a,matrix:o}=e;return t(u0,{"Array, Array":function(l,s){var f=c(512);return u(l,s,f)},"Array, Array, Array":function(l,s,f){return u(l,s,f)},"Array, Array, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f);return u(l,s,p)},"Matrix, Matrix":function(l,s){var f=c(512),{w:p,h:m}=u(l.valueOf(),s.valueOf(),f);return{w:o(p),h:o(m)}},"Matrix, Matrix, Matrix":function(l,s,f){var{h:p}=u(l.valueOf(),s.valueOf(),f.valueOf());return{h:o(p),w:o(f)}},"Matrix, Matrix, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f),{h:m}=u(l.valueOf(),s.valueOf(),p);return{h:o(m),w:o(p)}}});function u(l,s,f){for(var p=[],m=[],d=0;d<f.length;d++){for(var h=i(0,0),w=i(0,0),v=0;v<l.length;v++)h=r(h,n(l[v],i(Math.cos(-v*f[d]),Math.sin(-v*f[d]))));for(var x=0;x<s.length;x++)w=r(w,n(s[x],i(Math.cos(-x*f[d]),Math.sin(-x*f[d]))));p.push(h),m.push(w)}for(var g=[],b=0;b<p.length;b++)g.push(a(p[b],m[b]));return{h:g,w:f}}function c(l){for(var s=[],f=0;f<l;f++)s.push(f/l*Math.PI);return s}}),Q9="reviver",Z9=["classes"],X9=U(Q9,Z9,e=>{var{classes:t}=e;return function(r,n){var i=t[n&&n.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(n):n}}),Y9="replacer",e7=[],t7=U(Y9,e7,()=>function(e,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t}),r7="12.4.3",n7=U("true",[],()=>!0),i7=U("false",[],()=>!1),a7=U("null",[],()=>null),o7=Nr("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),s7=Nr("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),u7=Nr("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Bl(r):xD}),c7=Nr("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?U_(r):wD}),l7=Nr("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?P_(r):ND}),f7=Nr("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?V_(r):DD}),p7=Nr("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),m7=Nr("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),d7=Nr("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),h7=Nr("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),g7=Nr("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),v7=Nr("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),y7=Nr("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),b7=U("version",[],()=>r7);function Nr(e,t,r){return U(e,t,r,{recreateOnConfigChange:!0})}var x7=Pe("speedOfLight","299792458","m s^-1"),w7=Pe("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),N7=Pe("planckConstant","6.62607015e-34","J s"),D7=Pe("reducedPlanckConstant","1.0545718176461565e-34","J s"),E7=Pe("magneticConstant","1.25663706212e-6","N A^-2"),A7=Pe("electricConstant","8.8541878128e-12","F m^-1"),S7=Pe("vacuumImpedance","376.730313667","ohm"),C7=Pe("coulomb","8.987551792261171e9","N m^2 C^-2"),M7=Pe("elementaryCharge","1.602176634e-19","C"),_7=Pe("bohrMagneton","9.2740100783e-24","J T^-1"),F7=Pe("conductanceQuantum","7.748091729863649e-5","S"),T7=Pe("inverseConductanceQuantum","12906.403729652257","ohm"),O7=Pe("magneticFluxQuantum","2.0678338484619295e-15","Wb"),B7=Pe("nuclearMagneton","5.0507837461e-27","J T^-1"),k7=Pe("klitzing","25812.807459304513","ohm"),I7=Pe("bohrRadius","5.29177210903e-11","m"),R7=Pe("classicalElectronRadius","2.8179403262e-15","m"),q7=Pe("electronMass","9.1093837015e-31","kg"),z7=Pe("fermiCoupling","1.1663787e-5","GeV^-2"),j7=Au("fineStructure",.0072973525693),L7=Pe("hartreeEnergy","4.3597447222071e-18","J"),P7=Pe("protonMass","1.67262192369e-27","kg"),V7=Pe("deuteronMass","3.3435830926e-27","kg"),U7=Pe("neutronMass","1.6749271613e-27","kg"),$7=Pe("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),H7=Pe("rydberg","10973731.568160","m^-1"),J7=Pe("thomsonCrossSection","6.6524587321e-29","m^2"),G7=Au("weakMixingAngle",.2229),W7=Au("efimovFactor",22.7),K7=Pe("atomicMass","1.66053906660e-27","kg"),Q7=Pe("avogadro","6.02214076e23","mol^-1"),Z7=Pe("boltzmann","1.380649e-23","J K^-1"),X7=Pe("faraday","96485.33212331001","C mol^-1"),Y7=Pe("firstRadiation","3.7417718521927573e-16","W m^2"),ek=Pe("loschmidt","2.686780111798444e25","m^-3"),tk=Pe("gasConstant","8.31446261815324","J K^-1 mol^-1"),rk=Pe("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),nk=Pe("molarVolume","0.022413969545014137","m^3 mol^-1"),ik=Au("sackurTetrode",-1.16487052358),ak=Pe("secondRadiation","0.014387768775039337","m K"),ok=Pe("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),sk=Pe("wienDisplacement","2.897771955e-3","m K"),uk=Pe("molarMass","0.99999999965e-3","kg mol^-1"),ck=Pe("molarMassC12","11.9999999958e-3","kg mol^-1"),lk=Pe("gravity","9.80665","m s^-2"),fk=Pe("planckLength","1.616255e-35","m"),pk=Pe("planckMass","2.176435e-8","kg"),mk=Pe("planckTime","5.391245e-44","s"),dk=Pe("planckCharge","1.87554603778e-18","C"),hk=Pe("planckTemperature","1.416785e+32","K");function Pe(e,t,r){var n=["config","Unit","BigNumber"];return U(e,n,i=>{var{config:a,Unit:o,BigNumber:u}=i,c=a.number==="BigNumber"?new u(t):parseFloat(t),l=new o(c,r);return l.fixPrefix=!0,l})}function Au(e,t){var r=["config","BigNumber"];return U(e,r,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(t):t})}var gk="apply",vk=["typed","isInteger"],yk=U(gk,vk,e=>{var{typed:t,isInteger:r}=e,n=Cl({typed:t,isInteger:r});return t("apply",{"...any":function(i){var a=i[1];Ue(a)?i[1]=a-1:$e(a)&&(i[1]=a.minus(1));try{return n.apply(null,i)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),bk="column",xk=["typed","Index","matrix","range"],wk=U(bk,xk,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=My({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0});function Rl(e,t,r){var n=e.filter(function(c){return zt(c)&&!(c.name in t)&&!r.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,o=new Xg(r,a,new Set([i])),u=e.compile();return function(c){return a.set(i,c),u.evaluate(o)}}var Nk="filter",Dk=["typed"],Ek=U(Nk,Dk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=Rl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("filter",{"Array, function":c0,"Matrix, function":function(i,a){return i.create(c0(i.toArray(),a))},"Array, RegExp":Is,"Matrix, RegExp":function(i,a){return i.create(Is(i.toArray(),a))}});return r},{isTransformFunction:!0});function c0(e,t){return wv(e,function(r,n,i){return Ma(t,r,[n+1],i,"filter")})}var Ak="forEach",Sk=["typed"],Ck=U(Ak,Sk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=Rl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(i,a){var o=function u(c,l){if(Array.isArray(c))bu(c,function(s,f){u(s,l.concat(f+1))});else return Ma(a,c,l,i,"forEach")};o(i.valueOf(),[])}});return r},{isTransformFunction:!0}),Mk="index",_k=["Index","getMatrixDataType"],Fk=U(Mk,_k,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var n=[],i=0,a=arguments.length;i<a;i++){var o=arguments[i];if(wl(o))o.start--,o.end-=o.step>0?0:2;else if(o&&o.isSet===!0)o=o.map(function(c){return c-1});else if(st(o)||ke(o))r(o)!=="boolean"&&(o=o.map(function(c){return c-1}));else if(Ue(o))o--;else if($e(o))o=o.toNumber()-1;else if(typeof o!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");n[i]=o}var u=new t;return t.apply(u,n),u}},{isTransformFunction:!0}),Tk="map",Ok=["typed"],Bk=U(Tk,Ok,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=Rl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("map",{"Array, function":function(i,a){return l0(i,a,i)},"Matrix, function":function(i,a){return i.create(l0(i.valueOf(),a,i))}});return r},{isTransformFunction:!0});function l0(e,t,r){function n(i,a){return Array.isArray(i)?Nn(i,function(o,u){return n(o,a.concat(u+1))}):Ma(t,i,a,r,"map")}return n(e,[])}function ai(e){if(e.length===2&&Fr(e[0])){e=e.slice();var t=e[1];Ue(t)?e[1]=t-1:$e(t)&&(e[1]=t.minus(1))}return e}var kk="max",Ik=["typed","config","numeric","larger"],Rk=U(kk,Ik,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,a=zy({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),qk="mean",zk=["typed","add","divide"],jk=U(qk,zk,e=>{var{typed:t,add:r,divide:n}=e,i=Gy({typed:t,add:r,divide:n});return t("mean",{"...any":function(a){a=ai(a);try{return i.apply(null,a)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),Lk="min",Pk=["typed","config","numeric","smaller"],Vk=U(Lk,Pk,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,a=jy({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Uk="range",$k=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Hk=U(Uk,$k,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e,f=Oy({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s});return t("range",{"...any":function(p){var m=p.length-1,d=p[m];return typeof d!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),Jk="row",Gk=["typed","Index","matrix","range"],Wk=U(Jk,Gk,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=By({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0}),Kk="subset",Qk=["typed","matrix","zeros","add"],Zk=U(Kk,Qk,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=ky({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(o){try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Xk="concat",Yk=["typed","matrix","isInteger"],eI=U(Xk,Yk,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=Cy({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(a){var o=a.length-1,u=a[o];Ue(u)?a[o]=u-1:$e(u)&&(a[o]=u.minus(1));try{return i.apply(null,a)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),f0="diff",tI=["typed","matrix","subtract","number","bignumber"],rI=U(f0,tI,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e,o=_y({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(f0,{"...any":function(u){u=ai(u);try{return o.apply(null,u)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),nI="std",iI=["typed","map","sqrt","variance"],aI=U(nI,iI,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,a=Qy({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),p0="sum",oI=["typed","config","add","numeric"],sI=U(p0,oI,e=>{var{typed:t,config:r,add:n,numeric:i}=e,a=Hy({typed:t,config:r,add:n,numeric:i});return t(p0,{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),uI="quantileSeq",cI=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],lI=U(uI,cI,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=Ky({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(h,w,v,x)=>m(h,w,v,d(x)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(h,w,v,x)=>m(h,w,v,d(x))});function d(h){return ai([[],h])[1]}},{isTransformFunction:!0}),m0="cumsum",fI=["typed","add","unaryPlus"],pI=U(m0,fI,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=Jy({typed:t,add:r,unaryPlus:n});return t(m0,{"...any":function(a){if(a.length===2&&Fr(a[0])){var o=a[1];Ue(o)?a[1]=o-1:$e(o)&&(a[1]=o.minus(1))}try{return i.apply(null,a)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),d0="variance",mI=["typed","add","subtract","multiply","divide","apply","isNaN"],dI=U(d0,mI,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e,c=Wy({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u});return t(d0,{"...any":function(l){l=ai(l);try{return c.apply(null,l)}catch(s){throw lr(s)}}})},{isTransformFunction:!0}),h0="print",hI=["typed","matrix","zeros","add"],gI=U(h0,hI,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=Ry({typed:t,matrix:r,zeros:n,add:i});return t(h0,{"string, Object | Array":function(u,c){return a(o(u),c)},"string, Object | Array, number | Object":function(u,c,l){return a(o(u),c,l)}});function o(u){return u.replace(Iy,c=>{var l=c.slice(1).split("."),s=l.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+s.join(".")})}},{isTransformFunction:!0}),vI="and",yI=["typed","matrix","zeros","add","equalScalar","not","concat"],bI=U(vI,yI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=qy({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)&&!u(p,!0))return!1;var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),xI="or",wI=["typed","matrix","equalScalar","DenseMatrix","concat"],NI=U(xI,wI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Sy({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)&&o(f,!1))return!0;var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),DI="bitAnd",EI=["typed","matrix","zeros","add","equalScalar","not","concat"],AI=U(DI,EI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=Ey({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)){if(isNaN(p))return NaN;if(p===0||p===!1)return 0}var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),SI="bitOr",CI=["typed","matrix","equalScalar","DenseMatrix","concat"],MI=U(SI,CI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Ay({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),Ae=z2({config:ve}),ht=U2({}),g0=l7({BigNumber:Ae,config:ve}),_I=i7({}),FI=j7({BigNumber:Ae,config:ve}),Pi=G2({}),a1=y7({Complex:ht}),TI=o7({BigNumber:Ae,config:ve}),OI=m7({BigNumber:Ae,config:ve}),BI=h7({BigNumber:Ae,config:ve}),Su=Y2({}),kI=s7({BigNumber:Ae,config:ve}),II=a7({}),RI=f7({BigNumber:Ae,config:ve}),qI=Q2({}),o1=VN({}),zI=g7({BigNumber:Ae,config:ve}),jI=ik({BigNumber:Ae,config:ve}),s1=c7({BigNumber:Ae,config:ve}),LI=n7({}),PI=b7({}),He=mD({Matrix:Su}),VI=W7({BigNumber:Ae,config:ve}),UI=p7({BigNumber:Ae,config:ve}),Wc=u7({BigNumber:Ae,config:ve}),$I=t7({}),HI=v7({BigNumber:Ae,config:ve}),W=zN({BigNumber:Ae,Complex:ht,DenseMatrix:He,Fraction:Pi}),ql=EE({BigNumber:Ae,config:ve,typed:W}),JI=G7({BigNumber:Ae,config:ve}),fr=SE({typed:W}),GI=e3({Complex:ht,config:ve,typed:W}),WI=i3({BigNumber:Ae,typed:W}),KI=u3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),Rt=FE({typed:W}),QI=vS({typed:W}),ZI=d3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),XI=b3({typed:W}),u1=N3({typed:W}),YI=S3({Complex:ht,config:ve,typed:W}),ir=iE({BigNumber:Ae,typed:W}),eR=lS({typed:W}),tR=tE({typed:W}),rR=hD({typed:W}),Cu=O6({typed:W}),Mu=sE({Complex:ht,typed:W}),Vi=bS({typed:W}),zl=M3({typed:W}),nR=O3({BigNumber:Ae,typed:W}),iR=R3({BigNumber:Ae,typed:W}),aR=HE({typed:W}),Xe=UD({config:ve,typed:W}),oR=PC({typed:W}),c1=GE({typed:W}),sR=KE({Complex:ht,typed:W}),uR=jS({typed:W}),cR=US({typed:W}),Ao=XC({typed:W}),jl=JS({typed:W}),lR=iM({format:Ao,typed:W}),Ll=wS({typed:W}),dr=vD({typed:W}),oi=MD({typed:W}),Ui=kD({typed:W}),Wr=RD({typed:W}),fR=d7({BigNumber:Ae,config:ve}),pR=z6({Complex:ht,typed:W}),mR=FA({Complex:ht,config:ve,typed:W}),l1=OA({Complex:ht,config:ve,typed:W}),$i=XS({typed:W}),At=IA({typed:W}),Zs=AS({typed:W}),Tn=ZD({typed:W}),dR=rM({format:Ao,typed:W}),hR=p9({config:ve,typed:W}),gR=Ry({typed:W}),vR=d9({config:ve,typed:W}),Pl=DS({typed:W}),yR=L3({BigNumber:Ae,typed:W}),f1=PA({BigNumber:Ae,Fraction:Pi,complex:Mu,typed:W}),_u=$3({typed:W}),On=JD({Matrix:Su,equalScalar:Xe,typed:W}),bR=xE({typed:W}),xR=JA({typed:W}),wR=YD({typed:W}),Or=OE({typed:W}),NR=W3({typed:W}),p1=LD({typed:W}),DR=r3({Complex:ht,config:ve,typed:W}),ER=l3({BigNumber:Ae,typed:W}),Vl=Cl({isInteger:dr,typed:W}),AR=p3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),SR=eM({format:Ao,typed:W}),CR=k6({typed:W}),MR=F3({typed:W}),_R=z3({BigNumber:Ae,typed:W}),So=zD({typed:W}),FR=cM({typed:W}),TR=g9({config:ve,typed:W}),OR=V3({BigNumber:Ae,typed:W}),BR=J3({typed:W}),kR=Q_({SparseMatrix:On,typed:W}),Kr=$A({Complex:ht,config:ve,typed:W}),IR=Z3({typed:W}),ln=NE({typed:W}),RR=o3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),qR=k3({BigNumber:Ae,typed:W}),Fa=lE({Fraction:Pi,typed:W}),Hi=FD({typed:W}),we=pE({DenseMatrix:He,Matrix:Su,SparseMatrix:On,typed:W}),zR=dE({isZero:Wr,matrix:we,typed:W}),jR=WC({isNaN:So,isNumeric:Hi,typed:W}),Pr=pM({bignumber:ir,fraction:Fa,number:Tn}),m1=QC({config:ve,multiplyScalar:At,numeric:Pr,typed:W}),d1=oC({isInteger:dr,matrix:we,typed:W}),Gt=gC({matrix:we,config:ve,typed:W}),LR=yC({matrix:we,typed:W}),Co=EC({matrix:we,typed:W}),h1=QA({BigNumber:Ae,config:ve,matrix:we,typed:W}),Ut=MC({BigNumber:Ae,config:ve,matrix:we,typed:W}),PR=g3({Complex:ht,config:ve,typed:W}),g1=kE({BigNumber:Ae,Complex:ht,Fraction:Pi,config:ve,isNegative:oi,matrix:we,typed:W,unaryMinus:ln}),it=Cy({isInteger:dr,matrix:we,typed:W}),VR=OS({prod:m1,size:Gt,typed:W}),Ul=SC({conj:Vi,transpose:Co,typed:W}),v1=RS({DenseMatrix:He,SparseMatrix:On,matrix:we,typed:W}),Nt=dM({numeric:Pr,typed:W}),Mo=MM({DenseMatrix:He,concat:it,divideScalar:Nt,equalScalar:Xe,matrix:we,typed:W}),Br=r_({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),_o=PS({matrix:we,typed:W}),UR=OD({isNumeric:Hi,typed:W}),si=WS({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,config:ve,matrix:we,typed:W}),$R=QS({matrix:we,multiplyScalar:At,typed:W}),Fu=g_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),HR=LM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),y1=FM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),$l=yE({flatten:_o,matrix:we,size:Gt,typed:W}),JR=jA({BigNumber:Ae,concat:it,equalScalar:Xe,matrix:we,typed:W}),GR=nC({BigNumber:Ae,config:ve,matrix:we,typed:W}),Hl=BF({addScalar:Rt,complex:Mu,conj:Vi,divideScalar:Nt,equal:Br,identity:si,isZero:Wr,matrix:we,multiplyScalar:At,sign:f1,sqrt:Kr,subtractScalar:Or,typed:W,unaryMinus:ln,zeros:Ut}),WR=cC({config:ve,matrix:we}),KR=VM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),tn=yM({BigNumber:Ae,DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),ar=s_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Dt=WA({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,subtractScalar:Or,typed:W,unaryMinus:ln}),QR=sM({concat:it,matrix:we,typed:W}),ZR=w_({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:W}),Jl=OM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),XR=MS({DenseMatrix:He,concat:it,matrix:we,typed:W}),rt=b4({DenseMatrix:He,SparseMatrix:On,addScalar:Rt,concat:it,equalScalar:Xe,matrix:we,typed:W}),YR=E3({BigNumber:Ae,DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),eq=Ey({concat:it,equalScalar:Xe,matrix:we,typed:W}),tq=Ay({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),rq=hS({DenseMatrix:He,concat:it,matrix:we,typed:W}),nq=N9({addScalar:Rt,combinations:Cu,divideScalar:Nt,isInteger:dr,isNegative:oi,multiplyScalar:At,typed:W}),Ji=GM({BigNumber:Ae,DenseMatrix:He,Fraction:Pi,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:W}),b1=e_({concat:it,matrix:we,typed:W}),iq=Jy({add:rt,typed:W,unaryPlus:ql}),Gl=b_({equal:Br,typed:W}),aq=_y({matrix:we,number:Tn,subtract:Dt,typed:W}),oq=h6({abs:fr,addScalar:Rt,deepEqual:Gl,divideScalar:Nt,multiplyScalar:At,sqrt:Kr,subtractScalar:Or,typed:W}),Tu=A4({addScalar:Rt,conj:Vi,multiplyScalar:At,size:Gt,typed:W}),sq=a_({compareText:b1,isZero:Wr,typed:W}),x1=wy({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),uq=EA({BigNumber:Ae,DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),cq=w4({abs:fr,addScalar:Rt,divideScalar:Nt,isPositive:Ui,multiplyScalar:At,smaller:ar,sqrt:Kr,typed:W}),w1=T_({DenseMatrix:He,smaller:ar}),Xt=k_({ImmutableDenseMatrix:w1,getMatrixDataType:jl}),or=m_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Wl=xM({Complex:ht,config:ve,divideScalar:Nt,typed:W}),lq=kM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),fq=gE({flatten:_o,matrix:we,size:Gt,typed:W}),pq=jy({config:ve,numeric:Pr,smaller:ar,typed:W}),N1=Ny({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),ct=qA({addScalar:Rt,dot:Tu,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:W}),mq=EM({Complex:ht,config:ve,divideScalar:Nt,typed:W}),dq=Sy({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),Ou=E_({compare:Ji,isNaN:So,isNumeric:Hi,typed:W}),hq=$M({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),D1=nT({SparseMatrix:On,abs:fr,add:rt,divideScalar:Nt,larger:or,largerEq:Fu,multiply:ct,subtract:Dt,transpose:Co,typed:W}),Dr=ky({add:rt,matrix:we,typed:W,zeros:Ut}),Kl=Hy({add:rt,config:ve,numeric:Pr,typed:W}),gq=M4({add:rt,matrix:we,typed:W}),E1=RM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),vq=G9({Complex:ht,add:rt,multiply:ct,number:Tn,typed:W}),Ql=UE({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),fn=ZM({compare:Ji,typed:W}),yq=E9({addScalar:Rt,combinations:Cu,isInteger:dr,isNegative:oi,isPositive:Ui,larger:or,typed:W}),bq=kS({matrix:we,multiply:ct,subtract:Dt,typed:W}),A1=HB({divideScalar:Nt,isZero:Wr,matrix:we,multiply:ct,subtractScalar:Or,typed:W,unaryMinus:ln}),xq=rS({concat:it,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:W}),S1=q_({larger:or,smaller:ar}),C1=XE({Complex:ht,DenseMatrix:He,ceil:Ql,equalScalar:Xe,floor:x1,matrix:we,typed:W,zeros:Ut}),M1=F4({Index:Xt,typed:W}),wq=y6({abs:fr,add:rt,addScalar:Rt,config:ve,divideScalar:Nt,equalScalar:Xe,flatten:_o,isNumeric:Hi,isZero:Wr,matrix:we,multiply:ct,multiplyScalar:At,smaller:ar,subtract:Dt,typed:W}),Nq=XA({BigNumber:Ae,add:rt,config:ve,equal:Br,isInteger:dr,mod:N1,smaller:ar,typed:W,xgcd:h1}),Dq=MA({concat:it,equalScalar:Xe,matrix:we,typed:W}),Eq=NM({Complex:ht,config:ve,divideScalar:Nt,log:Wl,typed:W}),Zl=zy({config:ve,larger:or,numeric:Pr,typed:W}),Aq=Y3({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Sq=n4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Cq=s4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Mq=f4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),ya=l_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),_q=S_({compare:Ji,compareNatural:fn,matrix:we,typed:W}),Fq=qy({concat:it,equalScalar:Xe,matrix:we,not:Zs,typed:W,zeros:Ut}),ba=Oy({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Ui,larger:or,largerEq:Fu,smaller:ar,smallerEq:ya,typed:W}),Tq=By({Index:Xt,matrix:we,range:ba,typed:W}),_1=t4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Oq=c4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),F1=h4({Index:Xt,concat:it,setDifference:_1,size:Gt,subset:Dr,typed:W}),T1=L_({FibonacciHeap:S1,addScalar:Rt,equalScalar:Xe}),O1=My({Index:Xt,matrix:we,range:ba,typed:W}),Gi=GB({abs:fr,addScalar:Rt,det:A1,divideScalar:Nt,identity:si,matrix:we,multiply:ct,typed:W,unaryMinus:ln}),B1=TF({DenseMatrix:He,Spa:T1,SparseMatrix:On,abs:fr,addScalar:Rt,divideScalar:Nt,equalScalar:Xe,larger:or,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W,unaryMinus:ln}),Bq=KB({Complex:ht,add:rt,ctranspose:Ul,deepEqual:Gl,divideScalar:Nt,dot:Tu,dotDivide:Mo,equal:Br,inv:Gi,matrix:we,multiply:ct,typed:W}),kr=gM({Complex:ht,config:ve,fraction:Fa,identity:si,inv:Gi,matrix:we,multiply:ct,number:Tn,typed:W}),k1=a4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),kq=v4({Index:Xt,concat:it,setIntersect:k1,setSymDifference:F1,size:Gt,subset:Dr,typed:W}),Iq=i6({abs:fr,add:rt,identity:si,inv:Gi,map:$i,max:Zl,multiply:ct,size:Gt,sqrt:Kr,subtract:Dt,typed:W}),qe=J_({BigNumber:Ae,Complex:ht,Fraction:Pi,abs:fr,addScalar:Rt,config:ve,divideScalar:Nt,equal:Br,fix:C1,format:Ao,isNumeric:Hi,multiplyScalar:At,number:Tn,pow:kr,round:tn,subtractScalar:Or}),Rq=S7({BigNumber:Ae,Unit:qe,config:ve}),qq=sk({BigNumber:Ae,Unit:qe,config:ve}),zq=K7({BigNumber:Ae,Unit:qe,config:ve}),jq=_7({BigNumber:Ae,Unit:qe,config:ve}),Lq=Z7({BigNumber:Ae,Unit:qe,config:ve}),Pq=F7({BigNumber:Ae,Unit:qe,config:ve}),Vq=C7({BigNumber:Ae,Unit:qe,config:ve}),Uq=V7({BigNumber:Ae,Unit:qe,config:ve}),$q=SM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,pow:kr,typed:W}),Hq=A7({BigNumber:Ae,Unit:qe,config:ve}),Jq=M7({BigNumber:Ae,Unit:qe,config:ve}),Gq=r6({abs:fr,add:rt,identity:si,inv:Gi,multiply:ct,typed:W}),Wq=X7({BigNumber:Ae,Unit:qe,config:ve}),I1=FC({addScalar:Rt,ceil:Ql,conj:Vi,divideScalar:Nt,dotDivide:Mo,exp:c1,i:a1,log2:l1,matrix:we,multiplyScalar:At,pow:kr,tau:s1,typed:W}),Xl=R6({BigNumber:Ae,Complex:ht,config:ve,multiplyScalar:At,pow:kr,typed:W}),Kq=w7({BigNumber:Ae,Unit:qe,config:ve}),Qq=L7({BigNumber:Ae,Unit:qe,config:ve}),Zq=OC({conj:Vi,dotDivide:Mo,fft:I1,typed:W}),Xq=k7({BigNumber:Ae,Unit:qe,config:ve}),Yq=ek({BigNumber:Ae,Unit:qe,config:ve}),ez=E7({BigNumber:Ae,Unit:qe,config:ve}),tz=uk({BigNumber:Ae,Unit:qe,config:ve}),rz=rk({BigNumber:Ae,Unit:qe,config:ve}),nz=U7({BigNumber:Ae,Unit:qe,config:ve}),iz=B7({BigNumber:Ae,Unit:qe,config:ve}),az=dk({BigNumber:Ae,Unit:qe,config:ve}),oz=fk({BigNumber:Ae,Unit:qe,config:ve}),sz=hk({BigNumber:Ae,Unit:qe,config:ve}),uz=P7({BigNumber:Ae,Unit:qe,config:ve}),cz=$7({BigNumber:Ae,Unit:qe,config:ve}),lz=D7({BigNumber:Ae,Unit:qe,config:ve}),fz=H7({BigNumber:Ae,Unit:qe,config:ve}),pz=ak({BigNumber:Ae,Unit:qe,config:ve}),mz=x7({BigNumber:Ae,Unit:qe,config:ve}),dz=ok({BigNumber:Ae,Unit:qe,config:ve}),hz=J7({BigNumber:Ae,Unit:qe,config:ve}),gz=Q7({BigNumber:Ae,Unit:qe,config:ve}),vz=I7({BigNumber:Ae,Unit:qe,config:ve}),yz=X_({Unit:qe,typed:W}),jt=m6({divideScalar:Nt,equalScalar:Xe,inv:Gi,matrix:we,multiply:ct,typed:W}),bz=q7({BigNumber:Ae,Unit:qe,config:ve}),Fo=L6({gamma:Xl,typed:W}),xz=Y7({BigNumber:Ae,Unit:qe,config:ve}),wz=lk({BigNumber:Ae,Unit:qe,config:ve}),Nz=T7({BigNumber:Ae,Unit:qe,config:ve}),R1=aT({DenseMatrix:He,lsolve:y1,lup:B1,matrix:we,slu:D1,typed:W,usolve:Jl}),Dz=O7({BigNumber:Ae,Unit:qe,config:ve}),Ez=ck({BigNumber:Ae,Unit:qe,config:ve}),Az=$6({add:rt,divide:jt,factorial:Fo,isInteger:dr,isPositive:Ui,multiply:ct,typed:W}),Sz=J6({factorial:Fo,typed:W}),Cz=pk({BigNumber:Ae,Unit:qe,config:ve}),Mz=sT({add:rt,cbrt:g1,divide:jt,equalScalar:Xe,im:Ll,isZero:Wr,multiply:ct,re:Pl,sqrt:Kr,subtract:Dt,typeOf:p1,typed:W,unaryMinus:ln}),_z=m4({compareNatural:fn,typed:W}),Fz=zC({abs:fr,add:rt,bignumber:ir,divide:jt,isNegative:oi,isPositive:Ui,larger:or,map:$i,matrix:we,max:Zl,multiply:ct,smaller:ar,subtract:Dt,typed:W,unaryMinus:ln}),q1=y9({bignumber:ir,addScalar:Rt,combinations:Cu,divideScalar:Nt,factorial:Fo,isInteger:dr,isNegative:oi,larger:or,multiplyScalar:At,number:Tn,pow:kr,subtractScalar:Or,typed:W}),Tz=W_({Unit:qe,typed:W}),Oz=x9({addScalar:Rt,isInteger:dr,isNegative:oi,stirlingS2:q1,typed:W}),z1=e6({abs:fr,add:rt,addScalar:Rt,atan:u1,bignumber:ir,column:O1,complex:Mu,config:ve,cos:zl,diag:v1,divideScalar:Nt,dot:Tu,equal:Br,flatten:_o,im:Ll,inv:Gi,larger:or,matrix:we,matrixFromColumns:$l,multiply:ct,multiplyScalar:At,number:Tn,qr:Hl,re:Pl,reshape:d1,sin:_u,size:Gt,smaller:ar,sqrt:Kr,subtract:Dt,typed:W,usolve:Jl,usolveAll:E1}),Bz=z7({BigNumber:Ae,Unit:qe,config:ve}),kz=tk({BigNumber:Ae,Unit:qe,config:ve}),Iz=V6({divide:jt,dotDivide:Mo,isNumeric:Hi,log:Wl,map:$i,matrix:we,multiply:ct,sum:Kl,typed:W}),j1=Gy({add:rt,divide:jt,typed:W}),Rz=nk({BigNumber:Ae,Unit:qe,config:ve}),qz=N7({BigNumber:Ae,Unit:qe,config:ve}),zz=Ky({bignumber:ir,add:rt,compare:Ji,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:Ou,smaller:ar,smallerEq:ya,subtract:Dt,typed:W}),Yl=Wy({add:rt,apply:Vl,divide:jt,isNaN:So,multiply:ct,subtract:Dt,typed:W}),jz=R7({BigNumber:Ae,Unit:qe,config:ve}),L1=D6({add:rt,compare:Ji,divide:jt,partitionSelect:Ou,typed:W}),Lz=F6({add:rt,divide:jt,matrix:we,mean:j1,multiply:ct,pow:kr,sqrt:Kr,subtract:Dt,sum:Kl,typed:W}),Pz=K9({Complex:ht,add:rt,divide:jt,matrix:we,multiply:ct,typed:W}),Vz=A6({abs:fr,map:$i,median:L1,subtract:Dt,typed:W}),Uz=Qy({map:$i,sqrt:Kr,typed:W,variance:Yl}),$z=JC({BigNumber:Ae,Complex:ht,add:rt,config:ve,divide:jt,equal:Br,factorial:Fo,gamma:Xl,isNegative:oi,multiply:ct,pi:Wc,pow:kr,sin:_u,smallerEq:ya,subtract:Dt,typed:W}),ef=D4({abs:fr,add:rt,conj:Vi,ctranspose:Ul,eigs:z1,equalScalar:Xe,larger:or,matrix:we,multiply:ct,pow:kr,smaller:ar,sqrt:Kr,typed:W}),P1=mC({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,addScalar:Rt,config:ve,cos:zl,matrix:we,multiplyScalar:At,norm:ef,sin:_u,typed:W,unaryMinus:ln}),Hz=mk({BigNumber:Ae,Unit:qe,config:ve}),V1=u6({identity:si,matrix:we,multiply:ct,norm:ef,qr:Hl,subtract:Dt,typed:W}),Jz=fC({multiply:ct,rotationMatrix:P1,typed:W}),U1=o6({abs:fr,add:rt,concat:it,identity:si,index:M1,lusolve:R1,matrix:we,matrixFromColumns:$l,multiply:ct,range:ba,schur:V1,subset:Dr,subtract:Dt,transpose:Co,typed:W}),Gz=l6({matrix:we,multiply:ct,sylvester:U1,transpose:Co,typed:W}),Ta={},Oa={},$1={},tr=B4({mathWithTransform:Oa}),Ba=aF({Node:tr}),Bn=sF({Node:tr}),Wi=cF({Node:tr}),H1=mF({Node:tr}),ka=q4({Node:tr}),J1=U4({Node:tr,ResultSet:o1}),G1=H4({Node:tr}),ui=Y4({Node:tr}),W1=fF({Node:tr}),Wz=X9({classes:$1}),tf=mT({math:Ta,typed:W}),K1=tF({Node:tr,typed:W}),Q1=UB({Chain:tf,typed:W}),Ia=nF({Node:tr,size:Gt}),Ra=I4({Node:tr,subset:Dr}),Z1=P4({matrix:we,Node:tr,subset:Dr}),ci=gF({Unit:qe,Node:tr,math:Ta}),li=yF({Node:tr,SymbolNode:ci,math:Ta}),pn=xF({AccessorNode:Ra,ArrayNode:ka,AssignmentNode:Z1,BlockNode:J1,ConditionalNode:G1,ConstantNode:ui,FunctionAssignmentNode:K1,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,RangeNode:W1,RelationalNode:H1,SymbolNode:ci,config:ve,numeric:Pr,typed:W}),X1=j9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Wi,parse:pn,typed:W}),rf=k9({bignumber:ir,fraction:Fa,AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,SymbolNode:ci,config:ve,mathWithTransform:Oa,matrix:we,typed:W}),Kz=NF({parse:pn,typed:W}),nf=R9({AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,divide:jt,equal:Br,isZero:Wr,multiply:ct,parse:pn,pow:kr,subtract:Dt,typed:W}),af=EF({parse:pn,typed:W}),Y1=lT({evaluate:af}),eb=CF({evaluate:af}),Bu=T9({bignumber:ir,fraction:Fa,AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Wr,mathWithTransform:Oa,matrix:we,multiply:ct,parse:pn,pow:kr,resolve:X1,simplifyConstant:rf,simplifyCore:nf,subtract:Dt,typed:W}),Qz=P9({OperatorNode:Bn,parse:pn,simplify:Bu,typed:W}),Zz=S9({parse:pn,typed:W}),Xz=_F({Parser:eb,typed:W}),Yz=H9({bignumber:ir,fraction:Fa,AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Wr,mathWithTransform:Oa,matrix:we,multiply:ct,parse:pn,pow:kr,simplify:Bu,simplifyConstant:rf,simplifyCore:nf,subtract:Dt,typed:W}),ej=U9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,config:ve,equal:Br,isZero:Wr,numeric:Pr,parse:pn,simplify:Bu,typed:W}),tj=PB({Help:Y1,mathWithTransform:Oa,typed:W});Ot(Ta,{e:g0,false:_I,fineStructure:FI,i:a1,Infinity:TI,LN10:OI,LOG10E:BI,NaN:kI,null:II,phi:RI,SQRT1_2:zI,sackurTetrode:jI,tau:s1,true:LI,E:g0,version:PI,efimovFactor:VI,LN2:UI,pi:Wc,replacer:$I,reviver:Wz,SQRT2:HI,typed:W,unaryPlus:ql,PI:Wc,weakMixingAngle:JI,abs:fr,acos:GI,acot:WI,acsc:KI,addScalar:Rt,arg:QI,asech:ZI,asinh:XI,atan:u1,atanh:YI,bignumber:ir,bitNot:eR,boolean:tR,clone:rR,combinations:Cu,complex:Mu,conj:Vi,cos:zl,cot:nR,csc:iR,cube:aR,equalScalar:Xe,erf:oR,exp:c1,expm1:sR,filter:uR,forEach:cR,format:Ao,getMatrixDataType:jl,hex:lR,im:Ll,isInteger:dr,isNegative:oi,isPositive:Ui,isZero:Wr,LOG2E:fR,lgamma:pR,log10:mR,log2:l1,map:$i,multiplyScalar:At,not:Zs,number:Tn,oct:dR,pickRandom:hR,print:gR,random:vR,re:Pl,sec:yR,sign:f1,sin:_u,splitUnit:bR,square:xR,string:wR,subtractScalar:Or,tan:NR,typeOf:p1,acosh:DR,acsch:ER,apply:Vl,asec:AR,bin:SR,chain:Q1,combinationsWithRep:CR,cosh:MR,csch:_R,isNaN:So,isPrime:FR,randomInt:TR,sech:OR,sinh:BR,sparse:kR,sqrt:Kr,tanh:IR,unaryMinus:ln,acoth:RR,coth:qR,fraction:Fa,isNumeric:Hi,matrix:we,matrixFromFunction:zR,mode:jR,numeric:Pr,prod:m1,reshape:d1,size:Gt,squeeze:LR,transpose:Co,xgcd:h1,zeros:Ut,asin:PR,cbrt:g1,concat:it,count:VR,ctranspose:Ul,diag:v1,divideScalar:Nt,dotDivide:Mo,equal:Br,flatten:_o,hasNumericValue:UR,identity:si,kron:$R,largerEq:Fu,leftShift:HR,lsolve:y1,matrixFromColumns:$l,nthRoot:JR,ones:GR,qr:Hl,resize:WR,rightArithShift:KR,round:tn,smaller:ar,subtract:Dt,to:QR,unequal:ZR,usolve:Jl,xor:XR,add:rt,atan2:YR,bitAnd:eq,bitOr:tq,bitXor:rq,catalan:nq,compare:Ji,compareText:b1,cumsum:iq,deepEqual:Gl,diff:aq,distance:oq,dot:Tu,equalText:sq,floor:x1,gcd:uq,hypot:cq,larger:or,log:Wl,lsolveAll:lq,matrixFromRows:fq,min:pq,mod:N1,multiply:ct,nthRoots:mq,or:dq,partitionSelect:Ou,rightLogShift:hq,slu:D1,subset:Dr,sum:Kl,trace:gq,usolveAll:E1,zpk2tf:vq,ceil:Ql,compareNatural:fn,composition:yq,cross:bq,det:A1,dotMultiply:xq,fix:C1,index:M1,intersect:wq,invmod:Nq,lcm:Dq,log1p:Eq,max:Zl,setCartesian:Aq,setDistinct:Sq,setIsSubset:Cq,setPowerset:Mq,smallerEq:ya,sort:_q,and:Fq,range:ba,row:Tq,setDifference:_1,setMultiplicity:Oq,setSymDifference:F1,column:O1,inv:Gi,lup:B1,pinv:Bq,pow:kr,setIntersect:k1,setUnion:kq,sqrtm:Iq,vacuumImpedance:Rq,wienDisplacement:qq,atomicMass:zq,bohrMagneton:jq,boltzmann:Lq,conductanceQuantum:Pq,coulomb:Vq,deuteronMass:Uq,dotPow:$q,electricConstant:Hq,elementaryCharge:Jq,expm:Gq,faraday:Wq,fft:I1,gamma:Xl,gravitationConstant:Kq,hartreeEnergy:Qq,ifft:Zq,klitzing:Xq,loschmidt:Yq,magneticConstant:ez,molarMass:tz,molarPlanckConstant:rz,neutronMass:nz,nuclearMagneton:iz,planckCharge:az,planckLength:oz,planckTemperature:sz,protonMass:uz,quantumOfCirculation:cz,reducedPlanckConstant:lz,rydberg:fz,secondRadiation:pz,speedOfLight:mz,stefanBoltzmann:dz,thomsonCrossSection:hz,avogadro:gz,bohrRadius:vz,createUnit:yz,divide:jt,electronMass:bz,factorial:Fo,firstRadiation:xz,gravity:wz,inverseConductanceQuantum:Nz,lusolve:R1,magneticFluxQuantum:Dz,molarMassC12:Ez,multinomial:Az,parse:pn,permutations:Sz,planckMass:Cz,polynomialRoot:Mz,resolve:X1,setSize:_z,simplifyConstant:rf,solveODE:Fz,stirlingS2:q1,unit:Tz,bellNumbers:Oz,compile:Kz,eigs:z1,fermiCoupling:Bz,gasConstant:kz,kldivergence:Iz,mean:j1,molarVolume:Rz,planckConstant:qz,quantileSeq:zz,simplifyCore:nf,variance:Yl,classicalElectronRadius:jz,evaluate:af,median:L1,simplify:Bu,symbolicEqual:Qz,corr:Lz,freqz:Pz,leafCount:Zz,mad:Vz,parser:Xz,rationalize:Yz,std:Uz,zeta:$z,derivative:ej,norm:ef,rotationMatrix:P1,help:tj,planckTime:Hz,schur:V1,rotate:Jz,sylvester:U1,lyap:Gz,config:ve});Ot(Oa,Ta,{filter:Ek({typed:W}),forEach:Ck({typed:W}),map:Bk({typed:W}),apply:yk({isInteger:dr,typed:W}),or:NI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),and:bI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:Zs,typed:W,zeros:Ut}),concat:eI({isInteger:dr,matrix:we,typed:W}),max:Rk({config:ve,larger:or,numeric:Pr,typed:W}),print:gI({add:rt,matrix:we,typed:W,zeros:Ut}),bitAnd:AI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:Zs,typed:W,zeros:Ut}),diff:rI({bignumber:ir,matrix:we,number:Tn,subtract:Dt,typed:W}),min:Vk({config:ve,numeric:Pr,smaller:ar,typed:W}),subset:Zk({add:rt,matrix:we,typed:W,zeros:Ut}),bitOr:MI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),cumsum:pI({add:rt,typed:W,unaryPlus:ql}),index:Fk({Index:Xt,getMatrixDataType:jl}),sum:sI({add:rt,config:ve,numeric:Pr,typed:W}),range:Hk({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Ui,larger:or,largerEq:Fu,smaller:ar,smallerEq:ya,typed:W}),row:Wk({Index:Xt,matrix:we,range:ba,typed:W}),column:wk({Index:Xt,matrix:we,range:ba,typed:W}),mean:jk({add:rt,divide:jt,typed:W}),quantileSeq:lI({add:rt,bignumber:ir,compare:Ji,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:Ou,smaller:ar,smallerEq:ya,subtract:Dt,typed:W}),variance:dI({add:rt,apply:Vl,divide:jt,isNaN:So,multiply:ct,subtract:Dt,typed:W}),std:aI({map:$i,sqrt:Kr,typed:W,variance:Yl})});Ot($1,{BigNumber:Ae,Complex:ht,Fraction:Pi,Matrix:Su,Node:tr,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,Range:qI,RelationalNode:H1,ResultSet:o1,ArrayNode:ka,BlockNode:J1,ConditionalNode:G1,ConstantNode:ui,DenseMatrix:He,RangeNode:W1,Chain:tf,FunctionAssignmentNode:K1,SparseMatrix:On,IndexNode:Ia,ImmutableDenseMatrix:w1,Index:Xt,AccessorNode:Ra,AssignmentNode:Z1,FibonacciHeap:S1,Spa:T1,Unit:qe,SymbolNode:ci,FunctionNode:li,Help:Y1,Parser:eb});tf.createProxy(Ta);function tb(e,t){return function(){return e.apply(t,arguments)}}const{toString:rj}=Object.prototype,{getPrototypeOf:of}=Object,ku=(e=>t=>{const r=rj.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Qr=e=>(e=e.toLowerCase(),t=>ku(t)===e),Iu=e=>t=>typeof t===e,{isArray:qa}=Array,lo=Iu("undefined");function nj(e){return e!==null&&!lo(e)&&e.constructor!==null&&!lo(e.constructor)&&xr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const rb=Qr("ArrayBuffer");function ij(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&rb(e.buffer),t}const aj=Iu("string"),xr=Iu("function"),nb=Iu("number"),Ru=e=>e!==null&&typeof e=="object",oj=e=>e===!0||e===!1,ys=e=>{if(ku(e)!=="object")return!1;const t=of(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},sj=Qr("Date"),uj=Qr("File"),cj=Qr("Blob"),lj=Qr("FileList"),fj=e=>Ru(e)&&xr(e.pipe),pj=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xr(e.append)&&((t=ku(e))==="formdata"||t==="object"&&xr(e.toString)&&e.toString()==="[object FormData]"))},mj=Qr("URLSearchParams"),[dj,hj,gj,vj]=["ReadableStream","Request","Response","Headers"].map(Qr),yj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function To(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),qa(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let u;for(n=0;n<o;n++)u=a[n],t.call(null,e[u],u,e)}}function ib(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Ni=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ab=e=>!lo(e)&&e!==Ni;function Kc(){const{caseless:e}=ab(this)&&this||{},t={},r=(n,i)=>{const a=e&&ib(t,i)||i;ys(t[a])&&ys(n)?t[a]=Kc(t[a],n):ys(n)?t[a]=Kc({},n):qa(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&To(arguments[n],r);return t}const bj=(e,t,r,{allOwnKeys:n}={})=>(To(t,(i,a)=>{r&&xr(i)?e[a]=tb(i,r):e[a]=i},{allOwnKeys:n}),e),xj=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wj=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Nj=(e,t,r,n)=>{let i,a,o;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!u[o]&&(t[o]=e[o],u[o]=!0);e=r!==!1&&of(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Dj=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Ej=e=>{if(!e)return null;if(qa(e))return e;let t=e.length;if(!nb(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Aj=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&of(Uint8Array)),Sj=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},Cj=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Mj=Qr("HTMLFormElement"),_j=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),v0=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Fj=Qr("RegExp"),ob=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};To(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},Tj=e=>{ob(e,(t,r)=>{if(xr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(xr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Oj=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return qa(e)?n(e):n(String(e).split(t)),r},Bj=()=>{},kj=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,hc="abcdefghijklmnopqrstuvwxyz",y0="0123456789",sb={DIGIT:y0,ALPHA:hc,ALPHA_DIGIT:hc+hc.toUpperCase()+y0},Ij=(e=16,t=sb.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Rj(e){return!!(e&&xr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const qj=e=>{const t=new Array(10),r=(n,i)=>{if(Ru(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=qa(n)?[]:{};return To(n,(o,u)=>{const c=r(o,i+1);!lo(c)&&(a[u]=c)}),t[i]=void 0,a}}return n};return r(e,0)},zj=Qr("AsyncFunction"),jj=e=>e&&(Ru(e)||xr(e))&&xr(e.then)&&xr(e.catch),ub=((e,t)=>e?setImmediate:t?((r,n)=>(Ni.addEventListener("message",({source:i,data:a})=>{i===Ni&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Ni.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",xr(Ni.postMessage)),Lj=typeof queueMicrotask<"u"?queueMicrotask.bind(Ni):typeof process<"u"&&process.nextTick||ub,ge={isArray:qa,isArrayBuffer:rb,isBuffer:nj,isFormData:pj,isArrayBufferView:ij,isString:aj,isNumber:nb,isBoolean:oj,isObject:Ru,isPlainObject:ys,isReadableStream:dj,isRequest:hj,isResponse:gj,isHeaders:vj,isUndefined:lo,isDate:sj,isFile:uj,isBlob:cj,isRegExp:Fj,isFunction:xr,isStream:fj,isURLSearchParams:mj,isTypedArray:Aj,isFileList:lj,forEach:To,merge:Kc,extend:bj,trim:yj,stripBOM:xj,inherits:wj,toFlatObject:Nj,kindOf:ku,kindOfTest:Qr,endsWith:Dj,toArray:Ej,forEachEntry:Sj,matchAll:Cj,isHTMLForm:Mj,hasOwnProperty:v0,hasOwnProp:v0,reduceDescriptors:ob,freezeMethods:Tj,toObjectSet:Oj,toCamelCase:_j,noop:Bj,toFiniteNumber:kj,findKey:ib,global:Ni,isContextDefined:ab,ALPHABET:sb,generateString:Ij,isSpecCompliantForm:Rj,toJSONObject:qj,isAsyncFn:zj,isThenable:jj,setImmediate:ub,asap:Lj};function We(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(We,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ge.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const cb=We.prototype,lb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{lb[e]={value:e}});Object.defineProperties(We,lb);Object.defineProperty(cb,"isAxiosError",{value:!0});We.from=(e,t,r,n,i,a)=>{const o=Object.create(cb);return ge.toFlatObject(e,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError"),We.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const Pj=null;function Qc(e){return ge.isPlainObject(e)||ge.isArray(e)}function fb(e){return ge.endsWith(e,"[]")?e.slice(0,-2):e}function b0(e,t,r){return e?e.concat(t).map(function(n,i){return n=fb(n),!r&&i?"["+n+"]":n}).join(r?".":""):t}function Vj(e){return ge.isArray(e)&&!e.some(Qc)}const Uj=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function qu(e,t,r){if(!ge.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!ge.isUndefined(d[m])});const n=r.metaTokens,i=r.visitor||l,a=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&ge.isSpecCompliantForm(t);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(ge.isDate(m))return m.toISOString();if(!u&&ge.isBlob(m))throw new We("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(m)||ge.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,d,h){let w=m;if(m&&!h&&typeof m=="object"){if(ge.endsWith(d,"{}"))d=n?d:d.slice(0,-2),m=JSON.stringify(m);else if(ge.isArray(m)&&Vj(m)||(ge.isFileList(m)||ge.endsWith(d,"[]"))&&(w=ge.toArray(m)))return d=fb(d),w.forEach(function(v,x){!(ge.isUndefined(v)||v===null)&&t.append(o===!0?b0([d],x,a):o===null?d:d+"[]",c(v))}),!1}return Qc(m)?!0:(t.append(b0(h,d,a),c(m)),!1)}const s=[],f=Object.assign(Uj,{defaultVisitor:l,convertValue:c,isVisitable:Qc});function p(m,d){if(!ge.isUndefined(m)){if(s.indexOf(m)!==-1)throw Error("Circular reference detected in "+d.join("."));s.push(m),ge.forEach(m,function(h,w){(!(ge.isUndefined(h)||h===null)&&i.call(t,h,ge.isString(w)?w.trim():w,d,f))===!0&&p(h,d?d.concat(w):[w])}),s.pop()}}if(!ge.isObject(e))throw new TypeError("data must be an object");return p(e),t}function x0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function sf(e,t){this._pairs=[],e&&qu(e,this,t)}const pb=sf.prototype;pb.append=function(e,t){this._pairs.push([e,t])};pb.toString=function(e){const t=e?function(r){return e.call(this,r,x0)}:x0;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function $j(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mb(e,t,r){if(!t)return e;const n=r&&r.encode||$j,i=r&&r.serialize;let a;if(i?a=i(t,r):a=ge.isURLSearchParams(t)?t.toString():new sf(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class w0{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ge.forEach(this.handlers,function(r){r!==null&&t(r)})}}const db={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hj=typeof URLSearchParams<"u"?URLSearchParams:sf,Jj=typeof FormData<"u"?FormData:null,Gj=typeof Blob<"u"?Blob:null,Wj={isBrowser:!0,classes:{URLSearchParams:Hj,FormData:Jj,Blob:Gj},protocols:["http","https","file","blob","url","data"]},uf=typeof window<"u"&&typeof document<"u",Kj=(e=>uf&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Qj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zj=uf&&window.location.href||"http://localhost",Xj=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:uf,hasStandardBrowserEnv:Kj,hasStandardBrowserWebWorkerEnv:Qj,origin:Zj},Symbol.toStringTag,{value:"Module"})),Vr={...Xj,...Wj};function Yj(e,t){return qu(e,new Vr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Vr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function eL(e){return ge.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tL(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function hb(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;const u=Number.isFinite(+o),c=a>=r.length;return o=!o&&ge.isArray(i)?i.length:o,c?(ge.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!u):((!i[o]||!ge.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&ge.isArray(i[o])&&(i[o]=tL(i[o])),!u)}if(ge.isFormData(e)&&ge.isFunction(e.entries)){const r={};return ge.forEachEntry(e,(n,i)=>{t(eL(n),i,r,0)}),r}return null}function rL(e,t,r){if(ge.isString(e))try{return(t||JSON.parse)(e),ge.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Oo={transitional:db,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=ge.isObject(e);if(i&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return n?JSON.stringify(hb(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e)||ge.isReadableStream(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Yj(e,this.formSerializer).toString();if((a=ge.isFileList(e))||r.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return qu(a?{"files[]":e}:e,o&&new o,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),rL(e)):e}],transformResponse:[function(e){const t=this.transitional||Oo.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(ge.isResponse(e)||ge.isReadableStream(e))return e;if(e&&ge.isString(e)&&(r&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?We.from(a,We.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ge.forEach(["delete","get","head","post","put","patch"],e=>{Oo.headers[e]={}});const nL=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),iL=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
72
|
-
`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&
|
|
73
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const r=(this[N0]=this[N0]={accessors:{}}).accessors,n=this.prototype;function i(a){const o=Ja(a);r[o]||(uL(n,a),r[o]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}}hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ge.reduceDescriptors(hr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});ge.freezeMethods(hr);function vc(e,t){const r=this||Oo,n=t||r,i=hr.from(n.headers);let a=n.data;return ge.forEach(e,function(o){a=o.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function gb(e){return!!(e&&e.__CANCEL__)}function za(e,t,r){We.call(this,e??"canceled",We.ERR_CANCELED,t,r),this.name="CanceledError"}ge.inherits(za,We,{__CANCEL__:!0});function vb(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new We("Request failed with status code "+r.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function cL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function lL(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),l=n[a];o||(o=c),r[i]=u,n[i]=c;let s=a,f=0;for(;s!==i;)f+=r[s++],s=s%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(f*1e3/p):void 0}}function fL(e,t){let r=0,n=1e3/t,i,a;const o=(u,c=Date.now())=>{r=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),l=c-r;l>=n?o(u,c):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-l)))},()=>i&&o(i)]}const Xs=(e,t,r=3)=>{let n=0;const i=lL(50,250);return fL(a=>{const o=a.loaded,u=a.lengthComputable?a.total:void 0,c=o-n,l=i(c),s=o<=u;n=o;const f={loaded:o,total:u,progress:u?o/u:void 0,bytes:c,rate:l||void 0,estimated:l&&u&&s?(u-o)/l:void 0,event:a,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(f)},r)},D0=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},E0=e=>(...t)=>ge.asap(()=>e(...t)),pL=Vr.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(i){let a=i;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(i){const a=ge.isString(i)?n(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),mL=Vr.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];ge.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),ge.isString(n)&&o.push("path="+n),ge.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function dL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function yb(e,t){return e&&!dL(t)?hL(e,t):t}const A0=e=>e instanceof hr?{...e}:e;function Bi(e,t){t=t||{};const r={};function n(l,s,f){return ge.isPlainObject(l)&&ge.isPlainObject(s)?ge.merge.call({caseless:f},l,s):ge.isPlainObject(s)?ge.merge({},s):ge.isArray(s)?s.slice():s}function i(l,s,f){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l,f)}else return n(l,s,f)}function a(l,s){if(!ge.isUndefined(s))return n(void 0,s)}function o(l,s){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l)}else return n(void 0,s)}function u(l,s,f){if(f in t)return n(l,s);if(f in e)return n(void 0,l)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(l,s)=>i(A0(l),A0(s),!0)};return ge.forEach(Object.keys(Object.assign({},e,t)),function(l){const s=c[l]||i,f=s(e[l],t[l],l);ge.isUndefined(f)&&s!==u||(r[l]=f)}),r}const bb=e=>{const t=Bi({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:u}=t;t.headers=o=hr.from(o),t.url=mb(yb(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(ge.isFormData(r)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...s]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...s].join("; "))}}if(Vr.hasStandardBrowserEnv&&(n&&ge.isFunction(n)&&(n=n(t)),n||n!==!1&&pL(t.url))){const l=i&&a&&mL.read(a);l&&o.set(i,l)}return t},gL=typeof XMLHttpRequest<"u",vL=gL&&function(e){return new Promise(function(t,r){const n=bb(e);let i=n.data;const a=hr.from(n.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:c}=n,l,s,f,p,m;function d(){p&&p(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout;function w(){if(!h)return;const x=hr.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),g={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};vb(function(b){t(b),d()},function(b){r(b),d()},g),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(r(new We("Request aborted",We.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new We("Network Error",We.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let x=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const g=n.transitional||db;n.timeoutErrorMessage&&(x=n.timeoutErrorMessage),r(new We(x,g.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),"setRequestHeader"in h&&ge.forEach(a.toJSON(),function(x,g){h.setRequestHeader(g,x)}),ge.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),o&&o!=="json"&&(h.responseType=n.responseType),c&&([f,m]=Xs(c,!0),h.addEventListener("progress",f)),u&&h.upload&&([s,p]=Xs(u),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(l=x=>{h&&(r(!x||x.type?new za(null,e,h):x),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const v=cL(n.url);if(v&&Vr.protocols.indexOf(v)===-1){r(new We("Unsupported protocol "+v+":",We.ERR_BAD_REQUEST,e));return}h.send(i||null)})},yL=(e,t)=>{let r=new AbortController,n;const i=function(c){if(!n){n=!0,o();const l=c instanceof Error?c:this.reason;r.abort(l instanceof We?l:new za(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{i(new We(`timeout ${t} of ms exceeded`,We.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",i):c.unsubscribe(i))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=o,[u,()=>{a&&clearTimeout(a),a=null}]},bL=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},xL=async function*(e,t,r){for await(const n of e)yield*bL(ArrayBuffer.isView(n)?n:await r(String(n)),t)},S0=(e,t,r,n,i)=>{const a=xL(e,t,i);let o=0,u,c=l=>{u||(u=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:s,value:f}=await a.next();if(s){c(),l.close();return}let p=f.byteLength;if(r){let m=o+=p;r(m)}l.enqueue(new Uint8Array(f))}catch(s){throw c(s),s}},cancel(l){return c(l),a.return()}},{highWaterMark:2})},zu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",xb=zu&&typeof ReadableStream=="function",Zc=zu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),wb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},wL=xb&&wb(()=>{let e=!1;const t=new Request(Vr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),C0=64*1024,Xc=xb&&wb(()=>ge.isReadableStream(new Response("").body)),Ys={stream:Xc&&(e=>e.body)};zu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ys[t]&&(Ys[t]=ge.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new We(`Response type '${t}' is not supported`,We.ERR_NOT_SUPPORT,n)})})})(new Response);const NL=async e=>{if(e==null)return 0;if(ge.isBlob(e))return e.size;if(ge.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ge.isArrayBufferView(e)||ge.isArrayBuffer(e))return e.byteLength;if(ge.isURLSearchParams(e)&&(e=e+""),ge.isString(e))return(await Zc(e)).byteLength},DL=async(e,t)=>ge.toFiniteNumber(e.getContentLength())??NL(t),EL=zu&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:u,onUploadProgress:c,responseType:l,headers:s,withCredentials:f="same-origin",fetchOptions:p}=bb(e);l=l?(l+"").toLowerCase():"text";let[m,d]=i||a||o?yL([i,a],o):[],h,w;const v=()=>{!h&&setTimeout(()=>{m&&m.unsubscribe()}),h=!0};let x;try{if(c&&wL&&r!=="get"&&r!=="head"&&(x=await DL(s,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),E;if(ge.isFormData(n)&&(E=N.headers.get("content-type"))&&s.setContentType(E),N.body){const[A,D]=D0(x,Xs(E0(c)));n=S0(N.body,C0,A,D,Zc)}}ge.isString(f)||(f=f?"include":"omit"),w=new Request(t,{...p,signal:m,method:r.toUpperCase(),headers:s.normalize().toJSON(),body:n,duplex:"half",credentials:f});let g=await fetch(w);const b=Xc&&(l==="stream"||l==="response");if(Xc&&(u||b)){const N={};["status","statusText","headers"].forEach(S=>{N[S]=g[S]});const E=ge.toFiniteNumber(g.headers.get("content-length")),[A,D]=u&&D0(E,Xs(E0(u),!0))||[];g=new Response(S0(g.body,C0,A,()=>{D&&D(),b&&v()},Zc),N)}l=l||"text";let y=await Ys[ge.findKey(Ys,l)||"text"](g,e);return!b&&v(),d&&d(),await new Promise((N,E)=>{vb(N,E,{data:y,headers:hr.from(g.headers),status:g.status,statusText:g.statusText,config:e,request:w})})}catch(g){throw v(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,e,w),{cause:g.cause||g}):We.from(g,g&&g.code,e,w)}}),Yc={http:Pj,xhr:vL,fetch:EL};ge.forEach(Yc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const M0=e=>`- ${e}`,AL=e=>ge.isFunction(e)||e===null||e===!1,Nb={getAdapter:e=>{e=ge.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a<t;a++){r=e[a];let o;if(n=r,!AL(r)&&(n=Yc[(o=String(r)).toLowerCase()],n===void 0))throw new We(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){const a=Object.entries(i).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
74
|
-
`+a.map(
|
|
75
|
-
`):" "+
|
|
76
|
-
`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=
|
|
71
|
+
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},eB={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},tB={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},rB={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},nB={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},iB={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},aB={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},oB={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},sB={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},uB={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},cB={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},lB={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},fB={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},pB={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},mB={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},dB={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},hB={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},gB={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},vB={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},yB={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},bB={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},xB={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},wB={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},NB={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},DB={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},EB={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},AB={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},SB={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},CB={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},MB={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},_B={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},FB={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},TB={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},OB={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},BB={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},kB={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},IB={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},RB={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},qB={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},zB={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},jB={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},LB={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},PB={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},VB={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},UB={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},$B={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},HB={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},JB={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},GB={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},KB={bignumber:zT,boolean:jT,complex:LT,createUnit:PT,fraction:VT,index:UT,matrix:$T,number:HT,sparse:JT,splitUnit:GT,string:KT,unit:WT,e:Dh,E:Dh,false:DT,i:ET,Infinity:AT,LN2:CT,LN10:ST,LOG2E:_T,LOG10E:MT,NaN:FT,null:TT,pi:Eh,PI:Eh,phi:OT,SQRT1_2:BT,SQRT2:kT,tau:IT,true:RT,version:qT,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:YT,lsolve:t5,lsolveAll:r5,lup:n5,lusolve:i5,leafCount:e5,polynomialRoot:a5,resolve:u5,simplify:c5,simplifyConstant:l5,simplifyCore:f5,symbolicEqual:m5,rationalize:s5,slu:p5,usolve:d5,usolveAll:h5,qr:o5,abs:g5,add:v5,cbrt:y5,ceil:b5,cube:x5,divide:w5,dotDivide:N5,dotMultiply:D5,dotPow:E5,exp:A5,expm:S5,expm1:C5,fix:M5,floor:_5,gcd:F5,hypot:T5,lcm:B5,log:k5,log2:q5,log1p:R5,log10:I5,mod:z5,multiply:j5,norm:L5,nthRoot:P5,nthRoots:V5,pow:U5,round:$5,sign:H5,sqrt:J5,sqrtm:G5,square:Z5,subtract:X5,unaryMinus:Y5,unaryPlus:eO,xgcd:tO,invmod:O5,bitAnd:rO,bitNot:nO,bitOr:iO,bitXor:aO,leftShift:oO,rightArithShift:sO,rightLogShift:uO,bellNumbers:cO,catalan:lO,composition:fO,stirlingS2:pO,config:QT,import:ZT,typed:XT,arg:mO,conj:dO,re:gO,im:hO,evaluate:vO,help:yO,distance:bO,intersect:xO,and:wO,not:NO,or:DO,xor:EO,concat:SO,count:CO,cross:MO,column:AO,ctranspose:_O,det:FO,diag:TO,diff:OO,dot:BO,getMatrixDataType:zO,identity:jO,filter:IO,flatten:RO,forEach:qO,inv:LO,pinv:PO,eigs:kO,kron:VO,matrixFromFunction:HO,matrixFromRows:JO,matrixFromColumns:$O,map:UO,ones:GO,partitionSelect:KO,range:WO,resize:ZO,reshape:QO,rotate:XO,rotationMatrix:YO,row:e8,size:t8,sort:r8,squeeze:n8,subset:i8,trace:a8,transpose:o8,zeros:s8,fft:u8,ifft:c8,sylvester:K5,schur:W5,lyap:Q5,solveODE:GB,combinations:l8,combinationsWithRep:f8,factorial:p8,gamma:m8,kldivergence:h8,lgamma:d8,multinomial:g8,permutations:v8,pickRandom:y8,random:b8,randomInt:x8,compare:w8,compareNatural:N8,compareText:D8,deepEqual:E8,equal:A8,equalText:S8,larger:C8,largerEq:M8,smaller:_8,smallerEq:F8,unequal:T8,setCartesian:O8,setDifference:B8,setDistinct:k8,setIntersect:I8,setIsSubset:R8,setMultiplicity:q8,setPowerset:z8,setSize:j8,setSymDifference:L8,setUnion:P8,zpk2tf:V8,freqz:U8,erf:$8,zeta:H8,cumsum:tB,mad:J8,max:G8,mean:K8,median:W8,min:Q8,mode:Z8,prod:X8,quantileSeq:Y8,std:eB,sum:rB,variance:nB,corr:iB,acos:aB,acosh:oB,acot:sB,acoth:uB,acsc:cB,acsch:lB,asec:fB,asech:pB,asin:mB,asinh:dB,atan:hB,atanh:vB,atan2:gB,cos:yB,cosh:bB,cot:xB,coth:wB,csc:NB,csch:DB,sec:EB,sech:AB,sin:SB,sinh:CB,tan:MB,tanh:_B,to:FB,clone:OB,format:BB,bin:TB,oct:$B,hex:IB,isNaN:qB,isInteger:RB,isNegative:zB,isNumeric:jB,hasNumericValue:kB,isPositive:LB,isPrime:PB,isZero:VB,print:HB,typeOf:JB,numeric:UB},Ah="help",WB=["typed","mathWithTransform","Help"],QB=U(Ah,WB,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(Ah,{any:function(i){var a,o=i;if(typeof i!="string"){for(a in r)if(Me(r,a)&&i===r[a]){o=a;break}}var u=nr(KB,o);if(!u){var c=typeof o=="function"?o.name:o;throw new Error('No documentation found on "'+c+'"')}return new n(u)}})}),Sh="chain",ZB=["typed","Chain"],XB=U(Sh,ZB,e=>{var{typed:t,Chain:r}=e;return t(Sh,{"":function(){return new r},any:function(n){return new r(n)}})}),Ch="det",YB=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],e6=U(Ch,YB,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(Ch,{any:function(l){return ze(l)},"Array | Matrix":function(l){var s;switch(ke(l)?s=l.size():Array.isArray(l)?(l=r(l),s=l.size()):s=[],s.length){case 0:return ze(l);case 1:if(s[0]===1)return ze(l.valueOf()[0]);if(s[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")");case 2:{var f=s[0],p=s[1];if(f===p)return c(l.clone().valueOf(),f);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(s)+")")}}});function c(l,s,f){if(s===1)return ze(l[0][0]);if(s===2)return n(i(l[0][0],l[1][1]),i(l[1][0],l[0][1]));for(var p=!1,m=new Array(s).fill(0).map((E,A)=>A),d=0;d<s;d++){var h=m[d];if(o(l[h][d])){var w=void 0;for(w=d+1;w<s;w++)if(!o(l[m[w]][d])){h=m[w],m[w]=m[d],m[d]=h,p=!p;break}if(w===s)return l[h][d]}for(var v=l[h][d],x=d===0?1:l[m[d-1]][d-1],g=d+1;g<s;g++)for(var b=m[g],y=d+1;y<s;y++)l[b][y]=a(n(i(l[b][y],v),i(l[b][d],l[h][y])),x)}var N=l[m[s-1]][s-1];return p?u(N):N}}),Mh="inv",t6=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],r6=U(Mh,t6,e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:c,abs:l}=e;return t(Mh,{"Array | Matrix":function(f){var p=ke(f)?f.size():Ve(f);switch(p.length){case 1:if(p[0]===1)return ke(f)?r([n(1,f.valueOf()[0])]):[n(1,f[0])];throw new RangeError("Matrix must be square (size: "+Ge(p)+")");case 2:{var m=p[0],d=p[1];if(m===d)return ke(f)?r(s(f.valueOf(),m,d),f.storage()):s(f,m,d);throw new RangeError("Matrix must be square (size: "+Ge(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(p)+")")}},any:function(f){return n(1,f)}});function s(f,p,m){var d,h,w,v,x;if(p===1){if(v=f[0][0],v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,v)]]}else if(p===2){var g=u(f);if(g===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],g),n(o(f[0][1]),g)],[n(o(f[1][0]),g),n(f[0][0],g)]]}else{var b=f.concat();for(d=0;d<p;d++)b[d]=b[d].concat();for(var y=c(p).valueOf(),N=0;N<m;N++){var E=l(b[N][N]),A=N;for(d=N+1;d<p;)l(b[d][N])>E&&(E=l(b[d][N]),A=d),d++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");d=A,d!==N&&(x=b[N],b[N]=b[d],b[d]=x,x=y[N],y[N]=y[d],y[d]=x);var D=b[N],S=y[N];for(d=0;d<p;d++){var C=b[d],_=y[d];if(d!==N){if(C[N]!==0){for(w=n(o(C[N]),D[N]),h=N;h<m;h++)C[h]=i(C[h],a(w,D[h]));for(h=0;h<m;h++)_[h]=i(_[h],a(w,S[h]))}}else{for(w=D[N],h=N;h<m;h++)C[h]=n(C[h],w);for(h=0;h<m;h++)_[h]=n(_[h],w)}}}return y}}}),_h="pinv",n6=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],i6=U(_h,n6,e=>{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:o,dot:u,ctranspose:c,divideScalar:l,multiply:s,add:f,Complex:p}=e;return t(_h,{"Array | Matrix":function(x){var g=ke(x)?x.size():Ve(x);switch(g.length){case 1:return v(x)?c(x):g[0]===1?n(x):o(c(x),u(x,x));case 2:{if(v(x))return c(x);var b=g[0],y=g[1];if(b===y)try{return n(x)}catch(N){if(!(N instanceof Error&&N.message.match(/Cannot calculate inverse, determinant is zero/)))throw N}return ke(x)?r(m(x.valueOf(),b,y),x.storage()):m(x,b,y)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(g)+")")}},any:function(x){return a(x,0)?ze(x):l(1,x)}});function m(x,g,b){var{C:y,F:N}=h(x,g,b),E=s(n(s(c(y),y)),c(y)),A=s(c(N),n(s(N,c(N))));return s(A,E)}function d(x,g,b){for(var y=ze(x),N=0,E=0;E<g;E++){if(b<=N)return y;for(var A=E;w(y[A][N]);)if(A++,g===A&&(A=E,N++,b===N))return y;[y[A],y[E]]=[y[E],y[A]];for(var D=y[E][N],S=0;S<b;S++)y[E][S]=o(y[E][S],D);for(var C=0;C<g;C++)if(C!==E){D=y[C][N];for(var _=0;_<b;_++)y[C][_]=f(y[C][_],s(-1,s(D,y[E][_])))}N++}return y}function h(x,g,b){var y=d(x,g,b),N=x.map((A,D)=>A.filter((S,C)=>C<g&&!w(u(y[C],y[C])))),E=y.filter((A,D)=>!w(u(y[D],y[D])));return{C:N,F:E}}function w(x){return a(f(x,p(1,1)),f(0,p(1,1)))}function v(x){return i(f(x,p(1,1)),f(s(x,0),p(1,1)))}});function a6(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:c,bignumber:l,diag:s,size:f,reshape:p,inv:m,qr:d,usolve:h,usolveAll:w,equal:v,complex:x,larger:g,smaller:b,matrixFromColumns:y,dot:N}=e;function E(W,V,ue,me){var re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ae=A(W,V,ue,me,re);D(W,V,ue,me,re,ae);var{values:de,C:ne}=S(W,V,ue,me,re);if(re){var ce=C(W,V,ne,ae,de,ue,me);return{values:de,eigenvectors:ce}}return{values:de}}function A(W,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(0):0,ce=ae?l(1):de?x(1):1,le=ae?l(1):1,he=ae?l(10):2,xe=a(he,he),$;re&&($=Array(V).fill(ce));for(var T=!1;!T;){T=!0;for(var z=0;z<V;z++){for(var J=ne,L=ne,H=0;H<V;H++)z!==H&&(J=t(J,c(W[H][z])),L=t(L,c(W[z][H])));if(!v(J,0)&&!v(L,0)){for(var G=le,Y=J,ee=o(L,he),B=a(L,he);b(Y,ee);)Y=a(Y,xe),G=a(G,he);for(;g(Y,B);)Y=o(Y,xe),G=o(G,he);var j=b(o(t(Y,L),G),a(t(J,L),.95));if(j){T=!1;for(var Q=o(1,G),Z=0;Z<V;Z++)z!==Z&&(W[z][Z]=a(W[z][Z],Q),W[Z][z]=a(W[Z][z],G));re&&($[z]=a($[z],Q))}}}}return re?s($):null}function D(W,V,ue,me,re,ae){var de=me==="BigNumber",ne=me==="Complex",ce=de?l(0):ne?x(0):0;de&&(ue=l(ue));for(var le=0;le<V-2;le++){for(var he=0,xe=ce,$=le+1;$<V;$++){var T=W[$][le];b(c(xe),c(T))&&(xe=T,he=$)}if(!b(c(xe),ue)){if(he!==le+1){var z=W[he];W[he]=W[le+1],W[le+1]=z;for(var J=0;J<V;J++){var L=W[J][he];W[J][he]=W[J][le+1],W[J][le+1]=L}if(re){var H=ae[he];ae[he]=ae[le+1],ae[le+1]=H}}for(var G=le+2;G<V;G++){var Y=o(W[G][le],xe);if(Y!==0){for(var ee=0;ee<V;ee++)W[G][ee]=r(W[G][ee],a(Y,W[le+1][ee]));for(var B=0;B<V;B++)W[B][le+1]=t(W[B][le+1],a(Y,W[B][G]));if(re)for(var j=0;j<V;j++)ae[G][j]=r(ae[G][j],a(Y,ae[le+1][j]))}}}}return ae}function S(W,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(1):de?x(1):1;ae&&(ue=l(ue));for(var ce=ze(W),le=[],he=V,xe=[],$=re?s(Array(V).fill(ne)):void 0,T=re?s(Array(he).fill(ne)):void 0,z=0;z<=100;){z+=1;for(var J=ce[he-1][he-1],L=0;L<he;L++)ce[L][L]=r(ce[L][L],J);var{Q:H,R:G}=d(ce);ce=i(G,H);for(var Y=0;Y<he;Y++)ce[Y][Y]=t(ce[Y][Y],J);if(re&&(T=i(T,H)),he===1||b(c(ce[he-1][he-2]),ue)){z=0,le.push(ce[he-1][he-1]),re&&(xe.unshift([[1]]),P(T,V),$=i($,T),he>1&&(T=s(Array(he-1).fill(ne)))),he-=1,ce.pop();for(var ee=0;ee<he;ee++)ce[ee].pop()}else if(he===2||b(c(ce[he-2][he-3]),ue)){z=0;var B=_(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1]);le.push(...B),re&&(xe.unshift(R(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1],B[0],B[1],ue,me)),P(T,V),$=i($,T),he>2&&(T=s(Array(he-2).fill(ne)))),he-=2,ce.pop(),ce.pop();for(var j=0;j<he;j++)ce[j].pop(),ce[j].pop()}if(he===0)break}if(le.sort((ie,oe)=>+r(c(ie),c(oe))),z>100){var Q=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+le.join(", "));throw Q.values=le,Q.vectors=[],Q}var Z=re?i($,I(xe,V)):void 0;return{values:le,C:Z}}function C(W,V,ue,me,re,ae,de){var ne=m(ue),ce=i(ne,W,ue),le=de==="BigNumber",he=de==="Complex",xe=le?l(0):he?x(0):0,$=le?l(1):he?x(1):1,T=[],z=[];for(var J of re){var L=O(T,J,v);L===-1?(T.push(J),z.push(1)):z[L]+=1}for(var H=[],G=T.length,Y=Array(V).fill(xe),ee=s(Array(V).fill($)),B=function(){var Q=T[j],Z=r(ce,i(Q,ee)),ie=w(Z,Y);for(ie.shift();ie.length<z[j];){var oe=F(Z,V,ie,ae,de);if(oe===null)break;ie.push(oe)}var ye=i(m(me),ue);ie=ie.map(fe=>i(ye,fe)),H.push(...ie.map(fe=>({value:Q,vector:n(fe)})))},j=0;j<G;j++)B();return H}function _(W,V,ue,me){var re=t(W,me),ae=r(a(W,me),a(V,ue)),de=a(re,.5),ne=a(u(r(a(re,re),a(4,ae))),.5);return[t(de,ne),r(de,ne)]}function R(W,V,ue,me,re,ae,de,ne){var ce=ne==="BigNumber",le=ne==="Complex",he=ce?l(0):le?x(0):0,xe=ce?l(1):le?x(1):1;if(b(c(ue),de))return[[xe,he],[he,xe]];if(g(c(r(re,ae)),de))return[[r(re,me),r(ae,me)],[ue,ue]];var $=r(W,re),T=r(me,re);return b(c(V),de)&&b(c(T),de)?[[$,xe],[ue,he]]:[[V,he],[T,xe]]}function P(W,V){for(var ue=0;ue<W.length;ue++)W[ue].push(...Array(V-W[ue].length).fill(0));for(var me=W.length;me<V;me++)W.push(Array(V).fill(0)),W[me][me]=1;return W}function I(W,V){for(var ue=[],me=0;me<V;me++)ue[me]=Array(V).fill(0);var re=0;for(var ae of W){for(var de=ae.length,ne=0;ne<de;ne++)for(var ce=0;ce<de;ce++)ue[re+ne][re+ce]=ae[ne][ce];re+=de}return ue}function O(W,V,ue){for(var me=0;me<W.length;me++)if(ue(W[me],V))return me;return-1}function F(W,V,ue,me,re){for(var ae=re==="BigNumber"?l(1e3):1e3,de,ne=0;ne<5;++ne){de=q(V,ue,re);try{de=h(W,de)}catch{continue}if(g(te(de),ae))break}if(ne>=5)return null;for(ne=0;;){var ce=h(W,de);if(b(te(k(de,[ce])),me))break;if(++ne>=10)return null;de=se(ce)}return de}function q(W,V,ue){var me=ue==="BigNumber",re=ue==="Complex",ae=Array(W).fill(0).map(de=>2*Math.random()-1);return me&&(ae=ae.map(de=>l(de))),re&&(ae=ae.map(de=>x(de))),ae=k(ae,V),se(ae,ue)}function k(W,V){var ue=f(W);for(var me of V)me=p(me,ue),W=r(W,i(o(N(me,W),N(me,me)),me));return W}function te(W){return c(u(N(W,W)))}function se(W,V){var ue=V==="BigNumber",me=V==="Complex",re=ue?l(1):me?x(1):1;return i(o(re,te(W)),W)}return E}function o6(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:a,cos:o,sin:u,multiplyScalar:c,inv:l,bignumber:s,multiply:f,add:p}=e;function m(D,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.epsilon,_=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(_==="number")return d(D,C,R);if(_==="BigNumber")return h(D,C,R);throw TypeError("Unsupported data type: "+_)}function d(D,S,C){var _=D.length,R=Math.abs(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=N(D);Math.abs(F[1])>=Math.abs(R);){var q=F[0][0],k=F[0][1];P=w(D[q][q],D[k][k],D[q][k]),D=y(D,P,q,k),C&&(I=x(I,P,q,k)),F=N(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function h(D,S,C){var _=D.length,R=i(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=E(D);i(F[1])>=i(R);){var q=F[0][0],k=F[0][1];P=v(D[q][q],D[k][k],D[q][k]),D=b(D,P,q,k),C&&(I=g(I,P,q,k)),F=E(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function w(D,S,C){var _=S-D;return Math.abs(_)<=t.epsilon?Math.PI/4:.5*Math.atan(2*C/(S-D))}function v(D,S,C){var _=n(S,D);return i(_)<=t.epsilon?s(-1).acos().div(4):c(.5,a(f(2,C,l(_))))}function x(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=Array(R).fill(0),F=Array(R).fill(0),q=0;q<R;q++)O[q]=P*D[q][C]-I*D[q][_],F[q]=I*D[q][C]+P*D[q][_];for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function g(D,S,C,_){for(var R=D.length,P=o(S),I=u(S),O=Array(R).fill(s(0)),F=Array(R).fill(s(0)),q=0;q<R;q++)O[q]=n(c(P,D[q][C]),c(I,D[q][_])),F[q]=r(c(I,D[q][C]),c(P,D[q][_]));for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function b(D,S,C,_){for(var R=D.length,P=s(o(S)),I=s(u(S)),O=c(P,P),F=c(I,I),q=Array(R).fill(s(0)),k=Array(R).fill(s(0)),te=f(s(2),P,I,D[C][_]),se=r(n(c(O,D[C][C]),te),c(F,D[_][_])),W=p(c(F,D[C][C]),te,c(O,D[_][_])),V=0;V<R;V++)q[V]=n(c(P,D[C][V]),c(I,D[_][V])),k[V]=r(c(I,D[C][V]),c(P,D[_][V]));D[C][C]=se,D[_][_]=W,D[C][_]=s(0),D[_][C]=s(0);for(var ue=0;ue<R;ue++)ue!==C&&ue!==_&&(D[C][ue]=q[ue],D[ue][C]=q[ue],D[_][ue]=k[ue],D[ue][_]=k[ue]);return D}function y(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=P*P,F=I*I,q=Array(R).fill(0),k=Array(R).fill(0),te=O*D[C][C]-2*P*I*D[C][_]+F*D[_][_],se=F*D[C][C]+2*P*I*D[C][_]+O*D[_][_],W=0;W<R;W++)q[W]=P*D[C][W]-I*D[_][W],k[W]=I*D[C][W]+P*D[_][W];D[C][C]=te,D[_][_]=se,D[C][_]=0,D[_][C]=0;for(var V=0;V<R;V++)V!==C&&V!==_&&(D[C][V]=q[V],D[V][C]=q[V],D[_][V]=k[V],D[V][_]=k[V]);return D}function N(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)Math.abs(C)<Math.abs(D[R][P])&&(C=Math.abs(D[R][P]),_=[R,P]);return[_,C]}function E(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)i(C)<i(D[R][P])&&(C=i(D[R][P]),_=[R,P]);return[_,C]}function A(D,S,C){var _=D.length,R=Array(_),P;if(C){P=Array(_);for(var I=0;I<_;I++)P[I]=Array(_)}for(var O=0;O<_;O++){for(var F=0,q=D[0],k=0;k<D.length;k++)i(D[k])<i(q)&&(F=k,q=D[F]);if(R[O]=D.splice(F,1)[0],C)for(var te=0;te<_;te++)P[O][te]=S[te][F],S[te].splice(F,1)}if(!C)return{values:R};var se=P.map((W,V)=>({value:R[V],vector:W}));return{values:R,eigenvectors:se}}return m}var s6="eigs",u6=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],c6=U(s6,u6,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:a,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,divideScalar:p,inv:m,bignumber:d,multiply:h,add:w,larger:v,column:x,flatten:g,number:b,complex:y,sqrt:N,diag:E,size:A,reshape:D,qr:S,usolve:C,usolveAll:_,im:R,re:P,smaller:I,matrixFromColumns:O,dot:F}=e,q=o6({config:t,addScalar:i,subtract:a,column:x,flatten:g,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,inv:m,bignumber:d,complex:y,multiply:h,add:w}),k=a6({config:t,addScalar:i,subtract:a,multiply:h,multiplyScalar:f,flatten:g,divideScalar:p,sqrt:N,abs:u,bignumber:d,diag:E,size:A,reshape:D,qr:S,inv:m,usolve:C,usolveAll:_,equal:o,complex:y,larger:v,smaller:I,matrixFromColumns:O,dot:F});return r("eigs",{Array:function(re){return te(n(re))},"Array, number|BigNumber":function(re,ae){return te(n(re),{precision:ae})},"Array, Object"(re,ae){return te(n(re),ae)},Matrix:function(re){return te(re,{matricize:!0})},"Matrix, number|BigNumber":function(re,ae){return te(re,{precision:ae,matricize:!0})},"Matrix, Object":function(re,ae){var de={matricize:!0};return Ot(de,ae),te(re,de)}});function te(re){var ae,de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne="eigenvectors"in de?de.eigenvectors:!0,ce=(ae=de.precision)!==null&&ae!==void 0?ae:t.epsilon,le=se(re,ce,ne);return de.matricize&&(le.values=n(le.values),ne&&(le.eigenvectors=le.eigenvectors.map(he=>{var{value:xe,vector:$}=he;return{value:xe,vector:n($)}}))),ne&&Object.defineProperty(le,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),le}function se(re,ae,de){var ne=re.toArray(),ce=re.size();if(ce.length!==2||ce[0]!==ce[1])throw new RangeError("Matrix must be square (size: ".concat(Ge(ce),")"));var le=ce[0];if(V(ne,le,ae)&&(ue(ne,le),W(ne,le,ae))){var he=me(re,ne,le);return q(ne,le,ae,he,de)}var xe=me(re,ne,le);return k(ne,le,ae,xe,de)}function W(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=ne;ce<ae;ce++)if(v(d(u(a(re[ne][ce],re[ce][ne]))),de))return!1;return!0}function V(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=0;ce<ae;ce++)if(v(d(u(R(re[ne][ce]))),de))return!1;return!0}function ue(re,ae){for(var de=0;de<ae;de++)for(var ne=0;ne<ae;ne++)re[de][ne]=P(re[de][ne])}function me(re,ae,de){var ne=re.datatype();if(ne==="number"||ne==="BigNumber"||ne==="Complex")return ne;for(var ce=!1,le=!1,he=!1,xe=0;xe<de;xe++)for(var $=0;$<de;$++){var T=ae[xe][$];if(Ue(T)||Do(T))ce=!0;else if($e(T))le=!0;else if(wn(T))he=!0;else throw TypeError("Unsupported type in Matrix: "+dt(T))}if(le&&he&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),he){for(var z=0;z<de;z++)for(var J=0;J<de;J++)ae[z][J]=y(ae[z][J]);return"Complex"}if(le){for(var L=0;L<de;L++)for(var H=0;H<de;H++)ae[L][H]=d(ae[L][H]);return"BigNumber"}if(ce){for(var G=0;G<de;G++)for(var Y=0;Y<de;Y++)ae[G][Y]=b(ae[G][Y]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),Fh="expm",l6=["typed","abs","add","identity","inv","multiply"],f6=U(Fh,l6,e=>{var{typed:t,abs:r,add:n,identity:i,inv:a,multiply:o}=e;return t(Fh,{Matrix:function(s){var f=s.size();if(f.length!==2||f[0]!==f[1])throw new RangeError("Matrix must be square (size: "+Ge(f)+")");for(var p=f[0],m=1e-15,d=u(s),h=c(d,m),w=h.q,v=h.j,x=o(s,Math.pow(2,-v)),g=i(p),b=i(p),y=1,N=x,E=-1,A=1;A<=w;A++)A>1&&(N=o(N,x),E=-E),y=y*(w-A+1)/((2*w-A+1)*A),g=n(g,o(y,N)),b=n(b,o(y*E,N));for(var D=o(a(b),g),S=0;S<v;S++)D=o(D,D);return Ni(s)?s.createSparseMatrix(D):D}});function u(s){for(var f=s.size()[0],p=0,m=0;m<f;m++){for(var d=0,h=0;h<f;h++)d+=r(s.get([m,h]));p=Math.max(d,p)}return p}function c(s,f){for(var p=30,m=0;m<p;m++)for(var d=0;d<=m;d++){var h=m-d;if(l(s,d,h)<f)return{q:d,j:h}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function l(s,f,p){for(var m=1,d=2;d<=f;d++)m*=d;for(var h=m,w=f+1;w<=2*f;w++)h*=w;var v=h*(2*f+1);return 8*Math.pow(s/Math.pow(2,p),2*f)*m*m/(h*v)}}),Th="sqrtm",p6=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],m6=U(Th,p6,e=>{var{typed:t,abs:r,add:n,multiply:i,map:a,sqrt:o,subtract:u,inv:c,size:l,max:s,identity:f}=e,p=1e3,m=1e-6;function d(h){var w,v=0,x=h,g=f(l(h));do{var b=x;if(x=i(.5,n(b,c(g))),g=i(.5,n(g,c(b))),w=s(r(u(x,b))),w>m&&++v>p)throw new Error("computing square root of matrix: iterative method could not converge")}while(w>m);return x}return t(Th,{"Array | Matrix":function(h){var w=ke(h)?h.size():Ve(h);switch(w.length){case 1:if(w[0]===1)return a(h,o);throw new RangeError("Matrix must be square (size: "+Ge(w)+")");case 2:{var v=w[0],x=w[1];if(v===x)return d(h);throw new RangeError("Matrix must be square (size: "+Ge(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ge(w)+")")}}})}),Oh="sylvester",d6=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],h6=U(Oh,d6,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:o,concat:u,transpose:c,index:l,subset:s,add:f,subtract:p,identity:m,lusolve:d,abs:h}=e;return t(Oh,{"Matrix, Matrix, Matrix":w,"Array, Matrix, Matrix":function(v,x,g){return w(i(v),x,g)},"Array, Array, Matrix":function(v,x,g){return w(i(v),i(x),g)},"Array, Matrix, Array":function(v,x,g){return w(i(v),x,i(g))},"Matrix, Array, Matrix":function(v,x,g){return w(v,i(x),g)},"Matrix, Array, Array":function(v,x,g){return w(v,i(x),i(g))},"Matrix, Matrix, Array":function(v,x,g){return w(v,x,i(g))},"Array, Array, Array":function(v,x,g){return w(i(v),i(x),i(g)).toArray()}});function w(v,x,g){for(var b=x.size()[0],y=v.size()[0],N=r(v),E=N.T,A=N.U,D=r(a(-1,x)),S=D.T,C=D.U,_=a(a(c(A),g),C),R=o(0,y),P=[],I=(he,xe)=>u(he,xe,1),O=(he,xe)=>u(he,xe,0),F=0;F<b;F++)if(F<b-1&&h(s(S,l(F+1,F)))>1e-5){for(var q=O(s(_,l(R,F)),s(_,l(R,F+1))),k=0;k<F;k++)q=f(q,O(a(P[k],s(S,l(k,F))),a(P[k],s(S,l(k,F+1)))));var te=a(m(y),a(-1,s(S,l(F,F)))),se=a(m(y),a(-1,s(S,l(F+1,F)))),W=a(m(y),a(-1,s(S,l(F,F+1)))),V=a(m(y),a(-1,s(S,l(F+1,F+1)))),ue=O(I(f(E,te),se),I(W,f(E,V))),me=d(ue,q);P[F]=me.subset(l(o(0,y),0)),P[F+1]=me.subset(l(o(y,2*y),0)),F++}else{for(var re=s(_,l(R,F)),ae=0;ae<F;ae++)re=f(re,a(P[ae],s(S,l(ae,F))));var de=s(S,l(F,F)),ne=p(E,a(de,m(y)));P[F]=d(ne,re)}var ce=i(n(...P)),le=a(A,a(ce,c(C)));return le}}),Bh="schur",g6=["typed","matrix","identity","multiply","qr","norm","subtract"],v6=U(Bh,g6,e=>{var{typed:t,matrix:r,identity:n,multiply:i,qr:a,norm:o,subtract:u}=e;return t(Bh,{Array:function(l){var s=c(r(l));return{U:s.U.valueOf(),T:s.T.valueOf()}},Matrix:function(l){return c(l)}});function c(l){var s=l.size()[0],f=l,p=n(s),m=0,d;do{d=f;var h=a(f),w=h.Q,v=h.R;if(f=i(v,w),p=i(p,w),m++>100)break}while(o(u(f,d))>1e-4);return{U:p,T:f}}}),kh="lyap",y6=["typed","matrix","sylvester","multiply","transpose"],b6=U(kh,y6,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(kh,{"Matrix, Matrix":function(o,u){return n(o,a(o),i(-1,u))},"Array, Matrix":function(o,u){return n(r(o),a(r(o)),i(-1,u))},"Matrix, Array":function(o,u){return n(o,a(r(o)),r(i(-1,u)))},"Array, Array":function(o,u){return n(r(o),a(r(o)),r(i(-1,u))).toArray()}})}),x6="divide",w6=["typed","matrix","multiply","equalScalar","divideScalar","inv"],N6=U(x6,w6,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e,u=Jt({typed:t,equalScalar:i}),c=Jr({typed:t});return t("divide",ev({"Array | Matrix, Array | Matrix":function(l,s){return n(l,o(s))},"DenseMatrix, any":function(l,s){return c(l,s,a,!1)},"SparseMatrix, any":function(l,s){return u(l,s,a,!1)},"Array, any":function(l,s){return c(r(l),s,a,!1).valueOf()},"any, Array | Matrix":function(l,s){return n(l,o(s))}},a.signatures))}),Ih="distance",D6=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],E6=U(Ih,D6,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:u,abs:c}=e;return t(Ih,{"Array, Array, Array":function(b,y,N){if(b.length===2&&y.length===2&&N.length===2){if(!s(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(y))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(N))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(y,N))throw new TypeError("LinePoint1 should not be same with LinePoint2");var E=n(N[1],y[1]),A=n(y[0],N[0]),D=n(i(N[0],y[1]),i(y[0],N[1]));return w(b[0],b[1],E,A,D)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(b,y,N){if(Object.keys(b).length===2&&Object.keys(y).length===2&&Object.keys(N).length===2){if(!s(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(N))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(d(y),d(N)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in b&&"pointY"in b&&"lineOnePtX"in y&&"lineOnePtY"in y&&"lineTwoPtX"in N&&"lineTwoPtY"in N){var E=n(N.lineTwoPtY,y.lineOnePtY),A=n(y.lineOnePtX,N.lineTwoPtX),D=n(i(N.lineTwoPtX,y.lineOnePtY),i(y.lineOnePtX,N.lineTwoPtY));return w(b.pointX,b.pointY,E,A,D)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(b,y){if(b.length===2&&y.length===3){if(!s(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(y))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return w(b[0],b[1],y[0],y[1],y[2])}else if(b.length===3&&y.length===6){if(!f(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(y))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(b[0],b[1],b[2],y[0],y[1],y[2],y[3],y[4],y[5])}else if(b.length===y.length&&b.length>0){if(!p(b))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(y))throw new TypeError("All values of an array should be numbers or BigNumbers");return x(b,y)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(b,y){if(Object.keys(b).length===2&&Object.keys(y).length===3){if(!s(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"xCoeffLine"in y&&"yCoeffLine"in y&&"constant"in y)return w(b.pointX,b.pointY,y.xCoeffLine,y.yCoeffLine,y.constant);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===6){if(!f(b))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(y))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"x0"in y&&"y0"in y&&"z0"in y&&"a"in y&&"b"in y&&"c"in y)return v(b.pointX,b.pointY,b.pointZ,y.x0,y.y0,y.z0,y.a,y.b,y.c);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===2&&Object.keys(y).length===2){if(!s(b))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointTwoX"in y&&"pointTwoY"in y)return x([b.pointOneX,b.pointOneY],[y.pointTwoX,y.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===3){if(!f(b))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointOneZ"in b&&"pointTwoX"in y&&"pointTwoY"in y&&"pointTwoZ"in y)return x([b.pointOneX,b.pointOneY,b.pointOneZ],[y.pointTwoX,y.pointTwoY,y.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(b){if(!h(b))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return g(b)}});function l(b){return typeof b=="number"||$e(b)}function s(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])}function f(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])&&l(b[2])}function p(b){return Array.isArray(b)||(b=d(b)),b.every(l)}function m(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])&&l(b[2])&&l(b[3])&&l(b[4])&&l(b[5])}function d(b){for(var y=Object.keys(b),N=[],E=0;E<y.length;E++)N.push(b[y[E]]);return N}function h(b){if(b[0].length===2&&l(b[0][0])&&l(b[0][1])){if(b.some(y=>y.length!==2||!l(y[0])||!l(y[1])))return!1}else if(b[0].length===3&&l(b[0][0])&&l(b[0][1])&&l(b[0][2])){if(b.some(y=>y.length!==3||!l(y[0])||!l(y[1])||!l(y[2])))return!1}else return!1;return!0}function w(b,y,N,E,A){var D=c(r(r(i(N,b),i(E,y)),A)),S=u(r(i(N,N),i(E,E)));return a(D,S)}function v(b,y,N,E,A,D,S,C,_){var R=[n(i(n(A,y),_),i(n(D,N),C)),n(i(n(D,N),S),i(n(E,b),_)),n(i(n(E,b),C),i(n(A,y),S))];R=u(r(r(i(R[0],R[0]),i(R[1],R[1])),i(R[2],R[2])));var P=u(r(r(i(S,S),i(C,C)),i(_,_)));return a(R,P)}function x(b,y){for(var N=b.length,E=0,A=0,D=0;D<N;D++)A=n(b[D],y[D]),E=r(i(A,A),E);return u(E)}function g(b){for(var y=[],N=[],E=[],A=0;A<b.length-1;A++)for(var D=A+1;D<b.length;D++)b[0].length===2?(N=[b[A][0],b[A][1]],E=[b[D][0],b[D][1]]):b[0].length===3&&(N=[b[A][0],b[A][1],b[A][2]],E=[b[D][0],b[D][1],b[D][2]]),y.push(x(N,E));return y}}),A6="intersect",S6=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],C6=U(A6,S6,e=>{var{typed:t,config:r,abs:n,add:i,addScalar:a,matrix:o,multiply:u,multiplyScalar:c,divideScalar:l,subtract:s,smaller:f,equalScalar:p,flatten:m,isZero:d,isNumeric:h}=e;return t("intersect",{"Array, Array, Array":w,"Array, Array, Array, Array":v,"Matrix, Matrix, Matrix":function(S,C,_){var R=w(S.valueOf(),C.valueOf(),_.valueOf());return R===null?null:o(R)},"Matrix, Matrix, Matrix, Matrix":function(S,C,_,R){var P=v(S.valueOf(),C.valueOf(),_.valueOf(),R.valueOf());return P===null?null:o(P)}});function w(S,C,_){if(S=x(S),C=x(C),_=x(_),!b(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!y(_))throw new TypeError("Array with 4 numbers expected as third argument");return D(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],_[3])}function v(S,C,_,R){if(S=x(S),C=x(C),_=x(_),R=x(R),S.length===2){if(!g(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!g(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!g(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!g(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return N(S,C,_,R)}else if(S.length===3){if(!b(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!b(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return A(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],R[0],R[1],R[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function x(S){return S.length===1?S[0]:S.length>1&&Array.isArray(S[0])&&S.every(C=>Array.isArray(C)&&C.length===1)?m(S):S}function g(S){return S.length===2&&h(S[0])&&h(S[1])}function b(S){return S.length===3&&h(S[0])&&h(S[1])&&h(S[2])}function y(S){return S.length===4&&h(S[0])&&h(S[1])&&h(S[2])&&h(S[3])}function N(S,C,_,R){var P=S,I=_,O=s(P,C),F=s(I,R),q=s(c(O[0],F[1]),c(F[0],O[1]));if(d(q)||f(n(q),r.epsilon))return null;var k=c(F[0],P[1]),te=c(F[1],P[0]),se=c(F[0],I[1]),W=c(F[1],I[0]),V=l(a(s(s(k,te),se),W),q);return i(u(O,V),P)}function E(S,C,_,R,P,I,O,F,q,k,te,se){var W=c(s(S,C),s(_,R)),V=c(s(P,I),s(O,F)),ue=c(s(q,k),s(te,se));return a(a(W,V),ue)}function A(S,C,_,R,P,I,O,F,q,k,te,se){var W=E(S,O,k,O,C,F,te,F,_,q,se,q),V=E(k,O,R,S,te,F,P,C,se,q,I,_),ue=E(S,O,R,S,C,F,P,C,_,q,I,_),me=E(k,O,k,O,te,F,te,F,se,q,se,q),re=E(R,S,R,S,P,C,P,C,I,_,I,_),ae=s(c(W,V),c(ue,me)),de=s(c(re,me),c(V,V));if(d(de))return null;var ne=l(ae,de),ce=l(a(W,c(ne,V)),me),le=a(S,c(ne,s(R,S))),he=a(C,c(ne,s(P,C))),xe=a(_,c(ne,s(I,_))),$=a(O,c(ce,s(k,O))),T=a(F,c(ce,s(te,F))),z=a(q,c(ce,s(se,q)));return p(le,$)&&p(he,T)&&p(xe,z)?[le,he,xe]:null}function D(S,C,_,R,P,I,O,F,q,k){var te=c(S,O),se=c(R,O),W=c(C,F),V=c(P,F),ue=c(_,q),me=c(I,q),re=s(s(s(k,te),W),ue),ae=s(s(s(a(a(se,V),me),te),W),ue),de=l(re,ae),ne=a(S,c(de,s(R,S))),ce=a(C,c(de,s(P,C))),le=a(_,c(de,s(I,_)));return[ne,ce,le]}}),Rh="sum",M6=["typed","config","add","numeric"],e1=U(Rh,M6,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(Rh,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Ca(u))throw new TypeError("Scalar values expected in function sum");return a(u)}});function a(u){var c;return Sn(u,function(l){try{c=c===void 0?l:n(c,l)}catch(s){throw ur(s,"sum",l)}}),c===void 0&&(c=i(0,r.number)),typeof c=="string"&&(c=i(c,r.number)),c}function o(u,c){try{var l=Au(u,c,n);return l}catch(s){throw ur(s,"sum")}}}),ls="cumsum",_6=["typed","add","unaryPlus"],t1=U(ls,_6,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(ls,{Array:i,Matrix:function(c){return c.create(i(c.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(c,l){return c.create(o(c.valueOf(),l))},"...":function(c){if(Ca(c))throw new TypeError("All values expected to be scalar in function cumsum");return i(c)}});function i(c){try{return a(c)}catch(l){throw ur(l,ls)}}function a(c){if(c.length===0)return[];for(var l=[n(c[0])],s=1;s<c.length;++s)l.push(r(l[s-1],c[s]));return l}function o(c,l){var s=Ve(c);if(l<0||l>=s.length)throw new $r(l,s.length);try{return u(c,l)}catch(f){throw ur(f,ls)}}function u(c,l){var s,f,p;if(l<=0){var m=c[0][0];if(Array.isArray(m)){for(p=kv(c),f=[],s=0;s<p.length;s++)f[s]=u(p[s],l-1);return f}else return a(c)}else{for(f=[],s=0;s<c.length;s++)f[s]=u(c[s],l-1);return f}}}),qh="mean",F6=["typed","add","divide"],r1=U(qh,F6,e=>{var{typed:t,add:r,divide:n}=e;return t(qh,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(o){if(Ca(o))throw new TypeError("Scalar values expected in function mean");return a(o)}});function i(o,u){try{var c=Au(o,u,r),l=Array.isArray(o)?Ve(o):o.size();return n(c,l[u])}catch(s){throw ur(s,"mean")}}function a(o){var u,c=0;if(Sn(o,function(l){try{u=u===void 0?l:r(u,l),c++}catch(s){throw ur(s,"mean",l)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,c)}}),zh="median",T6=["typed","add","divide","compare","partitionSelect"],O6=U(zh,T6,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:a}=e;function o(l){try{l=ot(l.valueOf());var s=l.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var f=s/2-1,p=a(l,f+1),m=l[f],d=0;d<f;++d)i(l[d],m)>0&&(m=l[d]);return c(m,p)}else{var h=a(l,(s-1)/2);return u(h)}}catch(w){throw ur(w,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(l){return l}}),c=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(l,s){return n(r(l,s),2)}});return t(zh,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(l,s){throw new Error("median(A, dim) is not yet supported")},"...":function(l){if(Ca(l))throw new TypeError("Scalar values expected in function median");return o(l)}})}),jh="mad",B6=["typed","abs","map","median","subtract"],k6=U(jh,B6,e=>{var{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t(jh,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(u){if(u=ot(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=i(u);return i(n(u,function(l){return r(a(l,c))}))}catch(l){throw l instanceof TypeError&&l.message.includes("median")?new TypeError(l.message.replace("median","mad")):ur(l,"mad")}}}),yc="unbiased",Lh="variance",I6=["typed","add","subtract","multiply","divide","apply","isNaN"],n1=U(Lh,I6,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e;return t(Lh,{"Array | Matrix":function(s){return c(s,yc)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(s,f){return l(s,f,yc)},"Array | Matrix, number | BigNumber, string":l,"...":function(s){return c(s,yc)}});function c(s,f){var p,m=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Sn(s,function(w){try{p=p===void 0?w:r(p,w),m++}catch(v){throw ur(v,"variance",w)}}),m===0)throw new Error("Cannot calculate variance of an empty array");var d=a(p,m);if(p=void 0,Sn(s,function(w){var v=n(w,d);p=p===void 0?i(v,v):r(p,i(v,v))}),u(p))return p;switch(f){case"uncorrected":return a(p,m);case"biased":return a(p,m+1);case"unbiased":{var h=$e(p)?p.mul(0):0;return m===1?h:a(p,m-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(s,f,p){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(s,f,m=>c(m,p))}catch(m){throw ur(m,"variance")}}}),Ph="quantileSeq",R6=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],i1=U(Ph,R6,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=Bl({typed:t,isInteger:l});return t(Ph,{"Array | Matrix, number | BigNumber":(x,g)=>h(x,g,!1),"Array | Matrix, number | BigNumber, number":(x,g,b)=>d(x,g,!1,b,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(x,g,b,y)=>d(x,g,b,y,h),"Array | Matrix, Array | Matrix":(x,g)=>w(x,g,!1),"Array | Matrix, Array | Matrix, number":(x,g,b)=>d(x,g,!1,b,w),"Array | Matrix, Array | Matrix, boolean":w,"Array | Matrix, Array | Matrix, boolean, number":(x,g,b,y)=>d(x,g,b,y,w)});function d(x,g,b,y,N){return m(x,y,E=>N(E,g,b))}function h(x,g,b){var y,N=x.valueOf();if(s(g,0))throw new Error("N/prob must be non-negative");if(f(g,1))return Ue(g)?v(N,g,b):r(v(N,g,b));if(p(g,1)){if(!l(g))throw new Error("N must be a positive integer");if(p(g,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var E=n(g,1);y=[];for(var A=0;s(A,g);A++){var D=a(A+1,E);y.push(v(N,D,b))}return Ue(g)?y:r(y)}}function w(x,g,b){for(var y=x.valueOf(),N=g.valueOf(),E=[],A=0;A<N.length;++A)E.push(v(y,N[A],b));return E}function v(x,g,b){var y=ot(x),N=y.length;if(N===0)throw new Error("Cannot calculate quantile of an empty sequence");var E=Ue(g)?g*(N-1):g.times(N-1),A=Ue(g)?Math.floor(E):E.floor().toNumber(),D=Ue(g)?E%1:E.minus(A);if(l(E))return b?y[E]:u(y,Ue(g)?E:E.valueOf());var S,C;if(b)S=y[A],C=y[A+1];else{C=u(y,A+1),S=y[A];for(var _=0;_<A;++_)c(y[_],S)>0&&(S=y[_])}return n(o(S,i(1,D)),o(C,D))}}),Vh="std",q6=["typed","map","sqrt","variance"],a1=U(Vh,q6,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(Vh,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(o){return a(o)}});function a(o,u){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=i.apply(null,arguments);return Fr(c)?r(c,n):n(c)}catch(l){throw l instanceof TypeError&&l.message.includes(" variance")?new TypeError(l.message.replace(" variance"," std")):l}}}),Uh="corr",z6=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],j6=U(Uh,z6,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:a,subtract:o,multiply:u,pow:c,divide:l}=e;return t(Uh,{"Array, Array":function(p,m){return s(p,m)},"Matrix, Matrix":function(p,m){var d=s(p.toArray(),m.toArray());return Array.isArray(d)?r(d):d}});function s(p,m){var d=[];if(Array.isArray(p[0])&&Array.isArray(m[0])){if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var h=0;h<p.length;h++){if(p[h].length!==m[h].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");d.push(f(p[h],m[h]))}return d}else{if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(p,m)}}function f(p,m){var d=p.length,h=i(p),w=i(m),v=p.reduce((N,E,A)=>a(N,u(E,m[A])),0),x=i(p.map(N=>c(N,2))),g=i(m.map(N=>c(N,2))),b=o(u(d,v),u(h,w)),y=n(u(o(u(d,x),c(h,2)),o(u(d,g),c(w,2))));return l(b,y)}}),$h="combinations",L6=["typed"],P6=U($h,L6,e=>{var{typed:t}=e;return t($h,{"number, number":ny,"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=r.minus(n),c=new i(1);if(!Hh(r)||!Hh(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(r))throw new TypeError("k must be less than n in function combinations");if(a=c,n.lt(u))for(o=c;o.lte(u);o=o.plus(c))a=a.times(n.plus(o)).dividedBy(o);else for(o=c;o.lte(n);o=o.plus(c))a=a.times(u.plus(o)).dividedBy(o);return a}})});function Hh(e){return e.isInteger()&&e.gte(0)}var Jh="combinationsWithRep",V6=["typed"],U6=U(Jh,V6,e=>{var{typed:t}=e;return t(Jh,{"number, number":function(r,n){if(!Fe(r)||r<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n<r-1){var i=xn(r,r+n-1);return i/xn(1,n)}var a=xn(n+1,r+n-1);return a/xn(1,r-1)},"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=new i(1),c=r.minus(u);if(!Gh(r)||!Gh(n))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r.lt(u))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(a=u,n.lt(c))for(o=u;o.lte(c);o=o.plus(u))a=a.times(n.plus(o)).dividedBy(o);else for(o=u;o.lte(n);o=o.plus(u))a=a.times(c.plus(o)).dividedBy(o);return a}})});function Gh(e){return e.isInteger()&&e.gte(0)}var Kh="gamma",$6=["typed","config","multiplyScalar","pow","BigNumber","Complex"],H6=U(Kh,$6,e=>{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:o}=e;function u(l){if(l.im===0)return $s(l.re);if(l.re<.5){var s=new o(1-l.re,-l.im),f=new o(Math.PI*l.re,Math.PI*l.im);return new o(Math.PI).div(f.sin()).div(u(s))}l=new o(l.re-1,l.im);for(var p=new o(ca[0],0),m=1;m<ca.length;++m){var d=new o(ca[m],0);p=p.add(d.div(l.add(m)))}var h=new o(l.re+uy+.5,l.im),w=Math.sqrt(2*Math.PI),v=h.pow(l.add(.5)),x=h.neg().exp();return p.mul(w).mul(v).mul(x)}return t(Kh,{number:$s,Complex:u,BigNumber:function(l){if(l.isInteger())return l.isNegative()||l.isZero()?new a(1/0):c(l.minus(1));if(!l.isFinite())return new a(l.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function c(l){if(l<8)return new a([1,1,2,6,24,120,720,5040][l]);var s=r.precision+(Math.log(l.toNumber())|0),f=a.clone({precision:s});if(l%2===1)return l.times(c(new a(l-1)));for(var p=l,m=new f(l),d=l.toNumber();p>2;)p-=2,d+=p,m=m.times(d);return new a(m.toPrecision(a.precision))}}),Wh="lgamma",J6=["Complex","typed"],G6=U(Wh,J6,e=>{var{Complex:t,typed:r}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Wh,{number:Hs,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(l){var s=6.283185307179586,f=1.1447298858494002,p=.1;if(l.isNaN())return new t(NaN,NaN);if(l.im===0)return new t(Hs(l.re),0);if(l.re>=n||Math.abs(l.im)>=i)return u(l);if(l.re<=p){var m=qN(s,l.im)*Math.floor(.5*l.re+.25),d=l.mul(Math.PI).sin().log(),h=o(new t(1-l.re,-l.im));return new t(f,m).sub(d).sub(h)}else return l.im>=0?c(l):c(l.conjugate()).conjugate()}function u(l){for(var s=l.sub(.5).mul(l.log()).sub(l).add(cy),f=new t(1,0).div(l),p=f.div(l),m=a[0],d=a[1],h=2*p.re,w=p.re*p.re+p.im*p.im,v=2;v<8;v++){var x=d;d=-w*m+a[v],m=h*m+x}var g=f.mul(p.mul(m).add(d));return s.add(g)}function c(l){var s=0,f=0,p=l;for(l=l.add(1);l.re<=n;){p=p.mul(l);var m=p.im<0?1:0;m!==0&&f===0&&s++,f=m,l=l.add(1)}return u(l).sub(p.log()).sub(new t(0,s*2*Math.PI*1))}}),Qh="factorial",K6=["typed","gamma"],W6=U(Qh,K6,e=>{var{typed:t,gamma:r}=e;return t(Qh,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return r(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return r(n.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),Zh="kldivergence",Q6=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Z6=U(Zh,Q6,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:a,map:o,dotDivide:u,log:c,isNumeric:l}=e;return t(Zh,{"Array, Array":function(f,p){return s(r(f),r(p))},"Matrix, Array":function(f,p){return s(f,r(p))},"Array, Matrix":function(f,p){return s(r(f),p)},"Matrix, Matrix":function(f,p){return s(f,p)}});function s(f,p){var m=p.size().length,d=f.size().length;if(m>1)throw new Error("first object must be one dimensional");if(d>1)throw new Error("second object must be one dimensional");if(m!==d)throw new Error("Length of two vectors must be equal");var h=i(f);if(h===0)throw new Error("Sum of elements in first object must be non zero");var w=i(p);if(w===0)throw new Error("Sum of elements in second object must be non zero");var v=n(f,i(f)),x=n(p,i(p)),g=i(a(v,o(u(v,x),b=>c(b))));return l(g)?g:Number.NaN}}),Xh="multinomial",X6=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Y6=U(Xh,X6,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:a,isInteger:o,isPositive:u}=e;return t(Xh,{"Array | Matrix":function(c){var l=0,s=1;return Sn(c,function(f){if(!o(f)||!u(f))throw new TypeError("Positive integer value expected in function multinomial");l=r(l,f),s=i(s,a(f))}),n(a(l),s)}})}),Yh="permutations",e9=["typed","factorial"],t9=U(Yh,e9,e=>{var{typed:t,factorial:r}=e;return t(Yh,{"number | BigNumber":r,"number, number":function(n,i){if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Fe(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>n)throw new TypeError("second argument k must be less than or equal to first argument n");return xn(n-i+1,n)},"BigNumber, BigNumber":function(n,i){var a,o;if(!e0(n)||!e0(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var u=n.mul(0).add(1);for(a=u,o=n.minus(i).plus(1);o.lte(n);o=o.plus(1))a=a.times(o);return a}})});function e0(e){return e.isInteger()&&e.gte(0)}var o1={exports:{}};(function(e){(function(t,r,n){function i(c){var l=this,s=u();l.next=function(){var f=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=f-(l.c=f|0)},l.c=1,l.s0=s(" "),l.s1=s(" "),l.s2=s(" "),l.s0-=s(c),l.s0<0&&(l.s0+=1),l.s1-=s(c),l.s1<0&&(l.s1+=1),l.s2-=s(c),l.s2<0&&(l.s2+=1),s=null}function a(c,l){return l.c=c.c,l.s0=c.s0,l.s1=c.s1,l.s2=c.s2,l}function o(c,l){var s=new i(c),f=l&&l.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&a(f,s),p.state=function(){return a(s,{})}),p}function u(){var c=4022871197,l=function(s){s=String(s);for(var f=0;f<s.length;f++){c+=s.charCodeAt(f);var p=.02519603282416938*c;c=p>>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=o:this.alea=o})(ji,e)})(o1);var r9=o1.exports,s1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var f=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^f^f>>>8},u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor128=o})(ji,e)})(s1);var n9=s1.exports,u1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(f^f<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,s==l.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c.v=u.v,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorwow=o})(ji,e)})(u1);var i9=u1.exports,c1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.x,f=c.i,p,m;return p=s[f],p^=p>>>7,m=p^p<<24,p=s[f+1&7],m^=p^p>>>10,p=s[f+3&7],m^=p^p>>>3,p=s[f+4&7],m^=p^p<<7,p=s[f+7&7],p=p^p<<13,m^=p^p<<9,s[f]=m,c.i=f+1&7,m};function l(s,f){var p,m=[];if(f===(f|0))m[0]=f;else for(f=""+f,p=0;p<f.length;++p)m[p&7]=m[p&7]<<15^f.charCodeAt(p)+m[p+1&7]<<13;for(;m.length<8;)m.push(0);for(p=0;p<8&&m[p]===0;++p);for(p==8?m[7]=-1:m[p],s.x=m,s.i=0,p=256;p>0;--p)s.next()}l(c,u)}function a(u,c){return c.x=u.x.slice(),c.i=u.i,c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.x&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorshift7=o})(ji,e)})(c1);var a9=c1.exports,l1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.w,f=c.X,p=c.i,m,d;return c.w=s=s+1640531527|0,d=f[p+34&127],m=f[p=p+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=f[p]=d^m,c.i=p,d+(s^s>>>16)|0};function l(s,f){var p,m,d,h,w,v=[],x=128;for(f===(f|0)?(m=f,f=null):(f=f+"\0",m=0,x=Math.max(x,f.length)),d=0,h=-32;h<x;++h)f&&(m^=f.charCodeAt((h+32)%f.length)),h===0&&(w=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,h>=0&&(w=w+1640531527|0,p=v[h&127]^=m+w,d=p==0?d+1:0);for(d>=128&&(v[(f&&f.length||0)&127]=-1),d=127,h=4*128;h>0;--h)m=v[d+34&127],p=v[d=d+1&127],m^=m<<13,p^=p<<17,m^=m>>>15,p^=p>>>12,v[d]=m^p;s.w=w,s.X=v,s.i=d}l(c,u)}function a(u,c){return c.i=u.i,c.w=u.w,c.X=u.X.slice(),c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.X&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor4096=o})(ji,e)})(l1);var o9=l1.exports,f1={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.b,p=c.c,m=c.d,d=c.a;return f=f<<25^f>>>7^p,p=p-m|0,m=m<<24^m>>>8^d,d=d-f|0,c.b=f=f<<20^f>>>12^p,c.c=p=p-m|0,c.d=m<<16^p>>>16^d,c.a=d-f|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,u===Math.floor(u)?(c.a=u/4294967296|0,c.b=u|0):l+=u;for(var s=0;s<l.length+20;s++)c.b^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.a=u.a,c.b=u.b,c.c=u.c,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.tychei=o})(ji,e)})(f1);var s9=f1.exports,p1={exports:{}};const u9={},c9=Object.freeze(Object.defineProperty({__proto__:null,default:u9},Symbol.toStringTag,{value:"Module"})),l9=K2(c9);(function(e){(function(t,r,n){var i=256,a=6,o=52,u="random",c=n.pow(i,a),l=n.pow(2,o),s=l*2,f=i-1,p;function m(b,y,N){var E=[];y=y==!0?{entropy:!0}:y||{};var A=v(w(y.entropy?[b,g(r)]:b??x(),3),E),D=new d(E),S=function(){for(var C=D.g(a),_=c,R=0;C<l;)C=(C+R)*i,_*=i,R=D.g(1);for(;C>=s;)C/=2,_/=2,R>>>=1;return(C+R)/_};return S.int32=function(){return D.g(4)|0},S.quick=function(){return D.g(4)/4294967296},S.double=S,v(g(D.S),r),(y.pass||N||function(C,_,R,P){return P&&(P.S&&h(P,D),C.state=function(){return h(D,{})}),R?(n[u]=C,_):C})(S,A,"global"in y?y.global:this==n,y.state)}function d(b){var y,N=b.length,E=this,A=0,D=E.i=E.j=0,S=E.S=[];for(N||(b=[N++]);A<i;)S[A]=A++;for(A=0;A<i;A++)S[A]=S[D=f&D+b[A%N]+(y=S[A])],S[D]=y;(E.g=function(C){for(var _,R=0,P=E.i,I=E.j,O=E.S;C--;)_=O[P=f&P+1],R=R*i+O[f&(O[P]=O[I=f&I+_])+(O[I]=_)];return E.i=P,E.j=I,R})(i)}function h(b,y){return y.i=b.i,y.j=b.j,y.S=b.S.slice(),y}function w(b,y){var N=[],E=typeof b,A;if(y&&E=="object")for(A in b)try{N.push(w(b[A],y-1))}catch{}return N.length?N:E=="string"?b:b+"\0"}function v(b,y){for(var N=b+"",E,A=0;A<N.length;)y[f&A]=f&(E^=y[f&A]*19)+N.charCodeAt(A++);return g(y)}function x(){try{var b;return p&&(b=p.randomBytes)?b=b(i):(b=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(b)),g(b)}catch{var y=t.navigator,N=y&&y.plugins;return[+new Date,t,N,t.screen,g(r)]}}function g(b){return String.fromCharCode.apply(0,b)}if(v(n.random(),r),e.exports){e.exports=m;try{p=l9}catch{}}else n["seed"+u]=m})(typeof self<"u"?self:ji,[],Math)})(p1);var f9=p1.exports,p9=r9,m9=n9,d9=i9,h9=a9,g9=o9,v9=s9,Vi=f9;Vi.alea=p9;Vi.xor128=m9;Vi.xorwow=d9;Vi.xorshift7=h9;Vi.xor4096=g9;Vi.tychei=v9;var y9=Vi;const m1=So(y9);var b9=m1(Date.now());function xa(e){var t;function r(i){t=i===null?b9:m1(String(i))}r(e);function n(){return t()}return n}var t0="pickRandom",x9=["typed","config","?on"],w9=U(t0,x9,e=>{var{typed:t,config:r,on:n}=e,i=xa(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=xa(o.randomSeed))}),t(t0,{"Array | Matrix":function(o){return a(o,{})},"Array | Matrix, Object":function(o,u){return a(o,u)},"Array | Matrix, number":function(o,u){return a(o,{number:u})},"Array | Matrix, Array | Matrix":function(o,u){return a(o,{weights:u})},"Array | Matrix, Array | Matrix, number":function(o,u,c){return a(o,{number:c,weights:u})},"Array | Matrix, number, Array | Matrix":function(o,u,c){return a(o,{number:u,weights:c})}});function a(o,u){var{number:c,weights:l,elementWise:s=!0}=u,f=typeof c>"u";f&&(c=1);var p=ke(o)?o.create:ke(l)?l.create:null;o=o.valueOf(),l&&(l=l.valueOf()),s===!0&&(o=ot(o),l=ot(l));var m=0;if(typeof l<"u"){if(l.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var d=0,h=l.length;d<h;d++){if(!Ue(l[d])||l[d]<0)throw new Error("Weights must be an array of positive numbers");m+=l[d]}}for(var w=o.length,v=[],x;v.length<c;){if(typeof l>"u")x=o[Math.floor(i()*w)];else for(var g=i()*m,b=0,y=o.length;b<y;b++)if(g-=l[b],g<0){x=o[b];break}v.push(x)}return f?v[0]:p?p(v):v}});function Ll(e,t){var r=[];if(e=e.slice(0),e.length>1)for(var n=0,i=e.shift();n<i;n++)r.push(Ll(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var r0="random",N9=["typed","config","?on"],D9=U(r0,N9,e=>{var{typed:t,config:r,on:n}=e,i=xa(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=xa(u.randomSeed))}),t(r0,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=Ll(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return u+i()*(c-u)}}),n0="randomInt",E9=["typed","config","?on"],A9=U(n0,E9,e=>{var{typed:t,config:r,on:n}=e,i=xa(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=xa(u.randomSeed))}),t(n0,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=Ll(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return Math.floor(u+i()*(c-u))}}),i0="stirlingS2",S9=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],C9=U(i0,S9,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:o,factorial:u,combinations:c,isNegative:l,isInteger:s,number:f,bignumber:p,larger:m}=e,d=[],h=[];return t(i0,{"number | BigNumber, number | BigNumber":function(w,v){if(!s(w)||l(w)||!s(v)||l(v))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(v,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var x=!(Ue(w)&&Ue(v)),g=x?h:d,b=x?p:f,y=f(w),N=f(v);if(g[y]&&g[y].length>N)return g[y][N];for(var E=0;E<=y;++E)if(g[E]||(g[E]=[b(E===0?1:0)]),E!==0)for(var A=g[E],D=g[E-1],S=A.length;S<=E&&S<=N;++S)S===E?A[S]=1:A[S]=r(i(b(S),D[S]),D[S-1]);return g[y][N]}})}),a0="bellNumbers",M9=["typed","addScalar","isNegative","isInteger","stirlingS2"],_9=U(a0,M9,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=e;return t(a0,{"number | BigNumber":function(o){if(!i(o)||n(o))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,c=0;c<=o;c++)u=r(u,a(o,c));return u}})}),o0="catalan",F9=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],T9=U(o0,F9,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:u}=e;return t(o0,{"number | BigNumber":function(c){if(!u(c)||o(c))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(c,2),c),r(c,1))}})}),s0="composition",O9=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],B9=U(s0,O9,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:o,larger:u}=e;return t(s0,{"number | BigNumber, number | BigNumber":function(c,l){if(!o(c)||!i(c)||!o(l)||!i(l))throw new TypeError("Positive integer value expected in function composition");if(u(l,c))throw new TypeError("k must be less than or equal to n in function composition");return n(r(c,-1),r(l,-1))}})}),u0="leafCount",k9=["parse","typed"],I9=U(u0,k9,e=>{var{parse:t,typed:r}=e;function n(i){var a=0;return i.forEach(o=>{a+=n(o)}),a||1}return r(u0,{Node:function(i){return n(i)}})});function c0(e){return nt(e)||Ct(e)&&e.isUnary()&&nt(e.args[0])}function tu(e){return!!(nt(e)||(Zn(e)||Ct(e))&&e.args.every(tu)||An(e)&&tu(e.content))}function l0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l0(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var R9="simplifyUtil",q9=["FunctionNode","OperatorNode","SymbolNode"],Pl=U(R9,q9,e=>{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,a=!1,o="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},c={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function s(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,N=o;if(typeof g=="string"?N=g:Ct(g)?N=g.fn.toString():Zn(g)?N=g.name:An(g)&&(N="paren"),Me(y,N)){var E=y[N];if(Me(E,b))return E[b];if(Me(u,N))return u[N][b]}if(Me(y,o)){var A=y[o];return Me(A,b)?A[b]:u[o][b]}if(Me(u,N)){var D=u[N];if(Me(D,b))return D[b]}return u[o][b]}function f(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"commutative",b)}function p(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"associative",b)}function m(g,b){var y=bc({},g);for(var N in b)Me(g,N)?y[N]=bc(bc({},b[N]),g[N]):y[N]=b[N];return y}function d(g,b){if(!g.args||g.args.length===0)return g;g.args=h(g,b);for(var y=0;y<g.args.length;y++)d(g.args[y],b)}function h(g,b){var y,N=[],E=function A(D){for(var S=0;S<D.args.length;S++){var C=D.args[S];Ct(C)&&y===C.op?A(C):N.push(C)}};return p(g,b)?(y=g.op,E(g),N):g.args}function w(g,b){if(!(!g.args||g.args.length===0)){for(var y=x(g),N=g.args.length,E=0;E<N;E++)w(g.args[E],b);if(N>2&&p(g,b)){for(var A=g.args.pop();g.args.length>0;)A=y([g.args.pop(),A]);g.args=A.args}}}function v(g,b){if(!(!g.args||g.args.length===0)){for(var y=x(g),N=g.args.length,E=0;E<N;E++)v(g.args[E],b);if(N>2&&p(g,b)){for(var A=g.args.shift();g.args.length>0;)A=y([A,g.args.shift()]);g.args=A.args}}}function x(g){return Ct(g)?function(b){try{return new r(g.op,g.fn,b,g.implicit)}catch(y){return console.error(y),[]}}:function(b){return new t(new n(g.name),b)}}return{createMakeNodeFunction:x,hasProperty:s,isCommutative:f,isAssociative:p,mergeContext:m,flatten:d,allChildren:h,unflattenr:w,unflattenl:v,defaultContext:u,realContext:c,positiveContext:l}}),z9="simplify",j9=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],L9=U(z9,j9,e=>{var{config:t,typed:r,parse:n,add:i,subtract:a,multiply:o,divide:u,pow:c,isZero:l,equal:s,resolve:f,simplifyConstant:p,simplifyCore:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:x,ArrayNode:g,ConstantNode:b,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,ParenthesisNode:D,SymbolNode:S}=e,{hasProperty:C,isCommutative:_,isAssociative:R,mergeContext:P,flatten:I,unflattenr:O,unflattenl:F,createMakeNodeFunction:q,defaultContext:k,realContext:te,positiveContext:se}=Pl({FunctionNode:y,OperatorNode:A,SymbolNode:S});r.addConversion({from:"Object",to:"Map",convert:ua});var W=r("simplify",{Node:ne,"Node, Map":(L,H)=>ne(L,!1,H),"Node, Map, Object":(L,H,G)=>ne(L,!1,H,G),"Node, Array":ne,"Node, Array, Map":ne,"Node, Array, Map, Object":ne});r.removeConversion({from:"Object",to:"Map",convert:ua}),W.defaultContext=k,W.realContext=te,W.positiveContext=se;function V(L){return L.transform(function(H,G,Y){return An(H)?V(H.content):H})}var ue={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};W.rules=[m,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},p,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},p,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function me(L,H){var G={};if(L.s){var Y=L.s.split("->");if(Y.length===2)G.l=Y[0],G.r=Y[1];else throw SyntaxError("Could not parse rule: "+L.s)}else G.l=L.l,G.r=L.r;G.l=V(n(G.l)),G.r=V(n(G.r));for(var ee of["imposeContext","repeat","assuming"])ee in L&&(G[ee]=L[ee]);if(L.evaluate&&(G.evaluate=n(L.evaluate)),R(G.l,H)){var B=!_(G.l,H),j;B&&(j=de());var Q=q(G.l),Z=de();G.expanded={},G.expanded.l=Q([G.l,Z]),I(G.expanded.l,H),O(G.expanded.l,H),G.expanded.r=Q([G.r,Z]),B&&(G.expandedNC1={},G.expandedNC1.l=Q([j,G.l]),G.expandedNC1.r=Q([j,G.r]),G.expandedNC2={},G.expandedNC2.l=Q([j,G.expanded.l]),G.expandedNC2.r=Q([j,G.expanded.r]))}return G}function re(L,H){for(var G=[],Y=0;Y<L.length;Y++){var ee=L[Y],B=void 0,j=typeof ee;switch(j){case"string":ee={s:ee};case"object":B=me(ee,H);break;case"function":B=ee;break;default:throw TypeError("Unsupported type of rule: "+j)}G.push(B)}return G}var ae=0;function de(){return new S("_p"+ae++)}function ne(L,H){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:co(),Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ee=Y.consoleDebug;H=re(H||W.rules,Y.context);var B=f(L,G);B=V(B);for(var j={},Q=B.toString({parenthesis:"all"});!j[Q];){j[Q]=!0,ae=0;var Z=Q;ee&&console.log("Working on: ",Q);for(var ie=0;ie<H.length;ie++){var oe="";if(typeof H[ie]=="function"?(B=H[ie](B,Y),ee&&(oe=H[ie].name)):(I(B,Y.context),B=le(B,H[ie],Y.context),ee&&(oe="".concat(H[ie].l.toString()," -> ").concat(H[ie].r.toString()))),ee){var ye=B.toString({parenthesis:"all"});ye!==Z&&(console.log("Applying",oe,"produced",ye),Z=ye)}F(B,Y.context)}Q=B.toString({parenthesis:"all"})}return B}function ce(L,H,G){var Y=L;if(L)for(var ee=0;ee<L.length;++ee){var B=le(L[ee],H,G);B!==L[ee]&&(Y===L&&(Y=L.slice()),Y[ee]=B)}return Y}function le(L,H,G){if(H.assuming){for(var Y in H.assuming)for(var ee in H.assuming[Y])if(C(Y,ee,G)!==H.assuming[Y][ee])return L}var B=P(H.imposeContext,G),j=L;if(j instanceof A||j instanceof y){var Q=ce(j.args,H,G);Q!==j.args&&(j=j.clone(),j.args=Q)}else if(j instanceof D){if(j.content){var Z=le(j.content,H,G);Z!==j.content&&(j=new D(Z))}}else if(j instanceof g){var ie=ce(j.items,H,G);ie!==j.items&&(j=new g(ie))}else if(j instanceof x){var oe=j.object;j.object&&(oe=le(j.object,H,G));var ye=j.index;j.index&&(ye=le(j.index,H,G)),(oe!==j.object||ye!==j.index)&&(j=new x(oe,ye))}else if(j instanceof N){var fe=ce(j.dimensions,H,G);fe!==j.dimensions&&(j=new N(fe))}else if(j instanceof E){var De=!1,Ne={};for(var je in j.properties)Ne[je]=le(j.properties[je],H,G),Ne[je]!==j.properties[je]&&(De=!0);De&&(j=new E(Ne))}var Ze=H.r,_e=z(H.l,j,B)[0];if(!_e&&H.expanded&&(Ze=H.expanded.r,_e=z(H.expanded.l,j,B)[0]),!_e&&H.expandedNC1&&(Ze=H.expandedNC1.r,_e=z(H.expandedNC1.l,j,B)[0],_e||(Ze=H.expandedNC2.r,_e=z(H.expandedNC2.l,j,B)[0])),_e){var wt=j.implicit;j=Ze.clone(),wt&&"implicit"in Ze&&(j.implicit=!0),j=j.transform(function(M){return M.isSymbolNode&&Me(_e.placeholders,M.name)?_e.placeholders[M.name].clone():M})}return H.repeat&&j!==L&&(j=le(j,H,G)),j}function he(L,H){var G=[],Y,ee,B=q(L);if(_(L,H))for(var j=0;j<L.args.length;j++)ee=L.args.slice(0),ee.splice(j,1),Y=ee.length===1?ee[0]:B(ee),G.push(B([L.args[j],Y]));else for(var Q=1;Q<L.args.length;Q++){var Z=L.args[0];Q>1&&(Z=B(L.args.slice(0,Q))),ee=L.args.slice(Q),Y=ee.length===1?ee[0]:B(ee),G.push(B([Z,Y]))}return G}function xe(L,H){var G={placeholders:{}};if(!L.placeholders&&!H.placeholders)return G;if(L.placeholders){if(!H.placeholders)return L}else return H;for(var Y in L.placeholders)if(Me(L.placeholders,Y)&&(G.placeholders[Y]=L.placeholders[Y],Me(H.placeholders,Y)&&!J(L.placeholders[Y],H.placeholders[Y])))return null;for(var ee in H.placeholders)Me(H.placeholders,ee)&&(G.placeholders[ee]=H.placeholders[ee]);return G}function $(L,H){var G=[];if(L.length===0||H.length===0)return G;for(var Y,ee=0;ee<L.length;ee++)for(var B=0;B<H.length;B++)Y=xe(L[ee],H[B]),Y&&G.push(Y);return G}function T(L){if(L.length===0)return L;for(var H=L.reduce($),G=[],Y={},ee=0;ee<H.length;ee++){var B=JSON.stringify(H[ee]);Y[B]||(Y[B]=!0,G.push(H[ee]))}return G}function z(L,H,G,Y){var ee=[{placeholders:{}}];if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return[]}else if(L instanceof y&&L.name!==H.name)return[];if(H.args.length===1&&L.args.length===1||!R(H,G)&&H.args.length===L.args.length||Y){for(var B=[],j=0;j<L.args.length;j++){var Q=z(L.args[j],H.args[j],G);if(Q.length===0)break;B.push(Q)}if(B.length!==L.args.length){if(!_(H,G)||L.args.length===1)return[];if(L.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Z=z(L.args[0],H.args[1],G);if(Z.length===0)return[];var ie=z(L.args[1],H.args[0],G);if(ie.length===0)return[];B=[Z,ie]}ee=T(B)}else if(H.args.length>=2&&L.args.length===2){for(var oe=he(H,G),ye=[],fe=0;fe<oe.length;fe++){var De=z(L,oe[fe],G,!0);ye=ye.concat(De)}return ye}else{if(L.args.length>2)throw Error("Unexpected non-binary associative function: "+L.toString());return[]}}else if(L instanceof S){if(L.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ue[L.name]){if(L.name!==H.name)return[]}else switch(L.name[1]>="a"&&L.name[1]<="z"?L.name.substring(0,2):L.name[0]){case"n":case"_p":ee[0].placeholders[L.name]=H;break;case"c":case"cl":if(nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"v":if(!nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"vl":if(zt(H))ee[0].placeholders[L.name]=H;else return[];break;case"cd":if(c0(H))ee[0].placeholders[L.name]=H;else return[];break;case"vd":if(!c0(H))ee[0].placeholders[L.name]=H;else return[];break;case"ce":if(tu(H))ee[0].placeholders[L.name]=H;else return[];break;case"ve":if(!tu(H))ee[0].placeholders[L.name]=H;else return[];break;default:throw new Error("Invalid symbol in rule: "+L.name)}}else if(L instanceof b){if(!s(L.value,H.value))return[]}else return[];return ee}function J(L,H){if(L instanceof b&&H instanceof b){if(!s(L.value,H.value))return!1}else if(L instanceof S&&H instanceof S){if(L.name!==H.name)return!1}else if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return!1}else if(L instanceof y&&L.name!==H.name)return!1;if(L.args.length!==H.args.length)return!1;for(var G=0;G<L.args.length;G++)if(!J(L.args[G],H.args[G]))return!1}else return!1;return!0}return W}),P9="simplifyConstant",V9=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],U9=U(P9,V9,e=>{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:a,bignumber:o,AccessorNode:u,ArrayNode:c,ConstantNode:l,FunctionNode:s,IndexNode:f,ObjectNode:p,OperatorNode:m,SymbolNode:d}=e,{isCommutative:h,isAssociative:w,allChildren:v,createMakeNodeFunction:x}=Pl({FunctionNode:s,OperatorNode:m,SymbolNode:d}),g=t("simplifyConstant",{Node:I=>E(P(I,{})),"Node, Object":function(I,O){return E(P(I,O))}});function b(I){return Do(I)?I.valueOf():I instanceof Array?I.map(b):ke(I)?i(b(I.valueOf())):I}function y(I,O,F){try{return n[I].apply(null,O)}catch{return O=O.map(b),D(n[I].apply(null,O),F)}}var N=t({Fraction:C,number:function(I){return I<0?S(new l(-I)):new l(I)},BigNumber:function(I){return I<0?S(new l(-I)):new l(I)},Complex:function(I){throw new Error("Cannot convert Complex number to Node")},string:function(I){return new l(I)},Matrix:function(I){return new c(I.valueOf().map(O=>N(O)))}});function E(I){return ft(I)?I:N(I)}function A(I,O){var F=O&&O.exactFractions!==!1;if(F&&isFinite(I)&&a){var q=a(I),k=O&&typeof O.fractionsLimit=="number"?O.fractionsLimit:1/0;if(q.valueOf()===I&&q.n<k&&q.d<k)return q}return I}var D=t({"string, Object":function(I,O){if(r.number==="BigNumber")return o===void 0&&Rl(),o(I);if(r.number==="Fraction")return a===void 0&&jy(),a(I);var F=parseFloat(I);return A(F,O)},"Fraction, Object":function(I,O){return I},"BigNumber, Object":function(I,O){return I},"number, Object":function(I,O){return A(I,O)},"Complex, Object":function(I,O){return I.im!==0?I:A(I.re,O)},"Matrix, Object":function(I,O){return i(A(I.valueOf()))},"Array, Object":function(I,O){return I.map(A)}});function S(I){return new m("-","unaryMinus",[I])}function C(I){var O,F=I.s*I.n;return F<0?O=new m("-","unaryMinus",[new l(-F)]):O=new l(F),I.d===1?O:new m("/","divide",[O,new l(I.d)])}function _(I,O,F){if(!Sa(O))return new u(E(I),E(O));if(Sr(I)||ke(I)){for(var q=Array.from(O.dimensions);q.length>0;)if(nt(q[0])&&typeof q[0].value!="string"){var k=D(q.shift().value,F);Sr(I)?I=I.items[k-1]:(I=I.valueOf()[k-1],I instanceof Array&&(I=i(I)))}else if(q.length>1&&nt(q[1])&&typeof q[1].value!="string"){var te=D(q[1].value,F),se=[],W=Sr(I)?I.items:I.valueOf();for(var V of W)if(Sr(V))se.push(V.items[te-1]);else if(ke(I))se.push(V[te-1]);else break;if(se.length===W.length)Sr(I)?I=new c(se):I=i(se),q.splice(1,1);else break}else break;return q.length===O.dimensions.length?new u(E(I),O):q.length>0?(O=new f(q),new u(E(I),O)):I}if(yu(I)&&O.dimensions.length===1&&nt(O.dimensions[0])){var ue=O.dimensions[0].value;return ue in I.properties?I.properties[ue]:new l}return new u(E(I),O)}function R(I,O,F,q){var k=O.shift(),te=O.reduce((se,W)=>{if(!ft(W)){var V=se.pop();if(ft(V))return[V,W];try{return se.push(y(I,[V,W],q)),se}catch{se.push(V)}}se.push(E(se.pop()));var ue=se.length===1?se[0]:F(se);return[F([ue,E(W)])]},[k]);return te.length===1?te[0]:F([te[0],N(te[1])])}function P(I,O){switch(I.type){case"SymbolNode":return I;case"ConstantNode":switch(typeof I.value){case"number":return D(I.value,O);case"string":return I.value;default:if(!isNaN(I.value))return D(I.value,O)}return I;case"FunctionNode":if(n[I.name]&&n[I.name].rawArgs)return I;{var F=["add","multiply"];if(!F.includes(I.name)){var q=I.args.map(le=>P(le,O));if(!q.some(ft))try{return y(I.name,q,O)}catch{}if(I.name==="size"&&q.length===1&&Sr(q[0])){for(var k=[],te=q[0];Sr(te);)k.push(te.items.length),te=te.items[0];return i(k)}return new s(I.name,q.map(E))}}case"OperatorNode":{var se=I.fn.toString(),W,V,ue=x(I);if(Ct(I)&&I.isUnary())W=[P(I.args[0],O)],ft(W[0])?V=ue(W):V=y(se,W,O);else if(w(I,O.context))if(W=v(I,O.context),W=W.map(le=>P(le,O)),h(se,O.context)){for(var me=[],re=[],ae=0;ae<W.length;ae++)ft(W[ae])?re.push(W[ae]):me.push(W[ae]);me.length>1?(V=R(se,me,ue,O),re.unshift(V),V=R(se,re,ue,O)):V=R(se,W,ue,O)}else V=R(se,W,ue,O);else W=I.args.map(le=>P(le,O)),V=R(se,W,ue,O);return V}case"ParenthesisNode":return P(I.content,O);case"AccessorNode":return _(P(I.object,O),P(I.index,O),O);case"ArrayNode":{var de=I.items.map(le=>P(le,O));return de.some(ft)?new c(de.map(E)):i(de)}case"IndexNode":return new f(I.dimensions.map(le=>g(le,O)));case"ObjectNode":{var ne={};for(var ce in I.properties)ne[ce]=g(I.properties[ce],O);return new p(ne)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(I.type))}}return g}),f0="simplifyCore",$9=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],H9=U(f0,$9,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,AccessorNode:s,ArrayNode:f,ConstantNode:p,FunctionNode:m,IndexNode:d,ObjectNode:h,OperatorNode:w,ParenthesisNode:v,SymbolNode:x}=e,g=new p(0),b=new p(1),y=new p(!0),N=new p(!1);function E(C){return Ct(C)&&["and","not","or"].includes(C.op)}var{hasProperty:A,isCommutative:D}=Pl({FunctionNode:m,OperatorNode:w,SymbolNode:x});function S(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=_?_.context:void 0;if(A(C,"trivial",R)){if(Zn(C)&&C.args.length===1)return S(C.args[0],_);var P=!1,I=0;if(C.forEach(re=>{++I,I===1&&(P=S(re,_))}),I===1)return P}var O=C;if(Zn(O)){var F=K4(O.name);if(F){if(O.args.length>2&&A(O,"associative",R))for(;O.args.length>2;){var q=O.args.pop(),k=O.args.pop();O.args.push(new w(F,O.name,[q,k]))}O=new w(F,O.name,O.args)}else return new m(S(O.fn),O.args.map(re=>S(re,_)))}if(Ct(O)&&O.isUnary()){var te=S(O.args[0],_);if(O.op==="~"&&Ct(te)&&te.isUnary()&&te.op==="~"||O.op==="not"&&Ct(te)&&te.isUnary()&&te.op==="not"&&E(te.args[0]))return te.args[0];var se=!0;if(O.op==="-"&&Ct(te)&&(te.isBinary()&&te.fn==="subtract"&&(O=new w("-","subtract",[te.args[1],te.args[0]]),se=!1),te.isUnary()&&te.op==="-"))return te.args[0];if(se)return new w(O.op,O.fn,[te])}if(Ct(O)&&O.isBinary()){var W=S(O.args[0],_),V=S(O.args[1],_);if(O.op==="+"){if(nt(W)&&i(W.value))return V;if(nt(V)&&i(V.value))return W;Ct(V)&&V.isUnary()&&V.op==="-"&&(V=V.args[0],O=new w("-","subtract",[W,V]))}if(O.op==="-")return Ct(V)&&V.isUnary()&&V.op==="-"?S(new w("+","add",[W,V.args[0]]),_):nt(W)&&i(W.value)?S(new w("-","unaryMinus",[V])):nt(V)&&i(V.value)?W:new w(O.op,O.fn,[W,V]);if(O.op==="*"){if(nt(W)){if(i(W.value))return g;if(n(W.value,1))return V}if(nt(V)){if(i(V.value))return g;if(n(V.value,1))return W;if(D(O,R))return new w(O.op,O.fn,[V,W],O.implicit)}return new w(O.op,O.fn,[W,V],O.implicit)}if(O.op==="/")return nt(W)&&i(W.value)?g:nt(V)&&n(V.value,1)?W:new w(O.op,O.fn,[W,V]);if(O.op==="^"&&nt(V)){if(i(V.value))return b;if(n(V.value,1))return W}if(O.op==="and"){if(nt(W))if(W.value){if(E(V))return V;if(nt(V))return V.value?y:N}else return N;if(nt(V))if(V.value){if(E(W))return W}else return N}if(O.op==="or"){if(nt(W)){if(W.value)return y;if(E(V))return V}if(nt(V)){if(V.value)return y;if(E(W))return W}}return new w(O.op,O.fn,[W,V])}if(Ct(O))return new w(O.op,O.fn,O.args.map(re=>S(re,_)));if(Sr(O))return new f(O.items.map(re=>S(re,_)));if(Bi(O))return new s(S(O.object,_),S(O.index,_));if(Sa(O))return new d(O.dimensions.map(re=>S(re,_)));if(yu(O)){var ue={};for(var me in O.properties)ue[me]=S(O.properties[me],_);return new h(ue)}return O}return t(f0,{Node:S,"Node,Object":S})}),J9="resolve",G9=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],K9=U(J9,G9,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function u(c,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!l)return c;if(zt(c)){if(s.has(c.name)){var f=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var p=l.get(c.name);if(ft(p)){var m=new Set(s);return m.add(c.name),u(p,l,m)}else return typeof p=="number"?r(String(p)):p!==void 0?new n(p):c}else if(Ct(c)){var d=c.args.map(function(w){return u(w,l,s)});return new a(c.op,c.fn,d,c.implicit)}else{if(An(c))return new o(u(c.content,l,s));if(Zn(c)){var h=c.args.map(function(w){return u(w,l,s)});return new i(c.name,h)}}return c.map(w=>u(w,l,s))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(c,l)=>u(c,ua(l)),"Array | Matrix":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array | Matrix, null | undefined":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array, Object":t.referTo("Array,Map",c=>(l,s)=>c(l,ua(s))),"Matrix, Object":t.referTo("Matrix,Map",c=>(l,s)=>c(l,ua(s))),"Array | Matrix, Map":t.referToSelf(c=>(l,s)=>l.map(f=>c(f,s)))})}),p0="symbolicEqual",W9=["parse","simplify","typed","OperatorNode"],Q9=U(p0,W9,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function a(o,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=new i("-","subtract",[o,u]),s=r(l,{},c);return nt(s)&&!s.value}return n(p0,{"Node, Node":a,"Node, Node, Object":a})}),m0="derivative",Z9=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],X9=U(m0,Z9,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:a,isZero:o,numeric:u,ConstantNode:c,FunctionNode:l,OperatorNode:s,ParenthesisNode:f,SymbolNode:p}=e;function m(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},N={};w(N,g,b.name);var E=v(g,N);return y.simplify?i(E):E}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var d=t(m0,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),d._simplify=!0,d.toTex=function(g){return h.apply(null,g.args)};var h=t("_derivTex",{"Node, SymbolNode":function(g,b){return nt(g)&&dt(g.value)==="string"?h(n(g.value).toString(),b.toString(),1):h(g.toTex(),b.toString(),1)},"Node, ConstantNode":function(g,b){if(dt(b.value)==="string")return h(g,n(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(g,b,y){return h(g.toString(),b.name,y.value)},"string, string, number":function(g,b,y){var N;return y===1?N="{d\\over d"+b+"}":N="{d^{"+y+"}\\over d"+b+"^{"+y+"}}",N+"\\left[".concat(g,"\\right]")}}),w=t("constTag",{"Object, ConstantNode, string":function(g,b){return g[b]=!0,!0},"Object, SymbolNode, string":function(g,b,y){return b.name!==y?(g[b]=!0,!0):!1},"Object, ParenthesisNode, string":function(g,b,y){return w(g,b.content,y)},"Object, FunctionAssignmentNode, string":function(g,b,y){return b.params.includes(y)?w(g,b.expr,y):(g[b]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(g,b,y){if(b.args.length>0){for(var N=w(g,b.args[0],y),E=1;E<b.args.length;++E)N=w(g,b.args[E],y)&&N;if(N)return g[b]=!0,!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(g){return x(0)},"SymbolNode, Object":function(g,b){return b[g]!==void 0?x(0):x(1)},"ParenthesisNode, Object":function(g,b){return new f(v(g.content,b))},"FunctionAssignmentNode, Object":function(g,b){return b[g]!==void 0?x(0):v(g.expr,b)},"FunctionNode, Object":function(g,b){if(b[g]!==void 0)return x(0);var y=g.args[0],N,E=!1,A=!1,D;switch(g.name){case"cbrt":E=!0,D=new s("*","multiply",[x(3),new s("^","pow",[y,new s("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(g.args.length===1)E=!0,D=new s("*","multiply",[x(2),new l("sqrt",[y])]);else if(g.args.length===2)return N=new s("/","divide",[x(1),g.args[1]]),b[N]=b[g.args[1]],v(new s("^","pow",[y,N]),b);break;case"log10":N=x(10);case"log":if(!N&&g.args.length===1)D=y.clone(),E=!0;else if(g.args.length===1&&N||g.args.length===2&&b[g.args[1]]!==void 0)D=new s("*","multiply",[y.clone(),new l("log",[N||g.args[1]])]),E=!0;else if(g.args.length===2)return v(new s("/","divide",[new l("log",[y]),new l("log",[g.args[1]])]),b);break;case"pow":if(g.args.length===2)return b[N]=b[g.args[1]],v(new s("^","pow",[y,g.args[1]]),b);break;case"exp":D=new l("exp",[y.clone()]);break;case"sin":D=new l("cos",[y.clone()]);break;case"cos":D=new s("-","unaryMinus",[new l("sin",[y.clone()])]);break;case"tan":D=new s("^","pow",[new l("sec",[y.clone()]),x(2)]);break;case"sec":D=new s("*","multiply",[g,new l("tan",[y.clone()])]);break;case"csc":A=!0,D=new s("*","multiply",[g,new l("cot",[y.clone()])]);break;case"cot":A=!0,D=new s("^","pow",[new l("csc",[y.clone()]),x(2)]);break;case"asin":E=!0,D=new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])]);break;case"acos":E=!0,A=!0,D=new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])]);break;case"atan":E=!0,D=new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)]);break;case"asec":E=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acsc":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acot":E=!0,A=!0,D=new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)]);break;case"sinh":D=new l("cosh",[y.clone()]);break;case"cosh":D=new l("sinh",[y.clone()]);break;case"tanh":D=new s("^","pow",[new l("sech",[y.clone()]),x(2)]);break;case"sech":A=!0,D=new s("*","multiply",[g,new l("tanh",[y.clone()])]);break;case"csch":A=!0,D=new s("*","multiply",[g,new l("coth",[y.clone()])]);break;case"coth":A=!0,D=new s("^","pow",[new l("csch",[y.clone()]),x(2)]);break;case"asinh":E=!0,D=new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)])]);break;case"acosh":E=!0,D=new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])]);break;case"atanh":E=!0,D=new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])]);break;case"asech":E=!0,A=!0,D=new s("*","multiply",[y.clone(),new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])])]);break;case"acsch":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acoth":E=!0,A=!0,D=new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])]);break;case"abs":D=new s("/","divide",[new l(new p("abs"),[y.clone()]),y.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+g.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var S,C;E?(S="/",C="divide"):(S="*",C="multiply");var _=v(y,b);return A&&(_=new s("-","unaryMinus",[_])),new s(S,C,[_,D])},"OperatorNode, Object":function(g,b){if(b[g]!==void 0)return x(0);if(g.op==="+")return new s(g.op,g.fn,g.args.map(function(P){return v(P,b)}));if(g.op==="-"){if(g.isUnary())return new s(g.op,g.fn,[v(g.args[0],b)]);if(g.isBinary())return new s(g.op,g.fn,[v(g.args[0],b),v(g.args[1],b)])}if(g.op==="*"){var y=g.args.filter(function(P){return b[P]!==void 0});if(y.length>0){var N=g.args.filter(function(P){return b[P]===void 0}),E=N.length===1?N[0]:new s("*","multiply",N),A=y.concat(v(E,b));return new s("*","multiply",A)}return new s("+","add",g.args.map(function(P){return new s("*","multiply",g.args.map(function(I){return I===P?v(I,b):I.clone()}))}))}if(g.op==="/"&&g.isBinary()){var D=g.args[0],S=g.args[1];return b[S]!==void 0?new s("/","divide",[v(D,b),S]):b[D]!==void 0?new s("*","multiply",[new s("-","unaryMinus",[D]),new s("/","divide",[v(S,b),new s("^","pow",[S.clone(),x(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[v(D,b),S.clone()]),new s("*","multiply",[D.clone(),v(S,b)])]),new s("^","pow",[S.clone(),x(2)])])}if(g.op==="^"&&g.isBinary()){var C=g.args[0],_=g.args[1];if(b[C]!==void 0)return nt(C)&&(o(C.value)||a(C.value,1))?x(0):new s("*","multiply",[g,new s("*","multiply",[new l("log",[C.clone()]),v(_.clone(),b)])]);if(b[_]!==void 0){if(nt(_)){if(o(_.value))return x(0);if(a(_.value,1))return v(C,b)}var R=new s("^","pow",[C.clone(),new s("-","subtract",[_,x(1)])]);return new s("*","multiply",[_.clone(),new s("*","multiply",[v(C,b),R])])}return new s("*","multiply",[new s("^","pow",[C.clone(),_.clone()]),new s("+","add",[new s("*","multiply",[v(C,b),new s("/","divide",[_.clone(),C.clone()])]),new s("*","multiply",[v(_,b),new l("log",[C.clone()])])])])}throw new Error('Cannot process operator "'+g.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function x(g,b){return new c(u(g,r.number))}return d}),d0="rationalize",Y9=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],e7=U(d0,Y9,e=>{var{config:t,typed:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,parse:s,simplifyConstant:f,simplifyCore:p,simplify:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:x,ArrayNode:g,ConstantNode:b,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,SymbolNode:D,ParenthesisNode:S}=e;function C(O){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,k=R(),te=_(O,F,!0,k.firstRules),se=te.variables.length,W={exactFractions:!1},V={exactFractions:!0};if(O=te.expression,se>=1){O=P(O);var ue,me,re=!0,ae=!1;O=m(O,k.firstRules,{},W);for(var de;me=re?k.distrDivRules:k.sucDivRules,O=m(O,me,{},V),re=!re,de=O.toString(),de!==ue;)ae=!0,ue=de;ae&&(O=m(O,k.firstRulesAgain,{},W)),O=m(O,k.finalRules,{},W)}var ne=[],ce={};return O.type==="OperatorNode"&&O.isBinary()&&O.op==="/"?(se===1&&(O.args[0]=I(O.args[0],ne),O.args[1]=I(O.args[1])),q&&(ce.numerator=O.args[0],ce.denominator=O.args[1])):(se===1&&(O=I(O,ne)),q&&(ce.numerator=O,ce.denominator=null)),q?(ce.coefficients=ne,ce.variables=te.variables,ce.expression=O,ce):O}return r(d0,{Node:C,"Node, boolean":(O,F)=>C(O,{},F),"Node, Object":C,"Node, Object, boolean":C});function _(O,F,q,k){var te=[],se=m(O,k,F,{exactFractions:!1});q=!!q;var W="+-*"+(q?"/":"");ue(se);var V={};return V.expression=se,V.variables=te,V;function ue(me){var re=me.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode")if(me.op==="^"){if(me.args[1].type!=="ConstantNode"||!Fe(parseFloat(me.args[1].value)))throw new Error("There is a non-integer exponent");ue(me.args[0])}else{if(!W.includes(me.op))throw new Error("Operator "+me.op+" invalid in polynomial expression");for(var ae=0;ae<me.args.length;ae++)ue(me.args[ae])}else if(re==="SymbolNode"){var de=me.name,ne=te.indexOf(de);ne===-1&&te.push(de)}else if(re==="ParenthesisNode")ue(me.content);else if(re!=="ConstantNode")throw new Error("type "+re+" is not allowed in polynomial expression")}}function R(){var O=[p,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],F=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],q=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],k=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],te={};return te.firstRules=O.concat(F,k),te.distrDivRules=q,te.sucDivRules=k,te.firstRulesAgain=O.concat(F),te.finalRules=[p,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],te}function P(O,F,q){var k=O.type,te=arguments.length>1;if(k==="OperatorNode"&&O.isBinary()){var se=!1,W;if(O.op==="^"&&(O.args[0].type==="ParenthesisNode"||O.args[0].type==="OperatorNode")&&O.args[1].type==="ConstantNode"&&(W=parseFloat(O.args[1].value),se=W>=2&&Fe(W)),se){if(W>2){var V=O.args[0],ue=new A("^","pow",[O.args[0].cloneDeep(),new b(W-1)]);O=new A("*","multiply",[V,ue])}else O=new A("*","multiply",[O.args[0],O.args[0].cloneDeep()]);te&&(q==="content"?F.content=O:F.args[q]=O)}}if(k==="ParenthesisNode")P(O.content,O,"content");else if(k!=="ConstantNode"&&k!=="SymbolNode")for(var me=0;me<O.args.length;me++)P(O.args[me],O,me);if(!te)return O}function I(O,F){F===void 0&&(F=[]),F[0]=0;var q={};q.cte=1,q.oper="+",q.fire="";var k=0,te="";de(O,null,q),k=F.length-1;for(var se=!0,W,V=k;V>=0;V--)if(F[V]!==0){var ue=new b(se?F[V]:Math.abs(F[V])),me=F[V]<0?"-":"+";if(V>0){var re=new D(te);if(V>1){var ae=new b(V);re=new A("^","pow",[re,ae])}F[V]===-1&&se?ue=new A("-","unaryMinus",[re]):Math.abs(F[V])===1?ue=re:ue=new A("*","multiply",[ue,re])}se?W=ue:me==="+"?W=new A("+","add",[W,ue]):W=new A("-","subtract",[W,ue]),se=!1}if(se)return new b(0);return W;function de(ne,ce,le){var he=ne.type;if(he==="FunctionNode")throw new Error("There is an unsolved function call");if(he==="OperatorNode"){if(!"+-*^".includes(ne.op))throw new Error("Operator "+ne.op+" invalid");if(ce!==null){if((ne.fn==="unaryMinus"||ne.fn==="pow")&&ce.fn!=="add"&&ce.fn!=="subtract"&&ce.fn!=="multiply")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="multiply")&&ce.fn!=="add"&&ce.fn!=="subtract")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="unaryMinus")&&le.noFil!==0)throw new Error("Invalid "+ne.op+" placing")}(ne.op==="^"||ne.op==="*")&&(le.fire=ne.op);for(var xe=0;xe<ne.args.length;xe++)ne.fn==="unaryMinus"&&(le.oper="-"),(ne.op==="+"||ne.fn==="subtract")&&(le.fire="",le.cte=1,le.oper=xe===0?"+":ne.op),le.noFil=xe,de(ne.args[xe],ne,le)}else if(he==="SymbolNode"){if(ne.name!==te&&te!=="")throw new Error("There is more than one variable");if(te=ne.name,ce===null){F[1]=1;return}if(ce.op==="^"&&le.noFil!==0)throw new Error("In power the variable should be the first parameter");if(ce.op==="*"&&le.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(le.fire===""||le.fire==="*")&&(k<1&&(F[1]=0),F[1]+=le.cte*(le.oper==="+"?1:-1),k=Math.max(1,k))}else if(he==="ConstantNode"){var $=parseFloat(ne.value);if(ce===null){F[0]=$;return}if(ce.op==="^"){if(le.noFil!==1)throw new Error("Constant cannot be powered");if(!Fe($)||$<=0)throw new Error("Non-integer exponent is not allowed");for(var T=k+1;T<$;T++)F[T]=0;$>k&&(F[$]=0),F[$]+=le.cte*(le.oper==="+"?1:-1),k=Math.max($,k);return}le.cte=$,le.fire===""&&(F[0]+=le.cte*(le.oper==="+"?1:-1))}else throw new Error("Type "+he+" is not allowed")}}}),h0="zpk2tf",t7=["typed","add","multiply","Complex","number"],r7=U(h0,t7,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:a}=e;return t(h0,{"Array,Array,number":function(c,l,s){return o(c,l,s)},"Array,Array":function(c,l){return o(c,l,1)},"Matrix,Matrix,number":function(c,l,s){return o(c.valueOf(),l.valueOf(),s)},"Matrix,Matrix":function(c,l){return o(c.valueOf(),l.valueOf(),1)}});function o(c,l,s){c.some(x=>x.type==="BigNumber")&&(c=c.map(x=>a(x))),l.some(x=>x.type==="BigNumber")&&(l=l.map(x=>a(x)));for(var f=[i(1,0)],p=[i(1,0)],m=0;m<c.length;m++){var d=c[m];typeof d=="number"&&(d=i(d,0)),f=u(f,[i(1,0),i(-d.re,-d.im)])}for(var h=0;h<l.length;h++){var w=l[h];typeof w=="number"&&(w=i(w,0)),p=u(p,[i(1,0),i(-w.re,-w.im)])}for(var v=0;v<f.length;v++)f[v]=n(f[v],s);return[f,p]}function u(c,l){for(var s=[],f=0;f<c.length+l.length-1;f++){s[f]=i(0,0);for(var p=0;p<c.length;p++)f-p>=0&&f-p<l.length&&(s[f]=r(s[f],n(c[p],l[f-p])))}return s}}),g0="freqz",n7=["typed","add","multiply","Complex","divide","matrix"],i7=U(g0,n7,e=>{var{typed:t,add:r,multiply:n,Complex:i,divide:a,matrix:o}=e;return t(g0,{"Array, Array":function(l,s){var f=c(512);return u(l,s,f)},"Array, Array, Array":function(l,s,f){return u(l,s,f)},"Array, Array, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f);return u(l,s,p)},"Matrix, Matrix":function(l,s){var f=c(512),{w:p,h:m}=u(l.valueOf(),s.valueOf(),f);return{w:o(p),h:o(m)}},"Matrix, Matrix, Matrix":function(l,s,f){var{h:p}=u(l.valueOf(),s.valueOf(),f.valueOf());return{h:o(p),w:o(f)}},"Matrix, Matrix, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f),{h:m}=u(l.valueOf(),s.valueOf(),p);return{h:o(m),w:o(p)}}});function u(l,s,f){for(var p=[],m=[],d=0;d<f.length;d++){for(var h=i(0,0),w=i(0,0),v=0;v<l.length;v++)h=r(h,n(l[v],i(Math.cos(-v*f[d]),Math.sin(-v*f[d]))));for(var x=0;x<s.length;x++)w=r(w,n(s[x],i(Math.cos(-x*f[d]),Math.sin(-x*f[d]))));p.push(h),m.push(w)}for(var g=[],b=0;b<p.length;b++)g.push(a(p[b],m[b]));return{h:g,w:f}}function c(l){for(var s=[],f=0;f<l;f++)s.push(f/l*Math.PI);return s}}),a7="reviver",o7=["classes"],s7=U(a7,o7,e=>{var{classes:t}=e;return function(r,n){var i=t[n&&n.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(n):n}}),u7="replacer",c7=[],l7=U(u7,c7,()=>function(e,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t}),f7="12.4.3",p7=U("true",[],()=>!0),m7=U("false",[],()=>!1),d7=U("null",[],()=>null),h7=Nr("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),g7=Nr("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),v7=Nr("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?jl(r):_D}),y7=Nr("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?X_(r):FD}),b7=Nr("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Q_(r):TD}),x7=Nr("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Z_(r):OD}),w7=Nr("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),N7=Nr("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),D7=Nr("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),E7=Nr("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),A7=Nr("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),S7=Nr("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),C7=Nr("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),M7=U("version",[],()=>f7);function Nr(e,t,r){return U(e,t,r,{recreateOnConfigChange:!0})}var _7=Pe("speedOfLight","299792458","m s^-1"),F7=Pe("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),T7=Pe("planckConstant","6.62607015e-34","J s"),O7=Pe("reducedPlanckConstant","1.0545718176461565e-34","J s"),B7=Pe("magneticConstant","1.25663706212e-6","N A^-2"),k7=Pe("electricConstant","8.8541878128e-12","F m^-1"),I7=Pe("vacuumImpedance","376.730313667","ohm"),R7=Pe("coulomb","8.987551792261171e9","N m^2 C^-2"),q7=Pe("elementaryCharge","1.602176634e-19","C"),z7=Pe("bohrMagneton","9.2740100783e-24","J T^-1"),j7=Pe("conductanceQuantum","7.748091729863649e-5","S"),L7=Pe("inverseConductanceQuantum","12906.403729652257","ohm"),P7=Pe("magneticFluxQuantum","2.0678338484619295e-15","Wb"),V7=Pe("nuclearMagneton","5.0507837461e-27","J T^-1"),U7=Pe("klitzing","25812.807459304513","ohm"),$7=Pe("bohrRadius","5.29177210903e-11","m"),H7=Pe("classicalElectronRadius","2.8179403262e-15","m"),J7=Pe("electronMass","9.1093837015e-31","kg"),G7=Pe("fermiCoupling","1.1663787e-5","GeV^-2"),K7=Fu("fineStructure",.0072973525693),W7=Pe("hartreeEnergy","4.3597447222071e-18","J"),Q7=Pe("protonMass","1.67262192369e-27","kg"),Z7=Pe("deuteronMass","3.3435830926e-27","kg"),X7=Pe("neutronMass","1.6749271613e-27","kg"),Y7=Pe("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),ek=Pe("rydberg","10973731.568160","m^-1"),tk=Pe("thomsonCrossSection","6.6524587321e-29","m^2"),rk=Fu("weakMixingAngle",.2229),nk=Fu("efimovFactor",22.7),ik=Pe("atomicMass","1.66053906660e-27","kg"),ak=Pe("avogadro","6.02214076e23","mol^-1"),ok=Pe("boltzmann","1.380649e-23","J K^-1"),sk=Pe("faraday","96485.33212331001","C mol^-1"),uk=Pe("firstRadiation","3.7417718521927573e-16","W m^2"),ck=Pe("loschmidt","2.686780111798444e25","m^-3"),lk=Pe("gasConstant","8.31446261815324","J K^-1 mol^-1"),fk=Pe("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),pk=Pe("molarVolume","0.022413969545014137","m^3 mol^-1"),mk=Fu("sackurTetrode",-1.16487052358),dk=Pe("secondRadiation","0.014387768775039337","m K"),hk=Pe("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),gk=Pe("wienDisplacement","2.897771955e-3","m K"),vk=Pe("molarMass","0.99999999965e-3","kg mol^-1"),yk=Pe("molarMassC12","11.9999999958e-3","kg mol^-1"),bk=Pe("gravity","9.80665","m s^-2"),xk=Pe("planckLength","1.616255e-35","m"),wk=Pe("planckMass","2.176435e-8","kg"),Nk=Pe("planckTime","5.391245e-44","s"),Dk=Pe("planckCharge","1.87554603778e-18","C"),Ek=Pe("planckTemperature","1.416785e+32","K");function Pe(e,t,r){var n=["config","Unit","BigNumber"];return U(e,n,i=>{var{config:a,Unit:o,BigNumber:u}=i,c=a.number==="BigNumber"?new u(t):parseFloat(t),l=new o(c,r);return l.fixPrefix=!0,l})}function Fu(e,t){var r=["config","BigNumber"];return U(e,r,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(t):t})}var Ak="apply",Sk=["typed","isInteger"],Ck=U(Ak,Sk,e=>{var{typed:t,isInteger:r}=e,n=Bl({typed:t,isInteger:r});return t("apply",{"...any":function(i){var a=i[1];Ue(a)?i[1]=a-1:$e(a)&&(i[1]=a.minus(1));try{return n.apply(null,i)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),Mk="column",_k=["typed","Index","matrix","range"],Fk=U(Mk,_k,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=qy({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0});function Vl(e,t,r){var n=e.filter(function(c){return zt(c)&&!(c.name in t)&&!r.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,o=new sv(r,a,new Set([i])),u=e.compile();return function(c){return a.set(i,c),u.evaluate(o)}}var Tk="filter",Ok=["typed"],Bk=U(Tk,Ok,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||Eo(i[1])?c=i[1].compile().evaluate(o):c=Vl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("filter",{"Array, function":v0,"Matrix, function":function(i,a){return i.create(v0(i.toArray(),a))},"Array, RegExp":Ls,"Matrix, RegExp":function(i,a){return i.create(Ls(i.toArray(),a))}});return r},{isTransformFunction:!0});function v0(e,t){return Fv(e,function(r,n,i){return Ta(t,r,[n+1],i,"filter")})}var kk="forEach",Ik=["typed"],Rk=U(kk,Ik,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||Eo(i[1])?c=i[1].compile().evaluate(o):c=Vl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(i,a){var o=function u(c,l){if(Array.isArray(c))Eu(c,function(s,f){u(s,l.concat(f+1))});else return Ta(a,c,l,i,"forEach")};o(i.valueOf(),[])}});return r},{isTransformFunction:!0}),qk="index",zk=["Index","getMatrixDataType"],jk=U(qk,zk,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var n=[],i=0,a=arguments.length;i<a;i++){var o=arguments[i];if(Cl(o))o.start--,o.end-=o.step>0?0:2;else if(o&&o.isSet===!0)o=o.map(function(c){return c-1});else if(st(o)||ke(o))r(o)!=="boolean"&&(o=o.map(function(c){return c-1}));else if(Ue(o))o--;else if($e(o))o=o.toNumber()-1;else if(typeof o!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");n[i]=o}var u=new t;return t.apply(u,n),u}},{isTransformFunction:!0}),Lk="map",Pk=["typed"],Vk=U(Lk,Pk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||Eo(i[1])?c=i[1].compile().evaluate(o):c=Vl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("map",{"Array, function":function(i,a){return y0(i,a,i)},"Matrix, function":function(i,a){return i.create(y0(i.valueOf(),a,i))}});return r},{isTransformFunction:!0});function y0(e,t,r){function n(i,a){return Array.isArray(i)?Nn(i,function(o,u){return n(o,a.concat(u+1))}):Ta(t,i,a,r,"map")}return n(e,[])}function ai(e){if(e.length===2&&Fr(e[0])){e=e.slice();var t=e[1];Ue(t)?e[1]=t-1:$e(t)&&(e[1]=t.minus(1))}return e}var Uk="max",$k=["typed","config","numeric","larger"],Hk=U(Uk,$k,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,a=Gy({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Jk="mean",Gk=["typed","add","divide"],Kk=U(Jk,Gk,e=>{var{typed:t,add:r,divide:n}=e,i=r1({typed:t,add:r,divide:n});return t("mean",{"...any":function(a){a=ai(a);try{return i.apply(null,a)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),Wk="min",Qk=["typed","config","numeric","smaller"],Zk=U(Wk,Qk,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,a=Ky({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Xk="range",Yk=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],eI=U(Xk,Yk,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e,f=Py({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s});return t("range",{"...any":function(p){var m=p.length-1,d=p[m];return typeof d!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),tI="row",rI=["typed","Index","matrix","range"],nI=U(tI,rI,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=Vy({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0}),iI="subset",aI=["typed","matrix","zeros","add"],oI=U(iI,aI,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=Uy({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(o){try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),sI="concat",uI=["typed","matrix","isInteger"],cI=U(sI,uI,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=Ry({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(a){var o=a.length-1,u=a[o];Ue(u)?a[o]=u-1:$e(u)&&(a[o]=u.minus(1));try{return i.apply(null,a)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),b0="diff",lI=["typed","matrix","subtract","number","bignumber"],fI=U(b0,lI,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e,o=zy({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(b0,{"...any":function(u){u=ai(u);try{return o.apply(null,u)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),pI="std",mI=["typed","map","sqrt","variance"],dI=U(pI,mI,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,a=a1({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),x0="sum",hI=["typed","config","add","numeric"],gI=U(x0,hI,e=>{var{typed:t,config:r,add:n,numeric:i}=e,a=e1({typed:t,config:r,add:n,numeric:i});return t(x0,{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),vI="quantileSeq",yI=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],bI=U(vI,yI,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=i1({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(h,w,v,x)=>m(h,w,v,d(x)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(h,w,v,x)=>m(h,w,v,d(x))});function d(h){return ai([[],h])[1]}},{isTransformFunction:!0}),w0="cumsum",xI=["typed","add","unaryPlus"],wI=U(w0,xI,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=t1({typed:t,add:r,unaryPlus:n});return t(w0,{"...any":function(a){if(a.length===2&&Fr(a[0])){var o=a[1];Ue(o)?a[1]=o-1:$e(o)&&(a[1]=o.minus(1))}try{return i.apply(null,a)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),N0="variance",NI=["typed","add","subtract","multiply","divide","apply","isNaN"],DI=U(N0,NI,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e,c=n1({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u});return t(N0,{"...any":function(l){l=ai(l);try{return c.apply(null,l)}catch(s){throw lr(s)}}})},{isTransformFunction:!0}),D0="print",EI=["typed","matrix","zeros","add"],AI=U(D0,EI,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=Hy({typed:t,matrix:r,zeros:n,add:i});return t(D0,{"string, Object | Array":function(u,c){return a(o(u),c)},"string, Object | Array, number | Object":function(u,c,l){return a(o(u),c,l)}});function o(u){return u.replace($y,c=>{var l=c.slice(1).split("."),s=l.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+s.join(".")})}},{isTransformFunction:!0}),SI="and",CI=["typed","matrix","zeros","add","equalScalar","not","concat"],MI=U(SI,CI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=Jy({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)&&!u(p,!0))return!1;var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),_I="or",FI=["typed","matrix","equalScalar","DenseMatrix","concat"],TI=U(_I,FI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Iy({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)&&o(f,!1))return!0;var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),OI="bitAnd",BI=["typed","matrix","zeros","add","equalScalar","not","concat"],kI=U(OI,BI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=By({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)){if(isNaN(p))return NaN;if(p===0||p===!1)return 0}var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),II="bitOr",RI=["typed","matrix","equalScalar","DenseMatrix","concat"],qI=U(II,RI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ky({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),Ae=G2({config:ve}),ht=X2({}),E0=b7({BigNumber:Ae,config:ve}),zI=m7({}),jI=K7({BigNumber:Ae,config:ve}),Ui=rD({}),d1=C7({Complex:ht}),LI=h7({BigNumber:Ae,config:ve}),PI=N7({BigNumber:Ae,config:ve}),VI=E7({BigNumber:Ae,config:ve}),Tu=uD({}),UI=g7({BigNumber:Ae,config:ve}),$I=d7({}),HI=x7({BigNumber:Ae,config:ve}),JI=aD({}),h1=ZN({}),GI=A7({BigNumber:Ae,config:ve}),KI=mk({BigNumber:Ae,config:ve}),g1=y7({BigNumber:Ae,config:ve}),WI=p7({}),QI=M7({}),He=ND({Matrix:Tu}),ZI=nk({BigNumber:Ae,config:ve}),XI=w7({BigNumber:Ae,config:ve}),Yc=v7({BigNumber:Ae,config:ve}),YI=l7({}),eR=S7({BigNumber:Ae,config:ve}),K=GN({BigNumber:Ae,Complex:ht,DenseMatrix:He,Fraction:Ui}),Ul=BE({BigNumber:Ae,config:ve,typed:K}),tR=rk({BigNumber:Ae,config:ve}),fr=IE({typed:K}),rR=c3({Complex:ht,config:ve,typed:K}),nR=m3({BigNumber:Ae,typed:K}),iR=v3({BigNumber:Ae,Complex:ht,config:ve,typed:K}),Rt=jE({typed:K}),aR=SS({typed:K}),oR=D3({BigNumber:Ae,Complex:ht,config:ve,typed:K}),sR=M3({typed:K}),v1=T3({typed:K}),uR=I3({Complex:ht,config:ve,typed:K}),ir=mE({BigNumber:Ae,typed:K}),cR=bS({typed:K}),lR=lE({typed:K}),fR=ED({typed:K}),Ou=P6({typed:K}),Bu=gE({Complex:ht,typed:K}),$i=MS({typed:K}),$l=q3({typed:K}),pR=P3({BigNumber:Ae,typed:K}),mR=H3({BigNumber:Ae,typed:K}),dR=eA({typed:K}),Xe=XD({config:ve,typed:K}),hR=QC({typed:K}),y1=rA({typed:K}),gR=iA({Complex:ht,typed:K}),vR=KS({typed:K}),yR=XS({typed:K}),_o=sM({typed:K}),Hl=tC({typed:K}),bR=mM({format:_o,typed:K}),Jl=FS({typed:K}),dr=SD({typed:K}),oi=qD({typed:K}),Hi=UD({typed:K}),Kr=HD({typed:K}),xR=D7({BigNumber:Ae,config:ve}),wR=G6({Complex:ht,typed:K}),NR=jA({Complex:ht,config:ve,typed:K}),b1=PA({Complex:ht,config:ve,typed:K}),Ji=sC({typed:K}),At=$A({typed:K}),ru=kS({typed:K}),Tn=oE({typed:K}),DR=fM({format:_o,typed:K}),ER=w9({config:ve,typed:K}),AR=Hy({typed:K}),SR=D9({config:ve,typed:K}),Gl=OS({typed:K}),CR=W3({BigNumber:Ae,typed:K}),x1=QA({BigNumber:Ae,Fraction:Ui,complex:Bu,typed:K}),ku=Y3({typed:K}),On=tE({Matrix:Tu,equalScalar:Xe,typed:K}),MR=_E({typed:K}),_R=tS({typed:K}),FR=uE({typed:K}),Or=PE({typed:K}),TR=n4({typed:K}),w1=WD({typed:K}),OR=f3({Complex:ht,config:ve,typed:K}),BR=b3({BigNumber:Ae,typed:K}),Kl=Bl({isInteger:dr,typed:K}),kR=w3({BigNumber:Ae,Complex:ht,config:ve,typed:K}),IR=cM({format:_o,typed:K}),RR=U6({typed:K}),qR=j3({typed:K}),zR=G3({BigNumber:Ae,typed:K}),Fo=GD({typed:K}),jR=yM({typed:K}),LR=A9({config:ve,typed:K}),PR=Z3({BigNumber:Ae,typed:K}),VR=t4({typed:K}),UR=a3({SparseMatrix:On,typed:K}),Wr=YA({Complex:ht,config:ve,typed:K}),$R=o4({typed:K}),ln=TE({typed:K}),HR=h3({BigNumber:Ae,Complex:ht,config:ve,typed:K}),JR=U3({BigNumber:Ae,typed:K}),Ba=bE({Fraction:Ui,typed:K}),Gi=jD({typed:K}),we=wE({DenseMatrix:He,Matrix:Tu,SparseMatrix:On,typed:K}),GR=DE({isZero:Kr,matrix:we,typed:K}),KR=nM({isNaN:Fo,isNumeric:Gi,typed:K}),Pr=wM({bignumber:ir,fraction:Ba,number:Tn}),N1=aM({config:ve,multiplyScalar:At,numeric:Pr,typed:K}),D1=hC({isInteger:dr,matrix:we,typed:K}),Gt=AC({matrix:we,config:ve,typed:K}),WR=CC({matrix:we,typed:K}),To=BC({matrix:we,typed:K}),E1=aS({BigNumber:Ae,config:ve,matrix:we,typed:K}),Ut=qC({BigNumber:Ae,config:ve,matrix:we,typed:K}),QR=A3({Complex:ht,config:ve,typed:K}),A1=UE({BigNumber:Ae,Complex:ht,Fraction:Ui,config:ve,isNegative:oi,matrix:we,typed:K,unaryMinus:ln}),it=Ry({isInteger:dr,matrix:we,typed:K}),ZR=PS({prod:N1,size:Gt,typed:K}),Wl=IC({conj:$i,transpose:To,typed:K}),S1=HS({DenseMatrix:He,SparseMatrix:On,matrix:we,typed:K}),Nt=DM({numeric:Pr,typed:K}),Oo=qM({DenseMatrix:He,concat:it,divideScalar:Nt,equalScalar:Xe,matrix:we,typed:K}),Br=f_({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K}),Bo=QS({matrix:we,typed:K}),XR=PD({isNumeric:Gi,typed:K}),si=nC({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,config:ve,matrix:we,typed:K}),YR=aC({matrix:we,multiplyScalar:At,typed:K}),Iu=A_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:K}),eq=WM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K,zeros:Ut}),C1=jM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:K}),Ql=CE({flatten:Bo,matrix:we,size:Gt,typed:K}),tq=KA({BigNumber:Ae,concat:it,equalScalar:Xe,matrix:we,typed:K}),rq=pC({BigNumber:Ae,config:ve,matrix:we,typed:K}),Zl=VF({addScalar:Rt,complex:Bu,conj:$i,divideScalar:Nt,equal:Br,identity:si,isZero:Kr,matrix:we,multiplyScalar:At,sign:x1,sqrt:Wr,subtractScalar:Or,typed:K,unaryMinus:ln,zeros:Ut}),nq=yC({config:ve,matrix:we}),iq=ZM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K,zeros:Ut}),tn=CM({BigNumber:Ae,DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,typed:K,zeros:Ut}),ar=g_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:K}),Dt=nS({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,subtractScalar:Or,typed:K,unaryMinus:ln}),aq=gM({concat:it,matrix:we,typed:K}),oq=F_({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:K}),Xl=PM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:K}),sq=qS({DenseMatrix:He,concat:it,matrix:we,typed:K}),rt=M4({DenseMatrix:He,SparseMatrix:On,addScalar:Rt,concat:it,equalScalar:Xe,matrix:we,typed:K}),uq=B3({BigNumber:Ae,DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K}),cq=By({concat:it,equalScalar:Xe,matrix:we,typed:K}),lq=ky({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K}),fq=ES({DenseMatrix:He,concat:it,matrix:we,typed:K}),pq=T9({addScalar:Rt,combinations:Ou,divideScalar:Nt,isInteger:dr,isNegative:oi,multiplyScalar:At,typed:K}),Ki=r_({BigNumber:Ae,DenseMatrix:He,Fraction:Ui,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:K}),M1=c_({concat:it,matrix:we,typed:K}),mq=t1({add:rt,typed:K,unaryPlus:Ul}),Yl=M_({equal:Br,typed:K}),dq=zy({matrix:we,number:Tn,subtract:Dt,typed:K}),hq=E6({abs:fr,addScalar:Rt,deepEqual:Yl,divideScalar:Nt,multiplyScalar:At,sqrt:Wr,subtractScalar:Or,typed:K}),Ru=k4({addScalar:Rt,conj:$i,multiplyScalar:At,size:Gt,typed:K}),gq=d_({compareText:M1,isZero:Kr,typed:K}),_1=Fy({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:K,zeros:Ut}),vq=BA({BigNumber:Ae,DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:K,zeros:Ut}),yq=F4({abs:fr,addScalar:Rt,divideScalar:Nt,isPositive:Hi,multiplyScalar:At,smaller:ar,sqrt:Wr,typed:K}),F1=L_({DenseMatrix:He,smaller:ar}),Xt=U_({ImmutableDenseMatrix:F1,getMatrixDataType:Hl}),or=N_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:K}),ef=_M({Complex:ht,config:ve,divideScalar:Nt,typed:K}),bq=UM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:K}),xq=AE({flatten:Bo,matrix:we,size:Gt,typed:K}),wq=Ky({config:ve,numeric:Pr,smaller:ar,typed:K}),T1=Ty({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:K,zeros:Ut}),ct=JA({addScalar:Rt,dot:Ru,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:K}),Nq=BM({Complex:ht,config:ve,divideScalar:Nt,typed:K}),Dq=Iy({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K}),qu=B_({compare:Ki,isNaN:Fo,isNumeric:Gi,typed:K}),Eq=YM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K,zeros:Ut}),O1=pT({SparseMatrix:On,abs:fr,add:rt,divideScalar:Nt,larger:or,largerEq:Iu,multiply:ct,subtract:Dt,transpose:To,typed:K}),Dr=Uy({add:rt,matrix:we,typed:K,zeros:Ut}),tf=e1({add:rt,config:ve,numeric:Pr,typed:K}),Aq=q4({add:rt,matrix:we,typed:K}),B1=HM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:K}),Sq=r7({Complex:ht,add:rt,multiply:ct,number:Tn,typed:K}),rf=XE({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:K,zeros:Ut}),fn=o_({compare:Ki,typed:K}),Cq=B9({addScalar:Rt,combinations:Ou,isInteger:dr,isNegative:oi,isPositive:Hi,larger:or,typed:K}),Mq=US({matrix:we,multiply:ct,subtract:Dt,typed:K}),k1=e6({divideScalar:Nt,isZero:Kr,matrix:we,multiply:ct,subtractScalar:Or,typed:K,unaryMinus:ln}),_q=fS({concat:it,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:K}),I1=J_({larger:or,smaller:ar}),R1=sA({Complex:ht,DenseMatrix:He,ceil:rf,equalScalar:Xe,floor:_1,matrix:we,typed:K,zeros:Ut}),q1=j4({Index:Xt,typed:K}),Fq=C6({abs:fr,add:rt,addScalar:Rt,config:ve,divideScalar:Nt,equalScalar:Xe,flatten:Bo,isNumeric:Gi,isZero:Kr,matrix:we,multiply:ct,multiplyScalar:At,smaller:ar,subtract:Dt,typed:K}),Tq=sS({BigNumber:Ae,add:rt,config:ve,equal:Br,isInteger:dr,mod:T1,smaller:ar,typed:K,xgcd:E1}),Oq=qA({concat:it,equalScalar:Xe,matrix:we,typed:K}),Bq=TM({Complex:ht,config:ve,divideScalar:Nt,log:ef,typed:K}),nf=Gy({config:ve,larger:or,numeric:Pr,typed:K}),kq=u4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),Iq=p4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),Rq=g4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),qq=x4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),wa=b_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:K}),zq=I_({compare:Ki,compareNatural:fn,matrix:we,typed:K}),jq=Jy({concat:it,equalScalar:Xe,matrix:we,not:ru,typed:K,zeros:Ut}),Na=Py({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Hi,larger:or,largerEq:Iu,smaller:ar,smallerEq:wa,typed:K}),Lq=Vy({Index:Xt,matrix:we,range:Na,typed:K}),z1=l4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),Pq=y4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),j1=E4({Index:Xt,concat:it,setDifference:z1,size:Gt,subset:Dr,typed:K}),L1=W_({FibonacciHeap:I1,addScalar:Rt,equalScalar:Xe}),P1=qy({Index:Xt,matrix:we,range:Na,typed:K}),Wi=r6({abs:fr,addScalar:Rt,det:k1,divideScalar:Nt,identity:si,matrix:we,multiply:ct,typed:K,unaryMinus:ln}),V1=LF({DenseMatrix:He,Spa:L1,SparseMatrix:On,abs:fr,addScalar:Rt,divideScalar:Nt,equalScalar:Xe,larger:or,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:K,unaryMinus:ln}),Vq=i6({Complex:ht,add:rt,ctranspose:Wl,deepEqual:Yl,divideScalar:Nt,dot:Ru,dotDivide:Oo,equal:Br,inv:Wi,matrix:we,multiply:ct,typed:K}),kr=AM({Complex:ht,config:ve,fraction:Ba,identity:si,inv:Wi,matrix:we,multiply:ct,number:Tn,typed:K}),U1=d4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:K}),Uq=S4({Index:Xt,concat:it,setIntersect:U1,setSymDifference:j1,size:Gt,subset:Dr,typed:K}),$q=m6({abs:fr,add:rt,identity:si,inv:Wi,map:Ji,max:nf,multiply:ct,size:Gt,sqrt:Wr,subtract:Dt,typed:K}),qe=t3({BigNumber:Ae,Complex:ht,Fraction:Ui,abs:fr,addScalar:Rt,config:ve,divideScalar:Nt,equal:Br,fix:R1,format:_o,isNumeric:Gi,multiplyScalar:At,number:Tn,pow:kr,round:tn,subtractScalar:Or}),Hq=I7({BigNumber:Ae,Unit:qe,config:ve}),Jq=gk({BigNumber:Ae,Unit:qe,config:ve}),Gq=ik({BigNumber:Ae,Unit:qe,config:ve}),Kq=z7({BigNumber:Ae,Unit:qe,config:ve}),Wq=ok({BigNumber:Ae,Unit:qe,config:ve}),Qq=j7({BigNumber:Ae,Unit:qe,config:ve}),Zq=R7({BigNumber:Ae,Unit:qe,config:ve}),Xq=Z7({BigNumber:Ae,Unit:qe,config:ve}),Yq=IM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,pow:kr,typed:K}),ez=k7({BigNumber:Ae,Unit:qe,config:ve}),tz=q7({BigNumber:Ae,Unit:qe,config:ve}),rz=f6({abs:fr,add:rt,identity:si,inv:Wi,multiply:ct,typed:K}),nz=sk({BigNumber:Ae,Unit:qe,config:ve}),$1=jC({addScalar:Rt,ceil:rf,conj:$i,divideScalar:Nt,dotDivide:Oo,exp:y1,i:d1,log2:b1,matrix:we,multiplyScalar:At,pow:kr,tau:g1,typed:K}),af=H6({BigNumber:Ae,Complex:ht,config:ve,multiplyScalar:At,pow:kr,typed:K}),iz=F7({BigNumber:Ae,Unit:qe,config:ve}),az=W7({BigNumber:Ae,Unit:qe,config:ve}),oz=PC({conj:$i,dotDivide:Oo,fft:$1,typed:K}),sz=U7({BigNumber:Ae,Unit:qe,config:ve}),uz=ck({BigNumber:Ae,Unit:qe,config:ve}),cz=B7({BigNumber:Ae,Unit:qe,config:ve}),lz=vk({BigNumber:Ae,Unit:qe,config:ve}),fz=fk({BigNumber:Ae,Unit:qe,config:ve}),pz=X7({BigNumber:Ae,Unit:qe,config:ve}),mz=V7({BigNumber:Ae,Unit:qe,config:ve}),dz=Dk({BigNumber:Ae,Unit:qe,config:ve}),hz=xk({BigNumber:Ae,Unit:qe,config:ve}),gz=Ek({BigNumber:Ae,Unit:qe,config:ve}),vz=Q7({BigNumber:Ae,Unit:qe,config:ve}),yz=Y7({BigNumber:Ae,Unit:qe,config:ve}),bz=O7({BigNumber:Ae,Unit:qe,config:ve}),xz=ek({BigNumber:Ae,Unit:qe,config:ve}),wz=dk({BigNumber:Ae,Unit:qe,config:ve}),Nz=_7({BigNumber:Ae,Unit:qe,config:ve}),Dz=hk({BigNumber:Ae,Unit:qe,config:ve}),Ez=tk({BigNumber:Ae,Unit:qe,config:ve}),Az=ak({BigNumber:Ae,Unit:qe,config:ve}),Sz=$7({BigNumber:Ae,Unit:qe,config:ve}),Cz=s3({Unit:qe,typed:K}),jt=N6({divideScalar:Nt,equalScalar:Xe,inv:Wi,matrix:we,multiply:ct,typed:K}),Mz=J7({BigNumber:Ae,Unit:qe,config:ve}),ko=W6({gamma:af,typed:K}),_z=uk({BigNumber:Ae,Unit:qe,config:ve}),Fz=bk({BigNumber:Ae,Unit:qe,config:ve}),Tz=L7({BigNumber:Ae,Unit:qe,config:ve}),H1=dT({DenseMatrix:He,lsolve:C1,lup:V1,matrix:we,slu:O1,typed:K,usolve:Xl}),Oz=P7({BigNumber:Ae,Unit:qe,config:ve}),Bz=yk({BigNumber:Ae,Unit:qe,config:ve}),kz=Y6({add:rt,divide:jt,factorial:ko,isInteger:dr,isPositive:Hi,multiply:ct,typed:K}),Iz=t9({factorial:ko,typed:K}),Rz=wk({BigNumber:Ae,Unit:qe,config:ve}),qz=gT({add:rt,cbrt:A1,divide:jt,equalScalar:Xe,im:Jl,isZero:Kr,multiply:ct,re:Gl,sqrt:Wr,subtract:Dt,typeOf:w1,typed:K,unaryMinus:ln}),zz=N4({compareNatural:fn,typed:K}),jz=GC({abs:fr,add:rt,bignumber:ir,divide:jt,isNegative:oi,isPositive:Hi,larger:or,map:Ji,matrix:we,max:nf,multiply:ct,smaller:ar,subtract:Dt,typed:K,unaryMinus:ln}),J1=C9({bignumber:ir,addScalar:Rt,combinations:Ou,divideScalar:Nt,factorial:ko,isInteger:dr,isNegative:oi,larger:or,multiplyScalar:At,number:Tn,pow:kr,subtractScalar:Or,typed:K}),Lz=n3({Unit:qe,typed:K}),Pz=_9({addScalar:Rt,isInteger:dr,isNegative:oi,stirlingS2:J1,typed:K}),G1=c6({abs:fr,add:rt,addScalar:Rt,atan:v1,bignumber:ir,column:P1,complex:Bu,config:ve,cos:$l,diag:S1,divideScalar:Nt,dot:Ru,equal:Br,flatten:Bo,im:Jl,inv:Wi,larger:or,matrix:we,matrixFromColumns:Ql,multiply:ct,multiplyScalar:At,number:Tn,qr:Zl,re:Gl,reshape:D1,sin:ku,size:Gt,smaller:ar,sqrt:Wr,subtract:Dt,typed:K,usolve:Xl,usolveAll:B1}),Vz=G7({BigNumber:Ae,Unit:qe,config:ve}),Uz=lk({BigNumber:Ae,Unit:qe,config:ve}),$z=Z6({divide:jt,dotDivide:Oo,isNumeric:Gi,log:ef,map:Ji,matrix:we,multiply:ct,sum:tf,typed:K}),K1=r1({add:rt,divide:jt,typed:K}),Hz=pk({BigNumber:Ae,Unit:qe,config:ve}),Jz=T7({BigNumber:Ae,Unit:qe,config:ve}),Gz=i1({bignumber:ir,add:rt,compare:Ki,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:qu,smaller:ar,smallerEq:wa,subtract:Dt,typed:K}),of=n1({add:rt,apply:Kl,divide:jt,isNaN:Fo,multiply:ct,subtract:Dt,typed:K}),Kz=H7({BigNumber:Ae,Unit:qe,config:ve}),W1=O6({add:rt,compare:Ki,divide:jt,partitionSelect:qu,typed:K}),Wz=j6({add:rt,divide:jt,matrix:we,mean:K1,multiply:ct,pow:kr,sqrt:Wr,subtract:Dt,sum:tf,typed:K}),Qz=i7({Complex:ht,add:rt,divide:jt,matrix:we,multiply:ct,typed:K}),Zz=k6({abs:fr,map:Ji,median:W1,subtract:Dt,typed:K}),Xz=a1({map:Ji,sqrt:Wr,typed:K,variance:of}),Yz=tM({BigNumber:Ae,Complex:ht,add:rt,config:ve,divide:jt,equal:Br,factorial:ko,gamma:af,isNegative:oi,multiply:ct,pi:Yc,pow:kr,sin:ku,smallerEq:wa,subtract:Dt,typed:K}),sf=O4({abs:fr,add:rt,conj:$i,ctranspose:Wl,eigs:G1,equalScalar:Xe,larger:or,matrix:we,multiply:ct,pow:kr,smaller:ar,sqrt:Wr,typed:K}),Q1=NC({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,addScalar:Rt,config:ve,cos:$l,matrix:we,multiplyScalar:At,norm:sf,sin:ku,typed:K,unaryMinus:ln}),ej=Nk({BigNumber:Ae,Unit:qe,config:ve}),Z1=v6({identity:si,matrix:we,multiply:ct,norm:sf,qr:Zl,subtract:Dt,typed:K}),tj=xC({multiply:ct,rotationMatrix:Q1,typed:K}),X1=h6({abs:fr,add:rt,concat:it,identity:si,index:q1,lusolve:H1,matrix:we,matrixFromColumns:Ql,multiply:ct,range:Na,schur:Z1,subset:Dr,subtract:Dt,transpose:To,typed:K}),rj=b6({matrix:we,multiply:ct,sylvester:X1,transpose:To,typed:K}),ka={},Ia={},Y1={},tr=V4({mathWithTransform:Ia}),Ra=dF({Node:tr}),Bn=gF({Node:tr}),Qi=yF({Node:tr}),eb=NF({Node:tr}),qa=J4({Node:tr}),tb=X4({Node:tr,ResultSet:h1}),rb=eF({Node:tr}),ui=uF({Node:tr}),nb=xF({Node:tr}),nj=s7({classes:Y1}),uf=NT({math:ka,typed:K}),ib=lF({Node:tr,typed:K}),ab=XB({Chain:uf,typed:K}),za=pF({Node:tr,size:Gt}),ja=$4({Node:tr,subset:Dr}),ob=Q4({matrix:we,Node:tr,subset:Dr}),ci=AF({Unit:qe,Node:tr,math:ka}),li=CF({Node:tr,SymbolNode:ci,math:ka}),pn=_F({AccessorNode:ja,ArrayNode:qa,AssignmentNode:ob,BlockNode:tb,ConditionalNode:rb,ConstantNode:ui,FunctionAssignmentNode:ib,FunctionNode:li,IndexNode:za,ObjectNode:Ra,OperatorNode:Bn,ParenthesisNode:Qi,RangeNode:nb,RelationalNode:eb,SymbolNode:ci,config:ve,numeric:Pr,typed:K}),sb=K9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Qi,parse:pn,typed:K}),cf=U9({bignumber:ir,fraction:Ba,AccessorNode:ja,ArrayNode:qa,ConstantNode:ui,FunctionNode:li,IndexNode:za,ObjectNode:Ra,OperatorNode:Bn,SymbolNode:ci,config:ve,mathWithTransform:Ia,matrix:we,typed:K}),ij=TF({parse:pn,typed:K}),lf=H9({AccessorNode:ja,ArrayNode:qa,ConstantNode:ui,FunctionNode:li,IndexNode:za,ObjectNode:Ra,OperatorNode:Bn,ParenthesisNode:Qi,SymbolNode:ci,add:rt,divide:jt,equal:Br,isZero:Kr,multiply:ct,parse:pn,pow:kr,subtract:Dt,typed:K}),ff=BF({parse:pn,typed:K}),ub=bT({evaluate:ff}),cb=RF({evaluate:ff}),zu=L9({bignumber:ir,fraction:Ba,AccessorNode:ja,ArrayNode:qa,ConstantNode:ui,FunctionNode:li,IndexNode:za,ObjectNode:Ra,OperatorNode:Bn,ParenthesisNode:Qi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Kr,mathWithTransform:Ia,matrix:we,multiply:ct,parse:pn,pow:kr,resolve:sb,simplifyConstant:cf,simplifyCore:lf,subtract:Dt,typed:K}),aj=Q9({OperatorNode:Bn,parse:pn,simplify:zu,typed:K}),oj=I9({parse:pn,typed:K}),sj=zF({Parser:cb,typed:K}),uj=e7({bignumber:ir,fraction:Ba,AccessorNode:ja,ArrayNode:qa,ConstantNode:ui,FunctionNode:li,IndexNode:za,ObjectNode:Ra,OperatorNode:Bn,ParenthesisNode:Qi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Kr,mathWithTransform:Ia,matrix:we,multiply:ct,parse:pn,pow:kr,simplify:zu,simplifyConstant:cf,simplifyCore:lf,subtract:Dt,typed:K}),cj=X9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Qi,SymbolNode:ci,config:ve,equal:Br,isZero:Kr,numeric:Pr,parse:pn,simplify:zu,typed:K}),lj=QB({Help:ub,mathWithTransform:Ia,typed:K});Ot(ka,{e:E0,false:zI,fineStructure:jI,i:d1,Infinity:LI,LN10:PI,LOG10E:VI,NaN:UI,null:$I,phi:HI,SQRT1_2:GI,sackurTetrode:KI,tau:g1,true:WI,E:E0,version:QI,efimovFactor:ZI,LN2:XI,pi:Yc,replacer:YI,reviver:nj,SQRT2:eR,typed:K,unaryPlus:Ul,PI:Yc,weakMixingAngle:tR,abs:fr,acos:rR,acot:nR,acsc:iR,addScalar:Rt,arg:aR,asech:oR,asinh:sR,atan:v1,atanh:uR,bignumber:ir,bitNot:cR,boolean:lR,clone:fR,combinations:Ou,complex:Bu,conj:$i,cos:$l,cot:pR,csc:mR,cube:dR,equalScalar:Xe,erf:hR,exp:y1,expm1:gR,filter:vR,forEach:yR,format:_o,getMatrixDataType:Hl,hex:bR,im:Jl,isInteger:dr,isNegative:oi,isPositive:Hi,isZero:Kr,LOG2E:xR,lgamma:wR,log10:NR,log2:b1,map:Ji,multiplyScalar:At,not:ru,number:Tn,oct:DR,pickRandom:ER,print:AR,random:SR,re:Gl,sec:CR,sign:x1,sin:ku,splitUnit:MR,square:_R,string:FR,subtractScalar:Or,tan:TR,typeOf:w1,acosh:OR,acsch:BR,apply:Kl,asec:kR,bin:IR,chain:ab,combinationsWithRep:RR,cosh:qR,csch:zR,isNaN:Fo,isPrime:jR,randomInt:LR,sech:PR,sinh:VR,sparse:UR,sqrt:Wr,tanh:$R,unaryMinus:ln,acoth:HR,coth:JR,fraction:Ba,isNumeric:Gi,matrix:we,matrixFromFunction:GR,mode:KR,numeric:Pr,prod:N1,reshape:D1,size:Gt,squeeze:WR,transpose:To,xgcd:E1,zeros:Ut,asin:QR,cbrt:A1,concat:it,count:ZR,ctranspose:Wl,diag:S1,divideScalar:Nt,dotDivide:Oo,equal:Br,flatten:Bo,hasNumericValue:XR,identity:si,kron:YR,largerEq:Iu,leftShift:eq,lsolve:C1,matrixFromColumns:Ql,nthRoot:tq,ones:rq,qr:Zl,resize:nq,rightArithShift:iq,round:tn,smaller:ar,subtract:Dt,to:aq,unequal:oq,usolve:Xl,xor:sq,add:rt,atan2:uq,bitAnd:cq,bitOr:lq,bitXor:fq,catalan:pq,compare:Ki,compareText:M1,cumsum:mq,deepEqual:Yl,diff:dq,distance:hq,dot:Ru,equalText:gq,floor:_1,gcd:vq,hypot:yq,larger:or,log:ef,lsolveAll:bq,matrixFromRows:xq,min:wq,mod:T1,multiply:ct,nthRoots:Nq,or:Dq,partitionSelect:qu,rightLogShift:Eq,slu:O1,subset:Dr,sum:tf,trace:Aq,usolveAll:B1,zpk2tf:Sq,ceil:rf,compareNatural:fn,composition:Cq,cross:Mq,det:k1,dotMultiply:_q,fix:R1,index:q1,intersect:Fq,invmod:Tq,lcm:Oq,log1p:Bq,max:nf,setCartesian:kq,setDistinct:Iq,setIsSubset:Rq,setPowerset:qq,smallerEq:wa,sort:zq,and:jq,range:Na,row:Lq,setDifference:z1,setMultiplicity:Pq,setSymDifference:j1,column:P1,inv:Wi,lup:V1,pinv:Vq,pow:kr,setIntersect:U1,setUnion:Uq,sqrtm:$q,vacuumImpedance:Hq,wienDisplacement:Jq,atomicMass:Gq,bohrMagneton:Kq,boltzmann:Wq,conductanceQuantum:Qq,coulomb:Zq,deuteronMass:Xq,dotPow:Yq,electricConstant:ez,elementaryCharge:tz,expm:rz,faraday:nz,fft:$1,gamma:af,gravitationConstant:iz,hartreeEnergy:az,ifft:oz,klitzing:sz,loschmidt:uz,magneticConstant:cz,molarMass:lz,molarPlanckConstant:fz,neutronMass:pz,nuclearMagneton:mz,planckCharge:dz,planckLength:hz,planckTemperature:gz,protonMass:vz,quantumOfCirculation:yz,reducedPlanckConstant:bz,rydberg:xz,secondRadiation:wz,speedOfLight:Nz,stefanBoltzmann:Dz,thomsonCrossSection:Ez,avogadro:Az,bohrRadius:Sz,createUnit:Cz,divide:jt,electronMass:Mz,factorial:ko,firstRadiation:_z,gravity:Fz,inverseConductanceQuantum:Tz,lusolve:H1,magneticFluxQuantum:Oz,molarMassC12:Bz,multinomial:kz,parse:pn,permutations:Iz,planckMass:Rz,polynomialRoot:qz,resolve:sb,setSize:zz,simplifyConstant:cf,solveODE:jz,stirlingS2:J1,unit:Lz,bellNumbers:Pz,compile:ij,eigs:G1,fermiCoupling:Vz,gasConstant:Uz,kldivergence:$z,mean:K1,molarVolume:Hz,planckConstant:Jz,quantileSeq:Gz,simplifyCore:lf,variance:of,classicalElectronRadius:Kz,evaluate:ff,median:W1,simplify:zu,symbolicEqual:aj,corr:Wz,freqz:Qz,leafCount:oj,mad:Zz,parser:sj,rationalize:uj,std:Xz,zeta:Yz,derivative:cj,norm:sf,rotationMatrix:Q1,help:lj,planckTime:ej,schur:Z1,rotate:tj,sylvester:X1,lyap:rj,config:ve});Ot(Ia,ka,{filter:Bk({typed:K}),forEach:Rk({typed:K}),map:Vk({typed:K}),apply:Ck({isInteger:dr,typed:K}),or:TI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K}),and:MI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:ru,typed:K,zeros:Ut}),concat:cI({isInteger:dr,matrix:we,typed:K}),max:Hk({config:ve,larger:or,numeric:Pr,typed:K}),print:AI({add:rt,matrix:we,typed:K,zeros:Ut}),bitAnd:kI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:ru,typed:K,zeros:Ut}),diff:fI({bignumber:ir,matrix:we,number:Tn,subtract:Dt,typed:K}),min:Zk({config:ve,numeric:Pr,smaller:ar,typed:K}),subset:oI({add:rt,matrix:we,typed:K,zeros:Ut}),bitOr:qI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:K}),cumsum:wI({add:rt,typed:K,unaryPlus:Ul}),index:jk({Index:Xt,getMatrixDataType:Hl}),sum:gI({add:rt,config:ve,numeric:Pr,typed:K}),range:eI({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Hi,larger:or,largerEq:Iu,smaller:ar,smallerEq:wa,typed:K}),row:nI({Index:Xt,matrix:we,range:Na,typed:K}),column:Fk({Index:Xt,matrix:we,range:Na,typed:K}),mean:Kk({add:rt,divide:jt,typed:K}),quantileSeq:bI({add:rt,bignumber:ir,compare:Ki,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:qu,smaller:ar,smallerEq:wa,subtract:Dt,typed:K}),variance:DI({add:rt,apply:Kl,divide:jt,isNaN:Fo,multiply:ct,subtract:Dt,typed:K}),std:dI({map:Ji,sqrt:Wr,typed:K,variance:of})});Ot(Y1,{BigNumber:Ae,Complex:ht,Fraction:Ui,Matrix:Tu,Node:tr,ObjectNode:Ra,OperatorNode:Bn,ParenthesisNode:Qi,Range:JI,RelationalNode:eb,ResultSet:h1,ArrayNode:qa,BlockNode:tb,ConditionalNode:rb,ConstantNode:ui,DenseMatrix:He,RangeNode:nb,Chain:uf,FunctionAssignmentNode:ib,SparseMatrix:On,IndexNode:za,ImmutableDenseMatrix:F1,Index:Xt,AccessorNode:ja,AssignmentNode:ob,FibonacciHeap:I1,Spa:L1,Unit:qe,SymbolNode:ci,FunctionNode:li,Help:ub,Parser:cb});uf.createProxy(ka);function lb(e,t){return function(){return e.apply(t,arguments)}}const{toString:fj}=Object.prototype,{getPrototypeOf:pf}=Object,ju=(e=>t=>{const r=fj.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Qr=e=>(e=e.toLowerCase(),t=>ju(t)===e),Lu=e=>t=>typeof t===e,{isArray:La}=Array,ho=Lu("undefined");function pj(e){return e!==null&&!ho(e)&&e.constructor!==null&&!ho(e.constructor)&&xr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fb=Qr("ArrayBuffer");function mj(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fb(e.buffer),t}const dj=Lu("string"),xr=Lu("function"),pb=Lu("number"),Pu=e=>e!==null&&typeof e=="object",hj=e=>e===!0||e===!1,Ds=e=>{if(ju(e)!=="object")return!1;const t=pf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},gj=Qr("Date"),vj=Qr("File"),yj=Qr("Blob"),bj=Qr("FileList"),xj=e=>Pu(e)&&xr(e.pipe),wj=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xr(e.append)&&((t=ju(e))==="formdata"||t==="object"&&xr(e.toString)&&e.toString()==="[object FormData]"))},Nj=Qr("URLSearchParams"),[Dj,Ej,Aj,Sj]=["ReadableStream","Request","Response","Headers"].map(Qr),Cj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Io(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),La(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let u;for(n=0;n<o;n++)u=a[n],t.call(null,e[u],u,e)}}function mb(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Di=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,db=e=>!ho(e)&&e!==Di;function el(){const{caseless:e}=db(this)&&this||{},t={},r=(n,i)=>{const a=e&&mb(t,i)||i;Ds(t[a])&&Ds(n)?t[a]=el(t[a],n):Ds(n)?t[a]=el({},n):La(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Io(arguments[n],r);return t}const Mj=(e,t,r,{allOwnKeys:n}={})=>(Io(t,(i,a)=>{r&&xr(i)?e[a]=lb(i,r):e[a]=i},{allOwnKeys:n}),e),_j=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Fj=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Tj=(e,t,r,n)=>{let i,a,o;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!u[o]&&(t[o]=e[o],u[o]=!0);e=r!==!1&&pf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Oj=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Bj=e=>{if(!e)return null;if(La(e))return e;let t=e.length;if(!pb(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},kj=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&pf(Uint8Array)),Ij=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},Rj=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},qj=Qr("HTMLFormElement"),zj=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),A0=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),jj=Qr("RegExp"),hb=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Io(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},Lj=e=>{hb(e,(t,r)=>{if(xr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(xr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pj=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return La(e)?n(e):n(String(e).split(t)),r},Vj=()=>{},Uj=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,xc="abcdefghijklmnopqrstuvwxyz",S0="0123456789",gb={DIGIT:S0,ALPHA:xc,ALPHA_DIGIT:xc+xc.toUpperCase()+S0},$j=(e=16,t=gb.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Hj(e){return!!(e&&xr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Jj=e=>{const t=new Array(10),r=(n,i)=>{if(Pu(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=La(n)?[]:{};return Io(n,(o,u)=>{const c=r(o,i+1);!ho(c)&&(a[u]=c)}),t[i]=void 0,a}}return n};return r(e,0)},Gj=Qr("AsyncFunction"),Kj=e=>e&&(Pu(e)||xr(e))&&xr(e.then)&&xr(e.catch),vb=((e,t)=>e?setImmediate:t?((r,n)=>(Di.addEventListener("message",({source:i,data:a})=>{i===Di&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Di.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",xr(Di.postMessage)),Wj=typeof queueMicrotask<"u"?queueMicrotask.bind(Di):typeof process<"u"&&process.nextTick||vb,ge={isArray:La,isArrayBuffer:fb,isBuffer:pj,isFormData:wj,isArrayBufferView:mj,isString:dj,isNumber:pb,isBoolean:hj,isObject:Pu,isPlainObject:Ds,isReadableStream:Dj,isRequest:Ej,isResponse:Aj,isHeaders:Sj,isUndefined:ho,isDate:gj,isFile:vj,isBlob:yj,isRegExp:jj,isFunction:xr,isStream:xj,isURLSearchParams:Nj,isTypedArray:kj,isFileList:bj,forEach:Io,merge:el,extend:Mj,trim:Cj,stripBOM:_j,inherits:Fj,toFlatObject:Tj,kindOf:ju,kindOfTest:Qr,endsWith:Oj,toArray:Bj,forEachEntry:Ij,matchAll:Rj,isHTMLForm:qj,hasOwnProperty:A0,hasOwnProp:A0,reduceDescriptors:hb,freezeMethods:Lj,toObjectSet:Pj,toCamelCase:zj,noop:Vj,toFiniteNumber:Uj,findKey:mb,global:Di,isContextDefined:db,ALPHABET:gb,generateString:$j,isSpecCompliantForm:Hj,toJSONObject:Jj,isAsyncFn:Gj,isThenable:Kj,setImmediate:vb,asap:Wj};function Ke(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(Ke,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ge.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const yb=Ke.prototype,bb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{bb[e]={value:e}});Object.defineProperties(Ke,bb);Object.defineProperty(yb,"isAxiosError",{value:!0});Ke.from=(e,t,r,n,i,a)=>{const o=Object.create(yb);return ge.toFlatObject(e,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError"),Ke.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const Qj=null;function tl(e){return ge.isPlainObject(e)||ge.isArray(e)}function xb(e){return ge.endsWith(e,"[]")?e.slice(0,-2):e}function C0(e,t,r){return e?e.concat(t).map(function(n,i){return n=xb(n),!r&&i?"["+n+"]":n}).join(r?".":""):t}function Zj(e){return ge.isArray(e)&&!e.some(tl)}const Xj=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function Vu(e,t,r){if(!ge.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!ge.isUndefined(d[m])});const n=r.metaTokens,i=r.visitor||l,a=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&ge.isSpecCompliantForm(t);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(ge.isDate(m))return m.toISOString();if(!u&&ge.isBlob(m))throw new Ke("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(m)||ge.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,d,h){let w=m;if(m&&!h&&typeof m=="object"){if(ge.endsWith(d,"{}"))d=n?d:d.slice(0,-2),m=JSON.stringify(m);else if(ge.isArray(m)&&Zj(m)||(ge.isFileList(m)||ge.endsWith(d,"[]"))&&(w=ge.toArray(m)))return d=xb(d),w.forEach(function(v,x){!(ge.isUndefined(v)||v===null)&&t.append(o===!0?C0([d],x,a):o===null?d:d+"[]",c(v))}),!1}return tl(m)?!0:(t.append(C0(h,d,a),c(m)),!1)}const s=[],f=Object.assign(Xj,{defaultVisitor:l,convertValue:c,isVisitable:tl});function p(m,d){if(!ge.isUndefined(m)){if(s.indexOf(m)!==-1)throw Error("Circular reference detected in "+d.join("."));s.push(m),ge.forEach(m,function(h,w){(!(ge.isUndefined(h)||h===null)&&i.call(t,h,ge.isString(w)?w.trim():w,d,f))===!0&&p(h,d?d.concat(w):[w])}),s.pop()}}if(!ge.isObject(e))throw new TypeError("data must be an object");return p(e),t}function M0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function mf(e,t){this._pairs=[],e&&Vu(e,this,t)}const wb=mf.prototype;wb.append=function(e,t){this._pairs.push([e,t])};wb.toString=function(e){const t=e?function(r){return e.call(this,r,M0)}:M0;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function Yj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nb(e,t,r){if(!t)return e;const n=r&&r.encode||Yj,i=r&&r.serialize;let a;if(i?a=i(t,r):a=ge.isURLSearchParams(t)?t.toString():new mf(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class _0{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ge.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Db={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eL=typeof URLSearchParams<"u"?URLSearchParams:mf,tL=typeof FormData<"u"?FormData:null,rL=typeof Blob<"u"?Blob:null,nL={isBrowser:!0,classes:{URLSearchParams:eL,FormData:tL,Blob:rL},protocols:["http","https","file","blob","url","data"]},df=typeof window<"u"&&typeof document<"u",iL=(e=>df&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),aL=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",oL=df&&window.location.href||"http://localhost",sL=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:df,hasStandardBrowserEnv:iL,hasStandardBrowserWebWorkerEnv:aL,origin:oL},Symbol.toStringTag,{value:"Module"})),Vr={...sL,...nL};function uL(e,t){return Vu(e,new Vr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Vr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function cL(e){return ge.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function lL(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function Eb(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;const u=Number.isFinite(+o),c=a>=r.length;return o=!o&&ge.isArray(i)?i.length:o,c?(ge.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!u):((!i[o]||!ge.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&ge.isArray(i[o])&&(i[o]=lL(i[o])),!u)}if(ge.isFormData(e)&&ge.isFunction(e.entries)){const r={};return ge.forEachEntry(e,(n,i)=>{t(cL(n),i,r,0)}),r}return null}function fL(e,t,r){if(ge.isString(e))try{return(t||JSON.parse)(e),ge.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Ro={transitional:Db,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=ge.isObject(e);if(i&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return n?JSON.stringify(Eb(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e)||ge.isReadableStream(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return uL(e,this.formSerializer).toString();if((a=ge.isFileList(e))||r.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Vu(a?{"files[]":e}:e,o&&new o,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),fL(e)):e}],transformResponse:[function(e){const t=this.transitional||Ro.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(ge.isResponse(e)||ge.isReadableStream(e))return e;if(e&&ge.isString(e)&&(r&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?Ke.from(a,Ke.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ge.forEach(["delete","get","head","post","put","patch"],e=>{Ro.headers[e]={}});const pL=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mL=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
72
|
+
`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&pL[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},F0=Symbol("internals");function Wa(e){return e&&String(e).trim().toLowerCase()}function Es(e){return e===!1||e==null?e:ge.isArray(e)?e.map(Es):String(e)}function dL(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const hL=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function wc(e,t,r,n,i){if(ge.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!ge.isString(t)){if(ge.isString(n))return t.indexOf(n)!==-1;if(ge.isRegExp(n))return n.test(t)}}function gL(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function vL(e,t){const r=ge.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}class hr{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(u,c,l){const s=Wa(c);if(!s)throw new Error("header name must be a non-empty string");const f=ge.findKey(i,s);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||c]=Es(u))}const o=(u,c)=>ge.forEach(u,(l,s)=>a(l,s,c));if(ge.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(ge.isString(t)&&(t=t.trim())&&!hL(t))o(mL(t),r);else if(ge.isHeaders(t))for(const[u,c]of t.entries())a(c,u,n);else t!=null&&a(r,t,n);return this}get(t,r){if(t=Wa(t),t){const n=ge.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return dL(i);if(ge.isFunction(r))return r.call(this,i,n);if(ge.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Wa(t),t){const n=ge.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||wc(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=Wa(o),o){const u=ge.findKey(n,o);u&&(!r||wc(n,n[u],u,r))&&(delete n[u],i=!0)}}return ge.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||wc(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return ge.forEach(this,(i,a)=>{const o=ge.findKey(n,a);if(o){r[o]=Es(i),delete r[a];return}const u=t?gL(a):String(a).trim();u!==a&&delete r[a],r[u]=Es(i),n[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return ge.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&ge.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
73
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const r=(this[F0]=this[F0]={accessors:{}}).accessors,n=this.prototype;function i(a){const o=Wa(a);r[o]||(vL(n,a),r[o]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}}hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ge.reduceDescriptors(hr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});ge.freezeMethods(hr);function Nc(e,t){const r=this||Ro,n=t||r,i=hr.from(n.headers);let a=n.data;return ge.forEach(e,function(o){a=o.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Ab(e){return!!(e&&e.__CANCEL__)}function Pa(e,t,r){Ke.call(this,e??"canceled",Ke.ERR_CANCELED,t,r),this.name="CanceledError"}ge.inherits(Pa,Ke,{__CANCEL__:!0});function Sb(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Ke("Request failed with status code "+r.status,[Ke.ERR_BAD_REQUEST,Ke.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function yL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bL(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),l=n[a];o||(o=c),r[i]=u,n[i]=c;let s=a,f=0;for(;s!==i;)f+=r[s++],s=s%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(f*1e3/p):void 0}}function xL(e,t){let r=0,n=1e3/t,i,a;const o=(u,c=Date.now())=>{r=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),l=c-r;l>=n?o(u,c):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-l)))},()=>i&&o(i)]}const nu=(e,t,r=3)=>{let n=0;const i=bL(50,250);return xL(a=>{const o=a.loaded,u=a.lengthComputable?a.total:void 0,c=o-n,l=i(c),s=o<=u;n=o;const f={loaded:o,total:u,progress:u?o/u:void 0,bytes:c,rate:l||void 0,estimated:l&&u&&s?(u-o)/l:void 0,event:a,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(f)},r)},T0=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},O0=e=>(...t)=>ge.asap(()=>e(...t)),wL=Vr.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(i){let a=i;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(i){const a=ge.isString(i)?n(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),NL=Vr.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];ge.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),ge.isString(n)&&o.push("path="+n),ge.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function DL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function EL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Cb(e,t){return e&&!DL(t)?EL(e,t):t}const B0=e=>e instanceof hr?{...e}:e;function Ii(e,t){t=t||{};const r={};function n(l,s,f){return ge.isPlainObject(l)&&ge.isPlainObject(s)?ge.merge.call({caseless:f},l,s):ge.isPlainObject(s)?ge.merge({},s):ge.isArray(s)?s.slice():s}function i(l,s,f){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l,f)}else return n(l,s,f)}function a(l,s){if(!ge.isUndefined(s))return n(void 0,s)}function o(l,s){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l)}else return n(void 0,s)}function u(l,s,f){if(f in t)return n(l,s);if(f in e)return n(void 0,l)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(l,s)=>i(B0(l),B0(s),!0)};return ge.forEach(Object.keys(Object.assign({},e,t)),function(l){const s=c[l]||i,f=s(e[l],t[l],l);ge.isUndefined(f)&&s!==u||(r[l]=f)}),r}const Mb=e=>{const t=Ii({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:u}=t;t.headers=o=hr.from(o),t.url=Nb(Cb(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(ge.isFormData(r)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...s]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...s].join("; "))}}if(Vr.hasStandardBrowserEnv&&(n&&ge.isFunction(n)&&(n=n(t)),n||n!==!1&&wL(t.url))){const l=i&&a&&NL.read(a);l&&o.set(i,l)}return t},AL=typeof XMLHttpRequest<"u",SL=AL&&function(e){return new Promise(function(t,r){const n=Mb(e);let i=n.data;const a=hr.from(n.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:c}=n,l,s,f,p,m;function d(){p&&p(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout;function w(){if(!h)return;const x=hr.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),g={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};Sb(function(b){t(b),d()},function(b){r(b),d()},g),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(r(new Ke("Request aborted",Ke.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new Ke("Network Error",Ke.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let x=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const g=n.transitional||Db;n.timeoutErrorMessage&&(x=n.timeoutErrorMessage),r(new Ke(x,g.clarifyTimeoutError?Ke.ETIMEDOUT:Ke.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),"setRequestHeader"in h&&ge.forEach(a.toJSON(),function(x,g){h.setRequestHeader(g,x)}),ge.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),o&&o!=="json"&&(h.responseType=n.responseType),c&&([f,m]=nu(c,!0),h.addEventListener("progress",f)),u&&h.upload&&([s,p]=nu(u),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(l=x=>{h&&(r(!x||x.type?new Pa(null,e,h):x),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const v=yL(n.url);if(v&&Vr.protocols.indexOf(v)===-1){r(new Ke("Unsupported protocol "+v+":",Ke.ERR_BAD_REQUEST,e));return}h.send(i||null)})},CL=(e,t)=>{let r=new AbortController,n;const i=function(c){if(!n){n=!0,o();const l=c instanceof Error?c:this.reason;r.abort(l instanceof Ke?l:new Pa(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{i(new Ke(`timeout ${t} of ms exceeded`,Ke.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",i):c.unsubscribe(i))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=o,[u,()=>{a&&clearTimeout(a),a=null}]},ML=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},_L=async function*(e,t,r){for await(const n of e)yield*ML(ArrayBuffer.isView(n)?n:await r(String(n)),t)},k0=(e,t,r,n,i)=>{const a=_L(e,t,i);let o=0,u,c=l=>{u||(u=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:s,value:f}=await a.next();if(s){c(),l.close();return}let p=f.byteLength;if(r){let m=o+=p;r(m)}l.enqueue(new Uint8Array(f))}catch(s){throw c(s),s}},cancel(l){return c(l),a.return()}},{highWaterMark:2})},Uu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_b=Uu&&typeof ReadableStream=="function",rl=Uu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Fb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},FL=_b&&Fb(()=>{let e=!1;const t=new Request(Vr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),I0=64*1024,nl=_b&&Fb(()=>ge.isReadableStream(new Response("").body)),iu={stream:nl&&(e=>e.body)};Uu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!iu[t]&&(iu[t]=ge.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Ke(`Response type '${t}' is not supported`,Ke.ERR_NOT_SUPPORT,n)})})})(new Response);const TL=async e=>{if(e==null)return 0;if(ge.isBlob(e))return e.size;if(ge.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ge.isArrayBufferView(e)||ge.isArrayBuffer(e))return e.byteLength;if(ge.isURLSearchParams(e)&&(e=e+""),ge.isString(e))return(await rl(e)).byteLength},OL=async(e,t)=>ge.toFiniteNumber(e.getContentLength())??TL(t),BL=Uu&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:u,onUploadProgress:c,responseType:l,headers:s,withCredentials:f="same-origin",fetchOptions:p}=Mb(e);l=l?(l+"").toLowerCase():"text";let[m,d]=i||a||o?CL([i,a],o):[],h,w;const v=()=>{!h&&setTimeout(()=>{m&&m.unsubscribe()}),h=!0};let x;try{if(c&&FL&&r!=="get"&&r!=="head"&&(x=await OL(s,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),E;if(ge.isFormData(n)&&(E=N.headers.get("content-type"))&&s.setContentType(E),N.body){const[A,D]=T0(x,nu(O0(c)));n=k0(N.body,I0,A,D,rl)}}ge.isString(f)||(f=f?"include":"omit"),w=new Request(t,{...p,signal:m,method:r.toUpperCase(),headers:s.normalize().toJSON(),body:n,duplex:"half",credentials:f});let g=await fetch(w);const b=nl&&(l==="stream"||l==="response");if(nl&&(u||b)){const N={};["status","statusText","headers"].forEach(S=>{N[S]=g[S]});const E=ge.toFiniteNumber(g.headers.get("content-length")),[A,D]=u&&T0(E,nu(O0(u),!0))||[];g=new Response(k0(g.body,I0,A,()=>{D&&D(),b&&v()},rl),N)}l=l||"text";let y=await iu[ge.findKey(iu,l)||"text"](g,e);return!b&&v(),d&&d(),await new Promise((N,E)=>{Sb(N,E,{data:y,headers:hr.from(g.headers),status:g.status,statusText:g.statusText,config:e,request:w})})}catch(g){throw v(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new Ke("Network Error",Ke.ERR_NETWORK,e,w),{cause:g.cause||g}):Ke.from(g,g&&g.code,e,w)}}),il={http:Qj,xhr:SL,fetch:BL};ge.forEach(il,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const R0=e=>`- ${e}`,kL=e=>ge.isFunction(e)||e===null||e===!1,Tb={getAdapter:e=>{e=ge.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a<t;a++){r=e[a];let o;if(n=r,!kL(r)&&(n=il[(o=String(r)).toLowerCase()],n===void 0))throw new Ke(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){const a=Object.entries(i).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
74
|
+
`+a.map(R0).join(`
|
|
75
|
+
`):" "+R0(a[0]):"as no adapter specified";throw new Ke("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:il};function Dc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pa(null,e)}function q0(e){return Dc(e),e.headers=hr.from(e.headers),e.data=Nc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tb.getAdapter(e.adapter||Ro.adapter)(e).then(function(t){return Dc(e),t.data=Nc.call(e,e.transformResponse,t),t.headers=hr.from(t.headers),t},function(t){return Ab(t)||(Dc(e),t&&t.response&&(t.response.data=Nc.call(e,e.transformResponse,t.response),t.response.headers=hr.from(t.response.headers))),Promise.reject(t)})}const Ob="1.7.4",hf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const z0={};hf.transitional=function(e,t,r){function n(i,a){return"[Axios v"+Ob+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,o)=>{if(e===!1)throw new Ke(n(a," has been removed"+(t?" in "+t:"")),Ke.ERR_DEPRECATED);return t&&!z0[a]&&(z0[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,o):!0}};function IL(e,t,r){if(typeof e!="object")throw new Ke("options must be an object",Ke.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const u=e[a],c=u===void 0||o(u,a,e);if(c!==!0)throw new Ke("option "+a+" must be "+c,Ke.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Ke("Unknown option "+a,Ke.ERR_BAD_OPTION)}}const al={assertOptions:IL,validators:hf},qn=al.validators;class Ai{constructor(t){this.defaults=t,this.interceptors={request:new _0,response:new _0}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
76
|
+
`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ii(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&al.assertOptions(n,{silentJSONParsing:qn.transitional(qn.boolean),forcedJSONParsing:qn.transitional(qn.boolean),clarifyTimeoutError:qn.transitional(qn.boolean)},!1),i!=null&&(ge.isFunction(i)?r.paramsSerializer={serialize:i}:al.assertOptions(i,{encode:qn.function,serialize:qn.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&ge.merge(a.common,a[r.method]);a&&ge.forEach(["delete","get","head","post","put","patch","common"],d=>{delete a[d]}),r.headers=hr.concat(o,a);const u=[];let c=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(c=c&&d.synchronous,u.unshift(d.fulfilled,d.rejected))});const l=[];this.interceptors.response.forEach(function(d){l.push(d.fulfilled,d.rejected)});let s,f=0,p;if(!c){const d=[q0.bind(this),void 0];for(d.unshift.apply(d,u),d.push.apply(d,l),p=d.length,s=Promise.resolve(r);f<p;)s=s.then(d[f++],d[f++]);return s}p=u.length;let m=r;for(f=0;f<p;){const d=u[f++],h=u[f++];try{m=d(m)}catch(w){h.call(this,w);break}}try{s=q0.call(this,m)}catch(d){return Promise.reject(d)}for(f=0,p=l.length;f<p;)s=s.then(l[f++],l[f++]);return s}getUri(t){t=Ii(this.defaults,t);const r=Cb(t.baseURL,t.url);return Nb(r,t.params,t.paramsSerializer)}}ge.forEach(["delete","get","head","options"],function(e){Ai.prototype[e]=function(t,r){return this.request(Ii(r||{},{method:e,url:t,data:(r||{}).data}))}});ge.forEach(["post","put","patch"],function(e){function t(r){return function(n,i,a){return this.request(Ii(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Ai.prototype[e]=t(),Ai.prototype[e+"Form"]=t(!0)});class gf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(u=>{n.subscribe(u),a=u}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(i,a,o){n.reason||(n.reason=new Pa(i,a,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new gf(function(r){t=r}),cancel:t}}}function RL(e){return function(t){return e.apply(null,t)}}function qL(e){return ge.isObject(e)&&e.isAxiosError===!0}const ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ol).forEach(([e,t])=>{ol[t]=e});function Bb(e){const t=new Ai(e),r=lb(Ai.prototype.request,t);return ge.extend(r,Ai.prototype,t,{allOwnKeys:!0}),ge.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Bb(Ii(e,n))},r}const Ft=Bb(Ro);Ft.Axios=Ai;Ft.CanceledError=Pa;Ft.CancelToken=gf;Ft.isCancel=Ab;Ft.VERSION=Ob;Ft.toFormData=Vu;Ft.AxiosError=Ke;Ft.Cancel=Ft.CanceledError;Ft.all=function(e){return Promise.all(e)};Ft.spread=RL;Ft.isAxiosError=qL;Ft.mergeConfig=Ii;Ft.AxiosHeaders=hr;Ft.formToJSON=e=>Eb(ge.isHTMLForm(e)?new FormData(e):e);Ft.getAdapter=Tb.getAdapter;Ft.HttpStatusCode=ol;Ft.default=Ft;/**
|
|
77
77
|
* @vue/shared v3.4.38
|
|
78
78
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
79
79
|
* @license MIT
|
|
80
|
-
**//*! #__NO_SIDE_EFFECTS__ */function
|
|
80
|
+
**//*! #__NO_SIDE_EFFECTS__ */function Va(e,t){const r=new Set(e.split(","));return n=>r.has(n)}const vt=process.env.NODE_ENV!=="production"?Object.freeze({}):{},la=process.env.NODE_ENV!=="production"?Object.freeze([]):[],St=()=>{},zL=()=>!1,qo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),au=e=>e.startsWith("onUpdate:"),Et=Object.assign,vf=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},jL=Object.prototype.hasOwnProperty,tt=(e,t)=>jL.call(e,t),Oe=Array.isArray,Si=e=>$u(e)==="[object Map]",kb=e=>$u(e)==="[object Set]",Be=e=>typeof e=="function",xt=e=>typeof e=="string",fi=e=>typeof e=="symbol",lt=e=>e!==null&&typeof e=="object",yf=e=>(lt(e)||Be(e))&&Be(e.then)&&Be(e.catch),Ib=Object.prototype.toString,$u=e=>Ib.call(e),bf=e=>$u(e).slice(8,-1),Rb=e=>$u(e)==="[object Object]",xf=e=>xt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ao=Va(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),LL=Va("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Hu=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},PL=/-(\w)/g,wr=Hu(e=>e.replace(PL,(t,r)=>r?r.toUpperCase():"")),VL=/\B([A-Z])/g,Cn=Hu(e=>e.replace(VL,"-$1").toLowerCase()),Ri=Hu(e=>e.charAt(0).toUpperCase()+e.slice(1)),yi=Hu(e=>e?`on${Ri(e)}`:""),ei=(e,t)=>!Object.is(e,t),Qa=(e,...t)=>{for(let r=0;r<e.length;r++)e[r](...t)},ou=(e,t,r,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:r})},UL=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$L=e=>{const t=xt(e)?Number(e):NaN;return isNaN(t)?e:t};let j0;const wf=()=>j0||(j0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zo(e){if(Oe(e)){const t={};for(let r=0;r<e.length;r++){const n=e[r],i=xt(n)?KL(n):zo(n);if(i)for(const a in i)t[a]=i[a]}return t}else if(xt(e)||lt(e))return e}const HL=/;(?![^(]*\))/g,JL=/:([^]+)/,GL=/\/\*[^]*?\*\//g;function KL(e){const t={};return e.replace(GL,"").split(HL).forEach(r=>{if(r){const n=r.split(JL);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Rr(e){let t="";if(xt(e))t=e;else if(Oe(e))for(let r=0;r<e.length;r++){const n=Rr(e[r]);n&&(t+=n+" ")}else if(lt(e))for(const r in e)e[r]&&(t+=r+" ");return t.trim()}const WL="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",QL=Va(WL);function qb(e){return!!e||e===""}const zb=e=>!!(e&&e.__v_isRef===!0),Nf=e=>xt(e)?e:e==null?"":Oe(e)||lt(e)&&(e.toString===Ib||!Be(e.toString))?zb(e)?Nf(e.value):JSON.stringify(e,jb,2):String(e),jb=(e,t)=>zb(t)?jb(e,t.value):Si(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[n,i],a)=>(r[Ec(n,a)+" =>"]=i,r),{})}:kb(t)?{[`Set(${t.size})`]:[...t.values()].map(r=>Ec(r))}:fi(t)?Ec(t):lt(t)&&!Oe(t)&&!Rb(t)?String(t):t,Ec=(e,t="")=>{var r;return fi(e)?`Symbol(${(r=e.description)!=null?r:t})`:e};/**
|
|
81
81
|
* @vue/reactivity v3.4.38
|
|
82
82
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
83
83
|
* @license MIT
|
|
84
|
-
**/function Mn(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let yr;class VL{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=yr,!t&&yr&&(this.index=(yr.scopes||(yr.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const r=yr;try{return yr=this,t()}finally{yr=r}}else process.env.NODE_ENV!=="production"&&Mn("cannot run an inactive effect scope.")}on(){yr=this}off(){yr=this.parent}stop(t){if(this._active){let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.scopes)for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function UL(e,t=yr){t&&t.active&&t.effects.push(e)}function Tb(){return yr}function $L(e){yr?yr.cleanups.push(e):process.env.NODE_ENV!=="production"&&Mn("onScopeDispose() is called when there is no active effect scope to be associated with.")}let Si;class vf{constructor(t,r,n,i){this.fn=t,this.trigger=r,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,UL(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,kn();for(let t=0;t<this._depsLength;t++){const r=this.deps[t];if(r.computed&&(HL(r.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),In()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Qn,r=Si;try{return Qn=!0,Si=this,this._runnings++,O0(this),this.fn()}finally{B0(this),this._runnings--,Si=r,Qn=t}}stop(){this.active&&(O0(this),B0(this),this.onStop&&this.onStop(),this.active=!1)}}function HL(e){return e.value}function O0(e){e._trackId++,e._depsLength=0}function B0(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Ob(e.deps[t],e);e.deps.length=e._depsLength}}function Ob(e,t){const r=e.get(t);r!==void 0&&t._trackId!==r&&(e.delete(t),e.size===0&&e.cleanup())}let Qn=!0,rl=0;const Bb=[];function kn(){Bb.push(Qn),Qn=!1}function In(){const e=Bb.pop();Qn=e===void 0?!0:e}function yf(){rl++}function bf(){for(rl--;!rl&&nl.length;)nl.shift()()}function kb(e,t,r){var n;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const i=e.deps[e._depsLength];i!==t?(i&&Ob(i,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((n=e.onTrack)==null||n.call(e,Et({effect:e},r)))}}const nl=[];function Ib(e,t,r){var n;yf();for(const i of e.keys()){let a;i._dirtyLevel<t&&(a??(a=e.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=t),i._shouldSchedule&&(a??(a=e.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((n=i.onTrigger)==null||n.call(i,Et({effect:i},r))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&nl.push(i.scheduler)))}bf()}const Rb=(e,t)=>{const r=new Map;return r.cleanup=e,r.computed=t,r},il=new WeakMap,Ci=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),al=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Ht(e,t,r){if(Qn&&Si){let n=il.get(e);n||il.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=Rb(()=>n.delete(r))),kb(Si,i,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r}:void 0)}}function nn(e,t,r,n,i,a){const o=il.get(e);if(!o)return;let u=[];if(t==="clear")u=[...o.values()];else if(r==="length"&&Oe(e)){const c=Number(n);o.forEach((l,s)=>{(s==="length"||!fi(s)&&s>=c)&&u.push(l)})}else switch(r!==void 0&&u.push(o.get(r)),t){case"add":Oe(e)?df(r)&&u.push(o.get("length")):(u.push(o.get(Ci)),Ai(e)&&u.push(o.get(al)));break;case"delete":Oe(e)||(u.push(o.get(Ci)),Ai(e)&&u.push(o.get(al)));break;case"set":Ai(e)&&u.push(o.get(Ci));break}yf();for(const c of u)c&&Ib(c,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a}:void 0);bf()}const JL=ja("__proto__,__v_isRef,__isVue"),qb=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fi)),k0=GL();function GL(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const n=Ye(this);for(let a=0,o=this.length;a<o;a++)Ht(n,"get",a+"");const i=n[t](...r);return i===-1||i===!1?n[t](...r.map(Ye)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...r){kn(),yf();const n=Ye(this)[t].apply(this,r);return bf(),In(),n}}),e}function WL(e){fi(e)||(e=String(e));const t=Ye(this);return Ht(t,"has",e),t.hasOwnProperty(e)}class zb{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){const i=this._isReadonly,a=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return a;if(r==="__v_raw")return n===(i?a?Hb:$b:a?Ub:Vb).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Oe(t);if(!i){if(o&&tt(k0,r))return Reflect.get(k0,r,n);if(r==="hasOwnProperty")return WL}const u=Reflect.get(t,r,n);return(fi(r)?qb.has(r):JL(r))||(i||Ht(t,"get",r),a)?u:Lt(u)?o&&df(r)?u:u.value:lt(u)?i?Nf(u):wf(u):u}}class jb extends zb{constructor(t=!1){super(!1,t)}set(t,r,n,i){let a=t[r];if(!this._isShallow){const c=_n(a);if(!Dn(n)&&!_n(n)&&(a=Ye(a),n=Ye(n)),!Oe(t)&&Lt(a)&&!Lt(n))return c?!1:(a.value=n,!0)}const o=Oe(t)&&df(r)?Number(r)<t.length:tt(t,r),u=Reflect.set(t,r,n,i);return t===Ye(i)&&(o?ei(n,a)&&nn(t,"set",r,n,a):nn(t,"add",r,n)),u}deleteProperty(t,r){const n=tt(t,r),i=t[r],a=Reflect.deleteProperty(t,r);return a&&n&&nn(t,"delete",r,void 0,i),a}has(t,r){const n=Reflect.has(t,r);return(!fi(r)||!qb.has(r))&&Ht(t,"has",r),n}ownKeys(t){return Ht(t,"iterate",Oe(t)?"length":Ci),Reflect.ownKeys(t)}}class Lb extends zb{constructor(t=!1){super(!0,t)}set(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const KL=new jb,QL=new Lb,ZL=new jb(!0),XL=new Lb(!0),xf=e=>e,Pu=e=>Reflect.getPrototypeOf(e);function ss(e,t,r=!1,n=!1){e=e.__v_raw;const i=Ye(e),a=Ye(t);r||(ei(t,a)&&Ht(i,"get",t),Ht(i,"get",a));const{has:o}=Pu(i),u=n?xf:r?Df:fo;if(o.call(i,t))return u(e.get(t));if(o.call(i,a))return u(e.get(a));e!==i&&e.get(t)}function us(e,t=!1){const r=this.__v_raw,n=Ye(r),i=Ye(e);return t||(ei(e,i)&&Ht(n,"has",e),Ht(n,"has",i)),e===i?r.has(e):r.has(e)||r.has(i)}function cs(e,t=!1){return e=e.__v_raw,!t&&Ht(Ye(e),"iterate",Ci),Reflect.get(e,"size",e)}function I0(e,t=!1){!t&&!Dn(e)&&!_n(e)&&(e=Ye(e));const r=Ye(this);return Pu(r).has.call(r,e)||(r.add(e),nn(r,"add",e,e)),this}function R0(e,t,r=!1){!r&&!Dn(t)&&!_n(t)&&(t=Ye(t));const n=Ye(this),{has:i,get:a}=Pu(n);let o=i.call(n,e);o?process.env.NODE_ENV!=="production"&&Pb(n,i,e):(e=Ye(e),o=i.call(n,e));const u=a.call(n,e);return n.set(e,t),o?ei(t,u)&&nn(n,"set",e,t,u):nn(n,"add",e,t),this}function q0(e){const t=Ye(this),{has:r,get:n}=Pu(t);let i=r.call(t,e);i?process.env.NODE_ENV!=="production"&&Pb(t,r,e):(e=Ye(e),i=r.call(t,e));const a=n?n.call(t,e):void 0,o=t.delete(e);return i&&nn(t,"delete",e,void 0,a),o}function z0(){const e=Ye(this),t=e.size!==0,r=process.env.NODE_ENV!=="production"?Ai(e)?new Map(e):new Set(e):void 0,n=e.clear();return t&&nn(e,"clear",void 0,void 0,r),n}function ls(e,t){return function(r,n){const i=this,a=i.__v_raw,o=Ye(a),u=t?xf:e?Df:fo;return!e&&Ht(o,"iterate",Ci),a.forEach((c,l)=>r.call(n,u(c),u(l),i))}}function fs(e,t,r){return function(...n){const i=this.__v_raw,a=Ye(i),o=Ai(a),u=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...n),s=r?xf:t?Df:fo;return!t&&Ht(a,"iterate",c?al:Ci),{next(){const{value:f,done:p}=l.next();return p?{value:f,done:p}:{value:u?[s(f[0]),s(f[1])]:s(f),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){if(process.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";Mn(`${ki(e)} operation ${r}failed: target is readonly.`,Ye(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function YL(){const e={get(i){return ss(this,i)},get size(){return cs(this)},has:us,add:I0,set:R0,delete:q0,clear:z0,forEach:ls(!1,!1)},t={get(i){return ss(this,i,!1,!0)},get size(){return cs(this)},has:us,add(i){return I0.call(this,i,!0)},set(i,a){return R0.call(this,i,a,!0)},delete:q0,clear:z0,forEach:ls(!1,!0)},r={get(i){return ss(this,i,!0)},get size(){return cs(this,!0)},has(i){return us.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:ls(!0,!1)},n={get(i){return ss(this,i,!0,!0)},get size(){return cs(this,!0)},has(i){return us.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:ls(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=fs(i,!1,!1),r[i]=fs(i,!0,!1),t[i]=fs(i,!1,!0),n[i]=fs(i,!0,!0)}),[e,r,t,n]}const[eP,tP,rP,nP]=YL();function Vu(e,t){const r=t?e?nP:rP:e?tP:eP;return(n,i,a)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(tt(r,i)&&i in n?r:n,i,a)}const iP={get:Vu(!1,!1)},aP={get:Vu(!1,!0)},oP={get:Vu(!0,!1)},sP={get:Vu(!0,!0)};function Pb(e,t,r){const n=Ye(r);if(n!==r&&t.call(e,n)){const i=mf(e);Mn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Vb=new WeakMap,Ub=new WeakMap,$b=new WeakMap,Hb=new WeakMap;function uP(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function cP(e){return e.__v_skip||!Object.isExtensible(e)?0:uP(mf(e))}function wf(e){return _n(e)?e:Uu(e,!1,KL,iP,Vb)}function Jb(e){return Uu(e,!1,ZL,aP,Ub)}function Nf(e){return Uu(e,!0,QL,oP,$b)}function rn(e){return Uu(e,!0,XL,sP,Hb)}function Uu(e,t,r,n,i){if(!lt(e))return process.env.NODE_ENV!=="production"&&Mn(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=i.get(e);if(a)return a;const o=cP(e);if(o===0)return e;const u=new Proxy(e,o===2?n:r);return i.set(e,u),u}function ua(e){return _n(e)?ua(e.__v_raw):!!(e&&e.__v_isReactive)}function _n(e){return!!(e&&e.__v_isReadonly)}function Dn(e){return!!(e&&e.__v_isShallow)}function ol(e){return e?!!e.__v_raw:!1}function Ye(e){const t=e&&e.__v_raw;return t?Ye(t):e}function lP(e){return Object.isExtensible(e)&&tu(e,"__v_skip",!0),e}const fo=e=>lt(e)?wf(e):e,Df=e=>lt(e)?Nf(e):e,fP="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class Gb{constructor(t,r,n,i){this.getter=t,this._setter=r,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new vf(()=>t(this._value),()=>xs(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const t=Ye(this);return(!t._cacheable||t.effect.dirty)&&ei(t._value,t._value=t.effect.run())&&xs(t,4),Wb(t),t.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&Mn(fP,`
|
|
84
|
+
**/function Mn(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let yr;class ZL{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=yr,!t&&yr&&(this.index=(yr.scopes||(yr.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const r=yr;try{return yr=this,t()}finally{yr=r}}else process.env.NODE_ENV!=="production"&&Mn("cannot run an inactive effect scope.")}on(){yr=this}off(){yr=this.parent}stop(t){if(this._active){let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.scopes)for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function XL(e,t=yr){t&&t.active&&t.effects.push(e)}function Lb(){return yr}function YL(e){yr?yr.cleanups.push(e):process.env.NODE_ENV!=="production"&&Mn("onScopeDispose() is called when there is no active effect scope to be associated with.")}let Ci;class Df{constructor(t,r,n,i){this.fn=t,this.trigger=r,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,XL(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,kn();for(let t=0;t<this._depsLength;t++){const r=this.deps[t];if(r.computed&&(eP(r.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),In()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Qn,r=Ci;try{return Qn=!0,Ci=this,this._runnings++,L0(this),this.fn()}finally{P0(this),this._runnings--,Ci=r,Qn=t}}stop(){this.active&&(L0(this),P0(this),this.onStop&&this.onStop(),this.active=!1)}}function eP(e){return e.value}function L0(e){e._trackId++,e._depsLength=0}function P0(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Pb(e.deps[t],e);e.deps.length=e._depsLength}}function Pb(e,t){const r=e.get(t);r!==void 0&&t._trackId!==r&&(e.delete(t),e.size===0&&e.cleanup())}let Qn=!0,sl=0;const Vb=[];function kn(){Vb.push(Qn),Qn=!1}function In(){const e=Vb.pop();Qn=e===void 0?!0:e}function Ef(){sl++}function Af(){for(sl--;!sl&&ul.length;)ul.shift()()}function Ub(e,t,r){var n;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const i=e.deps[e._depsLength];i!==t?(i&&Pb(i,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((n=e.onTrack)==null||n.call(e,Et({effect:e},r)))}}const ul=[];function $b(e,t,r){var n;Ef();for(const i of e.keys()){let a;i._dirtyLevel<t&&(a??(a=e.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=t),i._shouldSchedule&&(a??(a=e.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((n=i.onTrigger)==null||n.call(i,Et({effect:i},r))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&ul.push(i.scheduler)))}Af()}const Hb=(e,t)=>{const r=new Map;return r.cleanup=e,r.computed=t,r},cl=new WeakMap,Mi=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),ll=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Ht(e,t,r){if(Qn&&Ci){let n=cl.get(e);n||cl.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=Hb(()=>n.delete(r))),Ub(Ci,i,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r}:void 0)}}function nn(e,t,r,n,i,a){const o=cl.get(e);if(!o)return;let u=[];if(t==="clear")u=[...o.values()];else if(r==="length"&&Oe(e)){const c=Number(n);o.forEach((l,s)=>{(s==="length"||!fi(s)&&s>=c)&&u.push(l)})}else switch(r!==void 0&&u.push(o.get(r)),t){case"add":Oe(e)?xf(r)&&u.push(o.get("length")):(u.push(o.get(Mi)),Si(e)&&u.push(o.get(ll)));break;case"delete":Oe(e)||(u.push(o.get(Mi)),Si(e)&&u.push(o.get(ll)));break;case"set":Si(e)&&u.push(o.get(Mi));break}Ef();for(const c of u)c&&$b(c,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a}:void 0);Af()}const tP=Va("__proto__,__v_isRef,__isVue"),Jb=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fi)),V0=rP();function rP(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const n=Ye(this);for(let a=0,o=this.length;a<o;a++)Ht(n,"get",a+"");const i=n[t](...r);return i===-1||i===!1?n[t](...r.map(Ye)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...r){kn(),Ef();const n=Ye(this)[t].apply(this,r);return Af(),In(),n}}),e}function nP(e){fi(e)||(e=String(e));const t=Ye(this);return Ht(t,"has",e),t.hasOwnProperty(e)}class Gb{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){const i=this._isReadonly,a=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return a;if(r==="__v_raw")return n===(i?a?ex:Yb:a?Xb:Zb).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Oe(t);if(!i){if(o&&tt(V0,r))return Reflect.get(V0,r,n);if(r==="hasOwnProperty")return nP}const u=Reflect.get(t,r,n);return(fi(r)?Jb.has(r):tP(r))||(i||Ht(t,"get",r),a)?u:Lt(u)?o&&xf(r)?u:u.value:lt(u)?i?Mf(u):Cf(u):u}}class Kb extends Gb{constructor(t=!1){super(!1,t)}set(t,r,n,i){let a=t[r];if(!this._isShallow){const c=_n(a);if(!Dn(n)&&!_n(n)&&(a=Ye(a),n=Ye(n)),!Oe(t)&&Lt(a)&&!Lt(n))return c?!1:(a.value=n,!0)}const o=Oe(t)&&xf(r)?Number(r)<t.length:tt(t,r),u=Reflect.set(t,r,n,i);return t===Ye(i)&&(o?ei(n,a)&&nn(t,"set",r,n,a):nn(t,"add",r,n)),u}deleteProperty(t,r){const n=tt(t,r),i=t[r],a=Reflect.deleteProperty(t,r);return a&&n&&nn(t,"delete",r,void 0,i),a}has(t,r){const n=Reflect.has(t,r);return(!fi(r)||!Jb.has(r))&&Ht(t,"has",r),n}ownKeys(t){return Ht(t,"iterate",Oe(t)?"length":Mi),Reflect.ownKeys(t)}}class Wb extends Gb{constructor(t=!1){super(!0,t)}set(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const iP=new Kb,aP=new Wb,oP=new Kb(!0),sP=new Wb(!0),Sf=e=>e,Ju=e=>Reflect.getPrototypeOf(e);function fs(e,t,r=!1,n=!1){e=e.__v_raw;const i=Ye(e),a=Ye(t);r||(ei(t,a)&&Ht(i,"get",t),Ht(i,"get",a));const{has:o}=Ju(i),u=n?Sf:r?_f:go;if(o.call(i,t))return u(e.get(t));if(o.call(i,a))return u(e.get(a));e!==i&&e.get(t)}function ps(e,t=!1){const r=this.__v_raw,n=Ye(r),i=Ye(e);return t||(ei(e,i)&&Ht(n,"has",e),Ht(n,"has",i)),e===i?r.has(e):r.has(e)||r.has(i)}function ms(e,t=!1){return e=e.__v_raw,!t&&Ht(Ye(e),"iterate",Mi),Reflect.get(e,"size",e)}function U0(e,t=!1){!t&&!Dn(e)&&!_n(e)&&(e=Ye(e));const r=Ye(this);return Ju(r).has.call(r,e)||(r.add(e),nn(r,"add",e,e)),this}function $0(e,t,r=!1){!r&&!Dn(t)&&!_n(t)&&(t=Ye(t));const n=Ye(this),{has:i,get:a}=Ju(n);let o=i.call(n,e);o?process.env.NODE_ENV!=="production"&&Qb(n,i,e):(e=Ye(e),o=i.call(n,e));const u=a.call(n,e);return n.set(e,t),o?ei(t,u)&&nn(n,"set",e,t,u):nn(n,"add",e,t),this}function H0(e){const t=Ye(this),{has:r,get:n}=Ju(t);let i=r.call(t,e);i?process.env.NODE_ENV!=="production"&&Qb(t,r,e):(e=Ye(e),i=r.call(t,e));const a=n?n.call(t,e):void 0,o=t.delete(e);return i&&nn(t,"delete",e,void 0,a),o}function J0(){const e=Ye(this),t=e.size!==0,r=process.env.NODE_ENV!=="production"?Si(e)?new Map(e):new Set(e):void 0,n=e.clear();return t&&nn(e,"clear",void 0,void 0,r),n}function ds(e,t){return function(r,n){const i=this,a=i.__v_raw,o=Ye(a),u=t?Sf:e?_f:go;return!e&&Ht(o,"iterate",Mi),a.forEach((c,l)=>r.call(n,u(c),u(l),i))}}function hs(e,t,r){return function(...n){const i=this.__v_raw,a=Ye(i),o=Si(a),u=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...n),s=r?Sf:t?_f:go;return!t&&Ht(a,"iterate",c?ll:Mi),{next(){const{value:f,done:p}=l.next();return p?{value:f,done:p}:{value:u?[s(f[0]),s(f[1])]:s(f),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){if(process.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";Mn(`${Ri(e)} operation ${r}failed: target is readonly.`,Ye(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function uP(){const e={get(i){return fs(this,i)},get size(){return ms(this)},has:ps,add:U0,set:$0,delete:H0,clear:J0,forEach:ds(!1,!1)},t={get(i){return fs(this,i,!1,!0)},get size(){return ms(this)},has:ps,add(i){return U0.call(this,i,!0)},set(i,a){return $0.call(this,i,a,!0)},delete:H0,clear:J0,forEach:ds(!1,!0)},r={get(i){return fs(this,i,!0)},get size(){return ms(this,!0)},has(i){return ps.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:ds(!0,!1)},n={get(i){return fs(this,i,!0,!0)},get size(){return ms(this,!0)},has(i){return ps.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:ds(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=hs(i,!1,!1),r[i]=hs(i,!0,!1),t[i]=hs(i,!1,!0),n[i]=hs(i,!0,!0)}),[e,r,t,n]}const[cP,lP,fP,pP]=uP();function Gu(e,t){const r=t?e?pP:fP:e?lP:cP;return(n,i,a)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(tt(r,i)&&i in n?r:n,i,a)}const mP={get:Gu(!1,!1)},dP={get:Gu(!1,!0)},hP={get:Gu(!0,!1)},gP={get:Gu(!0,!0)};function Qb(e,t,r){const n=Ye(r);if(n!==r&&t.call(e,n)){const i=bf(e);Mn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Zb=new WeakMap,Xb=new WeakMap,Yb=new WeakMap,ex=new WeakMap;function vP(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function yP(e){return e.__v_skip||!Object.isExtensible(e)?0:vP(bf(e))}function Cf(e){return _n(e)?e:Ku(e,!1,iP,mP,Zb)}function tx(e){return Ku(e,!1,oP,dP,Xb)}function Mf(e){return Ku(e,!0,aP,hP,Yb)}function rn(e){return Ku(e,!0,sP,gP,ex)}function Ku(e,t,r,n,i){if(!lt(e))return process.env.NODE_ENV!=="production"&&Mn(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=i.get(e);if(a)return a;const o=yP(e);if(o===0)return e;const u=new Proxy(e,o===2?n:r);return i.set(e,u),u}function fa(e){return _n(e)?fa(e.__v_raw):!!(e&&e.__v_isReactive)}function _n(e){return!!(e&&e.__v_isReadonly)}function Dn(e){return!!(e&&e.__v_isShallow)}function fl(e){return e?!!e.__v_raw:!1}function Ye(e){const t=e&&e.__v_raw;return t?Ye(t):e}function bP(e){return Object.isExtensible(e)&&ou(e,"__v_skip",!0),e}const go=e=>lt(e)?Cf(e):e,_f=e=>lt(e)?Mf(e):e,xP="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class rx{constructor(t,r,n,i){this.getter=t,this._setter=r,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Df(()=>t(this._value),()=>As(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const t=Ye(this);return(!t._cacheable||t.effect.dirty)&&ei(t._value,t._value=t.effect.run())&&As(t,4),nx(t),t.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&Mn(xP,`
|
|
85
85
|
|
|
86
|
-
getter: `,this.getter),
|
|
86
|
+
getter: `,this.getter),As(t,2)),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function wP(e,t,r=!1){let n,i;const a=Be(e);a?(n=e,i=process.env.NODE_ENV!=="production"?()=>{Mn("Write operation failed: computed value is readonly")}:St):(n=e.get,i=e.set);const o=new rx(n,i,a||!i,r);return process.env.NODE_ENV!=="production"&&t&&!r&&(o.effect.onTrack=t.onTrack,o.effect.onTrigger=t.onTrigger),o}function nx(e){var t;Qn&&Ci&&(e=Ye(e),Ub(Ci,(t=e.dep)!=null?t:e.dep=Hb(()=>e.dep=void 0,e instanceof rx?e:void 0),process.env.NODE_ENV!=="production"?{target:e,type:"get",key:"value"}:void 0))}function As(e,t=4,r,n){e=Ye(e);const i=e.dep;i&&$b(i,t,process.env.NODE_ENV!=="production"?{target:e,type:"set",key:"value",newValue:r,oldValue:n}:void 0)}function Lt(e){return!!(e&&e.__v_isRef===!0)}function Ur(e){return NP(e,!1)}function NP(e,t){return Lt(e)?e:new DP(e,t)}class DP{constructor(t,r){this.__v_isShallow=r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=r?t:Ye(t),this._value=r?t:go(t)}get value(){return nx(this),this._value}set value(t){const r=this.__v_isShallow||Dn(t)||_n(t);if(t=r?t:Ye(t),ei(t,this._rawValue)){const n=this._rawValue;this._rawValue=t,this._value=r?t:go(t),As(this,4,t,n)}}}function et(e){return Lt(e)?e.value:e}const EP={get:(e,t,r)=>et(Reflect.get(e,t,r)),set:(e,t,r,n)=>{const i=e[t];return Lt(i)&&!Lt(r)?(i.value=r,!0):Reflect.set(e,t,r,n)}};function ix(e){return fa(e)?e:new Proxy(e,EP)}/**
|
|
87
87
|
* @vue/runtime-core v3.4.38
|
|
88
88
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
89
89
|
* @license MIT
|
|
90
|
-
**/const
|
|
90
|
+
**/const _i=[];function Ss(e){_i.push(e)}function Cs(){_i.pop()}let Ac=!1;function Se(e,...t){if(Ac)return;Ac=!0,kn();const r=_i.length?_i[_i.length-1].component:null,n=r&&r.appContext.config.warnHandler,i=AP();if(n)En(n,r,11,[e+t.map(a=>{var o,u;return(u=(o=a.toString)==null?void 0:o.call(a))!=null?u:JSON.stringify(a)}).join(""),r&&r.proxy,i.map(({vnode:a})=>`at <${tc(r,a.type)}>`).join(`
|
|
91
91
|
`),i]);else{const a=[`[Vue warn]: ${e}`,...t];i.length&&a.push(`
|
|
92
|
-
`,...
|
|
93
|
-
`],...yP(r))}),t}function yP({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,i=` at <${Qu(e.component,e.type,n)}`,a=">"+r;return e.props?[i,...bP(e.props),a]:[i+a]}function bP(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...Qb(n,e[n]))}),r.length>3&&t.push(" ..."),t}function Qb(e,t,r){return xt(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Lt(t)?(t=Qb(e,Ye(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):Be(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Ye(t),r?t:[`${e}=`,t])}function xP(e,t){process.env.NODE_ENV!=="production"&&e!==void 0&&(typeof e!="number"?Se(`${t} is not a valid number - got ${JSON.stringify(e)}.`):isNaN(e)&&Se(`${t} is NaN - the duration expression might be incorrect.`))}const Ef={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update"};function En(e,t,r,n){try{return n?e(...n):e()}catch(i){Io(i,t,r)}}function _r(e,t,r,n){if(Be(e)){const i=En(e,t,r,n);return i&&pf(i)&&i.catch(a=>{Io(a,t,r)}),i}if(Oe(e)){const i=[];for(let a=0;a<e.length;a++)i.push(_r(e[a],t,r,n));return i}else process.env.NODE_ENV!=="production"&&Se(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Io(e,t,r,n=!0){const i=t?t.vnode:null;if(t){let a=t.parent;const o=t.proxy,u=process.env.NODE_ENV!=="production"?Ef[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const l=a.ec;if(l){for(let s=0;s<l.length;s++)if(l[s](e,o,u)===!1)return}a=a.parent}const c=t.appContext.config.errorHandler;if(c){kn(),En(c,null,10,[e,o,u]),In();return}}wP(e,r,i,n)}function wP(e,t,r,n=!0){if(process.env.NODE_ENV!=="production"){const i=Ef[t];if(r&&ws(r),Se(`Unhandled error${i?` during execution of ${i}`:""}`),r&&Ns(),n)throw e;console.error(e)}else console.error(e)}let po=!1,sl=!1;const Zt=[];let Yr=0;const ca=[];let Un=null,yi=0;const Zb=Promise.resolve();let Af=null;const NP=100;function Xb(e){const t=Af||Zb;return e?t.then(this?e.bind(this):e):t}function DP(e){let t=Yr+1,r=Zt.length;for(;t<r;){const n=t+r>>>1,i=Zt[n],a=mo(i);a<e||a===e&&i.pre?t=n+1:r=n}return t}function $u(e){(!Zt.length||!Zt.includes(e,po&&e.allowRecurse?Yr+1:Yr))&&(e.id==null?Zt.push(e):Zt.splice(DP(e.id),0,e),Yb())}function Yb(){!po&&!sl&&(sl=!0,Af=Zb.then(rx))}function EP(e){const t=Zt.indexOf(e);t>Yr&&Zt.splice(t,1)}function ex(e){Oe(e)?ca.push(...e):(!Un||!Un.includes(e,e.allowRecurse?yi+1:yi))&&ca.push(e),Yb()}function j0(e,t,r=po?Yr+1:0){for(process.env.NODE_ENV!=="production"&&(t=t||new Map);r<Zt.length;r++){const n=Zt[r];if(n&&n.pre){if(e&&n.id!==e.uid||process.env.NODE_ENV!=="production"&&Sf(t,n))continue;Zt.splice(r,1),r--,n()}}}function tx(e){if(ca.length){const t=[...new Set(ca)].sort((r,n)=>mo(r)-mo(n));if(ca.length=0,Un){Un.push(...t);return}for(Un=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),yi=0;yi<Un.length;yi++){const r=Un[yi];process.env.NODE_ENV!=="production"&&Sf(e,r)||r.active!==!1&&r()}Un=null,yi=0}}const mo=e=>e.id==null?1/0:e.id,AP=(e,t)=>{const r=mo(e)-mo(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function rx(e){sl=!1,po=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),Zt.sort(AP);const t=process.env.NODE_ENV!=="production"?r=>Sf(e,r):St;try{for(Yr=0;Yr<Zt.length;Yr++){const r=Zt[Yr];if(r&&r.active!==!1){if(process.env.NODE_ENV!=="production"&&t(r))continue;En(r,r.i,r.i?15:14)}}}finally{Yr=0,Zt.length=0,tx(e),po=!1,Af=null,(Zt.length||ca.length)&&rx(e)}}function Sf(e,t){if(!e.has(t))e.set(t,1);else{const r=e.get(t);if(r>NP){const n=t.i,i=n&&kf(n.type);return Io(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else e.set(t,r+1)}}let _i=!1;const Ds=new Map;process.env.NODE_ENV!=="production"&&(hf().__VUE_HMR_RUNTIME__={createRecord:wc(nx),rerender:wc(MP),reload:wc(_P)});const Ii=new Map;function SP(e){const t=e.type.__hmrId;let r=Ii.get(t);r||(nx(t,e.type),r=Ii.get(t)),r.instances.add(e)}function CP(e){Ii.get(e.type.__hmrId).instances.delete(e)}function nx(e,t){return Ii.has(e)?!1:(Ii.set(e,{initialDef:ru(t),instances:new Set}),!0)}function ru(e){return $x(e)?e.__vccOpts:e}function MP(e,t){const r=Ii.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,ru(n.type).render=t),n.renderCache=[],_i=!0,n.effect.dirty=!0,n.update(),_i=!1}))}function _P(e,t){const r=Ii.get(e);if(!r)return;t=ru(t),L0(r.initialDef,t);const n=[...r.instances];for(let i=0;i<n.length;i++){const a=n[i],o=ru(a.type);let u=Ds.get(o);u||(o!==r.initialDef&&L0(o,t),Ds.set(o,u=new Set)),u.add(a),a.appContext.propsCache.delete(a.type),a.appContext.emitsCache.delete(a.type),a.appContext.optionsCache.delete(a.type),a.ceReload?(u.add(a),a.ceReload(t.styles),u.delete(a)):a.parent?(a.parent.effect.dirty=!0,$u(()=>{a.parent.update(),u.delete(a)})):a.appContext.reload?a.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}ex(()=>{Ds.clear()})}function L0(e,t){Et(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function wc(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let en,Ya=[],ul=!1;function Ro(e,...t){en?en.emit(e,...t):ul||Ya.push({event:e,args:t})}function ix(e,t){var r,n;en=e,en?(en.enabled=!0,Ya.forEach(({event:i,args:a})=>en.emit(i,...a)),Ya=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{ix(i,t)}),setTimeout(()=>{en||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ul=!0,Ya=[])},3e3)):(ul=!0,Ya=[])}function FP(e,t){Ro("app:init",e,t,{Fragment:mr,Text:zo,Comment:Mt,Static:As})}function TP(e){Ro("app:unmount",e)}const OP=Cf("component:added"),ax=Cf("component:updated"),BP=Cf("component:removed"),kP=e=>{en&&typeof en.cleanupBuffer=="function"&&!en.cleanupBuffer(e)&&BP(e)};/*! #__NO_SIDE_EFFECTS__ */function Cf(e){return t=>{Ro(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}const IP=ox("perf:start"),RP=ox("perf:end");function ox(e){return(t,r,n)=>{Ro(e,t.appContext.app,t.uid,t,r,n)}}function qP(e,t,r){Ro("component:emit",e.appContext.app,e,t,r)}let _t=null,sx=null;function nu(e){const t=_t;return _t=e,sx=e&&e.type.__scopeId||null,t}function ro(e,t=_t,r){if(!t||e._n)return e;const n=(...i)=>{n._d&&Y0(-1);const a=nu(t);let o;try{o=e(...i)}finally{nu(a),n._d&&Y0(1)}return process.env.NODE_ENV!=="production"&&ax(t),o};return n._n=!0,n._c=!0,n._d=!0,n}function ux(e){TL(e)&&Se("Do not use built-in directive ids as custom directive id: "+e)}function cx(e,t){if(_t===null)return process.env.NODE_ENV!=="production"&&Se("withDirectives can only be used inside render functions."),e;const r=Ku(_t),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[a,o,u,c=vt]=t[i];a&&(Be(a)&&(a={mounted:a,updated:a}),a.deep&&Gn(o),n.push({dir:a,instance:r,value:o,oldValue:void 0,arg:u,modifiers:c}))}return e}function pi(e,t,r,n){const i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){const u=i[o];a&&(u.oldValue=a[o].value);let c=u.dir[n];c&&(kn(),_r(c,r,8,[e.el,u,e,t]),In())}}const $n=Symbol("_leaveCb"),ps=Symbol("_enterCb");function zP(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ju(()=>{e.isMounted=!0}),hx(()=>{e.isUnmounting=!0}),e}const Ar=[Function,Array],lx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ar,onEnter:Ar,onAfterEnter:Ar,onEnterCancelled:Ar,onBeforeLeave:Ar,onLeave:Ar,onAfterLeave:Ar,onLeaveCancelled:Ar,onBeforeAppear:Ar,onAppear:Ar,onAfterAppear:Ar,onAppearCancelled:Ar},fx=e=>{const t=e.subTree;return t.component?fx(t.component):t},jP={name:"BaseTransition",props:lx,setup(e,{slots:t}){const r=ri(),n=zP();return()=>{const i=t.default&&mx(t.default(),!0);if(!i||!i.length)return;let a=i[0];if(i.length>1){let p=!1;for(const m of i)if(m.type!==Mt){if(process.env.NODE_ENV!=="production"&&p){Se("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(a=m,p=!0,process.env.NODE_ENV==="production")break}}const o=Ye(e),{mode:u}=o;if(process.env.NODE_ENV!=="production"&&u&&u!=="in-out"&&u!=="out-in"&&u!=="default"&&Se(`invalid <transition> mode: ${u}`),n.isLeaving)return Nc(a);const c=P0(a);if(!c)return Nc(a);let l=cl(c,o,n,r,p=>l=p);iu(c,l);const s=r.subTree,f=s&&P0(s);if(f&&f.type!==Mt&&!xi(c,f)&&fx(r).type!==Mt){const p=cl(f,o,n,r);if(iu(f,p),u==="out-in"&&c.type!==Mt)return n.isLeaving=!0,p.afterLeave=()=>{n.isLeaving=!1,r.update.active!==!1&&(r.effect.dirty=!0,r.update())},Nc(a);u==="in-out"&&c.type!==Mt&&(p.delayLeave=(m,d,h)=>{const w=px(n,f);w[String(f.key)]=f,m[$n]=()=>{d(),m[$n]=void 0,delete l.delayedLeave},l.delayedLeave=h})}return a}}},LP=jP;function px(e,t){const{leavingVNodes:r}=e;let n=r.get(t.type);return n||(n=Object.create(null),r.set(t.type,n)),n}function cl(e,t,r,n,i){const{appear:a,mode:o,persisted:u=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:s,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:w,onAppear:v,onAfterAppear:x,onAppearCancelled:g}=t,b=String(e.key),y=px(r,e),N=(D,S)=>{D&&_r(D,n,9,S)},E=(D,S)=>{const C=S[1];N(D,S),Oe(D)?D.every(_=>_.length<=1)&&C():D.length<=1&&C()},A={mode:o,persisted:u,beforeEnter(D){let S=c;if(!r.isMounted)if(a)S=w||c;else return;D[$n]&&D[$n](!0);const C=y[b];C&&xi(e,C)&&C.el[$n]&&C.el[$n](),N(S,[D])},enter(D){let S=l,C=s,_=f;if(!r.isMounted)if(a)S=v||l,C=x||s,_=g||f;else return;let R=!1;const P=D[ps]=I=>{R||(R=!0,I?N(_,[D]):N(C,[D]),A.delayedLeave&&A.delayedLeave(),D[ps]=void 0)};S?E(S,[D,P]):P()},leave(D,S){const C=String(e.key);if(D[ps]&&D[ps](!0),r.isUnmounting)return S();N(p,[D]);let _=!1;const R=D[$n]=P=>{_||(_=!0,S(),P?N(h,[D]):N(d,[D]),D[$n]=void 0,y[C]===e&&delete y[C])};y[C]=e,m?E(m,[D,R]):R()},clone(D){const S=cl(D,t,r,n,i);return i&&i(S),S}};return A}function Nc(e){if(qo(e))return e=un(e),e.children=null,e}function P0(e){if(!qo(e))return e;if(process.env.NODE_ENV!=="production"&&e.component)return e.component.subTree;const{shapeFlag:t,children:r}=e;if(r){if(t&16)return r[0];if(t&32&&Be(r.default))return r.default()}}function iu(e,t){e.shapeFlag&6&&e.component?iu(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function mx(e,t=!1,r){let n=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];const u=r==null?o.key:String(r)+String(o.key!=null?o.key:a);o.type===mr?(o.patchFlag&128&&i++,n=n.concat(mx(o.children,t,u))):(t||o.type!==Mt)&&n.push(u!=null?un(o,{key:u}):o)}if(i>1)for(let a=0;a<n.length;a++)n[a].patchFlag=-2;return n}/*! #__NO_SIDE_EFFECTS__ */function Zr(e,t){return Be(e)?Et({name:e.name},t,{setup:e}):e}const no=e=>!!e.type.__asyncLoader,qo=e=>e.type.__isKeepAlive;function PP(e,t){dx(e,"a",t)}function VP(e,t){dx(e,"da",t)}function dx(e,t,r=Bt){const n=e.__wdc||(e.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Hu(t,n,r),r){let i=r.parent;for(;i&&i.parent;)qo(i.parent.vnode)&&UP(n,t,r,i),i=i.parent}}function UP(e,t,r,n){const i=Hu(t,e,n,!0);gx(()=>{ff(n[t],i)},r)}function Hu(e,t,r=Bt,n=!1){if(r){const i=r[e]||(r[e]=[]),a=t.__weh||(t.__weh=(...o)=>{kn();const u=jo(r),c=_r(t,r,e,o);return u(),In(),c});return n?i.unshift(a):i.push(a),a}else if(process.env.NODE_ENV!=="production"){const i=vi(Ef[e].replace(/ hook$/,""));Se(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Rn=e=>(t,r=Bt)=>{(!Wu||e==="sp")&&Hu(e,(...n)=>t(...n),r)},$P=Rn("bm"),Ju=Rn("m"),HP=Rn("bu"),JP=Rn("u"),hx=Rn("bum"),gx=Rn("um"),GP=Rn("sp"),WP=Rn("rtg"),KP=Rn("rtc");function QP(e,t=Bt){Hu("ec",e,t)}const ZP="components",vx=Symbol.for("v-ndc");function XP(e){return xt(e)?YP(ZP,e,!1)||e:e||vx}function YP(e,t,r=!0,n=!1){const i=_t||Bt;if(i){const a=i.type;{const u=kf(a,!1);if(u&&(u===t||u===wr(t)||u===ki(wr(t))))return a}const o=V0(i[e]||a[e],t)||V0(i.appContext[e],t);return!o&&n?a:(process.env.NODE_ENV!=="production"&&r&&!o&&Se(`Failed to resolve ${e.slice(0,-1)}: ${t}
|
|
94
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),o)}else process.env.NODE_ENV!=="production"&&Se(`resolve${ki(e.slice(0,-1))} can only be used in render() or setup().`)}function V0(e,t){return e&&(e[t]||e[wr(t)]||e[ki(wr(t))])}function Mf(e,t,r={},n,i){if(_t.isCE||_t.parent&&no(_t.parent)&&_t.parent.isCE)return $t("slot",r,n&&n());let a=e[t];process.env.NODE_ENV!=="production"&&a&&a.length>1&&(Se("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),a=()=>[]),a&&a._c&&(a._d=!1),Kt();const o=a&&yx(a(r)),u=bi(mr,{key:(r.key||o&&o.key||`_${t}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),a&&a._c&&(a._d=!0),u}function yx(e){return e.some(t=>ti(t)?!(t.type===Mt||t.type===mr&&!yx(t.children)):!0)?e:null}const ll=e=>e?Vx(e)?Ku(e):ll(e.parent):null,Fi=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?rn(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?rn(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?rn(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?rn(e.refs):e.refs,$parent:e=>ll(e.parent),$root:e=>ll(e.root),$emit:e=>e.emit,$options:e=>Ff(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,$u(e.update)}),$nextTick:e=>e.n||(e.n=Xb.bind(e.proxy)),$watch:e=>BV.bind(e)}),_f=e=>e==="_"||e==="$",Dc=(e,t)=>e!==vt&&!e.__isScriptSetup&&tt(e,t),bx={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:a,accessCache:o,type:u,appContext:c}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let l;if(t[0]!=="$"){const m=o[t];if(m!==void 0)switch(m){case 1:return n[t];case 2:return i[t];case 4:return r[t];case 3:return a[t]}else{if(Dc(n,t))return o[t]=1,n[t];if(i!==vt&&tt(i,t))return o[t]=2,i[t];if((l=e.propsOptions[0])&&tt(l,t))return o[t]=3,a[t];if(r!==vt&&tt(r,t))return o[t]=4,r[t];fl&&(o[t]=0)}}const s=Fi[t];let f,p;if(s)return t==="$attrs"?(Ht(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&su()):process.env.NODE_ENV!=="production"&&t==="$slots"&&Ht(e,"get",t),s(e);if((f=u.__cssModules)&&(f=f[t]))return f;if(r!==vt&&tt(r,t))return o[t]=4,r[t];if(p=c.config.globalProperties,tt(p,t))return p[t];process.env.NODE_ENV!=="production"&&_t&&(!xt(t)||t.indexOf("__v")!==0)&&(i!==vt&&_f(t[0])&&tt(i,t)?Se(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===_t&&Se(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,r){const{data:n,setupState:i,ctx:a}=e;return Dc(i,t)?(i[t]=r,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&tt(i,t)?(Se(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):n!==vt&&tt(n,t)?(n[t]=r,!0):tt(e.props,t)?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:r}):a[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:n,appContext:i,propsOptions:a}},o){let u;return!!r[o]||e!==vt&&tt(e,o)||Dc(t,o)||(u=a[0])&&tt(u,o)||tt(n,o)||tt(Fi,o)||tt(i.config.globalProperties,o)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:tt(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};process.env.NODE_ENV!=="production"&&(bx.ownKeys=e=>(Se("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function eV(e){const t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(Fi).forEach(r=>{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:()=>Fi[r](e),set:St})}),t}function tV(e){const{ctx:t,propsOptions:[r]}=e;r&&Object.keys(r).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:St})})}function rV(e){const{ctx:t,setupState:r}=e;Object.keys(Ye(r)).forEach(n=>{if(!r.__isScriptSetup){if(_f(n[0])){Se(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r[n],set:St})}})}function U0(e){return Oe(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function nV(){const e=Object.create(null);return(t,r)=>{e[r]?Se(`${t} property "${r}" is already defined in ${e[r]}.`):e[r]=t}}let fl=!0;function iV(e){const t=Ff(e),r=e.proxy,n=e.ctx;fl=!1,t.beforeCreate&&$0(t.beforeCreate,e,"bc");const{data:i,computed:a,methods:o,watch:u,provide:c,inject:l,created:s,beforeMount:f,mounted:p,beforeUpdate:m,updated:d,activated:h,deactivated:w,beforeDestroy:v,beforeUnmount:x,destroyed:g,unmounted:b,render:y,renderTracked:N,renderTriggered:E,errorCaptured:A,serverPrefetch:D,expose:S,inheritAttrs:C,components:_,directives:R,filters:P}=t,I=process.env.NODE_ENV!=="production"?nV():null;if(process.env.NODE_ENV!=="production"){const[F]=e.propsOptions;if(F)for(const q in F)I("Props",q)}if(l&&aV(l,n,I),o)for(const F in o){const q=o[F];Be(q)?(process.env.NODE_ENV!=="production"?Object.defineProperty(n,F,{value:q.bind(r),configurable:!0,enumerable:!0,writable:!0}):n[F]=q.bind(r),process.env.NODE_ENV!=="production"&&I("Methods",F)):process.env.NODE_ENV!=="production"&&Se(`Method "${F}" has type "${typeof q}" in the component definition. Did you reference the function correctly?`)}if(i){process.env.NODE_ENV!=="production"&&!Be(i)&&Se("The data option must be a function. Plain object usage is no longer supported.");const F=i.call(r,r);if(process.env.NODE_ENV!=="production"&&pf(F)&&Se("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!lt(F))process.env.NODE_ENV!=="production"&&Se("data() should return an object.");else if(e.data=wf(F),process.env.NODE_ENV!=="production")for(const q in F)I("Data",q),_f(q[0])||Object.defineProperty(n,q,{configurable:!0,enumerable:!0,get:()=>F[q],set:St})}if(fl=!0,a)for(const F in a){const q=a[F],k=Be(q)?q.bind(r,r):Be(q.get)?q.get.bind(r,r):St;process.env.NODE_ENV!=="production"&&k===St&&Se(`Computed property "${F}" has no getter.`);const te=!Be(q)&&Be(q.set)?q.set.bind(r):process.env.NODE_ENV!=="production"?()=>{Se(`Write operation failed: computed property "${F}" is readonly.`)}:St,se=yt({get:k,set:te});Object.defineProperty(n,F,{enumerable:!0,configurable:!0,get:()=>se.value,set:K=>se.value=K}),process.env.NODE_ENV!=="production"&&I("Computed",F)}if(u)for(const F in u)xx(u[F],n,r,F);if(c){const F=Be(c)?c.call(r):c;Reflect.ownKeys(F).forEach(q=>{Nx(q,F[q])})}s&&$0(s,e,"c");function O(F,q){Oe(q)?q.forEach(k=>F(k.bind(r))):q&&F(q.bind(r))}if(O($P,f),O(Ju,p),O(HP,m),O(JP,d),O(PP,h),O(VP,w),O(QP,A),O(KP,N),O(WP,E),O(hx,x),O(gx,b),O(GP,D),Oe(S))if(S.length){const F=e.exposed||(e.exposed={});S.forEach(q=>{Object.defineProperty(F,q,{get:()=>r[q],set:k=>r[q]=k})})}else e.exposed||(e.exposed={});y&&e.render===St&&(e.render=y),C!=null&&(e.inheritAttrs=C),_&&(e.components=_),R&&(e.directives=R)}function aV(e,t,r=St){Oe(e)&&(e=pl(e));for(const n in e){const i=e[n];let a;lt(i)?"default"in i?a=an(i.from||n,i.default,!0):a=an(i.from||n):a=an(i),Lt(a)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:o=>a.value=o}):t[n]=a,process.env.NODE_ENV!=="production"&&r("Inject",n)}}function $0(e,t,r){_r(Oe(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,r)}function xx(e,t,r,n){const i=n.includes(".")?kx(r,n):()=>r[n];if(xt(e)){const a=t[e];Be(a)?fa(i,a):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e}"`,a)}else if(Be(e))fa(i,e.bind(r));else if(lt(e))if(Oe(e))e.forEach(a=>xx(a,t,r,n));else{const a=Be(e.handler)?e.handler.bind(r):t[e.handler];Be(a)?fa(i,a,e):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e.handler}"`,a)}else process.env.NODE_ENV!=="production"&&Se(`Invalid watch option: "${n}"`,e)}function Ff(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,u=a.get(t);let c;return u?c=u:!i.length&&!r&&!n?c=t:(c={},i.length&&i.forEach(l=>au(c,l,o,!0)),au(c,t,o)),lt(t)&&a.set(t,c),c}function au(e,t,r,n=!1){const{mixins:i,extends:a}=t;a&&au(e,a,r,!0),i&&i.forEach(o=>au(e,o,r,!0));for(const o in t)if(n&&o==="expose")process.env.NODE_ENV!=="production"&&Se('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=oV[o]||r&&r[o];e[o]=u?u(e[o],t[o]):t[o]}return e}const oV={data:H0,props:J0,emits:J0,methods:eo,computed:eo,beforeCreate:rr,created:rr,beforeMount:rr,mounted:rr,beforeUpdate:rr,updated:rr,beforeDestroy:rr,beforeUnmount:rr,destroyed:rr,unmounted:rr,activated:rr,deactivated:rr,errorCaptured:rr,serverPrefetch:rr,components:eo,directives:eo,watch:uV,provide:H0,inject:sV};function H0(e,t){return t?e?function(){return Et(Be(e)?e.call(this,this):e,Be(t)?t.call(this,this):t)}:t:e}function sV(e,t){return eo(pl(e),pl(t))}function pl(e){if(Oe(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function rr(e,t){return e?[...new Set([].concat(e,t))]:t}function eo(e,t){return e?Et(Object.create(null),e,t):t}function J0(e,t){return e?Oe(e)&&Oe(t)?[...new Set([...e,...t])]:Et(Object.create(null),U0(e),U0(t??{})):t}function uV(e,t){if(!e)return t;if(!t)return e;const r=Et(Object.create(null),e);for(const n in t)r[n]=rr(e[n],t[n]);return r}function wx(){return{app:null,config:{isNativeTag:_L,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let cV=0;function lV(e,t){return function(r,n=null){Be(r)||(r=Et({},r)),n!=null&&!lt(n)&&(process.env.NODE_ENV!=="production"&&Se("root props passed to app.mount() must be an object."),n=null);const i=wx(),a=new WeakSet;let o=!1;const u=i.app={_uid:cV++,_component:r,_props:n,_container:null,_context:i,_instance:null,version:ng,get config(){return i.config},set config(c){process.env.NODE_ENV!=="production"&&Se("app.config cannot be replaced. Modify individual options instead.")},use(c,...l){return a.has(c)?process.env.NODE_ENV!=="production"&&Se("Plugin has already been applied to target app."):c&&Be(c.install)?(a.add(c),c.install(u,...l)):Be(c)?(a.add(c),c(u,...l)):process.env.NODE_ENV!=="production"&&Se('A plugin must either be a function or an object with an "install" function.'),u},mixin(c){return i.mixins.includes(c)?process.env.NODE_ENV!=="production"&&Se("Mixin has already been applied to target app"+(c.name?`: ${c.name}`:"")):i.mixins.push(c),u},component(c,l){return process.env.NODE_ENV!=="production"&&yl(c,i.config),l?(process.env.NODE_ENV!=="production"&&i.components[c]&&Se(`Component "${c}" has already been registered in target app.`),i.components[c]=l,u):i.components[c]},directive(c,l){return process.env.NODE_ENV!=="production"&&ux(c),l?(process.env.NODE_ENV!=="production"&&i.directives[c]&&Se(`Directive "${c}" has already been registered in target app.`),i.directives[c]=l,u):i.directives[c]},mount(c,l,s){if(o)process.env.NODE_ENV!=="production"&&Se("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!=="production"&&c.__vue_app__&&Se("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const f=$t(r,n);return f.appContext=i,s===!0?s="svg":s===!1&&(s=void 0),process.env.NODE_ENV!=="production"&&(i.reload=()=>{e(un(f),c,s)}),l&&t?t(f,c):e(f,c,s),o=!0,u._container=c,c.__vue_app__=u,process.env.NODE_ENV!=="production"&&(u._instance=f.component,FP(u,ng)),Ku(f.component)}},unmount(){o?(e(null,u._container),process.env.NODE_ENV!=="production"&&(u._instance=null,TP(u)),delete u._container.__vue_app__):process.env.NODE_ENV!=="production"&&Se("Cannot unmount an app that is not mounted.")},provide(c,l){return process.env.NODE_ENV!=="production"&&c in i.provides&&Se(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`),i.provides[c]=l,u},runWithContext(c){const l=la;la=u;try{return c()}finally{la=l}}};return u}}let la=null;function Nx(e,t){if(!Bt)process.env.NODE_ENV!=="production"&&Se("provide() can only be used inside setup().");else{let r=Bt.provides;const n=Bt.parent&&Bt.parent.provides;n===r&&(r=Bt.provides=Object.create(n)),r[e]=t}}function an(e,t,r=!1){const n=Bt||_t;if(n||la){const i=la?la._context.provides:n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return r&&Be(t)?t.call(n&&n.proxy):t;process.env.NODE_ENV!=="production"&&Se(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&Se("inject() can only be used inside setup() or functional components.")}const Dx={},Ex=()=>Object.create(Dx),Ax=e=>Object.getPrototypeOf(e)===Dx;function fV(e,t,r,n=!1){const i={},a=Ex();e.propsDefaults=Object.create(null),Sx(e,t,i,a);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);process.env.NODE_ENV!=="production"&&Mx(t||{},i,e),r?e.props=n?i:Jb(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function pV(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function mV(e,t,r,n){const{props:i,attrs:a,vnode:{patchFlag:o}}=e,u=Ye(i),[c]=e.propsOptions;let l=!1;if(!(process.env.NODE_ENV!=="production"&&pV(e))&&(n||o>0)&&!(o&16)){if(o&8){const s=e.vnode.dynamicProps;for(let f=0;f<s.length;f++){let p=s[f];if(Gu(e.emitsOptions,p))continue;const m=t[p];if(c)if(tt(a,p))m!==a[p]&&(a[p]=m,l=!0);else{const d=wr(p);i[d]=ml(c,u,d,m,e,!1)}else m!==a[p]&&(a[p]=m,l=!0)}}}else{Sx(e,t,i,a)&&(l=!0);let s;for(const f in u)(!t||!tt(t,f)&&((s=Cn(f))===f||!tt(t,s)))&&(c?r&&(r[f]!==void 0||r[s]!==void 0)&&(i[f]=ml(c,u,f,void 0,e,!0)):delete i[f]);if(a!==u)for(const f in a)(!t||!tt(t,f))&&(delete a[f],l=!0)}l&&nn(e.attrs,"set",""),process.env.NODE_ENV!=="production"&&Mx(t||{},i,e)}function Sx(e,t,r,n){const[i,a]=e.propsOptions;let o=!1,u;if(t)for(let c in t){if(to(c))continue;const l=t[c];let s;i&&tt(i,s=wr(c))?!a||!a.includes(s)?r[s]=l:(u||(u={}))[s]=l:Gu(e.emitsOptions,c)||(!(c in n)||l!==n[c])&&(n[c]=l,o=!0)}if(a){const c=Ye(r),l=u||vt;for(let s=0;s<a.length;s++){const f=a[s];r[f]=ml(i,c,f,l[f],e,!tt(l,f))}}return o}function ml(e,t,r,n,i,a){const o=e[r];if(o!=null){const u=tt(o,"default");if(u&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&Be(c)){const{propsDefaults:l}=i;if(r in l)n=l[r];else{const s=jo(i);n=l[r]=c.call(null,t),s()}}else n=c}o[0]&&(a&&!u?n=!1:o[1]&&(n===""||n===Cn(r))&&(n=!0))}return n}const dV=new WeakMap;function Cx(e,t,r=!1){const n=r?dV:t.propsCache,i=n.get(e);if(i)return i;const a=e.props,o={},u=[];let c=!1;if(!Be(e)){const s=f=>{c=!0;const[p,m]=Cx(f,t,!0);Et(o,p),m&&u.push(...m)};!r&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}if(!a&&!c)return lt(e)&&n.set(e,sa),sa;if(Oe(a))for(let s=0;s<a.length;s++){process.env.NODE_ENV!=="production"&&!xt(a[s])&&Se("props must be strings when using array syntax.",a[s]);const f=wr(a[s]);G0(f)&&(o[f]=vt)}else if(a){process.env.NODE_ENV!=="production"&&!lt(a)&&Se("invalid props options",a);for(const s in a){const f=wr(s);if(G0(f)){const p=a[s],m=o[f]=Oe(p)||Be(p)?{type:p}:Et({},p),d=m.type;let h=!1,w=!0;if(Oe(d))for(let v=0;v<d.length;++v){const x=d[v],g=Be(x)&&x.name;if(g==="Boolean"){h=!0;break}else g==="String"&&(w=!1)}else h=Be(d)&&d.name==="Boolean";m[0]=h,m[1]=w,(h||tt(m,"default"))&&u.push(f)}}}const l=[o,u];return lt(e)&&n.set(e,l),l}function G0(e){return e[0]!=="$"&&!to(e)?!0:(process.env.NODE_ENV!=="production"&&Se(`Invalid prop name: "${e}" is a reserved property.`),!1)}function hV(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function Mx(e,t,r){const n=Ye(t),i=r.propsOptions[0];for(const a in i){let o=i[a];o!=null&&gV(a,n[a],o,process.env.NODE_ENV!=="production"?rn(n):n,!tt(e,a)&&!tt(e,Cn(a)))}}function gV(e,t,r,n,i){const{type:a,required:o,validator:u,skipCheck:c}=r;if(o&&i){Se('Missing required prop: "'+e+'"');return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let l=!1;const s=Oe(a)?a:[a],f=[];for(let p=0;p<s.length&&!l;p++){const{valid:m,expectedType:d}=yV(t,s[p]);f.push(d||""),l=m}if(!l){Se(bV(e,t,f));return}}u&&!u(t,n)&&Se('Invalid prop: custom validator check failed for prop "'+e+'".')}}const vV=ja("String,Number,Boolean,Function,Symbol,BigInt");function yV(e,t){let r;const n=hV(t);if(vV(n)){const i=typeof e;r=i===n.toLowerCase(),!r&&i==="object"&&(r=e instanceof t)}else n==="Object"?r=lt(e):n==="Array"?r=Oe(e):n==="null"?r=e===null:r=e instanceof t;return{valid:r,expectedType:n}}function bV(e,t,r){if(r.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${e}". Expected ${r.map(ki).join(" | ")}`;const i=r[0],a=mf(t),o=W0(t,i),u=W0(t,a);return r.length===1&&K0(i)&&!xV(i,a)&&(n+=` with value ${o}`),n+=`, got ${a} `,K0(a)&&(n+=`with value ${u}.`),n}function W0(e,t){return t==="String"?`"${e}"`:t==="Number"?`${Number(e)}`:`${e}`}function K0(e){return["string","number","boolean"].some(t=>e.toLowerCase()===t)}function xV(...e){return e.some(t=>t.toLowerCase()==="boolean")}const _x=e=>e[0]==="_"||e==="$stable",Tf=e=>Oe(e)?e.map(qr):[qr(e)],wV=(e,t,r)=>{if(t._n)return t;const n=ro((...i)=>(process.env.NODE_ENV!=="production"&&Bt&&(!r||r.root===Bt.root)&&Se(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),Tf(t(...i))),r);return n._c=!1,n},Fx=(e,t,r)=>{const n=e._ctx;for(const i in e){if(_x(i))continue;const a=e[i];if(Be(a))t[i]=wV(i,a,n);else if(a!=null){process.env.NODE_ENV!=="production"&&Se(`Non-function value encountered for slot "${i}". Prefer function slots for better performance.`);const o=Tf(a);t[i]=()=>o}}},Tx=(e,t)=>{process.env.NODE_ENV!=="production"&&!qo(e.vnode)&&Se("Non-function value encountered for default slot. Prefer function slots for better performance.");const r=Tf(t);e.slots.default=()=>r},dl=(e,t,r)=>{for(const n in t)(r||n!=="_")&&(e[n]=t[n])},NV=(e,t,r)=>{const n=e.slots=Ex();if(e.vnode.shapeFlag&32){const i=t._;i?(dl(n,t,r),r&&tu(n,"_",i,!0)):Fx(t,n)}else t&&Tx(e,t)},DV=(e,t,r)=>{const{vnode:n,slots:i}=e;let a=!0,o=vt;if(n.shapeFlag&32){const u=t._;u?process.env.NODE_ENV!=="production"&&_i?(dl(i,t,r),nn(e,"set","$slots")):r&&u===1?a=!1:dl(i,t,r):(a=!t.$stable,Fx(t,i)),o=t}else t&&(Tx(e,t),o={default:1});if(a)for(const u in i)!_x(u)&&o[u]==null&&delete i[u]};function hl(e,t,r,n,i=!1){if(Oe(e)){e.forEach((p,m)=>hl(p,t&&(Oe(t)?t[m]:t),r,n,i));return}if(no(n)&&!i)return;const a=n.shapeFlag&4?Ku(n.component):n.el,o=i?null:a,{i:u,r:c}=e;if(process.env.NODE_ENV!=="production"&&!u){Se("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const l=t&&t.r,s=u.refs===vt?u.refs={}:u.refs,f=u.setupState;if(l!=null&&l!==c&&(xt(l)?(s[l]=null,tt(f,l)&&(f[l]=null)):Lt(l)&&(l.value=null)),Be(c))En(c,u,12,[o,s]);else{const p=xt(c),m=Lt(c);if(p||m){const d=()=>{if(e.f){const h=p?tt(f,c)?f[c]:s[c]:c.value;i?Oe(h)&&ff(h,a):Oe(h)?h.includes(a)||h.push(a):p?(s[c]=[a],tt(f,c)&&(f[c]=s[c])):(c.value=[a],e.k&&(s[e.k]=c.value))}else p?(s[c]=o,tt(f,c)&&(f[c]=o)):m?(c.value=o,e.k&&(s[e.k]=o)):process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)};o?(d.id=-1,pr(d,r)):d()}else process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)}}const EV=Symbol("_vte"),AV=e=>e.__isTeleport;let ms,Jn;function gn(e,t){e.appContext.config.performance&&ou()&&Jn.mark(`vue-${t}-${e.uid}`),process.env.NODE_ENV!=="production"&&IP(e,t,ou()?Jn.now():Date.now())}function vn(e,t){if(e.appContext.config.performance&&ou()){const r=`vue-${t}-${e.uid}`,n=r+":end";Jn.mark(n),Jn.measure(`<${Qu(e,e.type)}> ${t}`,r,n),Jn.clearMarks(r),Jn.clearMarks(n)}process.env.NODE_ENV!=="production"&&RP(e,t,ou()?Jn.now():Date.now())}function ou(){return ms!==void 0||(typeof window<"u"&&window.performance?(ms=!0,Jn=window.performance):ms=!1),ms}function SV(){const e=[];if(process.env.NODE_ENV!=="production"&&e.length){const t=e.length>1;console.warn(`Feature flag${t?"s":""} ${e.join(", ")} ${t?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
92
|
+
`,...SP(i)),console.warn(...a)}In(),Ac=!1}function AP(){let e=_i[_i.length-1];if(!e)return[];const t=[];for(;e;){const r=t[0];r&&r.vnode===e?r.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function SP(e){const t=[];return e.forEach((r,n)=>{t.push(...n===0?[]:[`
|
|
93
|
+
`],...CP(r))}),t}function CP({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,i=` at <${tc(e.component,e.type,n)}`,a=">"+r;return e.props?[i,...MP(e.props),a]:[i+a]}function MP(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...ax(n,e[n]))}),r.length>3&&t.push(" ..."),t}function ax(e,t,r){return xt(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Lt(t)?(t=ax(e,Ye(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):Be(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Ye(t),r?t:[`${e}=`,t])}function _P(e,t){process.env.NODE_ENV!=="production"&&e!==void 0&&(typeof e!="number"?Se(`${t} is not a valid number - got ${JSON.stringify(e)}.`):isNaN(e)&&Se(`${t} is NaN - the duration expression might be incorrect.`))}const Ff={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update"};function En(e,t,r,n){try{return n?e(...n):e()}catch(i){jo(i,t,r)}}function _r(e,t,r,n){if(Be(e)){const i=En(e,t,r,n);return i&&yf(i)&&i.catch(a=>{jo(a,t,r)}),i}if(Oe(e)){const i=[];for(let a=0;a<e.length;a++)i.push(_r(e[a],t,r,n));return i}else process.env.NODE_ENV!=="production"&&Se(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function jo(e,t,r,n=!0){const i=t?t.vnode:null;if(t){let a=t.parent;const o=t.proxy,u=process.env.NODE_ENV!=="production"?Ff[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const l=a.ec;if(l){for(let s=0;s<l.length;s++)if(l[s](e,o,u)===!1)return}a=a.parent}const c=t.appContext.config.errorHandler;if(c){kn(),En(c,null,10,[e,o,u]),In();return}}FP(e,r,i,n)}function FP(e,t,r,n=!0){if(process.env.NODE_ENV!=="production"){const i=Ff[t];if(r&&Ss(r),Se(`Unhandled error${i?` during execution of ${i}`:""}`),r&&Cs(),n)throw e;console.error(e)}else console.error(e)}let vo=!1,pl=!1;const Zt=[];let Yr=0;const pa=[];let Un=null,bi=0;const ox=Promise.resolve();let Tf=null;const TP=100;function sx(e){const t=Tf||ox;return e?t.then(this?e.bind(this):e):t}function OP(e){let t=Yr+1,r=Zt.length;for(;t<r;){const n=t+r>>>1,i=Zt[n],a=yo(i);a<e||a===e&&i.pre?t=n+1:r=n}return t}function Wu(e){(!Zt.length||!Zt.includes(e,vo&&e.allowRecurse?Yr+1:Yr))&&(e.id==null?Zt.push(e):Zt.splice(OP(e.id),0,e),ux())}function ux(){!vo&&!pl&&(pl=!0,Tf=ox.then(fx))}function BP(e){const t=Zt.indexOf(e);t>Yr&&Zt.splice(t,1)}function cx(e){Oe(e)?pa.push(...e):(!Un||!Un.includes(e,e.allowRecurse?bi+1:bi))&&pa.push(e),ux()}function G0(e,t,r=vo?Yr+1:0){for(process.env.NODE_ENV!=="production"&&(t=t||new Map);r<Zt.length;r++){const n=Zt[r];if(n&&n.pre){if(e&&n.id!==e.uid||process.env.NODE_ENV!=="production"&&Of(t,n))continue;Zt.splice(r,1),r--,n()}}}function lx(e){if(pa.length){const t=[...new Set(pa)].sort((r,n)=>yo(r)-yo(n));if(pa.length=0,Un){Un.push(...t);return}for(Un=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),bi=0;bi<Un.length;bi++){const r=Un[bi];process.env.NODE_ENV!=="production"&&Of(e,r)||r.active!==!1&&r()}Un=null,bi=0}}const yo=e=>e.id==null?1/0:e.id,kP=(e,t)=>{const r=yo(e)-yo(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function fx(e){pl=!1,vo=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),Zt.sort(kP);const t=process.env.NODE_ENV!=="production"?r=>Of(e,r):St;try{for(Yr=0;Yr<Zt.length;Yr++){const r=Zt[Yr];if(r&&r.active!==!1){if(process.env.NODE_ENV!=="production"&&t(r))continue;En(r,r.i,r.i?15:14)}}}finally{Yr=0,Zt.length=0,lx(e),vo=!1,Tf=null,(Zt.length||pa.length)&&fx(e)}}function Of(e,t){if(!e.has(t))e.set(t,1);else{const r=e.get(t);if(r>TP){const n=t.i,i=n&&Lf(n.type);return jo(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else e.set(t,r+1)}}let Fi=!1;const Ms=new Map;process.env.NODE_ENV!=="production"&&(wf().__VUE_HMR_RUNTIME__={createRecord:Sc(px),rerender:Sc(qP),reload:Sc(zP)});const qi=new Map;function IP(e){const t=e.type.__hmrId;let r=qi.get(t);r||(px(t,e.type),r=qi.get(t)),r.instances.add(e)}function RP(e){qi.get(e.type.__hmrId).instances.delete(e)}function px(e,t){return qi.has(e)?!1:(qi.set(e,{initialDef:su(t),instances:new Set}),!0)}function su(e){return Yx(e)?e.__vccOpts:e}function qP(e,t){const r=qi.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,su(n.type).render=t),n.renderCache=[],Fi=!0,n.effect.dirty=!0,n.update(),Fi=!1}))}function zP(e,t){const r=qi.get(e);if(!r)return;t=su(t),K0(r.initialDef,t);const n=[...r.instances];for(let i=0;i<n.length;i++){const a=n[i],o=su(a.type);let u=Ms.get(o);u||(o!==r.initialDef&&K0(o,t),Ms.set(o,u=new Set)),u.add(a),a.appContext.propsCache.delete(a.type),a.appContext.emitsCache.delete(a.type),a.appContext.optionsCache.delete(a.type),a.ceReload?(u.add(a),a.ceReload(t.styles),u.delete(a)):a.parent?(a.parent.effect.dirty=!0,Wu(()=>{a.parent.update(),u.delete(a)})):a.appContext.reload?a.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}cx(()=>{Ms.clear()})}function K0(e,t){Et(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function Sc(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let en,no=[],ml=!1;function Lo(e,...t){en?en.emit(e,...t):ml||no.push({event:e,args:t})}function mx(e,t){var r,n;en=e,en?(en.enabled=!0,no.forEach(({event:i,args:a})=>en.emit(i,...a)),no=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{mx(i,t)}),setTimeout(()=>{en||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ml=!0,no=[])},3e3)):(ml=!0,no=[])}function jP(e,t){Lo("app:init",e,t,{Fragment:mr,Text:Vo,Comment:Mt,Static:Fs})}function LP(e){Lo("app:unmount",e)}const PP=Bf("component:added"),dx=Bf("component:updated"),VP=Bf("component:removed"),UP=e=>{en&&typeof en.cleanupBuffer=="function"&&!en.cleanupBuffer(e)&&VP(e)};/*! #__NO_SIDE_EFFECTS__ */function Bf(e){return t=>{Lo(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}const $P=hx("perf:start"),HP=hx("perf:end");function hx(e){return(t,r,n)=>{Lo(e,t.appContext.app,t.uid,t,r,n)}}function JP(e,t,r){Lo("component:emit",e.appContext.app,e,t,r)}let _t=null,gx=null;function uu(e){const t=_t;return _t=e,gx=e&&e.type.__scopeId||null,t}function oo(e,t=_t,r){if(!t||e._n)return e;const n=(...i)=>{n._d&&sg(-1);const a=uu(t);let o;try{o=e(...i)}finally{uu(a),n._d&&sg(1)}return process.env.NODE_ENV!=="production"&&dx(t),o};return n._n=!0,n._c=!0,n._d=!0,n}function vx(e){LL(e)&&Se("Do not use built-in directive ids as custom directive id: "+e)}function yx(e,t){if(_t===null)return process.env.NODE_ENV!=="production"&&Se("withDirectives can only be used inside render functions."),e;const r=ec(_t),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[a,o,u,c=vt]=t[i];a&&(Be(a)&&(a={mounted:a,updated:a}),a.deep&&Gn(o),n.push({dir:a,instance:r,value:o,oldValue:void 0,arg:u,modifiers:c}))}return e}function pi(e,t,r,n){const i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){const u=i[o];a&&(u.oldValue=a[o].value);let c=u.dir[n];c&&(kn(),_r(c,r,8,[e.el,u,e,t]),In())}}const $n=Symbol("_leaveCb"),gs=Symbol("_enterCb");function GP(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Zu(()=>{e.isMounted=!0}),Ex(()=>{e.isUnmounting=!0}),e}const Ar=[Function,Array],bx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ar,onEnter:Ar,onAfterEnter:Ar,onEnterCancelled:Ar,onBeforeLeave:Ar,onLeave:Ar,onAfterLeave:Ar,onLeaveCancelled:Ar,onBeforeAppear:Ar,onAppear:Ar,onAfterAppear:Ar,onAppearCancelled:Ar},xx=e=>{const t=e.subTree;return t.component?xx(t.component):t},KP={name:"BaseTransition",props:bx,setup(e,{slots:t}){const r=ri(),n=GP();return()=>{const i=t.default&&Nx(t.default(),!0);if(!i||!i.length)return;let a=i[0];if(i.length>1){let p=!1;for(const m of i)if(m.type!==Mt){if(process.env.NODE_ENV!=="production"&&p){Se("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(a=m,p=!0,process.env.NODE_ENV==="production")break}}const o=Ye(e),{mode:u}=o;if(process.env.NODE_ENV!=="production"&&u&&u!=="in-out"&&u!=="out-in"&&u!=="default"&&Se(`invalid <transition> mode: ${u}`),n.isLeaving)return Cc(a);const c=W0(a);if(!c)return Cc(a);let l=dl(c,o,n,r,p=>l=p);cu(c,l);const s=r.subTree,f=s&&W0(s);if(f&&f.type!==Mt&&!wi(c,f)&&xx(r).type!==Mt){const p=dl(f,o,n,r);if(cu(f,p),u==="out-in"&&c.type!==Mt)return n.isLeaving=!0,p.afterLeave=()=>{n.isLeaving=!1,r.update.active!==!1&&(r.effect.dirty=!0,r.update())},Cc(a);u==="in-out"&&c.type!==Mt&&(p.delayLeave=(m,d,h)=>{const w=wx(n,f);w[String(f.key)]=f,m[$n]=()=>{d(),m[$n]=void 0,delete l.delayedLeave},l.delayedLeave=h})}return a}}},WP=KP;function wx(e,t){const{leavingVNodes:r}=e;let n=r.get(t.type);return n||(n=Object.create(null),r.set(t.type,n)),n}function dl(e,t,r,n,i){const{appear:a,mode:o,persisted:u=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:s,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:w,onAppear:v,onAfterAppear:x,onAppearCancelled:g}=t,b=String(e.key),y=wx(r,e),N=(D,S)=>{D&&_r(D,n,9,S)},E=(D,S)=>{const C=S[1];N(D,S),Oe(D)?D.every(_=>_.length<=1)&&C():D.length<=1&&C()},A={mode:o,persisted:u,beforeEnter(D){let S=c;if(!r.isMounted)if(a)S=w||c;else return;D[$n]&&D[$n](!0);const C=y[b];C&&wi(e,C)&&C.el[$n]&&C.el[$n](),N(S,[D])},enter(D){let S=l,C=s,_=f;if(!r.isMounted)if(a)S=v||l,C=x||s,_=g||f;else return;let R=!1;const P=D[gs]=I=>{R||(R=!0,I?N(_,[D]):N(C,[D]),A.delayedLeave&&A.delayedLeave(),D[gs]=void 0)};S?E(S,[D,P]):P()},leave(D,S){const C=String(e.key);if(D[gs]&&D[gs](!0),r.isUnmounting)return S();N(p,[D]);let _=!1;const R=D[$n]=P=>{_||(_=!0,S(),P?N(h,[D]):N(d,[D]),D[$n]=void 0,y[C]===e&&delete y[C])};y[C]=e,m?E(m,[D,R]):R()},clone(D){const S=dl(D,t,r,n,i);return i&&i(S),S}};return A}function Cc(e){if(Po(e))return e=un(e),e.children=null,e}function W0(e){if(!Po(e))return e;if(process.env.NODE_ENV!=="production"&&e.component)return e.component.subTree;const{shapeFlag:t,children:r}=e;if(r){if(t&16)return r[0];if(t&32&&Be(r.default))return r.default()}}function cu(e,t){e.shapeFlag&6&&e.component?cu(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Nx(e,t=!1,r){let n=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];const u=r==null?o.key:String(r)+String(o.key!=null?o.key:a);o.type===mr?(o.patchFlag&128&&i++,n=n.concat(Nx(o.children,t,u))):(t||o.type!==Mt)&&n.push(u!=null?un(o,{key:u}):o)}if(i>1)for(let a=0;a<n.length;a++)n[a].patchFlag=-2;return n}/*! #__NO_SIDE_EFFECTS__ */function Zr(e,t){return Be(e)?Et({name:e.name},t,{setup:e}):e}const so=e=>!!e.type.__asyncLoader,Po=e=>e.type.__isKeepAlive;function QP(e,t){Dx(e,"a",t)}function ZP(e,t){Dx(e,"da",t)}function Dx(e,t,r=Bt){const n=e.__wdc||(e.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Qu(t,n,r),r){let i=r.parent;for(;i&&i.parent;)Po(i.parent.vnode)&&XP(n,t,r,i),i=i.parent}}function XP(e,t,r,n){const i=Qu(t,e,n,!0);Ax(()=>{vf(n[t],i)},r)}function Qu(e,t,r=Bt,n=!1){if(r){const i=r[e]||(r[e]=[]),a=t.__weh||(t.__weh=(...o)=>{kn();const u=Uo(r),c=_r(t,r,e,o);return u(),In(),c});return n?i.unshift(a):i.push(a),a}else if(process.env.NODE_ENV!=="production"){const i=yi(Ff[e].replace(/ hook$/,""));Se(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Rn=e=>(t,r=Bt)=>{(!Yu||e==="sp")&&Qu(e,(...n)=>t(...n),r)},YP=Rn("bm"),Zu=Rn("m"),eV=Rn("bu"),tV=Rn("u"),Ex=Rn("bum"),Ax=Rn("um"),rV=Rn("sp"),nV=Rn("rtg"),iV=Rn("rtc");function aV(e,t=Bt){Qu("ec",e,t)}const oV="components",Sx=Symbol.for("v-ndc");function sV(e){return xt(e)?uV(oV,e,!1)||e:e||Sx}function uV(e,t,r=!0,n=!1){const i=_t||Bt;if(i){const a=i.type;{const u=Lf(a,!1);if(u&&(u===t||u===wr(t)||u===Ri(wr(t))))return a}const o=Q0(i[e]||a[e],t)||Q0(i.appContext[e],t);return!o&&n?a:(process.env.NODE_ENV!=="production"&&r&&!o&&Se(`Failed to resolve ${e.slice(0,-1)}: ${t}
|
|
94
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),o)}else process.env.NODE_ENV!=="production"&&Se(`resolve${Ri(e.slice(0,-1))} can only be used in render() or setup().`)}function Q0(e,t){return e&&(e[t]||e[wr(t)]||e[Ri(wr(t))])}function kf(e,t,r={},n,i){if(_t.isCE||_t.parent&&so(_t.parent)&&_t.parent.isCE)return $t("slot",r,n&&n());let a=e[t];process.env.NODE_ENV!=="production"&&a&&a.length>1&&(Se("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),a=()=>[]),a&&a._c&&(a._d=!1),Wt();const o=a&&Cx(a(r)),u=xi(mr,{key:(r.key||o&&o.key||`_${t}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),a&&a._c&&(a._d=!0),u}function Cx(e){return e.some(t=>ti(t)?!(t.type===Mt||t.type===mr&&!Cx(t.children)):!0)?e:null}const hl=e=>e?Zx(e)?ec(e):hl(e.parent):null,Ti=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?rn(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?rn(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?rn(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?rn(e.refs):e.refs,$parent:e=>hl(e.parent),$root:e=>hl(e.root),$emit:e=>e.emit,$options:e=>Rf(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Wu(e.update)}),$nextTick:e=>e.n||(e.n=sx.bind(e.proxy)),$watch:e=>VV.bind(e)}),If=e=>e==="_"||e==="$",Mc=(e,t)=>e!==vt&&!e.__isScriptSetup&&tt(e,t),Mx={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:a,accessCache:o,type:u,appContext:c}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let l;if(t[0]!=="$"){const m=o[t];if(m!==void 0)switch(m){case 1:return n[t];case 2:return i[t];case 4:return r[t];case 3:return a[t]}else{if(Mc(n,t))return o[t]=1,n[t];if(i!==vt&&tt(i,t))return o[t]=2,i[t];if((l=e.propsOptions[0])&&tt(l,t))return o[t]=3,a[t];if(r!==vt&&tt(r,t))return o[t]=4,r[t];gl&&(o[t]=0)}}const s=Ti[t];let f,p;if(s)return t==="$attrs"?(Ht(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&pu()):process.env.NODE_ENV!=="production"&&t==="$slots"&&Ht(e,"get",t),s(e);if((f=u.__cssModules)&&(f=f[t]))return f;if(r!==vt&&tt(r,t))return o[t]=4,r[t];if(p=c.config.globalProperties,tt(p,t))return p[t];process.env.NODE_ENV!=="production"&&_t&&(!xt(t)||t.indexOf("__v")!==0)&&(i!==vt&&If(t[0])&&tt(i,t)?Se(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===_t&&Se(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,r){const{data:n,setupState:i,ctx:a}=e;return Mc(i,t)?(i[t]=r,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&tt(i,t)?(Se(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):n!==vt&&tt(n,t)?(n[t]=r,!0):tt(e.props,t)?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:r}):a[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:n,appContext:i,propsOptions:a}},o){let u;return!!r[o]||e!==vt&&tt(e,o)||Mc(t,o)||(u=a[0])&&tt(u,o)||tt(n,o)||tt(Ti,o)||tt(i.config.globalProperties,o)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:tt(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};process.env.NODE_ENV!=="production"&&(Mx.ownKeys=e=>(Se("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function cV(e){const t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(Ti).forEach(r=>{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:()=>Ti[r](e),set:St})}),t}function lV(e){const{ctx:t,propsOptions:[r]}=e;r&&Object.keys(r).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:St})})}function fV(e){const{ctx:t,setupState:r}=e;Object.keys(Ye(r)).forEach(n=>{if(!r.__isScriptSetup){if(If(n[0])){Se(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r[n],set:St})}})}function Z0(e){return Oe(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function pV(){const e=Object.create(null);return(t,r)=>{e[r]?Se(`${t} property "${r}" is already defined in ${e[r]}.`):e[r]=t}}let gl=!0;function mV(e){const t=Rf(e),r=e.proxy,n=e.ctx;gl=!1,t.beforeCreate&&X0(t.beforeCreate,e,"bc");const{data:i,computed:a,methods:o,watch:u,provide:c,inject:l,created:s,beforeMount:f,mounted:p,beforeUpdate:m,updated:d,activated:h,deactivated:w,beforeDestroy:v,beforeUnmount:x,destroyed:g,unmounted:b,render:y,renderTracked:N,renderTriggered:E,errorCaptured:A,serverPrefetch:D,expose:S,inheritAttrs:C,components:_,directives:R,filters:P}=t,I=process.env.NODE_ENV!=="production"?pV():null;if(process.env.NODE_ENV!=="production"){const[F]=e.propsOptions;if(F)for(const q in F)I("Props",q)}if(l&&dV(l,n,I),o)for(const F in o){const q=o[F];Be(q)?(process.env.NODE_ENV!=="production"?Object.defineProperty(n,F,{value:q.bind(r),configurable:!0,enumerable:!0,writable:!0}):n[F]=q.bind(r),process.env.NODE_ENV!=="production"&&I("Methods",F)):process.env.NODE_ENV!=="production"&&Se(`Method "${F}" has type "${typeof q}" in the component definition. Did you reference the function correctly?`)}if(i){process.env.NODE_ENV!=="production"&&!Be(i)&&Se("The data option must be a function. Plain object usage is no longer supported.");const F=i.call(r,r);if(process.env.NODE_ENV!=="production"&&yf(F)&&Se("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!lt(F))process.env.NODE_ENV!=="production"&&Se("data() should return an object.");else if(e.data=Cf(F),process.env.NODE_ENV!=="production")for(const q in F)I("Data",q),If(q[0])||Object.defineProperty(n,q,{configurable:!0,enumerable:!0,get:()=>F[q],set:St})}if(gl=!0,a)for(const F in a){const q=a[F],k=Be(q)?q.bind(r,r):Be(q.get)?q.get.bind(r,r):St;process.env.NODE_ENV!=="production"&&k===St&&Se(`Computed property "${F}" has no getter.`);const te=!Be(q)&&Be(q.set)?q.set.bind(r):process.env.NODE_ENV!=="production"?()=>{Se(`Write operation failed: computed property "${F}" is readonly.`)}:St,se=yt({get:k,set:te});Object.defineProperty(n,F,{enumerable:!0,configurable:!0,get:()=>se.value,set:W=>se.value=W}),process.env.NODE_ENV!=="production"&&I("Computed",F)}if(u)for(const F in u)_x(u[F],n,r,F);if(c){const F=Be(c)?c.call(r):c;Reflect.ownKeys(F).forEach(q=>{Tx(q,F[q])})}s&&X0(s,e,"c");function O(F,q){Oe(q)?q.forEach(k=>F(k.bind(r))):q&&F(q.bind(r))}if(O(YP,f),O(Zu,p),O(eV,m),O(tV,d),O(QP,h),O(ZP,w),O(aV,A),O(iV,N),O(nV,E),O(Ex,x),O(Ax,b),O(rV,D),Oe(S))if(S.length){const F=e.exposed||(e.exposed={});S.forEach(q=>{Object.defineProperty(F,q,{get:()=>r[q],set:k=>r[q]=k})})}else e.exposed||(e.exposed={});y&&e.render===St&&(e.render=y),C!=null&&(e.inheritAttrs=C),_&&(e.components=_),R&&(e.directives=R)}function dV(e,t,r=St){Oe(e)&&(e=vl(e));for(const n in e){const i=e[n];let a;lt(i)?"default"in i?a=an(i.from||n,i.default,!0):a=an(i.from||n):a=an(i),Lt(a)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:o=>a.value=o}):t[n]=a,process.env.NODE_ENV!=="production"&&r("Inject",n)}}function X0(e,t,r){_r(Oe(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,r)}function _x(e,t,r,n){const i=n.includes(".")?Ux(r,n):()=>r[n];if(xt(e)){const a=t[e];Be(a)?da(i,a):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e}"`,a)}else if(Be(e))da(i,e.bind(r));else if(lt(e))if(Oe(e))e.forEach(a=>_x(a,t,r,n));else{const a=Be(e.handler)?e.handler.bind(r):t[e.handler];Be(a)?da(i,a,e):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e.handler}"`,a)}else process.env.NODE_ENV!=="production"&&Se(`Invalid watch option: "${n}"`,e)}function Rf(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,u=a.get(t);let c;return u?c=u:!i.length&&!r&&!n?c=t:(c={},i.length&&i.forEach(l=>lu(c,l,o,!0)),lu(c,t,o)),lt(t)&&a.set(t,c),c}function lu(e,t,r,n=!1){const{mixins:i,extends:a}=t;a&&lu(e,a,r,!0),i&&i.forEach(o=>lu(e,o,r,!0));for(const o in t)if(n&&o==="expose")process.env.NODE_ENV!=="production"&&Se('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=hV[o]||r&&r[o];e[o]=u?u(e[o],t[o]):t[o]}return e}const hV={data:Y0,props:eg,emits:eg,methods:io,computed:io,beforeCreate:rr,created:rr,beforeMount:rr,mounted:rr,beforeUpdate:rr,updated:rr,beforeDestroy:rr,beforeUnmount:rr,destroyed:rr,unmounted:rr,activated:rr,deactivated:rr,errorCaptured:rr,serverPrefetch:rr,components:io,directives:io,watch:vV,provide:Y0,inject:gV};function Y0(e,t){return t?e?function(){return Et(Be(e)?e.call(this,this):e,Be(t)?t.call(this,this):t)}:t:e}function gV(e,t){return io(vl(e),vl(t))}function vl(e){if(Oe(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function rr(e,t){return e?[...new Set([].concat(e,t))]:t}function io(e,t){return e?Et(Object.create(null),e,t):t}function eg(e,t){return e?Oe(e)&&Oe(t)?[...new Set([...e,...t])]:Et(Object.create(null),Z0(e),Z0(t??{})):t}function vV(e,t){if(!e)return t;if(!t)return e;const r=Et(Object.create(null),e);for(const n in t)r[n]=rr(e[n],t[n]);return r}function Fx(){return{app:null,config:{isNativeTag:zL,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let yV=0;function bV(e,t){return function(r,n=null){Be(r)||(r=Et({},r)),n!=null&&!lt(n)&&(process.env.NODE_ENV!=="production"&&Se("root props passed to app.mount() must be an object."),n=null);const i=Fx(),a=new WeakSet;let o=!1;const u=i.app={_uid:yV++,_component:r,_props:n,_container:null,_context:i,_instance:null,version:fg,get config(){return i.config},set config(c){process.env.NODE_ENV!=="production"&&Se("app.config cannot be replaced. Modify individual options instead.")},use(c,...l){return a.has(c)?process.env.NODE_ENV!=="production"&&Se("Plugin has already been applied to target app."):c&&Be(c.install)?(a.add(c),c.install(u,...l)):Be(c)?(a.add(c),c(u,...l)):process.env.NODE_ENV!=="production"&&Se('A plugin must either be a function or an object with an "install" function.'),u},mixin(c){return i.mixins.includes(c)?process.env.NODE_ENV!=="production"&&Se("Mixin has already been applied to target app"+(c.name?`: ${c.name}`:"")):i.mixins.push(c),u},component(c,l){return process.env.NODE_ENV!=="production"&&Dl(c,i.config),l?(process.env.NODE_ENV!=="production"&&i.components[c]&&Se(`Component "${c}" has already been registered in target app.`),i.components[c]=l,u):i.components[c]},directive(c,l){return process.env.NODE_ENV!=="production"&&vx(c),l?(process.env.NODE_ENV!=="production"&&i.directives[c]&&Se(`Directive "${c}" has already been registered in target app.`),i.directives[c]=l,u):i.directives[c]},mount(c,l,s){if(o)process.env.NODE_ENV!=="production"&&Se("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!=="production"&&c.__vue_app__&&Se("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const f=$t(r,n);return f.appContext=i,s===!0?s="svg":s===!1&&(s=void 0),process.env.NODE_ENV!=="production"&&(i.reload=()=>{e(un(f),c,s)}),l&&t?t(f,c):e(f,c,s),o=!0,u._container=c,c.__vue_app__=u,process.env.NODE_ENV!=="production"&&(u._instance=f.component,jP(u,fg)),ec(f.component)}},unmount(){o?(e(null,u._container),process.env.NODE_ENV!=="production"&&(u._instance=null,LP(u)),delete u._container.__vue_app__):process.env.NODE_ENV!=="production"&&Se("Cannot unmount an app that is not mounted.")},provide(c,l){return process.env.NODE_ENV!=="production"&&c in i.provides&&Se(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`),i.provides[c]=l,u},runWithContext(c){const l=ma;ma=u;try{return c()}finally{ma=l}}};return u}}let ma=null;function Tx(e,t){if(!Bt)process.env.NODE_ENV!=="production"&&Se("provide() can only be used inside setup().");else{let r=Bt.provides;const n=Bt.parent&&Bt.parent.provides;n===r&&(r=Bt.provides=Object.create(n)),r[e]=t}}function an(e,t,r=!1){const n=Bt||_t;if(n||ma){const i=ma?ma._context.provides:n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return r&&Be(t)?t.call(n&&n.proxy):t;process.env.NODE_ENV!=="production"&&Se(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&Se("inject() can only be used inside setup() or functional components.")}const Ox={},Bx=()=>Object.create(Ox),kx=e=>Object.getPrototypeOf(e)===Ox;function xV(e,t,r,n=!1){const i={},a=Bx();e.propsDefaults=Object.create(null),Ix(e,t,i,a);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);process.env.NODE_ENV!=="production"&&qx(t||{},i,e),r?e.props=n?i:tx(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function wV(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function NV(e,t,r,n){const{props:i,attrs:a,vnode:{patchFlag:o}}=e,u=Ye(i),[c]=e.propsOptions;let l=!1;if(!(process.env.NODE_ENV!=="production"&&wV(e))&&(n||o>0)&&!(o&16)){if(o&8){const s=e.vnode.dynamicProps;for(let f=0;f<s.length;f++){let p=s[f];if(Xu(e.emitsOptions,p))continue;const m=t[p];if(c)if(tt(a,p))m!==a[p]&&(a[p]=m,l=!0);else{const d=wr(p);i[d]=yl(c,u,d,m,e,!1)}else m!==a[p]&&(a[p]=m,l=!0)}}}else{Ix(e,t,i,a)&&(l=!0);let s;for(const f in u)(!t||!tt(t,f)&&((s=Cn(f))===f||!tt(t,s)))&&(c?r&&(r[f]!==void 0||r[s]!==void 0)&&(i[f]=yl(c,u,f,void 0,e,!0)):delete i[f]);if(a!==u)for(const f in a)(!t||!tt(t,f))&&(delete a[f],l=!0)}l&&nn(e.attrs,"set",""),process.env.NODE_ENV!=="production"&&qx(t||{},i,e)}function Ix(e,t,r,n){const[i,a]=e.propsOptions;let o=!1,u;if(t)for(let c in t){if(ao(c))continue;const l=t[c];let s;i&&tt(i,s=wr(c))?!a||!a.includes(s)?r[s]=l:(u||(u={}))[s]=l:Xu(e.emitsOptions,c)||(!(c in n)||l!==n[c])&&(n[c]=l,o=!0)}if(a){const c=Ye(r),l=u||vt;for(let s=0;s<a.length;s++){const f=a[s];r[f]=yl(i,c,f,l[f],e,!tt(l,f))}}return o}function yl(e,t,r,n,i,a){const o=e[r];if(o!=null){const u=tt(o,"default");if(u&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&Be(c)){const{propsDefaults:l}=i;if(r in l)n=l[r];else{const s=Uo(i);n=l[r]=c.call(null,t),s()}}else n=c}o[0]&&(a&&!u?n=!1:o[1]&&(n===""||n===Cn(r))&&(n=!0))}return n}const DV=new WeakMap;function Rx(e,t,r=!1){const n=r?DV:t.propsCache,i=n.get(e);if(i)return i;const a=e.props,o={},u=[];let c=!1;if(!Be(e)){const s=f=>{c=!0;const[p,m]=Rx(f,t,!0);Et(o,p),m&&u.push(...m)};!r&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}if(!a&&!c)return lt(e)&&n.set(e,la),la;if(Oe(a))for(let s=0;s<a.length;s++){process.env.NODE_ENV!=="production"&&!xt(a[s])&&Se("props must be strings when using array syntax.",a[s]);const f=wr(a[s]);tg(f)&&(o[f]=vt)}else if(a){process.env.NODE_ENV!=="production"&&!lt(a)&&Se("invalid props options",a);for(const s in a){const f=wr(s);if(tg(f)){const p=a[s],m=o[f]=Oe(p)||Be(p)?{type:p}:Et({},p),d=m.type;let h=!1,w=!0;if(Oe(d))for(let v=0;v<d.length;++v){const x=d[v],g=Be(x)&&x.name;if(g==="Boolean"){h=!0;break}else g==="String"&&(w=!1)}else h=Be(d)&&d.name==="Boolean";m[0]=h,m[1]=w,(h||tt(m,"default"))&&u.push(f)}}}const l=[o,u];return lt(e)&&n.set(e,l),l}function tg(e){return e[0]!=="$"&&!ao(e)?!0:(process.env.NODE_ENV!=="production"&&Se(`Invalid prop name: "${e}" is a reserved property.`),!1)}function EV(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function qx(e,t,r){const n=Ye(t),i=r.propsOptions[0];for(const a in i){let o=i[a];o!=null&&AV(a,n[a],o,process.env.NODE_ENV!=="production"?rn(n):n,!tt(e,a)&&!tt(e,Cn(a)))}}function AV(e,t,r,n,i){const{type:a,required:o,validator:u,skipCheck:c}=r;if(o&&i){Se('Missing required prop: "'+e+'"');return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let l=!1;const s=Oe(a)?a:[a],f=[];for(let p=0;p<s.length&&!l;p++){const{valid:m,expectedType:d}=CV(t,s[p]);f.push(d||""),l=m}if(!l){Se(MV(e,t,f));return}}u&&!u(t,n)&&Se('Invalid prop: custom validator check failed for prop "'+e+'".')}}const SV=Va("String,Number,Boolean,Function,Symbol,BigInt");function CV(e,t){let r;const n=EV(t);if(SV(n)){const i=typeof e;r=i===n.toLowerCase(),!r&&i==="object"&&(r=e instanceof t)}else n==="Object"?r=lt(e):n==="Array"?r=Oe(e):n==="null"?r=e===null:r=e instanceof t;return{valid:r,expectedType:n}}function MV(e,t,r){if(r.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${e}". Expected ${r.map(Ri).join(" | ")}`;const i=r[0],a=bf(t),o=rg(t,i),u=rg(t,a);return r.length===1&&ng(i)&&!_V(i,a)&&(n+=` with value ${o}`),n+=`, got ${a} `,ng(a)&&(n+=`with value ${u}.`),n}function rg(e,t){return t==="String"?`"${e}"`:t==="Number"?`${Number(e)}`:`${e}`}function ng(e){return["string","number","boolean"].some(t=>e.toLowerCase()===t)}function _V(...e){return e.some(t=>t.toLowerCase()==="boolean")}const zx=e=>e[0]==="_"||e==="$stable",qf=e=>Oe(e)?e.map(qr):[qr(e)],FV=(e,t,r)=>{if(t._n)return t;const n=oo((...i)=>(process.env.NODE_ENV!=="production"&&Bt&&(!r||r.root===Bt.root)&&Se(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),qf(t(...i))),r);return n._c=!1,n},jx=(e,t,r)=>{const n=e._ctx;for(const i in e){if(zx(i))continue;const a=e[i];if(Be(a))t[i]=FV(i,a,n);else if(a!=null){process.env.NODE_ENV!=="production"&&Se(`Non-function value encountered for slot "${i}". Prefer function slots for better performance.`);const o=qf(a);t[i]=()=>o}}},Lx=(e,t)=>{process.env.NODE_ENV!=="production"&&!Po(e.vnode)&&Se("Non-function value encountered for default slot. Prefer function slots for better performance.");const r=qf(t);e.slots.default=()=>r},bl=(e,t,r)=>{for(const n in t)(r||n!=="_")&&(e[n]=t[n])},TV=(e,t,r)=>{const n=e.slots=Bx();if(e.vnode.shapeFlag&32){const i=t._;i?(bl(n,t,r),r&&ou(n,"_",i,!0)):jx(t,n)}else t&&Lx(e,t)},OV=(e,t,r)=>{const{vnode:n,slots:i}=e;let a=!0,o=vt;if(n.shapeFlag&32){const u=t._;u?process.env.NODE_ENV!=="production"&&Fi?(bl(i,t,r),nn(e,"set","$slots")):r&&u===1?a=!1:bl(i,t,r):(a=!t.$stable,jx(t,i)),o=t}else t&&(Lx(e,t),o={default:1});if(a)for(const u in i)!zx(u)&&o[u]==null&&delete i[u]};function xl(e,t,r,n,i=!1){if(Oe(e)){e.forEach((p,m)=>xl(p,t&&(Oe(t)?t[m]:t),r,n,i));return}if(so(n)&&!i)return;const a=n.shapeFlag&4?ec(n.component):n.el,o=i?null:a,{i:u,r:c}=e;if(process.env.NODE_ENV!=="production"&&!u){Se("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const l=t&&t.r,s=u.refs===vt?u.refs={}:u.refs,f=u.setupState;if(l!=null&&l!==c&&(xt(l)?(s[l]=null,tt(f,l)&&(f[l]=null)):Lt(l)&&(l.value=null)),Be(c))En(c,u,12,[o,s]);else{const p=xt(c),m=Lt(c);if(p||m){const d=()=>{if(e.f){const h=p?tt(f,c)?f[c]:s[c]:c.value;i?Oe(h)&&vf(h,a):Oe(h)?h.includes(a)||h.push(a):p?(s[c]=[a],tt(f,c)&&(f[c]=s[c])):(c.value=[a],e.k&&(s[e.k]=c.value))}else p?(s[c]=o,tt(f,c)&&(f[c]=o)):m?(c.value=o,e.k&&(s[e.k]=o)):process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)};o?(d.id=-1,pr(d,r)):d()}else process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)}}const BV=Symbol("_vte"),kV=e=>e.__isTeleport;let vs,Jn;function gn(e,t){e.appContext.config.performance&&fu()&&Jn.mark(`vue-${t}-${e.uid}`),process.env.NODE_ENV!=="production"&&$P(e,t,fu()?Jn.now():Date.now())}function vn(e,t){if(e.appContext.config.performance&&fu()){const r=`vue-${t}-${e.uid}`,n=r+":end";Jn.mark(n),Jn.measure(`<${tc(e,e.type)}> ${t}`,r,n),Jn.clearMarks(r),Jn.clearMarks(n)}process.env.NODE_ENV!=="production"&&HP(e,t,fu()?Jn.now():Date.now())}function fu(){return vs!==void 0||(typeof window<"u"&&window.performance?(vs=!0,Jn=window.performance):vs=!1),vs}function IV(){const e=[];if(process.env.NODE_ENV!=="production"&&e.length){const t=e.length>1;console.warn(`Feature flag${t?"s":""} ${e.join(", ")} ${t?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
95
95
|
|
|
96
|
-
For more details, see https://link.vuejs.org/feature-flags.`)}}const pr=PV;function CV(e){return MV(e)}function MV(e,t){SV();const r=hf();r.__VUE__=!0,process.env.NODE_ENV!=="production"&&ix(r.__VUE_DEVTOOLS_GLOBAL_HOOK__,r);const{insert:n,remove:i,patchProp:a,createElement:o,createText:u,createComment:c,setText:l,setElementText:s,parentNode:f,nextSibling:p,setScopeId:m=St,insertStaticContent:d}=e,h=($,T,z,J=null,L=null,H=null,G=void 0,Y=null,ee=process.env.NODE_ENV!=="production"&&_i?!1:!!T.dynamicChildren)=>{if($===T)return;$&&!xi($,T)&&(J=de($),V($,L,H,!0),$=null),T.patchFlag===-2&&(ee=!1,T.dynamicChildren=null);const{type:B,ref:j,shapeFlag:Q}=T;switch(B){case zo:w($,T,z,J);break;case Mt:v($,T,z,J);break;case As:$==null?x(T,z,J,G):process.env.NODE_ENV!=="production"&&g($,T,z,G);break;case mr:R($,T,z,J,L,H,G,Y,ee);break;default:Q&1?N($,T,z,J,L,H,G,Y,ee):Q&6?P($,T,z,J,L,H,G,Y,ee):Q&64||Q&128?B.process($,T,z,J,L,H,G,Y,ee,le):process.env.NODE_ENV!=="production"&&Se("Invalid VNode type:",B,`(${typeof B})`)}j!=null&&L&&hl(j,$&&$.ref,H,T||$,!T)},w=($,T,z,J)=>{if($==null)n(T.el=u(T.children),z,J);else{const L=T.el=$.el;T.children!==$.children&&l(L,T.children)}},v=($,T,z,J)=>{$==null?n(T.el=c(T.children||""),z,J):T.el=$.el},x=($,T,z,J)=>{[$.el,$.anchor]=d($.children,T,z,J,$.el,$.anchor)},g=($,T,z,J)=>{if(T.children!==$.children){const L=p($.anchor);y($),[T.el,T.anchor]=d(T.children,z,L,J)}else T.el=$.el,T.anchor=$.anchor},b=({el:$,anchor:T},z,J)=>{let L;for(;$&&$!==T;)L=p($),n($,z,J),$=L;n(T,z,J)},y=({el:$,anchor:T})=>{let z;for(;$&&$!==T;)z=p($),i($),$=z;i(T)},N=($,T,z,J,L,H,G,Y,ee)=>{T.type==="svg"?G="svg":T.type==="math"&&(G="mathml"),$==null?E(T,z,J,L,H,G,Y,ee):S($,T,L,H,G,Y,ee)},E=($,T,z,J,L,H,G,Y)=>{let ee,B;const{props:j,shapeFlag:Q,transition:Z,dirs:ie}=$;if(ee=$.el=o($.type,H,j&&j.is,j),Q&8?s(ee,$.children):Q&16&&D($.children,ee,null,J,L,Ec($,H),G,Y),ie&&pi($,null,J,"created"),A(ee,$,$.scopeId,G,J),j){for(const ye in j)ye!=="value"&&!to(ye)&&a(ee,ye,null,j[ye],H,J);"value"in j&&a(ee,"value",null,j.value,H),(B=j.onVnodeBeforeMount)&&Xr(B,J,$)}process.env.NODE_ENV!=="production"&&(tu(ee,"__vnode",$,!0),tu(ee,"__vueParentComponent",J,!0)),ie&&pi($,null,J,"beforeMount");const oe=_V(L,Z);oe&&Z.beforeEnter(ee),n(ee,T,z),((B=j&&j.onVnodeMounted)||oe||ie)&&pr(()=>{B&&Xr(B,J,$),oe&&Z.enter(ee),ie&&pi($,null,J,"mounted")},L)},A=($,T,z,J,L)=>{if(z&&m($,z),J)for(let H=0;H<J.length;H++)m($,J[H]);if(L){let H=L.subTree;if(process.env.NODE_ENV!=="production"&&H.patchFlag>0&&H.patchFlag&2048&&(H=Of(H.children)||H),T===H){const G=L.vnode;A($,G,G.scopeId,G.slotScopeIds,L.parent)}}},D=($,T,z,J,L,H,G,Y,ee=0)=>{for(let B=ee;B<$.length;B++){const j=$[B]=Y?Hn($[B]):qr($[B]);h(null,j,T,z,J,L,H,G,Y)}},S=($,T,z,J,L,H,G)=>{const Y=T.el=$.el;process.env.NODE_ENV!=="production"&&(Y.__vnode=T);let{patchFlag:ee,dynamicChildren:B,dirs:j}=T;ee|=$.patchFlag&16;const Q=$.props||vt,Z=T.props||vt;let ie;if(z&&mi(z,!1),(ie=Z.onVnodeBeforeUpdate)&&Xr(ie,z,T,$),j&&pi(T,$,z,"beforeUpdate"),z&&mi(z,!0),process.env.NODE_ENV!=="production"&&_i&&(ee=0,G=!1,B=null),(Q.innerHTML&&Z.innerHTML==null||Q.textContent&&Z.textContent==null)&&s(Y,""),B?(C($.dynamicChildren,B,Y,z,J,Ec(T,L),H),process.env.NODE_ENV!=="production"&&Es($,T)):G||k($,T,Y,null,z,J,Ec(T,L),H,!1),ee>0){if(ee&16)_(Y,Q,Z,z,L);else if(ee&2&&Q.class!==Z.class&&a(Y,"class",null,Z.class,L),ee&4&&a(Y,"style",Q.style,Z.style,L),ee&8){const oe=T.dynamicProps;for(let ye=0;ye<oe.length;ye++){const fe=oe[ye],De=Q[fe],Ne=Z[fe];(Ne!==De||fe==="value")&&a(Y,fe,De,Ne,L,z)}}ee&1&&$.children!==T.children&&s(Y,T.children)}else!G&&B==null&&_(Y,Q,Z,z,L);((ie=Z.onVnodeUpdated)||j)&&pr(()=>{ie&&Xr(ie,z,T,$),j&&pi(T,$,z,"updated")},J)},C=($,T,z,J,L,H,G)=>{for(let Y=0;Y<T.length;Y++){const ee=$[Y],B=T[Y],j=ee.el&&(ee.type===mr||!xi(ee,B)||ee.shapeFlag&70)?f(ee.el):z;h(ee,B,j,null,J,L,H,G,!0)}},_=($,T,z,J,L)=>{if(T!==z){if(T!==vt)for(const H in T)!to(H)&&!(H in z)&&a($,H,T[H],null,L,J);for(const H in z){if(to(H))continue;const G=z[H],Y=T[H];G!==Y&&H!=="value"&&a($,H,Y,G,L,J)}"value"in z&&a($,"value",T.value,z.value,L)}},R=($,T,z,J,L,H,G,Y,ee)=>{const B=T.el=$?$.el:u(""),j=T.anchor=$?$.anchor:u("");let{patchFlag:Q,dynamicChildren:Z,slotScopeIds:ie}=T;process.env.NODE_ENV!=="production"&&(_i||Q&2048)&&(Q=0,ee=!1,Z=null),ie&&(Y=Y?Y.concat(ie):ie),$==null?(n(B,z,J),n(j,z,J),D(T.children||[],z,j,L,H,G,Y,ee)):Q>0&&Q&64&&Z&&$.dynamicChildren?(C($.dynamicChildren,Z,z,L,H,G,Y),process.env.NODE_ENV!=="production"?Es($,T):(T.key!=null||L&&T===L.subTree)&&Es($,T,!0)):k($,T,z,j,L,H,G,Y,ee)},P=($,T,z,J,L,H,G,Y,ee)=>{T.slotScopeIds=Y,$==null?T.shapeFlag&512?L.ctx.activate(T,z,J,G,ee):I(T,z,J,L,H,G,ee):O($,T,ee)},I=($,T,z,J,L,H,G)=>{const Y=$.component=WV($,J,L);if(process.env.NODE_ENV!=="production"&&Y.type.__hmrId&&SP(Y),process.env.NODE_ENV!=="production"&&(ws($),gn(Y,"mount")),qo($)&&(Y.ctx.renderer=le),process.env.NODE_ENV!=="production"&&gn(Y,"init"),QV(Y,!1,G),process.env.NODE_ENV!=="production"&&vn(Y,"init"),Y.asyncDep){if(L&&L.registerDep(Y,F,G),!$.el){const ee=Y.subTree=$t(Mt);v(null,ee,T,z)}}else F(Y,$,T,z,L,H,G);process.env.NODE_ENV!=="production"&&(Ns(),vn(Y,"mount"))},O=($,T,z)=>{const J=T.component=$.component;if(zV($,T,z))if(J.asyncDep&&!J.asyncResolved){process.env.NODE_ENV!=="production"&&ws(T),q(J,T,z),process.env.NODE_ENV!=="production"&&Ns();return}else J.next=T,EP(J.update),J.effect.dirty=!0,J.update();else T.el=$.el,J.vnode=T},F=($,T,z,J,L,H,G)=>{const Y=()=>{if($.isMounted){let{next:j,bu:Q,u:Z,parent:ie,vnode:oe}=$;{const je=Ox($);if(je){j&&(j.el=oe.el,q($,j,G)),je.asyncDep.then(()=>{$.isUnmounted||Y()});return}}let ye=j,fe;process.env.NODE_ENV!=="production"&&ws(j||$.vnode),mi($,!1),j?(j.el=oe.el,q($,j,G)):j=oe,Q&&Ga(Q),(fe=j.props&&j.props.onVnodeBeforeUpdate)&&Xr(fe,ie,j,oe),mi($,!0),process.env.NODE_ENV!=="production"&&gn($,"render");const De=Ac($);process.env.NODE_ENV!=="production"&&vn($,"render");const Ne=$.subTree;$.subTree=De,process.env.NODE_ENV!=="production"&&gn($,"patch"),h(Ne,De,f(Ne.el),de(Ne),$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),j.el=De.el,ye===null&&jV($,De.el),Z&&pr(Z,L),(fe=j.props&&j.props.onVnodeUpdated)&&pr(()=>Xr(fe,ie,j,oe),L),process.env.NODE_ENV!=="production"&&ax($),process.env.NODE_ENV!=="production"&&Ns()}else{let j;const{el:Q,props:Z}=T,{bm:ie,m:oe,parent:ye}=$,fe=no(T);if(mi($,!1),ie&&Ga(ie),!fe&&(j=Z&&Z.onVnodeBeforeMount)&&Xr(j,ye,T),mi($,!0),Q&&xe){const De=()=>{process.env.NODE_ENV!=="production"&&gn($,"render"),$.subTree=Ac($),process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"hydrate"),xe(Q,$.subTree,$,L,null),process.env.NODE_ENV!=="production"&&vn($,"hydrate")};fe?T.type.__asyncLoader().then(()=>!$.isUnmounted&&De()):De()}else{process.env.NODE_ENV!=="production"&&gn($,"render");const De=$.subTree=Ac($);process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"patch"),h(null,De,z,J,$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),T.el=De.el}if(oe&&pr(oe,L),!fe&&(j=Z&&Z.onVnodeMounted)){const De=T;pr(()=>Xr(j,ye,De),L)}(T.shapeFlag&256||ye&&no(ye.vnode)&&ye.vnode.shapeFlag&256)&&$.a&&pr($.a,L),$.isMounted=!0,process.env.NODE_ENV!=="production"&&OP($),T=z=J=null}},ee=$.effect=new vf(Y,St,()=>$u(B),$.scope),B=$.update=()=>{ee.dirty&&ee.run()};B.i=$,B.id=$.uid,mi($,!0),process.env.NODE_ENV!=="production"&&(ee.onTrack=$.rtc?j=>Ga($.rtc,j):void 0,ee.onTrigger=$.rtg?j=>Ga($.rtg,j):void 0),B()},q=($,T,z)=>{T.component=$;const J=$.vnode.props;$.vnode=T,$.next=null,mV($,T.props,J,z),DV($,T.children,z),kn(),j0($),In()},k=($,T,z,J,L,H,G,Y,ee=!1)=>{const B=$&&$.children,j=$?$.shapeFlag:0,Q=T.children,{patchFlag:Z,shapeFlag:ie}=T;if(Z>0){if(Z&128){se(B,Q,z,J,L,H,G,Y,ee);return}else if(Z&256){te(B,Q,z,J,L,H,G,Y,ee);return}}ie&8?(j&16&&ae(B,L,H),Q!==B&&s(z,Q)):j&16?ie&16?se(B,Q,z,J,L,H,G,Y,ee):ae(B,L,H,!0):(j&8&&s(z,""),ie&16&&D(Q,z,J,L,H,G,Y,ee))},te=($,T,z,J,L,H,G,Y,ee)=>{$=$||sa,T=T||sa;const B=$.length,j=T.length,Q=Math.min(B,j);let Z;for(Z=0;Z<Q;Z++){const ie=T[Z]=ee?Hn(T[Z]):qr(T[Z]);h($[Z],ie,z,null,L,H,G,Y,ee)}B>j?ae($,L,H,!0,!1,Q):D(T,z,J,L,H,G,Y,ee,Q)},se=($,T,z,J,L,H,G,Y,ee)=>{let B=0;const j=T.length;let Q=$.length-1,Z=j-1;for(;B<=Q&&B<=Z;){const ie=$[B],oe=T[B]=ee?Hn(T[B]):qr(T[B]);if(xi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;B++}for(;B<=Q&&B<=Z;){const ie=$[Q],oe=T[Z]=ee?Hn(T[Z]):qr(T[Z]);if(xi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;Q--,Z--}if(B>Q){if(B<=Z){const ie=Z+1,oe=ie<j?T[ie].el:J;for(;B<=Z;)h(null,T[B]=ee?Hn(T[B]):qr(T[B]),z,oe,L,H,G,Y,ee),B++}}else if(B>Z)for(;B<=Q;)V($[B],L,H,!0),B++;else{const ie=B,oe=B,ye=new Map;for(B=oe;B<=Z;B++){const M=T[B]=ee?Hn(T[B]):qr(T[B]);M.key!=null&&(process.env.NODE_ENV!=="production"&&ye.has(M.key)&&Se("Duplicate keys found during update:",JSON.stringify(M.key),"Make sure keys are unique."),ye.set(M.key,B))}let fe,De=0;const Ne=Z-oe+1;let je=!1,Ze=0;const _e=new Array(Ne);for(B=0;B<Ne;B++)_e[B]=0;for(B=ie;B<=Q;B++){const M=$[B];if(De>=Ne){V(M,L,H,!0);continue}let X;if(M.key!=null)X=ye.get(M.key);else for(fe=oe;fe<=Z;fe++)if(_e[fe-oe]===0&&xi(M,T[fe])){X=fe;break}X===void 0?V(M,L,H,!0):(_e[X-oe]=B+1,X>=Ze?Ze=X:je=!0,h(M,T[X],z,null,L,H,G,Y,ee),De++)}const wt=je?FV(_e):sa;for(fe=wt.length-1,B=Ne-1;B>=0;B--){const M=oe+B,X=T[M],pe=M+1<j?T[M+1].el:J;_e[B]===0?h(null,X,z,pe,L,H,G,Y,ee):je&&(fe<0||B!==wt[fe]?K(X,z,pe,2):fe--)}}},K=($,T,z,J,L=null)=>{const{el:H,type:G,transition:Y,children:ee,shapeFlag:B}=$;if(B&6){K($.component.subTree,T,z,J);return}if(B&128){$.suspense.move(T,z,J);return}if(B&64){G.move($,T,z,le);return}if(G===mr){n(H,T,z);for(let j=0;j<ee.length;j++)K(ee[j],T,z,J);n($.anchor,T,z);return}if(G===As){b($,T,z);return}if(J!==2&&B&1&&Y)if(J===0)Y.beforeEnter(H),n(H,T,z),pr(()=>Y.enter(H),L);else{const{leave:j,delayLeave:Q,afterLeave:Z}=Y,ie=()=>n(H,T,z),oe=()=>{j(H,()=>{ie(),Z&&Z()})};Q?Q(H,ie,oe):oe()}else n(H,T,z)},V=($,T,z,J=!1,L=!1)=>{const{type:H,props:G,ref:Y,children:ee,dynamicChildren:B,shapeFlag:j,patchFlag:Q,dirs:Z,cacheIndex:ie}=$;if(Q===-2&&(L=!1),Y!=null&&hl(Y,null,z,$,!0),ie!=null&&(T.renderCache[ie]=void 0),j&256){T.ctx.deactivate($);return}const oe=j&1&&Z,ye=!no($);let fe;if(ye&&(fe=G&&G.onVnodeBeforeUnmount)&&Xr(fe,T,$),j&6)re($.component,z,J);else{if(j&128){$.suspense.unmount(z,J);return}oe&&pi($,null,T,"beforeUnmount"),j&64?$.type.remove($,T,z,le,J):B&&!B.hasOnce&&(H!==mr||Q>0&&Q&64)?ae(B,T,z,!1,!0):(H===mr&&Q&384||!L&&j&16)&&ae(ee,T,z),J&&ue($)}(ye&&(fe=G&&G.onVnodeUnmounted)||oe)&&pr(()=>{fe&&Xr(fe,T,$),oe&&pi($,null,T,"unmounted")},z)},ue=$=>{const{type:T,el:z,anchor:J,transition:L}=$;if(T===mr){process.env.NODE_ENV!=="production"&&$.patchFlag>0&&$.patchFlag&2048&&L&&!L.persisted?$.children.forEach(G=>{G.type===Mt?i(G.el):ue(G)}):me(z,J);return}if(T===As){y($);return}const H=()=>{i(z),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if($.shapeFlag&1&&L&&!L.persisted){const{leave:G,delayLeave:Y}=L,ee=()=>G(z,H);Y?Y($.el,H,ee):ee()}else H()},me=($,T)=>{let z;for(;$!==T;)z=p($),i($),$=z;i(T)},re=($,T,z)=>{process.env.NODE_ENV!=="production"&&$.type.__hmrId&&CP($);const{bum:J,scope:L,update:H,subTree:G,um:Y,m:ee,a:B}=$;Q0(ee),Q0(B),J&&Ga(J),L.stop(),H&&(H.active=!1,V(G,$,T,z)),Y&&pr(Y,T),pr(()=>{$.isUnmounted=!0},T),T&&T.pendingBranch&&!T.isUnmounted&&$.asyncDep&&!$.asyncResolved&&$.suspenseId===T.pendingId&&(T.deps--,T.deps===0&&T.resolve()),process.env.NODE_ENV!=="production"&&kP($)},ae=($,T,z,J=!1,L=!1,H=0)=>{for(let G=H;G<$.length;G++)V($[G],T,z,J,L)},de=$=>{if($.shapeFlag&6)return de($.component.subTree);if($.shapeFlag&128)return $.suspense.next();const T=p($.anchor||$.el),z=T&&T[EV];return z?p(z):T};let ne=!1;const ce=($,T,z)=>{$==null?T._vnode&&V(T._vnode,null,null,!0):h(T._vnode||null,$,T,null,null,null,z),T._vnode=$,ne||(ne=!0,j0(),tx(),ne=!1)},le={p:h,um:V,m:K,r:ue,mt:I,mc:D,pc:k,pbc:C,n:de,o:e};let he,xe;return{render:ce,hydrate:he,createApp:lV(ce,he)}}function Ec({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function mi({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function _V(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Es(e,t,r=!1){const n=e.children,i=t.children;if(Oe(n)&&Oe(i))for(let a=0;a<n.length;a++){const o=n[a];let u=i[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=i[a]=Hn(i[a]),u.el=o.el),!r&&u.patchFlag!==-2&&Es(o,u)),u.type===zo&&(u.el=o.el),process.env.NODE_ENV!=="production"&&u.type===Mt&&!u.el&&(u.el=o.el)}}function FV(e){const t=e.slice(),r=[0];let n,i,a,o,u;const c=e.length;for(n=0;n<c;n++){const l=e[n];if(l!==0){if(i=r[r.length-1],e[i]<l){t[n]=i,r.push(n);continue}for(a=0,o=r.length-1;a<o;)u=a+o>>1,e[r[u]]<l?a=u+1:o=u;l<e[r[a]]&&(a>0&&(t[n]=r[a-1]),r[a]=n)}}for(a=r.length,o=r[a-1];a-- >0;)r[a]=o,o=t[o];return r}function Ox(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ox(t)}function Q0(e){if(e)for(let t=0;t<e.length;t++)e[t].active=!1}const TV=Symbol.for("v-scx"),OV=()=>{{const e=an(TV);return e||process.env.NODE_ENV!=="production"&&Se("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},ds={};function fa(e,t,r){return process.env.NODE_ENV!=="production"&&!Be(t)&&Se("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Bx(e,t,r)}function Bx(e,t,{immediate:r,deep:n,flush:i,once:a,onTrack:o,onTrigger:u}=vt){if(t&&a){const E=t;t=(...A)=>{E(...A),N()}}process.env.NODE_ENV!=="production"&&n!==void 0&&typeof n=="number"&&Se('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Se('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),n!==void 0&&Se('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Se('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=E=>{Se("Invalid watch source: ",E,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=Bt,s=E=>n===!0?E:Gn(E,n===!1?1:void 0);let f,p=!1,m=!1;if(Lt(e)?(f=()=>e.value,p=Dn(e)):ua(e)?(f=()=>s(e),p=!0):Oe(e)?(m=!0,p=e.some(E=>ua(E)||Dn(E)),f=()=>e.map(E=>{if(Lt(E))return E.value;if(ua(E))return s(E);if(Be(E))return En(E,l,2);process.env.NODE_ENV!=="production"&&c(E)})):Be(e)?t?f=()=>En(e,l,2):f=()=>(d&&d(),_r(e,l,3,[h])):(f=St,process.env.NODE_ENV!=="production"&&c(e)),t&&n){const E=f;f=()=>Gn(E())}let d,h=E=>{d=b.onStop=()=>{En(E,l,4),d=b.onStop=void 0}},w;if(Wu)if(h=St,t?r&&_r(t,l,3,[f(),m?[]:void 0,h]):f(),i==="sync"){const E=OV();w=E.__watcherHandles||(E.__watcherHandles=[])}else return St;let v=m?new Array(e.length).fill(ds):ds;const x=()=>{if(!(!b.active||!b.dirty))if(t){const E=b.run();(n||p||(m?E.some((A,D)=>ei(A,v[D])):ei(E,v)))&&(d&&d(),_r(t,l,3,[E,v===ds?void 0:m&&v[0]===ds?[]:v,h]),v=E)}else b.run()};x.allowRecurse=!!t;let g;i==="sync"?g=x:i==="post"?g=()=>pr(x,l&&l.suspense):(x.pre=!0,l&&(x.id=l.uid),g=()=>$u(x));const b=new vf(f,St,g),y=Tb(),N=()=>{b.stop(),y&&ff(y.effects,b)};return process.env.NODE_ENV!=="production"&&(b.onTrack=o,b.onTrigger=u),t?r?x():v=b.run():i==="post"?pr(b.run.bind(b),l&&l.suspense):b.run(),w&&w.push(N),N}function BV(e,t,r){const n=this.proxy,i=xt(e)?e.includes(".")?kx(n,e):()=>n[e]:e.bind(n,n);let a;Be(t)?a=t:(a=t.handler,r=t);const o=jo(this),u=Bx(i,a.bind(n),r);return o(),u}function kx(e,t){const r=t.split(".");return()=>{let n=e;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function Gn(e,t=1/0,r){if(t<=0||!lt(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,Lt(e))Gn(e.value,t,r);else if(Oe(e))for(let n=0;n<e.length;n++)Gn(e[n],t,r);else if(Ab(e)||Ai(e))e.forEach(n=>{Gn(n,t,r)});else if(Cb(e)){for(const n in e)Gn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Gn(e[n],t,r)}return e}const kV=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wr(t)}Modifiers`]||e[`${Cn(t)}Modifiers`];function IV(e,t,...r){if(e.isUnmounted)return;const n=e.vnode.props||vt;if(process.env.NODE_ENV!=="production"){const{emitsOptions:s,propsOptions:[f]}=e;if(s)if(!(t in s))(!f||!(vi(wr(t))in f))&&Se(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${vi(wr(t))}" prop.`);else{const p=s[t];Be(p)&&(p(...r)||Se(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=r;const a=t.startsWith("update:"),o=a&&kV(n,t.slice(7));if(o&&(o.trim&&(i=r.map(s=>xt(s)?s.trim():s)),o.number&&(i=r.map(kL))),process.env.NODE_ENV!=="production"&&qP(e,t,i),process.env.NODE_ENV!=="production"){const s=t.toLowerCase();s!==t&&n[vi(s)]&&Se(`Event "${s}" is emitted in component ${Qu(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Cn(t)}" instead of "${t}".`)}let u,c=n[u=vi(t)]||n[u=vi(wr(t))];!c&&a&&(c=n[u=vi(Cn(t))]),c&&_r(c,e,6,i);const l=n[u+"Once"];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,_r(l,e,6,i)}}function Ix(e,t,r=!1){const n=t.emitsCache,i=n.get(e);if(i!==void 0)return i;const a=e.emits;let o={},u=!1;if(!Be(e)){const c=l=>{const s=Ix(l,t,!0);s&&(u=!0,Et(o,s))};!r&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!a&&!u?(lt(e)&&n.set(e,null),null):(Oe(a)?a.forEach(c=>o[c]=null):Et(o,a),lt(e)&&n.set(e,o),o)}function Gu(e,t){return!e||!Bo(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,Cn(t))||tt(e,t))}let gl=!1;function su(){gl=!0}function Ac(e){const{type:t,vnode:r,proxy:n,withProxy:i,propsOptions:[a],slots:o,attrs:u,emit:c,render:l,renderCache:s,props:f,data:p,setupState:m,ctx:d,inheritAttrs:h}=e,w=nu(e);let v,x;process.env.NODE_ENV!=="production"&&(gl=!1);try{if(r.shapeFlag&4){const y=i||n,N=process.env.NODE_ENV!=="production"&&m.__isScriptSetup?new Proxy(y,{get(E,A,D){return Se(`Property '${String(A)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(E,A,D)}}):y;v=qr(l.call(N,y,s,process.env.NODE_ENV!=="production"?rn(f):f,m,p,d)),x=u}else{const y=t;process.env.NODE_ENV!=="production"&&u===f&&su(),v=qr(y.length>1?y(process.env.NODE_ENV!=="production"?rn(f):f,process.env.NODE_ENV!=="production"?{get attrs(){return su(),rn(u)},slots:o,emit:c}:{attrs:u,slots:o,emit:c}):y(process.env.NODE_ENV!=="production"?rn(f):f,null)),x=t.props?u:RV(u)}}catch(y){io.length=0,Io(y,e,1),v=$t(Mt)}let g=v,b;if(process.env.NODE_ENV!=="production"&&v.patchFlag>0&&v.patchFlag&2048&&([g,b]=Rx(v)),x&&h!==!1){const y=Object.keys(x),{shapeFlag:N}=g;if(y.length){if(N&7)a&&y.some(eu)&&(x=qV(x,a)),g=un(g,x,!1,!0);else if(process.env.NODE_ENV!=="production"&&!gl&&g.type!==Mt){const E=Object.keys(u),A=[],D=[];for(let S=0,C=E.length;S<C;S++){const _=E[S];Bo(_)?eu(_)||A.push(_[2].toLowerCase()+_.slice(3)):D.push(_)}D.length&&Se(`Extraneous non-props attributes (${D.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),A.length&&Se(`Extraneous non-emits event listeners (${A.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return r.dirs&&(process.env.NODE_ENV!=="production"&&!Z0(g)&&Se("Runtime directive used on component with non-element root node. The directives will not function as intended."),g=un(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(r.dirs):r.dirs),r.transition&&(process.env.NODE_ENV!=="production"&&!Z0(g)&&Se("Component inside <Transition> renders non-element root node that cannot be animated."),g.transition=r.transition),process.env.NODE_ENV!=="production"&&b?b(g):v=g,nu(w),v}const Rx=e=>{const t=e.children,r=e.dynamicChildren,n=Of(t,!1);if(n){if(process.env.NODE_ENV!=="production"&&n.patchFlag>0&&n.patchFlag&2048)return Rx(n)}else return[e,void 0];const i=t.indexOf(n),a=r?r.indexOf(n):-1,o=u=>{t[i]=u,r&&(a>-1?r[a]=u:u.patchFlag>0&&(e.dynamicChildren=[...r,u]))};return[qr(n),o]};function Of(e,t=!0){let r;for(let n=0;n<e.length;n++){const i=e[n];if(ti(i)){if(i.type!==Mt||i.children==="v-if"){if(r)return;if(r=i,process.env.NODE_ENV!=="production"&&t&&r.patchFlag>0&&r.patchFlag&2048)return Of(r.children)}}else return}return r}const RV=e=>{let t;for(const r in e)(r==="class"||r==="style"||Bo(r))&&((t||(t={}))[r]=e[r]);return t},qV=(e,t)=>{const r={};for(const n in e)(!eu(n)||!(n.slice(9)in t))&&(r[n]=e[n]);return r},Z0=e=>e.shapeFlag&7||e.type===Mt;function zV(e,t,r){const{props:n,children:i,component:a}=e,{props:o,children:u,patchFlag:c}=t,l=a.emitsOptions;if(process.env.NODE_ENV!=="production"&&(i||u)&&_i||t.dirs||t.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?X0(n,o,l):!!o;if(c&8){const s=t.dynamicProps;for(let f=0;f<s.length;f++){const p=s[f];if(o[p]!==n[p]&&!Gu(l,p))return!0}}}else return(i||u)&&(!u||!u.$stable)?!0:n===o?!1:n?o?X0(n,o,l):!0:!!o;return!1}function X0(e,t,r){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;i<n.length;i++){const a=n[i];if(t[a]!==e[a]&&!Gu(r,a))return!0}return!1}function jV({vnode:e,parent:t},r){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=r,t=t.parent;else break}}const LV=e=>e.__isSuspense;function PV(e,t){t&&t.pendingBranch?Oe(e)?t.effects.push(...e):t.effects.push(e):ex(e)}const mr=Symbol.for("v-fgt"),zo=Symbol.for("v-txt"),Mt=Symbol.for("v-cmt"),As=Symbol.for("v-stc"),io=[];let br=null;function Kt(e=!1){io.push(br=e?null:[])}function VV(){io.pop(),br=io[io.length-1]||null}let ho=1;function Y0(e){ho+=e,e<0&&br&&(br.hasOnce=!0)}function qx(e){return e.dynamicChildren=ho>0?br||sa:null,VV(),ho>0&&br&&br.push(e),e}function Fn(e,t,r,n,i,a){return qx(sn(e,t,r,n,i,a,!0))}function bi(e,t,r,n,i){return qx($t(e,t,r,n,i,!0))}function ti(e){return e?e.__v_isVNode===!0:!1}function xi(e,t){if(process.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const r=Ds.get(t.type);if(r&&r.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const UV=(...e)=>jx(...e),zx=({key:e})=>e??null,Ss=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?xt(e)||Lt(e)||Be(e)?{i:_t,r:e,k:t,f:!!r}:e:null);function sn(e,t=null,r=null,n=0,i=null,a=e===mr?0:1,o=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&zx(t),ref:t&&Ss(t),scopeId:sx,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:_t};return u?(Bf(c,r),a&128&&e.normalize(c)):r&&(c.shapeFlag|=xt(r)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&Se("VNode created with invalid key (NaN). VNode type:",c.type),ho>0&&!o&&br&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&br.push(c),c}const $t=process.env.NODE_ENV!=="production"?UV:jx;function jx(e,t=null,r=null,n=0,i=null,a=!1){if((!e||e===vx)&&(process.env.NODE_ENV!=="production"&&!e&&Se(`Invalid vnode type when creating vnode: ${e}.`),e=Mt),ti(e)){const u=un(e,t,!0);return r&&Bf(u,r),ho>0&&!a&&br&&(u.shapeFlag&6?br[br.indexOf(e)]=u:br.push(u)),u.patchFlag=-2,u}if($x(e)&&(e=e.__vccOpts),t){t=$V(t);let{class:u,style:c}=t;u&&!xt(u)&&(t.class=Rr(u)),lt(c)&&(ol(c)&&!Oe(c)&&(c=Et({},c)),t.style=ko(c))}const o=xt(e)?1:LV(e)?128:AV(e)?64:lt(e)?4:Be(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&ol(e)&&(e=Ye(e),Se("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
97
|
-
Component that was made reactive: `,e)),sn(e,t,r,n,i,o,a,!0)}function $V(e){return e?ol(e)||Ax(e)?Et({},e):e:null}function un(e,t,r=!1,n=!1){const{props:i,ref:a,patchFlag:o,children:u,transition:c}=e,l=t?Px(i||{},t):i,s={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&zx(l),ref:t&&t.ref?r&&a?Oe(a)?a.concat(Ss(t)):[a,Ss(t)]:Ss(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&Oe(u)?u.map(Lx):u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==mr?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&un(e.ssContent),ssFallback:e.ssFallback&&un(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&iu(s,c.clone(s)),s}function Lx(e){const t=un(e);return Oe(e.children)&&(t.children=e.children.map(Lx)),t}function HV(e=" ",t=0){return $t(zo,null,e,t)}function hs(e="",t=!1){return t?(Kt(),bi(Mt,null,e)):$t(Mt,null,e)}function qr(e){return e==null||typeof e=="boolean"?$t(Mt):Oe(e)?$t(mr,null,e.slice()):typeof e=="object"?Hn(e):$t(zo,null,String(e))}function Hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:un(e)}function Bf(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Oe(t))r=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),Bf(e,i()),i._c&&(i._d=!0));return}else{r=32;const i=t._;!i&&!Ax(t)?t._ctx=_t:i===3&&_t&&(_t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Be(t)?(t={default:t,_ctx:_t},r=32):(t=String(t),n&64?(r=16,t=[HV(t)]):r=8);e.children=t,e.shapeFlag|=r}function Px(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const i in n)if(i==="class")t.class!==n.class&&(t.class=Rr([t.class,n.class]));else if(i==="style")t.style=ko([t.style,n.style]);else if(Bo(i)){const a=t[i],o=n[i];o&&a!==o&&!(Oe(a)&&a.includes(o))&&(t[i]=a?[].concat(a,o):o)}else i!==""&&(t[i]=n[i])}return t}function Xr(e,t,r,n=null){_r(e,t,7,[r,n])}const JV=wx();let GV=0;function WV(e,t,r){const n=e.type,i=(t?t.appContext:e.appContext)||JV,a={uid:GV++,vnode:e,type:n,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new VL(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Cx(n,i),emitsOptions:Ix(n,i),emit:null,emitted:null,propsDefaults:vt,inheritAttrs:n.inheritAttrs,ctx:vt,data:vt,props:vt,attrs:vt,slots:vt,refs:vt,setupState:vt,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return process.env.NODE_ENV!=="production"?a.ctx=eV(a):a.ctx={_:a},a.root=t?t.root:a,a.emit=IV.bind(null,a),e.ce&&e.ce(a),a}let Bt=null;const ri=()=>Bt||_t;let uu,vl;{const e=hf(),t=(r,n)=>{let i;return(i=e[r])||(i=e[r]=[]),i.push(n),a=>{i.length>1?i.forEach(o=>o(a)):i[0](a)}};uu=t("__VUE_INSTANCE_SETTERS__",r=>Bt=r),vl=t("__VUE_SSR_SETTERS__",r=>Wu=r)}const jo=e=>{const t=Bt;return uu(e),e.scope.on(),()=>{e.scope.off(),uu(t)}},eg=()=>{Bt&&Bt.scope.off(),uu(null)},KV=ja("slot,component");function yl(e,{isNativeTag:t}){(KV(e)||t(e))&&Se("Do not use built-in or reserved HTML elements as component id: "+e)}function Vx(e){return e.vnode.shapeFlag&4}let Wu=!1;function QV(e,t=!1,r=!1){t&&vl(t);const{props:n,children:i}=e.vnode,a=Vx(e);fV(e,n,a,t),NV(e,i,r);const o=a?ZV(e,t):void 0;return t&&vl(!1),o}function ZV(e,t){var r;const n=e.type;if(process.env.NODE_ENV!=="production"){if(n.name&&yl(n.name,e.appContext.config),n.components){const a=Object.keys(n.components);for(let o=0;o<a.length;o++)yl(a[o],e.appContext.config)}if(n.directives){const a=Object.keys(n.directives);for(let o=0;o<a.length;o++)ux(a[o])}n.compilerOptions&&XV()&&Se('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,bx),process.env.NODE_ENV!=="production"&&tV(e);const{setup:i}=n;if(i){const a=e.setupContext=i.length>1?eU(e):null,o=jo(e);kn();const u=En(i,e,0,[process.env.NODE_ENV!=="production"?rn(e.props):e.props,a]);if(In(),o(),pf(u)){if(u.then(eg,eg),t)return u.then(c=>{tg(e,c,t)}).catch(c=>{Io(c,e,0)});if(e.asyncDep=u,process.env.NODE_ENV!=="production"&&!e.suspense){const c=(r=n.name)!=null?r:"Anonymous";Se(`Component <${c}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else tg(e,u,t)}else Ux(e,t)}function tg(e,t,r){Be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:lt(t)?(process.env.NODE_ENV!=="production"&&ti(t)&&Se("setup() should not return VNodes directly - return a render function instead."),process.env.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=Kb(t),process.env.NODE_ENV!=="production"&&rV(e)):process.env.NODE_ENV!=="production"&&t!==void 0&&Se(`setup() should return an object. Received: ${t===null?"null":typeof t}`),Ux(e,r)}let bl;const XV=()=>!bl;function Ux(e,t,r){const n=e.type;if(!e.render){if(!t&&bl&&!n.render){const i=n.template||Ff(e).template;if(i){process.env.NODE_ENV!=="production"&&gn(e,"compile");const{isCustomElement:a,compilerOptions:o}=e.appContext.config,{delimiters:u,compilerOptions:c}=n,l=Et(Et({isCustomElement:a,delimiters:u},o),c);n.render=bl(i,l),process.env.NODE_ENV!=="production"&&vn(e,"compile")}}e.render=n.render||St}{const i=jo(e);kn();try{iV(e)}finally{In(),i()}}process.env.NODE_ENV!=="production"&&!n.render&&e.render===St&&!t&&(n.template?Se('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):Se("Component is missing template or render function: ",n))}const rg=process.env.NODE_ENV!=="production"?{get(e,t){return su(),Ht(e,"get",""),e[t]},set(){return Se("setupContext.attrs is readonly."),!1},deleteProperty(){return Se("setupContext.attrs is readonly."),!1}}:{get(e,t){return Ht(e,"get",""),e[t]}};function YV(e){return new Proxy(e.slots,{get(t,r){return Ht(e,"get","$slots"),t[r]}})}function eU(e){const t=r=>{if(process.env.NODE_ENV!=="production"&&(e.exposed&&Se("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(Oe(r)?n="array":Lt(r)&&(n="ref")),n!=="object"&&Se(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(process.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,rg))},get slots(){return n||(n=YV(e))},get emit(){return(i,...a)=>e.emit(i,...a)},expose:t})}else return{attrs:new Proxy(e.attrs,rg),slots:e.slots,emit:e.emit,expose:t}}function Ku(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Kb(lP(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in Fi)return Fi[r](e)},has(t,r){return r in t||r in Fi}})):e.proxy}const tU=/(?:^|[-_])(\w)/g,rU=e=>e.replace(tU,t=>t.toUpperCase()).replace(/[-_]/g,"");function kf(e,t=!0){return Be(e)?e.displayName||e.name:e.name||t&&e.__name}function Qu(e,t,r=!1){let n=kf(t);if(!n&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&e&&e.parent){const i=a=>{for(const o in a)if(a[o]===t)return o};n=i(e.components||e.parent.type.components)||i(e.appContext.components)}return n?rU(n):r?"App":"Anonymous"}function $x(e){return Be(e)&&"__vccOpts"in e}const yt=(e,t)=>{const r=pP(e,t,Wu);if(process.env.NODE_ENV!=="production"){const n=ri();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function nU(e,t,r){const n=arguments.length;return n===2?lt(t)&&!Oe(t)?ti(t)?$t(e,null,[t]):$t(e,t):$t(e,null,t):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&ti(r)&&(r=[r]),$t(e,t,r))}function iU(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(f){return lt(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,s(f)],"<",u(f.value),">"]:ua(f)?["div",{},["span",e,Dn(f)?"ShallowReactive":"Reactive"],"<",u(f),`>${_n(f)?" (readonly)":""}`]:_n(f)?["div",{},["span",e,Dn(f)?"ShallowReadonly":"Readonly"],"<",u(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...a(f.$)]}};function a(f){const p=[];f.type.props&&f.props&&p.push(o("props",Ye(f.props))),f.setupState!==vt&&p.push(o("setup",f.setupState)),f.data!==vt&&p.push(o("data",Ye(f.data)));const m=c(f,"computed");m&&p.push(o("computed",m));const d=c(f,"inject");return d&&p.push(o("injected",d)),p.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),p}function o(f,p){return p=Et({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(m=>["div",{},["span",n,m+": "],u(p[m],!1)])]]:["span",{}]}function u(f,p=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",r,JSON.stringify(f)]:typeof f=="boolean"?["span",n,f]:lt(f)?["object",{object:p?Ye(f):f}]:["span",r,String(f)]}function c(f,p){const m=f.type;if(Be(m))return;const d={};for(const h in f.ctx)l(m,h,p)&&(d[h]=f.ctx[h]);return d}function l(f,p,m){const d=f[m];if(Oe(d)&&d.includes(p)||lt(d)&&p in d||f.extends&&l(f.extends,p,m)||f.mixins&&f.mixins.some(h=>l(h,p,m)))return!0}function s(f){return Dn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const ng="3.4.38",Zu=process.env.NODE_ENV!=="production"?Se:St;process.env.NODE_ENV;process.env.NODE_ENV;/**
|
|
96
|
+
For more details, see https://link.vuejs.org/feature-flags.`)}}const pr=QV;function RV(e){return qV(e)}function qV(e,t){IV();const r=wf();r.__VUE__=!0,process.env.NODE_ENV!=="production"&&mx(r.__VUE_DEVTOOLS_GLOBAL_HOOK__,r);const{insert:n,remove:i,patchProp:a,createElement:o,createText:u,createComment:c,setText:l,setElementText:s,parentNode:f,nextSibling:p,setScopeId:m=St,insertStaticContent:d}=e,h=($,T,z,J=null,L=null,H=null,G=void 0,Y=null,ee=process.env.NODE_ENV!=="production"&&Fi?!1:!!T.dynamicChildren)=>{if($===T)return;$&&!wi($,T)&&(J=de($),V($,L,H,!0),$=null),T.patchFlag===-2&&(ee=!1,T.dynamicChildren=null);const{type:B,ref:j,shapeFlag:Q}=T;switch(B){case Vo:w($,T,z,J);break;case Mt:v($,T,z,J);break;case Fs:$==null?x(T,z,J,G):process.env.NODE_ENV!=="production"&&g($,T,z,G);break;case mr:R($,T,z,J,L,H,G,Y,ee);break;default:Q&1?N($,T,z,J,L,H,G,Y,ee):Q&6?P($,T,z,J,L,H,G,Y,ee):Q&64||Q&128?B.process($,T,z,J,L,H,G,Y,ee,le):process.env.NODE_ENV!=="production"&&Se("Invalid VNode type:",B,`(${typeof B})`)}j!=null&&L&&xl(j,$&&$.ref,H,T||$,!T)},w=($,T,z,J)=>{if($==null)n(T.el=u(T.children),z,J);else{const L=T.el=$.el;T.children!==$.children&&l(L,T.children)}},v=($,T,z,J)=>{$==null?n(T.el=c(T.children||""),z,J):T.el=$.el},x=($,T,z,J)=>{[$.el,$.anchor]=d($.children,T,z,J,$.el,$.anchor)},g=($,T,z,J)=>{if(T.children!==$.children){const L=p($.anchor);y($),[T.el,T.anchor]=d(T.children,z,L,J)}else T.el=$.el,T.anchor=$.anchor},b=({el:$,anchor:T},z,J)=>{let L;for(;$&&$!==T;)L=p($),n($,z,J),$=L;n(T,z,J)},y=({el:$,anchor:T})=>{let z;for(;$&&$!==T;)z=p($),i($),$=z;i(T)},N=($,T,z,J,L,H,G,Y,ee)=>{T.type==="svg"?G="svg":T.type==="math"&&(G="mathml"),$==null?E(T,z,J,L,H,G,Y,ee):S($,T,L,H,G,Y,ee)},E=($,T,z,J,L,H,G,Y)=>{let ee,B;const{props:j,shapeFlag:Q,transition:Z,dirs:ie}=$;if(ee=$.el=o($.type,H,j&&j.is,j),Q&8?s(ee,$.children):Q&16&&D($.children,ee,null,J,L,_c($,H),G,Y),ie&&pi($,null,J,"created"),A(ee,$,$.scopeId,G,J),j){for(const ye in j)ye!=="value"&&!ao(ye)&&a(ee,ye,null,j[ye],H,J);"value"in j&&a(ee,"value",null,j.value,H),(B=j.onVnodeBeforeMount)&&Xr(B,J,$)}process.env.NODE_ENV!=="production"&&(ou(ee,"__vnode",$,!0),ou(ee,"__vueParentComponent",J,!0)),ie&&pi($,null,J,"beforeMount");const oe=zV(L,Z);oe&&Z.beforeEnter(ee),n(ee,T,z),((B=j&&j.onVnodeMounted)||oe||ie)&&pr(()=>{B&&Xr(B,J,$),oe&&Z.enter(ee),ie&&pi($,null,J,"mounted")},L)},A=($,T,z,J,L)=>{if(z&&m($,z),J)for(let H=0;H<J.length;H++)m($,J[H]);if(L){let H=L.subTree;if(process.env.NODE_ENV!=="production"&&H.patchFlag>0&&H.patchFlag&2048&&(H=zf(H.children)||H),T===H){const G=L.vnode;A($,G,G.scopeId,G.slotScopeIds,L.parent)}}},D=($,T,z,J,L,H,G,Y,ee=0)=>{for(let B=ee;B<$.length;B++){const j=$[B]=Y?Hn($[B]):qr($[B]);h(null,j,T,z,J,L,H,G,Y)}},S=($,T,z,J,L,H,G)=>{const Y=T.el=$.el;process.env.NODE_ENV!=="production"&&(Y.__vnode=T);let{patchFlag:ee,dynamicChildren:B,dirs:j}=T;ee|=$.patchFlag&16;const Q=$.props||vt,Z=T.props||vt;let ie;if(z&&mi(z,!1),(ie=Z.onVnodeBeforeUpdate)&&Xr(ie,z,T,$),j&&pi(T,$,z,"beforeUpdate"),z&&mi(z,!0),process.env.NODE_ENV!=="production"&&Fi&&(ee=0,G=!1,B=null),(Q.innerHTML&&Z.innerHTML==null||Q.textContent&&Z.textContent==null)&&s(Y,""),B?(C($.dynamicChildren,B,Y,z,J,_c(T,L),H),process.env.NODE_ENV!=="production"&&_s($,T)):G||k($,T,Y,null,z,J,_c(T,L),H,!1),ee>0){if(ee&16)_(Y,Q,Z,z,L);else if(ee&2&&Q.class!==Z.class&&a(Y,"class",null,Z.class,L),ee&4&&a(Y,"style",Q.style,Z.style,L),ee&8){const oe=T.dynamicProps;for(let ye=0;ye<oe.length;ye++){const fe=oe[ye],De=Q[fe],Ne=Z[fe];(Ne!==De||fe==="value")&&a(Y,fe,De,Ne,L,z)}}ee&1&&$.children!==T.children&&s(Y,T.children)}else!G&&B==null&&_(Y,Q,Z,z,L);((ie=Z.onVnodeUpdated)||j)&&pr(()=>{ie&&Xr(ie,z,T,$),j&&pi(T,$,z,"updated")},J)},C=($,T,z,J,L,H,G)=>{for(let Y=0;Y<T.length;Y++){const ee=$[Y],B=T[Y],j=ee.el&&(ee.type===mr||!wi(ee,B)||ee.shapeFlag&70)?f(ee.el):z;h(ee,B,j,null,J,L,H,G,!0)}},_=($,T,z,J,L)=>{if(T!==z){if(T!==vt)for(const H in T)!ao(H)&&!(H in z)&&a($,H,T[H],null,L,J);for(const H in z){if(ao(H))continue;const G=z[H],Y=T[H];G!==Y&&H!=="value"&&a($,H,Y,G,L,J)}"value"in z&&a($,"value",T.value,z.value,L)}},R=($,T,z,J,L,H,G,Y,ee)=>{const B=T.el=$?$.el:u(""),j=T.anchor=$?$.anchor:u("");let{patchFlag:Q,dynamicChildren:Z,slotScopeIds:ie}=T;process.env.NODE_ENV!=="production"&&(Fi||Q&2048)&&(Q=0,ee=!1,Z=null),ie&&(Y=Y?Y.concat(ie):ie),$==null?(n(B,z,J),n(j,z,J),D(T.children||[],z,j,L,H,G,Y,ee)):Q>0&&Q&64&&Z&&$.dynamicChildren?(C($.dynamicChildren,Z,z,L,H,G,Y),process.env.NODE_ENV!=="production"?_s($,T):(T.key!=null||L&&T===L.subTree)&&_s($,T,!0)):k($,T,z,j,L,H,G,Y,ee)},P=($,T,z,J,L,H,G,Y,ee)=>{T.slotScopeIds=Y,$==null?T.shapeFlag&512?L.ctx.activate(T,z,J,G,ee):I(T,z,J,L,H,G,ee):O($,T,ee)},I=($,T,z,J,L,H,G)=>{const Y=$.component=nU($,J,L);if(process.env.NODE_ENV!=="production"&&Y.type.__hmrId&&IP(Y),process.env.NODE_ENV!=="production"&&(Ss($),gn(Y,"mount")),Po($)&&(Y.ctx.renderer=le),process.env.NODE_ENV!=="production"&&gn(Y,"init"),aU(Y,!1,G),process.env.NODE_ENV!=="production"&&vn(Y,"init"),Y.asyncDep){if(L&&L.registerDep(Y,F,G),!$.el){const ee=Y.subTree=$t(Mt);v(null,ee,T,z)}}else F(Y,$,T,z,L,H,G);process.env.NODE_ENV!=="production"&&(Cs(),vn(Y,"mount"))},O=($,T,z)=>{const J=T.component=$.component;if(GV($,T,z))if(J.asyncDep&&!J.asyncResolved){process.env.NODE_ENV!=="production"&&Ss(T),q(J,T,z),process.env.NODE_ENV!=="production"&&Cs();return}else J.next=T,BP(J.update),J.effect.dirty=!0,J.update();else T.el=$.el,J.vnode=T},F=($,T,z,J,L,H,G)=>{const Y=()=>{if($.isMounted){let{next:j,bu:Q,u:Z,parent:ie,vnode:oe}=$;{const je=Px($);if(je){j&&(j.el=oe.el,q($,j,G)),je.asyncDep.then(()=>{$.isUnmounted||Y()});return}}let ye=j,fe;process.env.NODE_ENV!=="production"&&Ss(j||$.vnode),mi($,!1),j?(j.el=oe.el,q($,j,G)):j=oe,Q&&Qa(Q),(fe=j.props&&j.props.onVnodeBeforeUpdate)&&Xr(fe,ie,j,oe),mi($,!0),process.env.NODE_ENV!=="production"&&gn($,"render");const De=Fc($);process.env.NODE_ENV!=="production"&&vn($,"render");const Ne=$.subTree;$.subTree=De,process.env.NODE_ENV!=="production"&&gn($,"patch"),h(Ne,De,f(Ne.el),de(Ne),$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),j.el=De.el,ye===null&&KV($,De.el),Z&&pr(Z,L),(fe=j.props&&j.props.onVnodeUpdated)&&pr(()=>Xr(fe,ie,j,oe),L),process.env.NODE_ENV!=="production"&&dx($),process.env.NODE_ENV!=="production"&&Cs()}else{let j;const{el:Q,props:Z}=T,{bm:ie,m:oe,parent:ye}=$,fe=so(T);if(mi($,!1),ie&&Qa(ie),!fe&&(j=Z&&Z.onVnodeBeforeMount)&&Xr(j,ye,T),mi($,!0),Q&&xe){const De=()=>{process.env.NODE_ENV!=="production"&&gn($,"render"),$.subTree=Fc($),process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"hydrate"),xe(Q,$.subTree,$,L,null),process.env.NODE_ENV!=="production"&&vn($,"hydrate")};fe?T.type.__asyncLoader().then(()=>!$.isUnmounted&&De()):De()}else{process.env.NODE_ENV!=="production"&&gn($,"render");const De=$.subTree=Fc($);process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"patch"),h(null,De,z,J,$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),T.el=De.el}if(oe&&pr(oe,L),!fe&&(j=Z&&Z.onVnodeMounted)){const De=T;pr(()=>Xr(j,ye,De),L)}(T.shapeFlag&256||ye&&so(ye.vnode)&&ye.vnode.shapeFlag&256)&&$.a&&pr($.a,L),$.isMounted=!0,process.env.NODE_ENV!=="production"&&PP($),T=z=J=null}},ee=$.effect=new Df(Y,St,()=>Wu(B),$.scope),B=$.update=()=>{ee.dirty&&ee.run()};B.i=$,B.id=$.uid,mi($,!0),process.env.NODE_ENV!=="production"&&(ee.onTrack=$.rtc?j=>Qa($.rtc,j):void 0,ee.onTrigger=$.rtg?j=>Qa($.rtg,j):void 0),B()},q=($,T,z)=>{T.component=$;const J=$.vnode.props;$.vnode=T,$.next=null,NV($,T.props,J,z),OV($,T.children,z),kn(),G0($),In()},k=($,T,z,J,L,H,G,Y,ee=!1)=>{const B=$&&$.children,j=$?$.shapeFlag:0,Q=T.children,{patchFlag:Z,shapeFlag:ie}=T;if(Z>0){if(Z&128){se(B,Q,z,J,L,H,G,Y,ee);return}else if(Z&256){te(B,Q,z,J,L,H,G,Y,ee);return}}ie&8?(j&16&&ae(B,L,H),Q!==B&&s(z,Q)):j&16?ie&16?se(B,Q,z,J,L,H,G,Y,ee):ae(B,L,H,!0):(j&8&&s(z,""),ie&16&&D(Q,z,J,L,H,G,Y,ee))},te=($,T,z,J,L,H,G,Y,ee)=>{$=$||la,T=T||la;const B=$.length,j=T.length,Q=Math.min(B,j);let Z;for(Z=0;Z<Q;Z++){const ie=T[Z]=ee?Hn(T[Z]):qr(T[Z]);h($[Z],ie,z,null,L,H,G,Y,ee)}B>j?ae($,L,H,!0,!1,Q):D(T,z,J,L,H,G,Y,ee,Q)},se=($,T,z,J,L,H,G,Y,ee)=>{let B=0;const j=T.length;let Q=$.length-1,Z=j-1;for(;B<=Q&&B<=Z;){const ie=$[B],oe=T[B]=ee?Hn(T[B]):qr(T[B]);if(wi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;B++}for(;B<=Q&&B<=Z;){const ie=$[Q],oe=T[Z]=ee?Hn(T[Z]):qr(T[Z]);if(wi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;Q--,Z--}if(B>Q){if(B<=Z){const ie=Z+1,oe=ie<j?T[ie].el:J;for(;B<=Z;)h(null,T[B]=ee?Hn(T[B]):qr(T[B]),z,oe,L,H,G,Y,ee),B++}}else if(B>Z)for(;B<=Q;)V($[B],L,H,!0),B++;else{const ie=B,oe=B,ye=new Map;for(B=oe;B<=Z;B++){const M=T[B]=ee?Hn(T[B]):qr(T[B]);M.key!=null&&(process.env.NODE_ENV!=="production"&&ye.has(M.key)&&Se("Duplicate keys found during update:",JSON.stringify(M.key),"Make sure keys are unique."),ye.set(M.key,B))}let fe,De=0;const Ne=Z-oe+1;let je=!1,Ze=0;const _e=new Array(Ne);for(B=0;B<Ne;B++)_e[B]=0;for(B=ie;B<=Q;B++){const M=$[B];if(De>=Ne){V(M,L,H,!0);continue}let X;if(M.key!=null)X=ye.get(M.key);else for(fe=oe;fe<=Z;fe++)if(_e[fe-oe]===0&&wi(M,T[fe])){X=fe;break}X===void 0?V(M,L,H,!0):(_e[X-oe]=B+1,X>=Ze?Ze=X:je=!0,h(M,T[X],z,null,L,H,G,Y,ee),De++)}const wt=je?jV(_e):la;for(fe=wt.length-1,B=Ne-1;B>=0;B--){const M=oe+B,X=T[M],pe=M+1<j?T[M+1].el:J;_e[B]===0?h(null,X,z,pe,L,H,G,Y,ee):je&&(fe<0||B!==wt[fe]?W(X,z,pe,2):fe--)}}},W=($,T,z,J,L=null)=>{const{el:H,type:G,transition:Y,children:ee,shapeFlag:B}=$;if(B&6){W($.component.subTree,T,z,J);return}if(B&128){$.suspense.move(T,z,J);return}if(B&64){G.move($,T,z,le);return}if(G===mr){n(H,T,z);for(let j=0;j<ee.length;j++)W(ee[j],T,z,J);n($.anchor,T,z);return}if(G===Fs){b($,T,z);return}if(J!==2&&B&1&&Y)if(J===0)Y.beforeEnter(H),n(H,T,z),pr(()=>Y.enter(H),L);else{const{leave:j,delayLeave:Q,afterLeave:Z}=Y,ie=()=>n(H,T,z),oe=()=>{j(H,()=>{ie(),Z&&Z()})};Q?Q(H,ie,oe):oe()}else n(H,T,z)},V=($,T,z,J=!1,L=!1)=>{const{type:H,props:G,ref:Y,children:ee,dynamicChildren:B,shapeFlag:j,patchFlag:Q,dirs:Z,cacheIndex:ie}=$;if(Q===-2&&(L=!1),Y!=null&&xl(Y,null,z,$,!0),ie!=null&&(T.renderCache[ie]=void 0),j&256){T.ctx.deactivate($);return}const oe=j&1&&Z,ye=!so($);let fe;if(ye&&(fe=G&&G.onVnodeBeforeUnmount)&&Xr(fe,T,$),j&6)re($.component,z,J);else{if(j&128){$.suspense.unmount(z,J);return}oe&&pi($,null,T,"beforeUnmount"),j&64?$.type.remove($,T,z,le,J):B&&!B.hasOnce&&(H!==mr||Q>0&&Q&64)?ae(B,T,z,!1,!0):(H===mr&&Q&384||!L&&j&16)&&ae(ee,T,z),J&&ue($)}(ye&&(fe=G&&G.onVnodeUnmounted)||oe)&&pr(()=>{fe&&Xr(fe,T,$),oe&&pi($,null,T,"unmounted")},z)},ue=$=>{const{type:T,el:z,anchor:J,transition:L}=$;if(T===mr){process.env.NODE_ENV!=="production"&&$.patchFlag>0&&$.patchFlag&2048&&L&&!L.persisted?$.children.forEach(G=>{G.type===Mt?i(G.el):ue(G)}):me(z,J);return}if(T===Fs){y($);return}const H=()=>{i(z),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if($.shapeFlag&1&&L&&!L.persisted){const{leave:G,delayLeave:Y}=L,ee=()=>G(z,H);Y?Y($.el,H,ee):ee()}else H()},me=($,T)=>{let z;for(;$!==T;)z=p($),i($),$=z;i(T)},re=($,T,z)=>{process.env.NODE_ENV!=="production"&&$.type.__hmrId&&RP($);const{bum:J,scope:L,update:H,subTree:G,um:Y,m:ee,a:B}=$;ig(ee),ig(B),J&&Qa(J),L.stop(),H&&(H.active=!1,V(G,$,T,z)),Y&&pr(Y,T),pr(()=>{$.isUnmounted=!0},T),T&&T.pendingBranch&&!T.isUnmounted&&$.asyncDep&&!$.asyncResolved&&$.suspenseId===T.pendingId&&(T.deps--,T.deps===0&&T.resolve()),process.env.NODE_ENV!=="production"&&UP($)},ae=($,T,z,J=!1,L=!1,H=0)=>{for(let G=H;G<$.length;G++)V($[G],T,z,J,L)},de=$=>{if($.shapeFlag&6)return de($.component.subTree);if($.shapeFlag&128)return $.suspense.next();const T=p($.anchor||$.el),z=T&&T[BV];return z?p(z):T};let ne=!1;const ce=($,T,z)=>{$==null?T._vnode&&V(T._vnode,null,null,!0):h(T._vnode||null,$,T,null,null,null,z),T._vnode=$,ne||(ne=!0,G0(),lx(),ne=!1)},le={p:h,um:V,m:W,r:ue,mt:I,mc:D,pc:k,pbc:C,n:de,o:e};let he,xe;return{render:ce,hydrate:he,createApp:bV(ce,he)}}function _c({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function mi({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function zV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function _s(e,t,r=!1){const n=e.children,i=t.children;if(Oe(n)&&Oe(i))for(let a=0;a<n.length;a++){const o=n[a];let u=i[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=i[a]=Hn(i[a]),u.el=o.el),!r&&u.patchFlag!==-2&&_s(o,u)),u.type===Vo&&(u.el=o.el),process.env.NODE_ENV!=="production"&&u.type===Mt&&!u.el&&(u.el=o.el)}}function jV(e){const t=e.slice(),r=[0];let n,i,a,o,u;const c=e.length;for(n=0;n<c;n++){const l=e[n];if(l!==0){if(i=r[r.length-1],e[i]<l){t[n]=i,r.push(n);continue}for(a=0,o=r.length-1;a<o;)u=a+o>>1,e[r[u]]<l?a=u+1:o=u;l<e[r[a]]&&(a>0&&(t[n]=r[a-1]),r[a]=n)}}for(a=r.length,o=r[a-1];a-- >0;)r[a]=o,o=t[o];return r}function Px(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Px(t)}function ig(e){if(e)for(let t=0;t<e.length;t++)e[t].active=!1}const LV=Symbol.for("v-scx"),PV=()=>{{const e=an(LV);return e||process.env.NODE_ENV!=="production"&&Se("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},ys={};function da(e,t,r){return process.env.NODE_ENV!=="production"&&!Be(t)&&Se("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Vx(e,t,r)}function Vx(e,t,{immediate:r,deep:n,flush:i,once:a,onTrack:o,onTrigger:u}=vt){if(t&&a){const E=t;t=(...A)=>{E(...A),N()}}process.env.NODE_ENV!=="production"&&n!==void 0&&typeof n=="number"&&Se('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Se('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),n!==void 0&&Se('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Se('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=E=>{Se("Invalid watch source: ",E,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=Bt,s=E=>n===!0?E:Gn(E,n===!1?1:void 0);let f,p=!1,m=!1;if(Lt(e)?(f=()=>e.value,p=Dn(e)):fa(e)?(f=()=>s(e),p=!0):Oe(e)?(m=!0,p=e.some(E=>fa(E)||Dn(E)),f=()=>e.map(E=>{if(Lt(E))return E.value;if(fa(E))return s(E);if(Be(E))return En(E,l,2);process.env.NODE_ENV!=="production"&&c(E)})):Be(e)?t?f=()=>En(e,l,2):f=()=>(d&&d(),_r(e,l,3,[h])):(f=St,process.env.NODE_ENV!=="production"&&c(e)),t&&n){const E=f;f=()=>Gn(E())}let d,h=E=>{d=b.onStop=()=>{En(E,l,4),d=b.onStop=void 0}},w;if(Yu)if(h=St,t?r&&_r(t,l,3,[f(),m?[]:void 0,h]):f(),i==="sync"){const E=PV();w=E.__watcherHandles||(E.__watcherHandles=[])}else return St;let v=m?new Array(e.length).fill(ys):ys;const x=()=>{if(!(!b.active||!b.dirty))if(t){const E=b.run();(n||p||(m?E.some((A,D)=>ei(A,v[D])):ei(E,v)))&&(d&&d(),_r(t,l,3,[E,v===ys?void 0:m&&v[0]===ys?[]:v,h]),v=E)}else b.run()};x.allowRecurse=!!t;let g;i==="sync"?g=x:i==="post"?g=()=>pr(x,l&&l.suspense):(x.pre=!0,l&&(x.id=l.uid),g=()=>Wu(x));const b=new Df(f,St,g),y=Lb(),N=()=>{b.stop(),y&&vf(y.effects,b)};return process.env.NODE_ENV!=="production"&&(b.onTrack=o,b.onTrigger=u),t?r?x():v=b.run():i==="post"?pr(b.run.bind(b),l&&l.suspense):b.run(),w&&w.push(N),N}function VV(e,t,r){const n=this.proxy,i=xt(e)?e.includes(".")?Ux(n,e):()=>n[e]:e.bind(n,n);let a;Be(t)?a=t:(a=t.handler,r=t);const o=Uo(this),u=Vx(i,a.bind(n),r);return o(),u}function Ux(e,t){const r=t.split(".");return()=>{let n=e;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function Gn(e,t=1/0,r){if(t<=0||!lt(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,Lt(e))Gn(e.value,t,r);else if(Oe(e))for(let n=0;n<e.length;n++)Gn(e[n],t,r);else if(kb(e)||Si(e))e.forEach(n=>{Gn(n,t,r)});else if(Rb(e)){for(const n in e)Gn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Gn(e[n],t,r)}return e}const UV=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wr(t)}Modifiers`]||e[`${Cn(t)}Modifiers`];function $V(e,t,...r){if(e.isUnmounted)return;const n=e.vnode.props||vt;if(process.env.NODE_ENV!=="production"){const{emitsOptions:s,propsOptions:[f]}=e;if(s)if(!(t in s))(!f||!(yi(wr(t))in f))&&Se(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${yi(wr(t))}" prop.`);else{const p=s[t];Be(p)&&(p(...r)||Se(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=r;const a=t.startsWith("update:"),o=a&&UV(n,t.slice(7));if(o&&(o.trim&&(i=r.map(s=>xt(s)?s.trim():s)),o.number&&(i=r.map(UL))),process.env.NODE_ENV!=="production"&&JP(e,t,i),process.env.NODE_ENV!=="production"){const s=t.toLowerCase();s!==t&&n[yi(s)]&&Se(`Event "${s}" is emitted in component ${tc(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Cn(t)}" instead of "${t}".`)}let u,c=n[u=yi(t)]||n[u=yi(wr(t))];!c&&a&&(c=n[u=yi(Cn(t))]),c&&_r(c,e,6,i);const l=n[u+"Once"];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,_r(l,e,6,i)}}function $x(e,t,r=!1){const n=t.emitsCache,i=n.get(e);if(i!==void 0)return i;const a=e.emits;let o={},u=!1;if(!Be(e)){const c=l=>{const s=$x(l,t,!0);s&&(u=!0,Et(o,s))};!r&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!a&&!u?(lt(e)&&n.set(e,null),null):(Oe(a)?a.forEach(c=>o[c]=null):Et(o,a),lt(e)&&n.set(e,o),o)}function Xu(e,t){return!e||!qo(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,Cn(t))||tt(e,t))}let wl=!1;function pu(){wl=!0}function Fc(e){const{type:t,vnode:r,proxy:n,withProxy:i,propsOptions:[a],slots:o,attrs:u,emit:c,render:l,renderCache:s,props:f,data:p,setupState:m,ctx:d,inheritAttrs:h}=e,w=uu(e);let v,x;process.env.NODE_ENV!=="production"&&(wl=!1);try{if(r.shapeFlag&4){const y=i||n,N=process.env.NODE_ENV!=="production"&&m.__isScriptSetup?new Proxy(y,{get(E,A,D){return Se(`Property '${String(A)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(E,A,D)}}):y;v=qr(l.call(N,y,s,process.env.NODE_ENV!=="production"?rn(f):f,m,p,d)),x=u}else{const y=t;process.env.NODE_ENV!=="production"&&u===f&&pu(),v=qr(y.length>1?y(process.env.NODE_ENV!=="production"?rn(f):f,process.env.NODE_ENV!=="production"?{get attrs(){return pu(),rn(u)},slots:o,emit:c}:{attrs:u,slots:o,emit:c}):y(process.env.NODE_ENV!=="production"?rn(f):f,null)),x=t.props?u:HV(u)}}catch(y){uo.length=0,jo(y,e,1),v=$t(Mt)}let g=v,b;if(process.env.NODE_ENV!=="production"&&v.patchFlag>0&&v.patchFlag&2048&&([g,b]=Hx(v)),x&&h!==!1){const y=Object.keys(x),{shapeFlag:N}=g;if(y.length){if(N&7)a&&y.some(au)&&(x=JV(x,a)),g=un(g,x,!1,!0);else if(process.env.NODE_ENV!=="production"&&!wl&&g.type!==Mt){const E=Object.keys(u),A=[],D=[];for(let S=0,C=E.length;S<C;S++){const _=E[S];qo(_)?au(_)||A.push(_[2].toLowerCase()+_.slice(3)):D.push(_)}D.length&&Se(`Extraneous non-props attributes (${D.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),A.length&&Se(`Extraneous non-emits event listeners (${A.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return r.dirs&&(process.env.NODE_ENV!=="production"&&!ag(g)&&Se("Runtime directive used on component with non-element root node. The directives will not function as intended."),g=un(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(r.dirs):r.dirs),r.transition&&(process.env.NODE_ENV!=="production"&&!ag(g)&&Se("Component inside <Transition> renders non-element root node that cannot be animated."),g.transition=r.transition),process.env.NODE_ENV!=="production"&&b?b(g):v=g,uu(w),v}const Hx=e=>{const t=e.children,r=e.dynamicChildren,n=zf(t,!1);if(n){if(process.env.NODE_ENV!=="production"&&n.patchFlag>0&&n.patchFlag&2048)return Hx(n)}else return[e,void 0];const i=t.indexOf(n),a=r?r.indexOf(n):-1,o=u=>{t[i]=u,r&&(a>-1?r[a]=u:u.patchFlag>0&&(e.dynamicChildren=[...r,u]))};return[qr(n),o]};function zf(e,t=!0){let r;for(let n=0;n<e.length;n++){const i=e[n];if(ti(i)){if(i.type!==Mt||i.children==="v-if"){if(r)return;if(r=i,process.env.NODE_ENV!=="production"&&t&&r.patchFlag>0&&r.patchFlag&2048)return zf(r.children)}}else return}return r}const HV=e=>{let t;for(const r in e)(r==="class"||r==="style"||qo(r))&&((t||(t={}))[r]=e[r]);return t},JV=(e,t)=>{const r={};for(const n in e)(!au(n)||!(n.slice(9)in t))&&(r[n]=e[n]);return r},ag=e=>e.shapeFlag&7||e.type===Mt;function GV(e,t,r){const{props:n,children:i,component:a}=e,{props:o,children:u,patchFlag:c}=t,l=a.emitsOptions;if(process.env.NODE_ENV!=="production"&&(i||u)&&Fi||t.dirs||t.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?og(n,o,l):!!o;if(c&8){const s=t.dynamicProps;for(let f=0;f<s.length;f++){const p=s[f];if(o[p]!==n[p]&&!Xu(l,p))return!0}}}else return(i||u)&&(!u||!u.$stable)?!0:n===o?!1:n?o?og(n,o,l):!0:!!o;return!1}function og(e,t,r){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;i<n.length;i++){const a=n[i];if(t[a]!==e[a]&&!Xu(r,a))return!0}return!1}function KV({vnode:e,parent:t},r){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=r,t=t.parent;else break}}const WV=e=>e.__isSuspense;function QV(e,t){t&&t.pendingBranch?Oe(e)?t.effects.push(...e):t.effects.push(e):cx(e)}const mr=Symbol.for("v-fgt"),Vo=Symbol.for("v-txt"),Mt=Symbol.for("v-cmt"),Fs=Symbol.for("v-stc"),uo=[];let br=null;function Wt(e=!1){uo.push(br=e?null:[])}function ZV(){uo.pop(),br=uo[uo.length-1]||null}let bo=1;function sg(e){bo+=e,e<0&&br&&(br.hasOnce=!0)}function Jx(e){return e.dynamicChildren=bo>0?br||la:null,ZV(),bo>0&&br&&br.push(e),e}function Fn(e,t,r,n,i,a){return Jx(sn(e,t,r,n,i,a,!0))}function xi(e,t,r,n,i){return Jx($t(e,t,r,n,i,!0))}function ti(e){return e?e.__v_isVNode===!0:!1}function wi(e,t){if(process.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const r=Ms.get(t.type);if(r&&r.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const XV=(...e)=>Kx(...e),Gx=({key:e})=>e??null,Ts=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?xt(e)||Lt(e)||Be(e)?{i:_t,r:e,k:t,f:!!r}:e:null);function sn(e,t=null,r=null,n=0,i=null,a=e===mr?0:1,o=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Gx(t),ref:t&&Ts(t),scopeId:gx,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:_t};return u?(jf(c,r),a&128&&e.normalize(c)):r&&(c.shapeFlag|=xt(r)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&Se("VNode created with invalid key (NaN). VNode type:",c.type),bo>0&&!o&&br&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&br.push(c),c}const $t=process.env.NODE_ENV!=="production"?XV:Kx;function Kx(e,t=null,r=null,n=0,i=null,a=!1){if((!e||e===Sx)&&(process.env.NODE_ENV!=="production"&&!e&&Se(`Invalid vnode type when creating vnode: ${e}.`),e=Mt),ti(e)){const u=un(e,t,!0);return r&&jf(u,r),bo>0&&!a&&br&&(u.shapeFlag&6?br[br.indexOf(e)]=u:br.push(u)),u.patchFlag=-2,u}if(Yx(e)&&(e=e.__vccOpts),t){t=YV(t);let{class:u,style:c}=t;u&&!xt(u)&&(t.class=Rr(u)),lt(c)&&(fl(c)&&!Oe(c)&&(c=Et({},c)),t.style=zo(c))}const o=xt(e)?1:WV(e)?128:kV(e)?64:lt(e)?4:Be(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&fl(e)&&(e=Ye(e),Se("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
97
|
+
Component that was made reactive: `,e)),sn(e,t,r,n,i,o,a,!0)}function YV(e){return e?fl(e)||kx(e)?Et({},e):e:null}function un(e,t,r=!1,n=!1){const{props:i,ref:a,patchFlag:o,children:u,transition:c}=e,l=t?Qx(i||{},t):i,s={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Gx(l),ref:t&&t.ref?r&&a?Oe(a)?a.concat(Ts(t)):[a,Ts(t)]:Ts(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&Oe(u)?u.map(Wx):u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==mr?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&un(e.ssContent),ssFallback:e.ssFallback&&un(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&cu(s,c.clone(s)),s}function Wx(e){const t=un(e);return Oe(e.children)&&(t.children=e.children.map(Wx)),t}function eU(e=" ",t=0){return $t(Vo,null,e,t)}function bs(e="",t=!1){return t?(Wt(),xi(Mt,null,e)):$t(Mt,null,e)}function qr(e){return e==null||typeof e=="boolean"?$t(Mt):Oe(e)?$t(mr,null,e.slice()):typeof e=="object"?Hn(e):$t(Vo,null,String(e))}function Hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:un(e)}function jf(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Oe(t))r=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),jf(e,i()),i._c&&(i._d=!0));return}else{r=32;const i=t._;!i&&!kx(t)?t._ctx=_t:i===3&&_t&&(_t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Be(t)?(t={default:t,_ctx:_t},r=32):(t=String(t),n&64?(r=16,t=[eU(t)]):r=8);e.children=t,e.shapeFlag|=r}function Qx(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const i in n)if(i==="class")t.class!==n.class&&(t.class=Rr([t.class,n.class]));else if(i==="style")t.style=zo([t.style,n.style]);else if(qo(i)){const a=t[i],o=n[i];o&&a!==o&&!(Oe(a)&&a.includes(o))&&(t[i]=a?[].concat(a,o):o)}else i!==""&&(t[i]=n[i])}return t}function Xr(e,t,r,n=null){_r(e,t,7,[r,n])}const tU=Fx();let rU=0;function nU(e,t,r){const n=e.type,i=(t?t.appContext:e.appContext)||tU,a={uid:rU++,vnode:e,type:n,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new ZL(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Rx(n,i),emitsOptions:$x(n,i),emit:null,emitted:null,propsDefaults:vt,inheritAttrs:n.inheritAttrs,ctx:vt,data:vt,props:vt,attrs:vt,slots:vt,refs:vt,setupState:vt,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return process.env.NODE_ENV!=="production"?a.ctx=cV(a):a.ctx={_:a},a.root=t?t.root:a,a.emit=$V.bind(null,a),e.ce&&e.ce(a),a}let Bt=null;const ri=()=>Bt||_t;let mu,Nl;{const e=wf(),t=(r,n)=>{let i;return(i=e[r])||(i=e[r]=[]),i.push(n),a=>{i.length>1?i.forEach(o=>o(a)):i[0](a)}};mu=t("__VUE_INSTANCE_SETTERS__",r=>Bt=r),Nl=t("__VUE_SSR_SETTERS__",r=>Yu=r)}const Uo=e=>{const t=Bt;return mu(e),e.scope.on(),()=>{e.scope.off(),mu(t)}},ug=()=>{Bt&&Bt.scope.off(),mu(null)},iU=Va("slot,component");function Dl(e,{isNativeTag:t}){(iU(e)||t(e))&&Se("Do not use built-in or reserved HTML elements as component id: "+e)}function Zx(e){return e.vnode.shapeFlag&4}let Yu=!1;function aU(e,t=!1,r=!1){t&&Nl(t);const{props:n,children:i}=e.vnode,a=Zx(e);xV(e,n,a,t),TV(e,i,r);const o=a?oU(e,t):void 0;return t&&Nl(!1),o}function oU(e,t){var r;const n=e.type;if(process.env.NODE_ENV!=="production"){if(n.name&&Dl(n.name,e.appContext.config),n.components){const a=Object.keys(n.components);for(let o=0;o<a.length;o++)Dl(a[o],e.appContext.config)}if(n.directives){const a=Object.keys(n.directives);for(let o=0;o<a.length;o++)vx(a[o])}n.compilerOptions&&sU()&&Se('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Mx),process.env.NODE_ENV!=="production"&&lV(e);const{setup:i}=n;if(i){const a=e.setupContext=i.length>1?cU(e):null,o=Uo(e);kn();const u=En(i,e,0,[process.env.NODE_ENV!=="production"?rn(e.props):e.props,a]);if(In(),o(),yf(u)){if(u.then(ug,ug),t)return u.then(c=>{cg(e,c,t)}).catch(c=>{jo(c,e,0)});if(e.asyncDep=u,process.env.NODE_ENV!=="production"&&!e.suspense){const c=(r=n.name)!=null?r:"Anonymous";Se(`Component <${c}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else cg(e,u,t)}else Xx(e,t)}function cg(e,t,r){Be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:lt(t)?(process.env.NODE_ENV!=="production"&&ti(t)&&Se("setup() should not return VNodes directly - return a render function instead."),process.env.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=ix(t),process.env.NODE_ENV!=="production"&&fV(e)):process.env.NODE_ENV!=="production"&&t!==void 0&&Se(`setup() should return an object. Received: ${t===null?"null":typeof t}`),Xx(e,r)}let El;const sU=()=>!El;function Xx(e,t,r){const n=e.type;if(!e.render){if(!t&&El&&!n.render){const i=n.template||Rf(e).template;if(i){process.env.NODE_ENV!=="production"&&gn(e,"compile");const{isCustomElement:a,compilerOptions:o}=e.appContext.config,{delimiters:u,compilerOptions:c}=n,l=Et(Et({isCustomElement:a,delimiters:u},o),c);n.render=El(i,l),process.env.NODE_ENV!=="production"&&vn(e,"compile")}}e.render=n.render||St}{const i=Uo(e);kn();try{mV(e)}finally{In(),i()}}process.env.NODE_ENV!=="production"&&!n.render&&e.render===St&&!t&&(n.template?Se('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):Se("Component is missing template or render function: ",n))}const lg=process.env.NODE_ENV!=="production"?{get(e,t){return pu(),Ht(e,"get",""),e[t]},set(){return Se("setupContext.attrs is readonly."),!1},deleteProperty(){return Se("setupContext.attrs is readonly."),!1}}:{get(e,t){return Ht(e,"get",""),e[t]}};function uU(e){return new Proxy(e.slots,{get(t,r){return Ht(e,"get","$slots"),t[r]}})}function cU(e){const t=r=>{if(process.env.NODE_ENV!=="production"&&(e.exposed&&Se("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(Oe(r)?n="array":Lt(r)&&(n="ref")),n!=="object"&&Se(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(process.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,lg))},get slots(){return n||(n=uU(e))},get emit(){return(i,...a)=>e.emit(i,...a)},expose:t})}else return{attrs:new Proxy(e.attrs,lg),slots:e.slots,emit:e.emit,expose:t}}function ec(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ix(bP(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in Ti)return Ti[r](e)},has(t,r){return r in t||r in Ti}})):e.proxy}const lU=/(?:^|[-_])(\w)/g,fU=e=>e.replace(lU,t=>t.toUpperCase()).replace(/[-_]/g,"");function Lf(e,t=!0){return Be(e)?e.displayName||e.name:e.name||t&&e.__name}function tc(e,t,r=!1){let n=Lf(t);if(!n&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&e&&e.parent){const i=a=>{for(const o in a)if(a[o]===t)return o};n=i(e.components||e.parent.type.components)||i(e.appContext.components)}return n?fU(n):r?"App":"Anonymous"}function Yx(e){return Be(e)&&"__vccOpts"in e}const yt=(e,t)=>{const r=wP(e,t,Yu);if(process.env.NODE_ENV!=="production"){const n=ri();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function pU(e,t,r){const n=arguments.length;return n===2?lt(t)&&!Oe(t)?ti(t)?$t(e,null,[t]):$t(e,t):$t(e,null,t):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&ti(r)&&(r=[r]),$t(e,t,r))}function mU(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(f){return lt(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,s(f)],"<",u(f.value),">"]:fa(f)?["div",{},["span",e,Dn(f)?"ShallowReactive":"Reactive"],"<",u(f),`>${_n(f)?" (readonly)":""}`]:_n(f)?["div",{},["span",e,Dn(f)?"ShallowReadonly":"Readonly"],"<",u(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...a(f.$)]}};function a(f){const p=[];f.type.props&&f.props&&p.push(o("props",Ye(f.props))),f.setupState!==vt&&p.push(o("setup",f.setupState)),f.data!==vt&&p.push(o("data",Ye(f.data)));const m=c(f,"computed");m&&p.push(o("computed",m));const d=c(f,"inject");return d&&p.push(o("injected",d)),p.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),p}function o(f,p){return p=Et({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(m=>["div",{},["span",n,m+": "],u(p[m],!1)])]]:["span",{}]}function u(f,p=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",r,JSON.stringify(f)]:typeof f=="boolean"?["span",n,f]:lt(f)?["object",{object:p?Ye(f):f}]:["span",r,String(f)]}function c(f,p){const m=f.type;if(Be(m))return;const d={};for(const h in f.ctx)l(m,h,p)&&(d[h]=f.ctx[h]);return d}function l(f,p,m){const d=f[m];if(Oe(d)&&d.includes(p)||lt(d)&&p in d||f.extends&&l(f.extends,p,m)||f.mixins&&f.mixins.some(h=>l(h,p,m)))return!0}function s(f){return Dn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const fg="3.4.38",rc=process.env.NODE_ENV!=="production"?Se:St;process.env.NODE_ENV;process.env.NODE_ENV;/**
|
|
98
98
|
* @vue/runtime-dom v3.4.38
|
|
99
99
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
100
100
|
* @license MIT
|
|
101
|
-
**/const
|
|
102
|
-
Expected function or array of functions, received type ${typeof e}.`),St)}function
|
|
101
|
+
**/const dU="http://www.w3.org/2000/svg",hU="http://www.w3.org/1998/Math/MathML",yn=typeof document<"u"?document:null,pg=yn&&yn.createElement("template"),gU={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,n)=>{const i=t==="svg"?yn.createElementNS(dU,e):t==="mathml"?yn.createElementNS(hU,e):r?yn.createElement(e,{is:r}):yn.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>yn.createTextNode(e),createComment:e=>yn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,n,i,a){const o=r?r.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),r),!(i===a||!(i=i.nextSibling)););else{pg.innerHTML=n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e;const u=pg.content;if(n==="svg"||n==="mathml"){const c=u.firstChild;for(;c.firstChild;)u.appendChild(c.firstChild);u.removeChild(c)}t.insertBefore(u,r)}return[o?o.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},jn="transition",Za="animation",xo=Symbol("_vtc"),nc=(e,{slots:t})=>pU(WP,vU(e),t);nc.displayName="Transition";const ew={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};nc.props=Et({},bx,ew);const di=(e,t=[])=>{Oe(e)?e.forEach(r=>r(...t)):e&&e(...t)},mg=e=>e?Oe(e)?e.some(t=>t.length>1):e.length>1:!1;function vU(e){const t={};for(const _ in e)_ in ew||(t[_]=e[_]);if(e.css===!1)return t;const{name:r="v",type:n,duration:i,enterFromClass:a=`${r}-enter-from`,enterActiveClass:o=`${r}-enter-active`,enterToClass:u=`${r}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:s=u,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:p=`${r}-leave-active`,leaveToClass:m=`${r}-leave-to`}=e,d=yU(i),h=d&&d[0],w=d&&d[1],{onBeforeEnter:v,onEnter:x,onEnterCancelled:g,onLeave:b,onLeaveCancelled:y,onBeforeAppear:N=v,onAppear:E=x,onAppearCancelled:A=g}=t,D=(_,R,P)=>{hi(_,R?s:u),hi(_,R?l:o),P&&P()},S=(_,R)=>{_._isLeaving=!1,hi(_,f),hi(_,m),hi(_,p),R&&R()},C=_=>(R,P)=>{const I=_?E:x,O=()=>D(R,_,P);di(I,[R,O]),dg(()=>{hi(R,_?c:a),Ln(R,_?s:u),mg(I)||hg(R,n,h,O)})};return Et(t,{onBeforeEnter(_){di(v,[_]),Ln(_,a),Ln(_,o)},onBeforeAppear(_){di(N,[_]),Ln(_,c),Ln(_,l)},onEnter:C(!1),onAppear:C(!0),onLeave(_,R){_._isLeaving=!0;const P=()=>S(_,R);Ln(_,f),Ln(_,p),wU(),dg(()=>{_._isLeaving&&(hi(_,f),Ln(_,m),mg(b)||hg(_,n,w,P))}),di(b,[_,P])},onEnterCancelled(_){D(_,!1),di(g,[_])},onAppearCancelled(_){D(_,!0),di(A,[_])},onLeaveCancelled(_){S(_),di(y,[_])}})}function yU(e){if(e==null)return null;if(lt(e))return[Tc(e.enter),Tc(e.leave)];{const t=Tc(e);return[t,t]}}function Tc(e){const t=$L(e);return process.env.NODE_ENV!=="production"&&_P(t,"<transition> explicit duration"),t}function Ln(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[xo]||(e[xo]=new Set)).add(t)}function hi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const r=e[xo];r&&(r.delete(t),r.size||(e[xo]=void 0))}function dg(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let bU=0;function hg(e,t,r,n){const i=e._endId=++bU,a=()=>{i===e._endId&&n()};if(r)return setTimeout(a,r);const{type:o,timeout:u,propCount:c}=xU(e,t);if(!o)return n();const l=o+"end";let s=0;const f=()=>{e.removeEventListener(l,p),a()},p=m=>{m.target===e&&++s>=c&&f()};setTimeout(()=>{s<c&&f()},u+1),e.addEventListener(l,p)}function xU(e,t){const r=window.getComputedStyle(e),n=d=>(r[d]||"").split(", "),i=n(`${jn}Delay`),a=n(`${jn}Duration`),o=gg(i,a),u=n(`${Za}Delay`),c=n(`${Za}Duration`),l=gg(u,c);let s=null,f=0,p=0;t===jn?o>0&&(s=jn,f=o,p=a.length):t===Za?l>0&&(s=Za,f=l,p=c.length):(f=Math.max(o,l),s=f>0?o>l?jn:Za:null,p=s?s===jn?a.length:c.length:0);const m=s===jn&&/\b(transform|all)(,|$)/.test(n(`${jn}Property`).toString());return{type:s,timeout:f,propCount:p,hasTransform:m}}function gg(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((r,n)=>vg(r)+vg(e[n])))}function vg(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function wU(){return document.body.offsetHeight}function NU(e,t,r){const n=e[xo];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const du=Symbol("_vod"),tw=Symbol("_vsh"),Pf={beforeMount(e,{value:t},{transition:r}){e[du]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):Xa(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),Xa(e,!0),n.enter(e)):n.leave(e,()=>{Xa(e,!1)}):Xa(e,t))},beforeUnmount(e,{value:t}){Xa(e,t)}};process.env.NODE_ENV!=="production"&&(Pf.name="show");function Xa(e,t){e.style.display=t?e[du]:"none",e[tw]=!t}const DU=Symbol(process.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),EU=/(^|;)\s*display\s*:/;function AU(e,t,r){const n=e.style,i=xt(r);let a=!1;if(r&&!i){if(t)if(xt(t))for(const o of t.split(";")){const u=o.slice(0,o.indexOf(":")).trim();r[u]==null&&Os(n,u,"")}else for(const o in t)r[o]==null&&Os(n,o,"");for(const o in r)o==="display"&&(a=!0),Os(n,o,r[o])}else if(i){if(t!==r){const o=n[DU];o&&(r+=";"+o),n.cssText=r,a=EU.test(r)}}else t&&e.removeAttribute("style");du in e&&(e[du]=a?n.display:"",e[tw]&&(n.display="none"))}const SU=/[^\\];\s*$/,yg=/\s*!important$/;function Os(e,t,r){if(Oe(r))r.forEach(n=>Os(e,t,n));else if(r==null&&(r=""),process.env.NODE_ENV!=="production"&&SU.test(r)&&rc(`Unexpected semicolon at the end of '${t}' style value: '${r}'`),t.startsWith("--"))e.setProperty(t,r);else{const n=CU(e,t);yg.test(r)?e.setProperty(Cn(n),r.replace(yg,""),"important"):e[n]=r}}const bg=["Webkit","Moz","ms"],Oc={};function CU(e,t){const r=Oc[t];if(r)return r;let n=wr(t);if(n!=="filter"&&n in e)return Oc[t]=n;n=Ri(n);for(let i=0;i<bg.length;i++){const a=bg[i]+n;if(a in e)return Oc[t]=a}return t}const xg="http://www.w3.org/1999/xlink";function wg(e,t,r,n,i,a=QL(t)){n&&t.startsWith("xlink:")?r==null?e.removeAttributeNS(xg,t.slice(6,t.length)):e.setAttributeNS(xg,t,r):r==null||a&&!qb(r)?e.removeAttribute(t):e.setAttribute(t,a?"":fi(r)?String(r):r)}function MU(e,t,r,n){if(t==="innerHTML"||t==="textContent"){if(r==null)return;e[t]=r;return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const o=i==="OPTION"?e.getAttribute("value")||"":e.value,u=r==null?"":String(r);(o!==u||!("_value"in e))&&(e.value=u),r==null&&e.removeAttribute(t),e._value=r;return}let a=!1;if(r===""||r==null){const o=typeof e[t];o==="boolean"?r=qb(r):r==null&&o==="string"?(r="",a=!0):o==="number"&&(r=0,a=!0)}try{e[t]=r}catch(o){process.env.NODE_ENV!=="production"&&!a&&rc(`Failed setting prop "${t}" on <${i.toLowerCase()}>: value ${r} is invalid.`,o)}a&&e.removeAttribute(t)}function _U(e,t,r,n){e.addEventListener(t,r,n)}function FU(e,t,r,n){e.removeEventListener(t,r,n)}const Ng=Symbol("_vei");function TU(e,t,r,n,i=null){const a=e[Ng]||(e[Ng]={}),o=a[t];if(n&&o)o.value=process.env.NODE_ENV!=="production"?Eg(n,t):n;else{const[u,c]=OU(t);if(n){const l=a[t]=IU(process.env.NODE_ENV!=="production"?Eg(n,t):n,i);_U(e,u,l,c)}else o&&(FU(e,u,o,c),a[t]=void 0)}}const Dg=/(?:Once|Passive|Capture)$/;function OU(e){let t;if(Dg.test(e)){t={};let r;for(;r=e.match(Dg);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Cn(e.slice(2)),t]}let Bc=0;const BU=Promise.resolve(),kU=()=>Bc||(BU.then(()=>Bc=0),Bc=Date.now());function IU(e,t){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;_r(RU(n,r.value),t,5,[n])};return r.value=e,r.attached=kU(),r}function Eg(e,t){return Be(e)||Oe(e)?e:(rc(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
102
|
+
Expected function or array of functions, received type ${typeof e}.`),St)}function RU(e,t){if(Oe(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(n=>i=>!i._stopped&&n&&n(i))}else return t}const Ag=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,qU=(e,t,r,n,i,a)=>{const o=i==="svg";t==="class"?NU(e,n,o):t==="style"?AU(e,r,n):qo(t)?au(t)||TU(e,t,r,n,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):zU(e,t,n,o))?(MU(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&wg(e,t,n,o,a,t!=="value")):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),wg(e,t,n,o))};function zU(e,t,r,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ag(t)&&Be(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Ag(t)&&xt(r)?!1:t in e}const jU=["ctrl","shift","alt","meta"],LU={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>jU.some(r=>e[`${r}Key`]&&!t.includes(r))},PU=(e,t)=>{const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=(i,...a)=>{for(let o=0;o<t.length;o++){const u=LU[t[o]];if(u&&u(i,t))return}return e(i,...a)})},VU=Et({patchProp:qU},gU);let Sg;function UU(){return Sg||(Sg=RV(VU))}const Cg=(...e)=>{UU().render(...e)};/**
|
|
103
103
|
* vue v3.4.38
|
|
104
104
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
105
105
|
* @license MIT
|
|
106
|
-
**/function IU(){iU()}process.env.NODE_ENV!=="production"&&IU();var xg;const La=typeof window<"u",RU=e=>typeof e=="string",qU=()=>{};La&&(xg=window==null?void 0:window.navigator)!=null&&xg.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Rf(e){return typeof e=="function"?e():et(e)}function zU(e){return e}function qf(e){return Tb()?($L(e),!0):!1}function jU(e,t=!0){ri()?Ju(e):t?e():Xb(e)}function LU(e,t,r={}){const{immediate:n=!0}=r,i=Ur(!1);let a=null;function o(){a&&(clearTimeout(a),a=null)}function u(){i.value=!1,o()}function c(...l){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,e(...l)},Rf(t))}return n&&(i.value=!0,La&&c()),qf(u),{isPending:Nf(i),start:c,stop:u}}function Gx(e){var t;const r=Rf(e);return(t=r==null?void 0:r.$el)!=null?t:r}const Wx=La?window:void 0;function PU(...e){let t,r,n,i;if(RU(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=Wx):[t,r,n,i]=e,!t)return qU;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const a=[],o=()=>{a.forEach(s=>s()),a.length=0},u=(s,f,p,m)=>(s.addEventListener(f,p,m),()=>s.removeEventListener(f,p,m)),c=fa(()=>[Gx(t),Rf(i)],([s,f])=>{o(),s&&a.push(...r.flatMap(p=>n.map(m=>u(s,p,m,f))))},{immediate:!0,flush:"post"}),l=()=>{c(),o()};return qf(l),l}function VU(e,t=!1){const r=Ur(),n=()=>r.value=!!e();return n(),jU(n,t),r}const wg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ng="__vueuse_ssr_handlers__";wg[Ng]=wg[Ng]||{};var Dg=Object.getOwnPropertySymbols,UU=Object.prototype.hasOwnProperty,$U=Object.prototype.propertyIsEnumerable,HU=(e,t)=>{var r={};for(var n in e)UU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dg)for(var n of Dg(e))t.indexOf(n)<0&&$U.call(e,n)&&(r[n]=e[n]);return r};function JU(e,t,r={}){const n=r,{window:i=Wx}=n,a=HU(n,["window"]);let o;const u=VU(()=>i&&"ResizeObserver"in i),c=()=>{o&&(o.disconnect(),o=void 0)},l=fa(()=>Gx(e),f=>{c(),u.value&&i&&f&&(o=new ResizeObserver(t),o.observe(f,a))},{immediate:!0,flush:"post"}),s=()=>{c(),l()};return qf(s),{isSupported:u,stop:s}}var Eg;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Eg||(Eg={}));var GU=Object.defineProperty,Ag=Object.getOwnPropertySymbols,WU=Object.prototype.hasOwnProperty,KU=Object.prototype.propertyIsEnumerable,Sg=(e,t,r)=>t in e?GU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QU=(e,t)=>{for(var r in t||(t={}))WU.call(t,r)&&Sg(e,r,t[r]);if(Ag)for(var r of Ag(t))KU.call(t,r)&&Sg(e,r,t[r]);return e};const ZU={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};QU({linear:zU},ZU);var XU=typeof global=="object"&&global&&global.Object===Object&&global,YU=typeof self=="object"&&self&&self.Object===Object&&self,zf=XU||YU||Function("return this")(),xa=zf.Symbol,Kx=Object.prototype,e$=Kx.hasOwnProperty,t$=Kx.toString,Qa=xa?xa.toStringTag:void 0;function r$(e){var t=e$.call(e,Qa),r=e[Qa];try{e[Qa]=void 0;var n=!0}catch{}var i=t$.call(e);return n&&(t?e[Qa]=r:delete e[Qa]),i}var n$=Object.prototype,i$=n$.toString;function a$(e){return i$.call(e)}var o$="[object Null]",s$="[object Undefined]",Cg=xa?xa.toStringTag:void 0;function Qx(e){return e==null?e===void 0?s$:o$:Cg&&Cg in Object(e)?r$(e):a$(e)}function u$(e){return e!=null&&typeof e=="object"}var c$="[object Symbol]";function jf(e){return typeof e=="symbol"||u$(e)&&Qx(e)==c$}function l$(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Lf=Array.isArray,f$=1/0,Mg=xa?xa.prototype:void 0,_g=Mg?Mg.toString:void 0;function Zx(e){if(typeof e=="string")return e;if(Lf(e))return l$(e,Zx)+"";if(jf(e))return _g?_g.call(e):"";var t=e+"";return t=="0"&&1/e==-f$?"-0":t}function Xx(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var p$="[object AsyncFunction]",m$="[object Function]",d$="[object GeneratorFunction]",h$="[object Proxy]";function g$(e){if(!Xx(e))return!1;var t=Qx(e);return t==m$||t==d$||t==p$||t==h$}var _c=zf["__core-js_shared__"],Fg=function(){var e=/[^.]+$/.exec(_c&&_c.keys&&_c.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function v$(e){return!!Fg&&Fg in e}var y$=Function.prototype,b$=y$.toString;function x$(e){if(e!=null){try{return b$.call(e)}catch{}try{return e+""}catch{}}return""}var w$=/[\\^$.*+?()[\]{}|]/g,N$=/^\[object .+?Constructor\]$/,D$=Function.prototype,E$=Object.prototype,A$=D$.toString,S$=E$.hasOwnProperty,C$=RegExp("^"+A$.call(S$).replace(w$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function M$(e){if(!Xx(e)||v$(e))return!1;var t=g$(e)?C$:N$;return t.test(x$(e))}function _$(e,t){return e==null?void 0:e[t]}function Yx(e,t){var r=_$(e,t);return M$(r)?r:void 0}function F$(e,t){return e===t||e!==e&&t!==t}var T$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O$=/^\w*$/;function B$(e,t){if(Lf(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||jf(e)?!0:O$.test(e)||!T$.test(e)||t!=null&&e in Object(t)}var vo=Yx(Object,"create");function k$(){this.__data__=vo?vo(null):{},this.size=0}function I$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var R$="__lodash_hash_undefined__",q$=Object.prototype,z$=q$.hasOwnProperty;function j$(e){var t=this.__data__;if(vo){var r=t[e];return r===R$?void 0:r}return z$.call(t,e)?t[e]:void 0}var L$=Object.prototype,P$=L$.hasOwnProperty;function V$(e){var t=this.__data__;return vo?t[e]!==void 0:P$.call(t,e)}var U$="__lodash_hash_undefined__";function $$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=vo&&t===void 0?U$:t,this}function Ri(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ri.prototype.clear=k$;Ri.prototype.delete=I$;Ri.prototype.get=j$;Ri.prototype.has=V$;Ri.prototype.set=$$;function H$(){this.__data__=[],this.size=0}function Yu(e,t){for(var r=e.length;r--;)if(F$(e[r][0],t))return r;return-1}var J$=Array.prototype,G$=J$.splice;function W$(e){var t=this.__data__,r=Yu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():G$.call(t,r,1),--this.size,!0}function K$(e){var t=this.__data__,r=Yu(t,e);return r<0?void 0:t[r][1]}function Q$(e){return Yu(this.__data__,e)>-1}function Z$(e,t){var r=this.__data__,n=Yu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Pa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pa.prototype.clear=H$;Pa.prototype.delete=W$;Pa.prototype.get=K$;Pa.prototype.has=Q$;Pa.prototype.set=Z$;var X$=Yx(zf,"Map");function Y$(){this.size=0,this.__data__={hash:new Ri,map:new(X$||Pa),string:new Ri}}function eH(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ec(e,t){var r=e.__data__;return eH(t)?r[typeof t=="string"?"string":"hash"]:r.map}function tH(e){var t=ec(this,e).delete(e);return this.size-=t?1:0,t}function rH(e){return ec(this,e).get(e)}function nH(e){return ec(this,e).has(e)}function iH(e,t){var r=ec(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Ki(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ki.prototype.clear=Y$;Ki.prototype.delete=tH;Ki.prototype.get=rH;Ki.prototype.has=nH;Ki.prototype.set=iH;var aH="Expected a function";function Pf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(aH);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Pf.Cache||Ki),r}Pf.Cache=Ki;var oH=500;function sH(e){var t=Pf(e,function(n){return r.size===oH&&r.clear(),n}),r=t.cache;return t}var uH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cH=/\\(\\)?/g,lH=sH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(uH,function(r,n,i,a){t.push(i?a.replace(cH,"$1"):n||r)}),t});function fH(e){return e==null?"":Zx(e)}function pH(e,t){return Lf(e)?e:B$(e,t)?[e]:lH(fH(e))}var mH=1/0;function dH(e){if(typeof e=="string"||jf(e))return e;var t=e+"";return t=="0"&&1/e==-mH?"-0":t}function hH(e,t){t=pH(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[dH(t[r++])];return r&&r==n?e:void 0}function gH(e,t,r){var n=e==null?void 0:hH(e,t);return n===void 0?r:n}function vH(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}const yH=e=>e===void 0,yo=e=>typeof e=="number",bH=e=>typeof Element>"u"?!1:e instanceof Element,xH=e=>xt(e)?!Number.isNaN(Number(e)):!1,Tg=e=>Object.keys(e);class wH extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function tc(e,t){if(process.env.NODE_ENV!=="production"){const r=xt(e)?new wH(`[${e}] ${t}`):e;console.warn(r)}}const NH="utils/dom/style";function xl(e,t="px"){if(!e)return"";if(yo(e)||xH(e))return`${e}${t}`;if(xt(e))return e;tc(NH,"binding value must be a string or number")}/*! Element Plus Icons Vue v2.3.1 */var DH=Zr({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),ew=DH,EH=Zr({name:"Close",__name:"close",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),AH=EH,SH=Zr({name:"InfoFilled",__name:"info-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),tw=SH,CH=Zr({name:"SuccessFilled",__name:"success-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),rw=CH,MH=Zr({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),nw=MH;const iw="__epPropKey",wa=e=>e,_H=e=>lt(e)&&!!e[iw],aw=(e,t)=>{if(!lt(e)||_H(e))return e;const{values:r,required:n,default:i,type:a,validator:o}=e,u={type:a,required:!!n,validator:r||o?c=>{let l=!1,s=[];if(r&&(s=Array.from(r),tt(e,"default")&&s.push(i),l||(l=s.includes(c))),o&&(l||(l=o(c))),!l&&s.length>0){const f=[...new Set(s)].map(p=>JSON.stringify(p)).join(", ");Zu(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${f}], got value ${JSON.stringify(c)}.`)}return l}:void 0,[iw]:!0};return tt(e,"default")&&(u.default=i),u},rc=e=>vH(Object.entries(e).map(([t,r])=>[t,aw(r,t)])),FH=wa([String,Object,Function]),TH={Close:AH,SuccessFilled:rw,InfoFilled:tw,WarningFilled:nw,CircleCloseFilled:ew},Og={success:rw,warning:nw,error:ew,info:tw},ow=(e,t)=>(e.install=r=>{for(const n of[e,...Object.values({})])r.component(n.name,n)},e),OH=(e,t)=>(e.install=r=>{e._context=r._context,r.config.globalProperties[t]=e},e),BH={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},kH=["","default","small","large"],IH=e=>e;var RH={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const qH=e=>(t,r)=>zH(t,r,et(e)),zH=(e,t,r)=>gH(r,e,e).replace(/\{(\w+)\}/g,(n,i)=>{var a;return`${(a=t==null?void 0:t[i])!=null?a:`{${i}}`}`}),jH=e=>{const t=yt(()=>et(e).name),r=Lt(e)?e:Ur(e);return{lang:t,locale:r,t:qH(e)}},sw=Symbol("localeContextKey"),LH=e=>{const t=e||an(sw,Ur());return jH(yt(()=>t.value||RH))},Ms="el",PH="is-",gi=(e,t,r,n,i)=>{let a=`${e}-${t}`;return r&&(a+=`-${r}`),n&&(a+=`__${n}`),i&&(a+=`--${i}`),a},uw=Symbol("namespaceContextKey"),VH=e=>{const t=e||(ri()?an(uw,Ur(Ms)):Ur(Ms));return yt(()=>et(t)||Ms)},Vf=(e,t)=>{const r=VH(t);return{namespace:r,b:(n="")=>gi(r.value,e,n,"",""),e:n=>n?gi(r.value,e,"",n,""):"",m:n=>n?gi(r.value,e,"","",n):"",be:(n,i)=>n&&i?gi(r.value,e,n,i,""):"",em:(n,i)=>n&&i?gi(r.value,e,"",n,i):"",bm:(n,i)=>n&&i?gi(r.value,e,n,"",i):"",bem:(n,i,a)=>n&&i&&a?gi(r.value,e,n,i,a):"",is:(n,...i)=>{const a=i.length>=1?i[0]:!0;return n&&a?`${PH}${n}`:""},cssVar:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${a}`]=n[a]);return i},cssVarName:n=>`--${r.value}-${n}`,cssVarBlock:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${e}-${a}`]=n[a]);return i},cssVarBlockName:n=>`--${r.value}-${e}-${n}`}},Bg={current:0},kg=Ur(0),cw=2e3,Ig=Symbol("elZIndexContextKey"),lw=Symbol("zIndexContextKey"),UH=e=>{const t=ri()?an(Ig,Bg):Bg,r=e||(ri()?an(lw,void 0):void 0),n=yt(()=>{const o=et(r);return yo(o)?o:cw}),i=yt(()=>n.value+kg.value),a=()=>(t.current++,kg.value=t.current,i.value);return!La&&!an(Ig)&&tc("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
107
|
-
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:i,nextZIndex:a}};
|
|
106
|
+
**/function $U(){mU()}process.env.NODE_ENV!=="production"&&$U();var Mg;const Ua=typeof window<"u",HU=e=>typeof e=="string",JU=()=>{};Ua&&(Mg=window==null?void 0:window.navigator)!=null&&Mg.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Vf(e){return typeof e=="function"?e():et(e)}function GU(e){return e}function Uf(e){return Lb()?(YL(e),!0):!1}function KU(e,t=!0){ri()?Zu(e):t?e():sx(e)}function WU(e,t,r={}){const{immediate:n=!0}=r,i=Ur(!1);let a=null;function o(){a&&(clearTimeout(a),a=null)}function u(){i.value=!1,o()}function c(...l){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,e(...l)},Vf(t))}return n&&(i.value=!0,Ua&&c()),Uf(u),{isPending:Mf(i),start:c,stop:u}}function rw(e){var t;const r=Vf(e);return(t=r==null?void 0:r.$el)!=null?t:r}const nw=Ua?window:void 0;function QU(...e){let t,r,n,i;if(HU(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=nw):[t,r,n,i]=e,!t)return JU;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const a=[],o=()=>{a.forEach(s=>s()),a.length=0},u=(s,f,p,m)=>(s.addEventListener(f,p,m),()=>s.removeEventListener(f,p,m)),c=da(()=>[rw(t),Vf(i)],([s,f])=>{o(),s&&a.push(...r.flatMap(p=>n.map(m=>u(s,p,m,f))))},{immediate:!0,flush:"post"}),l=()=>{c(),o()};return Uf(l),l}function ZU(e,t=!1){const r=Ur(),n=()=>r.value=!!e();return n(),KU(n,t),r}const _g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fg="__vueuse_ssr_handlers__";_g[Fg]=_g[Fg]||{};var Tg=Object.getOwnPropertySymbols,XU=Object.prototype.hasOwnProperty,YU=Object.prototype.propertyIsEnumerable,e$=(e,t)=>{var r={};for(var n in e)XU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tg)for(var n of Tg(e))t.indexOf(n)<0&&YU.call(e,n)&&(r[n]=e[n]);return r};function t$(e,t,r={}){const n=r,{window:i=nw}=n,a=e$(n,["window"]);let o;const u=ZU(()=>i&&"ResizeObserver"in i),c=()=>{o&&(o.disconnect(),o=void 0)},l=da(()=>rw(e),f=>{c(),u.value&&i&&f&&(o=new ResizeObserver(t),o.observe(f,a))},{immediate:!0,flush:"post"}),s=()=>{c(),l()};return Uf(s),{isSupported:u,stop:s}}var Og;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Og||(Og={}));var r$=Object.defineProperty,Bg=Object.getOwnPropertySymbols,n$=Object.prototype.hasOwnProperty,i$=Object.prototype.propertyIsEnumerable,kg=(e,t,r)=>t in e?r$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a$=(e,t)=>{for(var r in t||(t={}))n$.call(t,r)&&kg(e,r,t[r]);if(Bg)for(var r of Bg(t))i$.call(t,r)&&kg(e,r,t[r]);return e};const o$={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};a$({linear:GU},o$);var s$=typeof global=="object"&&global&&global.Object===Object&&global,u$=typeof self=="object"&&self&&self.Object===Object&&self,$f=s$||u$||Function("return this")(),Da=$f.Symbol,iw=Object.prototype,c$=iw.hasOwnProperty,l$=iw.toString,Ya=Da?Da.toStringTag:void 0;function f$(e){var t=c$.call(e,Ya),r=e[Ya];try{e[Ya]=void 0;var n=!0}catch{}var i=l$.call(e);return n&&(t?e[Ya]=r:delete e[Ya]),i}var p$=Object.prototype,m$=p$.toString;function d$(e){return m$.call(e)}var h$="[object Null]",g$="[object Undefined]",Ig=Da?Da.toStringTag:void 0;function aw(e){return e==null?e===void 0?g$:h$:Ig&&Ig in Object(e)?f$(e):d$(e)}function v$(e){return e!=null&&typeof e=="object"}var y$="[object Symbol]";function Hf(e){return typeof e=="symbol"||v$(e)&&aw(e)==y$}function b$(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Jf=Array.isArray,x$=1/0,Rg=Da?Da.prototype:void 0,qg=Rg?Rg.toString:void 0;function ow(e){if(typeof e=="string")return e;if(Jf(e))return b$(e,ow)+"";if(Hf(e))return qg?qg.call(e):"";var t=e+"";return t=="0"&&1/e==-x$?"-0":t}function sw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var w$="[object AsyncFunction]",N$="[object Function]",D$="[object GeneratorFunction]",E$="[object Proxy]";function A$(e){if(!sw(e))return!1;var t=aw(e);return t==N$||t==D$||t==w$||t==E$}var kc=$f["__core-js_shared__"],zg=function(){var e=/[^.]+$/.exec(kc&&kc.keys&&kc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function S$(e){return!!zg&&zg in e}var C$=Function.prototype,M$=C$.toString;function _$(e){if(e!=null){try{return M$.call(e)}catch{}try{return e+""}catch{}}return""}var F$=/[\\^$.*+?()[\]{}|]/g,T$=/^\[object .+?Constructor\]$/,O$=Function.prototype,B$=Object.prototype,k$=O$.toString,I$=B$.hasOwnProperty,R$=RegExp("^"+k$.call(I$).replace(F$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q$(e){if(!sw(e)||S$(e))return!1;var t=A$(e)?R$:T$;return t.test(_$(e))}function z$(e,t){return e==null?void 0:e[t]}function uw(e,t){var r=z$(e,t);return q$(r)?r:void 0}function j$(e,t){return e===t||e!==e&&t!==t}var L$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P$=/^\w*$/;function V$(e,t){if(Jf(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Hf(e)?!0:P$.test(e)||!L$.test(e)||t!=null&&e in Object(t)}var wo=uw(Object,"create");function U$(){this.__data__=wo?wo(null):{},this.size=0}function $$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var H$="__lodash_hash_undefined__",J$=Object.prototype,G$=J$.hasOwnProperty;function K$(e){var t=this.__data__;if(wo){var r=t[e];return r===H$?void 0:r}return G$.call(t,e)?t[e]:void 0}var W$=Object.prototype,Q$=W$.hasOwnProperty;function Z$(e){var t=this.__data__;return wo?t[e]!==void 0:Q$.call(t,e)}var X$="__lodash_hash_undefined__";function Y$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=wo&&t===void 0?X$:t,this}function zi(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}zi.prototype.clear=U$;zi.prototype.delete=$$;zi.prototype.get=K$;zi.prototype.has=Z$;zi.prototype.set=Y$;function eH(){this.__data__=[],this.size=0}function ic(e,t){for(var r=e.length;r--;)if(j$(e[r][0],t))return r;return-1}var tH=Array.prototype,rH=tH.splice;function nH(e){var t=this.__data__,r=ic(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():rH.call(t,r,1),--this.size,!0}function iH(e){var t=this.__data__,r=ic(t,e);return r<0?void 0:t[r][1]}function aH(e){return ic(this.__data__,e)>-1}function oH(e,t){var r=this.__data__,n=ic(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function $a(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}$a.prototype.clear=eH;$a.prototype.delete=nH;$a.prototype.get=iH;$a.prototype.has=aH;$a.prototype.set=oH;var sH=uw($f,"Map");function uH(){this.size=0,this.__data__={hash:new zi,map:new(sH||$a),string:new zi}}function cH(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ac(e,t){var r=e.__data__;return cH(t)?r[typeof t=="string"?"string":"hash"]:r.map}function lH(e){var t=ac(this,e).delete(e);return this.size-=t?1:0,t}function fH(e){return ac(this,e).get(e)}function pH(e){return ac(this,e).has(e)}function mH(e,t){var r=ac(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Zi(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Zi.prototype.clear=uH;Zi.prototype.delete=lH;Zi.prototype.get=fH;Zi.prototype.has=pH;Zi.prototype.set=mH;var dH="Expected a function";function Gf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(dH);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Gf.Cache||Zi),r}Gf.Cache=Zi;var hH=500;function gH(e){var t=Gf(e,function(n){return r.size===hH&&r.clear(),n}),r=t.cache;return t}var vH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yH=/\\(\\)?/g,bH=gH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(vH,function(r,n,i,a){t.push(i?a.replace(yH,"$1"):n||r)}),t});function xH(e){return e==null?"":ow(e)}function wH(e,t){return Jf(e)?e:V$(e,t)?[e]:bH(xH(e))}var NH=1/0;function DH(e){if(typeof e=="string"||Hf(e))return e;var t=e+"";return t=="0"&&1/e==-NH?"-0":t}function EH(e,t){t=wH(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[DH(t[r++])];return r&&r==n?e:void 0}function AH(e,t,r){var n=e==null?void 0:EH(e,t);return n===void 0?r:n}function SH(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}const CH=e=>e===void 0,No=e=>typeof e=="number",MH=e=>typeof Element>"u"?!1:e instanceof Element,_H=e=>xt(e)?!Number.isNaN(Number(e)):!1,jg=e=>Object.keys(e);class FH extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function oc(e,t){if(process.env.NODE_ENV!=="production"){const r=xt(e)?new FH(`[${e}] ${t}`):e;console.warn(r)}}const TH="utils/dom/style";function Al(e,t="px"){if(!e)return"";if(No(e)||_H(e))return`${e}${t}`;if(xt(e))return e;oc(TH,"binding value must be a string or number")}/*! Element Plus Icons Vue v2.3.1 */var OH=Zr({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(t,r)=>(Wt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),cw=OH,BH=Zr({name:"Close",__name:"close",setup(e){return(t,r)=>(Wt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),kH=BH,IH=Zr({name:"InfoFilled",__name:"info-filled",setup(e){return(t,r)=>(Wt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),lw=IH,RH=Zr({name:"SuccessFilled",__name:"success-filled",setup(e){return(t,r)=>(Wt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),fw=RH,qH=Zr({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,r)=>(Wt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),pw=qH;const mw="__epPropKey",Ea=e=>e,zH=e=>lt(e)&&!!e[mw],dw=(e,t)=>{if(!lt(e)||zH(e))return e;const{values:r,required:n,default:i,type:a,validator:o}=e,u={type:a,required:!!n,validator:r||o?c=>{let l=!1,s=[];if(r&&(s=Array.from(r),tt(e,"default")&&s.push(i),l||(l=s.includes(c))),o&&(l||(l=o(c))),!l&&s.length>0){const f=[...new Set(s)].map(p=>JSON.stringify(p)).join(", ");rc(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${f}], got value ${JSON.stringify(c)}.`)}return l}:void 0,[mw]:!0};return tt(e,"default")&&(u.default=i),u},sc=e=>SH(Object.entries(e).map(([t,r])=>[t,dw(r,t)])),jH=Ea([String,Object,Function]),LH={Close:kH,SuccessFilled:fw,InfoFilled:lw,WarningFilled:pw,CircleCloseFilled:cw},Lg={success:fw,warning:pw,error:cw,info:lw},hw=(e,t)=>(e.install=r=>{for(const n of[e,...Object.values({})])r.component(n.name,n)},e),PH=(e,t)=>(e.install=r=>{e._context=r._context,r.config.globalProperties[t]=e},e),VH={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UH=["","default","small","large"],$H=e=>e;var HH={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const JH=e=>(t,r)=>GH(t,r,et(e)),GH=(e,t,r)=>AH(r,e,e).replace(/\{(\w+)\}/g,(n,i)=>{var a;return`${(a=t==null?void 0:t[i])!=null?a:`{${i}}`}`}),KH=e=>{const t=yt(()=>et(e).name),r=Lt(e)?e:Ur(e);return{lang:t,locale:r,t:JH(e)}},gw=Symbol("localeContextKey"),WH=e=>{const t=e||an(gw,Ur());return KH(yt(()=>t.value||HH))},Bs="el",QH="is-",gi=(e,t,r,n,i)=>{let a=`${e}-${t}`;return r&&(a+=`-${r}`),n&&(a+=`__${n}`),i&&(a+=`--${i}`),a},vw=Symbol("namespaceContextKey"),ZH=e=>{const t=e||(ri()?an(vw,Ur(Bs)):Ur(Bs));return yt(()=>et(t)||Bs)},Kf=(e,t)=>{const r=ZH(t);return{namespace:r,b:(n="")=>gi(r.value,e,n,"",""),e:n=>n?gi(r.value,e,"",n,""):"",m:n=>n?gi(r.value,e,"","",n):"",be:(n,i)=>n&&i?gi(r.value,e,n,i,""):"",em:(n,i)=>n&&i?gi(r.value,e,"",n,i):"",bm:(n,i)=>n&&i?gi(r.value,e,n,"",i):"",bem:(n,i,a)=>n&&i&&a?gi(r.value,e,n,i,a):"",is:(n,...i)=>{const a=i.length>=1?i[0]:!0;return n&&a?`${QH}${n}`:""},cssVar:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${a}`]=n[a]);return i},cssVarName:n=>`--${r.value}-${n}`,cssVarBlock:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${e}-${a}`]=n[a]);return i},cssVarBlockName:n=>`--${r.value}-${e}-${n}`}},Pg={current:0},Vg=Ur(0),yw=2e3,Ug=Symbol("elZIndexContextKey"),bw=Symbol("zIndexContextKey"),XH=e=>{const t=ri()?an(Ug,Pg):Pg,r=e||(ri()?an(bw,void 0):void 0),n=yt(()=>{const o=et(r);return No(o)?o:yw}),i=yt(()=>n.value+Vg.value),a=()=>(t.current++,Vg.value=t.current,i.value);return!Ua&&!an(Ug)&&oc("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
107
|
+
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:i,nextZIndex:a}};dw({type:String,values:UH,required:!1});const YH=Symbol("size"),eJ=Symbol("emptyValuesContextKey");sc({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>Be(e)?!e():!e}});const xw=Symbol(),hu=Ur();function ww(e,t=void 0){return ri()?an(xw,hu):hu}function tJ(e,t){const r=ww(),n=Kf(e,yt(()=>{var u;return((u=r.value)==null?void 0:u.namespace)||Bs})),i=WH(yt(()=>{var u;return(u=r.value)==null?void 0:u.locale})),a=XH(yt(()=>{var u;return((u=r.value)==null?void 0:u.zIndex)||yw})),o=yt(()=>{var u;return et(t)||((u=r.value)==null?void 0:u.size)||""});return rJ(yt(()=>et(r)||{})),{ns:n,locale:i,zIndex:a,size:o}}const rJ=(e,t,r=!1)=>{var n;const i=!!ri(),a=i?ww():void 0,o=(n=void 0)!=null?n:i?Tx:void 0;if(!o){oc("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const u=yt(()=>{const c=et(e);return a!=null&&a.value?nJ(a.value,c):c});return o(xw,u),o(gw,yt(()=>u.value.locale)),o(vw,yt(()=>u.value.namespace)),o(bw,yt(()=>u.value.zIndex)),o(YH,{size:yt(()=>u.value.size||"")}),o(eJ,yt(()=>({emptyValues:u.value.emptyValues,valueOnClear:u.value.valueOnClear}))),(r||!hu.value)&&(hu.value=u.value),u},nJ=(e,t)=>{const r=[...new Set([...jg(e),...jg(t)])],n={};for(const i of r)n[i]=t[i]!==void 0?t[i]:e[i];return n},$g={};var Wf=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r};const iJ=sc({size:{type:Ea([Number,String])},color:{type:String}}),aJ=Zr({name:"ElIcon",inheritAttrs:!1}),oJ=Zr({...aJ,props:iJ,setup(e){const t=e,r=Kf("icon"),n=yt(()=>{const{size:i,color:a}=t;return!i&&!a?{}:{fontSize:CH(i)?void 0:Al(i),"--color":a}});return(i,a)=>(Wt(),Fn("i",Qx({class:et(r).b(),style:et(n)},i.$attrs),[kf(i.$slots,"default")],16))}});var sJ=Wf(oJ,[["__file","icon.vue"]]);const Hg=hw(sJ),uJ=sc({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:Ea([String,Object,Array])},offset:{type:Ea(Array),default:[0,0]},badgeClass:{type:String}}),cJ=Zr({name:"ElBadge"}),lJ=Zr({...cJ,props:uJ,setup(e,{expose:t}){const r=e,n=Kf("badge"),i=yt(()=>r.isDot?"":No(r.value)&&No(r.max)?r.max<r.value?`${r.max}+`:r.value===0&&!r.showZero?"":`${r.value}`:`${r.value}`),a=yt(()=>{var o,u,c,l,s;return[{backgroundColor:r.color,marginRight:Al(-((u=(o=r.offset)==null?void 0:o[0])!=null?u:0)),marginTop:Al((l=(c=r.offset)==null?void 0:c[1])!=null?l:0)},(s=r.badgeStyle)!=null?s:{}]});return t({content:i}),(o,u)=>(Wt(),Fn("div",{class:Rr(et(n).b())},[kf(o.$slots,"default"),$t(nc,{name:`${et(n).namespace.value}-zoom-in-center`,persisted:""},{default:oo(()=>[yx(sn("sup",{class:Rr([et(n).e("content"),et(n).em("content",o.type),et(n).is("fixed",!!o.$slots.default),et(n).is("dot",o.isDot),o.badgeClass]),style:zo(et(a)),textContent:Nf(et(i))},null,14,["textContent"]),[[Pf,!o.hidden&&(et(i)||o.isDot)]])]),_:1},8,["name"])],2))}});var fJ=Wf(lJ,[["__file","badge.vue"]]);const pJ=hw(fJ),Nw=["success","info","warning","error"],Kt=$H({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Ua?document.body:void 0}),mJ=sc({customClass:{type:String,default:Kt.customClass},center:{type:Boolean,default:Kt.center},dangerouslyUseHTMLString:{type:Boolean,default:Kt.dangerouslyUseHTMLString},duration:{type:Number,default:Kt.duration},icon:{type:jH,default:Kt.icon},id:{type:String,default:Kt.id},message:{type:Ea([String,Object,Function]),default:Kt.message},onClose:{type:Ea(Function),default:Kt.onClose},showClose:{type:Boolean,default:Kt.showClose},type:{type:String,values:Nw,default:Kt.type},plain:{type:Boolean,default:Kt.plain},offset:{type:Number,default:Kt.offset},zIndex:{type:Number,default:Kt.zIndex},grouping:{type:Boolean,default:Kt.grouping},repeatNum:{type:Number,default:Kt.repeatNum}}),dJ={destroy:()=>!0},jr=tx([]),hJ=e=>{const t=jr.findIndex(i=>i.id===e),r=jr[t];let n;return t>0&&(n=jr[t-1]),{current:r,prev:n}},gJ=e=>{const{prev:t}=hJ(e);return t?t.vm.exposed.bottom.value:0},vJ=(e,t)=>jr.findIndex(r=>r.id===e)>0?16:t,yJ=Zr({name:"ElMessage"}),bJ=Zr({...yJ,props:mJ,emits:dJ,setup(e,{expose:t}){const r=e,{Close:n}=LH,{ns:i,zIndex:a}=tJ("message"),{currentZIndex:o,nextZIndex:u}=a,c=Ur(),l=Ur(!1),s=Ur(0);let f;const p=yt(()=>r.type?r.type==="error"?"danger":r.type:"info"),m=yt(()=>{const E=r.type;return{[i.bm("icon",E)]:E&&Lg[E]}}),d=yt(()=>r.icon||Lg[r.type]||""),h=yt(()=>gJ(r.id)),w=yt(()=>vJ(r.id,r.offset)+h.value),v=yt(()=>s.value+w.value),x=yt(()=>({top:`${w.value}px`,zIndex:o.value}));function g(){r.duration!==0&&({stop:f}=WU(()=>{y()},r.duration))}function b(){f==null||f()}function y(){l.value=!1}function N({code:E}){E===VH.esc&&y()}return Zu(()=>{g(),u(),l.value=!0}),da(()=>r.repeatNum,()=>{b(),g()}),QU(document,"keydown",N),t$(c,()=>{s.value=c.value.getBoundingClientRect().height}),t({visible:l,bottom:v,close:y}),(E,A)=>(Wt(),xi(nc,{name:et(i).b("fade"),onBeforeLeave:E.onClose,onAfterLeave:D=>E.$emit("destroy"),persisted:""},{default:oo(()=>[yx(sn("div",{id:E.id,ref_key:"messageRef",ref:c,class:Rr([et(i).b(),{[et(i).m(E.type)]:E.type},et(i).is("center",E.center),et(i).is("closable",E.showClose),et(i).is("plain",E.plain),E.customClass]),style:zo(et(x)),role:"alert",onMouseenter:b,onMouseleave:g},[E.repeatNum>1?(Wt(),xi(et(pJ),{key:0,value:E.repeatNum,type:et(p),class:Rr(et(i).e("badge"))},null,8,["value","type","class"])):bs("v-if",!0),et(d)?(Wt(),xi(et(Hg),{key:1,class:Rr([et(i).e("icon"),et(m)])},{default:oo(()=>[(Wt(),xi(sV(et(d))))]),_:1},8,["class"])):bs("v-if",!0),kf(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(Wt(),Fn(mr,{key:1},[bs(" Caution here, message could've been compromised, never use user's input as message "),sn("p",{class:Rr(et(i).e("content")),innerHTML:E.message},null,10,["innerHTML"])],2112)):(Wt(),Fn("p",{key:0,class:Rr(et(i).e("content"))},Nf(E.message),3))]),E.showClose?(Wt(),xi(et(Hg),{key:2,class:Rr(et(i).e("closeBtn")),onClick:PU(y,["stop"])},{default:oo(()=>[$t(et(n))]),_:1},8,["class","onClick"])):bs("v-if",!0)],46,["id"]),[[Pf,l.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var xJ=Wf(bJ,[["__file","message.vue"]]);let wJ=1;const Dw=e=>{const t=!e||xt(e)||ti(e)||Be(e)?{message:e}:e,r={...Kt,...t};if(!r.appendTo)r.appendTo=document.body;else if(xt(r.appendTo)){let n=document.querySelector(r.appendTo);MH(n)||(oc("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body),r.appendTo=n}return r},NJ=e=>{const t=jr.indexOf(e);if(t===-1)return;jr.splice(t,1);const{handler:r}=e;r.close()},DJ=({appendTo:e,...t},r)=>{const n=`message_${wJ++}`,i=t.onClose,a=document.createElement("div"),o={...t,id:n,onClose:()=>{i==null||i(),NJ(l)},onDestroy:()=>{Cg(null,a)}},u=$t(xJ,o,Be(o.message)||ti(o.message)?{default:Be(o.message)?o.message:()=>o.message}:null);u.appContext=r||Aa._context,Cg(u,a),e.appendChild(a.firstElementChild);const c=u.component,l={id:n,vnode:u,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:u.component.props};return l},Aa=(e={},t)=>{if(!Ua)return{close:()=>{}};if(No($g.max)&&jr.length>=$g.max)return{close:()=>{}};const r=Dw(e);if(r.grouping&&jr.length){const i=jr.find(({vnode:a})=>{var o;return((o=a.props)==null?void 0:o.message)===r.message});if(i)return i.props.repeatNum+=1,i.props.type=r.type,i.handler}const n=DJ(r,t);return jr.push(n),n.handler};Nw.forEach(e=>{Aa[e]=(t={},r)=>{const n=Dw(t);return Aa({...n,type:e},r)}});function EJ(e){for(const t of jr)(!e||e===t.props.type)&&t.handler.close()}Aa.closeAll=EJ;Aa._context=null;const Ic=PH(Aa,"$message"),xs=(e,t)=>{let r=ab(ir(t[0]));for(let n=1;n<t.length;n++){let i=Number(t[n]);i.toString()==="NaN"&&(i=0),r=r[e](ir(i))}return parseFloat(r.done())},Jg=e=>e==null||e==="",AJ={round:(e,t=2)=>Jg(e)?"-":tn(Number(e),t),add:function(...e){return xs("add",e)},subtract:function(...e){return xs("subtract",e)},multiply:function(...e){return xs("multiply",e)},divide:function(...e){return xs("divide",e)},formatValue:(e,t=2)=>{if(Jg(e))return"-";const r=Number(e);return r>=1e8||r<=-1e8?`${tn(r/1e8,t)}亿`:r>=1e4||r<=-1e4?`${tn(r/1e4,t)}万`:tn(r,t)}},SJ={timeout:12e3,handleReq:null,handleRes:null,handleError:null};let Rc=!0;const Gg=e=>e.VITE_BASE_URL2?(Rc=!Rc,Rc?e.VITE_BASE_URL:e.VITE_BASE_URL2):e.VITE_BASE_URL,CJ=(e,t)=>{const{timeout:r,handleReq:n,handleRes:i,handleError:a}=Object.assign(SJ,t),o=Ft.create({responseType:"json",timeout:r});return o.interceptors.request.use(u=>(n instanceof Function&&n(u),u)),o.interceptors.response.use(u=>{const{data:c,config:l,status:s}=u;return l.responseType==="blob"||c.code===0?Promise.resolve(c):c.code===1?(Ic.warning(c.msg),Promise.resolve(c)):i instanceof Function&&i(u)?Promise.resolve(c):(Ic.error(c.msg),Promise.reject(new Error(`接口异常-${c.msg} status: ${s}
|
|
108
108
|
接口: ${l.url}
|
|
109
109
|
入参: ${JSON.stringify(l.method==="post"?l.data:l.params)}
|
|
110
|
-
返参: ${JSON.stringify(c)}`)))},u=>{const{response:c={},config:l={}}=u;a instanceof Function&&a(u);let s=u.message;return s==="Network Error"?s="服务器网络故障":s.includes("timeout")?s="服务器接口超时":s.includes("Request failed with status code")&&(s="服务器接口"+s.substr(s.length-3)+"异常"),
|
|
110
|
+
返参: ${JSON.stringify(c)}`)))},u=>{const{response:c={},config:l={}}=u;a instanceof Function&&a(u);let s=u.message;return s==="Network Error"?s="服务器网络故障":s.includes("timeout")?s="服务器接口超时":s.includes("Request failed with status code")&&(s="服务器接口"+s.substr(s.length-3)+"异常"),Ic.error(s),Promise.reject(new Error(`服务器异常-${u.message} status: ${c==null?void 0:c.status}
|
|
111
111
|
接口: ${l.url}
|
|
112
|
-
入参: ${JSON.stringify(l.method==="post"?l.data:l.params)}`))}),{get:(u,c={},l={})=>o({method:"GET",url:`${
|
|
112
|
+
入参: ${JSON.stringify(l.method==="post"?l.data:l.params)}`))}),{get:(u,c={},l={})=>o({method:"GET",url:`${Gg(e)}${u.startsWith("/middleLayer/")?"":"/middleLayer/get"}${u}`,params:c,...l}),post:(u,c={},l={})=>o({method:"POST",url:`${Gg(e)}${u.startsWith("/middleLayer/")?"":"/middleLayer/post"}${u}`,data:c,...l})}},MJ=Object.freeze(Object.defineProperty({__proto__:null,initRequest:CJ},Symbol.toStringTag,{value:"Module"}));var _J=Object.defineProperty,FJ=(e,t,r)=>t in e?_J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ra=(e,t,r)=>FJ(e,typeof t!="symbol"?t+"":t,r);class Ew{constructor(t,r={}){ra(this,"dom"),ra(this,"resizeRo"),ra(this,"callback"),ra(this,"visibilitychangeFn"),ra(this,"timer"),ra(this,"config",{debounce:50}),this.dom=t,this.config={...this.config,...r}}listen(t){this.callback=t;let r=!0;this.resizeRo=new ResizeObserver(()=>{if(r){r=!1;return}clearTimeout(this.timer),this.timer=setTimeout(()=>{this.callback&&this.callback(),clearTimeout(this.timer)},this.config.debounce)}),this.resizeRo.observe(this.dom),this.visibilitychangeFn=()=>{(document.visibilityState==="visible"||!document.hidden)&&this.callback&&this.callback()},document.addEventListener("visibilitychange",this.visibilitychangeFn)}dispose(){var t;(t=this.resizeRo)==null||t.disconnect(),document.removeEventListener("visibilitychange",this.visibilitychangeFn)}}const TJ=e=>new Ew(e),OJ=Object.freeze(Object.defineProperty({__proto__:null,ResizeListener:Ew,addResizeListener:TJ},Symbol.toStringTag,{value:"Module"}));let Qf=`${new Date().getTime()}-${Math.floor(Math.random()*1e9)}`,BJ="",Zf="",ws="",na=null,Kg=null;const eo={},vi={},Wg={},Oi=e=>{try{const t=Sl("token");if(!t)return;const r=JSON.stringify({commonKey:Qf,token:t,systemName:Zf,uniqueKey:`${new Date().getTime()}-${Math.floor(Math.random()*1e9)}`,...e}),n=new Blob([r],{type:"application/json"});navigator.sendBeacon(`${BJ}/invest/sys/behavior/save`,n)}catch{}},kJ=(e,t="")=>{if(!e){console.info("系统埋点发送异常-请传入系统名称");return}t=t;try{na&&(window.removeEventListener("beforeunload",na),na(),na=null),Zf=e,ws=`${new Date().getTime()}-${Math.floor(Math.random()*1e9)}`,Oi({status:0,uniqueKey:ws}),Kg=setInterval(()=>{Oi({status:1,uniqueKey:ws})},60*1e3),na=function(){clearInterval(Kg),Oi({status:1,uniqueKey:ws})},window.addEventListener("beforeunload",na)}catch{}},IJ=(e,t,r="")=>{Zf=e,Qf=t,r=r},RJ=()=>Qf,qJ=(e,t="in")=>{if(!e){console.info("页面埋点发送异常-请传入页面名称");return}try{t==="in"?(eo[e]=`${new Date().getTime()}-${Math.floor(Math.random()*1e9)}`,Oi({pageName:e,uniqueKey:eo[e],status:0}),Wg[e]=setInterval(()=>{Oi({pageName:e,uniqueKey:eo[e],status:1})},60*1e3),window.removeEventListener("beforeunload",vi[e]),vi[e]=function(){Oi({pageName:e,uniqueKey:eo[e],status:1}),clearInterval(Wg[e])},window.addEventListener("beforeunload",vi[e])):vi[e]&&(window.removeEventListener("beforeunload",vi[e]),vi[e](),vi[e]=null,eo[e]=null)}catch{}},zJ=(e,t,r="")=>{if(!e||!t){console.info("操作埋点发送异常-请传入页面名称和操作名称");return}try{Oi({pageName:e,functionName:t,otherParam:r,status:0})}catch{}},jJ=Object.freeze(Object.defineProperty({__proto__:null,actionStat:zJ,getStatKey:RJ,initSystemStat:IJ,pageStat:qJ,systemStat:kJ},Symbol.toStringTag,{value:"Module"})),LJ=e=>{e?Qg("token",e):console.error("token不能为空")},PJ=e=>{e?Qg("userData",e):console.error("用户数据不能为空")},Aw=()=>Sl("token"),Sw=e=>{const t=Sl("userData");return e?t==null?void 0:t[e]:t},VJ=()=>!!Aw(),UJ=()=>{const e=Sw();return(e==null?void 0:e.username)==="admin"},Cw=(e="")=>location.href=`${location.origin}/login/index.html?url=${encodeURIComponent(e||location.href)}`,$J=(e=!0,t)=>{if(Yf("token"),Yf("userData"),e){Cw();return}t&&(location.href=t)},HJ=Object.freeze(Object.defineProperty({__proto__:null,getToken:Aw,getUserData:Sw,isAdmin:UJ,isLogin:VJ,login:Cw,loginout:$J,setToken:LJ,setUserData:PJ},Symbol.toStringTag,{value:"Module"})),JJ=AJ,{initRequest:GJ}=MJ,{addResizeListener:KJ}=OJ,{systemStat:nG,pageStat:iG,actionStat:WJ,initSystemStat:aG,getStatKey:oG}=jJ,{setToken:sG,setUserData:QJ,getToken:ZJ,getUserData:XJ,isLogin:YJ,isAdmin:uG,login:eG,loginout:tG}=HJ,rG=(e,t=500,r=!1)=>{let n=null;return function(...i){if(clearTimeout(n),r){const a=!n;n=setTimeout(()=>{n=null},t),a&&e.apply(this,i)}else n=setTimeout(()=>{e.apply(this,i)},t)}};exports.$=WJ;exports.A=eG;exports.D=KJ;exports.G=rG;exports.K=tG;exports.R=QJ;exports.U=ZJ;exports.V=XJ;exports.v=YJ;exports.x=JJ;exports.y=GJ;
|