From 714ab7db0b1b7d5864f3ca037cfb4cbf5b9ff42a Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 18 Aug 2023 16:38:02 +0100 Subject: [PATCH 1/6] Use new js --- scripts/update_js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_js b/scripts/update_js index a449dc58..05557b0b 100755 --- a/scripts/update_js +++ b/scripts/update_js @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -exu -ODIN_JS_BRANCH=main +ODIN_JS_BRANCH=mrc-4455 DUST_JS_BRANCH=main HERE=$(dirname $0) From 10d2bc78942d5833c0679bdd21fc0eeb46098365 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 18 Aug 2023 16:38:26 +0100 Subject: [PATCH 2/6] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4a3f0a41..efec8be7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: odin Title: ODE Generation and Integration -Version: 1.5.6 +Version: 1.5.7 Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"), email = "rich.fitzjohn@gmail.com"), person("Thibaut", "Jombart", role = "ctb"), From 366523e6506973094852b76e009dff21049c450b Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Wed, 30 Aug 2023 12:15:22 +0100 Subject: [PATCH 3/6] Update odin js code --- inst/js/odin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/js/odin.js b/inst/js/odin.js index 8683a5b8..ba751842 100644 --- a/inst/js/odin.js +++ b/inst/js/odin.js @@ -1 +1 @@ -var odinjs;(()=>{"use strict";var t={6:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateSearch=e.InterpolatorBase=void 0;var r=function(){function t(t,e){(function(t){return Array.isArray(t[0])})(e)||(e=[e]),this._i=0,this._x=t,this._y=e,this.nX=this._x.length,this.nY=this._y.length;for(var r=0;r=s-1)return s;for(i=n+o;e[i]=s){if(e[i=s-1]t;){if(i=n,n<(o*=2)){if(e[n=0]>t)return-1;break}n-=o}}for(;i-n>1;){var a=Math.floor((i+n)/2);e[a]{Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorSpline=e.InterpolatorLinear=e.InterpolatorConstant=e.InterpolatorBase=void 0;var n=r(6);Object.defineProperty(e,"InterpolatorBase",{enumerable:!0,get:function(){return n.InterpolatorBase}});var i=r(731);Object.defineProperty(e,"InterpolatorConstant",{enumerable:!0,get:function(){return i.InterpolatorConstant}});var o=r(477);Object.defineProperty(e,"InterpolatorLinear",{enumerable:!0,get:function(){return o.InterpolatorLinear}});var s=r(869);Object.defineProperty(e,"InterpolatorSpline",{enumerable:!0,get:function(){return s.InterpolatorSpline}})},477:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorLinear=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eval=function(t,e){void 0===e&&(e=0);var r=this.search(t,!1),n=this._x[r],i=(t-n)/(this._x[r+1]-n),o=this._y[e],s=o[r];return s+(o[r+1]-s)*i},e}(r(6).InterpolatorBase);e.InterpolatorLinear=o},869:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.solve=e.InterpolatorSpline=void 0;var s=o(r(863)),a=function(t){function e(e,r){var n=t.call(this,e,r)||this,i=function(t){var e=t.length,r=Array(e),n=Array(e),i=Array(e);r[0]=0,n[0]=2/(t[1]-t[0]),i[0]=1/(t[1]-t[0]);for(var o=1;o{function r(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.simplexControl=void 0,e.simplexControl=function(t){void 0===t&&(t={});var e={deltaNonZero:r(t.deltaNonZero,.05),deltaZero:r(t.deltaZero,.001),errorOnFailure:r(t.errorOnFailure,!1),tolerance:r(t.tolerance,1e-5)};if(e.tolerance<=0)throw new Error("Invalid control parameter: 'tolerance' must be strictly positive");return e}},153:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(169);Object.defineProperty(e,"Simplex",{enumerable:!0,get:function(){return n.Simplex}}),Object.defineProperty(e,"fitSimplex",{enumerable:!0,get:function(){return n.fitSimplex}})},169:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Simplex=e.fitSimplex=void 0;var n=r(394),i=r(3);function o(t,e,r){for(var n=e.length,i=new Array(n),o=1+t,s=-t,a=0;a=this._simplex[t-1].value){var s=i.value>r.value?this._contractInside(r,n):this._contractOutside(r,n);if(s.value{Object.defineProperty(e,"__esModule",{value:!0}),e.checkResult=void 0,e.checkResult=function(t){return"number"==typeof t?{data:null,value:t}:t}},886:function(t,e){var r=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i0&&(f.tcrit=r([],f.tcrit,!0).sort()),f.maxSteps<1)throw n("maxSteps","must be at least 1");if(f.atol<=0)throw n("atol","must be strictly positive");if(f.rtol<=0)throw n("rtol","must be strictly positive");return f}},742:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDE=e.integrateDDE=void 0;var o=r(223),s=r(660);e.integrateDDE=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new a(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var a=function(t){function e(e,r,n,i){void 0===n&&(n={}),void 0===i&&(i=null);var o=this,s=function(t){return o._interpolate(t)},a=null===i?null:function(t,e){return i(t,e,s)};return(o=t.call(this,(function(t,r,n){return e(t,r,n,s)}),r,n,a)||this)._y0=new Array(r),o}return i(e,t),e.prototype.initialise=function(e,r){return this._y0=r,t.prototype.initialise.call(this,e,r),this},e.prototype._interpolate=function(t){var e=this._findHistory(t);return e<0?this._y0.slice(0):this._stepper.interpolate(t,this._history[e])},e.prototype._findHistory=function(t){return(0,s.search)(this._history,(function(e){return e.t>t}))},e}(o.Dopri);e.DDE=a},223:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;it._t})),0===this._tcrit.length?1/0:this._tcrit[0])},t.prototype._step=function(){for(var t=this._t,e=this._h,r=!1,n=!1,i=Math.max(this._lastError,1e-4),o=this._stepper.stepControl,s=this._control,a=this._nextTcrit();!r;){if(this._nSteps>s.maxSteps)throw f("too many steps",t);if(ea&&(e=a-t),this._stepper.step(t,e),this._nSteps++;var u=this._stepper.error(s.atol,s.rtol),l=Math.pow(u,o.constant),p=1/o.factorMin,d=1/o.factorMax;if(u<=1){if(r=!0,this._nStepsAccepted++,this._isStiff(e))throw f("problem became stiff",t);this._stepper.stepComplete(t,e);var v=l/Math.pow(i,o.beta),_=e/(v=c.constrain(v/o.factorSafe,d,p));this._t+=e,this._h=n?Math.min(_,e):Math.min(_,s.stepSizeMax),this._lastError=u}else n=!0,this._nStepsAccepted>=1&&this._nStepsRejected++,e/=Math.min(p,l/o.factorSafe)}return this._t},t.prototype._isStiff=function(t){if(this._stiffNStiff>0||this._nStepsAccepted%this._control.stiffCheck==0)if(this._stepper.isStiff(t)){if(this._stiffNNonstiff=0,this._stiffNStiff++>=15)return!0}else this._stiffNStiff>0&&this._stiffNNonstiff++>=6&&(this._stiffNStiff=0,this._stiffNNonstiff=0);return!1},t}();e.Dopri=p},167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5StepControl=void 0;e.Dopri5StepControl=function(){this.factorSafe=.9,this.factorMin=.2,this.factorMax=10,this.beta=.04,this.constant=.2-.75*this.beta}},922:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5=void 0;var s=o(r(660)),a=o(r(167)),u=r(430),l=function(){function t(t,e){this.order=5,this.stepControl=new a.Dopri5StepControl,this.nEval=0,this.rhs=t,this.n=e,this.y=new Array(e),this.yNext=new Array(e),this.yStiff=new Array(e),this.k1=new Array(e),this.k2=new Array(e),this.k3=new Array(e),this.k4=new Array(e),this.k5=new Array(e),this.k6=new Array(e),this.history=new u.HistoryElement(this.order*e)}return t.prototype.step=function(t,e){var r=this.n,n=this.y,i=this.yNext,o=this.k1,s=this.k2,a=this.k3,u=this.k4,l=this.k5,c=this.k6,h=this.history.data,f=0;for(f=0;f0&&Math.abs(t)*Math.sqrt(e/r)>3.25},t.prototype.reset=function(t,e){for(var r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var r=function(){function t(t){this.t=0,this.h=0,this.data=new Array(t)}return t.prototype.clone=function(){var e=new t(this.data.length);return e.t=this.t,e.h=this.h,e.data=this.data.slice(0),e},t}();e.HistoryElement=r},245:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=e.integrateDDE=e.DDE=e.integrateDopri=e.Dopri=void 0;var n=r(223);Object.defineProperty(e,"Dopri",{enumerable:!0,get:function(){return n.Dopri}}),Object.defineProperty(e,"integrateDopri",{enumerable:!0,get:function(){return n.integrateDopri}});var i=r(742);Object.defineProperty(e,"DDE",{enumerable:!0,get:function(){return i.DDE}}),Object.defineProperty(e,"integrateDDE",{enumerable:!0,get:function(){return i.integrateDDE}});var o=r(961);Object.defineProperty(e,"integrate",{enumerable:!0,get:function(){return o.integrate}})},961:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=void 0;var n=r(742),i=r(223);e.integrate=function(t,e,r,o,s,a){if(void 0===s&&(s={}),void 0===a&&(a=null),function(t){return 3===t.length}(t)){if(!function(t){return null===t||2===t.length}(a))throw new Error("Can't used delayed output with non-delayed rhs");return(0,i.integrateDopri)(t,e,r,o,s,a)}if(!function(t){return null===t||3===t.length}(a))throw new Error("Can't used non-delayed output with delayed rhs");return(0,n.integrateDDE)(t,e,r,o,s,a)}},216:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolator=void 0,e.interpolator=function(t,e,r){return function(n){return function(t,e,r,n){for(var i=[],o=e,s=0,a=0,u=t;a{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var n=r(606);Object.defineProperty(e,"HistoryElement",{enumerable:!0,get:function(){return n.HistoryElement}})},660:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.seqLen=e.approxEqualArray=e.approxEqual=e.zeros=e.copyArray=e.constrain=e.square=void 0;var r=Math.pow(2,-26);e.square=function(t){return t*t},e.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},e.copyArray=function(t,e){for(var r=t.length,n=0;nn&&(i/=o),in&&(o/=i),o1;){var i=Math.floor((r+n)/2);e(t[i])?n=i:r=i}return r}},863:t=>{t.exports=function(t,e,r,n,i){var o,s;for(o=1;o=0;o--){if(0===r[o])return console.log("tridiagonalSolve: failed due to singular matrix"),!1;i[o]=(i[o]-n[o]*i[o+1])/r[o]}return!0}},653:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;const n=r(458),i=r(166),o=r(650),s=r(536);e.base={delay:n.delay,interpolate:i.interpolate,maths:o.maths,user:s.user}},401:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.alignDescriptionsGetLevels=e.computeExtremesResult=e.valueAtTimeResult=e.updatePars=e.batchParsDisplace=e.batchParsRange=e.batchRun=e.Batch=void 0;const n=r(822),i=r(882),o=r(915);class s{constructor(t,e,r,n,i=501){this.pars=Object.assign(Object.assign({},e),{values:[]}),this.tStart=r,this.tEnd=n,this.solutions=[],this.errors=[],this._pending=e.values,this._run=t,this._nPointsForExtremes=i}compute(){if(this._pending.length>0){const t=this._pending[0];this._pending=this._pending.slice(1);const e=u(this.pars.base,this.pars.name,t);try{this.solutions.push(this._run(e,this.tStart,this.tEnd)),this.pars.values.push(t)}catch(e){this.errors.push({value:t,error:e.message})}}const t=0===this._pending.length;if(t&&0===this.solutions.length)throw Error(`All solutions failed; first error: ${this.errors[0].error}`);return t}run(){for(;!this.compute(););}valueAtTime(t){return function(t,e,r){return c(e,r.map((e=>e({mode:n.TimeMode.Given,times:[t]}))))}(t,this.pars.values,this.solutions)}extreme(t){return this.findExtremes()[t]}findExtremes(){if(void 0===this._extremes){const i=(t={mode:n.TimeMode.Grid,nPoints:this._nPointsForExtremes,tEnd:this.tEnd,tStart:this.tStart},e=this.pars.values,r=this.solutions,h(e,r.map((e=>e(t)))));if(0!==this._pending.length)return i;this._extremes=i}var t,e,r;return this._extremes}}function a(t,e,r,n,o,s){const a=l(t,e);if(o>a)throw Error(`Expected lower bound to be no greater than ${a}`);if(s=s)throw Error("Expected upper bound to be greater than lower bound");if(r<2)throw Error("Must include at least 2 traces in the batch");if(n&&o<=0)throw Error("Lower bound must be greater than 0 for logarithmic scale");return{base:t,name:e,values:n?(0,i.gridLog)(o,s,r):(0,i.grid)(o,s,r)}}function u(t,e,r){const n=Object.assign({},t);return n[e]=r,n}function l(t,e){const r=t[e];if(void 0===r)throw Error(`Expected a value for '${e}'`);if("number"!=typeof r)throw Error(`Expected a number for '${e}'`);return r}function c(t,e){const r={x:t,values:[]},n=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of n){const n=p(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;te[t].y[0]));r.values.push(Object.assign(Object.assign({},n[0][t]),{y:e}))}}return r}function h(t,e){const r=()=>({x:[...t],values:[]}),n={tMax:r(),tMin:r(),yMax:r(),yMin:r()};if(0===t.length)return n;const o=e[0].x,s=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of s){const r=p(e.map((e=>e.values.filter((e=>e.name===t))))),i=r[0].length;for(let t=0;tf(o,e[t].y)));Object.keys(n).forEach((i=>{const o=i;n[o].values.push(Object.assign(Object.assign({},r[0][t]),{y:e.map((t=>t[o]))}))}))}}return n}function f(t,e){const r=(0,i.whichMin)(e),n=(0,i.whichMax)(e),o=t[r],s=t[n],a=e[r];return{tMax:s,tMin:o,yMax:e[n],yMin:a}}function p(t){const e=t.map((t=>t.length));if(e.every((t=>1===t)))return t;Math.max(...e);const r=d(t);for(let e=0;eObject.assign(Object.assign({},t[e][0]),{description:r}))));return t}function d(t){let e=null,r=[];return t.forEach((t=>{if(1===t.length){const r=t[0].description;if(null===e)e=r;else if(r!==e)throw Error(`Unexpected inconsistent descriptions: have ${e}, but given ${r}`)}else{const e=t.map((t=>t.description));if(0===r.length){if(e.some((t=>void 0===t)))throw Error("Expected all descriptions to be defined");r=e}else if(!(0,i.sameArrayContents)(e,r))throw Error(`Unexpected inconsistent descriptions: have [${r.join(", ")}], but given [${e.join(", ")}]`)}})),r}e.Batch=s,e.batchRun=function(t,e,r,n,i,a=!0){const u=new s(((e,r,n)=>(0,o.wodinRun)(t,e,r,n,i)),e,r,n);return a&&u.run(),u},e.batchParsRange=a,e.batchParsDisplace=function(t,e,r,n,i){const o=l(t,e),s=i/100;return a(t,e,r,n,o*(1-s),o*(1+s))},e.updatePars=u,e.valueAtTimeResult=c,e.computeExtremesResult=h,e.alignDescriptionsGetLevels=d},458:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t,e,r,n){const i=t(e);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfSquares=e.updatePars=e.fitTarget=void 0;const n=r(653),i=r(134),o=r(822);function s(t,e){const r=Object.assign({},t.base);for(let n=0;n{const f=s(r,h),p=new t(n.base,f,"error"),d=(0,i.runModel)(p,null,0,c,l).solution,v=p.names(),_=v.indexOf(u),y=d(e.time).map((t=>t[_]));return{data:{endTime:c,names:v,pars:f,solution:(0,o.interpolatedSolution)(d,v,0,c),startTime:0},value:a(e.value,y)}}},e.updatePars=s,e.sumOfSquares=a},166:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.interpolateTimes=e.interpolateCheckT=e.interpolateCheckY=e.interpolateAlloc=void 0;const n=r(673);function i(t,e,r){const i=function(t,e){if(t.length===e)return[t];const r=[],n=t.length/e;for(let i=0;ir.max)throw Error(`Integration times do not span interpolation range; max: ${r.max}`);return r.max===1/0?n:(void 0===n&&(n=[]),[...n,r.max])},e.interpolateTimes=s,e.interpolate={alloc:i,checkY:o,times:s}},650:(t,e)=>{function r(t){return.5===i(t,1)?2*Math.round(t/2):Math.round(t)}function n(t,e){if(void 0===e||0===e)return r(t);{const n=Math.pow(10,e);return r(t*n)/n}}function i(t,e){let r=t%e;return r*e<0&&(r+=e),r}function o(t,e){return Math.floor(t/e)}function s(t,e,r){let n=0;for(let i=e;it.output(e,r,n)),null===e&&(e=t.initial(r)),t.getInternal().initial_t=r;const a=new s.DDE((function(e,r,n,i){t.rhs(e,r,n,i)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i):function(t,e,r,n,i){let o=null;"function"==typeof t.output&&(o=(e,r)=>t.output(e,r)),null===e&&(e=t.initial(r));const a=new s.Dopri((function(e,r,n){t.rhs(e,r,n)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i)}},586:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PkgWrapper=void 0;const n=r(653),i=r(134);e.PkgWrapper=class{constructor(t,e,r){this.model=new t(n.base,e,r)}initial(t){return this.model.initial(t)}rhs(t,e){const r=new Array(e.length).fill(0);let n=null;if(!(0,i.isODEModel)(this.model))throw Error("Can't use rhs() with delay models");return this.model,this.model.rhs(t,e,r),this.model.output&&(n=this.model.output(t,e)),{output:n,state:r}}getMetadata(){return this.model.getMetadata()}getInternal(){return this.model.getInternal()}setUser(t,e){this.model.setUser(t,e)}run(t,e,r){const n=t[0],o=t[t.length-1],s=(0,i.runModel)(this.model,e,n,o,r);return{names:this.model.names(),statistics:s.statistics,y:s.solution(t)}}}},822:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedSolution=e.TimeMode=void 0;const n=r(882);var i;!function(t){t.Grid="grid",t.Given="given"}(i=e.TimeMode||(e.TimeMode={})),e.interpolatedSolution=function(t,e,r,o){return s=>{const a=function(t,e,r){switch(t.mode){case i.Grid:return(0,n.grid)(Math.max(e,t.tStart),Math.min(r,t.tEnd),t.nPoints);case i.Given:return t.times}}(s,r,o),u=t(a);return{values:e.map(((t,r)=>({name:e[r],y:u.map((t=>t[r]))}))),x:a}}}},536:(t,e)=>{function r(t,e,r){if("ignore"===r)return;const n=[];for(const r of Object.keys(t))e.includes(r)||n.push(r);if(n.length>0){const t="Unknown user parameters: "+n.join(", ");if("message"===r)console.log(t);else{if("warning"!==r)throw"stop"===r?Error(t):Error(t+" (and invalid value for unusedUserAction)");console.warn(t)}}}function n(t,e,r,n,i,o,s){const a=t[e];if(void 0===a){if(void 0!==r[e])return;if(null===n)throw Error(`Expected a value for '${e}'`);r[e]=n}else{if("number"!=typeof a)throw Error(`Expected a number for '${e}'`);l(a,i,o,s,e),r[e]=a}}function i(t,e,r,n,i,o,l){let c=t[e];if(void 0===c){if(void 0!==r[e])return;throw Error(`Expected a value for '${e}'`)}{const t=n.length-1;c=s(c),a(t,c,e),function(t,e,r){const n=t.length-1;for(let i=0;ir)throw Error(`Expected '${i}' to be at most ${r}`);if(n&&!Number.isInteger(t))throw Error(`Expected '${i}' to be integer-like`)}Object.defineProperty(e,"__esModule",{value:!0}),e.user=e.setUserArrayVariable=e.setUserArrayFixed=e.setUserScalar=e.checkUser=void 0,e.checkUser=r,e.setUserScalar=n,e.setUserArrayFixed=i,e.setUserArrayVariable=o,e.user={checkUser:r,setUserArrayFixed:i,setUserArrayVariable:o,setUserScalar:n}},882:(t,e)=>{function r(t,e,r){const n=(e-t)/(r-1),i=[];for(let e=0;er&&(e=n,r=t[n]);return e},e.unique=function(t){return[...new Set(t)]},e.sameArrayContents=function(t,e){return t.length===e.length&&t.every(((t,r)=>e[r]===t))}},556:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{dfoptim:"0.0.5",dopri:"0.0.13",odinjs:"0.1.1"}}},915:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wodinFitValue=e.wodinFit=e.wodinRun=void 0;const n=r(153),i=r(653),o=r(410),s=r(134),a=r(822);e.wodinRun=function(t,e,r,n,o){const u=new t(i.base,e,"error"),l=(0,s.runModel)(u,null,r,n,o).solution,c=u.names();return(0,a.interpolatedSolution)(l,c,r,n)},e.wodinFit=function(t,e,r,i,s,a){const u=(0,o.fitTarget)(t,e,r,i,s),l=r.vary.map((t=>r.base[t]));return new n.Simplex(u,l,a)},e.wodinFitValue=function(t,e,r){const n=t({mode:a.TimeMode.Given,times:e.time}),i=n.values.findIndex((t=>t.name===r));return(0,o.sumOfSquares)(e.value,n.values[i].y)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}var n={};(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.versions=t.batchRun=t.batchParsRange=t.batchParsDisplace=t.Batch=t.TimeMode=t.base=t.PkgWrapper=t.wodinRun=t.wodinFitValue=t.wodinFit=void 0;var e=r(915);Object.defineProperty(t,"wodinFit",{enumerable:!0,get:function(){return e.wodinFit}}),Object.defineProperty(t,"wodinFitValue",{enumerable:!0,get:function(){return e.wodinFitValue}}),Object.defineProperty(t,"wodinRun",{enumerable:!0,get:function(){return e.wodinRun}});var i=r(586);Object.defineProperty(t,"PkgWrapper",{enumerable:!0,get:function(){return i.PkgWrapper}});var o=r(653);Object.defineProperty(t,"base",{enumerable:!0,get:function(){return o.base}});var s=r(822);Object.defineProperty(t,"TimeMode",{enumerable:!0,get:function(){return s.TimeMode}});var a=r(401);Object.defineProperty(t,"Batch",{enumerable:!0,get:function(){return a.Batch}}),Object.defineProperty(t,"batchParsDisplace",{enumerable:!0,get:function(){return a.batchParsDisplace}}),Object.defineProperty(t,"batchParsRange",{enumerable:!0,get:function(){return a.batchParsRange}}),Object.defineProperty(t,"batchRun",{enumerable:!0,get:function(){return a.batchRun}});var u=r(556);Object.defineProperty(t,"versions",{enumerable:!0,get:function(){return u.versions}})})(),odinjs=n})(); +var odinjs;(()=>{"use strict";var t={6:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateSearch=e.InterpolatorBase=void 0;var r=function(){function t(t,e){(function(t){return Array.isArray(t[0])})(e)||(e=[e]),this._i=0,this._x=t,this._y=e,this.nX=this._x.length,this.nY=this._y.length;for(var r=0;r=s-1)return s;for(i=n+o;e[i]=s){if(e[i=s-1]t;){if(i=n,n<(o*=2)){if(e[n=0]>t)return-1;break}n-=o}}for(;i-n>1;){var a=Math.floor((i+n)/2);e[a]{Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorSpline=e.InterpolatorLinear=e.InterpolatorConstant=e.InterpolatorBase=void 0;var n=r(6);Object.defineProperty(e,"InterpolatorBase",{enumerable:!0,get:function(){return n.InterpolatorBase}});var i=r(731);Object.defineProperty(e,"InterpolatorConstant",{enumerable:!0,get:function(){return i.InterpolatorConstant}});var o=r(477);Object.defineProperty(e,"InterpolatorLinear",{enumerable:!0,get:function(){return o.InterpolatorLinear}});var s=r(869);Object.defineProperty(e,"InterpolatorSpline",{enumerable:!0,get:function(){return s.InterpolatorSpline}})},477:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorLinear=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eval=function(t,e){void 0===e&&(e=0);var r=this.search(t,!1),n=this._x[r],i=(t-n)/(this._x[r+1]-n),o=this._y[e],s=o[r];return s+(o[r+1]-s)*i},e}(r(6).InterpolatorBase);e.InterpolatorLinear=o},869:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.solve=e.InterpolatorSpline=void 0;var s=o(r(863)),a=function(t){function e(e,r){var n=t.call(this,e,r)||this,i=function(t){var e=t.length,r=Array(e),n=Array(e),i=Array(e);r[0]=0,n[0]=2/(t[1]-t[0]),i[0]=1/(t[1]-t[0]);for(var o=1;o{function r(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.simplexControl=void 0,e.simplexControl=function(t){void 0===t&&(t={});var e={deltaNonZero:r(t.deltaNonZero,.05),deltaZero:r(t.deltaZero,.001),errorOnFailure:r(t.errorOnFailure,!1),tolerance:r(t.tolerance,1e-5)};if(e.tolerance<=0)throw new Error("Invalid control parameter: 'tolerance' must be strictly positive");return e}},153:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(169);Object.defineProperty(e,"Simplex",{enumerable:!0,get:function(){return n.Simplex}}),Object.defineProperty(e,"fitSimplex",{enumerable:!0,get:function(){return n.fitSimplex}})},169:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Simplex=e.fitSimplex=void 0;var n=r(394),i=r(3);function o(t,e,r){for(var n=e.length,i=new Array(n),o=1+t,s=-t,a=0;a=this._simplex[t-1].value){var s=i.value>r.value?this._contractInside(r,n):this._contractOutside(r,n);if(s.value{Object.defineProperty(e,"__esModule",{value:!0}),e.checkResult=void 0,e.checkResult=function(t){return"number"==typeof t?{data:null,value:t}:t}},886:function(t,e){var r=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i0&&(f.tcrit=r([],f.tcrit,!0).sort()),f.maxSteps<1)throw n("maxSteps","must be at least 1");if(f.atol<=0)throw n("atol","must be strictly positive");if(f.rtol<=0)throw n("rtol","must be strictly positive");return f}},742:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDE=e.integrateDDE=void 0;var o=r(223),s=r(660);e.integrateDDE=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new a(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var a=function(t){function e(e,r,n,i){void 0===n&&(n={}),void 0===i&&(i=null);var o=this,s=function(t){return o._interpolate(t)},a=null===i?null:function(t,e){return i(t,e,s)};return(o=t.call(this,(function(t,r,n){return e(t,r,n,s)}),r,n,a)||this)._y0=new Array(r),o}return i(e,t),e.prototype.initialise=function(e,r){return this._y0=r,t.prototype.initialise.call(this,e,r),this},e.prototype._interpolate=function(t){var e=this._findHistory(t);return e<0?this._y0.slice(0):this._stepper.interpolate(t,this._history[e])},e.prototype._findHistory=function(t){return(0,s.search)(this._history,(function(e){return e.t>t}))},e}(o.Dopri);e.DDE=a},223:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;it._t})),0===this._tcrit.length?1/0:this._tcrit[0])},t.prototype._step=function(){for(var t=this._t,e=this._h,r=!1,n=!1,i=Math.max(this._lastError,1e-4),o=this._stepper.stepControl,s=this._control,a=this._nextTcrit();!r;){if(this._nSteps>s.maxSteps)throw f("too many steps",t);if(ea&&(e=a-t),this._stepper.step(t,e),this._nSteps++;var u=this._stepper.error(s.atol,s.rtol),l=Math.pow(u,o.constant),p=1/o.factorMin,d=1/o.factorMax;if(u<=1){if(r=!0,this._nStepsAccepted++,this._isStiff(e))throw f("problem became stiff",t);this._stepper.stepComplete(t,e);var v=l/Math.pow(i,o.beta),_=e/(v=c.constrain(v/o.factorSafe,d,p));this._t+=e,this._h=n?Math.min(_,e):Math.min(_,s.stepSizeMax),this._lastError=u}else n=!0,this._nStepsAccepted>=1&&this._nStepsRejected++,e/=Math.min(p,l/o.factorSafe)}return this._t},t.prototype._isStiff=function(t){if(this._stiffNStiff>0||this._nStepsAccepted%this._control.stiffCheck==0)if(this._stepper.isStiff(t)){if(this._stiffNNonstiff=0,this._stiffNStiff++>=15)return!0}else this._stiffNStiff>0&&this._stiffNNonstiff++>=6&&(this._stiffNStiff=0,this._stiffNNonstiff=0);return!1},t}();e.Dopri=p},167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5StepControl=void 0;e.Dopri5StepControl=function(){this.factorSafe=.9,this.factorMin=.2,this.factorMax=10,this.beta=.04,this.constant=.2-.75*this.beta}},922:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5=void 0;var s=o(r(660)),a=o(r(167)),u=r(430),l=function(){function t(t,e){this.order=5,this.stepControl=new a.Dopri5StepControl,this.nEval=0,this.rhs=t,this.n=e,this.y=new Array(e),this.yNext=new Array(e),this.yStiff=new Array(e),this.k1=new Array(e),this.k2=new Array(e),this.k3=new Array(e),this.k4=new Array(e),this.k5=new Array(e),this.k6=new Array(e),this.history=new u.HistoryElement(this.order*e)}return t.prototype.step=function(t,e){var r=this.n,n=this.y,i=this.yNext,o=this.k1,s=this.k2,a=this.k3,u=this.k4,l=this.k5,c=this.k6,h=this.history.data,f=0;for(f=0;f0&&Math.abs(t)*Math.sqrt(e/r)>3.25},t.prototype.reset=function(t,e){for(var r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var r=function(){function t(t){this.t=0,this.h=0,this.data=new Array(t)}return t.prototype.clone=function(){var e=new t(this.data.length);return e.t=this.t,e.h=this.h,e.data=this.data.slice(0),e},t}();e.HistoryElement=r},245:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=e.integrateDDE=e.DDE=e.integrateDopri=e.Dopri=void 0;var n=r(223);Object.defineProperty(e,"Dopri",{enumerable:!0,get:function(){return n.Dopri}}),Object.defineProperty(e,"integrateDopri",{enumerable:!0,get:function(){return n.integrateDopri}});var i=r(742);Object.defineProperty(e,"DDE",{enumerable:!0,get:function(){return i.DDE}}),Object.defineProperty(e,"integrateDDE",{enumerable:!0,get:function(){return i.integrateDDE}});var o=r(961);Object.defineProperty(e,"integrate",{enumerable:!0,get:function(){return o.integrate}})},961:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=void 0;var n=r(742),i=r(223);e.integrate=function(t,e,r,o,s,a){if(void 0===s&&(s={}),void 0===a&&(a=null),function(t){return 3===t.length}(t)){if(!function(t){return null===t||2===t.length}(a))throw new Error("Can't used delayed output with non-delayed rhs");return(0,i.integrateDopri)(t,e,r,o,s,a)}if(!function(t){return null===t||3===t.length}(a))throw new Error("Can't used non-delayed output with delayed rhs");return(0,n.integrateDDE)(t,e,r,o,s,a)}},216:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolator=void 0,e.interpolator=function(t,e,r){return function(n){return function(t,e,r,n){for(var i=[],o=e,s=0,a=0,u=t;a{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var n=r(606);Object.defineProperty(e,"HistoryElement",{enumerable:!0,get:function(){return n.HistoryElement}})},660:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.seqLen=e.approxEqualArray=e.approxEqual=e.zeros=e.copyArray=e.constrain=e.square=void 0;var r=Math.pow(2,-26);e.square=function(t){return t*t},e.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},e.copyArray=function(t,e){for(var r=t.length,n=0;nn&&(i/=o),in&&(o/=i),o1;){var i=Math.floor((r+n)/2);e(t[i])?n=i:r=i}return r}},863:t=>{t.exports=function(t,e,r,n,i){var o,s;for(o=1;o=0;o--){if(0===r[o])return console.log("tridiagonalSolve: failed due to singular matrix"),!1;i[o]=(i[o]-n[o]*i[o+1])/r[o]}return!0}},653:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;const n=r(458),i=r(166),o=r(650),s=r(536);e.base={delay:n.delay,interpolate:i.interpolate,maths:o.maths,user:s.user}},401:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.alignDescriptionsGetLevels=e.computeExtremesResult=e.valueAtTimeResult=e.updatePars=e.batchParsDisplace=e.batchParsRange=e.batchPars=e.batchRun=e.Batch=e.expandVaryingParams=void 0;const n=r(822),i=r(882),o=r(915);function s(t){const e=[],r=(n,i)=>{const o=n===t.length-1,s=t[n];if(0===s.values.length)throw Error(`Varying parameter '${s.name}' must have at least one value`);s.values.forEach((t=>{const a=Object.assign(Object.assign({},i),{[s.name]:t});o?e.push(a):r(n+1,a)}))};if(!(t.length>0))throw Error("A batch must have at least one varying parameter");return r(0,{}),e}e.expandVaryingParams=s;class a{constructor(t,e,r,n,i=501){this.pars=e,this.tStart=r,this.tEnd=n,this.solutions=[],this.runStatuses=[],this._pending=s(e.varying),this._run=t,this._nPointsForExtremes=i}get errors(){return this.runStatuses.filter((t=>!t.success))}get successfulVaryingParams(){return this.runStatuses.filter((t=>t.success)).map((t=>t.pars))}compute(){if(this._pending.length>0){const t=this._pending[0];this._pending=this._pending.slice(1);const e=l(this.pars.base,t);try{this.solutions.push(this._run(e,this.tStart,this.tEnd)),this.addRunStatus(t,!0,null)}catch(e){this.addRunStatus(t,!1,e.message)}}const t=0===this._pending.length;if(t&&0===this.solutions.length)throw Error(`All solutions failed; first error: ${this.errors[0].error}`);return t}run(){for(;!this.compute(););}valueAtTime(t){return function(t,e,r){return h(e,r.map((e=>e({mode:n.TimeMode.Given,times:[t]}))))}(t,this.successfulVaryingParams,this.solutions)}extreme(t){return this.findExtremes()[t]}findExtremes(){if(void 0===this._extremes){const i=(t={mode:n.TimeMode.Grid,nPoints:this._nPointsForExtremes,tEnd:this.tEnd,tStart:this.tStart},e=this.successfulVaryingParams,r=this.solutions,f(e,r.map((e=>e(t)))));if(0!==this._pending.length)return i;this._extremes=i}var t,e,r;return this._extremes}addRunStatus(t,e,r){this.runStatuses.push({pars:t,success:e,error:r})}}function u(t,e,r,n,o,s){const a=c(t,e);if(o>a)throw Error(`Expected lower bound to be no greater than ${a}`);if(s=s)throw Error("Expected upper bound to be greater than lower bound");if(r<2)throw Error("Must include at least 2 traces in the batch");if(n&&o<=0)throw Error("Lower bound must be greater than 0 for logarithmic scale");return{name:e,values:n?(0,i.gridLog)(o,s,r):(0,i.grid)(o,s,r)}}function l(t,e){return Object.assign(Object.assign({},t),e)}function c(t,e){const r=t[e];if(void 0===r)throw Error(`Expected a value for '${e}'`);if("number"!=typeof r)throw Error(`Expected a number for '${e}'`);return r}function h(t,e){const r={x:t,values:[]},n=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of n){const n=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;te[t].y[0]));r.values.push(Object.assign(Object.assign({},n[0][t]),{y:e}))}}return r}function f(t,e){const r=()=>({x:[...t],values:[]}),n={tMax:r(),tMin:r(),yMax:r(),yMin:r()};if(0===t.length)return n;const o=e[0].x,s=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of s){const r=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=r[0].length;for(let t=0;tp(o,e[t].y)));Object.keys(n).forEach((i=>{const o=i;n[o].values.push(Object.assign(Object.assign({},r[0][t]),{y:e.map((t=>t[o]))}))}))}}return n}function p(t,e){const r=(0,i.whichMin)(e),n=(0,i.whichMax)(e),o=t[r],s=t[n],a=e[r];return{tMax:s,tMin:o,yMax:e[n],yMin:a}}function d(t){const e=t.map((t=>t.length));if(e.every((t=>1===t)))return t;Math.max(...e);const r=v(t);for(let e=0;eObject.assign(Object.assign({},t[e][0]),{description:r}))));return t}function v(t){let e=null,r=[];return t.forEach((t=>{if(1===t.length){const r=t[0].description;if(null===e)e=r;else if(r!==e)throw Error(`Unexpected inconsistent descriptions: have ${e}, but given ${r}`)}else{const e=t.map((t=>t.description));if(0===r.length){if(e.some((t=>void 0===t)))throw Error("Expected all descriptions to be defined");r=e}else if(!(0,i.sameArrayContents)(e,r))throw Error(`Unexpected inconsistent descriptions: have [${r.join(", ")}], but given [${e.join(", ")}]`)}})),r}e.Batch=a,e.batchRun=function(t,e,r,n,i,s=!0){const u=new a(((e,r,n)=>(0,o.wodinRun)(t,e,r,n,i)),e,r,n);return s&&u.run(),u},e.batchPars=function(t,e){return{base:t,varying:e}},e.batchParsRange=u,e.batchParsDisplace=function(t,e,r,n,i){const o=c(t,e),s=i/100;return u(t,e,r,n,o*(1-s),o*(1+s))},e.updatePars=l,e.valueAtTimeResult=h,e.computeExtremesResult=f,e.alignDescriptionsGetLevels=v},458:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t,e,r,n){const i=t(e);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfSquares=e.updatePars=e.fitTarget=void 0;const n=r(653),i=r(134),o=r(822);function s(t,e){const r=Object.assign({},t.base);for(let n=0;n{const f=s(r,h),p=new t(n.base,f,"error"),d=(0,i.runModel)(p,null,0,c,l).solution,v=p.names(),_=v.indexOf(u),y=d(e.time).map((t=>t[_]));return{data:{endTime:c,names:v,pars:f,solution:(0,o.interpolatedSolution)(d,v,0,c),startTime:0},value:a(e.value,y)}}},e.updatePars=s,e.sumOfSquares=a},166:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.interpolateTimes=e.interpolateCheckT=e.interpolateCheckY=e.interpolateAlloc=void 0;const n=r(673);function i(t,e,r){const i=function(t,e){if(t.length===e)return[t];const r=[],n=t.length/e;for(let i=0;ir.max)throw Error(`Integration times do not span interpolation range; max: ${r.max}`);return r.max===1/0?n:(void 0===n&&(n=[]),[...n,r.max])},e.interpolateTimes=s,e.interpolate={alloc:i,checkY:o,times:s}},650:(t,e)=>{function r(t){return.5===i(t,1)?2*Math.round(t/2):Math.round(t)}function n(t,e){if(void 0===e||0===e)return r(t);{const n=Math.pow(10,e);return r(t*n)/n}}function i(t,e){let r=t%e;return r*e<0&&(r+=e),r}function o(t,e){return Math.floor(t/e)}function s(t,e,r){let n=0;for(let i=e;it.output(e,r,n)),null===e&&(e=t.initial(r)),t.getInternal().initial_t=r;const a=new s.DDE((function(e,r,n,i){t.rhs(e,r,n,i)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i):function(t,e,r,n,i){let o=null;"function"==typeof t.output&&(o=(e,r)=>t.output(e,r)),null===e&&(e=t.initial(r));const a=new s.Dopri((function(e,r,n){t.rhs(e,r,n)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i)}},586:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PkgWrapper=void 0;const n=r(653),i=r(134);e.PkgWrapper=class{constructor(t,e,r){this.model=new t(n.base,e,r)}initial(t){return this.model.initial(t)}rhs(t,e){const r=new Array(e.length).fill(0);let n=null;if(!(0,i.isODEModel)(this.model))throw Error("Can't use rhs() with delay models");return this.model,this.model.rhs(t,e,r),this.model.output&&(n=this.model.output(t,e)),{output:n,state:r}}getMetadata(){return this.model.getMetadata()}getInternal(){return this.model.getInternal()}setUser(t,e){this.model.setUser(t,e)}run(t,e,r){const n=t[0],o=t[t.length-1],s=(0,i.runModel)(this.model,e,n,o,r);return{names:this.model.names(),statistics:s.statistics,y:s.solution(t)}}}},822:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedSolution=e.TimeMode=void 0;const n=r(882);var i;!function(t){t.Grid="grid",t.Given="given"}(i=e.TimeMode||(e.TimeMode={})),e.interpolatedSolution=function(t,e,r,o){return s=>{const a=function(t,e,r){switch(t.mode){case i.Grid:return(0,n.grid)(Math.max(e,t.tStart),Math.min(r,t.tEnd),t.nPoints);case i.Given:return t.times}}(s,r,o),u=t(a);return{values:e.map(((t,r)=>({name:e[r],y:u.map((t=>t[r]))}))),x:a}}}},536:(t,e)=>{function r(t,e,r){if("ignore"===r)return;const n=[];for(const r of Object.keys(t))e.includes(r)||n.push(r);if(n.length>0){const t="Unknown user parameters: "+n.join(", ");if("message"===r)console.log(t);else{if("warning"!==r)throw"stop"===r?Error(t):Error(t+" (and invalid value for unusedUserAction)");console.warn(t)}}}function n(t,e,r,n,i,o,s){const a=t[e];if(void 0===a){if(void 0!==r[e])return;if(null===n)throw Error(`Expected a value for '${e}'`);r[e]=n}else{if("number"!=typeof a)throw Error(`Expected a number for '${e}'`);l(a,i,o,s,e),r[e]=a}}function i(t,e,r,n,i,o,l){let c=t[e];if(void 0===c){if(void 0!==r[e])return;throw Error(`Expected a value for '${e}'`)}{const t=n.length-1;c=s(c),a(t,c,e),function(t,e,r){const n=t.length-1;for(let i=0;ir)throw Error(`Expected '${i}' to be at most ${r}`);if(n&&!Number.isInteger(t))throw Error(`Expected '${i}' to be integer-like`)}Object.defineProperty(e,"__esModule",{value:!0}),e.user=e.setUserArrayVariable=e.setUserArrayFixed=e.setUserScalar=e.checkUser=void 0,e.checkUser=r,e.setUserScalar=n,e.setUserArrayFixed=i,e.setUserArrayVariable=o,e.user={checkUser:r,setUserArrayFixed:i,setUserArrayVariable:o,setUserScalar:n}},882:(t,e)=>{function r(t,e,r){const n=(e-t)/(r-1),i=[];for(let e=0;er&&(e=n,r=t[n]);return e},e.unique=function(t){return[...new Set(t)]},e.sameArrayContents=function(t,e){return t.length===e.length&&t.every(((t,r)=>e[r]===t))}},556:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{dfoptim:"0.0.5",dopri:"0.0.13",odinjs:"0.1.1"}}},915:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wodinFitValue=e.wodinFit=e.wodinRun=void 0;const n=r(153),i=r(653),o=r(410),s=r(134),a=r(822);e.wodinRun=function(t,e,r,n,o){const u=new t(i.base,e,"error"),l=(0,s.runModel)(u,null,r,n,o).solution,c=u.names();return(0,a.interpolatedSolution)(l,c,r,n)},e.wodinFit=function(t,e,r,i,s,a){const u=(0,o.fitTarget)(t,e,r,i,s),l=r.vary.map((t=>r.base[t]));return new n.Simplex(u,l,a)},e.wodinFitValue=function(t,e,r){const n=t({mode:a.TimeMode.Given,times:e.time}),i=n.values.findIndex((t=>t.name===r));return(0,o.sumOfSquares)(e.value,n.values[i].y)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}var n={};(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.versions=t.batchRun=t.batchParsRange=t.batchParsDisplace=t.Batch=t.TimeMode=t.base=t.PkgWrapper=t.wodinRun=t.wodinFitValue=t.wodinFit=void 0;var e=r(915);Object.defineProperty(t,"wodinFit",{enumerable:!0,get:function(){return e.wodinFit}}),Object.defineProperty(t,"wodinFitValue",{enumerable:!0,get:function(){return e.wodinFitValue}}),Object.defineProperty(t,"wodinRun",{enumerable:!0,get:function(){return e.wodinRun}});var i=r(586);Object.defineProperty(t,"PkgWrapper",{enumerable:!0,get:function(){return i.PkgWrapper}});var o=r(653);Object.defineProperty(t,"base",{enumerable:!0,get:function(){return o.base}});var s=r(822);Object.defineProperty(t,"TimeMode",{enumerable:!0,get:function(){return s.TimeMode}});var a=r(401);Object.defineProperty(t,"Batch",{enumerable:!0,get:function(){return a.Batch}}),Object.defineProperty(t,"batchParsDisplace",{enumerable:!0,get:function(){return a.batchParsDisplace}}),Object.defineProperty(t,"batchParsRange",{enumerable:!0,get:function(){return a.batchParsRange}}),Object.defineProperty(t,"batchRun",{enumerable:!0,get:function(){return a.batchRun}});var u=r(556);Object.defineProperty(t,"versions",{enumerable:!0,get:function(){return u.versions}})})(),odinjs=n})(); From 99e49e47829f7bcc6c9de2dbced696a943dcf58e Mon Sep 17 00:00:00 2001 From: EmmaLRussell Date: Wed, 30 Aug 2023 15:51:50 +0100 Subject: [PATCH 4/6] update dust js --- inst/js/dust.js | 2 +- inst/js/odin.js | 2 +- scripts/update_js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/js/dust.js b/inst/js/dust.js index 055b0fbf..e2de79fa 100644 --- a/inst/js/dust.js +++ b/inst/js/dust.js @@ -1,2 +1,2 @@ /*! For license information please see dust.js.LICENSE.txt */ -var dust;(()=>{var t={8006:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateSearch=e.InterpolatorBase=void 0;var r=function(){function t(t,e){(function(t){return Array.isArray(t[0])})(e)||(e=[e]),this._i=0,this._x=t,this._y=e,this.nX=this._x.length,this.nY=this._y.length;for(var r=0;r=s-1)return s;for(i=n+o;e[i]=s){if(e[i=s-1]t;){if(i=n,n<(o*=2)){if(e[n=0]>t)return-1;break}n-=o}}for(;i-n>1;){var a=Math.floor((i+n)/2);e[a]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorSpline=e.InterpolatorLinear=e.InterpolatorConstant=e.InterpolatorBase=void 0;var n=r(8006);Object.defineProperty(e,"InterpolatorBase",{enumerable:!0,get:function(){return n.InterpolatorBase}});var i=r(4731);Object.defineProperty(e,"InterpolatorConstant",{enumerable:!0,get:function(){return i.InterpolatorConstant}});var o=r(9477);Object.defineProperty(e,"InterpolatorLinear",{enumerable:!0,get:function(){return o.InterpolatorLinear}});var s=r(7869);Object.defineProperty(e,"InterpolatorSpline",{enumerable:!0,get:function(){return s.InterpolatorSpline}})},9477:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorLinear=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eval=function(t,e){void 0===e&&(e=0);var r=this.search(t,!1),n=this._x[r],i=(t-n)/(this._x[r+1]-n),o=this._y[e],s=o[r];return s+(o[r+1]-s)*i},e}(r(8006).InterpolatorBase);e.InterpolatorLinear=o},7869:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.solve=e.InterpolatorSpline=void 0;var s=o(r(8863)),a=function(t){function e(e,r){var n=t.call(this,e,r)||this,i=function(t){var e=t.length,r=Array(e),n=Array(e),i=Array(e);r[0]=0,n[0]=2/(t[1]-t[0]),i[0]=1/(t[1]-t[0]);for(var o=1;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;const n=r(3350),i=r(320),o=r(9928),s=r(2630);e.base={delay:n.delay,interpolate:i.interpolate,maths:o.maths,user:s.user}},7601:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.repairDeterministicDescription=e.computeExtremesResult=e.computeExtremes=e.valueAtTimeResult=e.valueAtTime=e.updatePars=e.batchParsDisplace=e.batchParsRange=e.batchRun=e.Batch=void 0;const n=r(46),i=r(1729),o=r(7466);class s{constructor(t,e,r,n){this.pars=Object.assign(Object.assign({},e),{values:[]}),this.tStart=r,this.tEnd=n,this.solutions=[],this.errors=[],this._pending=e.values,this._run=t}compute(){if(this._pending.length>0){const t=this._pending[0];this._pending=this._pending.slice(1);const e=u(this.pars.base,this.pars.name,t);try{this.solutions.push(this._run(e,this.tStart,this.tEnd)),this.pars.values.push(t)}catch(e){this.errors.push({value:t,error:e.message})}}const t=0===this._pending.length;if(t&&0===this.solutions.length)throw Error(`All solutions failed; first error: ${this.errors[0].error}`);return t}run(){for(;!this.compute(););}valueAtTime(t){return l(t,this.pars.values,this.solutions)}extreme(t){return this.findExtremes()[t]}findExtremes(){return void 0===this._extremes&&(this._extremes=h(this.tStart,this.tEnd,this.pars.values,this.solutions)),this._extremes}}function a(t,e,r,n,o,s){const a=c(t,e);if(o>a)throw Error(`Expected lower bound to be no greater than ${a}`);if(s=s)throw Error("Expected upper bound to be greater than lower bound");if(r<2)throw Error("Must include at least 2 traces in the batch");if(n&&o<=0)throw Error("Lower bound must be greater than 0 for logarithmic scale");return{base:t,name:e,values:n?(0,i.gridLog)(o,s,r):(0,i.grid)(o,s,r)}}function u(t,e,r){const n=Object.assign({},t);return n[e]=r,n}function c(t,e){const r=t[e];if(void 0===r)throw Error(`Expected a value for '${e}'`);if("number"!=typeof r)throw Error(`Expected a number for '${e}'`);return r}function l(t,e,r){return f(e,r.map((e=>e({mode:n.TimeMode.Given,times:[t]}))))}function f(t,e){const r={x:t,values:[]},n=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of n){const n=v(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;te[t].y[0]));r.values.push(Object.assign(Object.assign({},n[0][t]),{y:e}))}}return r}function h(t,e,r,i){const o={mode:n.TimeMode.Grid,nPoints:501,tEnd:e,tStart:t};return d(r,i.map((t=>t(o))))}function p(t,e){const r=(0,i.whichMin)(e),n=(0,i.whichMax)(e),o=t[r],s=t[n],a=e[r];return{tMax:s,tMin:o,yMax:e[n],yMin:a}}function d(t,e){const r=e[0].x,n=()=>({x:t,values:[]}),o={tMax:n(),tMin:n(),yMax:n(),yMin:n()},s=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of s){const n=v(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;tp(r,e[t].y)));Object.keys(o).forEach((r=>{const i=r;o[i].values.push(Object.assign(Object.assign({},n[0][t]),{y:e.map((t=>t[i]))}))}))}}return o}function v(t){const e=t.map((t=>t.length));if(e.every((t=>1===t)))return t;Math.max(...e);const r=y(t);for(let e=0;eObject.assign(Object.assign({},t[e][0]),{description:r}))));return t}function y(t){let e=null,r=[];return t.forEach((t=>{if(1===t.length){const r=t[0].description;if(null===e)e=r;else if(r!==e)throw Error(`Unexpected inconsistent descriptions: have ${e}, but given ${r}`)}else{const e=t.map((t=>t.description));if(0===r.length){if(e.some((t=>void 0===t)))throw Error("Expected all descriptions to be defined");r=e}else if(!(0,i.sameArrayContents)(e,r))throw Error(`Unexpected inconsistent descriptions: have [${r.join(", ")}], but given [${e.join(", ")}]`)}})),r}e.Batch=s,e.batchRun=function(t,e,r,n,i,a=!0){const u=new s(((e,r,n)=>(0,o.wodinRun)(t,e,r,n,i)),e,r,n);return a&&u.run(),u},e.batchParsRange=a,e.batchParsDisplace=function(t,e,r,n,i){const o=c(t,e),s=i/100;return a(t,e,r,n,o*(1-s),o*(1+s))},e.updatePars=u,e.valueAtTime=l,e.valueAtTimeResult=f,e.computeExtremes=h,e.computeExtremesResult=d,e.repairDeterministicDescription=y},3350:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t,e,r,n){const i=t(e);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfSquares=e.updatePars=e.fitTarget=void 0;const n=r(8251),i=r(1267),o=r(46);function s(t,e){const r=Object.assign({},t.base);for(let n=0;n{const h=s(r,f),p=new t(n.base,h,"error"),d=(0,i.runModel)(p,null,0,l,c).solution,v=p.names(),y=v.indexOf(u),m=d(e.time).map((t=>t[y]));return{data:{endTime:l,names:v,pars:h,solution:(0,o.interpolatedSolution)(d,v,0,l),startTime:0},value:a(e.value,m)}}},e.updatePars=s,e.sumOfSquares=a},1688:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.versions=e.batchRun=e.batchParsRange=e.batchParsDisplace=e.Batch=e.TimeMode=e.base=e.PkgWrapper=e.wodinRun=e.wodinFitValue=e.wodinFit=void 0;var n=r(7466);Object.defineProperty(e,"wodinFit",{enumerable:!0,get:function(){return n.wodinFit}}),Object.defineProperty(e,"wodinFitValue",{enumerable:!0,get:function(){return n.wodinFitValue}}),Object.defineProperty(e,"wodinRun",{enumerable:!0,get:function(){return n.wodinRun}});var i=r(8714);Object.defineProperty(e,"PkgWrapper",{enumerable:!0,get:function(){return i.PkgWrapper}});var o=r(8251);Object.defineProperty(e,"base",{enumerable:!0,get:function(){return o.base}});var s=r(46);Object.defineProperty(e,"TimeMode",{enumerable:!0,get:function(){return s.TimeMode}});var a=r(7601);Object.defineProperty(e,"Batch",{enumerable:!0,get:function(){return a.Batch}}),Object.defineProperty(e,"batchParsDisplace",{enumerable:!0,get:function(){return a.batchParsDisplace}}),Object.defineProperty(e,"batchParsRange",{enumerable:!0,get:function(){return a.batchParsRange}}),Object.defineProperty(e,"batchRun",{enumerable:!0,get:function(){return a.batchRun}});var u=r(7497);Object.defineProperty(e,"versions",{enumerable:!0,get:function(){return u.versions}})},320:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.interpolateTimes=e.interpolateCheckT=e.interpolateCheckY=e.interpolateAlloc=void 0;const n=r(9673);function i(t,e,r){const i=function(t,e){if(t.length===e)return[t];const r=[],n=t.length/e;for(let i=0;ir.max)throw Error(`Integration times do not span interpolation range; max: ${r.max}`);return void 0===n&&(n=r.max),n},e.interpolateTimes=s,e.interpolate={alloc:i,checkY:o,times:s}},9928:(t,e)=>{"use strict";function r(t){return.5===i(t,1)?2*Math.round(t/2):Math.round(t)}function n(t,e){if(void 0===e||0===e)return r(t);{const n=Math.pow(10,e);return r(t*n)/n}}function i(t,e){let r=t%e;return r*e<0&&(r+=e),r}function o(t,e){return Math.floor(t/e)}function s(t,e,r){let n=0;for(let i=e;it.output(e,r,n)),null===e&&(e=t.initial(r)),t.getInternal().initial_t=r;const a=new s.DDE((function(e,r,n,i){t.rhs(e,r,n,i)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i):function(t,e,r,n,i){let o=null;"function"==typeof t.output&&(o=(e,r)=>t.output(e,r)),null===e&&(e=t.initial(r));const a=new s.Dopri((function(e,r,n){t.rhs(e,r,n)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i)}},8714:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PkgWrapper=void 0;const n=r(8251),i=r(1267);e.PkgWrapper=class{constructor(t,e,r){this.model=new t(n.base,e,r)}initial(t){return this.model.initial(t)}rhs(t,e){const r=new Array(e.length).fill(0);let n=null;if(!(0,i.isODEModel)(this.model))throw Error("Can't use rhs() with delay models");return this.model,this.model.rhs(t,e,r),this.model.output&&(n=this.model.output(t,e)),{output:n,state:r}}getMetadata(){return this.model.getMetadata()}getInternal(){return this.model.getInternal()}setUser(t,e){this.model.setUser(t,e)}run(t,e,r){const n=t[0],o=t[t.length-1],s=(0,i.runModel)(this.model,e,n,o,r);return{names:this.model.names(),statistics:s.statistics,y:s.solution(t)}}}},46:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedSolution=e.TimeMode=void 0;const n=r(1729);var i;!function(t){t.Grid="grid",t.Given="given"}(i=e.TimeMode||(e.TimeMode={})),e.interpolatedSolution=function(t,e,r,o){return s=>{const a=function(t,e,r){switch(t.mode){case i.Grid:return(0,n.grid)(Math.max(e,t.tStart),Math.min(r,t.tEnd),t.nPoints);case i.Given:return t.times}}(s,r,o),u=t(a);return{values:e.map(((t,r)=>({name:e[r],y:u.map((t=>t[r]))}))),x:a}}}},2630:(t,e)=>{"use strict";function r(t,e,r){if("ignore"===r)return;const n=[];for(const r of Object.keys(t))e.includes(r)||n.push(r);if(n.length>0){const t="Unknown user parameters: "+n.join(", ");if("message"===r)console.log(t);else{if("warning"!==r)throw"stop"===r?Error(t):Error(t+" (and invalid value for unusedUserAction)");console.warn(t)}}}function n(t,e,r,n,i,o,s){const a=t[e];if(void 0===a){if(void 0!==r[e])return;if(null===n)throw Error(`Expected a value for '${e}'`);r[e]=n}else{if("number"!=typeof a)throw Error(`Expected a number for '${e}'`);c(a,i,o,s,e),r[e]=a}}function i(t,e,r,n,i,o,c){let l=t[e];if(void 0===l){if(void 0!==r[e])return;throw Error(`Expected a value for '${e}'`)}{const t=n.length-1;l=s(l),a(t,l,e),function(t,e,r){const n=t.length-1;for(let i=0;ir)throw Error(`Expected '${i}' to be at most ${r}`);if(n&&!Number.isInteger(t))throw Error(`Expected '${i}' to be integer-like`)}Object.defineProperty(e,"__esModule",{value:!0}),e.user=e.setUserArrayVariable=e.setUserArrayFixed=e.setUserScalar=e.checkUser=void 0,e.checkUser=r,e.setUserScalar=n,e.setUserArrayFixed=i,e.setUserArrayVariable=o,e.user={checkUser:r,setUserArrayFixed:i,setUserArrayVariable:o,setUserScalar:n}},1729:(t,e)=>{"use strict";function r(t,e,r){const n=(e-t)/(r-1),i=[];for(let e=0;er&&(e=n,r=t[n]);return e},e.unique=function(t){return[...new Set(t)]},e.sameArrayContents=function(t,e){return t.length===e.length&&t.every(((t,r)=>e[r]===t))}},7497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{dfoptim:"0.0.5",dopri:"0.0.12",odinjs:"0.1.1"}}},7466:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wodinFitValue=e.wodinFit=e.wodinRun=void 0;const n=r(4153),i=r(8251),o=r(7771),s=r(1267),a=r(46);e.wodinRun=function(t,e,r,n,o){const u=new t(i.base,e,"error"),c=(0,s.runModel)(u,null,r,n,o).solution,l=u.names();return(0,a.interpolatedSolution)(c,l,r,n)},e.wodinFit=function(t,e,r,i,s,a){const u=(0,o.fitTarget)(t,e,r,i,s),c=r.vary.map((t=>r.base[t]));return new n.Simplex(u,c,a)},e.wodinFitValue=function(t,e,r){const n=t({mode:a.TimeMode.Given,times:e.time}),i=n.values.findIndex((t=>t.name===r));return(0,o.sumOfSquares)(e.value,n.values[i].y)}},7689:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.binomial=void 0,e.binomial=function(t,e,r){if(0===e||0===r)return 0;if(1===r)return e;const o=r<=.5?r:1-r,s=e*o>=10?function(t,e,r){const i=Math.sqrt(e*r*(1-r)),o=1.15+2.53*i,s=.0248*o-.0873+.01*r,a=e*r+.5,u=.92-4.2/o,c=r/(1-r),l=(2.83+5.1/o)*i,f=Math.floor((e+1)*r);let h;for(;;){const r=t.random()-.5;let i=t.random();const p=.5-Math.abs(r),d=Math.floor((2*s/p+o)*r+a);if(p>=.07&&i<=u){h=d;break}if(!(d<0||d>e)&&(i=Math.log(i*l/(s/(p*p)+o)),i<=(f+.5)*Math.log((f+1)/(c*(e-f+1)))+(e+1)*Math.log((e-f+1)/(e-d+1))+(d+.5)*Math.log(c*(e-d+1)/(d+1))+n(f)+n(e-f)-n(d)-n(e-d))){h=d;break}}return h}(t,e,o):function(t,e,r){let n=-1;do{n=i(t.random(),e,r)}while(n<0);return n}(t,e,o);return r<=.5?s:e-s};const r=[.08106146679532733,.04134069595540946,.02767792568499805,.02079067210376495,.016644691189821703,.013876128823071987,.011896709945892425,.010411265261971892,.00925546218270945,.008330563433359472];function n(t){return t=s;)t-=s,a++,s*=o/a-i,u=s;return a}},9386:(t,e)=>{"use strict";function r(t){return-Math.log(t.random())}Object.defineProperty(e,"__esModule",{value:!0}),e.exponential=e.randomExponential=void 0,e.randomExponential=r,e.exponential=function(t,e){return r(t)/e}},6532:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniform=e.randomUniform=e.randomNormal=e.normal=e.randomExponential=e.exponential=e.binomial=e.RngStateReplay=e.RngStateObserved=e.RngStateBuiltin=e.RngState=e.Random=void 0;var n=r(1929);Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return n.Random}});var i=r(3726);Object.defineProperty(e,"RngState",{enumerable:!0,get:function(){return i.RngState}});var o=r(2035);Object.defineProperty(e,"RngStateBuiltin",{enumerable:!0,get:function(){return o.RngStateBuiltin}});var s=r(2301);Object.defineProperty(e,"RngStateObserved",{enumerable:!0,get:function(){return s.RngStateObserved}});var a=r(5843);Object.defineProperty(e,"RngStateReplay",{enumerable:!0,get:function(){return a.RngStateReplay}});var u=r(7689);Object.defineProperty(e,"binomial",{enumerable:!0,get:function(){return u.binomial}});var c=r(9386);Object.defineProperty(e,"exponential",{enumerable:!0,get:function(){return c.exponential}}),Object.defineProperty(e,"randomExponential",{enumerable:!0,get:function(){return c.randomExponential}});var l=r(2638);Object.defineProperty(e,"normal",{enumerable:!0,get:function(){return l.normal}}),Object.defineProperty(e,"randomNormal",{enumerable:!0,get:function(){return l.randomNormal}});var f=r(6390);Object.defineProperty(e,"randomUniform",{enumerable:!0,get:function(){return f.randomUniform}}),Object.defineProperty(e,"uniform",{enumerable:!0,get:function(){return f.uniform}})},2638:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normal=e.randomNormal=void 0;const r=2*Math.PI;function n(t){let e=0,n=0;do{e=t.random(),n=t.random()}while(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.poisson=void 0;const n=r(7788);e.poisson=function(t,e){return e<10?function(t,e){let r=0;const n=Math.exp(-e);let o=1;for(;o*=t.random(),!(o<=n&&r<=i);)r++;return r}(t,e):function(t,e){let r=0;const i=Math.log(e),o=.931+2.53*Math.sqrt(e),s=.02483*o-.059,a=1.1239+1.1328/(o-3.4);for(;;){let u=t.random();u-=.5;const c=t.random(),l=.5-Math.abs(u),f=Math.floor((2*s/l+o)*u+e+.43);if(l>=.07&&c<=.9277-3.6224/(o-2)){r=f;break}if(!(f<0||l<.013&&c>l)&&Math.log(c*a/(s/(l*l)+o))<=f*i-e-(0,n.lngamma)(f+1)){r=f;break}}return r}(t,e)};const i=2**31-1},1929:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Random=void 0;const n=r(7689),i=r(9386),o=r(2638),s=r(5789),a=r(6390);e.Random=class{state;constructor(t){this.state=t}randomExponential(){return(0,i.randomExponential)(this.state)}randomNormal(){return(0,o.randomNormal)(this.state)}randomUniform(){return(0,a.randomUniform)(this.state)}binomial(t,e){return(0,n.binomial)(this.state,t,e)}exponential(t){return(0,i.exponential)(this.state,t)}normal(t,e){return(0,o.normal)(this.state,t,e)}poisson(t){return(0,s.poisson)(this.state,t)}uniform(t,e){return(0,a.uniform)(this.state,t,e)}}},2035:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngStateBuiltin=void 0;const n=r(3726);class i extends n.RngState{constructor(){super()}random(){return Math.random()}}e.RngStateBuiltin=i},2301:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngStateObserved=void 0;const n=r(3726),i=r(2035),o=r(5843);class s extends n.RngState{_state;_values;constructor(t){super(),void 0===t&&(t=new i.RngStateBuiltin),this._state=t,this._values=[]}random(){const t=this._state.random();return this._values.push(t),t}replay(){return new o.RngStateReplay(this._values)}length(){return this._values.length}values(){return this._values}}e.RngStateObserved=s},5843:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngStateReplay=void 0;const n=r(3726);class i extends n.RngState{_i;_values;constructor(t){super(),this._i=0,this._values=t}random(){const t=this._values[this._i++];if(this._i>this._values.length)throw Error("Exhausted stream");return t}length(){return this._values.length-this._i}}e.RngStateReplay=i},3726:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngState=void 0,e.RngState=class{setSeed(t){throw Error("This generator cannot be seeded (really!)")}}},6390:(t,e)=>{"use strict";function r(t){return t.random()}Object.defineProperty(e,"__esModule",{value:!0}),e.uniform=e.randomUniform=void 0,e.randomUniform=r,e.uniform=function(t,e,n){return r(t)*(n-e)+e}},4394:(t,e)=>{"use strict";function r(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.simplexControl=void 0,e.simplexControl=function(t){void 0===t&&(t={});var e={deltaNonZero:r(t.deltaNonZero,.05),deltaZero:r(t.deltaZero,.001),errorOnFailure:r(t.errorOnFailure,!1),tolerance:r(t.tolerance,1e-5)};if(e.tolerance<=0)throw new Error("Invalid control parameter: 'tolerance' must be strictly positive");return e}},4153:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2169);Object.defineProperty(e,"Simplex",{enumerable:!0,get:function(){return n.Simplex}}),Object.defineProperty(e,"fitSimplex",{enumerable:!0,get:function(){return n.fitSimplex}})},2169:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Simplex=e.fitSimplex=void 0;var n=r(4394),i=r(2003);function o(t,e,r){for(var n=e.length,i=new Array(n),o=1+t,s=-t,a=0;a=this._simplex[t-1].value){var s=i.value>r.value?this._contractInside(r,n):this._contractOutside(r,n);if(s.value{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkResult=void 0,e.checkResult=function(t){return"number"==typeof t?{data:null,value:t}:t}},2886:(t,e)=>{"use strict";function r(t,e){return new Error("Invalid control parameter: '".concat(t,"' ").concat(e))}function n(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.dopriControl=void 0,e.dopriControl=function(t){void 0===t&&(t={});var e=1e-6,i=1e4,o=1e-6,s=1/0,a=1e-8,u=!1,c=0,l=1/0,f={atol:n(t.atol,e),maxSteps:n(t.maxSteps,i),rtol:n(t.rtol,o),stepSizeMax:n(t.stepSizeMax,s),stepSizeMin:n(t.stepSizeMin,a),stepSizeMinAllow:n(t.stepSizeMinAllow,u),stiffCheck:n(t.stiffCheck,c),tcrit:n(t.tcrit,l)};if(f.maxSteps<1)throw r("maxSteps","must be at least 1");if(f.atol<=0)throw r("atol","must be strictly positive");if(f.rtol<=0)throw r("rtol","must be strictly positive");return f}},8742:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDE=e.integrateDDE=void 0;var o=r(2223),s=r(4660);e.integrateDDE=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new a(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var a=function(t){function e(e,r,n,i){void 0===n&&(n={}),void 0===i&&(i=null);var o=this,s=function(t){return o._interpolate(t)},a=null===i?null:function(t,e){return i(t,e,s)};return(o=t.call(this,(function(t,r,n){return e(t,r,n,s)}),r,n,a)||this)._y0=new Array(r),o}return i(e,t),e.prototype.initialise=function(e,r){return this._y0=r,t.prototype.initialise.call(this,e,r),this},e.prototype._interpolate=function(t){var e=this._findHistory(t);return e<0?this._y0.slice(0):this._stepper.interpolate(t,this._history[e])},e.prototype._findHistory=function(t){return(0,s.search)(this._history,(function(e){return e.t>t}))},e}(o.Dopri);e.DDE=a},2223:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri=e.integrateDopri=void 0;var s=r(2886),a=o(r(2922)),u=r(1216),c=o(r(4660)),l=Math.pow(2,-52);function f(t,e){return new Error("Integration failure: ".concat(t," at ").concat(e))}e.integrateDopri=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new h(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var h=function(){function t(t,e,r,n){void 0===r&&(r={}),void 0===n&&(n=null),this._history=[],this._t=0,this._h=0,this._nSteps=0,this._nStepsAccepted=0,this._nStepsRejected=0,this._stiffNStiff=0,this._stiffNNonstiff=0,this._lastError=0,this._stepper=new a.Dopri5(t,e),this._control=(0,s.dopriControl)(r),this._output=n}return t.prototype.initialise=function(t,e){var r=this._stepper.n;if(e.length!==r)throw Error("Invalid size 'y' - expected a length ".concat(r," array"));return this._stepper.reset(t,e),this._reset(),this._h=function(t,e,r,n,i,o){var s=new Array(t.n),a=new Array(t.n),u=new Array(t.n);t.rhs(e,r,s),t.nEval++;var l=0,f=0,h=0;for(h=0;hs.maxSteps)throw f("too many steps",t);if(es.tcrit&&(e=s.tcrit-t),this._stepper.step(t,e),this._nSteps++;var a=this._stepper.error(s.atol,s.rtol),u=Math.pow(a,o.constant),h=1/o.factorMin,p=1/o.factorMax;if(a<=1){if(r=!0,this._nStepsAccepted++,this._isStiff(e))throw f("problem became stiff",t);this._stepper.stepComplete(t,e);var d=u/Math.pow(i,o.beta),v=e/(d=c.constrain(d/o.factorSafe,p,h));this._t+=e,this._h=n?Math.min(v,e):Math.min(v,s.stepSizeMax),this._lastError=a}else n=!0,this._nStepsAccepted>=1&&this._nStepsRejected++,e/=Math.min(h,u/o.factorSafe)}return this._t},t.prototype._isStiff=function(t){if(this._stiffNStiff>0||this._nStepsAccepted%this._control.stiffCheck==0)if(this._stepper.isStiff(t)){if(this._stiffNNonstiff=0,this._stiffNStiff++>=15)return!0}else this._stiffNStiff>0&&this._stiffNNonstiff++>=6&&(this._stiffNStiff=0,this._stiffNNonstiff=0);return!1},t}();e.Dopri=h},7134:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5StepControl=void 0;e.Dopri5StepControl=function(){this.factorSafe=.9,this.factorMin=.2,this.factorMax=10,this.beta=.04,this.constant=.2-.75*this.beta}},2922:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5=void 0;var s=o(r(4660)),a=o(r(7134)),u=r(8430),c=function(){function t(t,e){this.order=5,this.stepControl=new a.Dopri5StepControl,this.nEval=0,this.rhs=t,this.n=e,this.y=new Array(e),this.yNext=new Array(e),this.yStiff=new Array(e),this.k1=new Array(e),this.k2=new Array(e),this.k3=new Array(e),this.k4=new Array(e),this.k5=new Array(e),this.k6=new Array(e),this.history=new u.HistoryElement(this.order*e)}return t.prototype.step=function(t,e){var r=this.n,n=this.y,i=this.yNext,o=this.k1,s=this.k2,a=this.k3,u=this.k4,c=this.k5,l=this.k6,f=this.history.data,h=0;for(h=0;h0&&Math.abs(t)*Math.sqrt(e/r)>3.25},t.prototype.reset=function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var r=function(){function t(t){this.t=0,this.h=0,this.data=new Array(t)}return t.prototype.clone=function(){var e=new t(this.data.length);return e.t=this.t,e.h=this.h,e.data=this.data.slice(0),e},t}();e.HistoryElement=r},6245:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=e.integrateDDE=e.DDE=e.integrateDopri=e.Dopri=void 0;var n=r(2223);Object.defineProperty(e,"Dopri",{enumerable:!0,get:function(){return n.Dopri}}),Object.defineProperty(e,"integrateDopri",{enumerable:!0,get:function(){return n.integrateDopri}});var i=r(8742);Object.defineProperty(e,"DDE",{enumerable:!0,get:function(){return i.DDE}}),Object.defineProperty(e,"integrateDDE",{enumerable:!0,get:function(){return i.integrateDDE}});var o=r(5961);Object.defineProperty(e,"integrate",{enumerable:!0,get:function(){return o.integrate}})},5961:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=void 0;var n=r(8742),i=r(2223);e.integrate=function(t,e,r,o,s,a){if(void 0===s&&(s={}),void 0===a&&(a=null),function(t){return 3===t.length}(t)){if(!function(t){return null===t||2===t.length}(a))throw new Error("Can't used delayed output with non-delayed rhs");return(0,i.integrateDopri)(t,e,r,o,s,a)}if(!function(t){return null===t||3===t.length}(a))throw new Error("Can't used non-delayed output with delayed rhs");return(0,n.integrateDDE)(t,e,r,o,s,a)}},1216:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolator=void 0,e.interpolator=function(t,e,r){return function(n){return function(t,e,r,n){for(var i=[],o=e,s=0,a=0,u=t;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var n=r(1606);Object.defineProperty(e,"HistoryElement",{enumerable:!0,get:function(){return n.HistoryElement}})},4660:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.seqLen=e.approxEqualArray=e.approxEqual=e.zeros=e.copyArray=e.constrain=e.square=void 0;var r=Math.pow(2,-26);e.square=function(t){return t*t},e.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},e.copyArray=function(t,e){for(var r=t.length,n=0;nn&&(i/=o),in&&(o/=i),o1;){var i=Math.floor((r+n)/2);e(t[i])?n=i:r=i}return r}},7788:(t,e)=>{var r,n=function(){"use strict";var t=new DataView(new ArrayBuffer(8)),e=function(e,r,n){var i,o,s,a=-.16666666666666632,u=0;return t.setFloat64(0,e),u=t.getInt32(0),(u&=2147483647)<1044381696&&0==(0|e)?e:(s=(i=e*e)*e,o=.00833333333332249+i*(i*(27557313707070068e-22+i*(1.58969099521155e-10*i-2.5050760253406863e-8))-.0001984126982985795),0===n?e+s*(a+i*o):e-(i*(.5*r-s*o)-r-s*a))},r=function(e,r){var n,i,o,s=0;return t.setFloat64(0,e),s=t.getInt32(0),(s&=2147483647)<1044381696&&0==(0|e)?1:(i=(n=e*e)*(.0416666666666666+n*(n*(2480158728947673e-20+n*(n*(2.087572321298175e-9+-11359647557788195e-27*n)-2.7557314351390663e-7))-.001388888888887411)),s<1070805811?1-(.5*n-(n*i-e*r)):(s>1072234496?o=.28125:(t.setFloat64(0,o),t.setUint32(0,s-2097152),t.setUint32(4,0),o=t.getFloat64(0)),1-o-(.5*n-o-(n*i-e*r))))},n=function(n){var i,o,s,a,u,c,l,f,h=1.4616321449683622,p=0,d=0;if(t.setFloat64(0,n),c=t.getInt32(0),l=t.getInt32(4),(f=2147483647&c)>=2146435072)return n*n;if(0==(f|l))return 1/0;if(f<999292928)return c<0?-Math.log(-n):-Math.log(n);if(c<0){if(f>=1127219200)return 1/0;if(i=function(n){var i,o=0,s=0;if(t.setFloat64(0,n),s=t.getInt32(0),(s&=2147483647)<1070596096)return e(Math.PI*n,0,0);switch(i=-n,Math.floor(i)!=i?o=4*(i=2*((i*=.5)-Math.floor(i)))|0:s>=1128267776?(i=0,o=0):(o=t.getInt32(4),i=o&=1,o<<=2),o){case 0:i=e(Math.PI*i,0,0);break;case 1:case 2:i=r(Math.PI*(.5-i),0);break;case 3:case 4:i=e(Math.PI*(1-i),0,0);break;case 5:case 6:i=-r(Math.PI*(i-1.5),0);break;default:i=e(Math.PI*(i-2),0,0)}return-i}(n),0==i)return 1/0;p=Math.log(3.141592653589793/Math.abs(i*n)),n=-n}if(0==(f-1072693248|l)||0==(f-1073741824|l))a=0;else if(f<1073741824)switch(f<=1072483532?(a=-Math.log(n),f>=1072130372?(o=1-n,d=0):f>=1070442081?(o=n-(h-1),d=1):(o=n,d=2)):(a=0,f>=1073460419?(o=2-n,d=0):f>=1072936132?(o=n-h,d=1):(o=n-1,d=2)),d){case 0:a+=o*(.07721566490153287+(s=o*o)*(.06735230105312927+s*(.007385550860814029+s*(.0011927076318336207+s*(.00022086279071390839+25214456545125733e-21*s)))))+s*(.3224670334241136+s*(.020580808432516733+s*(.0028905138367341563+s*(.0005100697921535113+s*(.00010801156724758394+44864094961891516e-21*s)))))-.5*o;break;case 1:a+=(s=o*o)*(.48383612272381005+(u=s*o)*(u*(.006100538702462913+u*(.00031563207090362595*u-.0014034646998923284))-.032788541075985965))-(-3638676997039505e-33-u*(u*(.01797067508118204+u*(u*(.000881081882437654+-.00031275416837512086*u)-.0036845201678113826))-.1475877229945939+o*(.06462494023913339+u*(u*(.0022596478090061247+u*(.0003355291926355191*u-.0005385953053567405))-.010314224129834144))))-.12148629053584961;break;case 2:a+=-.5*o+o*(o*(.6328270640250934+o*(1.4549225013723477+o*(.9777175279633727+o*(.22896372806469245+.013381091853678766*o))))-.07721566490153287)/(1+o*(2.4559779371304113+o*(2.128489763798934+o*(.7692851504566728+o*(.10422264559336913+.003217092422824239*o)))))}else if(f<1075838976)switch(i=0,a=.5*(o=n-(d=0|n))+o*(o*(.21498241596060885+o*(.325778796408931+o*(.14635047265246445+o*(.02664227030336386+o*(.0018402845140733772+3194753265841009e-20*o)))))-.07721566490153287)/(1+o*(1.3920053346762105+o*(.7219355475671381+o*(.17193386563280308+o*(.01864591917156529+o*(.0007779424963818936+7326684307446256e-21*o)))))),s=1,d){case 7:s*=o+6;case 6:s*=o+5;case 5:s*=o+4;case 4:s*=o+3;case 3:s*=o+2,a+=Math.log(s)}else a=f<1133510656?(n-.5)*((i=Math.log(n))-1)+(u=.4189385332046727+(s=1/n)*(.08333333333333297+(o=s*s)*(o*(.0007936505586430196+o*(o*(.0008363399189962821+-.0016309293409657527*o)-.00059518755745034))-.0027777777772877554))):n*(Math.log(n)-1);return c<0&&(a=p-a),a};return{lngamma:function(t){return n(t)},gamma:function(t){return Math.exp(n(t))}}}();void 0!==t.exports?t.exports=n:void 0===(r=function(){return n}.apply(e,[]))||(t.exports=r)},6907:t=>{"use strict";t.exports=function(t){for(var e=new Array(t),r=0;r{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},2861:(t,e,r)=>{var n=r(6907),i=r(8738),o="undefined"!=typeof Float64Array;function s(t,e){return t[0]-e[0]}function a(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+l+",v)}"):o.push("return this.data["+l+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+l+")}"):o.push("return this.data["+l+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+l+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+s.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var p=s.map((function(t){return"a"+t+"=this.shape["+t+"]"})),d=s.map((function(t){return"c"+t+"=this.stride["+t+"]"}));o.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var v=0;v=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");for(o.push("return new "+r+"(this.data,"+s.map((function(t){return"a"+t})).join(",")+","+s.map((function(t){return"c"+t})).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+s.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),v=0;v=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map((function(t){return"shape["+t+"]"})).join(",")+","+s.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(c[t],a)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};t.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var a=s-1,l=1;a>=0;--a)r[a]=l,l*=e[a]}if(void 0===n)for(n=0,a=0;a{"use strict";t.exports=function(t,e,r,n,i){var o,s;for(o=1;o=0;o--){if(0===r[o])return console.log("tridiagonalSolve: failed due to singular matrix"),!1;i[o]=(i[o]-n[o]*i[o+1])/r[o]}return!0}},5653:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;var n=r(1688),i=n.base.maths,o=n.base.user;e.base={maths:i,user:o}},9133:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dust=void 0;var n=r(6532),i=r(5653),o=r(217),s=r(2367),a=r(8177),u=function(){function t(t,e,r,s,a){if(r<=0)throw Error("Expected at least one particle");this._Model=t,this._particles=[],this._random=a||new n.Random(new n.RngStateBuiltin);for(var u=new t(i.base,e,"ignore"),c=0;c=r)throw Error("Expected index to be in [0, ".concat(r-1,"]")+" but given ".concat(o));n.setState(e._particles[o].state(),!0)})),this.forEachParticle((function(t,e){t.swap()}))},t.prototype.forEachParticle=function(t){this._particles.forEach(t)},t.prototype.checkState=function(t){if(t.length!==this.nParticles())throw Error("Invalid length state, expected ".concat(this.nParticles())+" but given ".concat(t.length));for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.variableNames=e.PkgWrapper=void 0;var n=r(6532),i=r(5653),o=r(9133),s=r(9882),a=function(){function t(t,e,r,o){this.Model=t,this.pars=e,this.random=new n.Random(o||new n.RngStateBuiltin),this.model=new this.Model(i.base,e,r)}return t.random=function(t){return new n.Random(t)},t.prototype.setUser=function(t,e){this.pars=t,this.model=new this.Model(i.base,t,e)},t.prototype.initial=function(t){return this.model.initial(t)},t.prototype.update=function(t,e){var r=Array(e.length).fill(0);return this.model.update(t,e,r,this.random),r},t.prototype.getInternal=function(){return this.model.getInternal()},t.prototype.getMetadata=function(){var t=this.model.info();return{info:t,names:u(t),size:this.model.size()}},t.prototype.run=function(t,e){var r=t[0],n=new o.Dust(this.Model,this.pars,1,r,this.random);null!==e&&n.setState([e]);var i=n.simulate(t,null);return{size:this.model.size(),y:Array.from(i.state.data)}},t}();function u(t){for(var e=[],r=function(t){var r=t.dim,n=t.name;0===r.length?e.push(n):e.push.apply(e,(0,s.combinations)(r).map((function(t){return"".concat(n,"[").concat(t.join(","),"]")})))},n=0,i=t;n1;){var o=Math.floor((n+i)/2);e(t[o])?i=o:n=o}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.findClosest=e.meanArray=e.mean=e.applyArray=e.isEqualArray=e.combinations=e.seqBy=e.seq=void 0,e.seq=n,e.seqBy=function(t,e,r){for(var n=[],i=t;i<=e;i+=r)n.push(i);return n},e.combinations=function t(e){var i=n(1,e[0]);if(e.length>1){for(var o=[],s=0,a=t(e.slice(1));s=t}));return e[r]===t||0===r?r:r===e.length?e.length-1:t-e[r-1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{random:"0.0.3",odinjs:"0.1.1",dust:"0.0.4"}}},7915:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1&&!(0,s.isEqualArray)(l,o)&&(a=!0)}if(a){var f=u.map((function(e){return{description:"Individual",name:t,y:e}}));return r.map((function(e){f.push({description:e.description,name:t,y:(0,s.applyArray)(u,e.summary)})})),f}return[{description:"Deterministic",name:t,y:o}]}function p(t){return function(e){return d(t(e))}}function d(t){var e=t.values.filter((function(t){return"Individual"!==t.description}));return{x:t.x,values:e}}e.runModelDiscrete=a,e.wodinRunDiscrete=u,e.tidyDiscreteSolution=c,e.filterIndex=l,e.filterSolution=f,e.tidyDiscreteSolutionVariable=h,e.batchRunDiscrete=function(t,e,r,n,o,s,a){return new i.Batch((function(e,r,n){return p(u(t,e,r,n,o,s,a))}),e,r,n)},e.summaryOnly=p,e.filterToSummaryOnly=d}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}var n={};(()=>{"use strict";var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.batchParsRange=t.batchParsDisplace=t.wodinRunDiscrete=t.batchRunDiscrete=t.versions=t.DustStateTime=t.dustStateTime=t.DustState=t.dustState=t.PkgWrapper=t.Particle=t.Dust=t.base=void 0;var e=r(5653);Object.defineProperty(t,"base",{enumerable:!0,get:function(){return e.base}});var i=r(9133);Object.defineProperty(t,"Dust",{enumerable:!0,get:function(){return i.Dust}});var o=r(217);Object.defineProperty(t,"Particle",{enumerable:!0,get:function(){return o.Particle}});var s=r(586);Object.defineProperty(t,"PkgWrapper",{enumerable:!0,get:function(){return s.PkgWrapper}});var a=r(2367);Object.defineProperty(t,"dustState",{enumerable:!0,get:function(){return a.dustState}}),Object.defineProperty(t,"DustState",{enumerable:!0,get:function(){return a.DustState}});var u=r(8177);Object.defineProperty(t,"dustStateTime",{enumerable:!0,get:function(){return u.dustStateTime}}),Object.defineProperty(t,"DustStateTime",{enumerable:!0,get:function(){return u.DustStateTime}});var c=r(9556);Object.defineProperty(t,"versions",{enumerable:!0,get:function(){return c.versions}});var l=r(7915);Object.defineProperty(t,"batchRunDiscrete",{enumerable:!0,get:function(){return l.batchRunDiscrete}}),Object.defineProperty(t,"wodinRunDiscrete",{enumerable:!0,get:function(){return l.wodinRunDiscrete}});var f=r(1688);Object.defineProperty(t,"batchParsDisplace",{enumerable:!0,get:function(){return f.batchParsDisplace}}),Object.defineProperty(t,"batchParsRange",{enumerable:!0,get:function(){return f.batchParsRange}})})(),dust=n})(); +var dust;(()=>{var t={8006:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateSearch=e.InterpolatorBase=void 0;var r=function(){function t(t,e){(function(t){return Array.isArray(t[0])})(e)||(e=[e]),this._i=0,this._x=t,this._y=e,this.nX=this._x.length,this.nY=this._y.length;for(var r=0;r=s-1)return s;for(i=n+o;e[i]=s){if(e[i=s-1]t;){if(i=n,n<(o*=2)){if(e[n=0]>t)return-1;break}n-=o}}for(;i-n>1;){var a=Math.floor((i+n)/2);e[a]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorSpline=e.InterpolatorLinear=e.InterpolatorConstant=e.InterpolatorBase=void 0;var n=r(8006);Object.defineProperty(e,"InterpolatorBase",{enumerable:!0,get:function(){return n.InterpolatorBase}});var i=r(4731);Object.defineProperty(e,"InterpolatorConstant",{enumerable:!0,get:function(){return i.InterpolatorConstant}});var o=r(9477);Object.defineProperty(e,"InterpolatorLinear",{enumerable:!0,get:function(){return o.InterpolatorLinear}});var s=r(7869);Object.defineProperty(e,"InterpolatorSpline",{enumerable:!0,get:function(){return s.InterpolatorSpline}})},9477:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorLinear=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eval=function(t,e){void 0===e&&(e=0);var r=this.search(t,!1),n=this._x[r],i=(t-n)/(this._x[r+1]-n),o=this._y[e],s=o[r];return s+(o[r+1]-s)*i},e}(r(8006).InterpolatorBase);e.InterpolatorLinear=o},7869:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.solve=e.InterpolatorSpline=void 0;var s=o(r(8863)),a=function(t){function e(e,r){var n=t.call(this,e,r)||this,i=function(t){var e=t.length,r=Array(e),n=Array(e),i=Array(e);r[0]=0,n[0]=2/(t[1]-t[0]),i[0]=1/(t[1]-t[0]);for(var o=1;o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;const n=r(3350),i=r(320),o=r(9928),s=r(2630);e.base={delay:n.delay,interpolate:i.interpolate,maths:o.maths,user:s.user}},7601:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.alignDescriptionsGetLevels=e.computeExtremesResult=e.valueAtTimeResult=e.updatePars=e.batchParsDisplace=e.batchParsRange=e.batchPars=e.batchRun=e.Batch=e.expandVaryingParams=void 0;const n=r(46),i=r(1729),o=r(7466);function s(t){const e=[],r=(n,i)=>{const o=n===t.length-1,s=t[n];if(0===s.values.length)throw Error(`Varying parameter '${s.name}' must have at least one value`);s.values.forEach((t=>{const a=Object.assign(Object.assign({},i),{[s.name]:t});o?e.push(a):r(n+1,a)}))};if(!(t.length>0))throw Error("A batch must have at least one varying parameter");return r(0,{}),e}e.expandVaryingParams=s;class a{constructor(t,e,r,n,i=501){this.pars=e,this.tStart=r,this.tEnd=n,this.solutions=[],this.runStatuses=[],this._pending=s(e.varying),this._run=t,this._nPointsForExtremes=i}get errors(){return this.runStatuses.filter((t=>!t.success))}get successfulVaryingParams(){return this.runStatuses.filter((t=>t.success)).map((t=>t.pars))}compute(){if(this._pending.length>0){const t=this._pending[0];this._pending=this._pending.slice(1);const e=c(this.pars.base,t);try{this.solutions.push(this._run(e,this.tStart,this.tEnd)),this.addRunStatus(t,!0,null)}catch(e){this.addRunStatus(t,!1,e.message)}}const t=0===this._pending.length;if(t&&0===this.solutions.length)throw Error(`All solutions failed; first error: ${this.errors[0].error}`);return t}run(){for(;!this.compute(););}valueAtTime(t){return function(t,e,r){return f(e,r.map((e=>e({mode:n.TimeMode.Given,times:[t]}))))}(t,this.successfulVaryingParams,this.solutions)}extreme(t){return this.findExtremes()[t]}findExtremes(){if(void 0===this._extremes){const i=(t={mode:n.TimeMode.Grid,nPoints:this._nPointsForExtremes,tEnd:this.tEnd,tStart:this.tStart},e=this.successfulVaryingParams,r=this.solutions,h(e,r.map((e=>e(t)))));if(0!==this._pending.length)return i;this._extremes=i}var t,e,r;return this._extremes}addRunStatus(t,e,r){this.runStatuses.push({pars:t,success:e,error:r})}}function u(t,e,r,n,o,s){const a=l(t,e);if(o>a)throw Error(`Expected lower bound to be no greater than ${a}`);if(s=s)throw Error("Expected upper bound to be greater than lower bound");if(r<2)throw Error("Must include at least 2 traces in the batch");if(n&&o<=0)throw Error("Lower bound must be greater than 0 for logarithmic scale");return{name:e,values:n?(0,i.gridLog)(o,s,r):(0,i.grid)(o,s,r)}}function c(t,e){return Object.assign(Object.assign({},t),e)}function l(t,e){const r=t[e];if(void 0===r)throw Error(`Expected a value for '${e}'`);if("number"!=typeof r)throw Error(`Expected a number for '${e}'`);return r}function f(t,e){const r={x:t,values:[]},n=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of n){const n=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;te[t].y[0]));r.values.push(Object.assign(Object.assign({},n[0][t]),{y:e}))}}return r}function h(t,e){const r=()=>({x:[...t],values:[]}),n={tMax:r(),tMin:r(),yMax:r(),yMin:r()};if(0===t.length)return n;const o=e[0].x,s=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of s){const r=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=r[0].length;for(let t=0;tp(o,e[t].y)));Object.keys(n).forEach((i=>{const o=i;n[o].values.push(Object.assign(Object.assign({},r[0][t]),{y:e.map((t=>t[o]))}))}))}}return n}function p(t,e){const r=(0,i.whichMin)(e),n=(0,i.whichMax)(e),o=t[r],s=t[n],a=e[r];return{tMax:s,tMin:o,yMax:e[n],yMin:a}}function d(t){const e=t.map((t=>t.length));if(e.every((t=>1===t)))return t;Math.max(...e);const r=v(t);for(let e=0;eObject.assign(Object.assign({},t[e][0]),{description:r}))));return t}function v(t){let e=null,r=[];return t.forEach((t=>{if(1===t.length){const r=t[0].description;if(null===e)e=r;else if(r!==e)throw Error(`Unexpected inconsistent descriptions: have ${e}, but given ${r}`)}else{const e=t.map((t=>t.description));if(0===r.length){if(e.some((t=>void 0===t)))throw Error("Expected all descriptions to be defined");r=e}else if(!(0,i.sameArrayContents)(e,r))throw Error(`Unexpected inconsistent descriptions: have [${r.join(", ")}], but given [${e.join(", ")}]`)}})),r}e.Batch=a,e.batchRun=function(t,e,r,n,i,s=!0){const u=new a(((e,r,n)=>(0,o.wodinRun)(t,e,r,n,i)),e,r,n);return s&&u.run(),u},e.batchPars=function(t,e){return{base:t,varying:e}},e.batchParsRange=u,e.batchParsDisplace=function(t,e,r,n,i){const o=l(t,e),s=i/100;return u(t,e,r,n,o*(1-s),o*(1+s))},e.updatePars=c,e.valueAtTimeResult=f,e.computeExtremesResult=h,e.alignDescriptionsGetLevels=v},3350:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t,e,r,n){const i=t(e);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfSquares=e.updatePars=e.fitTarget=void 0;const n=r(8251),i=r(1267),o=r(46);function s(t,e){const r=Object.assign({},t.base);for(let n=0;n{const h=s(r,f),p=new t(n.base,h,"error"),d=(0,i.runModel)(p,null,0,l,c).solution,v=p.names(),y=v.indexOf(u),m=d(e.time).map((t=>t[y]));return{data:{endTime:l,names:v,pars:h,solution:(0,o.interpolatedSolution)(d,v,0,l),startTime:0},value:a(e.value,m)}}},e.updatePars=s,e.sumOfSquares=a},1688:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.versions=e.batchRun=e.batchParsRange=e.batchParsDisplace=e.Batch=e.TimeMode=e.base=e.PkgWrapper=e.wodinRun=e.wodinFitValue=e.wodinFit=void 0;var n=r(7466);Object.defineProperty(e,"wodinFit",{enumerable:!0,get:function(){return n.wodinFit}}),Object.defineProperty(e,"wodinFitValue",{enumerable:!0,get:function(){return n.wodinFitValue}}),Object.defineProperty(e,"wodinRun",{enumerable:!0,get:function(){return n.wodinRun}});var i=r(8714);Object.defineProperty(e,"PkgWrapper",{enumerable:!0,get:function(){return i.PkgWrapper}});var o=r(8251);Object.defineProperty(e,"base",{enumerable:!0,get:function(){return o.base}});var s=r(46);Object.defineProperty(e,"TimeMode",{enumerable:!0,get:function(){return s.TimeMode}});var a=r(7601);Object.defineProperty(e,"Batch",{enumerable:!0,get:function(){return a.Batch}}),Object.defineProperty(e,"batchParsDisplace",{enumerable:!0,get:function(){return a.batchParsDisplace}}),Object.defineProperty(e,"batchParsRange",{enumerable:!0,get:function(){return a.batchParsRange}}),Object.defineProperty(e,"batchRun",{enumerable:!0,get:function(){return a.batchRun}});var u=r(7497);Object.defineProperty(e,"versions",{enumerable:!0,get:function(){return u.versions}})},320:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.interpolateTimes=e.interpolateCheckT=e.interpolateCheckY=e.interpolateAlloc=void 0;const n=r(9673);function i(t,e,r){const i=function(t,e){if(t.length===e)return[t];const r=[],n=t.length/e;for(let i=0;ir.max)throw Error(`Integration times do not span interpolation range; max: ${r.max}`);return r.max===1/0?n:(void 0===n&&(n=[]),[...n,r.max])},e.interpolateTimes=s,e.interpolate={alloc:i,checkY:o,times:s}},9928:(t,e)=>{"use strict";function r(t){return.5===i(t,1)?2*Math.round(t/2):Math.round(t)}function n(t,e){if(void 0===e||0===e)return r(t);{const n=Math.pow(10,e);return r(t*n)/n}}function i(t,e){let r=t%e;return r*e<0&&(r+=e),r}function o(t,e){return Math.floor(t/e)}function s(t,e,r){let n=0;for(let i=e;it.output(e,r,n)),null===e&&(e=t.initial(r)),t.getInternal().initial_t=r;const a=new s.DDE((function(e,r,n,i){t.rhs(e,r,n,i)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i):function(t,e,r,n,i){let o=null;"function"==typeof t.output&&(o=(e,r)=>t.output(e,r)),null===e&&(e=t.initial(r));const a=new s.Dopri((function(e,r,n){t.rhs(e,r,n)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i)}},8714:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PkgWrapper=void 0;const n=r(8251),i=r(1267);e.PkgWrapper=class{constructor(t,e,r){this.model=new t(n.base,e,r)}initial(t){return this.model.initial(t)}rhs(t,e){const r=new Array(e.length).fill(0);let n=null;if(!(0,i.isODEModel)(this.model))throw Error("Can't use rhs() with delay models");return this.model,this.model.rhs(t,e,r),this.model.output&&(n=this.model.output(t,e)),{output:n,state:r}}getMetadata(){return this.model.getMetadata()}getInternal(){return this.model.getInternal()}setUser(t,e){this.model.setUser(t,e)}run(t,e,r){const n=t[0],o=t[t.length-1],s=(0,i.runModel)(this.model,e,n,o,r);return{names:this.model.names(),statistics:s.statistics,y:s.solution(t)}}}},46:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedSolution=e.TimeMode=void 0;const n=r(1729);var i;!function(t){t.Grid="grid",t.Given="given"}(i=e.TimeMode||(e.TimeMode={})),e.interpolatedSolution=function(t,e,r,o){return s=>{const a=function(t,e,r){switch(t.mode){case i.Grid:return(0,n.grid)(Math.max(e,t.tStart),Math.min(r,t.tEnd),t.nPoints);case i.Given:return t.times}}(s,r,o),u=t(a);return{values:e.map(((t,r)=>({name:e[r],y:u.map((t=>t[r]))}))),x:a}}}},2630:(t,e)=>{"use strict";function r(t,e,r){if("ignore"===r)return;const n=[];for(const r of Object.keys(t))e.includes(r)||n.push(r);if(n.length>0){const t="Unknown user parameters: "+n.join(", ");if("message"===r)console.log(t);else{if("warning"!==r)throw"stop"===r?Error(t):Error(t+" (and invalid value for unusedUserAction)");console.warn(t)}}}function n(t,e,r,n,i,o,s){const a=t[e];if(void 0===a){if(void 0!==r[e])return;if(null===n)throw Error(`Expected a value for '${e}'`);r[e]=n}else{if("number"!=typeof a)throw Error(`Expected a number for '${e}'`);c(a,i,o,s,e),r[e]=a}}function i(t,e,r,n,i,o,c){let l=t[e];if(void 0===l){if(void 0!==r[e])return;throw Error(`Expected a value for '${e}'`)}{const t=n.length-1;l=s(l),a(t,l,e),function(t,e,r){const n=t.length-1;for(let i=0;ir)throw Error(`Expected '${i}' to be at most ${r}`);if(n&&!Number.isInteger(t))throw Error(`Expected '${i}' to be integer-like`)}Object.defineProperty(e,"__esModule",{value:!0}),e.user=e.setUserArrayVariable=e.setUserArrayFixed=e.setUserScalar=e.checkUser=void 0,e.checkUser=r,e.setUserScalar=n,e.setUserArrayFixed=i,e.setUserArrayVariable=o,e.user={checkUser:r,setUserArrayFixed:i,setUserArrayVariable:o,setUserScalar:n}},1729:(t,e)=>{"use strict";function r(t,e,r){const n=(e-t)/(r-1),i=[];for(let e=0;er&&(e=n,r=t[n]);return e},e.unique=function(t){return[...new Set(t)]},e.sameArrayContents=function(t,e){return t.length===e.length&&t.every(((t,r)=>e[r]===t))}},7497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{dfoptim:"0.0.5",dopri:"0.0.13",odinjs:"0.1.3"}}},7466:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wodinFitValue=e.wodinFit=e.wodinRun=void 0;const n=r(4153),i=r(8251),o=r(7771),s=r(1267),a=r(46);e.wodinRun=function(t,e,r,n,o){const u=new t(i.base,e,"error"),c=(0,s.runModel)(u,null,r,n,o).solution,l=u.names();return(0,a.interpolatedSolution)(c,l,r,n)},e.wodinFit=function(t,e,r,i,s,a){const u=(0,o.fitTarget)(t,e,r,i,s),c=r.vary.map((t=>r.base[t]));return new n.Simplex(u,c,a)},e.wodinFitValue=function(t,e,r){const n=t({mode:a.TimeMode.Given,times:e.time}),i=n.values.findIndex((t=>t.name===r));return(0,o.sumOfSquares)(e.value,n.values[i].y)}},7689:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.binomial=void 0,e.binomial=function(t,e,r){if(0===e||0===r)return 0;if(1===r)return e;const o=r<=.5?r:1-r,s=e*o>=10?function(t,e,r){const i=Math.sqrt(e*r*(1-r)),o=1.15+2.53*i,s=.0248*o-.0873+.01*r,a=e*r+.5,u=.92-4.2/o,c=r/(1-r),l=(2.83+5.1/o)*i,f=Math.floor((e+1)*r);let h;for(;;){const r=t.random()-.5;let i=t.random();const p=.5-Math.abs(r),d=Math.floor((2*s/p+o)*r+a);if(p>=.07&&i<=u){h=d;break}if(!(d<0||d>e)&&(i=Math.log(i*l/(s/(p*p)+o)),i<=(f+.5)*Math.log((f+1)/(c*(e-f+1)))+(e+1)*Math.log((e-f+1)/(e-d+1))+(d+.5)*Math.log(c*(e-d+1)/(d+1))+n(f)+n(e-f)-n(d)-n(e-d))){h=d;break}}return h}(t,e,o):function(t,e,r){let n=-1;do{n=i(t.random(),e,r)}while(n<0);return n}(t,e,o);return r<=.5?s:e-s};const r=[.08106146679532733,.04134069595540946,.02767792568499805,.02079067210376495,.016644691189821703,.013876128823071987,.011896709945892425,.010411265261971892,.00925546218270945,.008330563433359472];function n(t){return t=s;)t-=s,a++,s*=o/a-i,u=s;return a}},9386:(t,e)=>{"use strict";function r(t){return-Math.log(t.random())}Object.defineProperty(e,"__esModule",{value:!0}),e.exponential=e.randomExponential=void 0,e.randomExponential=r,e.exponential=function(t,e){return r(t)/e}},6532:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uniform=e.randomUniform=e.randomNormal=e.normal=e.randomExponential=e.exponential=e.binomial=e.RngStateReplay=e.RngStateObserved=e.RngStateBuiltin=e.RngState=e.Random=void 0;var n=r(1929);Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return n.Random}});var i=r(3726);Object.defineProperty(e,"RngState",{enumerable:!0,get:function(){return i.RngState}});var o=r(2035);Object.defineProperty(e,"RngStateBuiltin",{enumerable:!0,get:function(){return o.RngStateBuiltin}});var s=r(2301);Object.defineProperty(e,"RngStateObserved",{enumerable:!0,get:function(){return s.RngStateObserved}});var a=r(5843);Object.defineProperty(e,"RngStateReplay",{enumerable:!0,get:function(){return a.RngStateReplay}});var u=r(7689);Object.defineProperty(e,"binomial",{enumerable:!0,get:function(){return u.binomial}});var c=r(9386);Object.defineProperty(e,"exponential",{enumerable:!0,get:function(){return c.exponential}}),Object.defineProperty(e,"randomExponential",{enumerable:!0,get:function(){return c.randomExponential}});var l=r(2638);Object.defineProperty(e,"normal",{enumerable:!0,get:function(){return l.normal}}),Object.defineProperty(e,"randomNormal",{enumerable:!0,get:function(){return l.randomNormal}});var f=r(6390);Object.defineProperty(e,"randomUniform",{enumerable:!0,get:function(){return f.randomUniform}}),Object.defineProperty(e,"uniform",{enumerable:!0,get:function(){return f.uniform}})},2638:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normal=e.randomNormal=void 0;const r=2*Math.PI;function n(t){let e=0,n=0;do{e=t.random(),n=t.random()}while(e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.poisson=void 0;const n=r(7788);e.poisson=function(t,e){return e<10?function(t,e){let r=0;const n=Math.exp(-e);let o=1;for(;o*=t.random(),!(o<=n&&r<=i);)r++;return r}(t,e):function(t,e){let r=0;const i=Math.log(e),o=.931+2.53*Math.sqrt(e),s=.02483*o-.059,a=1.1239+1.1328/(o-3.4);for(;;){let u=t.random();u-=.5;const c=t.random(),l=.5-Math.abs(u),f=Math.floor((2*s/l+o)*u+e+.43);if(l>=.07&&c<=.9277-3.6224/(o-2)){r=f;break}if(!(f<0||l<.013&&c>l)&&Math.log(c*a/(s/(l*l)+o))<=f*i-e-(0,n.lngamma)(f+1)){r=f;break}}return r}(t,e)};const i=2**31-1},1929:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Random=void 0;const n=r(7689),i=r(9386),o=r(2638),s=r(5789),a=r(6390);e.Random=class{state;constructor(t){this.state=t}randomExponential(){return(0,i.randomExponential)(this.state)}randomNormal(){return(0,o.randomNormal)(this.state)}randomUniform(){return(0,a.randomUniform)(this.state)}binomial(t,e){return(0,n.binomial)(this.state,t,e)}exponential(t){return(0,i.exponential)(this.state,t)}normal(t,e){return(0,o.normal)(this.state,t,e)}poisson(t){return(0,s.poisson)(this.state,t)}uniform(t,e){return(0,a.uniform)(this.state,t,e)}}},2035:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngStateBuiltin=void 0;const n=r(3726);class i extends n.RngState{constructor(){super()}random(){return Math.random()}}e.RngStateBuiltin=i},2301:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngStateObserved=void 0;const n=r(3726),i=r(2035),o=r(5843);class s extends n.RngState{_state;_values;constructor(t){super(),void 0===t&&(t=new i.RngStateBuiltin),this._state=t,this._values=[]}random(){const t=this._state.random();return this._values.push(t),t}replay(){return new o.RngStateReplay(this._values)}length(){return this._values.length}values(){return this._values}}e.RngStateObserved=s},5843:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngStateReplay=void 0;const n=r(3726);class i extends n.RngState{_i;_values;constructor(t){super(),this._i=0,this._values=t}random(){const t=this._values[this._i++];if(this._i>this._values.length)throw Error("Exhausted stream");return t}length(){return this._values.length-this._i}}e.RngStateReplay=i},3726:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RngState=void 0,e.RngState=class{setSeed(t){throw Error("This generator cannot be seeded (really!)")}}},6390:(t,e)=>{"use strict";function r(t){return t.random()}Object.defineProperty(e,"__esModule",{value:!0}),e.uniform=e.randomUniform=void 0,e.randomUniform=r,e.uniform=function(t,e,n){return r(t)*(n-e)+e}},4394:(t,e)=>{"use strict";function r(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.simplexControl=void 0,e.simplexControl=function(t){void 0===t&&(t={});var e={deltaNonZero:r(t.deltaNonZero,.05),deltaZero:r(t.deltaZero,.001),errorOnFailure:r(t.errorOnFailure,!1),tolerance:r(t.tolerance,1e-5)};if(e.tolerance<=0)throw new Error("Invalid control parameter: 'tolerance' must be strictly positive");return e}},4153:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2169);Object.defineProperty(e,"Simplex",{enumerable:!0,get:function(){return n.Simplex}}),Object.defineProperty(e,"fitSimplex",{enumerable:!0,get:function(){return n.fitSimplex}})},2169:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Simplex=e.fitSimplex=void 0;var n=r(4394),i=r(2003);function o(t,e,r){for(var n=e.length,i=new Array(n),o=1+t,s=-t,a=0;a=this._simplex[t-1].value){var s=i.value>r.value?this._contractInside(r,n):this._contractOutside(r,n);if(s.value{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkResult=void 0,e.checkResult=function(t){return"number"==typeof t?{data:null,value:t}:t}},2886:function(t,e){"use strict";var r=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i0&&(h.tcrit=r([],h.tcrit,!0).sort()),h.maxSteps<1)throw n("maxSteps","must be at least 1");if(h.atol<=0)throw n("atol","must be strictly positive");if(h.rtol<=0)throw n("rtol","must be strictly positive");return h}},8742:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDE=e.integrateDDE=void 0;var o=r(2223),s=r(4660);e.integrateDDE=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new a(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var a=function(t){function e(e,r,n,i){void 0===n&&(n={}),void 0===i&&(i=null);var o=this,s=function(t){return o._interpolate(t)},a=null===i?null:function(t,e){return i(t,e,s)};return(o=t.call(this,(function(t,r,n){return e(t,r,n,s)}),r,n,a)||this)._y0=new Array(r),o}return i(e,t),e.prototype.initialise=function(e,r){return this._y0=r,t.prototype.initialise.call(this,e,r),this},e.prototype._interpolate=function(t){var e=this._findHistory(t);return e<0?this._y0.slice(0):this._stepper.interpolate(t,this._history[e])},e.prototype._findHistory=function(t){return(0,s.search)(this._history,(function(e){return e.t>t}))},e}(o.Dopri);e.DDE=a},2223:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;it._t})),0===this._tcrit.length?1/0:this._tcrit[0])},t.prototype._step=function(){for(var t=this._t,e=this._h,r=!1,n=!1,i=Math.max(this._lastError,1e-4),o=this._stepper.stepControl,s=this._control,a=this._nextTcrit();!r;){if(this._nSteps>s.maxSteps)throw h("too many steps",t);if(ea&&(e=a-t),this._stepper.step(t,e),this._nSteps++;var u=this._stepper.error(s.atol,s.rtol),c=Math.pow(u,o.constant),p=1/o.factorMin,d=1/o.factorMax;if(u<=1){if(r=!0,this._nStepsAccepted++,this._isStiff(e))throw h("problem became stiff",t);this._stepper.stepComplete(t,e);var v=c/Math.pow(i,o.beta),y=e/(v=l.constrain(v/o.factorSafe,d,p));this._t+=e,this._h=n?Math.min(y,e):Math.min(y,s.stepSizeMax),this._lastError=u}else n=!0,this._nStepsAccepted>=1&&this._nStepsRejected++,e/=Math.min(p,c/o.factorSafe)}return this._t},t.prototype._isStiff=function(t){if(this._stiffNStiff>0||this._nStepsAccepted%this._control.stiffCheck==0)if(this._stepper.isStiff(t)){if(this._stiffNNonstiff=0,this._stiffNStiff++>=15)return!0}else this._stiffNStiff>0&&this._stiffNNonstiff++>=6&&(this._stiffNStiff=0,this._stiffNNonstiff=0);return!1},t}();e.Dopri=p},7134:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5StepControl=void 0;e.Dopri5StepControl=function(){this.factorSafe=.9,this.factorMin=.2,this.factorMax=10,this.beta=.04,this.constant=.2-.75*this.beta}},2922:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5=void 0;var s=o(r(4660)),a=o(r(7134)),u=r(8430),c=function(){function t(t,e){this.order=5,this.stepControl=new a.Dopri5StepControl,this.nEval=0,this.rhs=t,this.n=e,this.y=new Array(e),this.yNext=new Array(e),this.yStiff=new Array(e),this.k1=new Array(e),this.k2=new Array(e),this.k3=new Array(e),this.k4=new Array(e),this.k5=new Array(e),this.k6=new Array(e),this.history=new u.HistoryElement(this.order*e)}return t.prototype.step=function(t,e){var r=this.n,n=this.y,i=this.yNext,o=this.k1,s=this.k2,a=this.k3,u=this.k4,c=this.k5,l=this.k6,f=this.history.data,h=0;for(h=0;h0&&Math.abs(t)*Math.sqrt(e/r)>3.25},t.prototype.reset=function(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var r=function(){function t(t){this.t=0,this.h=0,this.data=new Array(t)}return t.prototype.clone=function(){var e=new t(this.data.length);return e.t=this.t,e.h=this.h,e.data=this.data.slice(0),e},t}();e.HistoryElement=r},6245:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=e.integrateDDE=e.DDE=e.integrateDopri=e.Dopri=void 0;var n=r(2223);Object.defineProperty(e,"Dopri",{enumerable:!0,get:function(){return n.Dopri}}),Object.defineProperty(e,"integrateDopri",{enumerable:!0,get:function(){return n.integrateDopri}});var i=r(8742);Object.defineProperty(e,"DDE",{enumerable:!0,get:function(){return i.DDE}}),Object.defineProperty(e,"integrateDDE",{enumerable:!0,get:function(){return i.integrateDDE}});var o=r(5961);Object.defineProperty(e,"integrate",{enumerable:!0,get:function(){return o.integrate}})},5961:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=void 0;var n=r(8742),i=r(2223);e.integrate=function(t,e,r,o,s,a){if(void 0===s&&(s={}),void 0===a&&(a=null),function(t){return 3===t.length}(t)){if(!function(t){return null===t||2===t.length}(a))throw new Error("Can't used delayed output with non-delayed rhs");return(0,i.integrateDopri)(t,e,r,o,s,a)}if(!function(t){return null===t||3===t.length}(a))throw new Error("Can't used non-delayed output with delayed rhs");return(0,n.integrateDDE)(t,e,r,o,s,a)}},1216:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolator=void 0,e.interpolator=function(t,e,r){return function(n){return function(t,e,r,n){for(var i=[],o=e,s=0,a=0,u=t;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var n=r(1606);Object.defineProperty(e,"HistoryElement",{enumerable:!0,get:function(){return n.HistoryElement}})},4660:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.seqLen=e.approxEqualArray=e.approxEqual=e.zeros=e.copyArray=e.constrain=e.square=void 0;var r=Math.pow(2,-26);e.square=function(t){return t*t},e.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},e.copyArray=function(t,e){for(var r=t.length,n=0;nn&&(i/=o),in&&(o/=i),o1;){var i=Math.floor((r+n)/2);e(t[i])?n=i:r=i}return r}},7788:(t,e)=>{var r,n=function(){"use strict";var t=new DataView(new ArrayBuffer(8)),e=function(e,r,n){var i,o,s,a=-.16666666666666632,u=0;return t.setFloat64(0,e),u=t.getInt32(0),(u&=2147483647)<1044381696&&0==(0|e)?e:(s=(i=e*e)*e,o=.00833333333332249+i*(i*(27557313707070068e-22+i*(1.58969099521155e-10*i-2.5050760253406863e-8))-.0001984126982985795),0===n?e+s*(a+i*o):e-(i*(.5*r-s*o)-r-s*a))},r=function(e,r){var n,i,o,s=0;return t.setFloat64(0,e),s=t.getInt32(0),(s&=2147483647)<1044381696&&0==(0|e)?1:(i=(n=e*e)*(.0416666666666666+n*(n*(2480158728947673e-20+n*(n*(2.087572321298175e-9+-11359647557788195e-27*n)-2.7557314351390663e-7))-.001388888888887411)),s<1070805811?1-(.5*n-(n*i-e*r)):(s>1072234496?o=.28125:(t.setFloat64(0,o),t.setUint32(0,s-2097152),t.setUint32(4,0),o=t.getFloat64(0)),1-o-(.5*n-o-(n*i-e*r))))},n=function(n){var i,o,s,a,u,c,l,f,h=1.4616321449683622,p=0,d=0;if(t.setFloat64(0,n),c=t.getInt32(0),l=t.getInt32(4),(f=2147483647&c)>=2146435072)return n*n;if(0==(f|l))return 1/0;if(f<999292928)return c<0?-Math.log(-n):-Math.log(n);if(c<0){if(f>=1127219200)return 1/0;if(i=function(n){var i,o=0,s=0;if(t.setFloat64(0,n),s=t.getInt32(0),(s&=2147483647)<1070596096)return e(Math.PI*n,0,0);switch(i=-n,Math.floor(i)!=i?o=4*(i=2*((i*=.5)-Math.floor(i)))|0:s>=1128267776?(i=0,o=0):(o=t.getInt32(4),i=o&=1,o<<=2),o){case 0:i=e(Math.PI*i,0,0);break;case 1:case 2:i=r(Math.PI*(.5-i),0);break;case 3:case 4:i=e(Math.PI*(1-i),0,0);break;case 5:case 6:i=-r(Math.PI*(i-1.5),0);break;default:i=e(Math.PI*(i-2),0,0)}return-i}(n),0==i)return 1/0;p=Math.log(3.141592653589793/Math.abs(i*n)),n=-n}if(0==(f-1072693248|l)||0==(f-1073741824|l))a=0;else if(f<1073741824)switch(f<=1072483532?(a=-Math.log(n),f>=1072130372?(o=1-n,d=0):f>=1070442081?(o=n-(h-1),d=1):(o=n,d=2)):(a=0,f>=1073460419?(o=2-n,d=0):f>=1072936132?(o=n-h,d=1):(o=n-1,d=2)),d){case 0:a+=o*(.07721566490153287+(s=o*o)*(.06735230105312927+s*(.007385550860814029+s*(.0011927076318336207+s*(.00022086279071390839+25214456545125733e-21*s)))))+s*(.3224670334241136+s*(.020580808432516733+s*(.0028905138367341563+s*(.0005100697921535113+s*(.00010801156724758394+44864094961891516e-21*s)))))-.5*o;break;case 1:a+=(s=o*o)*(.48383612272381005+(u=s*o)*(u*(.006100538702462913+u*(.00031563207090362595*u-.0014034646998923284))-.032788541075985965))-(-3638676997039505e-33-u*(u*(.01797067508118204+u*(u*(.000881081882437654+-.00031275416837512086*u)-.0036845201678113826))-.1475877229945939+o*(.06462494023913339+u*(u*(.0022596478090061247+u*(.0003355291926355191*u-.0005385953053567405))-.010314224129834144))))-.12148629053584961;break;case 2:a+=-.5*o+o*(o*(.6328270640250934+o*(1.4549225013723477+o*(.9777175279633727+o*(.22896372806469245+.013381091853678766*o))))-.07721566490153287)/(1+o*(2.4559779371304113+o*(2.128489763798934+o*(.7692851504566728+o*(.10422264559336913+.003217092422824239*o)))))}else if(f<1075838976)switch(i=0,a=.5*(o=n-(d=0|n))+o*(o*(.21498241596060885+o*(.325778796408931+o*(.14635047265246445+o*(.02664227030336386+o*(.0018402845140733772+3194753265841009e-20*o)))))-.07721566490153287)/(1+o*(1.3920053346762105+o*(.7219355475671381+o*(.17193386563280308+o*(.01864591917156529+o*(.0007779424963818936+7326684307446256e-21*o)))))),s=1,d){case 7:s*=o+6;case 6:s*=o+5;case 5:s*=o+4;case 4:s*=o+3;case 3:s*=o+2,a+=Math.log(s)}else a=f<1133510656?(n-.5)*((i=Math.log(n))-1)+(u=.4189385332046727+(s=1/n)*(.08333333333333297+(o=s*s)*(o*(.0007936505586430196+o*(o*(.0008363399189962821+-.0016309293409657527*o)-.00059518755745034))-.0027777777772877554))):n*(Math.log(n)-1);return c<0&&(a=p-a),a};return{lngamma:function(t){return n(t)},gamma:function(t){return Math.exp(n(t))}}}();void 0!==t.exports?t.exports=n:void 0===(r=function(){return n}.apply(e,[]))||(t.exports=r)},6907:t=>{"use strict";t.exports=function(t){for(var e=new Array(t),r=0;r{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},2861:(t,e,r)=>{var n=r(6907),i=r(8738),o="undefined"!=typeof Float64Array;function s(t,e){return t[0]-e[0]}function a(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+l+",v)}"):o.push("return this.data["+l+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+l+")}"):o.push("return this.data["+l+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+l+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+s.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var p=s.map((function(t){return"a"+t+"=this.shape["+t+"]"})),d=s.map((function(t){return"c"+t+"=this.stride["+t+"]"}));o.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var v=0;v=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");for(o.push("return new "+r+"(this.data,"+s.map((function(t){return"a"+t})).join(",")+","+s.map((function(t){return"c"+t})).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+s.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil"),v=0;v=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map((function(t){return"shape["+t+"]"})).join(",")+","+s.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(c[t],a)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};t.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var a=s-1,l=1;a>=0;--a)r[a]=l,l*=e[a]}if(void 0===n)for(n=0,a=0;a{"use strict";t.exports=function(t,e,r,n,i){var o,s;for(o=1;o=0;o--){if(0===r[o])return console.log("tridiagonalSolve: failed due to singular matrix"),!1;i[o]=(i[o]-n[o]*i[o+1])/r[o]}return!0}},5653:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;var n=r(1688),i=n.base.maths,o=n.base.user;e.base={maths:i,user:o}},9133:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dust=void 0;var n=r(6532),i=r(5653),o=r(217),s=r(2367),a=r(8177),u=function(){function t(t,e,r,s,a){if(r<=0)throw Error("Expected at least one particle");this._Model=t,this._particles=[],this._random=a||new n.Random(new n.RngStateBuiltin);for(var u=new t(i.base,e,"ignore"),c=0;c=r)throw Error("Expected index to be in [0, ".concat(r-1,"]")+" but given ".concat(o));n.setState(e._particles[o].state(),!0)})),this.forEachParticle((function(t,e){t.swap()}))},t.prototype.forEachParticle=function(t){this._particles.forEach(t)},t.prototype.checkState=function(t){if(t.length!==this.nParticles())throw Error("Invalid length state, expected ".concat(this.nParticles())+" but given ".concat(t.length));for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.variableNames=e.PkgWrapper=void 0;var n=r(6532),i=r(5653),o=r(9133),s=r(9882),a=function(){function t(t,e,r,o){this.Model=t,this.pars=e,this.random=new n.Random(o||new n.RngStateBuiltin),this.model=new this.Model(i.base,e,r)}return t.random=function(t){return new n.Random(t)},t.prototype.setUser=function(t,e){this.pars=t,this.model=new this.Model(i.base,t,e)},t.prototype.initial=function(t){return this.model.initial(t)},t.prototype.update=function(t,e){var r=Array(e.length).fill(0);return this.model.update(t,e,r,this.random),r},t.prototype.getInternal=function(){return this.model.getInternal()},t.prototype.getMetadata=function(){var t=this.model.info();return{info:t,names:u(t),size:this.model.size()}},t.prototype.run=function(t,e){var r=t[0],n=new o.Dust(this.Model,this.pars,1,r,this.random);null!==e&&n.setState([e]);var i=n.simulate(t,null);return{size:this.model.size(),y:Array.from(i.state.data)}},t}();function u(t){for(var e=[],r=function(t){var r=t.dim,n=t.name;0===r.length?e.push(n):e.push.apply(e,(0,s.combinations)(r).map((function(t){return"".concat(n,"[").concat(t.join(","),"]")})))},n=0,i=t;n1;){var o=Math.floor((n+i)/2);e(t[o])?i=o:n=o}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.findClosest=e.meanArray=e.mean=e.applyArray=e.isEqualArray=e.combinations=e.seqBy=e.seq=void 0,e.seq=n,e.seqBy=function(t,e,r){for(var n=[],i=t;i<=e;i+=r)n.push(i);return n},e.combinations=function t(e){var i=n(1,e[0]);if(e.length>1){for(var o=[],s=0,a=t(e.slice(1));s=t}));return e[r]===t||0===r?r:r===e.length?e.length-1:t-e[r-1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{random:"0.0.3",odinjs:"0.1.3",dust:"0.0.5"}}},7915:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1&&!(0,s.isEqualArray)(l,o)&&(a=!0)}if(a){var f=u.map((function(e){return{description:"Individual",name:t,y:e}}));return r.map((function(e){f.push({description:e.description,name:t,y:(0,s.applyArray)(u,e.summary)})})),f}return[{description:"Deterministic",name:t,y:o}]}function p(t){return function(e){return d(t(e))}}function d(t){var e=t.values.filter((function(t){return"Individual"!==t.description}));return{x:t.x,values:e}}e.runModelDiscrete=a,e.wodinRunDiscrete=u,e.tidyDiscreteSolution=c,e.filterIndex=l,e.filterSolution=f,e.tidyDiscreteSolutionVariable=h,e.batchRunDiscrete=function(t,e,r,n,o,s,a){return new i.Batch((function(e,r,n){return p(u(t,e,r,n,o,s,a))}),e,r,n)},e.summaryOnly=p,e.filterToSummaryOnly=d}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}var n={};(()=>{"use strict";var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.batchParsRange=t.batchParsDisplace=t.wodinRunDiscrete=t.batchRunDiscrete=t.versions=t.DustStateTime=t.dustStateTime=t.DustState=t.dustState=t.PkgWrapper=t.Particle=t.Dust=t.base=void 0;var e=r(5653);Object.defineProperty(t,"base",{enumerable:!0,get:function(){return e.base}});var i=r(9133);Object.defineProperty(t,"Dust",{enumerable:!0,get:function(){return i.Dust}});var o=r(217);Object.defineProperty(t,"Particle",{enumerable:!0,get:function(){return o.Particle}});var s=r(586);Object.defineProperty(t,"PkgWrapper",{enumerable:!0,get:function(){return s.PkgWrapper}});var a=r(2367);Object.defineProperty(t,"dustState",{enumerable:!0,get:function(){return a.dustState}}),Object.defineProperty(t,"DustState",{enumerable:!0,get:function(){return a.DustState}});var u=r(8177);Object.defineProperty(t,"dustStateTime",{enumerable:!0,get:function(){return u.dustStateTime}}),Object.defineProperty(t,"DustStateTime",{enumerable:!0,get:function(){return u.DustStateTime}});var c=r(9556);Object.defineProperty(t,"versions",{enumerable:!0,get:function(){return c.versions}});var l=r(7915);Object.defineProperty(t,"batchRunDiscrete",{enumerable:!0,get:function(){return l.batchRunDiscrete}}),Object.defineProperty(t,"wodinRunDiscrete",{enumerable:!0,get:function(){return l.wodinRunDiscrete}});var f=r(1688);Object.defineProperty(t,"batchParsDisplace",{enumerable:!0,get:function(){return f.batchParsDisplace}}),Object.defineProperty(t,"batchParsRange",{enumerable:!0,get:function(){return f.batchParsRange}})})(),dust=n})(); diff --git a/inst/js/odin.js b/inst/js/odin.js index ba751842..31315d37 100644 --- a/inst/js/odin.js +++ b/inst/js/odin.js @@ -1 +1 @@ -var odinjs;(()=>{"use strict";var t={6:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateSearch=e.InterpolatorBase=void 0;var r=function(){function t(t,e){(function(t){return Array.isArray(t[0])})(e)||(e=[e]),this._i=0,this._x=t,this._y=e,this.nX=this._x.length,this.nY=this._y.length;for(var r=0;r=s-1)return s;for(i=n+o;e[i]=s){if(e[i=s-1]t;){if(i=n,n<(o*=2)){if(e[n=0]>t)return-1;break}n-=o}}for(;i-n>1;){var a=Math.floor((i+n)/2);e[a]{Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorSpline=e.InterpolatorLinear=e.InterpolatorConstant=e.InterpolatorBase=void 0;var n=r(6);Object.defineProperty(e,"InterpolatorBase",{enumerable:!0,get:function(){return n.InterpolatorBase}});var i=r(731);Object.defineProperty(e,"InterpolatorConstant",{enumerable:!0,get:function(){return i.InterpolatorConstant}});var o=r(477);Object.defineProperty(e,"InterpolatorLinear",{enumerable:!0,get:function(){return o.InterpolatorLinear}});var s=r(869);Object.defineProperty(e,"InterpolatorSpline",{enumerable:!0,get:function(){return s.InterpolatorSpline}})},477:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorLinear=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eval=function(t,e){void 0===e&&(e=0);var r=this.search(t,!1),n=this._x[r],i=(t-n)/(this._x[r+1]-n),o=this._y[e],s=o[r];return s+(o[r+1]-s)*i},e}(r(6).InterpolatorBase);e.InterpolatorLinear=o},869:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.solve=e.InterpolatorSpline=void 0;var s=o(r(863)),a=function(t){function e(e,r){var n=t.call(this,e,r)||this,i=function(t){var e=t.length,r=Array(e),n=Array(e),i=Array(e);r[0]=0,n[0]=2/(t[1]-t[0]),i[0]=1/(t[1]-t[0]);for(var o=1;o{function r(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.simplexControl=void 0,e.simplexControl=function(t){void 0===t&&(t={});var e={deltaNonZero:r(t.deltaNonZero,.05),deltaZero:r(t.deltaZero,.001),errorOnFailure:r(t.errorOnFailure,!1),tolerance:r(t.tolerance,1e-5)};if(e.tolerance<=0)throw new Error("Invalid control parameter: 'tolerance' must be strictly positive");return e}},153:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(169);Object.defineProperty(e,"Simplex",{enumerable:!0,get:function(){return n.Simplex}}),Object.defineProperty(e,"fitSimplex",{enumerable:!0,get:function(){return n.fitSimplex}})},169:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Simplex=e.fitSimplex=void 0;var n=r(394),i=r(3);function o(t,e,r){for(var n=e.length,i=new Array(n),o=1+t,s=-t,a=0;a=this._simplex[t-1].value){var s=i.value>r.value?this._contractInside(r,n):this._contractOutside(r,n);if(s.value{Object.defineProperty(e,"__esModule",{value:!0}),e.checkResult=void 0,e.checkResult=function(t){return"number"==typeof t?{data:null,value:t}:t}},886:function(t,e){var r=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i0&&(f.tcrit=r([],f.tcrit,!0).sort()),f.maxSteps<1)throw n("maxSteps","must be at least 1");if(f.atol<=0)throw n("atol","must be strictly positive");if(f.rtol<=0)throw n("rtol","must be strictly positive");return f}},742:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDE=e.integrateDDE=void 0;var o=r(223),s=r(660);e.integrateDDE=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new a(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var a=function(t){function e(e,r,n,i){void 0===n&&(n={}),void 0===i&&(i=null);var o=this,s=function(t){return o._interpolate(t)},a=null===i?null:function(t,e){return i(t,e,s)};return(o=t.call(this,(function(t,r,n){return e(t,r,n,s)}),r,n,a)||this)._y0=new Array(r),o}return i(e,t),e.prototype.initialise=function(e,r){return this._y0=r,t.prototype.initialise.call(this,e,r),this},e.prototype._interpolate=function(t){var e=this._findHistory(t);return e<0?this._y0.slice(0):this._stepper.interpolate(t,this._history[e])},e.prototype._findHistory=function(t){return(0,s.search)(this._history,(function(e){return e.t>t}))},e}(o.Dopri);e.DDE=a},223:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;it._t})),0===this._tcrit.length?1/0:this._tcrit[0])},t.prototype._step=function(){for(var t=this._t,e=this._h,r=!1,n=!1,i=Math.max(this._lastError,1e-4),o=this._stepper.stepControl,s=this._control,a=this._nextTcrit();!r;){if(this._nSteps>s.maxSteps)throw f("too many steps",t);if(ea&&(e=a-t),this._stepper.step(t,e),this._nSteps++;var u=this._stepper.error(s.atol,s.rtol),l=Math.pow(u,o.constant),p=1/o.factorMin,d=1/o.factorMax;if(u<=1){if(r=!0,this._nStepsAccepted++,this._isStiff(e))throw f("problem became stiff",t);this._stepper.stepComplete(t,e);var v=l/Math.pow(i,o.beta),_=e/(v=c.constrain(v/o.factorSafe,d,p));this._t+=e,this._h=n?Math.min(_,e):Math.min(_,s.stepSizeMax),this._lastError=u}else n=!0,this._nStepsAccepted>=1&&this._nStepsRejected++,e/=Math.min(p,l/o.factorSafe)}return this._t},t.prototype._isStiff=function(t){if(this._stiffNStiff>0||this._nStepsAccepted%this._control.stiffCheck==0)if(this._stepper.isStiff(t)){if(this._stiffNNonstiff=0,this._stiffNStiff++>=15)return!0}else this._stiffNStiff>0&&this._stiffNNonstiff++>=6&&(this._stiffNStiff=0,this._stiffNNonstiff=0);return!1},t}();e.Dopri=p},167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5StepControl=void 0;e.Dopri5StepControl=function(){this.factorSafe=.9,this.factorMin=.2,this.factorMax=10,this.beta=.04,this.constant=.2-.75*this.beta}},922:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5=void 0;var s=o(r(660)),a=o(r(167)),u=r(430),l=function(){function t(t,e){this.order=5,this.stepControl=new a.Dopri5StepControl,this.nEval=0,this.rhs=t,this.n=e,this.y=new Array(e),this.yNext=new Array(e),this.yStiff=new Array(e),this.k1=new Array(e),this.k2=new Array(e),this.k3=new Array(e),this.k4=new Array(e),this.k5=new Array(e),this.k6=new Array(e),this.history=new u.HistoryElement(this.order*e)}return t.prototype.step=function(t,e){var r=this.n,n=this.y,i=this.yNext,o=this.k1,s=this.k2,a=this.k3,u=this.k4,l=this.k5,c=this.k6,h=this.history.data,f=0;for(f=0;f0&&Math.abs(t)*Math.sqrt(e/r)>3.25},t.prototype.reset=function(t,e){for(var r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var r=function(){function t(t){this.t=0,this.h=0,this.data=new Array(t)}return t.prototype.clone=function(){var e=new t(this.data.length);return e.t=this.t,e.h=this.h,e.data=this.data.slice(0),e},t}();e.HistoryElement=r},245:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=e.integrateDDE=e.DDE=e.integrateDopri=e.Dopri=void 0;var n=r(223);Object.defineProperty(e,"Dopri",{enumerable:!0,get:function(){return n.Dopri}}),Object.defineProperty(e,"integrateDopri",{enumerable:!0,get:function(){return n.integrateDopri}});var i=r(742);Object.defineProperty(e,"DDE",{enumerable:!0,get:function(){return i.DDE}}),Object.defineProperty(e,"integrateDDE",{enumerable:!0,get:function(){return i.integrateDDE}});var o=r(961);Object.defineProperty(e,"integrate",{enumerable:!0,get:function(){return o.integrate}})},961:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=void 0;var n=r(742),i=r(223);e.integrate=function(t,e,r,o,s,a){if(void 0===s&&(s={}),void 0===a&&(a=null),function(t){return 3===t.length}(t)){if(!function(t){return null===t||2===t.length}(a))throw new Error("Can't used delayed output with non-delayed rhs");return(0,i.integrateDopri)(t,e,r,o,s,a)}if(!function(t){return null===t||3===t.length}(a))throw new Error("Can't used non-delayed output with delayed rhs");return(0,n.integrateDDE)(t,e,r,o,s,a)}},216:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolator=void 0,e.interpolator=function(t,e,r){return function(n){return function(t,e,r,n){for(var i=[],o=e,s=0,a=0,u=t;a{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var n=r(606);Object.defineProperty(e,"HistoryElement",{enumerable:!0,get:function(){return n.HistoryElement}})},660:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.seqLen=e.approxEqualArray=e.approxEqual=e.zeros=e.copyArray=e.constrain=e.square=void 0;var r=Math.pow(2,-26);e.square=function(t){return t*t},e.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},e.copyArray=function(t,e){for(var r=t.length,n=0;nn&&(i/=o),in&&(o/=i),o1;){var i=Math.floor((r+n)/2);e(t[i])?n=i:r=i}return r}},863:t=>{t.exports=function(t,e,r,n,i){var o,s;for(o=1;o=0;o--){if(0===r[o])return console.log("tridiagonalSolve: failed due to singular matrix"),!1;i[o]=(i[o]-n[o]*i[o+1])/r[o]}return!0}},653:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;const n=r(458),i=r(166),o=r(650),s=r(536);e.base={delay:n.delay,interpolate:i.interpolate,maths:o.maths,user:s.user}},401:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.alignDescriptionsGetLevels=e.computeExtremesResult=e.valueAtTimeResult=e.updatePars=e.batchParsDisplace=e.batchParsRange=e.batchPars=e.batchRun=e.Batch=e.expandVaryingParams=void 0;const n=r(822),i=r(882),o=r(915);function s(t){const e=[],r=(n,i)=>{const o=n===t.length-1,s=t[n];if(0===s.values.length)throw Error(`Varying parameter '${s.name}' must have at least one value`);s.values.forEach((t=>{const a=Object.assign(Object.assign({},i),{[s.name]:t});o?e.push(a):r(n+1,a)}))};if(!(t.length>0))throw Error("A batch must have at least one varying parameter");return r(0,{}),e}e.expandVaryingParams=s;class a{constructor(t,e,r,n,i=501){this.pars=e,this.tStart=r,this.tEnd=n,this.solutions=[],this.runStatuses=[],this._pending=s(e.varying),this._run=t,this._nPointsForExtremes=i}get errors(){return this.runStatuses.filter((t=>!t.success))}get successfulVaryingParams(){return this.runStatuses.filter((t=>t.success)).map((t=>t.pars))}compute(){if(this._pending.length>0){const t=this._pending[0];this._pending=this._pending.slice(1);const e=l(this.pars.base,t);try{this.solutions.push(this._run(e,this.tStart,this.tEnd)),this.addRunStatus(t,!0,null)}catch(e){this.addRunStatus(t,!1,e.message)}}const t=0===this._pending.length;if(t&&0===this.solutions.length)throw Error(`All solutions failed; first error: ${this.errors[0].error}`);return t}run(){for(;!this.compute(););}valueAtTime(t){return function(t,e,r){return h(e,r.map((e=>e({mode:n.TimeMode.Given,times:[t]}))))}(t,this.successfulVaryingParams,this.solutions)}extreme(t){return this.findExtremes()[t]}findExtremes(){if(void 0===this._extremes){const i=(t={mode:n.TimeMode.Grid,nPoints:this._nPointsForExtremes,tEnd:this.tEnd,tStart:this.tStart},e=this.successfulVaryingParams,r=this.solutions,f(e,r.map((e=>e(t)))));if(0!==this._pending.length)return i;this._extremes=i}var t,e,r;return this._extremes}addRunStatus(t,e,r){this.runStatuses.push({pars:t,success:e,error:r})}}function u(t,e,r,n,o,s){const a=c(t,e);if(o>a)throw Error(`Expected lower bound to be no greater than ${a}`);if(s=s)throw Error("Expected upper bound to be greater than lower bound");if(r<2)throw Error("Must include at least 2 traces in the batch");if(n&&o<=0)throw Error("Lower bound must be greater than 0 for logarithmic scale");return{name:e,values:n?(0,i.gridLog)(o,s,r):(0,i.grid)(o,s,r)}}function l(t,e){return Object.assign(Object.assign({},t),e)}function c(t,e){const r=t[e];if(void 0===r)throw Error(`Expected a value for '${e}'`);if("number"!=typeof r)throw Error(`Expected a number for '${e}'`);return r}function h(t,e){const r={x:t,values:[]},n=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of n){const n=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;te[t].y[0]));r.values.push(Object.assign(Object.assign({},n[0][t]),{y:e}))}}return r}function f(t,e){const r=()=>({x:[...t],values:[]}),n={tMax:r(),tMin:r(),yMax:r(),yMin:r()};if(0===t.length)return n;const o=e[0].x,s=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of s){const r=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=r[0].length;for(let t=0;tp(o,e[t].y)));Object.keys(n).forEach((i=>{const o=i;n[o].values.push(Object.assign(Object.assign({},r[0][t]),{y:e.map((t=>t[o]))}))}))}}return n}function p(t,e){const r=(0,i.whichMin)(e),n=(0,i.whichMax)(e),o=t[r],s=t[n],a=e[r];return{tMax:s,tMin:o,yMax:e[n],yMin:a}}function d(t){const e=t.map((t=>t.length));if(e.every((t=>1===t)))return t;Math.max(...e);const r=v(t);for(let e=0;eObject.assign(Object.assign({},t[e][0]),{description:r}))));return t}function v(t){let e=null,r=[];return t.forEach((t=>{if(1===t.length){const r=t[0].description;if(null===e)e=r;else if(r!==e)throw Error(`Unexpected inconsistent descriptions: have ${e}, but given ${r}`)}else{const e=t.map((t=>t.description));if(0===r.length){if(e.some((t=>void 0===t)))throw Error("Expected all descriptions to be defined");r=e}else if(!(0,i.sameArrayContents)(e,r))throw Error(`Unexpected inconsistent descriptions: have [${r.join(", ")}], but given [${e.join(", ")}]`)}})),r}e.Batch=a,e.batchRun=function(t,e,r,n,i,s=!0){const u=new a(((e,r,n)=>(0,o.wodinRun)(t,e,r,n,i)),e,r,n);return s&&u.run(),u},e.batchPars=function(t,e){return{base:t,varying:e}},e.batchParsRange=u,e.batchParsDisplace=function(t,e,r,n,i){const o=c(t,e),s=i/100;return u(t,e,r,n,o*(1-s),o*(1+s))},e.updatePars=l,e.valueAtTimeResult=h,e.computeExtremesResult=f,e.alignDescriptionsGetLevels=v},458:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t,e,r,n){const i=t(e);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfSquares=e.updatePars=e.fitTarget=void 0;const n=r(653),i=r(134),o=r(822);function s(t,e){const r=Object.assign({},t.base);for(let n=0;n{const f=s(r,h),p=new t(n.base,f,"error"),d=(0,i.runModel)(p,null,0,c,l).solution,v=p.names(),_=v.indexOf(u),y=d(e.time).map((t=>t[_]));return{data:{endTime:c,names:v,pars:f,solution:(0,o.interpolatedSolution)(d,v,0,c),startTime:0},value:a(e.value,y)}}},e.updatePars=s,e.sumOfSquares=a},166:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.interpolateTimes=e.interpolateCheckT=e.interpolateCheckY=e.interpolateAlloc=void 0;const n=r(673);function i(t,e,r){const i=function(t,e){if(t.length===e)return[t];const r=[],n=t.length/e;for(let i=0;ir.max)throw Error(`Integration times do not span interpolation range; max: ${r.max}`);return r.max===1/0?n:(void 0===n&&(n=[]),[...n,r.max])},e.interpolateTimes=s,e.interpolate={alloc:i,checkY:o,times:s}},650:(t,e)=>{function r(t){return.5===i(t,1)?2*Math.round(t/2):Math.round(t)}function n(t,e){if(void 0===e||0===e)return r(t);{const n=Math.pow(10,e);return r(t*n)/n}}function i(t,e){let r=t%e;return r*e<0&&(r+=e),r}function o(t,e){return Math.floor(t/e)}function s(t,e,r){let n=0;for(let i=e;it.output(e,r,n)),null===e&&(e=t.initial(r)),t.getInternal().initial_t=r;const a=new s.DDE((function(e,r,n,i){t.rhs(e,r,n,i)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i):function(t,e,r,n,i){let o=null;"function"==typeof t.output&&(o=(e,r)=>t.output(e,r)),null===e&&(e=t.initial(r));const a=new s.Dopri((function(e,r,n){t.rhs(e,r,n)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i)}},586:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PkgWrapper=void 0;const n=r(653),i=r(134);e.PkgWrapper=class{constructor(t,e,r){this.model=new t(n.base,e,r)}initial(t){return this.model.initial(t)}rhs(t,e){const r=new Array(e.length).fill(0);let n=null;if(!(0,i.isODEModel)(this.model))throw Error("Can't use rhs() with delay models");return this.model,this.model.rhs(t,e,r),this.model.output&&(n=this.model.output(t,e)),{output:n,state:r}}getMetadata(){return this.model.getMetadata()}getInternal(){return this.model.getInternal()}setUser(t,e){this.model.setUser(t,e)}run(t,e,r){const n=t[0],o=t[t.length-1],s=(0,i.runModel)(this.model,e,n,o,r);return{names:this.model.names(),statistics:s.statistics,y:s.solution(t)}}}},822:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedSolution=e.TimeMode=void 0;const n=r(882);var i;!function(t){t.Grid="grid",t.Given="given"}(i=e.TimeMode||(e.TimeMode={})),e.interpolatedSolution=function(t,e,r,o){return s=>{const a=function(t,e,r){switch(t.mode){case i.Grid:return(0,n.grid)(Math.max(e,t.tStart),Math.min(r,t.tEnd),t.nPoints);case i.Given:return t.times}}(s,r,o),u=t(a);return{values:e.map(((t,r)=>({name:e[r],y:u.map((t=>t[r]))}))),x:a}}}},536:(t,e)=>{function r(t,e,r){if("ignore"===r)return;const n=[];for(const r of Object.keys(t))e.includes(r)||n.push(r);if(n.length>0){const t="Unknown user parameters: "+n.join(", ");if("message"===r)console.log(t);else{if("warning"!==r)throw"stop"===r?Error(t):Error(t+" (and invalid value for unusedUserAction)");console.warn(t)}}}function n(t,e,r,n,i,o,s){const a=t[e];if(void 0===a){if(void 0!==r[e])return;if(null===n)throw Error(`Expected a value for '${e}'`);r[e]=n}else{if("number"!=typeof a)throw Error(`Expected a number for '${e}'`);l(a,i,o,s,e),r[e]=a}}function i(t,e,r,n,i,o,l){let c=t[e];if(void 0===c){if(void 0!==r[e])return;throw Error(`Expected a value for '${e}'`)}{const t=n.length-1;c=s(c),a(t,c,e),function(t,e,r){const n=t.length-1;for(let i=0;ir)throw Error(`Expected '${i}' to be at most ${r}`);if(n&&!Number.isInteger(t))throw Error(`Expected '${i}' to be integer-like`)}Object.defineProperty(e,"__esModule",{value:!0}),e.user=e.setUserArrayVariable=e.setUserArrayFixed=e.setUserScalar=e.checkUser=void 0,e.checkUser=r,e.setUserScalar=n,e.setUserArrayFixed=i,e.setUserArrayVariable=o,e.user={checkUser:r,setUserArrayFixed:i,setUserArrayVariable:o,setUserScalar:n}},882:(t,e)=>{function r(t,e,r){const n=(e-t)/(r-1),i=[];for(let e=0;er&&(e=n,r=t[n]);return e},e.unique=function(t){return[...new Set(t)]},e.sameArrayContents=function(t,e){return t.length===e.length&&t.every(((t,r)=>e[r]===t))}},556:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{dfoptim:"0.0.5",dopri:"0.0.13",odinjs:"0.1.1"}}},915:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wodinFitValue=e.wodinFit=e.wodinRun=void 0;const n=r(153),i=r(653),o=r(410),s=r(134),a=r(822);e.wodinRun=function(t,e,r,n,o){const u=new t(i.base,e,"error"),l=(0,s.runModel)(u,null,r,n,o).solution,c=u.names();return(0,a.interpolatedSolution)(l,c,r,n)},e.wodinFit=function(t,e,r,i,s,a){const u=(0,o.fitTarget)(t,e,r,i,s),l=r.vary.map((t=>r.base[t]));return new n.Simplex(u,l,a)},e.wodinFitValue=function(t,e,r){const n=t({mode:a.TimeMode.Given,times:e.time}),i=n.values.findIndex((t=>t.name===r));return(0,o.sumOfSquares)(e.value,n.values[i].y)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}var n={};(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.versions=t.batchRun=t.batchParsRange=t.batchParsDisplace=t.Batch=t.TimeMode=t.base=t.PkgWrapper=t.wodinRun=t.wodinFitValue=t.wodinFit=void 0;var e=r(915);Object.defineProperty(t,"wodinFit",{enumerable:!0,get:function(){return e.wodinFit}}),Object.defineProperty(t,"wodinFitValue",{enumerable:!0,get:function(){return e.wodinFitValue}}),Object.defineProperty(t,"wodinRun",{enumerable:!0,get:function(){return e.wodinRun}});var i=r(586);Object.defineProperty(t,"PkgWrapper",{enumerable:!0,get:function(){return i.PkgWrapper}});var o=r(653);Object.defineProperty(t,"base",{enumerable:!0,get:function(){return o.base}});var s=r(822);Object.defineProperty(t,"TimeMode",{enumerable:!0,get:function(){return s.TimeMode}});var a=r(401);Object.defineProperty(t,"Batch",{enumerable:!0,get:function(){return a.Batch}}),Object.defineProperty(t,"batchParsDisplace",{enumerable:!0,get:function(){return a.batchParsDisplace}}),Object.defineProperty(t,"batchParsRange",{enumerable:!0,get:function(){return a.batchParsRange}}),Object.defineProperty(t,"batchRun",{enumerable:!0,get:function(){return a.batchRun}});var u=r(556);Object.defineProperty(t,"versions",{enumerable:!0,get:function(){return u.versions}})})(),odinjs=n})(); +var odinjs;(()=>{"use strict";var t={6:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateSearch=e.InterpolatorBase=void 0;var r=function(){function t(t,e){(function(t){return Array.isArray(t[0])})(e)||(e=[e]),this._i=0,this._x=t,this._y=e,this.nX=this._x.length,this.nY=this._y.length;for(var r=0;r=s-1)return s;for(i=n+o;e[i]=s){if(e[i=s-1]t;){if(i=n,n<(o*=2)){if(e[n=0]>t)return-1;break}n-=o}}for(;i-n>1;){var a=Math.floor((i+n)/2);e[a]{Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorSpline=e.InterpolatorLinear=e.InterpolatorConstant=e.InterpolatorBase=void 0;var n=r(6);Object.defineProperty(e,"InterpolatorBase",{enumerable:!0,get:function(){return n.InterpolatorBase}});var i=r(731);Object.defineProperty(e,"InterpolatorConstant",{enumerable:!0,get:function(){return i.InterpolatorConstant}});var o=r(477);Object.defineProperty(e,"InterpolatorLinear",{enumerable:!0,get:function(){return o.InterpolatorLinear}});var s=r(869);Object.defineProperty(e,"InterpolatorSpline",{enumerable:!0,get:function(){return s.InterpolatorSpline}})},477:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.InterpolatorLinear=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eval=function(t,e){void 0===e&&(e=0);var r=this.search(t,!1),n=this._x[r],i=(t-n)/(this._x[r+1]-n),o=this._y[e],s=o[r];return s+(o[r+1]-s)*i},e}(r(6).InterpolatorBase);e.InterpolatorLinear=o},869:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.solve=e.InterpolatorSpline=void 0;var s=o(r(863)),a=function(t){function e(e,r){var n=t.call(this,e,r)||this,i=function(t){var e=t.length,r=Array(e),n=Array(e),i=Array(e);r[0]=0,n[0]=2/(t[1]-t[0]),i[0]=1/(t[1]-t[0]);for(var o=1;o{function r(t,e){return void 0===t?e:t}Object.defineProperty(e,"__esModule",{value:!0}),e.simplexControl=void 0,e.simplexControl=function(t){void 0===t&&(t={});var e={deltaNonZero:r(t.deltaNonZero,.05),deltaZero:r(t.deltaZero,.001),errorOnFailure:r(t.errorOnFailure,!1),tolerance:r(t.tolerance,1e-5)};if(e.tolerance<=0)throw new Error("Invalid control parameter: 'tolerance' must be strictly positive");return e}},153:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(169);Object.defineProperty(e,"Simplex",{enumerable:!0,get:function(){return n.Simplex}}),Object.defineProperty(e,"fitSimplex",{enumerable:!0,get:function(){return n.fitSimplex}})},169:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Simplex=e.fitSimplex=void 0;var n=r(394),i=r(3);function o(t,e,r){for(var n=e.length,i=new Array(n),o=1+t,s=-t,a=0;a=this._simplex[t-1].value){var s=i.value>r.value?this._contractInside(r,n):this._contractOutside(r,n);if(s.value{Object.defineProperty(e,"__esModule",{value:!0}),e.checkResult=void 0,e.checkResult=function(t){return"number"==typeof t?{data:null,value:t}:t}},886:function(t,e){var r=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i0&&(f.tcrit=r([],f.tcrit,!0).sort()),f.maxSteps<1)throw n("maxSteps","must be at least 1");if(f.atol<=0)throw n("atol","must be strictly positive");if(f.rtol<=0)throw n("rtol","must be strictly positive");return f}},742:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.DDE=e.integrateDDE=void 0;var o=r(223),s=r(660);e.integrateDDE=function(t,e,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=null);var s=new a(t,e.length,i,o);return s.initialise(r,e),s.run(n)};var a=function(t){function e(e,r,n,i){void 0===n&&(n={}),void 0===i&&(i=null);var o=this,s=function(t){return o._interpolate(t)},a=null===i?null:function(t,e){return i(t,e,s)};return(o=t.call(this,(function(t,r,n){return e(t,r,n,s)}),r,n,a)||this)._y0=new Array(r),o}return i(e,t),e.prototype.initialise=function(e,r){return this._y0=r,t.prototype.initialise.call(this,e,r),this},e.prototype._interpolate=function(t){var e=this._findHistory(t);return e<0?this._y0.slice(0):this._stepper.interpolate(t,this._history[e])},e.prototype._findHistory=function(t){return(0,s.search)(this._history,(function(e){return e.t>t}))},e}(o.Dopri);e.DDE=a},223:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;it._t})),0===this._tcrit.length?1/0:this._tcrit[0])},t.prototype._step=function(){for(var t=this._t,e=this._h,r=!1,n=!1,i=Math.max(this._lastError,1e-4),o=this._stepper.stepControl,s=this._control,a=this._nextTcrit();!r;){if(this._nSteps>s.maxSteps)throw f("too many steps",t);if(ea&&(e=a-t),this._stepper.step(t,e),this._nSteps++;var u=this._stepper.error(s.atol,s.rtol),l=Math.pow(u,o.constant),p=1/o.factorMin,d=1/o.factorMax;if(u<=1){if(r=!0,this._nStepsAccepted++,this._isStiff(e))throw f("problem became stiff",t);this._stepper.stepComplete(t,e);var v=l/Math.pow(i,o.beta),_=e/(v=c.constrain(v/o.factorSafe,d,p));this._t+=e,this._h=n?Math.min(_,e):Math.min(_,s.stepSizeMax),this._lastError=u}else n=!0,this._nStepsAccepted>=1&&this._nStepsRejected++,e/=Math.min(p,l/o.factorSafe)}return this._t},t.prototype._isStiff=function(t){if(this._stiffNStiff>0||this._nStepsAccepted%this._control.stiffCheck==0)if(this._stepper.isStiff(t)){if(this._stiffNNonstiff=0,this._stiffNStiff++>=15)return!0}else this._stiffNStiff>0&&this._stiffNNonstiff++>=6&&(this._stiffNStiff=0,this._stiffNNonstiff=0);return!1},t}();e.Dopri=p},167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5StepControl=void 0;e.Dopri5StepControl=function(){this.factorSafe=.9,this.factorMin=.2,this.factorMax=10,this.beta=.04,this.constant=.2-.75*this.beta}},922:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Dopri5=void 0;var s=o(r(660)),a=o(r(167)),u=r(430),l=function(){function t(t,e){this.order=5,this.stepControl=new a.Dopri5StepControl,this.nEval=0,this.rhs=t,this.n=e,this.y=new Array(e),this.yNext=new Array(e),this.yStiff=new Array(e),this.k1=new Array(e),this.k2=new Array(e),this.k3=new Array(e),this.k4=new Array(e),this.k5=new Array(e),this.k6=new Array(e),this.history=new u.HistoryElement(this.order*e)}return t.prototype.step=function(t,e){var r=this.n,n=this.y,i=this.yNext,o=this.k1,s=this.k2,a=this.k3,u=this.k4,l=this.k5,c=this.k6,h=this.history.data,f=0;for(f=0;f0&&Math.abs(t)*Math.sqrt(e/r)>3.25},t.prototype.reset=function(t,e){for(var r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var r=function(){function t(t){this.t=0,this.h=0,this.data=new Array(t)}return t.prototype.clone=function(){var e=new t(this.data.length);return e.t=this.t,e.h=this.h,e.data=this.data.slice(0),e},t}();e.HistoryElement=r},245:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=e.integrateDDE=e.DDE=e.integrateDopri=e.Dopri=void 0;var n=r(223);Object.defineProperty(e,"Dopri",{enumerable:!0,get:function(){return n.Dopri}}),Object.defineProperty(e,"integrateDopri",{enumerable:!0,get:function(){return n.integrateDopri}});var i=r(742);Object.defineProperty(e,"DDE",{enumerable:!0,get:function(){return i.DDE}}),Object.defineProperty(e,"integrateDDE",{enumerable:!0,get:function(){return i.integrateDDE}});var o=r(961);Object.defineProperty(e,"integrate",{enumerable:!0,get:function(){return o.integrate}})},961:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.integrate=void 0;var n=r(742),i=r(223);e.integrate=function(t,e,r,o,s,a){if(void 0===s&&(s={}),void 0===a&&(a=null),function(t){return 3===t.length}(t)){if(!function(t){return null===t||2===t.length}(a))throw new Error("Can't used delayed output with non-delayed rhs");return(0,i.integrateDopri)(t,e,r,o,s,a)}if(!function(t){return null===t||3===t.length}(a))throw new Error("Can't used non-delayed output with delayed rhs");return(0,n.integrateDDE)(t,e,r,o,s,a)}},216:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolator=void 0,e.interpolator=function(t,e,r){return function(n){return function(t,e,r,n){for(var i=[],o=e,s=0,a=0,u=t;a{Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryElement=void 0;var n=r(606);Object.defineProperty(e,"HistoryElement",{enumerable:!0,get:function(){return n.HistoryElement}})},660:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.search=e.seqLen=e.approxEqualArray=e.approxEqual=e.zeros=e.copyArray=e.constrain=e.square=void 0;var r=Math.pow(2,-26);e.square=function(t){return t*t},e.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},e.copyArray=function(t,e){for(var r=t.length,n=0;nn&&(i/=o),in&&(o/=i),o1;){var i=Math.floor((r+n)/2);e(t[i])?n=i:r=i}return r}},863:t=>{t.exports=function(t,e,r,n,i){var o,s;for(o=1;o=0;o--){if(0===r[o])return console.log("tridiagonalSolve: failed due to singular matrix"),!1;i[o]=(i[o]-n[o]*i[o+1])/r[o]}return!0}},653:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base=void 0;const n=r(458),i=r(166),o=r(650),s=r(536);e.base={delay:n.delay,interpolate:i.interpolate,maths:o.maths,user:s.user}},401:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.alignDescriptionsGetLevels=e.computeExtremesResult=e.valueAtTimeResult=e.updatePars=e.batchParsDisplace=e.batchParsRange=e.batchPars=e.batchRun=e.Batch=e.expandVaryingParams=void 0;const n=r(822),i=r(882),o=r(915);function s(t){const e=[],r=(n,i)=>{const o=n===t.length-1,s=t[n];if(0===s.values.length)throw Error(`Varying parameter '${s.name}' must have at least one value`);s.values.forEach((t=>{const a=Object.assign(Object.assign({},i),{[s.name]:t});o?e.push(a):r(n+1,a)}))};if(!(t.length>0))throw Error("A batch must have at least one varying parameter");return r(0,{}),e}e.expandVaryingParams=s;class a{constructor(t,e,r,n,i=501){this.pars=e,this.tStart=r,this.tEnd=n,this.solutions=[],this.runStatuses=[],this._pending=s(e.varying),this._run=t,this._nPointsForExtremes=i}get errors(){return this.runStatuses.filter((t=>!t.success))}get successfulVaryingParams(){return this.runStatuses.filter((t=>t.success)).map((t=>t.pars))}compute(){if(this._pending.length>0){const t=this._pending[0];this._pending=this._pending.slice(1);const e=l(this.pars.base,t);try{this.solutions.push(this._run(e,this.tStart,this.tEnd)),this.addRunStatus(t,!0,null)}catch(e){this.addRunStatus(t,!1,e.message)}}const t=0===this._pending.length;if(t&&0===this.solutions.length)throw Error(`All solutions failed; first error: ${this.errors[0].error}`);return t}run(){for(;!this.compute(););}valueAtTime(t){return function(t,e,r){return h(e,r.map((e=>e({mode:n.TimeMode.Given,times:[t]}))))}(t,this.successfulVaryingParams,this.solutions)}extreme(t){return this.findExtremes()[t]}findExtremes(){if(void 0===this._extremes){const i=(t={mode:n.TimeMode.Grid,nPoints:this._nPointsForExtremes,tEnd:this.tEnd,tStart:this.tStart},e=this.successfulVaryingParams,r=this.solutions,f(e,r.map((e=>e(t)))));if(0!==this._pending.length)return i;this._extremes=i}var t,e,r;return this._extremes}addRunStatus(t,e,r){this.runStatuses.push({pars:t,success:e,error:r})}}function u(t,e,r,n,o,s){const a=c(t,e);if(o>a)throw Error(`Expected lower bound to be no greater than ${a}`);if(s=s)throw Error("Expected upper bound to be greater than lower bound");if(r<2)throw Error("Must include at least 2 traces in the batch");if(n&&o<=0)throw Error("Lower bound must be greater than 0 for logarithmic scale");return{name:e,values:n?(0,i.gridLog)(o,s,r):(0,i.grid)(o,s,r)}}function l(t,e){return Object.assign(Object.assign({},t),e)}function c(t,e){const r=t[e];if(void 0===r)throw Error(`Expected a value for '${e}'`);if("number"!=typeof r)throw Error(`Expected a number for '${e}'`);return r}function h(t,e){const r={x:t,values:[]},n=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of n){const n=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=n[0].length;for(let t=0;te[t].y[0]));r.values.push(Object.assign(Object.assign({},n[0][t]),{y:e}))}}return r}function f(t,e){const r=()=>({x:[...t],values:[]}),n={tMax:r(),tMin:r(),yMax:r(),yMin:r()};if(0===t.length)return n;const o=e[0].x,s=(0,i.unique)(e[0].values.map((t=>t.name)));for(const t of s){const r=d(e.map((e=>e.values.filter((e=>e.name===t))))),i=r[0].length;for(let t=0;tp(o,e[t].y)));Object.keys(n).forEach((i=>{const o=i;n[o].values.push(Object.assign(Object.assign({},r[0][t]),{y:e.map((t=>t[o]))}))}))}}return n}function p(t,e){const r=(0,i.whichMin)(e),n=(0,i.whichMax)(e),o=t[r],s=t[n],a=e[r];return{tMax:s,tMin:o,yMax:e[n],yMin:a}}function d(t){const e=t.map((t=>t.length));if(e.every((t=>1===t)))return t;Math.max(...e);const r=v(t);for(let e=0;eObject.assign(Object.assign({},t[e][0]),{description:r}))));return t}function v(t){let e=null,r=[];return t.forEach((t=>{if(1===t.length){const r=t[0].description;if(null===e)e=r;else if(r!==e)throw Error(`Unexpected inconsistent descriptions: have ${e}, but given ${r}`)}else{const e=t.map((t=>t.description));if(0===r.length){if(e.some((t=>void 0===t)))throw Error("Expected all descriptions to be defined");r=e}else if(!(0,i.sameArrayContents)(e,r))throw Error(`Unexpected inconsistent descriptions: have [${r.join(", ")}], but given [${e.join(", ")}]`)}})),r}e.Batch=a,e.batchRun=function(t,e,r,n,i,s=!0){const u=new a(((e,r,n)=>(0,o.wodinRun)(t,e,r,n,i)),e,r,n);return s&&u.run(),u},e.batchPars=function(t,e){return{base:t,varying:e}},e.batchParsRange=u,e.batchParsDisplace=function(t,e,r,n,i){const o=c(t,e),s=i/100;return u(t,e,r,n,o*(1-s),o*(1+s))},e.updatePars=l,e.valueAtTimeResult=h,e.computeExtremesResult=f,e.alignDescriptionsGetLevels=v},458:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.delay=void 0,e.delay=function(t,e,r,n){const i=t(e);for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfSquares=e.updatePars=e.fitTarget=void 0;const n=r(653),i=r(134),o=r(822);function s(t,e){const r=Object.assign({},t.base);for(let n=0;n{const f=s(r,h),p=new t(n.base,f,"error"),d=(0,i.runModel)(p,null,0,c,l).solution,v=p.names(),_=v.indexOf(u),y=d(e.time).map((t=>t[_]));return{data:{endTime:c,names:v,pars:f,solution:(0,o.interpolatedSolution)(d,v,0,c),startTime:0},value:a(e.value,y)}}},e.updatePars=s,e.sumOfSquares=a},166:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.interpolateTimes=e.interpolateCheckT=e.interpolateCheckY=e.interpolateAlloc=void 0;const n=r(673);function i(t,e,r){const i=function(t,e){if(t.length===e)return[t];const r=[],n=t.length/e;for(let i=0;ir.max)throw Error(`Integration times do not span interpolation range; max: ${r.max}`);return r.max===1/0?n:(void 0===n&&(n=[]),[...n,r.max])},e.interpolateTimes=s,e.interpolate={alloc:i,checkY:o,times:s}},650:(t,e)=>{function r(t){return.5===i(t,1)?2*Math.round(t/2):Math.round(t)}function n(t,e){if(void 0===e||0===e)return r(t);{const n=Math.pow(10,e);return r(t*n)/n}}function i(t,e){let r=t%e;return r*e<0&&(r+=e),r}function o(t,e){return Math.floor(t/e)}function s(t,e,r){let n=0;for(let i=e;it.output(e,r,n)),null===e&&(e=t.initial(r)),t.getInternal().initial_t=r;const a=new s.DDE((function(e,r,n,i){t.rhs(e,r,n,i)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i):function(t,e,r,n,i){let o=null;"function"==typeof t.output&&(o=(e,r)=>t.output(e,r)),null===e&&(e=t.initial(r));const a=new s.Dopri((function(e,r,n){t.rhs(e,r,n)}),e.length,i,o);return a.initialise(r,e),{solution:a.run(n),statistics:a.statistics()}}(t,e,r,n,i)}},586:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PkgWrapper=void 0;const n=r(653),i=r(134);e.PkgWrapper=class{constructor(t,e,r){this.model=new t(n.base,e,r)}initial(t){return this.model.initial(t)}rhs(t,e){const r=new Array(e.length).fill(0);let n=null;if(!(0,i.isODEModel)(this.model))throw Error("Can't use rhs() with delay models");return this.model,this.model.rhs(t,e,r),this.model.output&&(n=this.model.output(t,e)),{output:n,state:r}}getMetadata(){return this.model.getMetadata()}getInternal(){return this.model.getInternal()}setUser(t,e){this.model.setUser(t,e)}run(t,e,r){const n=t[0],o=t[t.length-1],s=(0,i.runModel)(this.model,e,n,o,r);return{names:this.model.names(),statistics:s.statistics,y:s.solution(t)}}}},822:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.interpolatedSolution=e.TimeMode=void 0;const n=r(882);var i;!function(t){t.Grid="grid",t.Given="given"}(i=e.TimeMode||(e.TimeMode={})),e.interpolatedSolution=function(t,e,r,o){return s=>{const a=function(t,e,r){switch(t.mode){case i.Grid:return(0,n.grid)(Math.max(e,t.tStart),Math.min(r,t.tEnd),t.nPoints);case i.Given:return t.times}}(s,r,o),u=t(a);return{values:e.map(((t,r)=>({name:e[r],y:u.map((t=>t[r]))}))),x:a}}}},536:(t,e)=>{function r(t,e,r){if("ignore"===r)return;const n=[];for(const r of Object.keys(t))e.includes(r)||n.push(r);if(n.length>0){const t="Unknown user parameters: "+n.join(", ");if("message"===r)console.log(t);else{if("warning"!==r)throw"stop"===r?Error(t):Error(t+" (and invalid value for unusedUserAction)");console.warn(t)}}}function n(t,e,r,n,i,o,s){const a=t[e];if(void 0===a){if(void 0!==r[e])return;if(null===n)throw Error(`Expected a value for '${e}'`);r[e]=n}else{if("number"!=typeof a)throw Error(`Expected a number for '${e}'`);l(a,i,o,s,e),r[e]=a}}function i(t,e,r,n,i,o,l){let c=t[e];if(void 0===c){if(void 0!==r[e])return;throw Error(`Expected a value for '${e}'`)}{const t=n.length-1;c=s(c),a(t,c,e),function(t,e,r){const n=t.length-1;for(let i=0;ir)throw Error(`Expected '${i}' to be at most ${r}`);if(n&&!Number.isInteger(t))throw Error(`Expected '${i}' to be integer-like`)}Object.defineProperty(e,"__esModule",{value:!0}),e.user=e.setUserArrayVariable=e.setUserArrayFixed=e.setUserScalar=e.checkUser=void 0,e.checkUser=r,e.setUserScalar=n,e.setUserArrayFixed=i,e.setUserArrayVariable=o,e.user={checkUser:r,setUserArrayFixed:i,setUserArrayVariable:o,setUserScalar:n}},882:(t,e)=>{function r(t,e,r){const n=(e-t)/(r-1),i=[];for(let e=0;er&&(e=n,r=t[n]);return e},e.unique=function(t){return[...new Set(t)]},e.sameArrayContents=function(t,e){return t.length===e.length&&t.every(((t,r)=>e[r]===t))}},556:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.versions=void 0,e.versions=function(){return{dfoptim:"0.0.5",dopri:"0.0.13",odinjs:"0.1.3"}}},915:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wodinFitValue=e.wodinFit=e.wodinRun=void 0;const n=r(153),i=r(653),o=r(410),s=r(134),a=r(822);e.wodinRun=function(t,e,r,n,o){const u=new t(i.base,e,"error"),l=(0,s.runModel)(u,null,r,n,o).solution,c=u.names();return(0,a.interpolatedSolution)(l,c,r,n)},e.wodinFit=function(t,e,r,i,s,a){const u=(0,o.fitTarget)(t,e,r,i,s),l=r.vary.map((t=>r.base[t]));return new n.Simplex(u,l,a)},e.wodinFitValue=function(t,e,r){const n=t({mode:a.TimeMode.Given,times:e.time}),i=n.values.findIndex((t=>t.name===r));return(0,o.sumOfSquares)(e.value,n.values[i].y)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}var n={};(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.versions=t.batchRun=t.batchParsRange=t.batchParsDisplace=t.Batch=t.TimeMode=t.base=t.PkgWrapper=t.wodinRun=t.wodinFitValue=t.wodinFit=void 0;var e=r(915);Object.defineProperty(t,"wodinFit",{enumerable:!0,get:function(){return e.wodinFit}}),Object.defineProperty(t,"wodinFitValue",{enumerable:!0,get:function(){return e.wodinFitValue}}),Object.defineProperty(t,"wodinRun",{enumerable:!0,get:function(){return e.wodinRun}});var i=r(586);Object.defineProperty(t,"PkgWrapper",{enumerable:!0,get:function(){return i.PkgWrapper}});var o=r(653);Object.defineProperty(t,"base",{enumerable:!0,get:function(){return o.base}});var s=r(822);Object.defineProperty(t,"TimeMode",{enumerable:!0,get:function(){return s.TimeMode}});var a=r(401);Object.defineProperty(t,"Batch",{enumerable:!0,get:function(){return a.Batch}}),Object.defineProperty(t,"batchParsDisplace",{enumerable:!0,get:function(){return a.batchParsDisplace}}),Object.defineProperty(t,"batchParsRange",{enumerable:!0,get:function(){return a.batchParsRange}}),Object.defineProperty(t,"batchRun",{enumerable:!0,get:function(){return a.batchRun}});var u=r(556);Object.defineProperty(t,"versions",{enumerable:!0,get:function(){return u.versions}})})(),odinjs=n})(); diff --git a/scripts/update_js b/scripts/update_js index 05557b0b..61e9c679 100755 --- a/scripts/update_js +++ b/scripts/update_js @@ -2,7 +2,7 @@ set -exu ODIN_JS_BRANCH=mrc-4455 -DUST_JS_BRANCH=main +DUST_JS_BRANCH=update-odin-js HERE=$(dirname $0) PACKAGE_ROOT=$(realpath $HERE/..) From 52cea3153502dd5708f9dce486f06bcda2f2dad5 Mon Sep 17 00:00:00 2001 From: EmmaLRussell Date: Wed, 30 Aug 2023 17:05:42 +0100 Subject: [PATCH 5/6] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index efec8be7..53966b58 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: odin Title: ODE Generation and Integration -Version: 1.5.7 +Version: 1.5.8 Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"), email = "rich.fitzjohn@gmail.com"), person("Thibaut", "Jombart", role = "ctb"), From 590ea82c898bd91ad7cd7394be0a87d698f10dff Mon Sep 17 00:00:00 2001 From: EmmaLRussell Date: Fri, 1 Sep 2023 10:23:29 +0100 Subject: [PATCH 6/6] reset odin-js and dust-js branches to main --- scripts/update_js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/update_js b/scripts/update_js index 61e9c679..a449dc58 100755 --- a/scripts/update_js +++ b/scripts/update_js @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -exu -ODIN_JS_BRANCH=mrc-4455 -DUST_JS_BRANCH=update-odin-js +ODIN_JS_BRANCH=main +DUST_JS_BRANCH=main HERE=$(dirname $0) PACKAGE_ROOT=$(realpath $HERE/..)