@graphistry/falcor
Version:
A JavaScript library for efficient data fetching.
114 lines • 62.6 kB
JavaScript
/*!
*
* Copyright 2015 Netflix, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
(function(b,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define("falcor",[],e):"object"===typeof exports?exports.falcor=e():b.falcor=e()})(this,function(){return function(b){function e(d){if(a[d])return a[d].exports;var f=a[d]={i:d,l:!1,exports:{}};b[d].call(f.exports,f,f.exports,e);f.l=!0;return f.exports}var a={};e.m=b;e.c=a;e.i=function(a){return a};e.d=function(a,f,c){e.o(a,f)||Object.defineProperty(a,f,{configurable:!1,enumerable:!0,
get:c})};e.n=function(a){var d=a&&a.__esModule?function(){return a["default"]}:function(){return a};e.d(d,"a",d);return d};e.o=function(a,f){return Object.prototype.hasOwnProperty.call(a,f)};e.p="";return e(e.s=107)}([function(b,e,a){var d=a(59),f=a(34),c=a(60);b.exports=function(a,b){a=a.$expires;return void 0===a||null===a||a===c?!1:a===f?b:a<d()}},function(b,e,a){var d=a(20);b.exports=function(a){for(var c,f=Object.keys(a),b={},l=-1,p=f.length;++l<p;)c=f[l],"$size"===c||d(c)||(b[c]=a[c]);return b}},
function(b,e,a){var d=a(54);b.exports=function(a,c,n){a["\u001ef_invalidated"]||(a["\u001ef_invalidated"]=!0,c.push(a),d(n,a));return a}},function(b,e,a){(function(a){function d(a){a?(this["\u001ef_meta"]=a["\u001ef_meta"])||(this["\u001ef_meta"]=a):this["\u001ef_meta"]={}}function c(a){return function(){var c=this.length;var d=c;var f;if("number"!==(f=typeof c)&&(!c||"object"!==f||"atom"!==c.$type||"number"!==typeof(d=c.value))||0>d||d!==(d|0)){if("resolved"===this.$__status)throw new RangeError("Invalid FalcorJSON length");
return[]}this.length=d;d=a.apply(this,arguments);this.length=c;return d}}function n(c){var d=c,g=typeof d,f=arguments.length;if(0===f)d=this;else if("string"!==g){if(!d||"object"!==g)return d}else{if(1!==f)return d;d=this}return d===a?void 0:d}function t(){return m(n.apply(this,arguments),t)}function l(a,c){return JSON.stringify(m(n.call(this,this),m,!0===a,!1,!0===c))}function p(a){var c=n.apply(this,arguments),d,f,h=0,u=m(c,p,!0,!0);c&&(d=c["\u001ef_meta"])&&(h=d.version);u&&"object"===typeof u&&
(f=u["\u001ef_meta"])&&(f.version=h);return u}function m(a,c,g,f,n){if(!a||"object"!==typeof a)return a;var k,v;if(u(a))var h=a;else{var w=-1;var m=Object.keys(a);var r=m.length;h={};f&&(h.__proto__=d.prototype);if(g&&(k=a["\u001ef_meta"])){var p=k.$code,b=k.status,l=k.abs_path,t=k.deref_to,x=k.deref_from;k={};p&&(k.$code=p);l&&(k.abs_path=l);t&&(k.deref_to=t);x&&(k.deref_from=x);n&&b&&(k.status=b);h["\u001ef_meta"]=k;f&&(k={},k.__proto__=h,h=k)}for(;++w<r;)"\u001ef_meta"!==(v=m[w])&&(h[v]=c(a[v],
c,g,f,n))}return h}var q={length:!0,toString:!0,constructor:!0,toLocaleString:!0},x={toJSON:{enumerable:!1,value:t},toProps:{enumerable:!1,value:p},toString:{enumerable:!1,value:l},toLocaleString:{enumerable:!1,value:l},$__hash:{enumerable:!1,get:function(){var a=this["\u001ef_meta"];return a&&a.$code||""}},$__path:{enumerable:!1,get:function(){var a=this["\u001ef_meta"];return a&&a.abs_path||[]}},$__status:{enumerable:!1,get:function(){var a=this["\u001ef_meta"];return a&&a.status||"resolved"}},
$__version:{enumerable:!1,get:function(){var a=this["\u001ef_meta"];return a&&a.version||0}}};Object.defineProperties(d.prototype,Object.getOwnPropertyNames(Array.prototype).reduce(function(a,d){if(!q.hasOwnProperty(d)){var g=Array.prototype[d];"function"===typeof g&&(a[d]={value:c(g),writable:!0,enumerable:!1})}return a},x));var u=Array.isArray;b.exports=d}).call(e,a(35))},function(b,e,a){e=a(5);b.exports=e("NullInPathError",function(){this.message="`null` is not allowed in branch key positions."})},
function(b,e){b.exports=function(a,d){function f(a){this.message=a;d&&d.apply(this,arguments);Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack}f.prototype=Object.create(Error.prototype);f.prototype.name=a;f.prototype.constructor=f;f.is=function(c){return c.name===a};return f}},function(b,e){b.exports=function(a){return null!==a&&"object"===typeof a}},function(b,e,a){b.exports=function(a,f){var c=f["\u001ef_refs_length"]||0;f["\u001ef_ref"+c]=a;f["\u001ef_refs_length"]=
c+1;a["\u001ef_ref_index"]=c;a["\u001ef_context"]=f}},function(b,e){b.exports={$type:"atom"}},function(b,e,a){var d=a(6);b.exports=function(a){return d(a)&&a.$size||0}},function(b,e,a){function d(a,c){var f=a,b,l=0,p=c.length;if(0<p){do for(f=f[c[l]];f&&"ref"===(b=f.$type);)f=d(a,f.value);while(++l<p&&f&&!b)}return f}b.exports=d},function(b,e,a){var d=a(29),f=a(31);b.exports=function(a,n,b,l){var c=a,m;do 0<(c.$size=(c.$size||0)-n)?(m=c["\u001ef_parent"])?c["\u001ef_version"]!==l&&f(c,l):c["\u001ef_version"]=
l:(m=c["\u001ef_parent"])&&d(c,m,c["\u001ef_key"],b,l);while(c=m);return a}},function(b,e,a){e=a(5);b.exports=e("InvalidKeySetError",function(a,f){this.mesage="The KeySet "+JSON.stringify(f)+" in path "+JSON.stringify(a)+" contains a KeySet. Keysets can only contain Keys or Ranges"})},function(b,e,a){var d=a(60);b.exports=function(a,c){if(c.$expires!==d){var f=a["\u001ef_head"];if(!f)a["\u001ef_head"]=a["\u001ef_tail"]=c;else if(f!==c){var b=c["\u001ef_prev"],l=c["\u001ef_next"];l&&(l["\u001ef_prev"]=
b);b&&(b["\u001ef_next"]=l);c["\u001ef_prev"]=void 0;a["\u001ef_head"]=c;c["\u001ef_next"]=f;f["\u001ef_prev"]=c;c===a["\u001ef_tail"]&&(a["\u001ef_tail"]=b)}}}},function(b,e,a){function d(a,d,b){"function"===typeof a||"function"===typeof d||"function"===typeof b?(f.call(this,[]),this.destination={error:d,onError:d,next:a,onNext:a,complete:b,onCompleted:b}):(f.call(this,[],d),this.parent=d,this.destination=a)}var f=a(15);b.exports=d;d.prototype=Object.create(f.prototype);d.prototype.next=d.prototype.onNext=
function(a){var c=this.destination;if(c)if(c.onNext)c.onNext(a);else c.next&&c.next(a)};d.prototype.error=d.prototype.onError=function(a){var c=!1,d=this.destination;d&&(d.onError?(c=!0,d.onError(a)):d.error&&(c=!0,d.error(a)),this.dispose());if(!c)throw a;};d.prototype.complete=d.prototype.onCompleted=function(){var a=this.destination;if(a){if(a.onCompleted)a.onCompleted();else a.complete&&a.complete();this.dispose()}};d.prototype.dispose=d.prototype.unsubscribe=function(){this.destination=null;
f.prototype.dispose.call(this)}},function(b,e){function a(a,f){this.parent=f;this.subscriptions=a||[]}b.exports=a;a.prototype.add=function(a){return this.subscriptions.push(a)&&this||this};a.prototype.remove=function(a){a=this.subscriptions.indexOf(a);~a&&this.subscriptions.splice(a,1);return this};a.prototype.dispose=a.prototype.unsubscribe=function(){for(var a,f=this.subscriptions;f.length;)(a=f.pop())&&a.dispose&&a.dispose();if(a=this.parent)this.parent=null,a.remove&&a.remove(this)}},function(b,
e,a){var d=a(0),f=a(2),c=a(13);b.exports=function(a,b,l,p,m,q,x,u,h,w,g,k,r,B,v,y,C,D,e,F,A,z,G){var n=e;if(b)if(d(a,v))a["\u001ef_invalidated"]||f(a,B,r);else if(c(r,a),void 0===a.value)n=!1,e=D;else{if(q)return k&&(u[m]=null),A(a,b,m,q,x,u,w,g,k,C,D,F);return}if(D)q&&(x.hasValue=!0);else if(!e)return;return z(p,m,x,u,h,k,w,g,n,D,l,y,C,G,r)}},function(b,e,a){var d=a(10);b.exports=function(a,c){c=c||a._path;var f=a._node;if(!f||void 0===f["\u001ef_parent"]||f["\u001ef_invalidated"])a._node=null,0===
c.length?f=a._root.cache:(f=d(a._root.cache,c),c===a._path&&(a._node=f));return f}},function(b,e,a){function d(a,n,h,b,g,k,m,l,v,y,p,t,e,F,A,z,G,M){var w={},u=n<a.length-1,r=a[n],B=q(r,w),x=t.index;do{p.depth=n;f(h,b,g,k,m,l,B,u,!1,p,t,e,F,A,z,G,M);p[n]=B;p.index=n;var C=c[0],D=c[1],E=c[4];E[E.index++]=B;C&&(u?d(a,n+1,h,D,C,k,c[3],c[2],v,y,p,E,e,F,A,z,G,M):(v.push(p.slice(0,p.index+1)),y.push(E.slice(0,E.index))));B=q(r,w);if(w.done)break;t.index=x}while(1)}function f(a,d,h,b,g,k,r,B,v,y,C,q,e,F,
A,z,G){var w=h;for(h=w.$type;"ref"===h;){a:{g=a;C=b;h=k;k=y;d=q;v=e;var u=F,x=A,D=z,E=G,H=w,L=H.value,J=L.slice(0);if(n(H,E)){t(H,v,u);H=void 0;var R=g;w=C;J.index=L.length}else{var Q=0,Y=H,S=L.length-1;R=H=g;w=h=C;do{var X=L[Q],ba=Q<S;J.index=Q;f(g,R,H,C,w,h,X,ba,!0,k,J,d,v,u,x,D,E);H=c[0];J=c[4];if(!H||"object"!==typeof H){J.index=Q;break a}R=c[1];h=c[2];w=c[3]}while(Q++<S);J.index=Q;Y["\u001ef_context"]!==H&&l(Y,H)}c[0]=H;c[1]=R;c[2]=h;c[3]=w;c[4]=J}w=c[0];if(!w||"object"!==typeof w)return;d=c[1];
k=c[2];g=c[3];C=c[4];h=w.$type}if(void 0===h){if(null==r){if(B)throw new m;w&&(r=w["\u001ef_key"])}else d=w,g=k,w=d[r],k=g&&g[r];w=p(d,w,k,r,y,C,q,e,F,A,z,G)}c[0]=w;c[1]=d;c[2]=k;c[3]=g;c[4]=C}var c=Array(5),n=a(0),t=a(2),l=a(7),p=a(81),m=a(4),q=a(23);b.exports=function(a,f,n,w,g){a=a._root;for(var k=a.expired,h=a.version+1,b=a.cache,v=[],m=[],u=[],p=[],l=-1,t=f.length;++l<t;){var q=f[l],x=q.paths;q=q.jsonGraph;for(var e=-1,M=x.length;++e<M;){var I=x[e];m.index=0;d(I,0,b,b,b,q,q,q,u,p,v,m,h,k,a,w,
n,g)}}c[0]=void 0;c[1]=void 0;c[2]=void 0;c[3]=void 0;c[4]=void 0;return b["\u001ef_version"]===h?(a.version=h,[u,p,!0]):[u,p,!1]}},function(b,e,a){function d(a,w,g,k,b,m,v,u,p,l,t,x,e,z,G){if(a&&"object"===typeof a&&!a.$type){var h=[];var r=0;n(a)&&(h[r++]="length");for(var y in a)q(y)||(h[r++]=y)}else h=void 0;if(h&&h.length){r=0;y=h.length;var B=p.index;do{var C=h[r],D=a[C],E=!(!D||"object"!==typeof D)&&!D.$type;u.depth=w;f(g,k,b,C,D,E,!1,u,p,l,t,x,e,z,G);u[w]=C;u.index=w;var A=c[0],F=c[1],Q=c[2];
Q[Q.index++]=C;A&&(E?d(D,w+1,g,F,A,m,v,u,Q,l,t,x,e,z,G):(m.push(u.slice(0,u.index+1)),v.push(Q.slice(0,Q.index))));if(++r>=y)break;p.index=B}while(1)}}function f(a,d,g,k,n,b,v,m,q,e,E,F,A,z,G){var h=g;for(g=h.$type;"ref"===g;){a:{q=n;g=a;d=m;var w=e,r=E,y=F,B=A,C=z,D=G,J=h,R=J.value,Q=R.slice(0);if(t(J,D))l(J,r,y),J=void 0,h=g,Q.index=R.length;else{var Y=J;J=J["\u001ef_context"];if(null!=J)h=J["\u001ef_parent"]||g,Q.index=R.length;else{var S=0,X=R.length-1;Q.index=S;h=J=g;do{f(g,h,J,R[S],q,S<X,!0,
d,Q,w,r,y,B,C,D);J=c[0];Q=c[2];if(!J||"object"!==typeof J){Q.index=S;break a}h=c[1]}while(S++<X);Q.index=S;Y["\u001ef_context"]!==J&&p(Y,J)}}c[0]=J;c[1]=h;c[2]=Q}h=c[0];if(!h||"object"!==typeof h)return;d=c[1];q=c[2];g=h&&h.$type}if(!b||void 0===g){if(null==k){if(b)throw new x;h&&(k=h["\u001ef_key"])}else d=h,h=d[k];h=u(d,h,k,n,b,v,m,q,e,E,F,A,z,G)}c[0]=h;c[1]=d;c[2]=q}var c=Array(3),n=Array.isArray,t=a(0),l=a(2),p=a(7),m=a(10),q=a(33),x=a(4),u=a(48);b.exports=function(a,f,g,k,n){var h=a._root,v=
h.expired,b=h.version+1;a=a._path;var w=h.cache,u=m(w,a);if(!u)return[[],[],!1];for(var p=u["\u001ef_parent"]||w,l=[],r=[],q=[],t=a.length,x=-1,e=f.length;++x<e;){var N=f[x],K=a.slice(0);K.index=t;d(N.json,0,w,p,u,r,q,l,K,b,v,h,k,g,n)}c[0]=void 0;c[1]=void 0;c[2]=void 0;return w["\u001ef_version"]===b?(h.version=b,[r,q,!0]):[r,q,!1]}},function(b,e,a){e=a(92);e=new RegExp("^"+e,"i","g");b.exports=e.test.bind(e)},function(b,e){function a(d,f,c){c=c||[];f=f||[];if(!d)return f;for(var n=[],b=d.$keys,
l=b.length,p=-1;++p<l;){var m=d[p],q=b[p];m&&"object"===typeof m?a(m,f,c.concat([q])):n.push(q)}1===n.length?f.push(c.concat(n)):1<n.length&&f.push(c.concat([n]));return f}b.exports=a},function(b,e){b.exports=function(a){for(var d=5381,f=a.length;f;)d=33*d^a.charCodeAt(--f);return d>>>0}},function(b,e){function a(a,c){var d=c.from=a.from||0;a=c.to=a.to||"number"===typeof a.length&&c.from+a.length-1||0;c.rangeOffset=c.from;c.loaded=!0;d>a&&(c.empty=!0)}var d=Array.isArray;b.exports=function(f,c){if(void 0===
c.isArray){c.done=!1;var n=c.isObject=!(!f||"object"!==typeof f);c.isArray=n&&d(f);c.arrayOffset=0}if(c.isArray){var b;do{c.loaded&&c.rangeOffset>c.to&&(++c.arrayOffset,c.loaded=!1);if(c.arrayOffset>=f.length){c.done=!0;break}n=f[c.arrayOffset];"object"===typeof n?(c.loaded||a(n,c),c.empty||(b=c.rangeOffset++)):(++c.arrayOffset,b=n)}while(void 0===b);return b}if(c.isObject){c.loaded||a(f,c);if(c.rangeOffset>c.to){c.done=!0;return}return c.rangeOffset++}c.done=!0;return f}},function(b,e,a){b.exports=
a(40)},function(b,e,a){b.exports=a(43)},function(b,e){b.exports=function(a,d,f,c,n){var b=0;var l=c.jsonGraph;l||(c.jsonGraph=l={});do{c=d[b++];if(b>=f){l=l[c]=!0!==n?a:l[c]||{};break}l=l[c]||(l[c]={})}while(1);return l}},function(b,e){var a=Array.isArray;b.exports=function(d,f,c,n,b,l,p,m,q,x,u,h,w,g,k){if(q||x){for(var r,B=-1,v=(l=b-f)&&Array(l)||void 0;++B<l;){r=d[B+f];var y=r;if("object"!==typeof y||null===y)y=!1;else if(a(y))y=0===y.length;else{var t=y.to,e=y.from||0;"number"!==typeof t&&(t=
e+(y.length||0));y=e>=t}if(y)return;v[B]=r}var E;d=null===r;r=q;if(q){y=b;t=n;var F=c.requested||(c.requested=[])}else f=m,t=p,y=m+l-Number(d);do{if(l<b||!r){n=-1;B=f;for(E=Array(y);++n<B;)E[n]=t[n];for(B=-1;n<y;)E[n++]=v[++B]}if(r=!r){q&&(F[F.length]=E);break}F[F.length]=E||v;f=m;t=p;F=c.missing||(c.missing=[]);y=m+l-Number(d)}while(1);if(x)return g(u,E,f,y,h,w,k,q)}}},function(b,e,a){function d(a,n,g,k,b,m,v,l,q){var h={},w=n<a.length-1,r=a[n],y=u(r,h);do{f(g,k,b,y,w,!1,m,v,l,q);y=c[0];var B=c[1];
y&&(w?d(a,n+1,g,B,y,m,v,l,q):x(y,p(y),l,m));y=u(r,h)}while(!h.done)}function f(a,d,g,k,b,u,v,p,q,x){var h=g;for(g=h.$type;"ref"===g;){a:{d=a;g=v;u=p;var w=q,r=x;if(n(h,r))t(h,u,w),c[0]=void 0,c[1]=d;else{l(w,h);var y=h,B=h.value;h=h["\u001ef_context"];if(null!=h)var e=h["\u001ef_parent"]||d;else{var C=0,D=B.length-1;e=h=d;do{f(d,e,h,B[C],C<D,!0,g,u,w,r);h=c[0];if(!h&&"object"!==typeof h)break a;e=c[1]}while(C++<D);y["\u001ef_context"]!==h&&m(y,h)}c[0]=h;c[1]=e}}h=c[0];if(!h&&"object"!==typeof h)return;
d=c[1];g=h.$type}if(void 0===g)if(null==k){if(b)throw Error("`null` is not allowed in branch key positions.");}else d=h,h=d[k];c[0]=h;c[1]=d}var c=Array(2),n=a(0),t=a(2),l=a(13),p=a(9),m=a(7),q=a(17),x=a(11),u=a(23);b.exports=function(a,f,g){var k=a._root,n=k.expired,h=k.version+1,b=k.cache;a=q(a);if(!a)return!1;for(var u=-1,m=f.length,w=a["\u001ef_parent"]||b;++u<m;)d(f[u],0,b,w,a,h,n,k,g);c[0]=void 0;c[1]=void 0;return b["\u001ef_version"]===h?(k.version=h,!0):!1}},function(b,e,a){function d(a,
b,q,x,u){if(a&&"object"===typeof a){var h=a.$type;if(void 0===h)for(var m in a)c(m)||d(a[m],a,m,x,u);else"ref"===h&&t(a),f(x,a);n(l(a,u));b[q]=a["\u001ef_parent"]=void 0;return!0}return!1}var f=a(54),c=a(33),n=a(84),t=a(85),l=a(31);b.exports=d},function(b,e,a){function d(a,n,b,g,k,m,l,v,p,x,t,e,F,A,z,G){var h={},u=b<n.length-1,w=n[b],r=q(w,h),y=x.index;do{p.depth=b;p[b]=r;p.index=b;f(g,k,m,r,a,u,!1,p,x,t,e,F,A,z,G);p[b]=r;p.index=b;var B=c[0],C=c[1],D=c[2];D[D.index++]=r;B&&(u?d(a,n,b+1,g,C,B,l,v,
p,D,t,e,F,A,z,G):(l.push(p.slice(0,p.index+1)),v.push(D.slice(0,D.index))));r=q(w,h);if(h.done)break;x.index=y}while(1)}function f(a,d,b,g,k,p,q,v,y,e,D,E,F,A,z){var h=b;for(b=h.$type;"ref"===b;){a:{y=k;b=a;d=v;var u=e,r=D,w=E,B=F,C=A,H=z,L=h,J=L.value,R=J.slice(0);if(n(L,H))t(L,r,w),L=void 0,h=b,R.index=J.length;else{var Q=L;L=L["\u001ef_context"];if(null!=L)h=L["\u001ef_parent"]||b,R.index=J.length;else{var Y=0,S=J.length-1;h=L=b;do{var X=J[Y],ba=Y<S;R.index=Y;f(b,h,L,X,y,ba,!0,d,R,u,r,w,B,C,H);
L=c[0];R=c[2];if(!L||"object"!==typeof L){R.index=Y;break a}h=c[1]}while(Y++<S);R.index=Y;Q["\u001ef_context"]!==L&&l(Q,L)}}c[0]=L;c[1]=h;c[2]=R}h=c[0];if(!h||"object"!==typeof h)return;d=c[1];y=c[2];b=h.$type}if(!p||void 0===b){if(null==g){if(p)throw new m;h&&(g=h["\u001ef_key"])}else d=h,h=d[g];h=x(d,h,g,k,p,q,v,y,e,D,E,F,A,z)}c[0]=h;c[1]=d;c[2]=y}var c=Array(3),n=a(0),t=a(2),l=a(7),p=a(10),m=a(4),q=a(23),x=a(48);b.exports=function(a,f,b,g,k){var n=a._root,h=n.expired,v=n.version+1;a=a._path;var m=
n.cache,u=p(m,a);if(!u)return[[],[],!1];for(var l=u["\u001ef_parent"]||m,w=[],q=[],x=[],e=a.length,t=-1,M=f.length;++t<M;){var I=f[t],N=I.path;I=I.value;var K=a.slice(0);K.index=e;d(I,N,0,m,l,u,q,x,w,K,v,h,n,g,b,k)}c[0]=void 0;c[1]=void 0;c[2]=void 0;return m["\u001ef_version"]===v?(n.version=v,[q,x,!0]):[q,x,!1]}},function(b,e,a){b.exports=function(a,f){var c=a,d=[],b=0;do{var l=-1;var p=c["\u001ef_parent"];c["\u001ef_version"]=f;var m=c["\u001ef_refs_length"]||0;do if(p&&p["\u001ef_version"]!==
f&&(d[b++]=p),++l<m)p=c["\u001ef_ref"+l];else break;while(1)}while(c=d[--b]);return a}},function(b,e,a){var d=a(6);b.exports=function(a){return d(a)&&a.$timestamp||void 0}},function(b,e,a){b.exports=function(a){return a&&"$"===a[0]||d(a)};var d=a(20)},function(b,e){b.exports=0},function(b,e){e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(a){"object"===typeof window&&(e=window)}b.exports=e},function(b,e,a){var d=a(39),f=a(37),c=a(38);b.exports=function(a){return d(c(f(a)))}},
function(b,e,a){function d(a,c){var d=c.length;d=a[d]||(a[d]=[]);d[d.length]=c;return a}var f=Array.isArray,c=a(21);b.exports=function(a,b){b&&"object"===typeof b||(b={});if(a)!f(a)&&f(a.$keys)&&(a=c(a));else return b;return a.reduce(d,b)}},function(b,e,a){var d=a(65);b.exports=function(a,c){var f=Object.keys(a),b=-1,l=f.length,p=c;for(p&&"object"===typeof p||(p={});++b<l;)c=f[b],p[c]=d(a[c],p[c]);return p}},function(b,e,a){function d(a,f,b){var h=Object.create(null),g=""+m(""+f),k=[],u=-1,p=0,v=
[],l=0,q;var e=[];var x=-1;if(f<b-1){for(q=c(a,e);++x<q;){var t=e[x];var A=d(a[t],f+1,b);var z=A.code;h[z]?A=h[z]:(k[p++]=z,A=h[z]={keys:[],sets:A.sets});g=""+m(g+t+z);n(t)&&A.keys.push(parseInt(t,10))||A.keys.push(t)}for(;++u<p;)if(t=k[u],A=h[t],e=A.keys,q=e.length,0<q)for(a=A.sets,f=-1,b=a.length,x=e[0];++f<b;){t=a[f];A=-1;z=t.length;var G=Array(z+1);for(G[0]=1<q&&e||x;++A<z;)G[A+1]=t[A];v[l++]=G}}else for(q=c(a,e),1<q?v[l++]=[e]:v[l++]=e;++x<q;)g=""+m(g+e[x]);return{code:g,sets:v}}function f(a,
c){return a-c}function c(a,c,d){var f=0;if(a===q)c[f++]=null;else{for(var g in a)c[f++]=g;1<f&&c.sort(d)}return f}function n(a){var c=a,d=typeof a;if("string"===d){c=a.length;if(0===c||17<c||!p.test(a))return!1;if(16>c)return!0;c=+a}else if("number"!==d)return!1;return 0===c%1&&9007199254740991>=l(c)}var t=Array.isArray,l=Math.abs,p=/^(0|(\-?[1-9][0-9]*))$/,m=a(22),q=a(8);b.exports=function(a){var c,b=[],m=0,g;for(g in a){var k;if(k=n(g))k=c=a[g],k=null!==k&&"object"===typeof k;if(k){k=d(c,0,parseInt(g,
10)).sets;for(var p=-1,l=k.length;++p<l;){for(var v=m++,q=k[p],e=-1,x=q.length;++e<x;){var E=q[e];if(t(E)){var F=q,A=e;for(var z=-1,G=E.length-1,M=0<G;++z<=G;){var I=E[z];if(!n(I)){M=!1;break}E[z]=parseInt(I,10)}!0===M&&(E.sort(f),z=E[0],M=E[G],M-z<=G&&(E={from:z,to:M}));F[A]=E}}b[v]=q}}}return b};b.exports._isSafeNumber=n},function(b,e,a){var d=Array.isArray,f=a(73),c=a(72),n=a(17),t=a(90),l=a(64),p=a(62);b.exports=function(a,b,e,u,h){var m,g=b,k;b=a._path;var r=a._root,q=r.cache,v=b&&b.length||
0;if(v){if((m=n(a))&&m.$type)return{error:new t(b,b)};var y=[];for(k=0;k<v;++k)y[k]=b[k];k=a._referenceContainer}else m=q,y=[];var x=[];var D=!1;u=e&&e.json;var E=a._boxed,F=r.expired;var A=a._recycleJSON;var z=!!a._source,G=r.branchSelector,M=e&&a._materialized,I=a._treatErrorsAsValues,N=a._allowFromWhenceYouCame;a={args:null,data:e,hasValue:!1,relative:null,requested:null,missing:null};var K=0,P=g.length;if(0<P){if(A){D=!0;if(1<P&&h||d(g[0]))g=[p(l(g,{}))];P=1}do{var H=g[K];D?A=c(q,m,u,H,0,e,a,
x,y,v,!1,k,r,F,h,G,E,M,z,I,N):(A=H.length,A=f(q,m,u,H,0,e,a,x,A,y,v,!1,k,r,F,h,G,E,M,z,I,N));u=A[0];A[0]=void 0;A[1]=void 0}while(++K<P)}h=a.requested;a.args=D&&g||h;if(h&&h.length&&(a.relative=a.args,v)){g=[];k=0;for(v=h.length;k<v;++k)g[k]=b.concat(h[k]);a.requested=g}a.hasValue&&(e.json=u);return a}},function(b,e,a){var d=Array(3),f=a(13),c=a(0),n=a(7),t=a(52);b.exports=function(a,b,m,q){f(m,b);var p,l=0,h=a,e=b.value,g=e,k=e.length;do{if(0===l&&void 0!==(p=b["\u001ef_context"]))h=p,l=k;else{var r=
e[l++];if(void 0===(h=h[r]))break}if(l===k){r=h.$type;if(void 0!==r&&c(h,q))break;else{if(h===b)throw new t(e);h!==p&&n(b,h)}if("ref"===r)f(m,h),l=0,b=h,h=a,e=g=b.value,k=e.length;else break}else if(void 0!==h.$type)break}while(1);l<k&&void 0!==h&&(k=l);l=-1;for(e=Array(k);++l<k;)e[l]=g[l];d[0]=h;d[1]=e;d[2]=b;return d}},function(b,e,a){var d=a(1),f=a(71);b.exports=function(a,b,e,l,p,m,q,x,u,h,w,g){if("error"===b&&!g)return f(a,e,p,m,u,h);p.hasValue=!0;return h?d(a):a.value}},function(b,e,a){var d=
a(76),f=a(88);b.exports=function(a,b,e,l,p){var c=a._path;l=a._root;var n=c&&c.length||0;if(n)return{error:new f};var t=[];var u=c=l.cache;var h=[];for(var w=a._boxed,g=l.expired,k=a._materialized,r=!!a._source,B=-1,v=b.length,y=a._treatErrorsAsValues,C={args:null,data:e,paths:null,relative:null,requested:null,jsonGraph:null};++B<v;){var D=b[B];a=D.length;d(u,c,D,0,e,C,h,a,t,n,!1,l,g,p,w,k,r,y)}C.args=C.relative=C.requested;return C}},function(b,e,a){function d(a,b,e,x,u,h,w,g){if(e===x)return h?
c(l):void 0;var k,m=e+1,p=-1,v=0;var q=b[e];a&&"object"===typeof a?((k=a["\u001ef_meta"])||(a["\u001ef_meta"]=k={}),k.status=g?"pending":"resolved",k.version=w.version,k.abs_path=b.slice(0,e)):(a={},a.__proto__=n.prototype,a["\u001ef_meta"]=k={},k.status=g?"pending":"resolved",k.version=w.version,k.abs_path=b.slice(0,e),u&&(a=u(a)));a:do{if("object"!==typeof q)e=q,g=void 0,q=!1;else if(f(q)){if(void 0!==C)throw new t(b,C);p=0;var C=q;v=q.length;if(0===v)break a;q=C[p];continue a}else{g=q.to;e=q.from||
0;"number"!==typeof g&&(g=e+(q.length||0)-1);if(0>g-e)break a;q=!0}do a[e]=d(a[e],b,m,x,u,h,w);while(q&&++e<=g);if(++p===v)break a;q=C[p]}while(1);return a}var f=Array.isArray,c=a(1),n=a(3);a(4);var t=a(12),l=a(8);b.exports=d},function(b,e,a){var d=Array.isArray,f=a(102),c=a(57),n=a(58);b.exports=function(a){for(var b=[],e=-1,m=a.length,q,t,u,h;++e<m;)u=a[e],d(u)?(u={path:u},h="PathValues"):f(u)?h="PathValues":n(u)?h="JSONGraphs":c(u)&&(h="PathMaps"),t!==h&&(t=h,b.push(q={arguments:[],inputType:h})),
q.arguments.push(u);return b}},function(b,e,a){b.exports=function(a,b,c,n,e){a["\u001ef_key"]=c;a["\u001ef_parent"]=b;void 0!==n&&(a["\u001ef_version"]=n);a["\u001ef_abs_path"]||(a["\u001ef_abs_path"]=e.slice(0,e.index).concat(c));return b[c]=a}},function(b,e,a){function d(a,b,g,k,n,e,v,l,m,q){if(a&&"object"===typeof a&&!a.$type)for(var h in a)if(!x(h)){var r=a[h],w=!(!r||"object"!==typeof r)&&!r.$type;f(g,k,n,h,r,w,!1,e,v,l,m,q);var t=c[0],y=c[1];t&&(w?d(r,b+1,g,y,t,e,v,l,m,q):u(t,p(t),l,e))}}function f(a,
d,b,k,e,p,v,q,u,x,E,F){var g=b;for(b=g.$type;"ref"===b;){a:{d=e;b=a;v=q;var h=u,r=x,w=E,y=F;if(n(g,y))t(g,h,r),c[0]=void 0,c[1]=b;else{l(r,g);var B=g,C=g.value;g=g["\u001ef_context"];if(null!=g)var D=g["\u001ef_parent"]||b;else{var H=0,L=C.length-1;D=g=b;do{f(b,D,g,C[H],d,H<L,!0,v,h,r,w,y);g=c[0];if(!g&&"object"!==typeof g)break a;D=c[1]}while(H++<L);B["\u001ef_context"]!==g&&m(B,g)}c[0]=g;c[1]=D}}g=c[0];if(!g&&"object"!==typeof g)return;d=c[1];b=g.$type}if(void 0===b)if(null==k){if(p)throw Error("`null` is not allowed in branch key positions.");
}else d=g,g=d[k];c[0]=g;c[1]=d}var c=Array(2),n=a(0),t=a(2),l=a(13),p=a(9),m=a(7),q=a(17),x=a(33),u=a(11);b.exports=function(a,b,g){var f=a._root,n=f.expired,h=f.version+1,v=f._comparator,e=f.cache;a=q(a);if(!a)return!1;for(var l=-1,m=a["\u001ef_parent"]||e,p=b.length;++l<p;)d(b[l].json,0,e,m,a,h,n,f,v,g);c[0]=void 0;c[1]=void 0;return e["\u001ef_version"]===h?(f.version=h,!0):!1}},function(b,e,a){var d=a(34),f=a(101),c=a(9),n=a(32),t=a(51),l=a(0),p=a(2),m=a(46),q=a(50),x=a(49),u=a(11);a(29);b.exports=
function(a,b,g,k,e,B,v,y,C,D,E,F,A,z){z=f(b,B);if(e||B){if(z&&l(b,!0)&&(p(b,D,E),z=b.$expires===d?z:"expired"),z&&"ref"!==z||!b||"object"!==typeof b)b=q(b,{},a,g,E,C),b=m(b,a,g,C,y)}else e=f(k),(z||e)&&(F?3>F.length?F(b,k):F(b,k,y.slice(0,y.index)):!1!==n(k)<n(b))||(A&&"error"===e&&(k=A(x(v,g),k)),v=c(b)-c(k=t(k,e,e?k.value:k)),b=q(b,k,a,g,E,C),a=u(a,v,E,C),b=m(b,a,g,C,y));return b}},function(b,e){b.exports=function(a,d){a=a.slice(0,a.depth);a[a.length]=d;return a}},function(b,e,a){var d=a(83),f=
a(29),c=a(31);b.exports=function(a,b,e,p,m,q){if(a===b)return a;a&&"object"===typeof a&&(d(a,b),f(a,e,p,m),c(b,q));return e[p]=b}},function(b,e,a){var d=Array.isArray,f=a(59),c=a(99),n=a(9),t=a(100),l=a(34);b.exports=function(a,b,e){var m=0;if(b){var p=a["\u001ef_wrapped_value"];a=c(a);m=n(a);a.$type=b;a["\u001ef_prev"]=void 0;a["\u001ef_next"]=void 0;a["\u001ef_wrapped_value"]=p||!1}else a={$type:"atom",value:e,"\u001ef_prev":void 0,"\u001ef_next":void 0,"\u001ef_wrapped_value":!0};if(null==e)m=
51;else if(null==m||0>=m)switch(typeof e){case "object":m=d(e)?50+e.length:51;break;case "string":m=50+e.length;break;default:m=51}b=t(a);"number"===typeof b&&b<l&&(a.$expires=f()+-1*b);a.$size=m;return a}},function(b,e,a){e=a(5);b.exports=e("CircularReferenceError",function(a){this.message="Encountered circular reference "+JSON.stringify(a)})},function(b,e,a){e=a(5);b.exports=e("InvalidSourceError",function(a){this.message="An exception was thrown when making a request:\n\t"+a})},function(b,e,a){b.exports=
function(a,b){var c=b["\u001ef_prev"],d=b["\u001ef_next"];d&&(d["\u001ef_prev"]=c);c&&(c["\u001ef_next"]=d);b["\u001ef_prev"]=b["\u001ef_next"]=void 0;b===a["\u001ef_head"]&&(a["\u001ef_head"]=d);b===a["\u001ef_tail"]&&(a["\u001ef_tail"]=c)}},function(b,e,a){(function(d){function f(a){if(a)switch(typeof a){case "object":this.source=a;break;case "function":this.source={subscribe:a}}}var c=a(14),n=a(15),e=a(103).default;b.exports=f;f.prototype[e]=function(){return this};f.prototype.operator=function(a){return this.subscribe(a)};
f.prototype.subscribe=function(a,d,b){return new n([this.operator.call(this.source,a instanceof c?a:new c(a,d,b))])};f.prototype.then=function(a,c){var b=this;this._promise||(this._promise=new d.Promise(function(a,c){var d=[],f=!1;b.subscribe({next:function(a){d[d.length]=a},error:function(a){f=!0;c(a)},complete:function(){!f&&a(1>=d.length?d[0]:d)}})}));return this._promise.then(a,c)}}).call(e,a(35))},function(b,e){function a(){}var d={dispose:function(){},unsubscribe:function(){}};a.prototype.schedule=
function(a){a();return d};b.exports=a},function(b,e,a){var d=a(6);b.exports=function(a){return d(a)&&"json"in a}},function(b,e,a){var d=Array.isArray,f=a(6);b.exports=function(a){return f(a)&&d(a.paths)&&(f(a.jsonGraph)||f(a.jsong)||f(a.json)||f(a.values)||f(a.value))}},function(b,e){b.exports=Date.now},function(b,e){b.exports=1},function(b,e,a){function d(a){if(!(this instanceof f))return new f(a);f.call(this,a)}var f=a(66);e=a(3);d.prototype=Object.create(f.prototype);d.Model=f;d.FalcorJSON=e;d.toProps=
e.prototype.toProps;b.exports=d},function(b,e,a){function d(a){if(void 0!==a){for(var c="",b=a.$keys,e=-1,p=b.length;++e<p;){var m=b[e];if(null===m)c=""+f(""+c+"null");else{"object"===typeof m&&(m="["+m.from+".."+(m.from+m.length-1)+"]");var q=d(a[e]);c=void 0===q?""+f(""+c+m):""+f(""+c+m+q.$code)}}a.$code=c;return a}}var f=a(22);b.exports=d},function(b,e,a){function d(a,b,e,p){if(e===p)return!0;var n=-1,l=0,t=e+1;var u=b[e];if(null===u)return a===c;a:do{if("object"!==typeof u){e=u;var h=void 0;var w=
!1}else if(f(u)){if(void 0!==g)break a;n=0;var g=u;l=u.length;if(0===l)break a;u=g[n];continue a}else{h=u.to;e=u.from||0;"number"!==typeof h&&(h=e+(u.length||0)-1);if(0>h-e)break a;w=!0}do if(t===p){if(null!==a[e])return!1}else if(u=a[e],null===u||void 0===u||!1===d(u,b,t,p))return!1;while(w&&++e<=h);if(++n===l)break a;u=g[n]}while(1);return!0}var f=Array.isArray,c=a(8);b.exports=d},function(b,e,a){function d(a,b){return a.reduce(function(a,b){return c(b)?f(a,b,0,b.length):c(b.$keys)?d(t(b),a):a},
b||{})}function f(a,d,b,e){if(b!==e){a=a||{};var p=a.$keys||(a.$keys=[]),l=a.$keysMap||(a.$keysMap={}),h=-1,m=0,g=b+1;var k=d[b];if(null===k)return n;a:do{if("object"!==typeof k){var r=k;"undefined"===typeof(b=l[r])&&(b=p.length);p[b]=r;l[r]=b;k=f(a[b],d,g,e);void 0!==k&&(a[b]=k)}else if(c(k)){if(void 0!==q)break a;h=0;var q=k;m=k.length;if(0===m)break a;k=q[h];continue a}else{b=k.to;r=k.from||0;"number"!==typeof b&&(b=r+(k.length||0)-1);if(0>b-r)break a;k={from:r,length:b-r+1};r="["+r+".."+b+"]";
"undefined"===typeof(b=l[r])&&(b=p.length);p[b]=k;l[r]=b;k=f(a[b],d,g,e);void 0!==k&&(a[b]=k)}if(++h===m)break a;k=q[h]}while(1);return a}}var c=Array.isArray,n={$keys:[null],$keysMap:{"null":0}},t=a(21);b.exports=d},function(b,e,a){function d(a,b,e,p,m){if(e===p)return!0;a=a||{};var n=-1,l=0,u,h=e+1;var t=b[e];if(null===t)return c;a:do{if("object"!==typeof t){e=t;var g=void 0;var k=!1}else if(f(t)){if(void 0!==r)break a;n=0;var r=t;l=t.length;if(0===l)break a;t=r[n];continue a}else{g=t.to;e=t.from||
0;"number"!==typeof g&&(g=e+(t.length||0)-1);if(0>g-e)break a;k=!0}do h===p?a[e]=m:(t=a[e],(u=d(t,b,h,p,m))?t||(a[e]=u):a[e]=m);while(k&&++e<=g);if(++n===l)break a;t=r[n]}while(1);return a}var f=Array.isArray,c=a(8);b.exports=function(a,b){return a.reduce(function(a,b){return d(a,b,0,b.length,null)},b||{})}},function(b,e,a){function d(a){a=a||{};this._node=a._node;this._path=a._path||[];this._source=a.source||a._source;this._root=a._root||new c(a,this);this._recycleJSON=!0===a.recycleJSON||a._recycleJSON;
this._scheduler=a.scheduler||a._scheduler||new p;a._seed?(this._recycleJSON=!0,this._seed=a._seed,"undefined"===typeof a.treatErrorsAsValues&&(a.treatErrorsAsValues=!0)):this._recycleJSON&&(this._seed={},this._seed.__proto__=n.prototype,"undefined"===typeof a.treatErrorsAsValues&&(a.treatErrorsAsValues=!0));this._boxed=!0===a.boxed||a._boxed||!1;this._materialized=!0===a.materialized||a._materialized||!1;this._treatErrorsAsValues=!0===a.treatErrorsAsValues||a._treatErrorsAsValues||!1;this._allowFromWhenceYouCame=
!0===a.allowFromWhenceYouCame||a._allowFromWhenceYouCame||!1;a.cache&&this.setCache(a.cache)}var f=a(94),c=a(68),n=a(3),t=a(67),l=a(98),p=a(56),m=a(36);a(9);var q=a(6),x=a(57),u=a(10),h=a(58),w=a(19),g=a(18),k=a(24),r=a(78),B=a(25);b.exports=d;d.prototype.constructor=d;d.prototype.get=function(){var a=this._seed;a||(a={},a.__proto__=n.prototype);for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];return(new f("get",this,c))._toJSON(a,[])};d.prototype.set=function(){var a={};a.__proto__=
n.prototype;for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];return(new f("set",this,c))._toJSON(a,[])};d.prototype.preload=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return(new f("get",this,b))._toJSON(null,[])};d.prototype.call=function(){var a={};a.__proto__=n.prototype;for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];return(new f("call",this,c))._toJSON(a,[])};d.prototype.invalidate=function(){for(var a=arguments.length,
b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return(new f("invalidate",this,b))._toJSON(null,null).then()};d.prototype.deref=a(87);d.prototype._hasValidParentReference=a(86);d.prototype.getValue=function(a){return(new f("get",this,[a]))._toJSON({},[]).lift(function(b){return this.subscribe({onNext:function(c){var d=-1;c=c.json;for(var g=a.length;c&&!c.$type&&++d<g;)c=c[a[d]];b.onNext(c)},onError:b.onError.bind(b),onCompleted:b.onCompleted.bind(b)})})};d.prototype.setValue=function(a,b){a=1===arguments.length?
a.path:a;b=1===arguments.length?a:{path:a,value:b};return(new f("set",this,[b]))._toJSON({},[]).lift(function(b){return this.subscribe({onNext:function(c){var d=-1;c=c.json;for(var g=a.length;c&&!c.$type&&++d<g;)c=c[a[d]];b.onNext(c)},onError:b.onError.bind(b),onCompleted:b.onCompleted.bind(b)})})};d.prototype.setCache=function(a){var b=this._root,c=b.cache;if(a!==c){var d={_path:[],_boxed:!1,_root:b,_materialized:!1,_treatErrorsAsValues:!1};b.cache=this._node={};"undefined"!==typeof c&&(b.expired=
[],b["\u001ef_head"]=void 0,b["\u001ef_tail"]=void 0,this._recycleJSON&&(this._seed={},this._seed.__proto__=n.prototype));var f,e;h(a)?f=g(d,[a]):x(a)?f=w(d,[a]):q(a)&&(f=w(d,[{json:a}]));f&&(f[0].length&&k(d,f[0],null,!1,!1),f[2]&&(e=b.onChange)&&e.call(b.topLevelModel))}else"undefined"===typeof c&&(this._root.cache={});return this};d.prototype.getCache=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];if(0===b.length)return r(this,this._root.cache);a={};a.__proto__=
n.prototype;a=B({_path:[],_root:this._root,_boxed:this._boxed,_materialized:this._materialized,_treatErrorsAsValues:this._treatErrorsAsValues},b,a).data;a.paths=m(b);return a};d.prototype.getVersion=function(a){a=a||[];if(!1===Array.isArray(a))throw Error("Model#getVersion must be called with an Array path.");this._path.length&&(a=this._path.concat(a));return this._getVersion(this,a)};d.prototype._clone=function(a){var b=new d(this);if(a)for(var c in a){var g=a[c];"delete"===g?delete b[c]:"_path"===
c?(b[c]=g,!1===a.hasOwnProperty("_node")&&delete b._node):b[c]=g}0<b._path.length&&(b.setCache=void 0);return b};d.prototype.batch=function(a){var b;"number"===typeof a?b=new l(Math.round(Math.abs(a))):a?"function"===typeof a.schedule?b=a:"function"===typeof a&&(b={scheudle:a}):b=new l(1);return this._clone({_scheduler:b})};d.prototype.unbatch=function(){return this._clone({_scheduler:new p})};d.prototype.treatErrorsAsValues=function(){return this._clone({_treatErrorsAsValues:!0})};d.prototype.asDataSource=
function(){return new t(this)};d.prototype._materialize=function(){return this._clone({_materialized:!0})};d.prototype._dematerialize=function(){return this._clone({_materialized:"delete"})};d.prototype.boxValues=function(){return this._clone({_boxed:!0})};d.prototype.unboxValues=function(){return this._clone({_boxed:"delete"})};d.prototype.withoutDataSource=function(){return this._clone({_source:"delete"})};d.prototype.inspect=function(){return"{ v: "+this.getVersion()+" p: ["+this._path.join(", ")+
"] }"};d.prototype.toJSON=function(){return{$type:"ref",value:this.getPath()}};d.prototype.getPath=function(){return this._path.slice(0)};d.prototype._fromWhenceYouCame=function(a){return this._clone({_allowFromWhenceYouCame:void 0===a?!0:a})};d.prototype._optimizePath=function(a){a=u(this._root.cache,a);return(a&&a["\u001ef_abs_path"]||[]).slice(0)};d.prototype._getVersion=a(79);d.prototype._getPathValuesAsPathMap=k;d.prototype._getPathValuesAsJSONG=B;d.prototype._setPathValues=a(30);d.prototype._setPathMaps=
a(19);d.prototype._setJSONGs=a(18);d.prototype._setCache=a(19);d.prototype._invalidatePathValues=a(28);d.prototype._invalidatePathMaps=a(47)},function(b,e){function a(a){this._model=a._materialize().treatErrorsAsValues()}a.prototype.get=function(a){return this._model.get.apply(this._model,a)._toJSONG()};a.prototype.set=function(a){return this._model.set(a)._toJSONG()};a.prototype.call=function(a,b,c,e){return this._model.call.apply(this._model,[a,b,c].concat(e))._toJSONG()};b.exports=a},function(b,
e,a){function d(a,b){a=a||{};this.cache={};this.version=-1;this.syncRefCount=0;this.maxRetryCount=10;this.topLevelModel=b;this.requests=new f(this);this.expired=a.expired||[];this.collectRatio=.75;this.maxSize=Math.pow(2,53)-1;"number"===typeof a.collectRatio&&(this.collectRatio=a.collectRatio);"number"===typeof a.maxSize&&(this.maxSize=a.maxSize);"function"===typeof a.comparator&&(this.comparator=a.comparator);"function"===typeof a.branchSelector&&(this.branchSelector=a.branchSelector);"function"===
typeof a.errorSelector&&(this.errorSelector=a.errorSelector);"function"===typeof a.branchSelector&&(this.branchSelector=a.branchSelector);"function"===typeof a.onChange&&(this.onChange=a.onChange);"function"===typeof a.onChangesCompleted&&(this.onChangesCompleted=a.onChangesCompleted)}var f=a(95);a(32);d.comparator=d.prototype.comparator=function(a,b){var c=a&&a.$type,d;var f=b&&b.$type;if(c){if(!f)return a.value===b;if(c!==f)return!1;if((d=b.$timestamp)<(f=a.$timestamp))return!0;if(void 0!==d&&void 0===
f||a.$expires!==b.$expires)return!1;if("ref"===c){a=a.value;c=a.length;b=b.value;if(c!==b.length)return!1;for(;~--c;)if(a[c]!==b[c])return!1;return!0}return a.value===b.value}return f?!1:a===b};b.exports=d},function(b,e,a){var d=a(24),f=a(25);b.exports={json:function(a,b,f,e){var c=!1;if(!b)return{missing:!1,hasValue:!1};var n=[].concat(b[1]||[]),l=[].concat(b[2]||[]),t=[].concat(b[3]||[]);b=(a._path||[]).concat(b[0]||[]);e&&t&&t.length&&(c=d(a,t,f,e,!0).hasValue);return{data:f,missing:!0,hasValue:c,
fragments:[b,n,l,t]}},jsonGraph:function(a,b,d,e){var c=!1;if(!b)return{missing:!1,hasValue:!1};var n=[].concat(b[1]||[]),l=[].concat(b[2]||[]),t=[].concat(b[3]||[]);b=(a._path||[]).concat(b[0]||[]);e&&t&&t.length&&(c=f({_root:a._root,_boxed:a._boxed,_materialized:a._materialized,_treatErrorsAsValues:a._treatErrorsAsValues},t,d,!0,!0).hasValue);return{data:d,missing:!0,hasValue:c,fragments:[b,n,l,t]}}}},function(b,e,a){b.exports={json:a(40),jsonGraph:a(43)}},function(b,e,a){var d=a(1);b.exports=function(a,
b,e,t,l,p){var c=-1;b+=!!l;l=Array(b);for(a=p?d(a):a.value;++c<b;)l[c]=t[c];(e.errors||(e.errors=[])).push({path:l,value:a})}},function(b,e,a){function d(a,b,g,e,q,C,D,E,F,A,z,G,M,I,N,K,P,H,L,J,R){var k,r=z;if(void 0===b||void 0!==(k=b.$type)||void 0===e)return n[1]=void 0===b,n[0]=m(b,k,g,e,q,C,D,E,q,F,A,r,M,I,N,K,P,H,L,J,t,f,u),n;var v;k="";z=e.$keys;var B=q+1,y=A+1;if(R&&G){var V=G.value;var W=G["\u001ef_abs_path"]}if(!g||"object"!==typeof g)g=void 0;else if(v=g["\u001ef_meta"]){var U=b["\u001ef_abs_path"];
var T=v.abs_path;K||g instanceof l||(g.__proto__={},g.__proto__["\u001ef_meta"]=v,g.__proto__.__proto__=l.prototype);if(!c(U,T)){v.$code="";v.status=L&&"pending"||"incomplete";v.abs_path=U;v.version=b["\u001ef_version"];V&&(v.deref_to=V);W&&(v.deref_from=W);if(T=v.keys)for(O in v.keys=Object.create(null),T)T[O]&&delete g[O];n[0]=g;n[1]=!0;return n}if(v.version===b["\u001ef_version"]&&v.$code===e.$code)return D.hasValue=!0,n[0]=g,n[1]=!1,n;T=v.keys;v.abs_path=U;v.version=b["\u001ef_version"];V&&(v.deref_to=
V);W&&(v.deref_from=W)}U=Object.create(null);var ha=-1,ia=z.length,Z=!1;a:for(;++ha<ia;){r=z[ha];var aa=e[ha];if(null===r){if(void 0!==aa)throw new h;k=""+w(""+k+"null")}else{if("object"!==typeof r){var O=r;var ca=void 0;var da=!1;var ea=O}else{ca=r.to;O=r.from||0;"number"!==typeof ca&&(ca=O+(r.length||0)-1);if(0>ca-O)break a;da=!0;ea="["+O+".."+ca+"]"}do{r=!1;var ka=g&&g[O];var la=F;var ma=y;var na=G;var fa=b[O];E[q]=O;F[A]=O;if(void 0===aa){if(d(a,fa,ka,aa,B,C,D,E,la,ma,r,na,M,I,N,K,P,H,L,J,R),
!0===n[1]&&(Z=!0),void 0===(ka=n[0])&&!H){g&&g.hasOwnProperty(O)&&delete g[O];continue}}else{if(fa&&"ref"===fa.$type&&!p(fa,N)){var ja=x(a,fa,M,N);fa=ja[0];r=!0;la=ja[1];na=ja[2];ma=la.length;ja[0]=ja[1]=ja[2]=void 0}d(a,fa,ka,aa,B,C,D,E,la,ma,r,na,M,I,N,K,P,H,L,J,R);!0===n[1]&&(Z=!0);if(void 0===(ka=n[0])){g&&g.hasOwnProperty(O)&&delete g[O];continue}}void 0===v&&(v={},v.version=b["\u001ef_version"],v.abs_path=b["\u001ef_abs_path"],V&&(v.deref_to=V),W&&(v.deref_from=W),g={},g["\u001ef_meta"]=v,g.__proto__=
l.prototype,K?g=K(g):(r=g,g={},g.__proto__=r));U[O]=!0;T&&O in T&&(T[O]=!1);g[O]=ka}while(da&&++O<=ca);k=""+w(""+k+(Z?"":ea)+(aa?aa.$code:""))}}if(v&&(v.$code=k,v.keys=U,v.status=Z?L?"pending":H?"resolved":"incomplete":"resolved",T))for(O in T)T[O]&&delete g[O];n[0]=g;n[1]=Z;return n}function f(a,b,c,d,e,h,n,u,m,p,l,t,w,x,N){if(p)return x(l,a,b,b,t,w,N,m,c,d,n,u,h,f);a=a?g(a):[[]];var k=d.slice(0,e);return a.forEach(function(a){e=b+a.length;return q(k.concat(a),b,c,d,e,h,n,u,m,!1,l,t,w,x,N)})}function c(a,
b){if(a===b)return!0;var c=a.length;if(c!==b.length)return!1;for(;~--c;)if(a[c]!==b[c])return!1;return!0}var n=Array(2),t=a(42),l=a(3),p=a(0),m=a(16),q=a(27),x=a(41),u=a(77),h=a(4);a(12);var w=a(22),g=a(21);b.exports=d},function(b,e,a){function d(a,b,e,r,B,v,y,C,D,E,F,A,z,G,M,I,N,K,P,H,L,J){var g;if(void 0===b||(g=b.$type)||B===D)return f[1]=void 0===b,f[0]=p(b,g,e,r,B,v,y,C,D,E,F,A,G,M,I,N,K,P,H,L,n,t,q),f;var k,w=B+1,S=-1,X=0,ba=F+1;A=r[B];if(null===A){if(w<D)throw new u;f[0]=e;f[1]=!1;return f}if(J&&
z){var V=z.value;var W=z["\u001ef_abs_path"]}if(!e||"object"!==typeof e)e=void 0;else if(k=e["\u001ef_meta"])k.version=b["\u001ef_version"],k.abs_path=b["\u001ef_abs_path"],V&&(k.deref_to=V),W&&(k.deref_from=W);var U=!1;a:do{if("object"!==typeof A){g=A;var T=void 0;var ha=!1}else if(c(A)){if(void 0!==ia)throw new h(r,ia);S=0;var ia=A;X=A.length;if(0===X)break a;A=ia[S];continue a}else{T=A.to;g=A.from||0;"number"!==typeof T&&(T=g+(A.length||0)-1);if(0>T-g)break a;ha=!0}do{A=!1;var Z=e&&e[g];var aa=
E;var O=ba;var ca=z;var da=b[g];C[B]=g;E[F]=g;if(w===D){if(d(a,da,Z,r,w,v,y,C,D,aa,O,A,ca,G,M,I,N,K,P,H,L,J),!0===f[1]&&(U=!0),void 0===(Z=f[0])&&!P)continue}else{if(da&&"ref"===da.$type&&!m(da,I)){var ea=x(a,da,G,I);da=ea[0];A=!0;aa=ea[1];ca=ea[2];O=aa.length;ea[0]=ea[1]=ea[2]=void 0}d(a,da,Z,r,w,v,y,C,D,aa,O,A,ca,G,M,I,N,K,P,H,L,J);!0===f[1]&&(U=!0);if(void 0===(Z=f[0]))continue}void 0===k&&(k={},k.version=b["\u001ef_version"],k.abs_path=b["\u001ef_abs_path"],V&&(k.deref_to=V),W&&(k.deref_from=
W),e={},e["\u001ef_meta"]=k,e.__proto__=l.prototype,N&&(e=N(e)));e[g]=Z}while(ha&&++g<=T);if(++S===X)break a;A=ia[S]}while(1);k&&(k.status=U?H?"pending":P?"resolved":"incomplete":"resolved");f[0]=e;f[1]=U;return f}var f=Array(2),c=Array.isArray,n=a(42),t=a(27),l=a(3),p=a(16),m=a(0),q=a(44),x=a(41),u=a(4),h=a(12);b.exports=d},function(b,e,a){var d=Array(2),f=a(1),c=a(26),n=a(13),t=a(0),l=a(7),p=a(52);b.exports=function(a,b,e,u,h){n(e,b);var m,g=0,k=a,r=b.value,q=r,v=r.length;do{if(0===g&&void 0!==
(m=b["\u001ef_context"]))k=m,g=v;else{var x=r[g++];if(void 0===(k=k[x]))break}if(g===v){x=k.$type;if(void 0!==x&&t(k,h))break;else{if(k===b)throw new p(r);k!==m&&l(b,k)}if("ref"===x)n(e,k),u&&c(f(k),r,v,u),g=0,b=k,k=a,r=q=b.value,v=r.length;else break}else if(void 0!==k.$type)break}while(1);g<v&&void 0!==k&&(v=g);g=-1;for(r=Array(v);++g<v;)r[g]=q[g];d[0]=k;d[1]=r;return d}},function(b,e,a){var d=a(1),f=a(26);b.exports=function(a,b,e,l,p,m,q,x,u,h,w){w=a.value;if(h||"ref"===b||"error"===b||!a["\u001ef_wrapped_value"]||
"object"===typeof w)w=d(a);p.hasValue=!0;f(w,q,x,l);(l.paths||(l.paths=[])).push(m.slice(0,e+!!u));return w}},function(b,e,a){function d(a,b,g,e,x,C,D,E,F,A,z,G,M,I,N,K,P,H){var k;if(void 0===b||(k=b.$type)||e===E)return m(b,k,x,g,e,x,C,D,E,F,A,z,G,M,I,void 0,N,K,P,H,t,f,q);var r=e+1,v=-1,B=0,y=A+1;z=g[e];if(null===z){if(r<E)throw new h;}else{a:do{if("object"!==typeof z){k=z;var S=void 0;var X=!1}else if(c(z)){if(void 0!==ba)throw new w(g,ba);v=0;var ba=z;B=z.length;if(0===B)break a;z=ba[v];continue a}else{S=
z.to;k=z.from||0;"number"!==typeof S&&(S=k+(z.length||0)-1);if(0>S-k)break a;X=!0}do{z=!1;var V=F;var W=y;var U=b[k];D[e]=k;F[A]=k;if(U&&r<E&&"ref"===U.$type&&!p(U,I)){x&&l(n(U),F,W,x);var T=u(a,U,G,x,I);U=T[0];z=!0;V=T[1];W=V.length;T[0]=T[1]=void 0}d(a,U,g,r,x,C,D,E,V,W,z,G,M,I,N,K,P,H)}while(X&&++k<=S);if(++v===B)break a;z=ba[v]}while(1)}}function f(a,b,c,d,e,f,h,m,u,p,q,t,w,I,N){var k;if(q&&p){(q.paths||(q.paths=[])).push((k=0===e-b)&&d.slice(0,b+!!f)||d.slice(0,b).concat(a.slice(b,e+!!f)));var r=
l(k&&n(g)||void 0,h,m,q,!k)}return x(a,b,c,d,e,f,h,m,u,!k&&p,r,t,!0,I,N)}var c=Array.isArray,n=a(1),t=a(75),l=a(26),p=a(0),m=a(16),q=a(44),x=a(27),u=a(74),h=a(4),w=a(12),g=a(8);b.exports=d},function(b,e,a){function d(a,b,e,x,u,h,w,g,k,r,B,v,y,C){if(void 0===b)return c(void 0,void 0,a,b,e,void 0,k,r,e,B,v,y,w,void 0,!1,u,h,!1,g,!1,void 0,C,void 0),h?f(l):void 0;var m,q,p=b.$keys,A=e+1,z=v+1;a&&"object"===typeof a?((m=a["\u001ef_meta"])?q=m.keys:a["\u001ef_meta"]=m={},m.$code="",m.status=g?"pending":
"resolved",m.version=w.version,m.abs_path=B.slice(0,v)):(a={},a.__proto__=n.prototype,a["\u001ef_meta"]=m={},m.$code="",m.status=g?"pending":"resolved",m.version=w.version,m.abs_path=B.slice(0,v),u&&(a=u(a)));x=Object.create(null);var G=-1,M=p.length;a:for(;++G<M;){var I=p[G];var N=b[G];if(null===I){if(void 0!==N)throw new t;}else{if("object"!==typeof I){var K=I;var P=void 0;I=!1}else{P=I.to;K=I.from||0;"number"!==typeof P&&(P=K+(I.length||0)-1);if(0>P-K)break a;I=!0}do r[e]=K,B[v]=K,x[K]=!0,q&&K in
q&&(q[K]=!1),a[K]=d(a[K],N,A,A,u,h,w,g,k,r,B,z,y,C);while(I&&++K<=P)}}m.keys=x;if(q)for(K in q)q[K]&&delete a[K];return a}var f=a(1),c=a(16),n=a(3),t=a(4);a(12);var l=a(8);b.exports=d},function(b,e,a){function d(a,b,e,p){var n,q;if(!a||"object"!==typeof a)return a;if(n=a.$type){if(void 0===(q=a.value))p?q={$type:"atom"}:a["\u001ef_wrapped_value"]&&(q=f(a));else if(e||"ref"===n||"error"===n||!a["\u001ef_wrapped_value"]||"object"===typeof q)q=f(a);return q}n=Object.keys(a);for(var l=n.length,u=-1;++u<
l;){var h=n[u];"$size"===h||c(h)||void 0===(q=d(a[h],b&&b[h],e,p))||(void 0===b&&(b={}),b[h]=q)}return b}var f=a(1),c=a(20);b.exports=function(a,b){return d(b,{},a._boxed,a._materialized)}},function(b,e,a){var d=a(17);b.exports=function(a,b){a=(a=d(a,b))&&a["\u001ef_version"];return null==a?-1:a}},function(b,e,a){function d(a,d,e,p,m){d=c(d);e=!1;p=-1;for(var n=d.length;++p<n;){var l=d[p],u=l.inputType;l=l.arguments;0<l.length&&("PathValues"===u&&(l=l.map(f)),(0,b.exports["invalidate"+u])(a,l,m)&&
(e=!0))}e&&(m=a._root.onChange)&&m.call(a._root.topLevelModel);return{}}function f(a){return a.path||a.paths}var c=a(45);b.exports={json:d,jsonGraph:d,invalidatePathMaps:a(47),invalidatePathValues:a(28)}},function(b,e,a){var d=a(51),f=a(0),c=a(46),n=a(2),t=a(50),l=a(9),p=a(49),m=a(32),q=a(11);b.exports=function(a,b,e,w,g,k,r,B,v,y,C,D){var h,u,x;if(b===e){if(void 0===e)return e;if(null===e)return b=d(e,void 0,e),a=q(a,-b.$size,v,r),b=c(b,a,w,void 0,k);if((u=!(!b||"object"!==typeof b))&&void 0===(h=
b.$type))return void 0===b["\u001ef_parent"]&&c(b,a,w,r,k),b}else if(u=!(!b||"object"!==typeof b))h=b.$type;if("ref"!==h){if(x=!(!e||"object"!==typeof e))var z=e.$type;if(u&&!h&&(null==e||x&&!z))return b}else{if(null==e){if(f(b,D)){n(b,B,v);return}return b}if(x=!(!e||"object"!==typeof e))if(z=e.$type,"ref"===z)if(b===e){if(null!=b["\u001ef_parent"])return b}else{var G=b.$timestamp;var M=e.$timestamp;if(!f(b,D)&&!f(e,D)&&M<G)return}}if(h&&x&&!z)return c(t(b,e,a,w,v,r),a,w,void 0,k);z||!x?("error"===
z&&C&&(e=C(p(g,w),e)),z&&b===e?b["\u001ef_parent"]||(b=d(b,h,b.value),a=q(a,-b.$size,v,r),b=c(b,a,w,r,k)):(g=!0,h||z?u&&f(b,D)||(g=y?!(3>y.length?y(b,e):y(b,e,k.slice(0,k.index))):!1===m(e)<m(b)):g=!0,g&&(y=l(b)-l(e=d(e,z,z?e.value:e)),b=t(b,e,a,w,v,r),a=q(a,y,v,r),b=c(b,a,w,r,k))),f(b,!0)&&n(b,B,v)):null==b&&(b=c(e,a,w,void 0,k));return b}},function(b,e,a){function d(a,d,e){var n=!1,m=-1,h=d.length,l=[],g=[],k=a._root,r=k.errorSelector;e=e&&!a._source;for(k=a._source?null:k.comparator;++m<h;){var q=
d[m],p=q.inputType;q=q.arguments;if(0<q.length){var t=(0,b.exports["set"+p])(a,q,r,k,e);n=n||t[2];g.push.apply(g,t[1]);"PathValues"===p?l.push.apply(l,q.map(f)):"JSONGraphs"===p?l.push.apply(l,c(q,f)):l.push.apply(l,t[0])}}return{changed:n,requested:l,optimized:g}}function f(a){return a.path||a.paths}function c(a,b){for(var c=-1,d=-1,e=a.length,f=[];++d<e;)for(var n=b(a[d],d,a),g=-1,k=n.length;++g<k;)f[++c]=n[g];return f}var n=a(24),t=a(25),l=a(45);b.exports={json:function(a,b,c,e,f){var h,m=l(b);
var g=d(a,m,f);if((b=g.requested).length){if(!(h=g.changed)||e)var k=n(a,b,c,e,f);if(h){var r=t({_root:a._root,_boxed:a._boxed,_materialized:!0,_treatErrorsAsValues:a._treatErrorsAsValues},g.optimized,{},e,f);var q=r.data;var p=q.paths;r=r.requested;(e=a._root.onChange)&&e.call(a._root.topLevelModel)}}return{args:m,data:c,missing:p,relative:b,fragments:q,requested:r,error:k&&k.error,errors:k&&k.errors,hasValue:k&&k.hasValue}},jsonGraph:function(a,b,c,e,f){var h,n=l(b);var g=d(a,n,f);if((b=g.requested).length&&
(e||(h=g.changed))){var k=t({_root:a._root,_boxed:a._boxed,_materialized:!0,_treatErrorsAsValues:a._treatErrorsAsValues},g.optimized,c,e,f);var r=k.data;var m=r.paths;var q=k.requested;h&&(e=a._root.onChange)&&e.call(a._root.topLevelModel)}return{args:n,data:c,missing:m,relative:b,fragments:r,requested:q,error:k&&k.error,hasValue:k&&k.hasValue}},setPathMaps:a(19),setPathValues:a(30),setJSONGraphs:a(18)}},function(b,e,a){b.exports=function(a,b){for(var c=a["\u001ef_refs_length"]||0,d=b["\u001ef_refs_length"]||
0,e=-1;++e<c;){var f=a["\u001ef_ref"+e];void 0!==f&&(f["\u001ef_context"]=b,f["\u001ef_ref_index"]=d+e,b["\u001ef_ref"+(d+e)]=f,a["\u001ef_ref"+e]=void 0)}b["\u001ef_refs_length"]=c+d;a["\u001ef_refs_length"]=void 0;return b}},function(b,e,a){b.exports=function(a){for(var b=-1,c=a["\u001ef_refs_length"]||0;++b<c;){var d=a["\u001ef_ref"+b];null!=d&&(d["\u001ef_context"]=d["\u001ef_ref_index"]=a["\u001ef_ref"+b]=void 0)}a["\u001ef_refs_length"]=void 0;return a}},function(b,e,a){b.exports=function(a){var b=
a["\u001ef_context"];if(b){for(var c=(a["\u001ef_ref_index"]||0)-1,d=(b["\u001ef_refs_length"]||0)-1;++c<=d;){var e=b["\u001ef_ref"+(c+1)];(b["\u001ef_ref"+c]=e)&&(e["\u001ef_ref_index"]=c)}b["\u001ef_refs_length"]=d;a["\u001ef_ref_index"]=a["\u001ef_context"]=void 0}return a}},function(b,e,a){b.exports=function(){var a=this._referenceContainer;return this._allowFromWhenceYouCame&&!0!==a?!1===a||a&&void 0===a["\u001ef_parent"]||a&&a["\u001ef_invalidated"]?!1:!0:!0}},function(b,e,a){var d=a(3),f=a(10);
a(89);b.exports=function(a){var b;if(!a||"object"!==typeof a||!(b=a["\u001ef_meta"])||"object"!==typeof b)return null;var c=this._root.cache,e=this._recycleJSON,p=b.abs_path,m;if(!p){if(e){var q={json:a};q.__proto__=d.prototype}return this._clone({_node:void 0,_seed:q})}if(0===p.length)return e&&(q={json:a},q.__proto__=d.prototype),this._clone({_node:c,_path:p,_referenceContainer:!0,_seed:q});var x=b.deref_to,u=b.deref_from,h=f(c,p),w="e";if(u){w=!1;b=-1;var g=u.length;for(m=c;++b<g&&(m=m[u[b]],m&&
!m.$type););if(x&&m&&"ref"===m.$type)for(w=!0,g=x.length,c=m.value,b=0;b<g;++b)if(c[b]!==x[b]){h=void 0;w=!1;break}}w?"e"===w&&(m=!0):m=!1;e&&(q={json:a},q.__proto__=d.prototype);return this._clone({_seed:q,_node:h,_path:p,_referenceContainer:m})}},function(b,e,a){e=a(5);b.exports=e("BoundJSONGraphModelError",function(){this.message="It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model."})},function(b,e,a){e=a(5);b.exports=e("InvalidDerefInputError",
function(){this.message="Deref can only be used with a non-primitive object from get, set, or call."})},f