@byteluck-fe/model-driven-engine 2.23.0-beta.16 → 2.23.0-beta.17
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
|
|
3
3
|
* @Date: 2022-04-15 14:06:03
|
|
4
4
|
* @LastEditors: SuperLuckyqi
|
|
5
|
-
* @LastEditTime: 2024-11-05
|
|
5
|
+
* @LastEditTime: 2024-11-05 18:10:51
|
|
6
6
|
* @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
|
|
7
7
|
*/ function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
@@ -61,7 +61,7 @@ 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 = ".render-engine-
|
|
64
|
+
cssStyleText = ".render-engine-".concat(engine.id, "{ ").concat(compiledStyle, " }");
|
|
65
65
|
} else {
|
|
66
66
|
cssStyleText = compiledStyle;
|
|
67
67
|
}
|
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
|
-
**/var N3=2e3,P={s:1,n:0,d:1};function nt(e,t){if(isNaN(e=parseInt(e,10)))throw Rn();return e*t}function re(e,t){if(t===0)throw su();var n=Object.create(Ce.prototype);n.s=e<0?-1:1,e=e<0?-e:e;var r=Rt(e,t);return n.n=e/r,n.d=t/r,n}function Co(e){for(var t={},n=e,r=2,u=4;u<=n;){for(;n%r===0;)n/=r,t[r]=(t[r]||0)+1;u+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var Re=function(e,t){var n=0,r=1,u=1,i=0,o=0,a=0,s=1,c=1,l=0,f=1,d=1,h=1,g=1e7,v;if(e!=null)if(t!==void 0){if(n=e,r=t,u=n*r,n%1!==0||r%1!==0)throw R3()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)n=e.n,r=e.d,"s"in e&&(n*=e.s);else if(0 in e)n=e[0],1 in e&&(r=e[1]);else throw Rn();u=n*r;break}case"number":{if(e<0&&(u=e,e=-e),e%1===0)n=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);f<=g&&h<=g;)if(v=(l+d)/(f+h),e===v){f+h<=g?(n=l+d,r=f+h):h>f?(n=d,r=h):(n=l,r=f);break}else e>v?(l+=d,f+=h):(d+=l,h+=f),f>g?(n=d,r=h):(n=l,r=f);n*=c}else(isNaN(e)||isNaN(t))&&(r=n=NaN);break}case"string":{if(f=e.match(/\d+|./g),f===null)throw Rn();if(f[l]==="-"?(u=-1,l++):f[l]==="+"&&l++,f.length===l+1?o=nt(f[l++],u):f[l+1]==="."||f[l]==="."?(f[l]!=="."&&(i=nt(f[l++],u)),l++,(l+1===f.length||f[l+1]==="("&&f[l+3]===")"||f[l+1]==="'"&&f[l+3]==="'")&&(o=nt(f[l],u),s=Math.pow(10,f[l].length),l++),(f[l]==="("&&f[l+2]===")"||f[l]==="'"&&f[l+2]==="'")&&(a=nt(f[l+1],u),c=Math.pow(10,f[l+1].length)-1,l+=3)):f[l+1]==="/"||f[l+1]===":"?(o=nt(f[l],u),s=nt(f[l+2],1),l+=3):f[l+3]==="/"&&f[l+1]===" "&&(i=nt(f[l],u),o=nt(f[l+2],u),s=nt(f[l+4],1),l+=5),f.length<=l){r=s*c,u=n=a+r*i+c*o;break}}default:throw Rn()}if(r===0)throw su();P.s=u<0?-1:1,P.n=Math.abs(n),P.d=Math.abs(r)};function I3(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)t&1&&(r=r*e%n);return r}function x3(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(t===1)return 0;for(var n=10%t,r=1;n!==1;r++)if(n=n*10%t,r>N3)return 0;return r}function O3(e,t,n){for(var r=1,u=I3(10,n,t),i=0;i<300;i++){if(r===u)return i;r=r*10%t,u=u*10%t}return 0}function Rt(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Ce(e,t){if(Re(e,t),this instanceof Ce)e=Rt(P.d,P.n),this.s=P.s,this.n=P.n/e,this.d=P.d/e;else return re(P.s*P.n,P.d)}var su=function(){return new Error("Division by Zero")},Rn=function(){return new Error("Invalid argument")},R3=function(){return new Error("Parameters must be integer")};Ce.prototype={s:1,n:0,d:1,abs:function(){return re(this.n,this.d)},neg:function(){return re(-this.s*this.n,this.d)},add:function(e,t){return Re(e,t),re(this.s*this.n*P.d+P.s*this.d*P.n,this.d*P.d)},sub:function(e,t){return Re(e,t),re(this.s*this.n*P.d-P.s*this.d*P.n,this.d*P.d)},mul:function(e,t){return Re(e,t),re(this.s*P.s*this.n*P.n,this.d*P.d)},div:function(e,t){return Re(e,t),re(this.s*P.s*this.n*P.d,this.d*P.n)},clone:function(){return re(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Ce(NaN);if(e===void 0)return re(this.s*this.n%this.d,1);if(Re(e,t),P.n===0&&this.d===0)throw su();return re(this.s*(P.d*this.n)%(P.n*this.d),P.d*this.d)},gcd:function(e,t){return Re(e,t),re(Rt(P.n,this.n)*Rt(P.d,this.d),P.d*this.d)},lcm:function(e,t){return Re(e,t),P.n===0&&this.n===0?re(0,1):re(P.n*this.n,Rt(P.n,this.n)*Rt(P.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ce(NaN):re(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ce(NaN):re(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ce(NaN):re(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return Re(e,t),re(this.s*Math.round(this.n*P.d/(this.d*P.n))*P.n,P.d)},inverse:function(){return re(this.s*this.d,this.n)},pow:function(e,t){if(Re(e,t),P.d===1)return P.s<0?re(Math.pow(this.s*this.d,P.n),Math.pow(this.n,P.n)):re(Math.pow(this.s*this.n,P.n),Math.pow(this.d,P.n));if(this.s<0)return null;var n=Co(this.n),r=Co(this.d),u=1,i=1;for(var o in n)if(o!=="1"){if(o==="0"){u=0;break}if(n[o]*=P.n,n[o]%P.d===0)n[o]/=P.d;else return null;u*=Math.pow(o,n[o])}for(var o in r)if(o!=="1"){if(r[o]*=P.n,r[o]%P.d===0)r[o]/=P.d;else return null;i*=Math.pow(o,r[o])}return P.s<0?re(i,u):re(u,i)},equals:function(e,t){return Re(e,t),this.s*this.n*P.d===P.s*P.n*this.d},compare:function(e,t){Re(e,t);var n=this.s*this.n*P.d-P.s*P.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),r=1;r<n.length;r++){for(var u=re(n[r-1],1),i=r-2;i>=0;i--)u=u.inverse().add(n[i]);if(Math.abs(u.sub(t).valueOf())<e)return u.mul(this.s)}return this},divisible:function(e,t){return Re(e,t),!(!(P.n*this.d)||this.n*P.d%(P.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,u=this.d;return this.s<0&&(n+="-"),u===1?n+=r:(e&&(t=Math.floor(r/u))>0&&(n+=t,n+=" ",r%=u),n+=r,n+="/",n+=u),n},toLatex:function(e){var t,n="",r=this.n,u=this.d;return this.s<0&&(n+="-"),u===1?n+=r:(e&&(t=Math.floor(r/u))>0&&(n+=t,r%=u),n+="\\frac{",n+=r,n+="}{",n+=u,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do r.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(t!==1);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=x3(t,n),u=O3(t,n,r),i=this.s<0?"-":"";if(i+=t/n|0,t%=n,t*=10,t&&(i+="."),r){for(var o=u;o--;)i+=t/n|0,t%=n,t*=10;i+="(";for(var o=r;o--;)i+=t/n|0,t%=n,t*=10;i+=")"}else for(var o=e;t&&o--;)i+=t/n|0,t%=n,t*=10;return i}};var P3="Fraction",T3=[],L3=_e(P3,T3,()=>(Object.defineProperty(Ce,"name",{value:"Fraction"}),Ce.prototype.constructor=Ce,Ce.prototype.type="Fraction",Ce.prototype.isFraction=!0,Ce.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ce.fromJSON=function(e){return new Ce(e)},Ce),{isClass:!0}),j3="Matrix",k3=[],q3=_e(j3,k3,()=>{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 V3(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var U3="DenseMatrix",H3=["Matrix"],z3=_e(U3,H3,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&&!An(f))throw new Error("Invalid datatype: "+f);if(Qt(l))l.type==="DenseMatrix"?(this._data=yt(l._data),this._size=yt(l._size),this._datatype=f||l._datatype):(this._data=l.toArray(),this._size=l.size(),this._datatype=f||l._datatype);else if(l&&Oe(l.data)&&Oe(l.size))this._data=l.data,this._size=l.size,Qi(this._data,this._size),this._datatype=f||l.datatype;else if(Oe(l))this._data=c(l),this._size=Xr(this._data),Qi(this._data,this._size),this._datatype=f;else{if(l)throw new TypeError("Unsupported type of data ("+zr(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 Qr(this._data,zr)},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(!Oe(l))throw new TypeError("Array expected");if(l.length!==this._size.length)throw new ve(l.length,this._size.length);for(var f=0;f<l.length;f++)Te(l[f],this._size[f]);for(var d=this._data,h=0,g=l.length;h<g;h++){var v=l[h];Te(v,d.length),d=d[v]}return d},n.prototype.set=function(l,f,d){if(!Oe(l))throw new TypeError("Array expected");if(l.length<this._size.length)throw new ve(l.length,this._size.length,"<");var h,g,v,y=l.map(function(F){return F+1});s(this,y,d);var D=this._data;for(h=0,g=l.length-1;h<g;h++)v=l[h],Te(v,D.length),D=D[v];return v=l[l.length-1],Te(v,D.length),D[v]=f,this};function r(l,f){if(!Vi(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return l.get(f.min());var h=f.size();if(h.length!==l._size.length)throw new ve(h.length,l._size.length);for(var g=f.min(),v=f.max(),y=0,D=l._size.length;y<D;y++)Te(g[y],l._size[y]),Te(v[y],l._size[y]);return new n(u(l._data,f,h.length,0),l._datatype)}function u(l,f,d,h){var g=h===d-1,v=f.dimension(h);return g?v.map(function(y){return Te(y,l.length),l[y]}).valueOf():v.map(function(y){Te(y,l.length);var D=l[y];return u(D,f,d,h+1)}).valueOf()}function i(l,f,d,h){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var g=f.size(),v=f.isScalar(),y;if(Qt(d)?(y=d.size(),d=d.valueOf()):y=Xr(d),v){if(y.length!==0)throw new TypeError("Scalar expected");l.set(f.min(),d,h)}else{if(g.length<l._size.length)throw new ve(g.length,l._size.length,"<");if(y.length<g.length){for(var D=0,F=0;g[D]===1&&y[D]===1;)D++;for(;g[D]===1;)F++,D++;d=hm(d,g.length,F,y)}if(!Wr(g,y))throw new ve(g,y,">");var S=f.max().map(function(I){return I+1});s(l,S,h);var _=g.length,$=0;o(l._data,f,d,_,$)}return l}function o(l,f,d,h,g){var v=g===h-1,y=f.dimension(g);v?y.forEach(function(D,F){Te(D),l[D]=d[F[0]]}):y.forEach(function(D,F){Te(D),o(l[D],f,d[F[0]],h,g+1)})}n.prototype.resize=function(l,f,d){if(!Hr(l))throw new TypeError("Array or Matrix expected");var h=l.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),g=d?this.clone():this;return a(g,h,f)};function a(l,f,d){if(f.length===0){for(var h=l._data;Oe(h);)h=h[0];return h}return l._size=f.slice(0),l._data=Yi(l._data,l._size,d),l}n.prototype.reshape=function(l,f){var d=f?this.clone():this;d._data=fm(d._data,l);var h=d._size.reduce((g,v)=>g*v);return d._size=eo(l,h),d};function s(l,f,d){for(var h=l._size.slice(0),g=!1;h.length<f.length;)h.push(0),g=!0;for(var v=0,y=f.length;v<y;v++)f[v]>h[v]&&(h[v]=f[v],g=!0);g&&a(l,h,d)}n.prototype.clone=function(){var l=new n({data:yt(this._data),size:yt(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=V3(l),h=function y(D,F){return Oe(D)?D.map(function(S,_){return y(S,F.concat(_))}):d===1?l(D):d===2?l(D,F):l(D,F,f)},g=h(this._data,[]),v=this._datatype!==void 0?Qr(g,zr):void 0;return new n(g,v)},n.prototype.forEach=function(l){var f=this,d=function h(g,v){Oe(g)?g.forEach(function(y,D){h(y,v.concat(D))}):l(g,v,f)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var l=function*f(d,h){if(Oe(d))for(var g=0;g<d.length;g++)yield*f(d[g],h.concat(g));else yield{value:d,index:h}};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 h of d)l.push(new n([h],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 h=this._data,g=function(D){var F=h.map(S=>[S[D]]);f.push(new n(F,l._datatype))},v=0;v<d[1];v++)g(v);return f},n.prototype.toArray=function(){return yt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(l){return Et(this._data,l)},n.prototype.toString=function(){return Et(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(lt(l)&&(l=l.toNumber()),!Ae(l)||!Ze(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,h=this._size[0],g=this._size[1],v=Math.min(h-d,g-f),y=[],D=0;D<v;D++)y[D]=this._data[D+d][D+f];return new n({data:y,size:[v],datatype:this._datatype})},n.diagonal=function(l,f,d,h){if(!Oe(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(R){if(lt(R)&&(R=R.toNumber()),!Ae(R)||!Ze(R)||R<1)throw new Error("Size values must be positive integers");return R}),d){if(lt(d)&&(d=d.toNumber()),!Ae(d)||!Ze(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var g=d>0?d:0,v=d<0?-d:0,y=l[0],D=l[1],F=Math.min(y-v,D-g),S;if(Oe(f)){if(f.length!==F)throw new Error("Invalid value array length");S=function(L){return f[L]}}else if(Qt(f)){var _=f.size();if(_.length!==1||_[0]!==F)throw new Error("Invalid matrix length");S=function(L){return f.get([L])}}else S=function(){return f};h||(h=lt(S(0))?S(0).mul(0):0);var $=[];if(l.length>0){$=Yi($,l,h);for(var I=0;I<F;I++)$[I+v][I+g]=S(I)}return new n({data:$,size:[y,D]})},n.fromJSON=function(l){return new n(l)},n.prototype.swapRows=function(l,f){if(!Ae(l)||!Ze(l)||!Ae(f)||!Ze(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 Te(l,this._size[0]),Te(f,this._size[0]),n._swapRows(l,f,this._data),this},n._swapRows=function(l,f,d){var h=d[l];d[l]=d[f],d[f]=h};function c(l){for(var f=0,d=l.length;f<d;f++){var h=l[f];Oe(h)?l[f]=c(h):h&&h.isMatrix===!0&&(l[f]=c(h.valueOf()))}return l}return n},{isClass:!0}),Fo="equalScalar";_e(Fo,["typed","config"],e=>{var{typed:t,config:n}=e;return t(Fo,{"number, number":function(u,i){return im(u,i,n.epsilon)}})});function en(e,t,n,r){if(!(this instanceof en))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}en.prototype=new Error,en.prototype.constructor=Error,en.prototype.name="ArgumentsError",en.prototype.isArgumentsError=!0;var Ao="format",W3=["typed"],Z3=_e(Ao,W3,e=>{var{typed:t}=e;return t(Ao,{any:Et,"any, Object | function | number":Et})}),Bo="bin",G3=["typed","format"];_e(Bo,G3,e=>{var{typed:t,format:n}=e;return t(Bo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var wo="oct",J3=["typed","format"];_e(wo,J3,e=>{var{typed:t,format:n}=e;return t(wo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var bo="hex",X3=["typed","format"];_e(bo,X3,e=>{var{typed:t,format:n}=e;return t(bo,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var _o="equal";_e(_o,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(_o,{"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 So="unequal";_e(So,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(So,{"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 Mo={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})(rt,e,!1)})(Mo);var $o={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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})($o);var No={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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(No);var Io={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this;s.next=function(){var l=s.x,f=s.i,d,h;return d=l[f],d^=d>>>7,h=d^d<<24,d=l[f+1&7],h^=d^d>>>10,d=l[f+3&7],h^=d^d>>>3,d=l[f+4&7],h^=d^d<<7,d=l[f+7&7],d=d^d<<13,h^=d^d<<9,l[f]=h,s.i=f+1&7,h};function c(l,f){var d,h=[];if(f===(f|0))h[0]=f;else for(f=""+f,d=0;d<f.length;++d)h[d&7]=h[d&7]<<15^f.charCodeAt(d)+h[d+1&7]<<13;for(;h.length<8;)h.push(0);for(d=0;d<8&&h[d]===0;++d);for(d==8?h[7]=-1:h[d],l.x=h,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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(Io);var xo={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,h,g;return s.w=l=l+1640531527|0,g=f[d+34&127],h=f[d=d+1&127],g^=g<<13,h^=h<<17,g^=g>>>15,h^=h>>>12,g=f[d]=g^h,s.i=d,g+(l^l>>>16)|0};function c(l,f){var d,h,g,v,y,D=[],F=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,F=Math.max(F,f.length)),g=0,v=-32;v<F;++v)f&&(h^=f.charCodeAt((v+32)%f.length)),v===0&&(y=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,v>=0&&(y=y+1640531527|0,d=D[v&127]^=h+y,g=d==0?g+1:0);for(g>=128&&(D[(f&&f.length||0)&127]=-1),g=127,v=4*128;v>0;--v)h=D[g+34&127],d=D[g=g+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,D[g]=h^d;l.w=y,l.X=D,l.i=g}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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(xo);var Oo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.next=function(){var f=s.b,d=s.c,h=s.d,g=s.a;return f=f<<25^f>>>7^d,d=d-h|0,h=h<<24^h>>>8^g,g=g-f|0,s.b=f=f<<20^f>>>12^d,s.c=d=d-h|0,s.d=h<<16^d>>>16^g,s.a=g-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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(Oo);var Ro={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 h(_,$,I){var R=[];$=$==!0?{entropy:!0}:$||{};var L=D(y($.entropy?[_,S(n)]:_==null?F():_,3),R),Z=new g(R),G=function(){for(var J=Z.g(i),fe=s,oe=0;J<c;)J=(J+oe)*u,fe*=u,oe=Z.g(1);for(;J>=l;)J/=2,fe/=2,oe>>>=1;return(J+oe)/fe};return G.int32=function(){return Z.g(4)|0},G.quick=function(){return Z.g(4)/4294967296},G.double=G,D(S(Z.S),n),($.pass||I||function(J,fe,oe,ae){return ae&&(ae.S&&v(ae,Z),J.state=function(){return v(Z,{})}),oe?(r[a]=J,fe):J})(G,L,"global"in $?$.global:this==r,$.state)}function g(_){var $,I=_.length,R=this,L=0,Z=R.i=R.j=0,G=R.S=[];for(I||(_=[I++]);L<u;)G[L]=L++;for(L=0;L<u;L++)G[L]=G[Z=f&Z+_[L%I]+($=G[L])],G[Z]=$;(R.g=function(J){for(var fe,oe=0,ae=R.i,ue=R.j,U=R.S;J--;)fe=U[ae=f&ae+1],oe=oe*u+U[f&(U[ae]=U[ue=f&ue+fe])+(U[ue]=fe)];return R.i=ae,R.j=ue,oe})(u)}function v(_,$){return $.i=_.i,$.j=_.j,$.S=_.S.slice(),$}function y(_,$){var I=[],R=typeof _,L;if($&&R=="object")for(L in _)try{I.push(y(_[L],$-1))}catch(Z){}return I.length?I:R=="string"?_:_+"\0"}function D(_,$){for(var I=_+"",R,L=0;L<I.length;)$[f&L]=f&(R^=$[f&L]*19)+I.charCodeAt(L++);return S($)}function F(){try{var _;return d&&(_=d.randomBytes)?_=_(u):(_=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(_)),S(_)}catch(R){var $=t.navigator,I=$&&$.plugins;return[+new Date,t,I,t.screen,S(n)]}}function S(_){return String.fromCharCode.apply(0,_)}if(D(r.random(),n),e.exports){e.exports=h;try{d=kn.default}catch(_){}}else r["seed"+a]=h})(typeof self!="undefined"?self:rt,[],Math)})(Ro);var K3=Mo.exports,Q3=$o.exports,Y3=No.exports,ey=Io.exports,ty=xo.exports,ny=Oo.exports,Pt=Ro.exports;Pt.alea=K3,Pt.xor128=Q3,Pt.xorwow=Y3,Pt.xorshift7=ey,Pt.xor4096=ty,Pt.tychei=ny,Pn("fineStructure",.0072973525693),Pn("weakMixingAngle",.2229),Pn("efimovFactor",22.7),Pn("sackurTetrode",-1.16487052358);function Pn(e,t){var n=["config","BigNumber"];return _e(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var ry=B3({config:Ui}),uy=$3({}),iy=L3({}),oy=q3({}),ay=z3({Matrix:oy}),sy=_m({BigNumber:ry,Complex:uy,DenseMatrix:ay,Fraction:iy}),cy=Z3({typed:sy});class ly{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===te.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===je.VariableInMainTable||r.type===je.VariableInCurrentSubTable||r.type===je.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===je.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,te.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)===te.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===je.Operator||l.type===je.Number)return c+l.name;let f=0,d;switch(l.type){case je.VariableInMainTable:{const h=this.getNumberValue(this.engine.getState(l.id));d=this.engine.getInstance(l.id),f=Number(h);break}case je.VariableInCurrentSubTable:{d=this.engine.getInstance(l.id,r);const h=this.engine.getState(l.id,r),g=this.getNumberValue(h);f=Number(g);break}case je.VariableInOtherSubTable:{const h=this.engine.getState(l.id),g=Array.isArray(h)?h.map(y=>this.getNumberValue(y)):[],v=this.getAggregateTypeValue(g,l.aggregateType);d=this.engine.getInstance(l.subTableId),f=Number(v);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(cy(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 Ct.MAX:return Math.max(...t);case Ct.MIN:return Math.min(...t);case Ct.SUM:return t.reduce((r,u)=>r+u);case Ct.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class fy{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))}}z.CalcPlugin=ly,z.ControlsEventPlugin=E5,z.ES6ModulePlugin=g5,z.Engine=Vr,z.LifecycleEventPlugin=y5,z.Plugin=v5,z.StylePlugin=fy,z.buildUUID=Jt,z.hasChildrenControl=En,z.loopDataViewControl=mt,z.loopFormControl=gt,z.parseModule=Ti,Object.defineProperty(z,"__esModule",{value:!0})});
|
|
22
|
+
**/var N3=2e3,P={s:1,n:0,d:1};function nt(e,t){if(isNaN(e=parseInt(e,10)))throw Rn();return e*t}function re(e,t){if(t===0)throw su();var n=Object.create(Ce.prototype);n.s=e<0?-1:1,e=e<0?-e:e;var r=Rt(e,t);return n.n=e/r,n.d=t/r,n}function Co(e){for(var t={},n=e,r=2,u=4;u<=n;){for(;n%r===0;)n/=r,t[r]=(t[r]||0)+1;u+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var Re=function(e,t){var n=0,r=1,u=1,i=0,o=0,a=0,s=1,c=1,l=0,f=1,d=1,h=1,g=1e7,v;if(e!=null)if(t!==void 0){if(n=e,r=t,u=n*r,n%1!==0||r%1!==0)throw R3()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)n=e.n,r=e.d,"s"in e&&(n*=e.s);else if(0 in e)n=e[0],1 in e&&(r=e[1]);else throw Rn();u=n*r;break}case"number":{if(e<0&&(u=e,e=-e),e%1===0)n=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);f<=g&&h<=g;)if(v=(l+d)/(f+h),e===v){f+h<=g?(n=l+d,r=f+h):h>f?(n=d,r=h):(n=l,r=f);break}else e>v?(l+=d,f+=h):(d+=l,h+=f),f>g?(n=d,r=h):(n=l,r=f);n*=c}else(isNaN(e)||isNaN(t))&&(r=n=NaN);break}case"string":{if(f=e.match(/\d+|./g),f===null)throw Rn();if(f[l]==="-"?(u=-1,l++):f[l]==="+"&&l++,f.length===l+1?o=nt(f[l++],u):f[l+1]==="."||f[l]==="."?(f[l]!=="."&&(i=nt(f[l++],u)),l++,(l+1===f.length||f[l+1]==="("&&f[l+3]===")"||f[l+1]==="'"&&f[l+3]==="'")&&(o=nt(f[l],u),s=Math.pow(10,f[l].length),l++),(f[l]==="("&&f[l+2]===")"||f[l]==="'"&&f[l+2]==="'")&&(a=nt(f[l+1],u),c=Math.pow(10,f[l+1].length)-1,l+=3)):f[l+1]==="/"||f[l+1]===":"?(o=nt(f[l],u),s=nt(f[l+2],1),l+=3):f[l+3]==="/"&&f[l+1]===" "&&(i=nt(f[l],u),o=nt(f[l+2],u),s=nt(f[l+4],1),l+=5),f.length<=l){r=s*c,u=n=a+r*i+c*o;break}}default:throw Rn()}if(r===0)throw su();P.s=u<0?-1:1,P.n=Math.abs(n),P.d=Math.abs(r)};function I3(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)t&1&&(r=r*e%n);return r}function x3(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(t===1)return 0;for(var n=10%t,r=1;n!==1;r++)if(n=n*10%t,r>N3)return 0;return r}function O3(e,t,n){for(var r=1,u=I3(10,n,t),i=0;i<300;i++){if(r===u)return i;r=r*10%t,u=u*10%t}return 0}function Rt(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Ce(e,t){if(Re(e,t),this instanceof Ce)e=Rt(P.d,P.n),this.s=P.s,this.n=P.n/e,this.d=P.d/e;else return re(P.s*P.n,P.d)}var su=function(){return new Error("Division by Zero")},Rn=function(){return new Error("Invalid argument")},R3=function(){return new Error("Parameters must be integer")};Ce.prototype={s:1,n:0,d:1,abs:function(){return re(this.n,this.d)},neg:function(){return re(-this.s*this.n,this.d)},add:function(e,t){return Re(e,t),re(this.s*this.n*P.d+P.s*this.d*P.n,this.d*P.d)},sub:function(e,t){return Re(e,t),re(this.s*this.n*P.d-P.s*this.d*P.n,this.d*P.d)},mul:function(e,t){return Re(e,t),re(this.s*P.s*this.n*P.n,this.d*P.d)},div:function(e,t){return Re(e,t),re(this.s*P.s*this.n*P.d,this.d*P.n)},clone:function(){return re(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Ce(NaN);if(e===void 0)return re(this.s*this.n%this.d,1);if(Re(e,t),P.n===0&&this.d===0)throw su();return re(this.s*(P.d*this.n)%(P.n*this.d),P.d*this.d)},gcd:function(e,t){return Re(e,t),re(Rt(P.n,this.n)*Rt(P.d,this.d),P.d*this.d)},lcm:function(e,t){return Re(e,t),P.n===0&&this.n===0?re(0,1):re(P.n*this.n,Rt(P.n,this.n)*Rt(P.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ce(NaN):re(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ce(NaN):re(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ce(NaN):re(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return Re(e,t),re(this.s*Math.round(this.n*P.d/(this.d*P.n))*P.n,P.d)},inverse:function(){return re(this.s*this.d,this.n)},pow:function(e,t){if(Re(e,t),P.d===1)return P.s<0?re(Math.pow(this.s*this.d,P.n),Math.pow(this.n,P.n)):re(Math.pow(this.s*this.n,P.n),Math.pow(this.d,P.n));if(this.s<0)return null;var n=Co(this.n),r=Co(this.d),u=1,i=1;for(var o in n)if(o!=="1"){if(o==="0"){u=0;break}if(n[o]*=P.n,n[o]%P.d===0)n[o]/=P.d;else return null;u*=Math.pow(o,n[o])}for(var o in r)if(o!=="1"){if(r[o]*=P.n,r[o]%P.d===0)r[o]/=P.d;else return null;i*=Math.pow(o,r[o])}return P.s<0?re(i,u):re(u,i)},equals:function(e,t){return Re(e,t),this.s*this.n*P.d===P.s*P.n*this.d},compare:function(e,t){Re(e,t);var n=this.s*this.n*P.d-P.s*P.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),r=1;r<n.length;r++){for(var u=re(n[r-1],1),i=r-2;i>=0;i--)u=u.inverse().add(n[i]);if(Math.abs(u.sub(t).valueOf())<e)return u.mul(this.s)}return this},divisible:function(e,t){return Re(e,t),!(!(P.n*this.d)||this.n*P.d%(P.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,u=this.d;return this.s<0&&(n+="-"),u===1?n+=r:(e&&(t=Math.floor(r/u))>0&&(n+=t,n+=" ",r%=u),n+=r,n+="/",n+=u),n},toLatex:function(e){var t,n="",r=this.n,u=this.d;return this.s<0&&(n+="-"),u===1?n+=r:(e&&(t=Math.floor(r/u))>0&&(n+=t,r%=u),n+="\\frac{",n+=r,n+="}{",n+=u,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do r.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(t!==1);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=x3(t,n),u=O3(t,n,r),i=this.s<0?"-":"";if(i+=t/n|0,t%=n,t*=10,t&&(i+="."),r){for(var o=u;o--;)i+=t/n|0,t%=n,t*=10;i+="(";for(var o=r;o--;)i+=t/n|0,t%=n,t*=10;i+=")"}else for(var o=e;t&&o--;)i+=t/n|0,t%=n,t*=10;return i}};var P3="Fraction",T3=[],L3=_e(P3,T3,()=>(Object.defineProperty(Ce,"name",{value:"Fraction"}),Ce.prototype.constructor=Ce,Ce.prototype.type="Fraction",Ce.prototype.isFraction=!0,Ce.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ce.fromJSON=function(e){return new Ce(e)},Ce),{isClass:!0}),j3="Matrix",k3=[],q3=_e(j3,k3,()=>{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 V3(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var U3="DenseMatrix",H3=["Matrix"],z3=_e(U3,H3,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&&!An(f))throw new Error("Invalid datatype: "+f);if(Qt(l))l.type==="DenseMatrix"?(this._data=yt(l._data),this._size=yt(l._size),this._datatype=f||l._datatype):(this._data=l.toArray(),this._size=l.size(),this._datatype=f||l._datatype);else if(l&&Oe(l.data)&&Oe(l.size))this._data=l.data,this._size=l.size,Qi(this._data,this._size),this._datatype=f||l.datatype;else if(Oe(l))this._data=c(l),this._size=Xr(this._data),Qi(this._data,this._size),this._datatype=f;else{if(l)throw new TypeError("Unsupported type of data ("+zr(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 Qr(this._data,zr)},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(!Oe(l))throw new TypeError("Array expected");if(l.length!==this._size.length)throw new ve(l.length,this._size.length);for(var f=0;f<l.length;f++)Te(l[f],this._size[f]);for(var d=this._data,h=0,g=l.length;h<g;h++){var v=l[h];Te(v,d.length),d=d[v]}return d},n.prototype.set=function(l,f,d){if(!Oe(l))throw new TypeError("Array expected");if(l.length<this._size.length)throw new ve(l.length,this._size.length,"<");var h,g,v,y=l.map(function(F){return F+1});s(this,y,d);var D=this._data;for(h=0,g=l.length-1;h<g;h++)v=l[h],Te(v,D.length),D=D[v];return v=l[l.length-1],Te(v,D.length),D[v]=f,this};function r(l,f){if(!Vi(f))throw new TypeError("Invalid index");var d=f.isScalar();if(d)return l.get(f.min());var h=f.size();if(h.length!==l._size.length)throw new ve(h.length,l._size.length);for(var g=f.min(),v=f.max(),y=0,D=l._size.length;y<D;y++)Te(g[y],l._size[y]),Te(v[y],l._size[y]);return new n(u(l._data,f,h.length,0),l._datatype)}function u(l,f,d,h){var g=h===d-1,v=f.dimension(h);return g?v.map(function(y){return Te(y,l.length),l[y]}).valueOf():v.map(function(y){Te(y,l.length);var D=l[y];return u(D,f,d,h+1)}).valueOf()}function i(l,f,d,h){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var g=f.size(),v=f.isScalar(),y;if(Qt(d)?(y=d.size(),d=d.valueOf()):y=Xr(d),v){if(y.length!==0)throw new TypeError("Scalar expected");l.set(f.min(),d,h)}else{if(g.length<l._size.length)throw new ve(g.length,l._size.length,"<");if(y.length<g.length){for(var D=0,F=0;g[D]===1&&y[D]===1;)D++;for(;g[D]===1;)F++,D++;d=hm(d,g.length,F,y)}if(!Wr(g,y))throw new ve(g,y,">");var S=f.max().map(function(I){return I+1});s(l,S,h);var _=g.length,$=0;o(l._data,f,d,_,$)}return l}function o(l,f,d,h,g){var v=g===h-1,y=f.dimension(g);v?y.forEach(function(D,F){Te(D),l[D]=d[F[0]]}):y.forEach(function(D,F){Te(D),o(l[D],f,d[F[0]],h,g+1)})}n.prototype.resize=function(l,f,d){if(!Hr(l))throw new TypeError("Array or Matrix expected");var h=l.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),g=d?this.clone():this;return a(g,h,f)};function a(l,f,d){if(f.length===0){for(var h=l._data;Oe(h);)h=h[0];return h}return l._size=f.slice(0),l._data=Yi(l._data,l._size,d),l}n.prototype.reshape=function(l,f){var d=f?this.clone():this;d._data=fm(d._data,l);var h=d._size.reduce((g,v)=>g*v);return d._size=eo(l,h),d};function s(l,f,d){for(var h=l._size.slice(0),g=!1;h.length<f.length;)h.push(0),g=!0;for(var v=0,y=f.length;v<y;v++)f[v]>h[v]&&(h[v]=f[v],g=!0);g&&a(l,h,d)}n.prototype.clone=function(){var l=new n({data:yt(this._data),size:yt(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=V3(l),h=function y(D,F){return Oe(D)?D.map(function(S,_){return y(S,F.concat(_))}):d===1?l(D):d===2?l(D,F):l(D,F,f)},g=h(this._data,[]),v=this._datatype!==void 0?Qr(g,zr):void 0;return new n(g,v)},n.prototype.forEach=function(l){var f=this,d=function h(g,v){Oe(g)?g.forEach(function(y,D){h(y,v.concat(D))}):l(g,v,f)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var l=function*f(d,h){if(Oe(d))for(var g=0;g<d.length;g++)yield*f(d[g],h.concat(g));else yield{value:d,index:h}};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 h of d)l.push(new n([h],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 h=this._data,g=function(D){var F=h.map(S=>[S[D]]);f.push(new n(F,l._datatype))},v=0;v<d[1];v++)g(v);return f},n.prototype.toArray=function(){return yt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(l){return Et(this._data,l)},n.prototype.toString=function(){return Et(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(lt(l)&&(l=l.toNumber()),!Ae(l)||!Ze(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,h=this._size[0],g=this._size[1],v=Math.min(h-d,g-f),y=[],D=0;D<v;D++)y[D]=this._data[D+d][D+f];return new n({data:y,size:[v],datatype:this._datatype})},n.diagonal=function(l,f,d,h){if(!Oe(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(R){if(lt(R)&&(R=R.toNumber()),!Ae(R)||!Ze(R)||R<1)throw new Error("Size values must be positive integers");return R}),d){if(lt(d)&&(d=d.toNumber()),!Ae(d)||!Ze(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var g=d>0?d:0,v=d<0?-d:0,y=l[0],D=l[1],F=Math.min(y-v,D-g),S;if(Oe(f)){if(f.length!==F)throw new Error("Invalid value array length");S=function(L){return f[L]}}else if(Qt(f)){var _=f.size();if(_.length!==1||_[0]!==F)throw new Error("Invalid matrix length");S=function(L){return f.get([L])}}else S=function(){return f};h||(h=lt(S(0))?S(0).mul(0):0);var $=[];if(l.length>0){$=Yi($,l,h);for(var I=0;I<F;I++)$[I+v][I+g]=S(I)}return new n({data:$,size:[y,D]})},n.fromJSON=function(l){return new n(l)},n.prototype.swapRows=function(l,f){if(!Ae(l)||!Ze(l)||!Ae(f)||!Ze(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 Te(l,this._size[0]),Te(f,this._size[0]),n._swapRows(l,f,this._data),this},n._swapRows=function(l,f,d){var h=d[l];d[l]=d[f],d[f]=h};function c(l){for(var f=0,d=l.length;f<d;f++){var h=l[f];Oe(h)?l[f]=c(h):h&&h.isMatrix===!0&&(l[f]=c(h.valueOf()))}return l}return n},{isClass:!0}),Fo="equalScalar";_e(Fo,["typed","config"],e=>{var{typed:t,config:n}=e;return t(Fo,{"number, number":function(u,i){return im(u,i,n.epsilon)}})});function en(e,t,n,r){if(!(this instanceof en))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}en.prototype=new Error,en.prototype.constructor=Error,en.prototype.name="ArgumentsError",en.prototype.isArgumentsError=!0;var Ao="format",W3=["typed"],Z3=_e(Ao,W3,e=>{var{typed:t}=e;return t(Ao,{any:Et,"any, Object | function | number":Et})}),Bo="bin",G3=["typed","format"];_e(Bo,G3,e=>{var{typed:t,format:n}=e;return t(Bo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var wo="oct",J3=["typed","format"];_e(wo,J3,e=>{var{typed:t,format:n}=e;return t(wo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var bo="hex",X3=["typed","format"];_e(bo,X3,e=>{var{typed:t,format:n}=e;return t(bo,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var _o="equal";_e(_o,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(_o,{"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 So="unequal";_e(So,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(So,{"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 Mo={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})(rt,e,!1)})(Mo);var $o={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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})($o);var No={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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(No);var Io={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this;s.next=function(){var l=s.x,f=s.i,d,h;return d=l[f],d^=d>>>7,h=d^d<<24,d=l[f+1&7],h^=d^d>>>10,d=l[f+3&7],h^=d^d>>>3,d=l[f+4&7],h^=d^d<<7,d=l[f+7&7],d=d^d<<13,h^=d^d<<9,l[f]=h,s.i=f+1&7,h};function c(l,f){var d,h=[];if(f===(f|0))h[0]=f;else for(f=""+f,d=0;d<f.length;++d)h[d&7]=h[d&7]<<15^f.charCodeAt(d)+h[d+1&7]<<13;for(;h.length<8;)h.push(0);for(d=0;d<8&&h[d]===0;++d);for(d==8?h[7]=-1:h[d],l.x=h,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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(Io);var xo={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,h,g;return s.w=l=l+1640531527|0,g=f[d+34&127],h=f[d=d+1&127],g^=g<<13,h^=h<<17,g^=g>>>15,h^=h>>>12,g=f[d]=g^h,s.i=d,g+(l^l>>>16)|0};function c(l,f){var d,h,g,v,y,D=[],F=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,F=Math.max(F,f.length)),g=0,v=-32;v<F;++v)f&&(h^=f.charCodeAt((v+32)%f.length)),v===0&&(y=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,v>=0&&(y=y+1640531527|0,d=D[v&127]^=h+y,g=d==0?g+1:0);for(g>=128&&(D[(f&&f.length||0)&127]=-1),g=127,v=4*128;v>0;--v)h=D[g+34&127],d=D[g=g+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,D[g]=h^d;l.w=y,l.X=D,l.i=g}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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(xo);var Oo={exports:{}};(function(e){(function(t,n,r){function u(a){var s=this,c="";s.next=function(){var f=s.b,d=s.c,h=s.d,g=s.a;return f=f<<25^f>>>7^d,d=d-h|0,h=h<<24^h>>>8^g,g=g-f|0,s.b=f=f<<20^f>>>12^d,s.c=d=d-h|0,s.d=h<<16^d>>>16^g,s.a=g-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,h=(c.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},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})(rt,e,!1)})(Oo);var Ro={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 h(_,$,I){var R=[];$=$==!0?{entropy:!0}:$||{};var L=D(y($.entropy?[_,S(n)]:_==null?F():_,3),R),Z=new g(R),G=function(){for(var J=Z.g(i),fe=s,oe=0;J<c;)J=(J+oe)*u,fe*=u,oe=Z.g(1);for(;J>=l;)J/=2,fe/=2,oe>>>=1;return(J+oe)/fe};return G.int32=function(){return Z.g(4)|0},G.quick=function(){return Z.g(4)/4294967296},G.double=G,D(S(Z.S),n),($.pass||I||function(J,fe,oe,ae){return ae&&(ae.S&&v(ae,Z),J.state=function(){return v(Z,{})}),oe?(r[a]=J,fe):J})(G,L,"global"in $?$.global:this==r,$.state)}function g(_){var $,I=_.length,R=this,L=0,Z=R.i=R.j=0,G=R.S=[];for(I||(_=[I++]);L<u;)G[L]=L++;for(L=0;L<u;L++)G[L]=G[Z=f&Z+_[L%I]+($=G[L])],G[Z]=$;(R.g=function(J){for(var fe,oe=0,ae=R.i,ue=R.j,U=R.S;J--;)fe=U[ae=f&ae+1],oe=oe*u+U[f&(U[ae]=U[ue=f&ue+fe])+(U[ue]=fe)];return R.i=ae,R.j=ue,oe})(u)}function v(_,$){return $.i=_.i,$.j=_.j,$.S=_.S.slice(),$}function y(_,$){var I=[],R=typeof _,L;if($&&R=="object")for(L in _)try{I.push(y(_[L],$-1))}catch(Z){}return I.length?I:R=="string"?_:_+"\0"}function D(_,$){for(var I=_+"",R,L=0;L<I.length;)$[f&L]=f&(R^=$[f&L]*19)+I.charCodeAt(L++);return S($)}function F(){try{var _;return d&&(_=d.randomBytes)?_=_(u):(_=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(_)),S(_)}catch(R){var $=t.navigator,I=$&&$.plugins;return[+new Date,t,I,t.screen,S(n)]}}function S(_){return String.fromCharCode.apply(0,_)}if(D(r.random(),n),e.exports){e.exports=h;try{d=kn.default}catch(_){}}else r["seed"+a]=h})(typeof self!="undefined"?self:rt,[],Math)})(Ro);var K3=Mo.exports,Q3=$o.exports,Y3=No.exports,ey=Io.exports,ty=xo.exports,ny=Oo.exports,Pt=Ro.exports;Pt.alea=K3,Pt.xor128=Q3,Pt.xorwow=Y3,Pt.xorshift7=ey,Pt.xor4096=ty,Pt.tychei=ny,Pn("fineStructure",.0072973525693),Pn("weakMixingAngle",.2229),Pn("efimovFactor",22.7),Pn("sackurTetrode",-1.16487052358);function Pn(e,t){var n=["config","BigNumber"];return _e(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var ry=B3({config:Ui}),uy=$3({}),iy=L3({}),oy=q3({}),ay=z3({Matrix:oy}),sy=_m({BigNumber:ry,Complex:uy,DenseMatrix:ay,Fraction:iy}),cy=Z3({typed:sy});class ly{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===te.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===je.VariableInMainTable||r.type===je.VariableInCurrentSubTable||r.type===je.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===je.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,te.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)===te.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===je.Operator||l.type===je.Number)return c+l.name;let f=0,d;switch(l.type){case je.VariableInMainTable:{const h=this.getNumberValue(this.engine.getState(l.id));d=this.engine.getInstance(l.id),f=Number(h);break}case je.VariableInCurrentSubTable:{d=this.engine.getInstance(l.id,r);const h=this.engine.getState(l.id,r),g=this.getNumberValue(h);f=Number(g);break}case je.VariableInOtherSubTable:{const h=this.engine.getState(l.id),g=Array.isArray(h)?h.map(y=>this.getNumberValue(y)):[],v=this.getAggregateTypeValue(g,l.aggregateType);d=this.engine.getInstance(l.subTableId),f=Number(v);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(cy(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 Ct.MAX:return Math.max(...t);case Ct.MIN:return Math.min(...t);case Ct.SUM:return t.reduce((r,u)=>r+u);case Ct.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class fy{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))}}z.CalcPlugin=ly,z.ControlsEventPlugin=E5,z.ES6ModulePlugin=g5,z.Engine=Vr,z.LifecycleEventPlugin=y5,z.Plugin=v5,z.StylePlugin=fy,z.buildUUID=Jt,z.hasChildrenControl=En,z.loopDataViewControl=mt,z.loopFormControl=gt,z.parseModule=Ti,Object.defineProperty(z,"__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.0-beta.
|
|
3
|
+
"version": "2.23.0-beta.17",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"postpublish": "node ../../scripts/postpublish.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@byteluck-fe/model-driven-core": "2.23.0-beta.
|
|
30
|
-
"@byteluck-fe/model-driven-shared": "2.23.0-beta.
|
|
29
|
+
"@byteluck-fe/model-driven-core": "2.23.0-beta.17",
|
|
30
|
+
"@byteluck-fe/model-driven-shared": "2.23.0-beta.17",
|
|
31
31
|
"@types/mathjs": "^9.4.2",
|
|
32
32
|
"mathjs": "^11.3.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "~18.0.6"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "8990d6ba4aa29fa8f9ceb535eb231bde1cc643b9"
|
|
38
38
|
}
|