@byteluck-fe/model-driven-engine 2.22.0-beta.4 → 2.22.0-beta.6

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.
@@ -39,10 +39,13 @@ function _define_property(obj, key, value) {
39
39
  export var StylePlugin = /*#__PURE__*/ function() {
40
40
  "use strict";
41
41
  function StylePlugin(config) {
42
+ var isPC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
42
43
  _class_call_check(this, StylePlugin);
43
44
  _define_property(this, "config", void 0);
44
45
  _define_property(this, "engine", void 0);
46
+ _define_property(this, "isPc", void 0);
45
47
  this.config = config;
48
+ this.isPc = isPC;
46
49
  }
47
50
  _create_class(StylePlugin, [
48
51
  {
@@ -55,8 +58,11 @@ export var StylePlugin = /*#__PURE__*/ function() {
55
58
  var style = document.createElement("style");
56
59
  style.className = "edit-css-" + engine.id;
57
60
  style.type = "text/css";
58
- // style.innerHTML = compiledStyle
59
- style.innerHTML = "[data-engine-id='".concat(engine.id, "']{ ").concat(compiledStyle, " }");
61
+ if (this.isPc) {
62
+ style.innerHTML = "[data-engine-id='".concat(engine.id, "']{ ").concat(compiledStyle, " }");
63
+ } else {
64
+ style.innerHTML = compiledStyle;
65
+ }
60
66
  var dom = document.querySelector("head");
61
67
  dom.appendChild(style);
62
68
  }
package/dist/index.umd.js CHANGED
@@ -24,4 +24,4 @@ Example:
24
24
  *
25
25
  * Copyright (c) 2023, Robert Eisele (robert@raw.org)
26
26
  * Dual licensed under the MIT or GPL Version 2 licenses.
27
- **/var vD=2e3,$={s:1,n:0,d:1};function rt(e,t){if(isNaN(e=parseInt(e,10)))throw jn();return e*t}function te(e,t){if(t===0)throw ou();var n=Object.create(Ee.prototype);n.s=e<0?-1:1,e=e<0?-e:e;var r=Pt(e,t);return n.n=e/r,n.d=t/r,n}function Do(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 Pe=function(e,t){var n=0,r=1,u=1,i=0,o=0,s=0,l=1,f=1,c=0,a=1,d=1,h=1,p=1e7,g;if(e!=null)if(t!==void 0){if(n=e,r=t,u=n*r,n%1!==0||r%1!==0)throw AD()}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 jn();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&&(f=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=f);a<=p&&h<=p;)if(g=(c+d)/(a+h),e===g){a+h<=p?(n=c+d,r=a+h):h>a?(n=d,r=h):(n=c,r=a);break}else e>g?(c+=d,a+=h):(d+=c,h+=a),a>p?(n=d,r=h):(n=c,r=a);n*=f}else(isNaN(e)||isNaN(t))&&(r=n=NaN);break}case"string":{if(a=e.match(/\d+|./g),a===null)throw jn();if(a[c]==="-"?(u=-1,c++):a[c]==="+"&&c++,a.length===c+1?o=rt(a[c++],u):a[c+1]==="."||a[c]==="."?(a[c]!=="."&&(i=rt(a[c++],u)),c++,(c+1===a.length||a[c+1]==="("&&a[c+3]===")"||a[c+1]==="'"&&a[c+3]==="'")&&(o=rt(a[c],u),l=Math.pow(10,a[c].length),c++),(a[c]==="("&&a[c+2]===")"||a[c]==="'"&&a[c+2]==="'")&&(s=rt(a[c+1],u),f=Math.pow(10,a[c+1].length)-1,c+=3)):a[c+1]==="/"||a[c+1]===":"?(o=rt(a[c],u),l=rt(a[c+2],1),c+=3):a[c+3]==="/"&&a[c+1]===" "&&(i=rt(a[c],u),o=rt(a[c+2],u),l=rt(a[c+4],1),c+=5),a.length<=c){r=l*f,u=n=s+r*i+f*o;break}}default:throw jn()}if(r===0)throw ou();$.s=u<0?-1:1,$.n=Math.abs(n),$.d=Math.abs(r)};function yD(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)t&1&&(r=r*e%n);return r}function mD(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>vD)return 0;return r}function ED(e,t,n){for(var r=1,u=yD(10,n,t),i=0;i<300;i++){if(r===u)return i;r=r*10%t,u=u*10%t}return 0}function Pt(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Ee(e,t){if(Pe(e,t),this instanceof Ee)e=Pt($.d,$.n),this.s=$.s,this.n=$.n/e,this.d=$.d/e;else return te($.s*$.n,$.d)}var ou=function(){return new Error("Division by Zero")},jn=function(){return new Error("Invalid argument")},AD=function(){return new Error("Parameters must be integer")};Ee.prototype={s:1,n:0,d:1,abs:function(){return te(this.n,this.d)},neg:function(){return te(-this.s*this.n,this.d)},add:function(e,t){return Pe(e,t),te(this.s*this.n*$.d+$.s*this.d*$.n,this.d*$.d)},sub:function(e,t){return Pe(e,t),te(this.s*this.n*$.d-$.s*this.d*$.n,this.d*$.d)},mul:function(e,t){return Pe(e,t),te(this.s*$.s*this.n*$.n,this.d*$.d)},div:function(e,t){return Pe(e,t),te(this.s*$.s*this.n*$.d,this.d*$.n)},clone:function(){return te(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Ee(NaN);if(e===void 0)return te(this.s*this.n%this.d,1);if(Pe(e,t),$.n===0&&this.d===0)throw ou();return te(this.s*($.d*this.n)%($.n*this.d),$.d*this.d)},gcd:function(e,t){return Pe(e,t),te(Pt($.n,this.n)*Pt($.d,this.d),$.d*this.d)},lcm:function(e,t){return Pe(e,t),$.n===0&&this.n===0?te(0,1):te($.n*this.n,Pt($.n,this.n)*Pt($.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ee(NaN):te(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 Ee(NaN):te(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 Ee(NaN):te(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return Pe(e,t),te(this.s*Math.round(this.n*$.d/(this.d*$.n))*$.n,$.d)},inverse:function(){return te(this.s*this.d,this.n)},pow:function(e,t){if(Pe(e,t),$.d===1)return $.s<0?te(Math.pow(this.s*this.d,$.n),Math.pow(this.n,$.n)):te(Math.pow(this.s*this.n,$.n),Math.pow(this.d,$.n));if(this.s<0)return null;var n=Do(this.n),r=Do(this.d),u=1,i=1;for(var o in n)if(o!=="1"){if(o==="0"){u=0;break}if(n[o]*=$.n,n[o]%$.d===0)n[o]/=$.d;else return null;u*=Math.pow(o,n[o])}for(var o in r)if(o!=="1"){if(r[o]*=$.n,r[o]%$.d===0)r[o]/=$.d;else return null;i*=Math.pow(o,r[o])}return $.s<0?te(i,u):te(u,i)},equals:function(e,t){return Pe(e,t),this.s*this.n*$.d===$.s*$.n*this.d},compare:function(e,t){Pe(e,t);var n=this.s*this.n*$.d-$.s*$.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=te(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 Pe(e,t),!(!($.n*this.d)||this.n*$.d%($.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=mD(t,n),u=ED(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 CD="Fraction",FD=[],wD=_e(CD,FD,()=>(Object.defineProperty(Ee,"name",{value:"Fraction"}),Ee.prototype.constructor=Ee,Ee.prototype.type="Fraction",Ee.prototype.isFraction=!0,Ee.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ee.fromJSON=function(e){return new Ee(e)},Ee),{isClass:!0}),bD="Matrix",BD=[],_D=_e(bD,BD,()=>{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 SD(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var MD="DenseMatrix",ID=["Matrix"],ND=_e(MD,ID,e=>{var{Matrix:t}=e;function n(c,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Bn(a))throw new Error("Invalid datatype: "+a);if(Yt(c))c.type==="DenseMatrix"?(this._data=At(c._data),this._size=At(c._size),this._datatype=a||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=a||c._datatype);else if(c&&$e(c.data)&&$e(c.size))this._data=c.data,this._size=c.size,zi(this._data,this._size),this._datatype=a||c.datatype;else if($e(c))this._data=f(c),this._size=Gr(this._data),zi(this._data,this._size),this._datatype=a;else{if(c)throw new TypeError("Unsupported type of data ("+Hr(c)+")");this._data=[],this._size=[0],this._datatype=a}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,a){return new n(c,a)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Kr(this._data,Hr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,a){return new n(c,a)},n.prototype.subset=function(c,a,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return i(this,c,a,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!$e(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new De(c.length,this._size.length);for(var a=0;a<c.length;a++)je(c[a],this._size[a]);for(var d=this._data,h=0,p=c.length;h<p;h++){var g=c[h];je(g,d.length),d=d[g]}return d},n.prototype.set=function(c,a,d){if(!$e(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new De(c.length,this._size.length,"<");var h,p,g,m=c.map(function(A){return A+1});l(this,m,d);var D=this._data;for(h=0,p=c.length-1;h<p;h++)g=c[h],je(g,D.length),D=D[g];return g=c[c.length-1],je(g,D.length),D[g]=a,this};function r(c,a){if(!$i(a))throw new TypeError("Invalid index");var d=a.isScalar();if(d)return c.get(a.min());var h=a.size();if(h.length!==c._size.length)throw new De(h.length,c._size.length);for(var p=a.min(),g=a.max(),m=0,D=c._size.length;m<D;m++)je(p[m],c._size[m]),je(g[m],c._size[m]);return new n(u(c._data,a,h.length,0),c._datatype)}function u(c,a,d,h){var p=h===d-1,g=a.dimension(h);return p?g.map(function(m){return je(m,c.length),c[m]}).valueOf():g.map(function(m){je(m,c.length);var D=c[m];return u(D,a,d,h+1)}).valueOf()}function i(c,a,d,h){if(!a||a.isIndex!==!0)throw new TypeError("Invalid index");var p=a.size(),g=a.isScalar(),m;if(Yt(d)?(m=d.size(),d=d.valueOf()):m=Gr(d),g){if(m.length!==0)throw new TypeError("Scalar expected");c.set(a.min(),d,h)}else{if(p.length<c._size.length)throw new De(p.length,c._size.length,"<");if(m.length<p.length){for(var D=0,A=0;p[D]===1&&m[D]===1;)D++;for(;p[D]===1;)A++,D++;d=np(d,p.length,A,m)}if(!zr(p,m))throw new De(p,m,">");var _=a.max().map(function(N){return N+1});l(c,_,h);var B=p.length,I=0;o(c._data,a,d,B,I)}return c}function o(c,a,d,h,p){var g=p===h-1,m=a.dimension(p);g?m.forEach(function(D,A){je(D),c[D]=d[A[0]]}):m.forEach(function(D,A){je(D),o(c[D],a,d[A[0]],h,p+1)})}n.prototype.resize=function(c,a,d){if(!Vr(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),p=d?this.clone():this;return s(p,h,a)};function s(c,a,d){if(a.length===0){for(var h=c._data;$e(h);)h=h[0];return h}return c._size=a.slice(0),c._data=Wi(c._data,c._size,d),c}n.prototype.reshape=function(c,a){var d=a?this.clone():this;d._data=ep(d._data,c);var h=d._size.reduce((p,g)=>p*g);return d._size=Zi(c,h),d};function l(c,a,d){for(var h=c._size.slice(0),p=!1;h.length<a.length;)h.push(0),p=!0;for(var g=0,m=a.length;g<m;g++)a[g]>h[g]&&(h[g]=a[g],p=!0);p&&s(c,h,d)}n.prototype.clone=function(){var c=new n({data:At(this._data),size:At(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var a=this,d=SD(c),h=function m(D,A){return $e(D)?D.map(function(_,B){return m(_,A.concat(B))}):d===1?c(D):d===2?c(D,A):c(D,A,a)},p=h(this._data,[]),g=this._datatype!==void 0?Kr(p,Hr):void 0;return new n(p,g)},n.prototype.forEach=function(c){var a=this,d=function h(p,g){$e(p)?p.forEach(function(m,D){h(m,g.concat(D))}):c(p,g,a)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*a(d,h){if($e(d))for(var p=0;p<d.length;p++)yield*a(d[p],h.concat(p));else yield{value:d,index:h}};yield*c(this._data,[])},n.prototype.rows=function(){var c=[],a=this.size();if(a.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)c.push(new n([h],this._datatype));return c},n.prototype.columns=function(){var c=this,a=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,p=function(D){var A=h.map(_=>[_[D]]);a.push(new n(A,c._datatype))},g=0;g<d[1];g++)p(g);return a},n.prototype.toArray=function(){return At(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return Ct(this._data,c)},n.prototype.toString=function(){return Ct(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(ft(c)&&(c=c.toNumber()),!Ce(c)||!Ze(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var a=c>0?c:0,d=c<0?-c:0,h=this._size[0],p=this._size[1],g=Math.min(h-d,p-a),m=[],D=0;D<g;D++)m[D]=this._data[D+d][D+a];return new n({data:m,size:[g],datatype:this._datatype})},n.diagonal=function(c,a,d,h){if(!$e(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(R){if(ft(R)&&(R=R.toNumber()),!Ce(R)||!Ze(R)||R<1)throw new Error("Size values must be positive integers");return R}),d){if(ft(d)&&(d=d.toNumber()),!Ce(d)||!Ze(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var p=d>0?d:0,g=d<0?-d:0,m=c[0],D=c[1],A=Math.min(m-g,D-p),_;if($e(a)){if(a.length!==A)throw new Error("Invalid value array length");_=function(j){return a[j]}}else if(Yt(a)){var B=a.size();if(B.length!==1||B[0]!==A)throw new Error("Invalid matrix length");_=function(j){return a.get([j])}}else _=function(){return a};h||(h=ft(_(0))?_(0).mul(0):0);var I=[];if(c.length>0){I=Wi(I,c,h);for(var N=0;N<A;N++)I[N+g][N+p]=_(N)}return new n({data:I,size:[m,D]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,a){if(!Ce(c)||!Ze(c)||!Ce(a)||!Ze(a))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return je(c,this._size[0]),je(a,this._size[0]),n._swapRows(c,a,this._data),this},n._swapRows=function(c,a,d){var h=d[c];d[c]=d[a],d[a]=h};function f(c){for(var a=0,d=c.length;a<d;a++){var h=c[a];$e(h)?c[a]=f(h):h&&h.isMatrix===!0&&(c[a]=f(h.valueOf()))}return c}return n},{isClass:!0}),go="equalScalar";_e(go,["typed","config"],e=>{var{typed:t,config:n}=e;return t(go,{"number, number":function(u,i){return Jh(u,i,n.epsilon)}})});function tn(e,t,n,r){if(!(this instanceof tn))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}tn.prototype=new Error,tn.prototype.constructor=Error,tn.prototype.name="ArgumentsError",tn.prototype.isArgumentsError=!0;var vo="format",OD=["typed"],xD=_e(vo,OD,e=>{var{typed:t}=e;return t(vo,{any:Ct,"any, Object | function | number":Ct})}),yo="bin",RD=["typed","format"];_e(yo,RD,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 mo="oct",$D=["typed","format"];_e(mo,$D,e=>{var{typed:t,format:n}=e;return t(mo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var Eo="hex",PD=["typed","format"];_e(Eo,PD,e=>{var{typed:t,format:n}=e;return t(Eo,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Ao="equal";_e(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 Co="unequal";_e(Co,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Co,{"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 Fo={exports:{}};(function(e){(function(t,n,r){function u(l){var f=this,c=s();f.next=function(){var a=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=a-(f.c=a|0)},f.c=1,f.s0=c(" "),f.s1=c(" "),f.s2=c(" "),f.s0-=c(l),f.s0<0&&(f.s0+=1),f.s1-=c(l),f.s1<0&&(f.s1+=1),f.s2-=c(l),f.s2<0&&(f.s2+=1),c=null}function i(l,f){return f.c=l.c,f.s0=l.s0,f.s1=l.s1,f.s2=l.s2,f}function o(l,f){var c=new u(l),a=f&&f.state,d=c.next;return d.int32=function(){return c.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,a&&(typeof a=="object"&&i(a,c),d.state=function(){return i(c,{})}),d}function s(){var l=4022871197,f=function(c){c=String(c);for(var a=0;a<c.length;a++){l+=c.charCodeAt(a);var d=.02519603282416938*l;l=d>>>0,d-=l,d*=l,l=d>>>0,d-=l,l+=d*4294967296}return(l>>>0)*23283064365386963e-26};return f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(ut,e,!1)})(Fo);var wo={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this,f="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var a=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^a^a>>>8},s===(s|0)?l.x=s:f+=s;for(var c=0;c<f.length+64;c++)l.x^=f.charCodeAt(c)|0,l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l}function o(s,l){var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(typeof c=="object"&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(ut,e,!1)})(wo);var bo={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this,f="";l.next=function(){var a=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(a^a<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,s===(s|0)?l.x=s:f+=s;for(var c=0;c<f.length+64;c++)l.x^=f.charCodeAt(c)|0,c==f.length&&(l.d=l.x<<10^l.x>>>4),l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l.v=s.v,l.d=s.d,l}function o(s,l){var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(typeof c=="object"&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(ut,e,!1)})(bo);var Bo={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this;l.next=function(){var c=l.x,a=l.i,d,h;return d=c[a],d^=d>>>7,h=d^d<<24,d=c[a+1&7],h^=d^d>>>10,d=c[a+3&7],h^=d^d>>>3,d=c[a+4&7],h^=d^d<<7,d=c[a+7&7],d=d^d<<13,h^=d^d<<9,c[a]=h,l.i=a+1&7,h};function f(c,a){var d,h=[];if(a===(a|0))h[0]=a;else for(a=""+a,d=0;d<a.length;++d)h[d&7]=h[d&7]<<15^a.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],c.x=h,c.i=0,d=256;d>0;--d)c.next()}f(l,s)}function i(s,l){return l.x=s.x.slice(),l.i=s.i,l}function o(s,l){s==null&&(s=+new Date);var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(c.x&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(ut,e,!1)})(Bo);var _o={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this;l.next=function(){var c=l.w,a=l.X,d=l.i,h,p;return l.w=c=c+1640531527|0,p=a[d+34&127],h=a[d=d+1&127],p^=p<<13,h^=h<<17,p^=p>>>15,h^=h>>>12,p=a[d]=p^h,l.i=d,p+(c^c>>>16)|0};function f(c,a){var d,h,p,g,m,D=[],A=128;for(a===(a|0)?(h=a,a=null):(a=a+"\0",h=0,A=Math.max(A,a.length)),p=0,g=-32;g<A;++g)a&&(h^=a.charCodeAt((g+32)%a.length)),g===0&&(m=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,g>=0&&(m=m+1640531527|0,d=D[g&127]^=h+m,p=d==0?p+1:0);for(p>=128&&(D[(a&&a.length||0)&127]=-1),p=127,g=4*128;g>0;--g)h=D[p+34&127],d=D[p=p+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,D[p]=h^d;c.w=m,c.X=D,c.i=p}f(l,s)}function i(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function o(s,l){s==null&&(s=+new Date);var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(c.X&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(ut,e,!1)})(_o);var So={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this,f="";l.next=function(){var a=l.b,d=l.c,h=l.d,p=l.a;return a=a<<25^a>>>7^d,d=d-h|0,h=h<<24^h>>>8^p,p=p-a|0,l.b=a=a<<20^a>>>12^d,l.c=d=d-h|0,l.d=h<<16^d>>>16^p,l.a=p-a|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,s===Math.floor(s)?(l.a=s/4294967296|0,l.b=s|0):f+=s;for(var c=0;c<f.length+20;c++)l.b^=f.charCodeAt(c)|0,l.next()}function i(s,l){return l.a=s.a,l.b=s.b,l.c=s.c,l.d=s.d,l}function o(s,l){var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(typeof c=="object"&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(ut,e,!1)})(So);var Mo={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,s="random",l=r.pow(u,i),f=r.pow(2,o),c=f*2,a=u-1,d;function h(B,I,N){var R=[];I=I==!0?{entropy:!0}:I||{};var j=D(m(I.entropy?[B,_(n)]:B==null?A():B,3),R),J=new p(R),K=function(){for(var z=J.g(i),ce=l,ue=0;z<f;)z=(z+ue)*u,ce*=u,ue=J.g(1);for(;z>=c;)z/=2,ce/=2,ue>>>=1;return(z+ue)/ce};return K.int32=function(){return J.g(4)|0},K.quick=function(){return J.g(4)/4294967296},K.double=K,D(_(J.S),n),(I.pass||N||function(z,ce,ue,ie){return ie&&(ie.S&&g(ie,J),z.state=function(){return g(J,{})}),ue?(r[s]=z,ce):z})(K,j,"global"in I?I.global:this==r,I.state)}function p(B){var I,N=B.length,R=this,j=0,J=R.i=R.j=0,K=R.S=[];for(N||(B=[N++]);j<u;)K[j]=j++;for(j=0;j<u;j++)K[j]=K[J=a&J+B[j%N]+(I=K[j])],K[J]=I;(R.g=function(z){for(var ce,ue=0,ie=R.i,ne=R.j,q=R.S;z--;)ce=q[ie=a&ie+1],ue=ue*u+q[a&(q[ie]=q[ne=a&ne+ce])+(q[ne]=ce)];return R.i=ie,R.j=ne,ue})(u)}function g(B,I){return I.i=B.i,I.j=B.j,I.S=B.S.slice(),I}function m(B,I){var N=[],R=typeof B,j;if(I&&R=="object")for(j in B)try{N.push(m(B[j],I-1))}catch(J){}return N.length?N:R=="string"?B:B+"\0"}function D(B,I){for(var N=B+"",R,j=0;j<N.length;)I[a&j]=a&(R^=I[a&j]*19)+N.charCodeAt(j++);return _(I)}function A(){try{var B;return d&&(B=d.randomBytes)?B=B(u):(B=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(B)),_(B)}catch(R){var I=t.navigator,N=I&&I.plugins;return[+new Date,t,N,t.screen,_(n)]}}function _(B){return String.fromCharCode.apply(0,B)}if(D(r.random(),n),e.exports){e.exports=h;try{d=Vn.default}catch(B){}}else r["seed"+s]=h})(typeof self!="undefined"?self:ut,[],Math)})(Mo);var TD=Fo.exports,jD=wo.exports,LD=bo.exports,kD=Bo.exports,qD=_o.exports,UD=So.exports,Tt=Mo.exports;Tt.alea=TD,Tt.xor128=jD,Tt.xorwow=LD,Tt.xorshift7=kD,Tt.xor4096=qD,Tt.tychei=UD,Ln("fineStructure",.0072973525693),Ln("weakMixingAngle",.2229),Ln("efimovFactor",22.7),Ln("sackurTetrode",-1.16487052358);function Ln(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 VD=hD({config:Pi}),HD=gD({}),zD=wD({}),WD=_D({}),ZD=ND({Matrix:WD}),JD=gp({BigNumber:VD,Complex:HD,DenseMatrix:ZD,Fraction:zD}),GD=xD({typed:JD});class XD{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===Y.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===Le.VariableInMainTable||r.type===Le.VariableInCurrentSubTable||r.type===Le.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===Le.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,Y.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,s;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(l=>{this.computedCalcValue(l)}),((s=this.dependenciesTriggerMap.get(t.instance.id))!=null?s:[]).forEach(l=>{this.computedCalcValue(l)})})}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)===Y.SUBTABLE_COLUMN}computedCalcValue(t){var l;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((f,c)=>{if(c.type===Le.Operator||c.type===Le.Number)return f+c.name;let a=0,d;switch(c.type){case Le.VariableInMainTable:{const h=this.getNumberValue(this.engine.getState(c.id));d=this.engine.getInstance(c.id),a=Number(h);break}case Le.VariableInCurrentSubTable:{d=this.engine.getInstance(c.id,r);const h=this.engine.getState(c.id,r),p=this.getNumberValue(h);a=Number(p);break}case Le.VariableInOtherSubTable:{const h=this.engine.getState(c.id),p=Array.isArray(h)?h.map(m=>this.getNumberValue(m)):[],g=this.getAggregateTypeValue(p,c.aggregateType);d=this.engine.getInstance(c.subTableId),a=Number(g);break}}return!Number.isNaN(a)&&this.controlNeedComputedValue(d)?f+=`(${a})`:f+=0,f},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(GD(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),s=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));s!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:s,unit:(l=o==null?void 0:o.unit)!=null?l:""},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 Ft.MAX:return Math.max(...t);case Ft.MIN:return Math.min(...t);case Ft.SUM:return t.reduce((r,u)=>r+u);case Ft.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class KD{constructor(t){this.config=t}apply(t){var i,o;this.engine=t;const n=(o=(i=this.config)==null?void 0:i.source)!=null?o:"";let r=document.createElement("style");r.className="edit-css-"+t.id,r.type="text/css",r.innerHTML=`[data-engine-id='${t.id}']{ ${n} }`,document.querySelector("head").appendChild(r)}}U.CalcPlugin=XD,U.ControlsEventPlugin=ch,U.ES6ModulePlugin=oh,U.Engine=qr,U.LifecycleEventPlugin=sh,U.Plugin=ih,U.StylePlugin=KD,U.buildUUID=Xt,U.hasChildrenControl=Cn,U.loopDataViewControl=Et,U.loopFormControl=mt,U.parseModule=Ii,Object.defineProperty(U,"__esModule",{value:!0})});
27
+ **/var vD=2e3,$={s:1,n:0,d:1};function rt(e,t){if(isNaN(e=parseInt(e,10)))throw jn();return e*t}function te(e,t){if(t===0)throw ou();var n=Object.create(Ee.prototype);n.s=e<0?-1:1,e=e<0?-e:e;var r=Pt(e,t);return n.n=e/r,n.d=t/r,n}function Do(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 Pe=function(e,t){var n=0,r=1,u=1,i=0,o=0,s=0,l=1,f=1,c=0,a=1,d=1,h=1,p=1e7,g;if(e!=null)if(t!==void 0){if(n=e,r=t,u=n*r,n%1!==0||r%1!==0)throw AD()}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 jn();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&&(f=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=f);a<=p&&h<=p;)if(g=(c+d)/(a+h),e===g){a+h<=p?(n=c+d,r=a+h):h>a?(n=d,r=h):(n=c,r=a);break}else e>g?(c+=d,a+=h):(d+=c,h+=a),a>p?(n=d,r=h):(n=c,r=a);n*=f}else(isNaN(e)||isNaN(t))&&(r=n=NaN);break}case"string":{if(a=e.match(/\d+|./g),a===null)throw jn();if(a[c]==="-"?(u=-1,c++):a[c]==="+"&&c++,a.length===c+1?o=rt(a[c++],u):a[c+1]==="."||a[c]==="."?(a[c]!=="."&&(i=rt(a[c++],u)),c++,(c+1===a.length||a[c+1]==="("&&a[c+3]===")"||a[c+1]==="'"&&a[c+3]==="'")&&(o=rt(a[c],u),l=Math.pow(10,a[c].length),c++),(a[c]==="("&&a[c+2]===")"||a[c]==="'"&&a[c+2]==="'")&&(s=rt(a[c+1],u),f=Math.pow(10,a[c+1].length)-1,c+=3)):a[c+1]==="/"||a[c+1]===":"?(o=rt(a[c],u),l=rt(a[c+2],1),c+=3):a[c+3]==="/"&&a[c+1]===" "&&(i=rt(a[c],u),o=rt(a[c+2],u),l=rt(a[c+4],1),c+=5),a.length<=c){r=l*f,u=n=s+r*i+f*o;break}}default:throw jn()}if(r===0)throw ou();$.s=u<0?-1:1,$.n=Math.abs(n),$.d=Math.abs(r)};function yD(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)t&1&&(r=r*e%n);return r}function mD(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>vD)return 0;return r}function ED(e,t,n){for(var r=1,u=yD(10,n,t),i=0;i<300;i++){if(r===u)return i;r=r*10%t,u=u*10%t}return 0}function Pt(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Ee(e,t){if(Pe(e,t),this instanceof Ee)e=Pt($.d,$.n),this.s=$.s,this.n=$.n/e,this.d=$.d/e;else return te($.s*$.n,$.d)}var ou=function(){return new Error("Division by Zero")},jn=function(){return new Error("Invalid argument")},AD=function(){return new Error("Parameters must be integer")};Ee.prototype={s:1,n:0,d:1,abs:function(){return te(this.n,this.d)},neg:function(){return te(-this.s*this.n,this.d)},add:function(e,t){return Pe(e,t),te(this.s*this.n*$.d+$.s*this.d*$.n,this.d*$.d)},sub:function(e,t){return Pe(e,t),te(this.s*this.n*$.d-$.s*this.d*$.n,this.d*$.d)},mul:function(e,t){return Pe(e,t),te(this.s*$.s*this.n*$.n,this.d*$.d)},div:function(e,t){return Pe(e,t),te(this.s*$.s*this.n*$.d,this.d*$.n)},clone:function(){return te(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Ee(NaN);if(e===void 0)return te(this.s*this.n%this.d,1);if(Pe(e,t),$.n===0&&this.d===0)throw ou();return te(this.s*($.d*this.n)%($.n*this.d),$.d*this.d)},gcd:function(e,t){return Pe(e,t),te(Pt($.n,this.n)*Pt($.d,this.d),$.d*this.d)},lcm:function(e,t){return Pe(e,t),$.n===0&&this.n===0?te(0,1):te($.n*this.n,Pt($.n,this.n)*Pt($.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ee(NaN):te(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 Ee(NaN):te(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 Ee(NaN):te(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return Pe(e,t),te(this.s*Math.round(this.n*$.d/(this.d*$.n))*$.n,$.d)},inverse:function(){return te(this.s*this.d,this.n)},pow:function(e,t){if(Pe(e,t),$.d===1)return $.s<0?te(Math.pow(this.s*this.d,$.n),Math.pow(this.n,$.n)):te(Math.pow(this.s*this.n,$.n),Math.pow(this.d,$.n));if(this.s<0)return null;var n=Do(this.n),r=Do(this.d),u=1,i=1;for(var o in n)if(o!=="1"){if(o==="0"){u=0;break}if(n[o]*=$.n,n[o]%$.d===0)n[o]/=$.d;else return null;u*=Math.pow(o,n[o])}for(var o in r)if(o!=="1"){if(r[o]*=$.n,r[o]%$.d===0)r[o]/=$.d;else return null;i*=Math.pow(o,r[o])}return $.s<0?te(i,u):te(u,i)},equals:function(e,t){return Pe(e,t),this.s*this.n*$.d===$.s*$.n*this.d},compare:function(e,t){Pe(e,t);var n=this.s*this.n*$.d-$.s*$.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=te(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 Pe(e,t),!(!($.n*this.d)||this.n*$.d%($.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=mD(t,n),u=ED(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 CD="Fraction",FD=[],wD=_e(CD,FD,()=>(Object.defineProperty(Ee,"name",{value:"Fraction"}),Ee.prototype.constructor=Ee,Ee.prototype.type="Fraction",Ee.prototype.isFraction=!0,Ee.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ee.fromJSON=function(e){return new Ee(e)},Ee),{isClass:!0}),bD="Matrix",BD=[],_D=_e(bD,BD,()=>{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 SD(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var MD="DenseMatrix",ID=["Matrix"],ND=_e(MD,ID,e=>{var{Matrix:t}=e;function n(c,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Bn(a))throw new Error("Invalid datatype: "+a);if(Yt(c))c.type==="DenseMatrix"?(this._data=At(c._data),this._size=At(c._size),this._datatype=a||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=a||c._datatype);else if(c&&$e(c.data)&&$e(c.size))this._data=c.data,this._size=c.size,zi(this._data,this._size),this._datatype=a||c.datatype;else if($e(c))this._data=f(c),this._size=Gr(this._data),zi(this._data,this._size),this._datatype=a;else{if(c)throw new TypeError("Unsupported type of data ("+Hr(c)+")");this._data=[],this._size=[0],this._datatype=a}}n.prototype=new t,n.prototype.createDenseMatrix=function(c,a){return new n(c,a)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Kr(this._data,Hr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,a){return new n(c,a)},n.prototype.subset=function(c,a,d){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return i(this,c,a,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!$e(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new De(c.length,this._size.length);for(var a=0;a<c.length;a++)je(c[a],this._size[a]);for(var d=this._data,h=0,p=c.length;h<p;h++){var g=c[h];je(g,d.length),d=d[g]}return d},n.prototype.set=function(c,a,d){if(!$e(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new De(c.length,this._size.length,"<");var h,p,g,m=c.map(function(A){return A+1});l(this,m,d);var D=this._data;for(h=0,p=c.length-1;h<p;h++)g=c[h],je(g,D.length),D=D[g];return g=c[c.length-1],je(g,D.length),D[g]=a,this};function r(c,a){if(!$i(a))throw new TypeError("Invalid index");var d=a.isScalar();if(d)return c.get(a.min());var h=a.size();if(h.length!==c._size.length)throw new De(h.length,c._size.length);for(var p=a.min(),g=a.max(),m=0,D=c._size.length;m<D;m++)je(p[m],c._size[m]),je(g[m],c._size[m]);return new n(u(c._data,a,h.length,0),c._datatype)}function u(c,a,d,h){var p=h===d-1,g=a.dimension(h);return p?g.map(function(m){return je(m,c.length),c[m]}).valueOf():g.map(function(m){je(m,c.length);var D=c[m];return u(D,a,d,h+1)}).valueOf()}function i(c,a,d,h){if(!a||a.isIndex!==!0)throw new TypeError("Invalid index");var p=a.size(),g=a.isScalar(),m;if(Yt(d)?(m=d.size(),d=d.valueOf()):m=Gr(d),g){if(m.length!==0)throw new TypeError("Scalar expected");c.set(a.min(),d,h)}else{if(p.length<c._size.length)throw new De(p.length,c._size.length,"<");if(m.length<p.length){for(var D=0,A=0;p[D]===1&&m[D]===1;)D++;for(;p[D]===1;)A++,D++;d=np(d,p.length,A,m)}if(!zr(p,m))throw new De(p,m,">");var _=a.max().map(function(N){return N+1});l(c,_,h);var B=p.length,I=0;o(c._data,a,d,B,I)}return c}function o(c,a,d,h,p){var g=p===h-1,m=a.dimension(p);g?m.forEach(function(D,A){je(D),c[D]=d[A[0]]}):m.forEach(function(D,A){je(D),o(c[D],a,d[A[0]],h,p+1)})}n.prototype.resize=function(c,a,d){if(!Vr(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),p=d?this.clone():this;return s(p,h,a)};function s(c,a,d){if(a.length===0){for(var h=c._data;$e(h);)h=h[0];return h}return c._size=a.slice(0),c._data=Wi(c._data,c._size,d),c}n.prototype.reshape=function(c,a){var d=a?this.clone():this;d._data=ep(d._data,c);var h=d._size.reduce((p,g)=>p*g);return d._size=Zi(c,h),d};function l(c,a,d){for(var h=c._size.slice(0),p=!1;h.length<a.length;)h.push(0),p=!0;for(var g=0,m=a.length;g<m;g++)a[g]>h[g]&&(h[g]=a[g],p=!0);p&&s(c,h,d)}n.prototype.clone=function(){var c=new n({data:At(this._data),size:At(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var a=this,d=SD(c),h=function m(D,A){return $e(D)?D.map(function(_,B){return m(_,A.concat(B))}):d===1?c(D):d===2?c(D,A):c(D,A,a)},p=h(this._data,[]),g=this._datatype!==void 0?Kr(p,Hr):void 0;return new n(p,g)},n.prototype.forEach=function(c){var a=this,d=function h(p,g){$e(p)?p.forEach(function(m,D){h(m,g.concat(D))}):c(p,g,a)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*a(d,h){if($e(d))for(var p=0;p<d.length;p++)yield*a(d[p],h.concat(p));else yield{value:d,index:h}};yield*c(this._data,[])},n.prototype.rows=function(){var c=[],a=this.size();if(a.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)c.push(new n([h],this._datatype));return c},n.prototype.columns=function(){var c=this,a=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,p=function(D){var A=h.map(_=>[_[D]]);a.push(new n(A,c._datatype))},g=0;g<d[1];g++)p(g);return a},n.prototype.toArray=function(){return At(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(c){return Ct(this._data,c)},n.prototype.toString=function(){return Ct(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(c){if(c){if(ft(c)&&(c=c.toNumber()),!Ce(c)||!Ze(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var a=c>0?c:0,d=c<0?-c:0,h=this._size[0],p=this._size[1],g=Math.min(h-d,p-a),m=[],D=0;D<g;D++)m[D]=this._data[D+d][D+a];return new n({data:m,size:[g],datatype:this._datatype})},n.diagonal=function(c,a,d,h){if(!$e(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(R){if(ft(R)&&(R=R.toNumber()),!Ce(R)||!Ze(R)||R<1)throw new Error("Size values must be positive integers");return R}),d){if(ft(d)&&(d=d.toNumber()),!Ce(d)||!Ze(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var p=d>0?d:0,g=d<0?-d:0,m=c[0],D=c[1],A=Math.min(m-g,D-p),_;if($e(a)){if(a.length!==A)throw new Error("Invalid value array length");_=function(j){return a[j]}}else if(Yt(a)){var B=a.size();if(B.length!==1||B[0]!==A)throw new Error("Invalid matrix length");_=function(j){return a.get([j])}}else _=function(){return a};h||(h=ft(_(0))?_(0).mul(0):0);var I=[];if(c.length>0){I=Wi(I,c,h);for(var N=0;N<A;N++)I[N+g][N+p]=_(N)}return new n({data:I,size:[m,D]})},n.fromJSON=function(c){return new n(c)},n.prototype.swapRows=function(c,a){if(!Ce(c)||!Ze(c)||!Ce(a)||!Ze(a))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return je(c,this._size[0]),je(a,this._size[0]),n._swapRows(c,a,this._data),this},n._swapRows=function(c,a,d){var h=d[c];d[c]=d[a],d[a]=h};function f(c){for(var a=0,d=c.length;a<d;a++){var h=c[a];$e(h)?c[a]=f(h):h&&h.isMatrix===!0&&(c[a]=f(h.valueOf()))}return c}return n},{isClass:!0}),go="equalScalar";_e(go,["typed","config"],e=>{var{typed:t,config:n}=e;return t(go,{"number, number":function(u,i){return Jh(u,i,n.epsilon)}})});function tn(e,t,n,r){if(!(this instanceof tn))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}tn.prototype=new Error,tn.prototype.constructor=Error,tn.prototype.name="ArgumentsError",tn.prototype.isArgumentsError=!0;var vo="format",OD=["typed"],xD=_e(vo,OD,e=>{var{typed:t}=e;return t(vo,{any:Ct,"any, Object | function | number":Ct})}),yo="bin",RD=["typed","format"];_e(yo,RD,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 mo="oct",$D=["typed","format"];_e(mo,$D,e=>{var{typed:t,format:n}=e;return t(mo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var Eo="hex",PD=["typed","format"];_e(Eo,PD,e=>{var{typed:t,format:n}=e;return t(Eo,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Ao="equal";_e(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 Co="unequal";_e(Co,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Co,{"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 Fo={exports:{}};(function(e){(function(t,n,r){function u(l){var f=this,c=s();f.next=function(){var a=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=a-(f.c=a|0)},f.c=1,f.s0=c(" "),f.s1=c(" "),f.s2=c(" "),f.s0-=c(l),f.s0<0&&(f.s0+=1),f.s1-=c(l),f.s1<0&&(f.s1+=1),f.s2-=c(l),f.s2<0&&(f.s2+=1),c=null}function i(l,f){return f.c=l.c,f.s0=l.s0,f.s1=l.s1,f.s2=l.s2,f}function o(l,f){var c=new u(l),a=f&&f.state,d=c.next;return d.int32=function(){return c.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,a&&(typeof a=="object"&&i(a,c),d.state=function(){return i(c,{})}),d}function s(){var l=4022871197,f=function(c){c=String(c);for(var a=0;a<c.length;a++){l+=c.charCodeAt(a);var d=.02519603282416938*l;l=d>>>0,d-=l,d*=l,l=d>>>0,d-=l,l+=d*4294967296}return(l>>>0)*23283064365386963e-26};return f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(ut,e,!1)})(Fo);var wo={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this,f="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var a=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^a^a>>>8},s===(s|0)?l.x=s:f+=s;for(var c=0;c<f.length+64;c++)l.x^=f.charCodeAt(c)|0,l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l}function o(s,l){var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(typeof c=="object"&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(ut,e,!1)})(wo);var bo={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this,f="";l.next=function(){var a=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(a^a<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,s===(s|0)?l.x=s:f+=s;for(var c=0;c<f.length+64;c++)l.x^=f.charCodeAt(c)|0,c==f.length&&(l.d=l.x<<10^l.x>>>4),l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l.v=s.v,l.d=s.d,l}function o(s,l){var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(typeof c=="object"&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(ut,e,!1)})(bo);var Bo={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this;l.next=function(){var c=l.x,a=l.i,d,h;return d=c[a],d^=d>>>7,h=d^d<<24,d=c[a+1&7],h^=d^d>>>10,d=c[a+3&7],h^=d^d>>>3,d=c[a+4&7],h^=d^d<<7,d=c[a+7&7],d=d^d<<13,h^=d^d<<9,c[a]=h,l.i=a+1&7,h};function f(c,a){var d,h=[];if(a===(a|0))h[0]=a;else for(a=""+a,d=0;d<a.length;++d)h[d&7]=h[d&7]<<15^a.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],c.x=h,c.i=0,d=256;d>0;--d)c.next()}f(l,s)}function i(s,l){return l.x=s.x.slice(),l.i=s.i,l}function o(s,l){s==null&&(s=+new Date);var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(c.x&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(ut,e,!1)})(Bo);var _o={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this;l.next=function(){var c=l.w,a=l.X,d=l.i,h,p;return l.w=c=c+1640531527|0,p=a[d+34&127],h=a[d=d+1&127],p^=p<<13,h^=h<<17,p^=p>>>15,h^=h>>>12,p=a[d]=p^h,l.i=d,p+(c^c>>>16)|0};function f(c,a){var d,h,p,g,m,D=[],A=128;for(a===(a|0)?(h=a,a=null):(a=a+"\0",h=0,A=Math.max(A,a.length)),p=0,g=-32;g<A;++g)a&&(h^=a.charCodeAt((g+32)%a.length)),g===0&&(m=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,g>=0&&(m=m+1640531527|0,d=D[g&127]^=h+m,p=d==0?p+1:0);for(p>=128&&(D[(a&&a.length||0)&127]=-1),p=127,g=4*128;g>0;--g)h=D[p+34&127],d=D[p=p+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,D[p]=h^d;c.w=m,c.X=D,c.i=p}f(l,s)}function i(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function o(s,l){s==null&&(s=+new Date);var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(c.X&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(ut,e,!1)})(_o);var So={exports:{}};(function(e){(function(t,n,r){function u(s){var l=this,f="";l.next=function(){var a=l.b,d=l.c,h=l.d,p=l.a;return a=a<<25^a>>>7^d,d=d-h|0,h=h<<24^h>>>8^p,p=p-a|0,l.b=a=a<<20^a>>>12^d,l.c=d=d-h|0,l.d=h<<16^d>>>16^p,l.a=p-a|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,s===Math.floor(s)?(l.a=s/4294967296|0,l.b=s|0):f+=s;for(var c=0;c<f.length+20;c++)l.b^=f.charCodeAt(c)|0,l.next()}function i(s,l){return l.a=s.a,l.b=s.b,l.c=s.c,l.d=s.d,l}function o(s,l){var f=new u(s),c=l&&l.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,p=(d+h)/(1<<21);while(p===0);return p},a.int32=f.next,a.quick=a,c&&(typeof c=="object"&&i(c,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(ut,e,!1)})(So);var Mo={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,s="random",l=r.pow(u,i),f=r.pow(2,o),c=f*2,a=u-1,d;function h(B,I,N){var R=[];I=I==!0?{entropy:!0}:I||{};var j=D(m(I.entropy?[B,_(n)]:B==null?A():B,3),R),J=new p(R),K=function(){for(var z=J.g(i),ce=l,ue=0;z<f;)z=(z+ue)*u,ce*=u,ue=J.g(1);for(;z>=c;)z/=2,ce/=2,ue>>>=1;return(z+ue)/ce};return K.int32=function(){return J.g(4)|0},K.quick=function(){return J.g(4)/4294967296},K.double=K,D(_(J.S),n),(I.pass||N||function(z,ce,ue,ie){return ie&&(ie.S&&g(ie,J),z.state=function(){return g(J,{})}),ue?(r[s]=z,ce):z})(K,j,"global"in I?I.global:this==r,I.state)}function p(B){var I,N=B.length,R=this,j=0,J=R.i=R.j=0,K=R.S=[];for(N||(B=[N++]);j<u;)K[j]=j++;for(j=0;j<u;j++)K[j]=K[J=a&J+B[j%N]+(I=K[j])],K[J]=I;(R.g=function(z){for(var ce,ue=0,ie=R.i,ne=R.j,q=R.S;z--;)ce=q[ie=a&ie+1],ue=ue*u+q[a&(q[ie]=q[ne=a&ne+ce])+(q[ne]=ce)];return R.i=ie,R.j=ne,ue})(u)}function g(B,I){return I.i=B.i,I.j=B.j,I.S=B.S.slice(),I}function m(B,I){var N=[],R=typeof B,j;if(I&&R=="object")for(j in B)try{N.push(m(B[j],I-1))}catch(J){}return N.length?N:R=="string"?B:B+"\0"}function D(B,I){for(var N=B+"",R,j=0;j<N.length;)I[a&j]=a&(R^=I[a&j]*19)+N.charCodeAt(j++);return _(I)}function A(){try{var B;return d&&(B=d.randomBytes)?B=B(u):(B=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(B)),_(B)}catch(R){var I=t.navigator,N=I&&I.plugins;return[+new Date,t,N,t.screen,_(n)]}}function _(B){return String.fromCharCode.apply(0,B)}if(D(r.random(),n),e.exports){e.exports=h;try{d=Vn.default}catch(B){}}else r["seed"+s]=h})(typeof self!="undefined"?self:ut,[],Math)})(Mo);var TD=Fo.exports,jD=wo.exports,LD=bo.exports,kD=Bo.exports,qD=_o.exports,UD=So.exports,Tt=Mo.exports;Tt.alea=TD,Tt.xor128=jD,Tt.xorwow=LD,Tt.xorshift7=kD,Tt.xor4096=qD,Tt.tychei=UD,Ln("fineStructure",.0072973525693),Ln("weakMixingAngle",.2229),Ln("efimovFactor",22.7),Ln("sackurTetrode",-1.16487052358);function Ln(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 VD=hD({config:Pi}),HD=gD({}),zD=wD({}),WD=_D({}),ZD=ND({Matrix:WD}),JD=gp({BigNumber:VD,Complex:HD,DenseMatrix:ZD,Fraction:zD}),GD=xD({typed:JD});class XD{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===Y.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===Le.VariableInMainTable||r.type===Le.VariableInCurrentSubTable||r.type===Le.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===Le.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,Y.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,s;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(l=>{this.computedCalcValue(l)}),((s=this.dependenciesTriggerMap.get(t.instance.id))!=null?s:[]).forEach(l=>{this.computedCalcValue(l)})})}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)===Y.SUBTABLE_COLUMN}computedCalcValue(t){var l;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((f,c)=>{if(c.type===Le.Operator||c.type===Le.Number)return f+c.name;let a=0,d;switch(c.type){case Le.VariableInMainTable:{const h=this.getNumberValue(this.engine.getState(c.id));d=this.engine.getInstance(c.id),a=Number(h);break}case Le.VariableInCurrentSubTable:{d=this.engine.getInstance(c.id,r);const h=this.engine.getState(c.id,r),p=this.getNumberValue(h);a=Number(p);break}case Le.VariableInOtherSubTable:{const h=this.engine.getState(c.id),p=Array.isArray(h)?h.map(m=>this.getNumberValue(m)):[],g=this.getAggregateTypeValue(p,c.aggregateType);d=this.engine.getInstance(c.subTableId),a=Number(g);break}}return!Number.isNaN(a)&&this.controlNeedComputedValue(d)?f+=`(${a})`:f+=0,f},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(GD(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),s=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));s!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:s,unit:(l=o==null?void 0:o.unit)!=null?l:""},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 Ft.MAX:return Math.max(...t);case Ft.MIN:return Math.min(...t);case Ft.SUM:return t.reduce((r,u)=>r+u);case Ft.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class KD{constructor(t,n=!0){this.config=t,this.isPc=n}apply(t){var i,o;this.engine=t;const n=(o=(i=this.config)==null?void 0:i.source)!=null?o:"";let r=document.createElement("style");r.className="edit-css-"+t.id,r.type="text/css",this.isPc?r.innerHTML=`[data-engine-id='${t.id}']{ ${n} }`:r.innerHTML=n,document.querySelector("head").appendChild(r)}}U.CalcPlugin=XD,U.ControlsEventPlugin=ch,U.ES6ModulePlugin=oh,U.Engine=qr,U.LifecycleEventPlugin=sh,U.Plugin=ih,U.StylePlugin=KD,U.buildUUID=Xt,U.hasChildrenControl=Cn,U.loopDataViewControl=Et,U.loopFormControl=mt,U.parseModule=Ii,Object.defineProperty(U,"__esModule",{value:!0})});
@@ -7,6 +7,7 @@ export type StyleConfig = {
7
7
  export declare class StylePlugin implements Plugin {
8
8
  private config;
9
9
  private engine;
10
- constructor(config: StyleConfig);
10
+ private isPc;
11
+ constructor(config: StyleConfig, isPC?: boolean);
11
12
  apply(engine: Engine): void;
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-engine",
3
- "version": "2.22.0-beta.4",
3
+ "version": "2.22.0-beta.6",
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.22.0-beta.4",
30
- "@byteluck-fe/model-driven-shared": "2.21.0-beta.15",
29
+ "@byteluck-fe/model-driven-core": "2.22.0-beta.6",
30
+ "@byteluck-fe/model-driven-shared": "2.22.0-beta.6",
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": "07d07ec0e8e1997210577f263400229f084bde95"
37
+ "gitHead": "5b7a6ae39fcac35fb56be60575258aa2644892b9"
38
38
  }