@byteluck-fe/model-driven-engine 2.23.1-beta.2-zt → 2.23.1-beta.3-zt
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
|
|
3
|
-
* @Date: 2022-04-15 14:06:03
|
|
4
|
-
* @LastEditors: SuperLuckyqi
|
|
5
|
-
* @LastEditTime: 2024-11-08 11:17:53
|
|
6
|
-
* @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
|
|
1
|
+
/*
|
|
2
|
+
* @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
|
|
3
|
+
* @Date: 2022-04-15 14:06:03
|
|
4
|
+
* @LastEditors: SuperLuckyqi
|
|
5
|
+
* @LastEditTime: 2024-11-08 11:17:53
|
|
6
|
+
* @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
|
|
7
7
|
*/ function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -61,7 +61,8 @@ export var StylePlugin = /*#__PURE__*/ function() {
|
|
|
61
61
|
dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
|
|
62
62
|
var cssStyleText;
|
|
63
63
|
if (this.isPc) {
|
|
64
|
-
cssStyleText =
|
|
64
|
+
cssStyleText = compiledStyle;
|
|
65
|
+
// `.render-engine-${engine.id} ${compiledStyle} `
|
|
65
66
|
} else {
|
|
66
67
|
cssStyleText = compiledStyle;
|
|
67
68
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -19,4 +19,4 @@ Example:
|
|
|
19
19
|
*
|
|
20
20
|
* Copyright (c) 2023, Robert Eisele (robert@raw.org)
|
|
21
21
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
22
|
-
**/(function(e,t){(function(n){var r=2e3,u={s:1,n:0,d:1};function i(h,g){if(isNaN(h=parseInt(h,10)))throw m();return h*g}function o(h,g){if(g===0)throw v();var E=Object.create(p.prototype);E.s=h<0?-1:1,h=h<0?-h:h;var C=d(h,g);return E.n=h/C,E.d=g/C,E}function a(h){for(var g={},E=h,C=2,B=4;B<=E;){for(;E%C===0;)E/=C,g[C]=(g[C]||0)+1;B+=1+2*C++}return E!==h?E>1&&(g[E]=(g[E]||0)+1):g[h]=(g[h]||0)+1,g}var s=function(h,g){var E=0,C=1,B=1,M=0,$=0,L=0,W=1,z=1,x=0,R=1,K=1,Z=1,ee=1e7,V;if(h!=null)if(g!==void 0){if(E=h,C=g,B=E*C,E%1!==0||C%1!==0)throw F()}else switch(typeof h){case"object":{if("d"in h&&"n"in h)E=h.n,C=h.d,"s"in h&&(E*=h.s);else if(0 in h)E=h[0],1 in h&&(C=h[1]);else throw m();B=E*C;break}case"number":{if(h<0&&(B=h,h=-h),h%1===0)E=h;else if(h>0){for(h>=1&&(z=Math.pow(10,Math.floor(1+Math.log(h)/Math.LN10)),h/=z);R<=ee&&Z<=ee;)if(V=(x+K)/(R+Z),h===V){R+Z<=ee?(E=x+K,C=R+Z):Z>R?(E=K,C=Z):(E=x,C=R);break}else h>V?(x+=K,R+=Z):(K+=x,Z+=R),R>ee?(E=K,C=Z):(E=x,C=R);E*=z}else(isNaN(h)||isNaN(g))&&(C=E=NaN);break}case"string":{if(R=h.match(/\d+|./g),R===null)throw m();if(R[x]==="-"?(B=-1,x++):R[x]==="+"&&x++,R.length===x+1?$=i(R[x++],B):R[x+1]==="."||R[x]==="."?(R[x]!=="."&&(M=i(R[x++],B)),x++,(x+1===R.length||R[x+1]==="("&&R[x+3]===")"||R[x+1]==="'"&&R[x+3]==="'")&&($=i(R[x],B),W=Math.pow(10,R[x].length),x++),(R[x]==="("&&R[x+2]===")"||R[x]==="'"&&R[x+2]==="'")&&(L=i(R[x+1],B),z=Math.pow(10,R[x+1].length)-1,x+=3)):R[x+1]==="/"||R[x+1]===":"?($=i(R[x],B),W=i(R[x+2],1),x+=3):R[x+3]==="/"&&R[x+1]===" "&&(M=i(R[x],B),$=i(R[x+2],B),W=i(R[x+4],1),x+=5),R.length<=x){C=W*z,B=E=L+C*M+z*$;break}}default:throw m()}if(C===0)throw v();u.s=B<0?-1:1,u.n=Math.abs(E),u.d=Math.abs(C)};function c(h,g,E){for(var C=1;g>0;h=h*h%E,g>>=1)g&1&&(C=C*h%E);return C}function l(h,g){for(;g%2===0;g/=2);for(;g%5===0;g/=5);if(g===1)return 0;for(var E=10%g,C=1;E!==1;C++)if(E=E*10%g,C>r)return 0;return C}function f(h,g,E){for(var C=1,B=c(10,E,g),M=0;M<300;M++){if(C===B)return M;C=C*10%g,B=B*10%g}return 0}function d(h,g){if(!h)return g;if(!g)return h;for(;;){if(h%=g,!h)return g;if(g%=h,!g)return h}}function p(h,g){if(s(h,g),this instanceof p)h=d(u.d,u.n),this.s=u.s,this.n=u.n/h,this.d=u.d/h;else return o(u.s*u.n,u.d)}var v=function(){return new Error("Division by Zero")},m=function(){return new Error("Invalid argument")},F=function(){return new Error("Parameters must be integer")};p.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(h,g){return s(h,g),o(this.s*this.n*u.d+u.s*this.d*u.n,this.d*u.d)},sub:function(h,g){return s(h,g),o(this.s*this.n*u.d-u.s*this.d*u.n,this.d*u.d)},mul:function(h,g){return s(h,g),o(this.s*u.s*this.n*u.n,this.d*u.d)},div:function(h,g){return s(h,g),o(this.s*u.s*this.n*u.d,this.d*u.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(h,g){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(h===void 0)return o(this.s*this.n%this.d,1);if(s(h,g),u.n===0&&this.d===0)throw v();return o(this.s*(u.d*this.n)%(u.n*this.d),u.d*this.d)},gcd:function(h,g){return s(h,g),o(d(u.n,this.n)*d(u.d,this.d),u.d*this.d)},lcm:function(h,g){return s(h,g),u.n===0&&this.n===0?o(0,1):o(u.n*this.n,d(u.n,this.n)*d(u.d,this.d))},ceil:function(h){return h=Math.pow(10,h||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):o(Math.ceil(h*this.s*this.n/this.d),h)},floor:function(h){return h=Math.pow(10,h||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):o(Math.floor(h*this.s*this.n/this.d),h)},round:function(h){return h=Math.pow(10,h||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):o(Math.round(h*this.s*this.n/this.d),h)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(h,g){if(s(h,g),u.d===1)return u.s<0?o(Math.pow(this.s*this.d,u.n),Math.pow(this.n,u.n)):o(Math.pow(this.s*this.n,u.n),Math.pow(this.d,u.n));if(this.s<0)return null;var E=a(this.n),C=a(this.d),B=1,M=1;for(var $ in E)if($!=="1"){if($==="0"){B=0;break}if(E[$]*=u.n,E[$]%u.d===0)E[$]/=u.d;else return null;B*=Math.pow($,E[$])}for(var $ in C)if($!=="1"){if(C[$]*=u.n,C[$]%u.d===0)C[$]/=u.d;else return null;M*=Math.pow($,C[$])}return u.s<0?o(M,B):o(B,M)},equals:function(h,g){return s(h,g),this.s*this.n*u.d===u.s*u.n*this.d},compare:function(h,g){s(h,g);var E=this.s*this.n*u.d-u.s*u.n*this.d;return(0<E)-(E<0)},simplify:function(h){if(isNaN(this.n)||isNaN(this.d))return this;h=h||.001;for(var g=this.abs(),E=g.toContinued(),C=1;C<E.length;C++){for(var B=o(E[C-1],1),M=C-2;M>=0;M--)B=B.inverse().add(E[M]);if(Math.abs(B.sub(g).valueOf())<h)return B.mul(this.s)}return this},divisible:function(h,g){return s(h,g),!(!(u.n*this.d)||this.n*u.d%(u.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(h){var g,E="",C=this.n,B=this.d;return this.s<0&&(E+="-"),B===1?E+=C:(h&&(g=Math.floor(C/B))>0&&(E+=g,E+=" ",C%=B),E+=C,E+="/",E+=B),E},toLatex:function(h){var g,E="",C=this.n,B=this.d;return this.s<0&&(E+="-"),B===1?E+=C:(h&&(g=Math.floor(C/B))>0&&(E+=g,C%=B),E+="\\frac{",E+=C,E+="}{",E+=B,E+="}"),E},toContinued:function(){var h,g=this.n,E=this.d,C=[];if(isNaN(g)||isNaN(E))return C;do C.push(Math.floor(g/E)),h=g%E,g=E,E=h;while(g!==1);return C},toString:function(h){var g=this.n,E=this.d;if(isNaN(g)||isNaN(E))return"NaN";h=h||15;var C=l(g,E),B=f(g,E,C),M=this.s<0?"-":"";if(M+=g/E|0,g%=E,g*=10,g&&(M+="."),C){for(var $=B;$--;)M+=g/E|0,g%=E,g*=10;M+="(";for(var $=C;$--;)M+=g/E|0,g%=E,g*=10;M+=")"}else for(var $=h;g&&$--;)M+=g/E|0,g%=E,g*=10;return M}},Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,e.exports=p})()})(vo);var Ye=fD(vo.exports),N3="Fraction",$3=[],I3=Be(N3,$3,()=>(Object.defineProperty(Ye,"name",{value:"Fraction"}),Ye.prototype.constructor=Ye,Ye.prototype.type="Fraction",Ye.prototype.isFraction=!0,Ye.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ye.fromJSON=function(e){return new Ye(e)},Ye),{isClass:!0}),O3="Matrix",x3=[],T3=Be(O3,x3,()=>{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,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){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,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){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,n){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 P3(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var R3="DenseMatrix",L3=["Matrix"],k3=Be(R3,L3,e=>{var{Matrix:t}=e;function n(l,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Cn(f))throw new Error("Invalid datatype: "+f);if(wt(l))l.type==="DenseMatrix"?(this._data=Dt(l._data),this._size=Dt(l._size),this._datatype=f||l._datatype):(this._data=l.toArray(),this._size=l.size(),this._datatype=f||l._datatype);else if(l&&$e(l.data)&&$e(l.size))this._data=l.data,this._size=l.size,Vi(this._data,this._size),this._datatype=f||l.datatype;else if($e(l))this._data=c(l),this._size=gt(this._data),Vi(this._data,this._size),this._datatype=f;else{if(l)throw new TypeError("Unsupported type of data ("+qr(l)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new t,n.prototype.createDenseMatrix=function(l,f){return new n(l,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Wr(this._data,qr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(l,f){return new n(l,f)},n.prototype.subset=function(l,f,d){switch(arguments.length){case 1:return r(this,l);case 2:case 3:return i(this,l,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(l){if(!$e(l))throw new TypeError("Array expected");if(l.length!==this._size.length)throw new de(l.length,this._size.length);for(var f=0;f<l.length;f++)Oe(l[f],this._size[f]);for(var d=this._data,p=0,v=l.length;p<v;p++){var m=l[p];Oe(m,d.length),d=d[m]}return d},n.prototype.set=function(l,f,d){if(!$e(l))throw new TypeError("Array expected");if(l.length<this._size.length)throw new de(l.length,this._size.length,"<");var p,v,m,F=l.map(function(g){return g+1});s(this,F,d);var h=this._data;for(p=0,v=l.length-1;p<v;p++)m=l[p],Oe(m,h.length),h=h[m];return m=l[l.length-1],Oe(m,h.length),h[m]=f,this};function r(l,f){if(!Ni(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return l.get(f.min());var p=f.size();if(p.length!==l._size.length)throw new de(p.length,l._size.length);for(var v=f.min(),m=f.max(),F=0,h=l._size.length;F<h;F++)Oe(v[F],l._size[F]),Oe(m[F],l._size[F]);return new n(u(l._data,f,p.length,0),l._datatype)}function u(l,f,d,p){var v=p===d-1,m=f.dimension(p);return v?m.map(function(F){return Oe(F,l.length),l[F]}).valueOf():m.map(function(F){Oe(F,l.length);var h=l[F];return u(h,f,d,p+1)}).valueOf()}function i(l,f,d,p){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var v=f.size(),m=f.isScalar(),F;if(wt(d)?(F=d.size(),d=d.valueOf()):F=gt(d),m){if(F.length!==0)throw new TypeError("Scalar expected");l.set(f.min(),d,p)}else{if(!Jt(F,v))try{F.length===0?d=Ki([d],v):d=Ki(d,v),F=gt(d)}catch(M){}if(v.length<l._size.length)throw new de(v.length,l._size.length,"<");if(F.length<v.length){for(var h=0,g=0;v[h]===1&&F[h]===1;)h++;for(;v[h]===1;)g++,h++;d=cm(d,v.length,g,F)}if(!Jt(v,F))throw new de(v,F,">");var E=f.max().map(function(M){return M+1});s(l,E,p);var C=v.length,B=0;o(l._data,f,d,C,B)}return l}function o(l,f,d,p,v){var m=v===p-1,F=f.dimension(v);m?F.forEach(function(h,g){Oe(h),l[h]=d[g[0]]}):F.forEach(function(h,g){Oe(h),o(l[h],f,d[g[0]],p,v+1)})}n.prototype.resize=function(l,f,d){if(!jr(l))throw new TypeError("Array or Matrix expected");var p=l.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),v=d?this.clone():this;return a(v,p,f)};function a(l,f,d){if(f.length===0){for(var p=l._data;$e(p);)p=p[0];return p}return l._size=f.slice(0),l._data=Hi(l._data,l._size,d),l}n.prototype.reshape=function(l,f){var d=f?this.clone():this;d._data=zi(d._data,l);var p=d._size.reduce((v,m)=>v*m);return d._size=Wi(l,p),d};function s(l,f,d){for(var p=l._size.slice(0),v=!1;p.length<f.length;)p.push(0),v=!0;for(var m=0,F=f.length;m<F;m++)f[m]>p[m]&&(p[m]=f[m],v=!0);v&&a(l,p,d)}n.prototype.clone=function(){var l=new n({data:Dt(this._data),size:Dt(this._size),datatype:this._datatype});return l},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(l){var f=this,d=P3(l),p=function F(h,g){return $e(h)?h.map(function(E,C){return F(E,g.concat(C))}):d===1?l(h):d===2?l(h,g):l(h,g,f)},v=p(this._data,[]),m=this._datatype!==void 0?Wr(v,qr):void 0;return new n(v,m)},n.prototype.forEach=function(l){var f=this,d=function p(v,m){$e(v)?v.forEach(function(F,h){p(F,m.concat(h))}):l(v,m,f)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var l=function*f(d,p){if($e(d))for(var v=0;v<d.length;v++)yield*f(d[v],p.concat(v));else yield{value:d,index:p}};yield*l(this._data,[])},n.prototype.rows=function(){var l=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var p of d)l.push(new n([p],this._datatype));return l},n.prototype.columns=function(){var l=this,f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var p=this._data,v=function(h){var g=p.map(E=>[E[h]]);f.push(new n(g,l._datatype))},m=0;m<d[1];m++)v(m);return f},n.prototype.toArray=function(){return Dt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(l){return vt(this._data,l)},n.prototype.toString=function(){return vt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(l){if(l){if(Ke(l)&&(l=l.toNumber()),!ge(l)||!qe(l))throw new TypeError("The parameter k must be an integer number")}else l=0;for(var f=l>0?l:0,d=l<0?-l:0,p=this._size[0],v=this._size[1],m=Math.min(p-d,v-f),F=[],h=0;h<m;h++)F[h]=this._data[h+d][h+f];return new n({data:F,size:[m],datatype:this._datatype})},n.diagonal=function(l,f,d,p){if(!$e(l))throw new TypeError("Array expected, size parameter");if(l.length!==2)throw new Error("Only two dimensions matrix are supported");if(l=l.map(function($){if(Ke($)&&($=$.toNumber()),!ge($)||!qe($)||$<1)throw new Error("Size values must be positive integers");return $}),d){if(Ke(d)&&(d=d.toNumber()),!ge(d)||!qe(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var v=d>0?d:0,m=d<0?-d:0,F=l[0],h=l[1],g=Math.min(F-m,h-v),E;if($e(f)){if(f.length!==g)throw new Error("Invalid value array length");E=function(L){return f[L]}}else if(wt(f)){var C=f.size();if(C.length!==1||C[0]!==g)throw new Error("Invalid matrix length");E=function(L){return f.get([L])}}else E=function(){return f};p||(p=Ke(E(0))?E(0).mul(0):0);var B=[];if(l.length>0){B=Hi(B,l,p);for(var M=0;M<g;M++)B[M+m][M+v]=E(M)}return new n({data:B,size:[F,h]})},n.fromJSON=function(l){return new n(l)},n.prototype.swapRows=function(l,f){if(!ge(l)||!qe(l)||!ge(f)||!qe(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 Oe(l,this._size[0]),Oe(f,this._size[0]),n._swapRows(l,f,this._data),this},n._swapRows=function(l,f,d){var p=d[l];d[l]=d[f],d[f]=p};function c(l){return wt(l)?c(l.valueOf()):$e(l)?l.map(c):l}return n},{isClass:!0}),go="equalScalar";Be(go,["typed","config"],e=>{var{typed:t,config:n}=e;return t(go,{"number, number":function(u,i){return nm(u,i,n.epsilon)}})});function Kt(e,t,n,r){if(!(this instanceof Kt))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(r!=null?"-"+r:"")+" expected)",this.stack=new Error().stack}Kt.prototype=new Error,Kt.prototype.constructor=Error,Kt.prototype.name="ArgumentsError",Kt.prototype.isArgumentsError=!0;var mo="format",j3=["typed"],q3=Be(mo,j3,e=>{var{typed:t}=e;return t(mo,{any:vt,"any, Object | function | number":vt})}),yo="bin",U3=["typed","format"];Be(yo,U3,e=>{var{typed:t,format:n}=e;return t(yo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var Eo="oct",V3=["typed","format"];Be(Eo,V3,e=>{var{typed:t,format:n}=e;return t(Eo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var Co="hex",H3=["typed","format"];Be(Co,H3,e=>{var{typed:t,format:n}=e;return t(Co,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Fo="equal";Be(Fo,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Fo,{"any, any":function(u,i){return u===null?i===null:i===null?u===null:u===void 0?i===void 0:i===void 0?u===void 0:n(u,i)}})});var Ao="unequal";Be(Ao,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Ao,{"any, any":function(u,i){return u===null?i!==null:i===null?u!==null:u===void 0?i!==void 0:i===void 0?u!==void 0:!n(u,i)}})});var Bo={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this,l=a();c.next=function(){var f=2091639*c.s0+c.c*23283064365386963e-26;return c.s0=c.s1,c.s1=c.s2,c.s2=f-(c.c=f|0)},c.c=1,c.s0=l(" "),c.s1=l(" "),c.s2=l(" "),c.s0-=l(s),c.s0<0&&(c.s0+=1),c.s1-=l(s),c.s1<0&&(c.s1+=1),c.s2-=l(s),c.s2<0&&(c.s2+=1),l=null}function i(s,c){return c.c=s.c,c.s0=s.s0,c.s1=s.s1,c.s2=s.s2,c}function o(s,c){var l=new u(s),f=c&&c.state,d=l.next;return d.int32=function(){return l.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,f&&(typeof f=="object"&&i(f,l),d.state=function(){return i(l,{})}),d}function a(){var s=4022871197,c=function(l){l=String(l);for(var f=0;f<l.length;f++){s+=l.charCodeAt(f);var d=.02519603282416938*s;s=d>>>0,d-=s,d*=s,s=d>>>0,d-=s,s+=d*4294967296}return(s>>>0)*23283064365386963e-26};return c}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(et,e,!1)})(Bo);var wo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.x=0,s.y=0,s.z=0,s.w=0,s.next=function(){var f=s.x^s.x<<11;return s.x=s.y,s.y=s.z,s.z=s.w,s.w^=s.w>>>19^f^f>>>8},a===(a|0)?s.x=a:c+=a;for(var l=0;l<c.length+64;l++)s.x^=c.charCodeAt(l)|0,s.next()}function i(a,s){return s.x=a.x,s.y=a.y,s.z=a.z,s.w=a.w,s}function o(a,s){var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(typeof l=="object"&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(et,e,!1)})(wo);var bo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.next=function(){var f=s.x^s.x>>>2;return s.x=s.y,s.y=s.z,s.z=s.w,s.w=s.v,(s.d=s.d+362437|0)+(s.v=s.v^s.v<<4^(f^f<<1))|0},s.x=0,s.y=0,s.z=0,s.w=0,s.v=0,a===(a|0)?s.x=a:c+=a;for(var l=0;l<c.length+64;l++)s.x^=c.charCodeAt(l)|0,l==c.length&&(s.d=s.x<<10^s.x>>>4),s.next()}function i(a,s){return s.x=a.x,s.y=a.y,s.z=a.z,s.w=a.w,s.v=a.v,s.d=a.d,s}function o(a,s){var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(typeof l=="object"&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(et,e,!1)})(bo);var _o={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this;s.next=function(){var l=s.x,f=s.i,d,p;return d=l[f],d^=d>>>7,p=d^d<<24,d=l[f+1&7],p^=d^d>>>10,d=l[f+3&7],p^=d^d>>>3,d=l[f+4&7],p^=d^d<<7,d=l[f+7&7],d=d^d<<13,p^=d^d<<9,l[f]=p,s.i=f+1&7,p};function c(l,f){var d,p=[];if(f===(f|0))p[0]=f;else for(f=""+f,d=0;d<f.length;++d)p[d&7]=p[d&7]<<15^f.charCodeAt(d)+p[d+1&7]<<13;for(;p.length<8;)p.push(0);for(d=0;d<8&&p[d]===0;++d);for(d==8?p[7]=-1:p[d],l.x=p,l.i=0,d=256;d>0;--d)l.next()}c(s,a)}function i(a,s){return s.x=a.x.slice(),s.i=a.i,s}function o(a,s){a==null&&(a=+new Date);var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(l.x&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(et,e,!1)})(_o);var So={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this;s.next=function(){var l=s.w,f=s.X,d=s.i,p,v;return s.w=l=l+1640531527|0,v=f[d+34&127],p=f[d=d+1&127],v^=v<<13,p^=p<<17,v^=v>>>15,p^=p>>>12,v=f[d]=v^p,s.i=d,v+(l^l>>>16)|0};function c(l,f){var d,p,v,m,F,h=[],g=128;for(f===(f|0)?(p=f,f=null):(f=f+"\0",p=0,g=Math.max(g,f.length)),v=0,m=-32;m<g;++m)f&&(p^=f.charCodeAt((m+32)%f.length)),m===0&&(F=p),p^=p<<10,p^=p>>>15,p^=p<<4,p^=p>>>13,m>=0&&(F=F+1640531527|0,d=h[m&127]^=p+F,v=d==0?v+1:0);for(v>=128&&(h[(f&&f.length||0)&127]=-1),v=127,m=4*128;m>0;--m)p=h[v+34&127],d=h[v=v+1&127],p^=p<<13,d^=d<<17,p^=p>>>15,d^=d>>>12,h[v]=p^d;l.w=F,l.X=h,l.i=v}c(s,a)}function i(a,s){return s.i=a.i,s.w=a.w,s.X=a.X.slice(),s}function o(a,s){a==null&&(a=+new Date);var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(l.X&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(et,e,!1)})(So);var Mo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.next=function(){var f=s.b,d=s.c,p=s.d,v=s.a;return f=f<<25^f>>>7^d,d=d-p|0,p=p<<24^p>>>8^v,v=v-f|0,s.b=f=f<<20^f>>>12^d,s.c=d=d-p|0,s.d=p<<16^d>>>16^v,s.a=v-f|0},s.a=0,s.b=0,s.c=-1640531527,s.d=1367130551,a===Math.floor(a)?(s.a=a/4294967296|0,s.b=a|0):c+=a;for(var l=0;l<c.length+20;l++)s.b^=c.charCodeAt(l)|0,s.next()}function i(a,s){return s.a=a.a,s.b=a.b,s.c=a.c,s.d=a.d,s}function o(a,s){var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(typeof l=="object"&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(et,e,!1)})(Mo);var No={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,a="random",s=r.pow(u,i),c=r.pow(2,o),l=c*2,f=u-1,d;function p(C,B,M){var $=[];B=B==!0?{entropy:!0}:B||{};var L=h(F(B.entropy?[C,E(n)]:C==null?g():C,3),$),W=new v($),z=function(){for(var x=W.g(i),R=s,K=0;x<c;)x=(x+K)*u,R*=u,K=W.g(1);for(;x>=l;)x/=2,R/=2,K>>>=1;return(x+K)/R};return z.int32=function(){return W.g(4)|0},z.quick=function(){return W.g(4)/4294967296},z.double=z,h(E(W.S),n),(B.pass||M||function(x,R,K,Z){return Z&&(Z.S&&m(Z,W),x.state=function(){return m(W,{})}),K?(r[a]=x,R):x})(z,L,"global"in B?B.global:this==r,B.state)}function v(C){var B,M=C.length,$=this,L=0,W=$.i=$.j=0,z=$.S=[];for(M||(C=[M++]);L<u;)z[L]=L++;for(L=0;L<u;L++)z[L]=z[W=f&W+C[L%M]+(B=z[L])],z[W]=B;($.g=function(x){for(var R,K=0,Z=$.i,ee=$.j,V=$.S;x--;)R=V[Z=f&Z+1],K=K*u+V[f&(V[Z]=V[ee=f&ee+R])+(V[ee]=R)];return $.i=Z,$.j=ee,K})(u)}function m(C,B){return B.i=C.i,B.j=C.j,B.S=C.S.slice(),B}function F(C,B){var M=[],$=typeof C,L;if(B&&$=="object")for(L in C)try{M.push(F(C[L],B-1))}catch(W){}return M.length?M:$=="string"?C:C+"\0"}function h(C,B){for(var M=C+"",$,L=0;L<M.length;)B[f&L]=f&($^=B[f&L]*19)+M.charCodeAt(L++);return E(B)}function g(){try{var C;return d&&(C=d.randomBytes)?C=C(u):(C=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(C)),E(C)}catch($){var B=t.navigator,M=B&&B.plugins;return[+new Date,t,M,t.screen,E(n)]}}function E(C){return String.fromCharCode.apply(0,C)}if(h(r.random(),n),e.exports){e.exports=p;try{d=Ln.default}catch(C){}}else r["seed"+a]=p})(typeof self!="undefined"?self:et,[],Math)})(No);var z3=Bo.exports,W3=wo.exports,G3=bo.exports,Z3=_o.exports,J3=So.exports,X3=Mo.exports,Ot=No.exports;Ot.alea=z3,Ot.xor128=W3,Ot.xorwow=G3,Ot.xorshift7=Z3,Ot.xor4096=J3,Ot.tychei=X3,xn("fineStructure",.0072973525693),xn("weakMixingAngle",.2229),xn("efimovFactor",22.7),xn("sackurTetrode",-1.16487052358);function xn(e,t){var n=["config","BigNumber"];return Be(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var K3=B3({config:Ii}),Q3=M3({}),Y3=I3({}),ey=T3({}),ty=k3({Matrix:ey}),ny=_m({BigNumber:K3,Complex:Q3,DenseMatrix:ty,Fraction:Y3}),ry=q3({typed:ny});class uy{constructor(t){this.calcControls=[],this.dependenciesTriggerMap=new Map,this.hideNotRememberControlIds=[],this.dontHasPermissionControlIds=[],this.cacheComputedResult={},this.options=t,this.getDontHasPermissionControlIds(),this.getNeedHideRememberControlIds()}getNeedHideRememberControlIds(){var t;!((t=this.options)!=null&&t.displayBoList)||(this.hideNotRememberControlIds=this.options.displayBoList.reduce((n,r)=>(r.is_remember||n.push(...r.hide_controls),n),[]))}getDontHasPermissionControlIds(){var t;!((t=this.options)!=null&&t.behavior)||(this.dontHasPermissionControlIds=this.options.behavior.reduce((n,r)=>(r.ctrlBehavior===1&&n.push(r.ctrlId),n),[]))}controlNeedComputedValue(t){if(!t)return!1;const n=this.getControlIsHide(t);return!(this.dontHasPermissionControlIds.includes(t.id)&&n||this.hideNotRememberControlIds.includes(t.id)&&n)}getControlIsHide(t){return t.props.isHide?!0:t.parent===null||t.parent===void 0?!1:this.getControlIsHide(t.parent)}apply(t){this.engine=t,this.watchControlChange(),this.watchSubtableChange(),this.watchSchemaHideChange(),this.engine.on("engine-mounted",()=>{requestAnimationFrame(()=>{this.resetDependencies(),this.allCalcControlComputed()})})}resetDependencies(){this.calcControls=[],this.dependenciesTriggerMap.clear(),this.getAllCalcControl(),this.getCalcDependencies()}allCalcControlComputed(){this.calcControls.forEach(t=>{(t.props.dataBind.result.fieldCode===null||t.props.dataBind.result.fieldCode===void 0)&&this.computedCalcValue(t)})}getAllCalcControl(){this.calcControls=this.engine.runtime.flatInstances.filter(t=>t.type===oe.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===We.VariableInMainTable||r.type===We.VariableInCurrentSubTable||r.type===We.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===We.VariableInOtherSubTable&&r.subTableId&&this.setDependenciesTriggerMapItem(r.subTableId,t)})})}setDependenciesTriggerMapItem(t,n){this.dependenciesTriggerMap.has(t)||this.dependenciesTriggerMap.set(t,[]);const r=this.dependenciesTriggerMap.get(t);r.includes(n)||r.push(n)}getCalcControlsFromSubtableRows(t){return t.reduce((n,r)=>(r.children.forEach(u=>{const i=u.children[0];i&&this.engine.assertInstance(i,oe.CALC)&&n.push(i)}),n),[])}watchSchemaHideChange(){this.engine.on("schema-change",t=>{var n;t.props==="isHide"&&((n=this.dependenciesTriggerMap.get(t.instance.id))!=null?n:[]).forEach(u=>{this.computedCalcValue(u)})})}watchSubtableChange(){this.engine.on("list-change",t=>{var i,o,a;if(this.engine.isMounted===!1)return;this.resetDependencies();const n=(o=(i=t.options)==null?void 0:i.changed)!=null?o:[];this.getCalcControlsFromSubtableRows(n).forEach(s=>{this.computedCalcValue(s)}),((a=this.dependenciesTriggerMap.get(t.instance.id))!=null?a:[]).forEach(s=>{this.computedCalcValue(s)})})}watchControlChange(){this.engine.on("change",t=>{var u;if(this.engine.isMounted===!1)return;const{instance:n}=t;if(!this.dependenciesTriggerMap.has(n.id))return;const r=(u=this.dependenciesTriggerMap.get(n.id))!=null?u:[];t.rowIndex!==void 0&&t.rowIndex>-1?r.forEach(i=>{this.controlInSubtable(i)&&this.engine.getInstanceRowIndex(i)!==t.rowIndex||this.computedCalcValue(i)}):r.forEach(i=>{this.computedCalcValue(i)})})}controlInSubtable(t){var n;return((n=t.parent)==null?void 0:n.type)===oe.SUBTABLE_COLUMN}computedCalcValue(t){var s;const n=t.props.scriptEcho;if(!n||n.length===0)return;let r;this.controlInSubtable(t)&&(r=this.engine.getInstanceRowIndex(t));const u=n.reduce((c,l)=>{if(l.type===We.Operator||l.type===We.Number)return c+l.name;let f=0,d;switch(l.type){case We.VariableInMainTable:{const p=this.getNumberValue(this.engine.getState(l.id));d=this.engine.getInstance(l.id),f=Number(p);break}case We.VariableInCurrentSubTable:{d=this.engine.getInstance(l.id,r);const p=this.engine.getState(l.id,r),v=this.getNumberValue(p);f=Number(v);break}case We.VariableInOtherSubTable:{const p=this.engine.getState(l.id),v=Array.isArray(p)?p.map(F=>this.getNumberValue(F)):[],m=this.getAggregateTypeValue(v,l.aggregateType);d=this.engine.getInstance(l.subTableId),f=Number(m);break}}return!Number.isNaN(f)&&this.controlNeedComputedValue(d)?c+=`(${f})`:c+=0,c},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(ry(new Function(`return ${u}`)(),{precision:16})),this.cacheComputedResult[u]=i),this.controlInSubtable(t)&&r===void 0)return;const o=this.engine.getState(t.id,r),a=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));a!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:a,unit:(s=o==null?void 0:o.unit)!=null?s:""},r)}getNumberValue(t){if(typeof t=="object"&&t){if("result"in t)return t.result;if("amount"in t)return t.amount}return typeof t=="number"?t:0}getAggregateTypeValue(t,n){if(!n||!t||!t.length)return 0;switch(n){case en.MAX:return Math.max(...t);case en.MIN:return Math.min(...t);case en.SUM:return t.reduce((r,u)=>r+u);case en.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class iy{constructor(t,n=!0){this.config=t,this.isPc=n}apply(t){var o,a;this.engine=t;const n=(a=(o=this.config)==null?void 0:o.source)!=null?a:"";let r=document.createElement("style");r.className="edit-css-"+t.id;let u=document.querySelector("head");u==null||u.appendChild(r);let i;this.isPc?i=`.render-engine-${t.id} ${n} `:i=n,r.appendChild(document.createTextNode(i))}}G.CalcPlugin=uy,G.ControlsEventPlugin=m5,G.ES6ModulePlugin=D5,G.Engine=kr,G.LifecycleEventPlugin=g5,G.Plugin=p5,G.StylePlugin=iy,G.buildUUID=Wt,G.hasChildrenControl=gn,G.loopDataViewControl=pt,G.loopFormControl=ht,G.parseModule=wi,Object.defineProperty(G,"__esModule",{value:!0})});
|
|
22
|
+
**/(function(e,t){(function(n){var r=2e3,u={s:1,n:0,d:1};function i(h,g){if(isNaN(h=parseInt(h,10)))throw m();return h*g}function o(h,g){if(g===0)throw v();var E=Object.create(p.prototype);E.s=h<0?-1:1,h=h<0?-h:h;var C=d(h,g);return E.n=h/C,E.d=g/C,E}function a(h){for(var g={},E=h,C=2,B=4;B<=E;){for(;E%C===0;)E/=C,g[C]=(g[C]||0)+1;B+=1+2*C++}return E!==h?E>1&&(g[E]=(g[E]||0)+1):g[h]=(g[h]||0)+1,g}var s=function(h,g){var E=0,C=1,B=1,M=0,$=0,L=0,W=1,z=1,x=0,R=1,K=1,Z=1,ee=1e7,V;if(h!=null)if(g!==void 0){if(E=h,C=g,B=E*C,E%1!==0||C%1!==0)throw F()}else switch(typeof h){case"object":{if("d"in h&&"n"in h)E=h.n,C=h.d,"s"in h&&(E*=h.s);else if(0 in h)E=h[0],1 in h&&(C=h[1]);else throw m();B=E*C;break}case"number":{if(h<0&&(B=h,h=-h),h%1===0)E=h;else if(h>0){for(h>=1&&(z=Math.pow(10,Math.floor(1+Math.log(h)/Math.LN10)),h/=z);R<=ee&&Z<=ee;)if(V=(x+K)/(R+Z),h===V){R+Z<=ee?(E=x+K,C=R+Z):Z>R?(E=K,C=Z):(E=x,C=R);break}else h>V?(x+=K,R+=Z):(K+=x,Z+=R),R>ee?(E=K,C=Z):(E=x,C=R);E*=z}else(isNaN(h)||isNaN(g))&&(C=E=NaN);break}case"string":{if(R=h.match(/\d+|./g),R===null)throw m();if(R[x]==="-"?(B=-1,x++):R[x]==="+"&&x++,R.length===x+1?$=i(R[x++],B):R[x+1]==="."||R[x]==="."?(R[x]!=="."&&(M=i(R[x++],B)),x++,(x+1===R.length||R[x+1]==="("&&R[x+3]===")"||R[x+1]==="'"&&R[x+3]==="'")&&($=i(R[x],B),W=Math.pow(10,R[x].length),x++),(R[x]==="("&&R[x+2]===")"||R[x]==="'"&&R[x+2]==="'")&&(L=i(R[x+1],B),z=Math.pow(10,R[x+1].length)-1,x+=3)):R[x+1]==="/"||R[x+1]===":"?($=i(R[x],B),W=i(R[x+2],1),x+=3):R[x+3]==="/"&&R[x+1]===" "&&(M=i(R[x],B),$=i(R[x+2],B),W=i(R[x+4],1),x+=5),R.length<=x){C=W*z,B=E=L+C*M+z*$;break}}default:throw m()}if(C===0)throw v();u.s=B<0?-1:1,u.n=Math.abs(E),u.d=Math.abs(C)};function c(h,g,E){for(var C=1;g>0;h=h*h%E,g>>=1)g&1&&(C=C*h%E);return C}function l(h,g){for(;g%2===0;g/=2);for(;g%5===0;g/=5);if(g===1)return 0;for(var E=10%g,C=1;E!==1;C++)if(E=E*10%g,C>r)return 0;return C}function f(h,g,E){for(var C=1,B=c(10,E,g),M=0;M<300;M++){if(C===B)return M;C=C*10%g,B=B*10%g}return 0}function d(h,g){if(!h)return g;if(!g)return h;for(;;){if(h%=g,!h)return g;if(g%=h,!g)return h}}function p(h,g){if(s(h,g),this instanceof p)h=d(u.d,u.n),this.s=u.s,this.n=u.n/h,this.d=u.d/h;else return o(u.s*u.n,u.d)}var v=function(){return new Error("Division by Zero")},m=function(){return new Error("Invalid argument")},F=function(){return new Error("Parameters must be integer")};p.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(h,g){return s(h,g),o(this.s*this.n*u.d+u.s*this.d*u.n,this.d*u.d)},sub:function(h,g){return s(h,g),o(this.s*this.n*u.d-u.s*this.d*u.n,this.d*u.d)},mul:function(h,g){return s(h,g),o(this.s*u.s*this.n*u.n,this.d*u.d)},div:function(h,g){return s(h,g),o(this.s*u.s*this.n*u.d,this.d*u.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(h,g){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(h===void 0)return o(this.s*this.n%this.d,1);if(s(h,g),u.n===0&&this.d===0)throw v();return o(this.s*(u.d*this.n)%(u.n*this.d),u.d*this.d)},gcd:function(h,g){return s(h,g),o(d(u.n,this.n)*d(u.d,this.d),u.d*this.d)},lcm:function(h,g){return s(h,g),u.n===0&&this.n===0?o(0,1):o(u.n*this.n,d(u.n,this.n)*d(u.d,this.d))},ceil:function(h){return h=Math.pow(10,h||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):o(Math.ceil(h*this.s*this.n/this.d),h)},floor:function(h){return h=Math.pow(10,h||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):o(Math.floor(h*this.s*this.n/this.d),h)},round:function(h){return h=Math.pow(10,h||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):o(Math.round(h*this.s*this.n/this.d),h)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(h,g){if(s(h,g),u.d===1)return u.s<0?o(Math.pow(this.s*this.d,u.n),Math.pow(this.n,u.n)):o(Math.pow(this.s*this.n,u.n),Math.pow(this.d,u.n));if(this.s<0)return null;var E=a(this.n),C=a(this.d),B=1,M=1;for(var $ in E)if($!=="1"){if($==="0"){B=0;break}if(E[$]*=u.n,E[$]%u.d===0)E[$]/=u.d;else return null;B*=Math.pow($,E[$])}for(var $ in C)if($!=="1"){if(C[$]*=u.n,C[$]%u.d===0)C[$]/=u.d;else return null;M*=Math.pow($,C[$])}return u.s<0?o(M,B):o(B,M)},equals:function(h,g){return s(h,g),this.s*this.n*u.d===u.s*u.n*this.d},compare:function(h,g){s(h,g);var E=this.s*this.n*u.d-u.s*u.n*this.d;return(0<E)-(E<0)},simplify:function(h){if(isNaN(this.n)||isNaN(this.d))return this;h=h||.001;for(var g=this.abs(),E=g.toContinued(),C=1;C<E.length;C++){for(var B=o(E[C-1],1),M=C-2;M>=0;M--)B=B.inverse().add(E[M]);if(Math.abs(B.sub(g).valueOf())<h)return B.mul(this.s)}return this},divisible:function(h,g){return s(h,g),!(!(u.n*this.d)||this.n*u.d%(u.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(h){var g,E="",C=this.n,B=this.d;return this.s<0&&(E+="-"),B===1?E+=C:(h&&(g=Math.floor(C/B))>0&&(E+=g,E+=" ",C%=B),E+=C,E+="/",E+=B),E},toLatex:function(h){var g,E="",C=this.n,B=this.d;return this.s<0&&(E+="-"),B===1?E+=C:(h&&(g=Math.floor(C/B))>0&&(E+=g,C%=B),E+="\\frac{",E+=C,E+="}{",E+=B,E+="}"),E},toContinued:function(){var h,g=this.n,E=this.d,C=[];if(isNaN(g)||isNaN(E))return C;do C.push(Math.floor(g/E)),h=g%E,g=E,E=h;while(g!==1);return C},toString:function(h){var g=this.n,E=this.d;if(isNaN(g)||isNaN(E))return"NaN";h=h||15;var C=l(g,E),B=f(g,E,C),M=this.s<0?"-":"";if(M+=g/E|0,g%=E,g*=10,g&&(M+="."),C){for(var $=B;$--;)M+=g/E|0,g%=E,g*=10;M+="(";for(var $=C;$--;)M+=g/E|0,g%=E,g*=10;M+=")"}else for(var $=h;g&&$--;)M+=g/E|0,g%=E,g*=10;return M}},Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,e.exports=p})()})(vo);var Ye=fD(vo.exports),N3="Fraction",$3=[],I3=Be(N3,$3,()=>(Object.defineProperty(Ye,"name",{value:"Fraction"}),Ye.prototype.constructor=Ye,Ye.prototype.type="Fraction",Ye.prototype.isFraction=!0,Ye.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ye.fromJSON=function(e){return new Ye(e)},Ye),{isClass:!0}),O3="Matrix",x3=[],T3=Be(O3,x3,()=>{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,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){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,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){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,n){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 P3(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var R3="DenseMatrix",L3=["Matrix"],k3=Be(R3,L3,e=>{var{Matrix:t}=e;function n(l,f){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Cn(f))throw new Error("Invalid datatype: "+f);if(wt(l))l.type==="DenseMatrix"?(this._data=Dt(l._data),this._size=Dt(l._size),this._datatype=f||l._datatype):(this._data=l.toArray(),this._size=l.size(),this._datatype=f||l._datatype);else if(l&&$e(l.data)&&$e(l.size))this._data=l.data,this._size=l.size,Vi(this._data,this._size),this._datatype=f||l.datatype;else if($e(l))this._data=c(l),this._size=gt(this._data),Vi(this._data,this._size),this._datatype=f;else{if(l)throw new TypeError("Unsupported type of data ("+qr(l)+")");this._data=[],this._size=[0],this._datatype=f}}n.prototype=new t,n.prototype.createDenseMatrix=function(l,f){return new n(l,f)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Wr(this._data,qr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(l,f){return new n(l,f)},n.prototype.subset=function(l,f,d){switch(arguments.length){case 1:return r(this,l);case 2:case 3:return i(this,l,f,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(l){if(!$e(l))throw new TypeError("Array expected");if(l.length!==this._size.length)throw new de(l.length,this._size.length);for(var f=0;f<l.length;f++)Oe(l[f],this._size[f]);for(var d=this._data,p=0,v=l.length;p<v;p++){var m=l[p];Oe(m,d.length),d=d[m]}return d},n.prototype.set=function(l,f,d){if(!$e(l))throw new TypeError("Array expected");if(l.length<this._size.length)throw new de(l.length,this._size.length,"<");var p,v,m,F=l.map(function(g){return g+1});s(this,F,d);var h=this._data;for(p=0,v=l.length-1;p<v;p++)m=l[p],Oe(m,h.length),h=h[m];return m=l[l.length-1],Oe(m,h.length),h[m]=f,this};function r(l,f){if(!Ni(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return l.get(f.min());var p=f.size();if(p.length!==l._size.length)throw new de(p.length,l._size.length);for(var v=f.min(),m=f.max(),F=0,h=l._size.length;F<h;F++)Oe(v[F],l._size[F]),Oe(m[F],l._size[F]);return new n(u(l._data,f,p.length,0),l._datatype)}function u(l,f,d,p){var v=p===d-1,m=f.dimension(p);return v?m.map(function(F){return Oe(F,l.length),l[F]}).valueOf():m.map(function(F){Oe(F,l.length);var h=l[F];return u(h,f,d,p+1)}).valueOf()}function i(l,f,d,p){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var v=f.size(),m=f.isScalar(),F;if(wt(d)?(F=d.size(),d=d.valueOf()):F=gt(d),m){if(F.length!==0)throw new TypeError("Scalar expected");l.set(f.min(),d,p)}else{if(!Jt(F,v))try{F.length===0?d=Ki([d],v):d=Ki(d,v),F=gt(d)}catch(M){}if(v.length<l._size.length)throw new de(v.length,l._size.length,"<");if(F.length<v.length){for(var h=0,g=0;v[h]===1&&F[h]===1;)h++;for(;v[h]===1;)g++,h++;d=cm(d,v.length,g,F)}if(!Jt(v,F))throw new de(v,F,">");var E=f.max().map(function(M){return M+1});s(l,E,p);var C=v.length,B=0;o(l._data,f,d,C,B)}return l}function o(l,f,d,p,v){var m=v===p-1,F=f.dimension(v);m?F.forEach(function(h,g){Oe(h),l[h]=d[g[0]]}):F.forEach(function(h,g){Oe(h),o(l[h],f,d[g[0]],p,v+1)})}n.prototype.resize=function(l,f,d){if(!jr(l))throw new TypeError("Array or Matrix expected");var p=l.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),v=d?this.clone():this;return a(v,p,f)};function a(l,f,d){if(f.length===0){for(var p=l._data;$e(p);)p=p[0];return p}return l._size=f.slice(0),l._data=Hi(l._data,l._size,d),l}n.prototype.reshape=function(l,f){var d=f?this.clone():this;d._data=zi(d._data,l);var p=d._size.reduce((v,m)=>v*m);return d._size=Wi(l,p),d};function s(l,f,d){for(var p=l._size.slice(0),v=!1;p.length<f.length;)p.push(0),v=!0;for(var m=0,F=f.length;m<F;m++)f[m]>p[m]&&(p[m]=f[m],v=!0);v&&a(l,p,d)}n.prototype.clone=function(){var l=new n({data:Dt(this._data),size:Dt(this._size),datatype:this._datatype});return l},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(l){var f=this,d=P3(l),p=function F(h,g){return $e(h)?h.map(function(E,C){return F(E,g.concat(C))}):d===1?l(h):d===2?l(h,g):l(h,g,f)},v=p(this._data,[]),m=this._datatype!==void 0?Wr(v,qr):void 0;return new n(v,m)},n.prototype.forEach=function(l){var f=this,d=function p(v,m){$e(v)?v.forEach(function(F,h){p(F,m.concat(h))}):l(v,m,f)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var l=function*f(d,p){if($e(d))for(var v=0;v<d.length;v++)yield*f(d[v],p.concat(v));else yield{value:d,index:p}};yield*l(this._data,[])},n.prototype.rows=function(){var l=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var p of d)l.push(new n([p],this._datatype));return l},n.prototype.columns=function(){var l=this,f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var p=this._data,v=function(h){var g=p.map(E=>[E[h]]);f.push(new n(g,l._datatype))},m=0;m<d[1];m++)v(m);return f},n.prototype.toArray=function(){return Dt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(l){return vt(this._data,l)},n.prototype.toString=function(){return vt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(l){if(l){if(Ke(l)&&(l=l.toNumber()),!ge(l)||!qe(l))throw new TypeError("The parameter k must be an integer number")}else l=0;for(var f=l>0?l:0,d=l<0?-l:0,p=this._size[0],v=this._size[1],m=Math.min(p-d,v-f),F=[],h=0;h<m;h++)F[h]=this._data[h+d][h+f];return new n({data:F,size:[m],datatype:this._datatype})},n.diagonal=function(l,f,d,p){if(!$e(l))throw new TypeError("Array expected, size parameter");if(l.length!==2)throw new Error("Only two dimensions matrix are supported");if(l=l.map(function($){if(Ke($)&&($=$.toNumber()),!ge($)||!qe($)||$<1)throw new Error("Size values must be positive integers");return $}),d){if(Ke(d)&&(d=d.toNumber()),!ge(d)||!qe(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var v=d>0?d:0,m=d<0?-d:0,F=l[0],h=l[1],g=Math.min(F-m,h-v),E;if($e(f)){if(f.length!==g)throw new Error("Invalid value array length");E=function(L){return f[L]}}else if(wt(f)){var C=f.size();if(C.length!==1||C[0]!==g)throw new Error("Invalid matrix length");E=function(L){return f.get([L])}}else E=function(){return f};p||(p=Ke(E(0))?E(0).mul(0):0);var B=[];if(l.length>0){B=Hi(B,l,p);for(var M=0;M<g;M++)B[M+m][M+v]=E(M)}return new n({data:B,size:[F,h]})},n.fromJSON=function(l){return new n(l)},n.prototype.swapRows=function(l,f){if(!ge(l)||!qe(l)||!ge(f)||!qe(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 Oe(l,this._size[0]),Oe(f,this._size[0]),n._swapRows(l,f,this._data),this},n._swapRows=function(l,f,d){var p=d[l];d[l]=d[f],d[f]=p};function c(l){return wt(l)?c(l.valueOf()):$e(l)?l.map(c):l}return n},{isClass:!0}),go="equalScalar";Be(go,["typed","config"],e=>{var{typed:t,config:n}=e;return t(go,{"number, number":function(u,i){return nm(u,i,n.epsilon)}})});function Kt(e,t,n,r){if(!(this instanceof Kt))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(r!=null?"-"+r:"")+" expected)",this.stack=new Error().stack}Kt.prototype=new Error,Kt.prototype.constructor=Error,Kt.prototype.name="ArgumentsError",Kt.prototype.isArgumentsError=!0;var mo="format",j3=["typed"],q3=Be(mo,j3,e=>{var{typed:t}=e;return t(mo,{any:vt,"any, Object | function | number":vt})}),yo="bin",U3=["typed","format"];Be(yo,U3,e=>{var{typed:t,format:n}=e;return t(yo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var Eo="oct",V3=["typed","format"];Be(Eo,V3,e=>{var{typed:t,format:n}=e;return t(Eo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var Co="hex",H3=["typed","format"];Be(Co,H3,e=>{var{typed:t,format:n}=e;return t(Co,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Fo="equal";Be(Fo,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Fo,{"any, any":function(u,i){return u===null?i===null:i===null?u===null:u===void 0?i===void 0:i===void 0?u===void 0:n(u,i)}})});var Ao="unequal";Be(Ao,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Ao,{"any, any":function(u,i){return u===null?i!==null:i===null?u!==null:u===void 0?i!==void 0:i===void 0?u!==void 0:!n(u,i)}})});var Bo={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this,l=a();c.next=function(){var f=2091639*c.s0+c.c*23283064365386963e-26;return c.s0=c.s1,c.s1=c.s2,c.s2=f-(c.c=f|0)},c.c=1,c.s0=l(" "),c.s1=l(" "),c.s2=l(" "),c.s0-=l(s),c.s0<0&&(c.s0+=1),c.s1-=l(s),c.s1<0&&(c.s1+=1),c.s2-=l(s),c.s2<0&&(c.s2+=1),l=null}function i(s,c){return c.c=s.c,c.s0=s.s0,c.s1=s.s1,c.s2=s.s2,c}function o(s,c){var l=new u(s),f=c&&c.state,d=l.next;return d.int32=function(){return l.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,f&&(typeof f=="object"&&i(f,l),d.state=function(){return i(l,{})}),d}function a(){var s=4022871197,c=function(l){l=String(l);for(var f=0;f<l.length;f++){s+=l.charCodeAt(f);var d=.02519603282416938*s;s=d>>>0,d-=s,d*=s,s=d>>>0,d-=s,s+=d*4294967296}return(s>>>0)*23283064365386963e-26};return c}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(et,e,!1)})(Bo);var wo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.x=0,s.y=0,s.z=0,s.w=0,s.next=function(){var f=s.x^s.x<<11;return s.x=s.y,s.y=s.z,s.z=s.w,s.w^=s.w>>>19^f^f>>>8},a===(a|0)?s.x=a:c+=a;for(var l=0;l<c.length+64;l++)s.x^=c.charCodeAt(l)|0,s.next()}function i(a,s){return s.x=a.x,s.y=a.y,s.z=a.z,s.w=a.w,s}function o(a,s){var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(typeof l=="object"&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(et,e,!1)})(wo);var bo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.next=function(){var f=s.x^s.x>>>2;return s.x=s.y,s.y=s.z,s.z=s.w,s.w=s.v,(s.d=s.d+362437|0)+(s.v=s.v^s.v<<4^(f^f<<1))|0},s.x=0,s.y=0,s.z=0,s.w=0,s.v=0,a===(a|0)?s.x=a:c+=a;for(var l=0;l<c.length+64;l++)s.x^=c.charCodeAt(l)|0,l==c.length&&(s.d=s.x<<10^s.x>>>4),s.next()}function i(a,s){return s.x=a.x,s.y=a.y,s.z=a.z,s.w=a.w,s.v=a.v,s.d=a.d,s}function o(a,s){var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(typeof l=="object"&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(et,e,!1)})(bo);var _o={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this;s.next=function(){var l=s.x,f=s.i,d,p;return d=l[f],d^=d>>>7,p=d^d<<24,d=l[f+1&7],p^=d^d>>>10,d=l[f+3&7],p^=d^d>>>3,d=l[f+4&7],p^=d^d<<7,d=l[f+7&7],d=d^d<<13,p^=d^d<<9,l[f]=p,s.i=f+1&7,p};function c(l,f){var d,p=[];if(f===(f|0))p[0]=f;else for(f=""+f,d=0;d<f.length;++d)p[d&7]=p[d&7]<<15^f.charCodeAt(d)+p[d+1&7]<<13;for(;p.length<8;)p.push(0);for(d=0;d<8&&p[d]===0;++d);for(d==8?p[7]=-1:p[d],l.x=p,l.i=0,d=256;d>0;--d)l.next()}c(s,a)}function i(a,s){return s.x=a.x.slice(),s.i=a.i,s}function o(a,s){a==null&&(a=+new Date);var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(l.x&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(et,e,!1)})(_o);var So={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this;s.next=function(){var l=s.w,f=s.X,d=s.i,p,v;return s.w=l=l+1640531527|0,v=f[d+34&127],p=f[d=d+1&127],v^=v<<13,p^=p<<17,v^=v>>>15,p^=p>>>12,v=f[d]=v^p,s.i=d,v+(l^l>>>16)|0};function c(l,f){var d,p,v,m,F,h=[],g=128;for(f===(f|0)?(p=f,f=null):(f=f+"\0",p=0,g=Math.max(g,f.length)),v=0,m=-32;m<g;++m)f&&(p^=f.charCodeAt((m+32)%f.length)),m===0&&(F=p),p^=p<<10,p^=p>>>15,p^=p<<4,p^=p>>>13,m>=0&&(F=F+1640531527|0,d=h[m&127]^=p+F,v=d==0?v+1:0);for(v>=128&&(h[(f&&f.length||0)&127]=-1),v=127,m=4*128;m>0;--m)p=h[v+34&127],d=h[v=v+1&127],p^=p<<13,d^=d<<17,p^=p>>>15,d^=d>>>12,h[v]=p^d;l.w=F,l.X=h,l.i=v}c(s,a)}function i(a,s){return s.i=a.i,s.w=a.w,s.X=a.X.slice(),s}function o(a,s){a==null&&(a=+new Date);var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(l.X&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(et,e,!1)})(So);var Mo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.next=function(){var f=s.b,d=s.c,p=s.d,v=s.a;return f=f<<25^f>>>7^d,d=d-p|0,p=p<<24^p>>>8^v,v=v-f|0,s.b=f=f<<20^f>>>12^d,s.c=d=d-p|0,s.d=p<<16^d>>>16^v,s.a=v-f|0},s.a=0,s.b=0,s.c=-1640531527,s.d=1367130551,a===Math.floor(a)?(s.a=a/4294967296|0,s.b=a|0):c+=a;for(var l=0;l<c.length+20;l++)s.b^=c.charCodeAt(l)|0,s.next()}function i(a,s){return s.a=a.a,s.b=a.b,s.c=a.c,s.d=a.d,s}function o(a,s){var c=new u(a),l=s&&s.state,f=function(){return(c.next()>>>0)/4294967296};return f.double=function(){do var d=c.next()>>>11,p=(c.next()>>>0)/4294967296,v=(d+p)/(1<<21);while(v===0);return v},f.int32=c.next,f.quick=f,l&&(typeof l=="object"&&i(l,c),f.state=function(){return i(c,{})}),f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(et,e,!1)})(Mo);var No={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,a="random",s=r.pow(u,i),c=r.pow(2,o),l=c*2,f=u-1,d;function p(C,B,M){var $=[];B=B==!0?{entropy:!0}:B||{};var L=h(F(B.entropy?[C,E(n)]:C==null?g():C,3),$),W=new v($),z=function(){for(var x=W.g(i),R=s,K=0;x<c;)x=(x+K)*u,R*=u,K=W.g(1);for(;x>=l;)x/=2,R/=2,K>>>=1;return(x+K)/R};return z.int32=function(){return W.g(4)|0},z.quick=function(){return W.g(4)/4294967296},z.double=z,h(E(W.S),n),(B.pass||M||function(x,R,K,Z){return Z&&(Z.S&&m(Z,W),x.state=function(){return m(W,{})}),K?(r[a]=x,R):x})(z,L,"global"in B?B.global:this==r,B.state)}function v(C){var B,M=C.length,$=this,L=0,W=$.i=$.j=0,z=$.S=[];for(M||(C=[M++]);L<u;)z[L]=L++;for(L=0;L<u;L++)z[L]=z[W=f&W+C[L%M]+(B=z[L])],z[W]=B;($.g=function(x){for(var R,K=0,Z=$.i,ee=$.j,V=$.S;x--;)R=V[Z=f&Z+1],K=K*u+V[f&(V[Z]=V[ee=f&ee+R])+(V[ee]=R)];return $.i=Z,$.j=ee,K})(u)}function m(C,B){return B.i=C.i,B.j=C.j,B.S=C.S.slice(),B}function F(C,B){var M=[],$=typeof C,L;if(B&&$=="object")for(L in C)try{M.push(F(C[L],B-1))}catch(W){}return M.length?M:$=="string"?C:C+"\0"}function h(C,B){for(var M=C+"",$,L=0;L<M.length;)B[f&L]=f&($^=B[f&L]*19)+M.charCodeAt(L++);return E(B)}function g(){try{var C;return d&&(C=d.randomBytes)?C=C(u):(C=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(C)),E(C)}catch($){var B=t.navigator,M=B&&B.plugins;return[+new Date,t,M,t.screen,E(n)]}}function E(C){return String.fromCharCode.apply(0,C)}if(h(r.random(),n),e.exports){e.exports=p;try{d=Ln.default}catch(C){}}else r["seed"+a]=p})(typeof self!="undefined"?self:et,[],Math)})(No);var z3=Bo.exports,W3=wo.exports,G3=bo.exports,Z3=_o.exports,J3=So.exports,X3=Mo.exports,Ot=No.exports;Ot.alea=z3,Ot.xor128=W3,Ot.xorwow=G3,Ot.xorshift7=Z3,Ot.xor4096=J3,Ot.tychei=X3,xn("fineStructure",.0072973525693),xn("weakMixingAngle",.2229),xn("efimovFactor",22.7),xn("sackurTetrode",-1.16487052358);function xn(e,t){var n=["config","BigNumber"];return Be(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var K3=B3({config:Ii}),Q3=M3({}),Y3=I3({}),ey=T3({}),ty=k3({Matrix:ey}),ny=_m({BigNumber:K3,Complex:Q3,DenseMatrix:ty,Fraction:Y3}),ry=q3({typed:ny});class uy{constructor(t){this.calcControls=[],this.dependenciesTriggerMap=new Map,this.hideNotRememberControlIds=[],this.dontHasPermissionControlIds=[],this.cacheComputedResult={},this.options=t,this.getDontHasPermissionControlIds(),this.getNeedHideRememberControlIds()}getNeedHideRememberControlIds(){var t;!((t=this.options)!=null&&t.displayBoList)||(this.hideNotRememberControlIds=this.options.displayBoList.reduce((n,r)=>(r.is_remember||n.push(...r.hide_controls),n),[]))}getDontHasPermissionControlIds(){var t;!((t=this.options)!=null&&t.behavior)||(this.dontHasPermissionControlIds=this.options.behavior.reduce((n,r)=>(r.ctrlBehavior===1&&n.push(r.ctrlId),n),[]))}controlNeedComputedValue(t){if(!t)return!1;const n=this.getControlIsHide(t);return!(this.dontHasPermissionControlIds.includes(t.id)&&n||this.hideNotRememberControlIds.includes(t.id)&&n)}getControlIsHide(t){return t.props.isHide?!0:t.parent===null||t.parent===void 0?!1:this.getControlIsHide(t.parent)}apply(t){this.engine=t,this.watchControlChange(),this.watchSubtableChange(),this.watchSchemaHideChange(),this.engine.on("engine-mounted",()=>{requestAnimationFrame(()=>{this.resetDependencies(),this.allCalcControlComputed()})})}resetDependencies(){this.calcControls=[],this.dependenciesTriggerMap.clear(),this.getAllCalcControl(),this.getCalcDependencies()}allCalcControlComputed(){this.calcControls.forEach(t=>{(t.props.dataBind.result.fieldCode===null||t.props.dataBind.result.fieldCode===void 0)&&this.computedCalcValue(t)})}getAllCalcControl(){this.calcControls=this.engine.runtime.flatInstances.filter(t=>t.type===oe.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===We.VariableInMainTable||r.type===We.VariableInCurrentSubTable||r.type===We.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===We.VariableInOtherSubTable&&r.subTableId&&this.setDependenciesTriggerMapItem(r.subTableId,t)})})}setDependenciesTriggerMapItem(t,n){this.dependenciesTriggerMap.has(t)||this.dependenciesTriggerMap.set(t,[]);const r=this.dependenciesTriggerMap.get(t);r.includes(n)||r.push(n)}getCalcControlsFromSubtableRows(t){return t.reduce((n,r)=>(r.children.forEach(u=>{const i=u.children[0];i&&this.engine.assertInstance(i,oe.CALC)&&n.push(i)}),n),[])}watchSchemaHideChange(){this.engine.on("schema-change",t=>{var n;t.props==="isHide"&&((n=this.dependenciesTriggerMap.get(t.instance.id))!=null?n:[]).forEach(u=>{this.computedCalcValue(u)})})}watchSubtableChange(){this.engine.on("list-change",t=>{var i,o,a;if(this.engine.isMounted===!1)return;this.resetDependencies();const n=(o=(i=t.options)==null?void 0:i.changed)!=null?o:[];this.getCalcControlsFromSubtableRows(n).forEach(s=>{this.computedCalcValue(s)}),((a=this.dependenciesTriggerMap.get(t.instance.id))!=null?a:[]).forEach(s=>{this.computedCalcValue(s)})})}watchControlChange(){this.engine.on("change",t=>{var u;if(this.engine.isMounted===!1)return;const{instance:n}=t;if(!this.dependenciesTriggerMap.has(n.id))return;const r=(u=this.dependenciesTriggerMap.get(n.id))!=null?u:[];t.rowIndex!==void 0&&t.rowIndex>-1?r.forEach(i=>{this.controlInSubtable(i)&&this.engine.getInstanceRowIndex(i)!==t.rowIndex||this.computedCalcValue(i)}):r.forEach(i=>{this.computedCalcValue(i)})})}controlInSubtable(t){var n;return((n=t.parent)==null?void 0:n.type)===oe.SUBTABLE_COLUMN}computedCalcValue(t){var s;const n=t.props.scriptEcho;if(!n||n.length===0)return;let r;this.controlInSubtable(t)&&(r=this.engine.getInstanceRowIndex(t));const u=n.reduce((c,l)=>{if(l.type===We.Operator||l.type===We.Number)return c+l.name;let f=0,d;switch(l.type){case We.VariableInMainTable:{const p=this.getNumberValue(this.engine.getState(l.id));d=this.engine.getInstance(l.id),f=Number(p);break}case We.VariableInCurrentSubTable:{d=this.engine.getInstance(l.id,r);const p=this.engine.getState(l.id,r),v=this.getNumberValue(p);f=Number(v);break}case We.VariableInOtherSubTable:{const p=this.engine.getState(l.id),v=Array.isArray(p)?p.map(F=>this.getNumberValue(F)):[],m=this.getAggregateTypeValue(v,l.aggregateType);d=this.engine.getInstance(l.subTableId),f=Number(m);break}}return!Number.isNaN(f)&&this.controlNeedComputedValue(d)?c+=`(${f})`:c+=0,c},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(ry(new Function(`return ${u}`)(),{precision:16})),this.cacheComputedResult[u]=i),this.controlInSubtable(t)&&r===void 0)return;const o=this.engine.getState(t.id,r),a=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));a!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:a,unit:(s=o==null?void 0:o.unit)!=null?s:""},r)}getNumberValue(t){if(typeof t=="object"&&t){if("result"in t)return t.result;if("amount"in t)return t.amount}return typeof t=="number"?t:0}getAggregateTypeValue(t,n){if(!n||!t||!t.length)return 0;switch(n){case en.MAX:return Math.max(...t);case en.MIN:return Math.min(...t);case en.SUM:return t.reduce((r,u)=>r+u);case en.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class iy{constructor(t,n=!0){this.config=t,this.isPc=n}apply(t){var o,a;this.engine=t;const n=(a=(o=this.config)==null?void 0:o.source)!=null?a:"";let r=document.createElement("style");r.className="edit-css-"+t.id;let u=document.querySelector("head");u==null||u.appendChild(r);let i;this.isPc,i=n,r.appendChild(document.createTextNode(i))}}G.CalcPlugin=uy,G.ControlsEventPlugin=m5,G.ES6ModulePlugin=D5,G.Engine=kr,G.LifecycleEventPlugin=g5,G.Plugin=p5,G.StylePlugin=iy,G.buildUUID=Wt,G.hasChildrenControl=gn,G.loopDataViewControl=pt,G.loopFormControl=ht,G.parseModule=wi,Object.defineProperty(G,"__esModule",{value:!0})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-engine",
|
|
3
|
-
"version": "2.23.1-beta.
|
|
3
|
+
"version": "2.23.1-beta.3-zt",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "~18.0.6"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "768d273a9c2df24ead215fe386f2716e515a1527"
|
|
38
38
|
}
|