odsa/dist/bundle.js

1 line
24 KiB
JavaScript
Raw Permalink Normal View History

2019-05-14 15:42:03 +02:00
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var o=function(e,t){var n=new a(e,t);return function(){return n.current()}};Object.defineProperty(o,"default",{value:o});var i=o;o.root=function(e){var t=m,n=0===e.length?y:new a(null,null),o=void 0,i=0===e.length?null:function(){null!==g?p.disposes.add(n):O(n)};return m=n,null===g?o=function(e,t,n){try{return null===t?e():e(t)}finally{m=n}}(e,i,t):(o=null===i?e():e(i),m=t),o},o.on=function(e,t,n,i){var l;return Array.isArray(e)&&(l=e,e=function(){for(var e=0;e<l.length;e++)l[e]()}),i=!!i,o(r,n);function r(n){var o=v;return e(),i?i=!1:(v=null,n=t(n),v=o),n}},o.effect=function(e,t){new a(e,t)},o.data=function(e){var t=new s(e);return function(e){return 0===arguments.length?t.current():t.next(e)}},o.value=function(e,t){var n=o.data(e),i=-1;return function(o){if(0===arguments.length)return n();if(!(t?t(e,o):e===o)){var l=p.time;if(i===l)throw new Error("conflicting values: "+o+" is not the same as "+e);i=l,e=o,n(o)}return o}},o.freeze=function(e){var t=void 0;if(null!==g)t=e();else{(g=p).changes.reset();try{t=e(),S()}finally{g=null}}return t},o.sample=function(e){var t,n=v;return null!==n?(v=null,t=e(),v=n):t=e(),t},o.cleanup=function(e){null!==m?null===m.cleanups?m.cleanups=[e]:m.cleanups.push(e):console.warn("cleanups created without a root or parent will never be run")},o.makeDataNode=function(e){return new s(e)},o.makeComputationNode=function(e,t){return new a(e,t)},o.isFrozen=function(){return null!==g},o.isListening=function(){return null!==v};var l=function(){return function(){this.time=0,this.changes=new c,this.updates=new c,this.disposes=new c}}(),r={time:function(){return p.time}},s=function(){function e(e){this.value=e,this.pending=d,this.log=null}return e.prototype.current=function(){return null!==v&&function(e,t){null===e.log&&(e.log=new u);x(e.log,t)}(this,v),this.value},e.prototype.next=function(e){if(null!==g)if(this.pending!==d){if(e!==this.pending)throw new Error("conflicting changes: "+e+" !== "+this.pending)}else this.pending=e,p.changes.add(this);else null!==this.log?(this.pending=e,p.changes.add(this),S()):this.value=e;return e},e.prototype.clock=function(){return r},e}(),a=function(){function e(e,t){if(this.state=f,this.source1=null,this.source1slot=0,this.sources=null,this.sourceslots=null,this.log=null,this.owned=null,this.cleanups=null,this.fn=e,this.value=t,this.age=p.time,null!==e){var n=m,o=v;null===n&&console.warn("computations created without a root or parent will never be disposed"),m=v=this,null===g?function(e){g=p,p.changes.reset(),p.updates.reset();try{e.value=e.fn(e.value),(p.changes.count>0||p.updates.count>0)&&(p.time++,C(p))}finally{g=m=v=null}}(this):this.value=this.fn(this.value),n&&n!==y&&(null===n.owned?n.owned=[this]:n.owned.push(this)),m=n,v=o}}return e.prototype.current=function(){if(null!==v){if(this.age===p.time){if(this.state===h)throw new Error("circular dependency");N(this)}!function(e,t){null===e.log&&(e.log=new u);x(e.log,t)}(this,v)}return this.value},e.prototype.clock=function(){return r},e}(),u=function(){return function(){this.node1=null,this.node1slot=0,this.nodes=null,this.nodeslots=null}}(),c=function(){function e(){this.items=[],thi