yjs/build/browser/Engine.min.js
2014-08-12 19:18:56 +02:00

1 line
1.8 KiB
JavaScript

!function r(e,t,o){function p(s,i){if(!t[s]){if(!e[s]){var u="function"==typeof require&&require;if(!i&&u)return u(s,!0);if(n)return n(s,!0);throw new Error("Cannot find module '"+s+"'")}var h=t[s]={exports:{}};e[s][0].call(h.exports,function(r){var t=e[s][1][r];return p(t?t:r)},h,h.exports,r,e,t,o)}return t[s].exports}for(var n="function"==typeof require&&require,s=0;s<o.length;s++)p(o[s]);return p}({1:[function(r,e){var t;t=function(){function r(r,e){this.HB=r,this.parser=e,this.unprocessed_ops=[]}return r.prototype.parseOperation=function(r){var e;if(e=this.parser[r.type],null!=e)return e(r);throw new Error("You forgot to specify a parser for type "+r.type+". The message is "+JSON.stringify(r)+".")},r.prototype.applyOpsBundle=function(r){var e,t,o,p,n,s,i,u;for(t=[],o=0,s=r.length;s>o;o++)e=r[o],t.push(this.parseOperation(e));for(p=0,i=t.length;i>p;p++)e=t[p],this.HB.addOperation(e);for(n=0,u=t.length;u>n;n++)e=t[n],e.execute()||this.unprocessed_ops.push(e);return this.tryUnprocessed()},r.prototype.applyOpsCheckDouble=function(r){var e,t,o,p;for(p=[],t=0,o=r.length;o>t;t++)e=r[t],p.push(null!=this.HB.getOperation(e.uid)?this.applyOp(e):void 0);return p},r.prototype.applyOps=function(r){var e,t,o,p;for(p=[],t=0,o=r.length;o>t;t++)e=r[t],p.push(this.applyOp(e));return p},r.prototype.applyOp=function(r){var e;return e=this.parseOperation(r),this.HB.addToCounter(e),e.execute()?this.HB.addOperation(e):this.unprocessed_ops.push(e),this.tryUnprocessed()},r.prototype.tryUnprocessed=function(){var r,e,t,o,p,n,s;for(s=[];;){for(r=this.unprocessed_ops.length,t=[],n=this.unprocessed_ops,o=0,p=n.length;p>o;o++)e=n[o],e.execute()?this.HB.addOperation(e):t.push(e);if(this.unprocessed_ops=t,this.unprocessed_ops.length===r)break;s.push(void 0)}return s},r}(),e.exports=t},{}]},{},[1]);