Socket
Socket
Sign inDemoInstall

@sanity/client

Package Overview
Dependencies
Maintainers
6
Versions
977
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/client - npm Package Compare versions

Comparing version 0.3.13 to 0.3.14

4

package.json
{
"name": "@sanity/client",
"version": "0.3.13",
"version": "0.3.14",
"description": "Client for retrieving data from Sanity",

@@ -23,3 +23,3 @@ "main": "lib/sanityClient.js",

"@sanity/eventsource": "^1.0.0",
"@sanity/observable": "^1.0.1",
"@sanity/observable": "^1.1.0",
"@sanity/request": "0.0.3",

@@ -26,0 +26,0 @@ "debug": "^2.2.0",

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SanityClient = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";function AssetsClient(e){this.client=e}var assign=require("xtend/mutable"),validators=require("../validators"),ASSET_TYPES_TO_ENDPOINT={image:"images",file:"files"};assign(AssetsClient.prototype,{upload:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};validators.validateAssetType(e);var i=validators.hasDataset(this.client.clientConfig),n="contentType"in s?{"Content-Type":s.contentType}:{},a=ASSET_TYPES_TO_ENDPOINT[e],o=s.label?"?label="+encodeURIComponent(s.label):"",l="/assets/"+a+"/"+i+o;return this.client.requestObservable({method:"POST",headers:assign({Accept:"application/json"},n),uri:l,body:t,json:!1,timeout:0}).map(function(e){return"response"!==e.type?e:assign({},e,{body:JSON.parse(e.body)})})}}),module.exports=AssetsClient;
},{"../validators":18,"xtend/mutable":50}],2:[function(require,module,exports){
},{"../validators":18,"xtend/mutable":51}],2:[function(require,module,exports){
"use strict";function AuthClient(t){this.client=t}var assign=require("xtend/mutable");assign(AuthClient.prototype,{getLoginProviders:function(){return this.client.request({uri:"/auth/providers"})},logout:function(){return this.client.request({uri:"/auth/logout"})}}),module.exports=AuthClient;
},{"xtend/mutable":50}],3:[function(require,module,exports){
},{"xtend/mutable":51}],3:[function(require,module,exports){
"use strict";var assign=require("xtend/mutable"),validate=require("./validators"),defaultConfig=exports.defaultConfig={apiHost:"https://api.sanity.io",useProjectHostname:!0};exports.initConfig=function(t,e){var o=assign({},defaultConfig,e,t),a=o.useProjectHostname;if("undefined"==typeof Promise)throw new Error("No native `Promise`-implementation found, polyfill needed");if(a&&!o.projectId)throw new Error("Configuration must contain `projectId`");a&&validate.projectId(o.projectId),o.dataset&&validate.dataset(o.dataset);var i=o.apiHost.split("://",2),r=i[0],n=i[1];return o.useProjectHostname?o.url=r+"://"+o.projectId+"."+n+"/v1":o.url=o.apiHost+"/v1",o};
},{"./validators":18,"xtend/mutable":50}],4:[function(require,module,exports){
},{"./validators":18,"xtend/mutable":51}],4:[function(require,module,exports){
"use strict";function _defineProperty(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var assign=require("xtend/mutable"),validators=require("../validators"),encodeQueryString=require("./encodeQueryString"),Transaction=require("./transaction"),Patch=require("./patch"),listen=require("./listen"),excludeFalsey=function(t,e){var r="undefined"==typeof t?e:t;return t===!1?void 0:r},getMutationQuery=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{returnIds:!0,returnDocuments:excludeFalsey(t.returnDocuments,!0),visibility:t.visibility||"sync"}},getQuerySizeLimit=1948;module.exports={listen:listen,fetch:function(t,e){return this.dataRequest("query",{query:t,params:e}).then(function(t){return t.result||[]})},getDocument:function(t){return this.request({uri:"/data/doc/"+t,json:!0}).then(function(t){return t.documents&&t.documents[0]})},create:function(t,e){return this._create(t,"create",e)},createIfNotExists:function(t,e){return this._create(t,"createIfNotExists",e)},createOrReplace:function(t,e){return this._create(t,"createOrReplace",e)},patch:function(t,e){return new Patch(t,e,this)},delete:function(t,e){return validators.validateDocumentId("delete",t),this.dataRequest("mutate",{mutations:[{delete:{id:t}}]},e)},mutate:function(t,e){var r=t instanceof Patch?t.serialize():t,n=Array.isArray(r)?r:[r];return this.dataRequest("mutate",{mutations:n},e)},transaction:function(t){return new Transaction(t,this)},dataRequest:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="mutate"===t,u=!i&&encodeQueryString(e),a=!i&&u.length<getQuerySizeLimit,s=a?u:"",o=n.returnFirst;return validators.promise.hasDataset(this.clientConfig).then(function(u){return r.request({method:a?"GET":"POST",uri:"/data/"+t+"/"+u+s,json:!0,body:a?void 0:e,query:i&&getMutationQuery(n)})}).then(function(t){if(!i)return t;var e=t.results||[];if(n.returnDocuments)return o?e[0]&&e[0].document:e.map(function(t){return t.document});var r=o?"documentId":"documentIds",u=o?e[0]&&e[0].id:e.map(function(t){return t.id});return _defineProperty({transactionId:t.transactionId},r,u)})},_create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=validators.hasDataset(this.clientConfig),i=_defineProperty({},e,assign({},t,{_id:t._id||n+"/"})),u=assign({returnFirst:!0,returnDocuments:!0},r);return this.dataRequest("mutate",{mutations:[i]},u)}};
},{"../validators":18,"./encodeQueryString":5,"./listen":6,"./patch":7,"./transaction":8,"xtend/mutable":50}],5:[function(require,module,exports){
},{"../validators":18,"./encodeQueryString":5,"./listen":6,"./patch":7,"./transaction":8,"xtend/mutable":51}],5:[function(require,module,exports){
"use strict";var enc=encodeURIComponent;module.exports=function(e){var n=e.query,r=e.params,c=void 0===r?{}:r,t=e.options,o=void 0===t?{}:t,u=Object.keys(c).reduce(function(e,n){return e+"&"+enc("$"+n)+"="+enc(JSON.stringify(c[n]))},"?query="+enc(n));return Object.keys(o).reduce(function(e,n){return o[n]?e+"&"+enc(n)+"="+enc(o[n]):e},u)};

@@ -18,12 +18,12 @@

},{"../util/defaults":16,"../util/pick":17,"../validators":18,"./encodeQueryString":5,"@sanity/eventsource":20,"@sanity/observable/minimal":22,"xtend/mutable":50}],7:[function(require,module,exports){
},{"../util/defaults":16,"../util/pick":17,"../validators":18,"./encodeQueryString":5,"@sanity/eventsource":20,"@sanity/observable/minimal":22,"xtend/mutable":51}],7:[function(require,module,exports){
"use strict";function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Patch(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.selection=t,this.operations=assign({},e),this.client=i}function getSelection(t){if("string"==typeof t||Array.isArray(t))return{id:t};if(t&&t.query)return{query:t.query};var e=["* Dataset-prefixed document ID (<dataset/docId>)","* Array of dataset-prefixed document IDs","* Object containing `query`"].join("\n");throw new Error("Unknown selection for patch - must be one of:\n\n"+e)}var deepAssign=require("deep-assign"),assign=require("xtend/mutable"),validate=require("../validators"),validateObject=validate.validateObject,validateInsert=validate.validateInsert;assign(Patch.prototype,{clone:function(){return new Patch(this.selection,assign({},this.operations),this.client)},merge:function(t){return validateObject("merge",t),this._assign("merge",deepAssign(this.operations.merge||{},t))},set:function(t){return this._assign("set",t)},diffMatchPatch:function(t){return validateObject("diffMatchPatch",t),this._assign("diffMatchPatch",t)},unset:function(t){if(!Array.isArray(t))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=assign({},this.operations,{unset:t}),this},setIfMissing:function(t){return this._assign("setIfMissing",t)},replace:function(t){return validateObject("replace",t),this._set("set",{$:t})},inc:function(t){return this._assign("inc",t)},dec:function(t){return this._assign("dec",t)},insert:function(t,e,i){var n;return validateInsert(t,e,i),this._assign("insert",(n={},_defineProperty(n,t,e),_defineProperty(n,"items",i),n))},append:function(t,e){return this.insert("after",t+"[-1]",e)},prepend:function(t,e){return this.insert("before",t+"[0]",e)},splice:function(t,e,i,n){var r="undefined"==typeof i||i===-1,s=e<0?e-1:e,a=r?-1:Math.max(0,e+i),o=s<0&&a>=0?"":a,c=t+"["+s+":"+o+"]";return this.insert("replace",c,n||[])},serialize:function(){return assign(getSelection(this.selection),this.operations)},toJSON:function(){return this.serialize()},commit:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.client)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");var e="string"==typeof this.selection,i=assign({returnFirst:e,returnDocuments:!0},t);return this.client.mutate({patch:this.serialize()},i)},reset:function(){return this.operations={},this},_set:function(t,e){return this._assign(t,e,!1)},_assign:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return validateObject(t,e),this.operations=assign({},this.operations,_defineProperty({},t,assign({},i&&this.operations[t]||{},e))),this}}),module.exports=Patch;
},{"../validators":18,"deep-assign":24,"xtend/mutable":50}],8:[function(require,module,exports){
},{"../validators":18,"deep-assign":24,"xtend/mutable":51}],8:[function(require,module,exports){
"use strict";function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Transaction(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];this.operations=t,this.client=e}var assign=require("xtend/mutable"),validators=require("../validators"),Patch=require("./patch"),defaultMutateOptions={returnDocuments:!1};assign(Transaction.prototype,{clone:function(){return new Transaction(this.operations.slice(0),this.client)},create:function(t){return this._create(t,"create")},createIfNotExists:function(t){return this._create(t,"createIfNotExists")},createOrReplace:function(t){return this._create(t,"createOrReplace")},delete:function(t){return validators.validateDocumentId("delete",t),this._add({delete:{id:t}})},patch:function t(e,i){var n="function"==typeof i,r=e instanceof Patch;if(r)return this._add({patch:e.serialize()});if(n){var t=i(new Patch(e,{},this.client));if(!(t instanceof Patch))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:t.serialize()})}return this._add({patch:assign({id:e},i)})},serialize:function(){return this.operations.slice()},toJSON:function(){return this.serialize()},commit:function(t){if(!this.client)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.client.mutate(this.serialize(),t||defaultMutateOptions)},reset:function(){return this.operations=[],this},_create:function(t,e){if(!t._id&&!this.client)throw new Error('Document needs an _id property when transaction is create outside a client scope. Pass `{_id: "<datasetName>:"}` to have Sanity generate an ID for you.');validators.validateObject(e,t);var i=validators.hasDataset(this.client.clientConfig),n=_defineProperty({},e,assign({},t,{_id:t._id||i+"/"}));return this._add(n)},_add:function(t){return this.operations.push(t),this}}),module.exports=Transaction;
},{"../validators":18,"./patch":7,"xtend/mutable":50}],9:[function(require,module,exports){
},{"../validators":18,"./patch":7,"xtend/mutable":51}],9:[function(require,module,exports){
"use strict";function DatasetsClient(t){this.request=t.request.bind(t)}var assign=require("xtend/mutable"),validate=require("../validators");assign(DatasetsClient.prototype,{create:function(t){return this._modify("PUT",t)},delete:function(t){return this._modify("DELETE",t)},list:function(){return this.request({uri:"/datasets"})},_modify:function(t,e){return validate.dataset(e),this.request({method:t,uri:"/datasets/"+e})}}),module.exports=DatasetsClient;
},{"../validators":18,"xtend/mutable":50}],10:[function(require,module,exports){
},{"../validators":18,"xtend/mutable":51}],10:[function(require,module,exports){
"use strict";function queryString(e){var n=function(n,r){return"undefined"==typeof e[r]?n:n.concat(encode(r)+"="+encode(e[r]))};return Object.keys(e).reduce(n,[]).join("&")}var encode=function(e){return encodeURIComponent(e)};exports.stringify=queryString;

@@ -34,3 +34,3 @@

},{"./queryString":10,"@sanity/observable/minimal":22,"@sanity/request":23,"xtend/mutable":50}],12:[function(require,module,exports){
},{"./queryString":10,"@sanity/observable/minimal":22,"@sanity/request":23,"xtend/mutable":51}],12:[function(require,module,exports){
"use strict";var tokenHeader="Sanity-Token",projectHeader="Sanity-Project-ID";module.exports=function(e){var t={};return e.token&&(t[tokenHeader]=e.token),!e.useProjectHostname&&e.projectId&&(t[projectHeader]=e.projectId),{headers:t,timeout:"timeout"in e?e.timeout:15e3,withCredentials:!0,json:!0}};

@@ -41,8 +41,8 @@

},{"xtend/mutable":50}],14:[function(require,module,exports){
},{"xtend/mutable":51}],14:[function(require,module,exports){
"use strict";function SanityClient(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultConfig;this.config(t),this.assets=new AssetsClient(this),this.datasets=new DatasetsClient(this),this.projects=new ProjectsClient(this),this.users=new UsersClient(this),this.auth=new AuthClient(this)}function mergeOptions(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];var n=e.reduce(function(t,e){return t||e.headers?assign(t||{},e.headers||{}):null},null);return assign.apply(void 0,e.concat([n?{headers:n}:{}]))}function createClient(t){return new SanityClient(t)}var assign=require("xtend/mutable"),Patch=require("./data/patch"),Transaction=require("./data/transaction"),dataMethods=require("./data/dataMethods"),DatasetsClient=require("./datasets/datasetsClient"),ProjectsClient=require("./projects/projectsClient"),AssetsClient=require("./assets/assetsClient"),UsersClient=require("./users/usersClient"),AuthClient=require("./auth/authClient"),httpRequest=require("./http/request"),getRequestOptions=require("./http/requestOptions"),_require=require("./config"),defaultConfig=_require.defaultConfig,initConfig=_require.initConfig;assign(SanityClient.prototype,dataMethods),assign(SanityClient.prototype,{config:function(t){return"undefined"==typeof t?this.clientConfig:(this.clientConfig=initConfig(t,this.clientConfig||{}),this)},getUrl:function(t){return this.clientConfig.url+"/"+t.replace(/^\//,"")},request:function(t){return this.requestObservable(t).toPromise()},requestObservable:function(t){return httpRequest(mergeOptions(getRequestOptions(this.clientConfig),t,{uri:this.getUrl(t.uri)}))}}),createClient.Patch=Patch,createClient.Transaction=Transaction,module.exports=createClient;
},{"./assets/assetsClient":1,"./auth/authClient":2,"./config":3,"./data/dataMethods":4,"./data/patch":7,"./data/transaction":8,"./datasets/datasetsClient":9,"./http/request":11,"./http/requestOptions":12,"./projects/projectsClient":13,"./users/usersClient":15,"xtend/mutable":50}],15:[function(require,module,exports){
},{"./assets/assetsClient":1,"./auth/authClient":2,"./config":3,"./data/dataMethods":4,"./data/patch":7,"./data/transaction":8,"./datasets/datasetsClient":9,"./http/request":11,"./http/requestOptions":12,"./projects/projectsClient":13,"./users/usersClient":15,"xtend/mutable":51}],15:[function(require,module,exports){
"use strict";function UsersClient(e){this.client=e}var assign=require("xtend/mutable");assign(UsersClient.prototype,{getById:function(e){return this.client.request({uri:"/users/"+e})}}),module.exports=UsersClient;
},{"xtend/mutable":50}],16:[function(require,module,exports){
},{"xtend/mutable":51}],16:[function(require,module,exports){
"use strict";module.exports=function(e,t){return Object.keys(t).concat(Object.keys(e)).reduce(function(n,c){return n[c]="undefined"==typeof e[c]?t[c]:e[c],n},{})};

@@ -56,8 +56,8 @@

"use strict";function forEachArray(e,t){for(var r=0;r<e.length;r++)t(e[r])}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function initParams(e,t,r){var n=e;return isFunction(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=xtend(t,{uri:e}),n.callback=r,n}function createXHR(e,t,r){return t=initParams(e,t,r),_createXHR(t)}function _createXHR(e){function t(){4===u.readyState&&o()}function r(){var e=void 0;if(e=u.response?u.response:u.responseText||getXml(u),h)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(p),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,i)}function o(){if(!d){var t;clearTimeout(p),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var n=i,o=null;return 0!==t?(n={body:r(),statusCode:t,method:f,headers:{},url:l,rawRequest:u},u.getAllResponseHeaders&&(n.headers=parseHeaders(u.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),a(o,n,n.body)}}if("undefined"==typeof e.callback)throw new Error("callback argument missing");var s=!1,a=function(t,r,n){s||(s=!0,e.callback(t,r,n))},i={body:void 0,headers:{},statusCode:0,method:f,url:l,rawRequest:u},u=e.xhr||null;u||(u=e.cors||e.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var c,d,p,l=u.url=e.uri||e.url,f=u.method=e.method||"GET",m=e.body||e.data||null,R=u.headers=e.headers||{},X=!!e.sync,h=!1;if(e.json===!0&&(h=!0,R.accept||R.Accept||(R.Accept="application/json"),"GET"!==f&&"HEAD"!==f&&(R["content-type"]||R["Content-Type"]||(R["Content-Type"]="application/json"),m=JSON.stringify(e.body))),u.onreadystatechange=t,u.onload=o,u.onerror=n,u.onprogress=function(){},u.ontimeout=n,u.open(f,l,!X,e.username,e.password),X||(u.withCredentials=!!e.withCredentials),!X&&e.timeout>0&&(p=setTimeout(function(){d=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)},e.timeout)),u.setRequestHeader)for(c in R)R.hasOwnProperty(c)&&u.setRequestHeader(c,R[c]);else if(e.headers&&!isEmpty(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(m),u}function getXml(e){if("document"===e.responseType)return e.responseXML;var t=204===e.status&&e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function noop(){}var window=require("global/window"),isFunction=require("is-function"),parseHeaders=require("parse-headers"),xtend=require("xtend");module.exports=createXHR,createXHR.XMLHttpRequest=window.XMLHttpRequest||noop,createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window.XDomainRequest,forEachArray(["get","put","post","patch","head","delete"],function(e){createXHR["delete"===e?"del":e]=function(t,r,n){return r=initParams(t,r,n),r.method=e.toUpperCase(),_createXHR(r)}});
},{"global/window":27,"is-function":28,"parse-headers":30,"xtend":49}],20:[function(require,module,exports){
},{"global/window":27,"is-function":28,"parse-headers":30,"xtend":50}],20:[function(require,module,exports){
module.exports=require("eventsource-polyfill/dist/eventsource");
},{"eventsource-polyfill/dist/eventsource":25}],21:[function(require,module,exports){
"use strict";function SanityObservableMinimal(){Observable.apply(this,arguments)}var _require=require("rxjs/Observable"),Observable=_require.Observable,_require2=require("rxjs/operator/map"),map=_require2.map,_require3=require("rxjs/operator/filter"),filter=_require3.filter,_require4=require("rxjs/operator/reduce"),reduce=_require4.reduce;SanityObservableMinimal.prototype=Object.create(Observable.prototype),SanityObservableMinimal.prototype.constructor=SanityObservableMinimal,SanityObservableMinimal.prototype.lift=function(e){var r=new SanityObservableMinimal;return r.source=this,r.operator=e,r},SanityObservableMinimal.prototype.map=map,SanityObservableMinimal.prototype.filter=filter,SanityObservableMinimal.prototype.reduce=reduce,module.exports=SanityObservableMinimal;
"use strict";function SanityObservableMinimal(){Observable.apply(this,arguments)}var _require=require("rxjs/Observable"),Observable=_require.Observable,_require2=require("rxjs/operator/map"),map=_require2.map,_require3=require("rxjs/operator/filter"),filter=_require3.filter,_require4=require("rxjs/operator/reduce"),reduce=_require4.reduce,_require5=require("rxjs/operator/toPromise"),toPromise=_require5.toPromise;SanityObservableMinimal.prototype=Object.create(Observable.prototype),Object.defineProperty(SanityObservableMinimal.prototype,"constructor",{value:SanityObservableMinimal,enumerable:!1,writable:!0,configurable:!0}),SanityObservableMinimal.prototype.lift=function(e){var r=new SanityObservableMinimal;return r.source=this,r.operator=e,r},SanityObservableMinimal.prototype.map=map,SanityObservableMinimal.prototype.filter=filter,SanityObservableMinimal.prototype.reduce=reduce,SanityObservableMinimal.prototype.toPromise=toPromise,module.exports=SanityObservableMinimal;
},{"rxjs/Observable":31,"rxjs/operator/filter":35,"rxjs/operator/map":36,"rxjs/operator/reduce":37}],22:[function(require,module,exports){
},{"rxjs/Observable":31,"rxjs/operator/filter":35,"rxjs/operator/map":36,"rxjs/operator/reduce":37,"rxjs/operator/toPromise":38}],22:[function(require,module,exports){
module.exports=require("./lib/SanityObservableMinimal");

@@ -70,12 +70,12 @@ },{"./lib/SanityObservableMinimal":21}],23:[function(require,module,exports){

!function(t){function e(t,e,i,r){this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.data=e||null,this.origin=i||"",this.lastEventId=r||"",this.type=t||"message"}function i(){return!(!window.XDomainRequest||!window.XMLHttpRequest||void 0!==(new XMLHttpRequest).responseType)}if(!t.EventSource||t._eventSourceImportPrefix){var r=(t._eventSourceImportPrefix||"")+"EventSource",s=function(t,e){if(!t||"string"!=typeof t)throw new SyntaxError("Not enough arguments");this.URL=t,this.setOptions(e);var i=this;setTimeout(function(){i.poll()},0)};if(s.prototype={CONNECTING:0,OPEN:1,CLOSED:2,defaultOptions:{loggingEnabled:!1,loggingPrefix:"eventsource",interval:500,bufferSizeLimit:262144,silentTimeout:3e5,getArgs:{evs_buffer_size_limit:262144},xhrHeaders:{Accept:"text/event-stream","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}},setOptions:function(t){var e,i=this.defaultOptions;for(e in i)i.hasOwnProperty(e)&&(this[e]=i[e]);for(e in t)e in i&&t.hasOwnProperty(e)&&(this[e]=t[e]);this.getArgs&&this.bufferSizeLimit&&(this.getArgs.evs_buffer_size_limit=this.bufferSizeLimit),"undefined"!=typeof console&&"undefined"!=typeof console.log||(this.loggingEnabled=!1)},log:function(t){this.loggingEnabled&&console.log("["+this.loggingPrefix+"]:"+t)},poll:function(){try{if(this.readyState==this.CLOSED)return;this.cleanup(),this.readyState=this.CONNECTING,this.cursor=0,this.cache="",this._xhr=new this.XHR(this),this.resetNoActivityTimer()}catch(t){this.log("There were errors inside the pool try-catch"),this.dispatchEvent("error",{type:"error",data:t.message})}},pollAgain:function(t){var e=this;e.readyState=e.CONNECTING,e.dispatchEvent("error",{type:"error",data:"Reconnecting "}),this._pollTimer=setTimeout(function(){e.poll()},t||0)},cleanup:function(){this.log("evs cleaning up"),this._pollTimer&&(clearInterval(this._pollTimer),this._pollTimer=null),this._noActivityTimer&&(clearInterval(this._noActivityTimer),this._noActivityTimer=null),this._xhr&&(this._xhr.abort(),this._xhr=null)},resetNoActivityTimer:function(){if(this.silentTimeout){this._noActivityTimer&&clearInterval(this._noActivityTimer);var t=this;this._noActivityTimer=setTimeout(function(){t.log("Timeout! silentTImeout:"+t.silentTimeout),t.pollAgain()},this.silentTimeout)}},close:function(){this.readyState=this.CLOSED,this.log("Closing connection. readyState: "+this.readyState),this.cleanup()},ondata:function(){var t=this._xhr;if(t.isReady()&&!t.hasError()){this.resetNoActivityTimer(),this.readyState==this.CONNECTING&&(this.readyState=this.OPEN,this.dispatchEvent("open",{type:"open"}));var e=t.getBuffer();e.length>this.bufferSizeLimit&&(this.log("buffer.length > this.bufferSizeLimit"),this.pollAgain()),0==this.cursor&&e.length>0&&"\ufeff"==e.substring(0,1)&&(this.cursor=1);var i=this.lastMessageIndex(e);if(i[0]>=this.cursor){var r=i[1],s=e.substring(this.cursor,r);this.parseStream(s),this.cursor=r}t.isDone()&&(this.log("request.isDone(). reopening the connection"),this.pollAgain(this.interval))}else this.readyState!==this.CLOSED&&(this.log("this.readyState !== this.CLOSED"),this.pollAgain(this.interval))},parseStream:function(t){t=this.cache+this.normalizeToLF(t);var i,r,s,n,a,o,h=t.split("\n\n");for(i=0;i<h.length-1;i++){for(s="message",n=[],parts=h[i].split("\n"),r=0;r<parts.length;r++)a=this.trimWhiteSpace(parts[r]),0==a.indexOf("event")?s=a.replace(/event:?\s*/,""):0==a.indexOf("retry")?(o=parseInt(a.replace(/retry:?\s*/,"")),isNaN(o)||(this.interval=o)):0==a.indexOf("data")?n.push(a.replace(/data:?\s*/,"")):0==a.indexOf("id:")?this.lastEventId=a.replace(/id:?\s*/,""):0==a.indexOf("id")&&(this.lastEventId=null);if(n.length){var u=new e(s,n.join("\n"),window.location.origin,this.lastEventId);this.dispatchEvent(s,u)}}this.cache=h[h.length-1]},dispatchEvent:function(t,e){var i=this["_"+t+"Handlers"];if(i)for(var r=0;r<i.length;r++)i[r].call(this,e);this["on"+t]&&this["on"+t].call(this,e)},addEventListener:function(t,e){this["_"+t+"Handlers"]||(this["_"+t+"Handlers"]=[]),this["_"+t+"Handlers"].push(e)},removeEventListener:function(t,e){var i=this["_"+t+"Handlers"];if(i)for(var r=i.length-1;r>=0;--r)if(i[r]===e){i.splice(r,1);break}},_pollTimer:null,_noactivityTimer:null,_xhr:null,lastEventId:null,cache:"",cursor:0,onerror:null,onmessage:null,onopen:null,readyState:0,urlWithParams:function(t,e){var i=[];if(e){var r,s,n=encodeURIComponent;for(r in e)e.hasOwnProperty(r)&&(s=n(r)+"="+n(e[r]),i.push(s))}return i.length>0?t.indexOf("?")==-1?t+"?"+i.join("&"):t+"&"+i.join("&"):t},lastMessageIndex:function(t){var e=t.lastIndexOf("\n\n"),i=t.lastIndexOf("\r\r"),r=t.lastIndexOf("\r\n\r\n");return r>Math.max(e,i)?[r,r+4]:[Math.max(e,i),Math.max(e,i)+2]},trimWhiteSpace:function(t){var e=/^(\s|\u00A0)+|(\s|\u00A0)+$/g;return t.replace(e,"")},normalizeToLF:function(t){return t.replace(/\r\n|\r/g,"\n")}},i()){s.isPolyfill="IE_8-9";var n=s.prototype.defaultOptions;n.xhrHeaders=null,n.getArgs.evs_preamble=2056,s.prototype.XHR=function(t){request=new XDomainRequest,this._request=request,request.onprogress=function(){request._ready=!0,t.ondata()},request.onload=function(){this._loaded=!0,t.ondata()},request.onerror=function(){this._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"XDomainRequest error"})},request.ontimeout=function(){this._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"XDomainRequest timed out"})};var e={};if(t.getArgs){var i=t.getArgs;for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r]);t.lastEventId&&(e.evs_last_event_id=t.lastEventId)}request.open("GET",t.urlWithParams(t.URL,e)),request.send()},s.prototype.XHR.prototype={useXDomainRequest:!0,_request:null,_ready:!1,_loaded:!1,_failed:!1,isReady:function(){return this._request._ready},isDone:function(){return this._request._loaded},hasError:function(){return this._request._failed},getBuffer:function(){var t="";try{t=this._request.responseText||""}catch(t){}return t},abort:function(){this._request&&this._request.abort()}}}else s.isPolyfill="XHR",s.prototype.XHR=function(t){request=new XMLHttpRequest,this._request=request,t._xhr=this,request.onreadystatechange=function(){request.readyState>1&&t.readyState!=t.CLOSED&&(200==request.status||request.status>=300&&request.status<400?t.ondata():(request._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"The server responded with "+request.status}),t.close()))},request.onprogress=function(){},request.open("GET",t.urlWithParams(t.URL,t.getArgs),!0);var e=t.xhrHeaders;for(var i in e)e.hasOwnProperty(i)&&request.setRequestHeader(i,e[i]);t.lastEventId&&request.setRequestHeader("Last-Event-Id",t.lastEventId),request.send()},s.prototype.XHR.prototype={useXDomainRequest:!1,_request:null,_failed:!1,isReady:function(){return this._request.readyState>=2},isDone:function(){return 4==this._request.readyState},hasError:function(){return this._failed||this._request.status>=400},getBuffer:function(){var t="";try{t=this._request.responseText||""}catch(t){}return t},abort:function(){this._request&&this._request.abort()}};t[r]=s}}(this);
},{}],26:[function(require,module,exports){
function forEach(r,t,o){if(!isFunction(t))throw new TypeError("iterator must be a function");arguments.length<3&&(o=this),"[object Array]"===toString.call(r)?forEachArray(r,t,o):"string"==typeof r?forEachString(r,t,o):forEachObject(r,t,o)}function forEachArray(r,t,o){for(var n=0,a=r.length;n<a;n++)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}function forEachString(r,t,o){for(var n=0,a=r.length;n<a;n++)t.call(o,r.charAt(n),n,r)}function forEachObject(r,t,o){for(var n in r)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}var isFunction=require("is-function");module.exports=forEach;var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty;
},{"is-function":28}],27:[function(require,module,exports){
(function (global){
"undefined"!=typeof window?module.exports=window:"undefined"!=typeof global?module.exports=global:"undefined"!=typeof self?module.exports=self:module.exports={};
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],28:[function(require,module,exports){
function isFunction(o){var t=toString.call(o);return"[object Function]"===t||"function"==typeof o&&"[object RegExp]"!==t||"undefined"!=typeof window&&(o===window.setTimeout||o===window.alert||o===window.confirm||o===window.prompt)}module.exports=isFunction;var toString=Object.prototype.toString;
},{}],29:[function(require,module,exports){

@@ -86,14 +86,13 @@ "use strict";module.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)};

},{"for-each":26,"trim":48}],31:[function(require,module,exports){
},{"for-each":26,"trim":49}],31:[function(require,module,exports){
"use strict";var root_1=require("./util/root"),toSubscriber_1=require("./util/toSubscriber"),observable_1=require("./symbol/observable"),Observable=function(){function r(r){this._isScalar=!1,r&&(this._subscribe=r)}return r.prototype.lift=function(o){var t=new r;return t.source=this,t.operator=o,t},r.prototype.subscribe=function(r,o,t){var e=this.operator,s=toSubscriber_1.toSubscriber(r,o,t);if(e?e.call(s,this):s.add(this._subscribe(s)),s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},r.prototype.forEach=function(r,o){var t=this;if(o||(root_1.root.Rx&&root_1.root.Rx.config&&root_1.root.Rx.config.Promise?o=root_1.root.Rx.config.Promise:root_1.root.Promise&&(o=root_1.root.Promise)),!o)throw new Error("no Promise impl found");return new o(function(o,e){var s=t.subscribe(function(o){if(s)try{r(o)}catch(r){e(r),s.unsubscribe()}else r(o)},e,o)})},r.prototype._subscribe=function(r){return this.source.subscribe(r)},r.prototype[observable_1.$$observable]=function(){return this},r.create=function(o){return new r(o)},r}();exports.Observable=Observable;
},{"./symbol/observable":39,"./util/root":46,"./util/toSubscriber":47}],32:[function(require,module,exports){
"use strict";exports.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}};
},{"./symbol/observable":38,"./util/root":45,"./util/toSubscriber":46}],32:[function(require,module,exports){
"use strict";exports.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}};
},{}],33:[function(require,module,exports){
"use strict";var __extends=this&&this.__extends||function(t,r){function i(){this.constructor=t}for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s]);t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},isFunction_1=require("./util/isFunction"),Subscription_1=require("./Subscription"),Observer_1=require("./Observer"),rxSubscriber_1=require("./symbol/rxSubscriber"),Subscriber=function(t){function r(i,s,e){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=Observer_1.empty;break;case 1:if(!i){this.destination=Observer_1.empty;break}if("object"==typeof i){i instanceof r?(this.destination=i,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new SafeSubscriber(this,i));break}default:this.syncErrorThrowable=!0,this.destination=new SafeSubscriber(this,i,s,e)}}return __extends(r,t),r.prototype[rxSubscriber_1.$$rxSubscriber]=function(){return this},r.create=function(t,i,s){var e=new r(t,i,s);return e.syncErrorThrowable=!1,e},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},r.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},r}(Subscription_1.Subscription);exports.Subscriber=Subscriber;var SafeSubscriber=function(t){function r(r,i,s,e){t.call(this),this._parent=r;var n,o=this;isFunction_1.isFunction(i)?n=i:i&&(o=i,n=i.next,s=i.error,e=i.complete,isFunction_1.isFunction(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this)),this._context=o,this._next=n,this._error=s,this._complete=e}return __extends(r,t),r.prototype.next=function(t){if(!this.isStopped&&this._next){var r=this._parent;r.syncErrorThrowable?this.__tryOrSetError(r,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var r=this._parent;if(this._error)r.syncErrorThrowable?(this.__tryOrSetError(r,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!r.syncErrorThrowable)throw this.unsubscribe(),t;r.syncErrorValue=t,r.syncErrorThrown=!0,this.unsubscribe()}}},r.prototype.complete=function(){if(!this.isStopped){var t=this._parent;this._complete?t.syncErrorThrowable?(this.__tryOrSetError(t,this._complete),this.unsubscribe()):(this.__tryOrUnsub(this._complete),this.unsubscribe()):this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,r){try{t.call(this._context,r)}catch(t){throw this.unsubscribe(),t}},r.prototype.__tryOrSetError=function(t,r,i){try{r.call(this._context,i)}catch(r){return t.syncErrorValue=r,t.syncErrorThrown=!0,!0}return!1},r.prototype._unsubscribe=function(){var t=this._parent;this._context=null,this._parent=null,t.unsubscribe()},r}(Subscriber);
},{"./Observer":32,"./Subscription":34,"./symbol/rxSubscriber":39,"./util/isFunction":43}],34:[function(require,module,exports){
},{"./Observer":32,"./Subscription":34,"./symbol/rxSubscriber":40,"./util/isFunction":44}],34:[function(require,module,exports){
"use strict";var isArray_1=require("./util/isArray"),isObject_1=require("./util/isObject"),isFunction_1=require("./util/isFunction"),tryCatch_1=require("./util/tryCatch"),errorObject_1=require("./util/errorObject"),UnsubscriptionError_1=require("./util/UnsubscriptionError"),Subscription=function(){function r(r){this.closed=!1,r&&(this._unsubscribe=r)}return r.prototype.unsubscribe=function(){var r,i=!1;if(!this.closed){this.closed=!0;var t=this,s=t._unsubscribe,e=t._subscriptions;if(this._subscriptions=null,isFunction_1.isFunction(s)){var c=tryCatch_1.tryCatch(s).call(this);c===errorObject_1.errorObject&&(i=!0,(r=r||[]).push(errorObject_1.errorObject.e))}if(isArray_1.isArray(e))for(var n=-1,o=e.length;++n<o;){var u=e[n];if(isObject_1.isObject(u)){var c=tryCatch_1.tryCatch(u.unsubscribe).call(u);if(c===errorObject_1.errorObject){i=!0,r=r||[];var b=errorObject_1.errorObject.e;b instanceof UnsubscriptionError_1.UnsubscriptionError?r=r.concat(b.errors):r.push(b)}}}if(i)throw new UnsubscriptionError_1.UnsubscriptionError(r)}},r.prototype.add=function(i){if(!i||i===r.EMPTY)return r.EMPTY;if(i===this)return this;var t=i;switch(typeof i){case"function":t=new r(i);case"object":if(t.closed||"function"!=typeof t.unsubscribe)break;this.closed?t.unsubscribe():(this._subscriptions||(this._subscriptions=[])).push(t);break;default:throw new Error("unrecognized teardown "+i+" added to Subscription.")}return t},r.prototype.remove=function(i){if(null!=i&&i!==this&&i!==r.EMPTY){var t=this._subscriptions;if(t){var s=t.indexOf(i);s!==-1&&t.splice(s,1)}}},r.EMPTY=function(r){return r.closed=!0,r}(new r),r}();exports.Subscription=Subscription;
},{"./util/UnsubscriptionError":40,"./util/errorObject":41,"./util/isArray":42,"./util/isFunction":43,"./util/isObject":44,"./util/tryCatch":47}],35:[function(require,module,exports){
},{"./util/UnsubscriptionError":41,"./util/errorObject":42,"./util/isArray":43,"./util/isFunction":44,"./util/isObject":45,"./util/tryCatch":48}],35:[function(require,module,exports){
"use strict";function filter(t,r){return this.lift(new FilterOperator(t,r))}var __extends=this&&this.__extends||function(t,r){function i(){this.constructor=t}for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},Subscriber_1=require("../Subscriber");exports.filter=filter;var FilterOperator=function(){function t(t,r){this.predicate=t,this.thisArg=r}return t.prototype.call=function(t,r){return r._subscribe(new FilterSubscriber(t,this.predicate,this.thisArg))},t}(),FilterSubscriber=function(t){function r(r,i,e){t.call(this,r),this.predicate=i,this.thisArg=e,this.count=0,this.predicate=i}return __extends(r,t),r.prototype._next=function(t){var r;try{r=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}r&&this.destination.next(t)},r}(Subscriber_1.Subscriber);
},{"../Subscriber":33}],36:[function(require,module,exports){

@@ -106,37 +105,41 @@ "use strict";function map(t,r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new MapOperator(t,r))}var __extends=this&&this.__extends||function(t,r){function e(){this.constructor=t}for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i]);t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)},Subscriber_1=require("../Subscriber");exports.map=map;var MapOperator=function(){function t(t,r){this.project=t,this.thisArg=r}return t.prototype.call=function(t,r){return r._subscribe(new MapSubscriber(t,this.project,this.thisArg))},t}();exports.MapOperator=MapOperator;var MapSubscriber=function(t){function r(r,e,i){t.call(this,r),this.project=e,this.count=0,this.thisArg=i||this}return __extends(r,t),r.prototype._next=function(t){var r;try{r=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(r)},r}(Subscriber_1.Subscriber);

},{"../Subscriber":33}],38:[function(require,module,exports){
"use strict";function toPromise(o){var r=this;if(o||(root_1.root.Rx&&root_1.root.Rx.config&&root_1.root.Rx.config.Promise?o=root_1.root.Rx.config.Promise:root_1.root.Promise&&(o=root_1.root.Promise)),!o)throw new Error("no Promise impl found");return new o(function(o,t){var i;r.subscribe(function(o){return i=o},function(o){return t(o)},function(){return o(i)})})}var root_1=require("../util/root");exports.toPromise=toPromise;
},{"../util/root":46}],39:[function(require,module,exports){
"use strict";function getSymbolObservable(e){var b,o=e.Symbol;return"function"==typeof o?o.observable?b=o.observable:(b=o("observable"),o.observable=b):b="@@observable",b}var root_1=require("../util/root");exports.getSymbolObservable=getSymbolObservable,exports.$$observable=getSymbolObservable(root_1.root);
},{"../util/root":45}],39:[function(require,module,exports){
},{"../util/root":46}],40:[function(require,module,exports){
"use strict";var root_1=require("../util/root"),Symbol=root_1.root.Symbol;exports.$$rxSubscriber="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("rxSubscriber"):"@@rxSubscriber";
},{"../util/root":45}],40:[function(require,module,exports){
},{"../util/root":46}],41:[function(require,module,exports){
"use strict";var __extends=this&&this.__extends||function(r,t){function n(){this.constructor=r}for(var s in t)t.hasOwnProperty(s)&&(r[s]=t[s]);r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},UnsubscriptionError=function(r){function t(t){r.call(this),this.errors=t;var n=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map(function(r,t){return t+1+") "+r.toString()}).join("\n "):"");this.name=n.name="UnsubscriptionError",this.stack=n.stack,this.message=n.message}return __extends(t,r),t}(Error);exports.UnsubscriptionError=UnsubscriptionError;
},{}],41:[function(require,module,exports){
},{}],42:[function(require,module,exports){
"use strict";exports.errorObject={e:{}};
},{}],42:[function(require,module,exports){
},{}],43:[function(require,module,exports){
"use strict";exports.isArray=Array.isArray||function(r){return r&&"number"==typeof r.length};
},{}],43:[function(require,module,exports){
},{}],44:[function(require,module,exports){
"use strict";function isFunction(n){return"function"==typeof n}exports.isFunction=isFunction;
},{}],44:[function(require,module,exports){
},{}],45:[function(require,module,exports){
"use strict";function isObject(t){return null!=t&&"object"==typeof t}exports.isObject=isObject;
},{}],45:[function(require,module,exports){
},{}],46:[function(require,module,exports){
(function (global){
"use strict";if(exports.root="object"==typeof window&&window.window===window&&window||"object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global,!exports.root)throw new Error("RxJS could not find any global context (window, self, global)");
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],46:[function(require,module,exports){
},{}],47:[function(require,module,exports){
"use strict";function toSubscriber(r,b,e){if(r){if(r instanceof Subscriber_1.Subscriber)return r;if(r[rxSubscriber_1.$$rxSubscriber])return r[rxSubscriber_1.$$rxSubscriber]()}return r||b||e?new Subscriber_1.Subscriber(r,b,e):new Subscriber_1.Subscriber(Observer_1.empty)}var Subscriber_1=require("../Subscriber"),rxSubscriber_1=require("../symbol/rxSubscriber"),Observer_1=require("../Observer");exports.toSubscriber=toSubscriber;
},{"../Observer":32,"../Subscriber":33,"../symbol/rxSubscriber":39}],47:[function(require,module,exports){
},{"../Observer":32,"../Subscriber":33,"../symbol/rxSubscriber":40}],48:[function(require,module,exports){
"use strict";function tryCatcher(){try{return tryCatchTarget.apply(this,arguments)}catch(r){return errorObject_1.errorObject.e=r,errorObject_1.errorObject}}function tryCatch(r){return tryCatchTarget=r,tryCatcher}var errorObject_1=require("./errorObject"),tryCatchTarget;exports.tryCatch=tryCatch;
},{"./errorObject":41}],48:[function(require,module,exports){
},{"./errorObject":42}],49:[function(require,module,exports){
function trim(r){return r.replace(/^\s*|\s*$/g,"")}exports=module.exports=trim,exports.left=function(r){return r.replace(/^\s*/,"")},exports.right=function(r){return r.replace(/\s*$/,"")};
},{}],50:[function(require,module,exports){
function extend(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];for(var n in t)hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;
},{}],49:[function(require,module,exports){
function extend(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];for(var n in t)hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;
},{}],50:[function(require,module,exports){
},{}],51:[function(require,module,exports){
function extend(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;

@@ -143,0 +146,0 @@

@@ -1,2 +0,2 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.SanityClient=t()}}(function(){return function t(e,r,n){function i(s,u){if(!r[s]){if(!e[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable"),o=t("../validators"),s={image:"images",file:"files"};i(n.prototype,{upload:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.validateAssetType(t);var n=o.hasDataset(this.client.clientConfig),u="contentType"in r?{"Content-Type":r.contentType}:{},a=s[t],c=r.label?"?label="+encodeURIComponent(r.label):"",l="/assets/"+a+"/"+n+c;return this.client.requestObservable({method:"POST",headers:i({Accept:"application/json"},u),uri:l,body:e,json:!1,timeout:0}).map(function(t){return"response"!==t.type?t:i({},t,{body:JSON.parse(t.body)})})}}),e.exports=n},{"../validators":18,"xtend/mutable":50}],2:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable");i(n.prototype,{getLoginProviders:function(){return this.client.request({uri:"/auth/providers"})},logout:function(){return this.client.request({uri:"/auth/logout"})}}),e.exports=n},{"xtend/mutable":50}],3:[function(t,e,r){"use strict";var n=t("xtend/mutable"),i=t("./validators"),o=r.defaultConfig={apiHost:"https://api.sanity.io",useProjectHostname:!0};r.initConfig=function(t,e){var r=n({},o,e,t),s=r.useProjectHostname;if("undefined"==typeof Promise)throw new Error("No native `Promise`-implementation found, polyfill needed");if(s&&!r.projectId)throw new Error("Configuration must contain `projectId`");s&&i.projectId(r.projectId),r.dataset&&i.dataset(r.dataset);var u=r.apiHost.split("://",2),a=u[0],c=u[1];return r.useProjectHostname?r.url=a+"://"+r.projectId+"."+c+"/v1":r.url=r.apiHost+"/v1",r}},{"./validators":18,"xtend/mutable":50}],4:[function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=t("xtend/mutable"),o=t("../validators"),s=t("./encodeQueryString"),u=t("./transaction"),a=t("./patch"),c=t("./listen"),l=function(t,e){var r="undefined"==typeof t?e:t;return t===!1?void 0:r},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{returnIds:!0,returnDocuments:l(t.returnDocuments,!0),visibility:t.visibility||"sync"}},h=1948;e.exports={listen:c,fetch:function(t,e){return this.dataRequest("query",{query:t,params:e}).then(function(t){return t.result||[]})},getDocument:function(t){return this.request({uri:"/data/doc/"+t,json:!0}).then(function(t){return t.documents&&t.documents[0]})},create:function(t,e){return this._create(t,"create",e)},createIfNotExists:function(t,e){return this._create(t,"createIfNotExists",e)},createOrReplace:function(t,e){return this._create(t,"createOrReplace",e)},patch:function(t,e){return new a(t,e,this)},delete:function(t,e){return o.validateDocumentId("delete",t),this.dataRequest("mutate",{mutations:[{delete:{id:t}}]},e)},mutate:function(t,e){var r=t instanceof a?t.serialize():t,n=Array.isArray(r)?r:[r];return this.dataRequest("mutate",{mutations:n},e)},transaction:function(t){return new u(t,this)},dataRequest:function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u="mutate"===t,a=!u&&s(e),c=!u&&a.length<h,l=c?a:"",p=i.returnFirst;return o.promise.hasDataset(this.clientConfig).then(function(n){return r.request({method:c?"GET":"POST",uri:"/data/"+t+"/"+n+l,json:!0,body:c?void 0:e,query:u&&f(i)})}).then(function(t){if(!u)return t;var e=t.results||[];if(i.returnDocuments)return p?e[0]&&e[0].document:e.map(function(t){return t.document});var r=p?"documentId":"documentIds",o=p?e[0]&&e[0].id:e.map(function(t){return t.id});return n({transactionId:t.transactionId},r,o)})},_create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o.hasDataset(this.clientConfig),u=n({},e,i({},t,{_id:t._id||s+"/"})),a=i({returnFirst:!0,returnDocuments:!0},r);return this.dataRequest("mutate",{mutations:[u]},a)}}},{"../validators":18,"./encodeQueryString":5,"./listen":6,"./patch":7,"./transaction":8,"xtend/mutable":50}],5:[function(t,e,r){"use strict";var n=encodeURIComponent;e.exports=function(t){var e=t.query,r=t.params,i=void 0===r?{}:r,o=t.options,s=void 0===o?{}:o,u=Object.keys(i).reduce(function(t,e){return t+"&"+n("$"+e)+"="+n(JSON.stringify(i[e]))},"?query="+n(e));return Object.keys(s).reduce(function(t,e){return s[e]?t+"&"+n(e)+"="+n(s[e]):t},u)}},{}],6:[function(t,e,r){"use strict";function n(t){try{var e=t.data&&JSON.parse(t.data)||{};return o({type:t.type},e)}catch(t){return t}}function i(t){if(t instanceof Error)return t;var e=n(t);return e instanceof Error?e:new Error(e.error||e.message||"Unknown listener error")}var o=t("xtend/mutable"),s=t("@sanity/observable/minimal"),u=t("./encodeQueryString"),a=t("../validators"),c=t("../util/pick"),l=t("../util/defaults"),f="undefined"!=typeof window&&window.EventSource?window.EventSource:t("@sanity/eventsource"),h=function(t,e,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.removeListener(e,r)},p=["includePreviousRevision","includeResult"],d={includeResult:!0};e.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},b=l(r,d),y=c(b,p),v=u({query:t,params:e,options:y}),m=a.hasDataset(this.clientConfig),g=this.getUrl("/data/listen/"+m+v),w=this.clientConfig.token,_=b.events?b.events:["mutation"],x=_.indexOf("reconnect")!==-1,E=new f(g,o({withCredentials:!0},w?{headers:{"Sanity-Token":w}}:{}));return new s(function(t){function e(){E.readyState===f.CLOSED?t.complete():E.readyState===f.CONNECTING&&a()}function r(e){t.error(i(e))}function o(e){var r=n(e);return r instanceof Error?t.error(r):t.next(r)}function s(e){t.complete(),u()}function u(){_.forEach(function(t){return h(E,t,o)}),h(E,"error",e),h(E,"channelError",r),h(E,"disconnect",s),E.close()}function a(){x&&t.next({type:"reconnect"})}return E.addEventListener("error",e,!1),E.addEventListener("channelError",r,!1),E.addEventListener("disconnect",s,!1),_.forEach(function(t){return E.addEventListener(t,o,!1)}),u})}},{"../util/defaults":16,"../util/pick":17,"../validators":18,"./encodeQueryString":5,"@sanity/eventsource":20,"@sanity/observable/minimal":22,"xtend/mutable":50}],7:[function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.selection=t,this.operations=u({},e),this.client=r}function o(t){if("string"==typeof t||Array.isArray(t))return{id:t};if(t&&t.query)return{query:t.query};var e=["* Dataset-prefixed document ID (<dataset/docId>)","* Array of dataset-prefixed document IDs","* Object containing `query`"].join("\n");throw new Error("Unknown selection for patch - must be one of:\n\n"+e)}var s=t("deep-assign"),u=t("xtend/mutable"),a=t("../validators"),c=a.validateObject,l=a.validateInsert;u(i.prototype,{clone:function(){return new i(this.selection,u({},this.operations),this.client)},merge:function(t){return c("merge",t),this._assign("merge",s(this.operations.merge||{},t))},set:function(t){return this._assign("set",t)},diffMatchPatch:function(t){return c("diffMatchPatch",t),this._assign("diffMatchPatch",t)},unset:function(t){if(!Array.isArray(t))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=u({},this.operations,{unset:t}),this},setIfMissing:function(t){return this._assign("setIfMissing",t)},replace:function(t){return c("replace",t),this._set("set",{$:t})},inc:function(t){return this._assign("inc",t)},dec:function(t){return this._assign("dec",t)},insert:function(t,e,r){var i;return l(t,e,r),this._assign("insert",(i={},n(i,t,e),n(i,"items",r),i))},append:function(t,e){return this.insert("after",t+"[-1]",e)},prepend:function(t,e){return this.insert("before",t+"[0]",e)},splice:function(t,e,r,n){var i="undefined"==typeof r||r===-1,o=e<0?e-1:e,s=i?-1:Math.max(0,e+r),u=o<0&&s>=0?"":s,a=t+"["+o+":"+u+"]";return this.insert("replace",a,n||[])},serialize:function(){return u(o(this.selection),this.operations)},toJSON:function(){return this.serialize()},commit:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.client)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");var e="string"==typeof this.selection,r=u({returnFirst:e,returnDocuments:!0},t);return this.client.mutate({patch:this.serialize()},r)},reset:function(){return this.operations={},this},_set:function(t,e){return this._assign(t,e,!1)},_assign:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return c(t,e),this.operations=u({},this.operations,n({},t,u({},r&&this.operations[t]||{},e))),this}}),e.exports=i},{"../validators":18,"deep-assign":24,"xtend/mutable":50}],8:[function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];this.operations=t,this.client=e}var o=t("xtend/mutable"),s=t("../validators"),u=t("./patch"),a={returnDocuments:!1};o(i.prototype,{clone:function(){return new i(this.operations.slice(0),this.client)},create:function(t){return this._create(t,"create")},createIfNotExists:function(t){return this._create(t,"createIfNotExists")},createOrReplace:function(t){return this._create(t,"createOrReplace")},delete:function(t){return s.validateDocumentId("delete",t),this._add({delete:{id:t}})},patch:function t(e,r){var n="function"==typeof r,i=e instanceof u;if(i)return this._add({patch:e.serialize()});if(n){var t=r(new u(e,{},this.client));if(!(t instanceof u))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:t.serialize()})}return this._add({patch:o({id:e},r)})},serialize:function(){return this.operations.slice()},toJSON:function(){return this.serialize()},commit:function(t){if(!this.client)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.client.mutate(this.serialize(),t||a)},reset:function(){return this.operations=[],this},_create:function(t,e){if(!t._id&&!this.client)throw new Error('Document needs an _id property when transaction is create outside a client scope. Pass `{_id: "<datasetName>:"}` to have Sanity generate an ID for you.');s.validateObject(e,t);var r=s.hasDataset(this.client.clientConfig),i=n({},e,o({},t,{_id:t._id||r+"/"}));return this._add(i)},_add:function(t){return this.operations.push(t),this}}),e.exports=i},{"../validators":18,"./patch":7,"xtend/mutable":50}],9:[function(t,e,r){"use strict";function n(t){this.request=t.request.bind(t)}var i=t("xtend/mutable"),o=t("../validators");i(n.prototype,{create:function(t){return this._modify("PUT",t)},delete:function(t){return this._modify("DELETE",t)},list:function(){return this.request({uri:"/datasets"})},_modify:function(t,e){return o.dataset(e),this.request({method:t,uri:"/datasets/"+e})}}),e.exports=n},{"../validators":18,"xtend/mutable":50}],10:[function(t,e,r){"use strict";function n(t){var e=function(e,r){return"undefined"==typeof t[r]?e:e.concat(i(r)+"="+i(t[r]))};return Object.keys(t).reduce(e,[]).join("&")}var i=function(t){return encodeURIComponent(t)};r.stringify=n},{}],11:[function(t,e,r){"use strict";function n(t,e){if(t.error&&t.message)return new Error(t.error+" - "+t.message);if(t.error&&t.error.description){var r=new Error(t.error.description);return r.details=t.error,r}return new Error(t.error||t.message||o(e))}function i(t,e,r){t.responseBody=s(e,r),t.statusCode=r.statusCode}function o(t){var e=t.statusMessage?" "+t.statusMessage:"";return"Server responded with HTTP "+t.statusCode+e+", no description"}function s(t,e){var r=(e.headers["content-type"]||"").toLowerCase(),n=r.indexOf("application/json")!==-1;return n?JSON.stringify(t,null,2):t}var u=t("@sanity/request"),a=t("./queryString"),c=t("@sanity/observable/minimal"),l=t("xtend/mutable"),f="".indexOf("sanity")!==-1,h=function(){};e.exports=function(t){t.query&&(t.uri+="?"+a.stringify(t.query)),f&&(h("HTTP %s %s",t.method||"GET",t.uri),"POST"===t.method&&t.body&&h("Request body: %s",JSON.stringify(t.body,null,2)));var e=new c(function(e){function r(t){return function(r){var n=r.lengthComputable?r.loaded/r.total*100:-1;e.next({type:"progress",stage:t,percent:n})}}var a=l({},t,{beforeSend:function(n){t.beforeSend&&t.beforeSend(n),"upload"in n&&"onprogress"in n.upload&&(n.upload.onprogress=r("upload")),"onprogress"in n&&(n.onprogress=r("download")),n.onabort=function(){e.next({type:"abort"}),e.complete()}}}),c=u(a,function(t,r,u){if(t)return void e.error(t);h("Response code: %s",r.statusCode),f&&u&&h("Response body: %s",s(u,r));var a=r.statusCode>=400;if(a&&u){var c=n(u,r);return i(c,u,r),void e.error(c)}if(a){var l=new Error(o(r));return l.statusCode=r.statusCode,void e.error(l)}e.next({type:"response",body:u}),e.complete()});return function(){return c.abort()}});return e.toPromise=function(){var t=void 0;return e.forEach(function(e){t=e}).then(function(){return t.body})},e}},{"./queryString":10,"@sanity/observable/minimal":22,"@sanity/request":23,"xtend/mutable":50}],12:[function(t,e,r){"use strict";var n="Sanity-Token",i="Sanity-Project-ID";e.exports=function(t){var e={};return t.token&&(e[n]=t.token),!t.useProjectHostname&&t.projectId&&(e[i]=t.projectId),{headers:e,timeout:"timeout"in t?t.timeout:15e3,withCredentials:!0,json:!0}}},{}],13:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable");i(n.prototype,{list:function(){return this.client.request({uri:"/projects"})},getById:function(t){return this.client.request({uri:"/projects/"+t})}}),e.exports=n},{"xtend/mutable":50}],14:[function(t,e,r){"use strict";function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;this.config(t),this.assets=new h(this),this.datasets=new l(this),this.projects=new f(this),this.users=new p(this),this.auth=new d(this)}function i(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=e.reduce(function(t,e){return t||e.headers?s(t||{},e.headers||{}):null},null);return s.apply(void 0,e.concat([n?{headers:n}:{}]))}function o(t){return new n(t)}var s=t("xtend/mutable"),u=t("./data/patch"),a=t("./data/transaction"),c=t("./data/dataMethods"),l=t("./datasets/datasetsClient"),f=t("./projects/projectsClient"),h=t("./assets/assetsClient"),p=t("./users/usersClient"),d=t("./auth/authClient"),b=t("./http/request"),y=t("./http/requestOptions"),v=t("./config"),m=v.defaultConfig,g=v.initConfig;s(n.prototype,c),s(n.prototype,{config:function(t){return"undefined"==typeof t?this.clientConfig:(this.clientConfig=g(t,this.clientConfig||{}),this)},getUrl:function(t){return this.clientConfig.url+"/"+t.replace(/^\//,"")},request:function(t){return this.requestObservable(t).toPromise()},requestObservable:function(t){return b(i(y(this.clientConfig),t,{uri:this.getUrl(t.uri)}))}}),o.Patch=u,o.Transaction=a,e.exports=o},{"./assets/assetsClient":1,"./auth/authClient":2,"./config":3,"./data/dataMethods":4,"./data/patch":7,"./data/transaction":8,"./datasets/datasetsClient":9,"./http/request":11,"./http/requestOptions":12,"./projects/projectsClient":13,"./users/usersClient":15,"xtend/mutable":50}],15:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable");i(n.prototype,{getById:function(t){return this.client.request({uri:"/users/"+t})}}),e.exports=n},{"xtend/mutable":50}],16:[function(t,e,r){"use strict";e.exports=function(t,e){return Object.keys(e).concat(Object.keys(t)).reduce(function(r,n){return r[n]="undefined"==typeof t[n]?e[n]:t[n],r},{})}},{}],17:[function(t,e,r){"use strict";e.exports=function(t,e){return e.reduce(function(e,r){return"undefined"==typeof t[r]?e:(e[r]=t[r],e)},{})}},{}],18:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=["image","file"],o=["before","after","replace"];r.dataset=function(t){if(!/^[-\w]{1,128}$/.test(t))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes")},r.projectId=function(t){if(!/^[-a-z0-9]+$/i.test(t))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},r.validateAssetType=function(t){if(i.indexOf(t)===-1)throw new Error("Invalid asset type: "+t+". Must be one of "+i.join(", "))},r.validateObject=function(t,e){if(null===e||"object"!==("undefined"==typeof e?"undefined":n(e))||Array.isArray(e))throw new Error(t+"() takes an object of properties")},r.validateDocumentId=function(t,e){if("string"!=typeof e||!/^[-_a-z0-9]{1,128}\/[-_a-z0-9\/]+$/i.test(e))throw new Error(t+"() takes a document ID in format dataset/docId")},r.validateInsert=function(t,e,r){var n="insert(at, selector, items)";if(o.indexOf(t)===-1){var i=o.map(function(t){return'"'+t+'"'}).join(", ");throw new Error(n+' takes an "at"-argument which is one of: '+i)}if("string"!=typeof e)throw new Error(n+' takes a "selector"-argument which must be a string');if(!Array.isArray(r))throw new Error(n+' takes an "items"-argument which must be an array')},r.hasDataset=function(t){if(!t.dataset)throw new Error("`dataset` must be provided to perform queries");return t.dataset},r.promise={hasDataset:function(t){return new Promise(function(e){return e(r.hasDataset(t))})}}},{}],19:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t.length;r++)e(t[r])}function i(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function o(t,e,r){var n=t;return f(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=p(e,{uri:t}),n.callback=r,n}function s(t,e,r){return e=o(t,e,r),u(e)}function u(t){function e(){4===f.readyState&&o()}function r(){var t=void 0;if(t=f.response?f.response:f.responseText||a(f),_)try{t=JSON.parse(t)}catch(t){}return t}function n(t){return clearTimeout(b),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,c(t,l)}function o(){if(!d){var e;clearTimeout(b),e=t.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var n=l,i=null;return 0!==e?(n={body:r(),statusCode:e,method:v,headers:{},url:y,rawRequest:f},f.getAllResponseHeaders&&(n.headers=h(f.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),c(i,n,n.body)}}if("undefined"==typeof t.callback)throw new Error("callback argument missing");var u=!1,c=function(e,r,n){u||(u=!0,t.callback(e,r,n))},l={body:void 0,headers:{},statusCode:0,method:v,url:y,rawRequest:f},f=t.xhr||null;f||(f=t.cors||t.useXDR?new s.XDomainRequest:new s.XMLHttpRequest);var p,d,b,y=f.url=t.uri||t.url,v=f.method=t.method||"GET",m=t.body||t.data||null,g=f.headers=t.headers||{},w=!!t.sync,_=!1;if(t.json===!0&&(_=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),m=JSON.stringify(t.body))),f.onreadystatechange=e,f.onload=o,f.onerror=n,f.onprogress=function(){},f.ontimeout=n,f.open(v,y,!w,t.username,t.password),w||(f.withCredentials=!!t.withCredentials),!w&&t.timeout>0&&(b=setTimeout(function(){d=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)},t.timeout)),f.setRequestHeader)for(p in g)g.hasOwnProperty(p)&&f.setRequestHeader(p,g[p]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(m),f}function a(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function c(){}var l=t("global/window"),f=t("is-function"),h=t("parse-headers"),p=t("xtend");e.exports=s,s.XMLHttpRequest=l.XMLHttpRequest||c,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:l.XDomainRequest,n(["get","put","post","patch","head","delete"],function(t){s["delete"===t?"del":t]=function(e,r,n){return r=o(e,r,n),r.method=t.toUpperCase(),u(r)}})},{"global/window":27,"is-function":28,"parse-headers":30,xtend:49}],20:[function(t,e,r){e.exports=t("eventsource-polyfill/dist/eventsource")},{"eventsource-polyfill/dist/eventsource":25}],21:[function(t,e,r){"use strict";function n(){o.apply(this,arguments)}var i=t("rxjs/Observable"),o=i.Observable,s=t("rxjs/operator/map"),u=s.map,a=t("rxjs/operator/filter"),c=a.filter,l=t("rxjs/operator/reduce"),f=l.reduce;n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.map=u,n.prototype.filter=c,n.prototype.reduce=f,e.exports=n},{"rxjs/Observable":31,"rxjs/operator/filter":35,"rxjs/operator/map":36,"rxjs/operator/reduce":37}],22:[function(t,e,r){e.exports=t("./lib/SanityObservableMinimal")},{"./lib/SanityObservableMinimal":21}],23:[function(t,e,r){e.exports=t("@bjoerge/xhr")},{"@bjoerge/xhr":19}],24:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Sources cannot be null or undefined");return Object(t)}function i(t,e,r){var n=e[r];if(void 0!==n&&null!==n){if(u.call(t,r)&&(void 0===t[r]||null===t[r]))throw new TypeError("Cannot convert undefined or null to object ("+r+")");u.call(t,r)&&s(n)?t[r]=o(Object(t[r]),e[r]):t[r]=n}}function o(t,e){if(t===e)return t;e=Object(e);for(var r in e)u.call(e,r)&&i(t,e,r);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(e),o=0;o<n.length;o++)a.call(e,n[o])&&i(t,e,n[o]);return t}var s=t("is-obj"),u=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(t){t=n(t);for(var e=1;e<arguments.length;e++)o(t,arguments[e]);return t}},{"is-obj":29}],25:[function(t,e,r){!function(t){function e(t,e,r,n){this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.data=e||null,this.origin=r||"",this.lastEventId=n||"",this.type=t||"message"}function r(){return!(!window.XDomainRequest||!window.XMLHttpRequest||void 0!==(new XMLHttpRequest).responseType)}if(!t.EventSource||t._eventSourceImportPrefix){var n=(t._eventSourceImportPrefix||"")+"EventSource",i=function(t,e){if(!t||"string"!=typeof t)throw new SyntaxError("Not enough arguments");this.URL=t,this.setOptions(e);var r=this;setTimeout(function(){r.poll()},0)};if(i.prototype={CONNECTING:0,OPEN:1,CLOSED:2,defaultOptions:{loggingEnabled:!1,loggingPrefix:"eventsource",interval:500,bufferSizeLimit:262144,silentTimeout:3e5,getArgs:{evs_buffer_size_limit:262144},xhrHeaders:{Accept:"text/event-stream","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}},setOptions:function(t){var e,r=this.defaultOptions;for(e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);for(e in t)e in r&&t.hasOwnProperty(e)&&(this[e]=t[e]);this.getArgs&&this.bufferSizeLimit&&(this.getArgs.evs_buffer_size_limit=this.bufferSizeLimit),"undefined"!=typeof console&&"undefined"!=typeof console.log||(this.loggingEnabled=!1)},log:function(t){this.loggingEnabled&&console.log("["+this.loggingPrefix+"]:"+t)},poll:function(){try{if(this.readyState==this.CLOSED)return;this.cleanup(),this.readyState=this.CONNECTING,this.cursor=0,this.cache="",this._xhr=new this.XHR(this),this.resetNoActivityTimer()}catch(t){this.log("There were errors inside the pool try-catch"),this.dispatchEvent("error",{type:"error",data:t.message})}},pollAgain:function(t){var e=this;e.readyState=e.CONNECTING,e.dispatchEvent("error",{type:"error",data:"Reconnecting "}),this._pollTimer=setTimeout(function(){e.poll()},t||0)},cleanup:function(){this.log("evs cleaning up"),this._pollTimer&&(clearInterval(this._pollTimer),this._pollTimer=null),this._noActivityTimer&&(clearInterval(this._noActivityTimer),this._noActivityTimer=null),this._xhr&&(this._xhr.abort(),this._xhr=null)},resetNoActivityTimer:function(){if(this.silentTimeout){this._noActivityTimer&&clearInterval(this._noActivityTimer);var t=this;this._noActivityTimer=setTimeout(function(){t.log("Timeout! silentTImeout:"+t.silentTimeout),t.pollAgain()},this.silentTimeout)}},close:function(){this.readyState=this.CLOSED,this.log("Closing connection. readyState: "+this.readyState),this.cleanup()},ondata:function(){var t=this._xhr;if(t.isReady()&&!t.hasError()){this.resetNoActivityTimer(),this.readyState==this.CONNECTING&&(this.readyState=this.OPEN,this.dispatchEvent("open",{type:"open"}));var e=t.getBuffer();e.length>this.bufferSizeLimit&&(this.log("buffer.length > this.bufferSizeLimit"),this.pollAgain()),0==this.cursor&&e.length>0&&"\ufeff"==e.substring(0,1)&&(this.cursor=1);var r=this.lastMessageIndex(e);if(r[0]>=this.cursor){var n=r[1],i=e.substring(this.cursor,n);this.parseStream(i),this.cursor=n}t.isDone()&&(this.log("request.isDone(). reopening the connection"),this.pollAgain(this.interval))}else this.readyState!==this.CLOSED&&(this.log("this.readyState !== this.CLOSED"),this.pollAgain(this.interval))},parseStream:function(t){t=this.cache+this.normalizeToLF(t);var r,n,i,o,s,u,a=t.split("\n\n");for(r=0;r<a.length-1;r++){for(i="message",o=[],parts=a[r].split("\n"),n=0;n<parts.length;n++)s=this.trimWhiteSpace(parts[n]),0==s.indexOf("event")?i=s.replace(/event:?\s*/,""):0==s.indexOf("retry")?(u=parseInt(s.replace(/retry:?\s*/,"")),isNaN(u)||(this.interval=u)):0==s.indexOf("data")?o.push(s.replace(/data:?\s*/,"")):0==s.indexOf("id:")?this.lastEventId=s.replace(/id:?\s*/,""):0==s.indexOf("id")&&(this.lastEventId=null);if(o.length){var c=new e(i,o.join("\n"),window.location.origin,this.lastEventId);this.dispatchEvent(i,c)}}this.cache=a[a.length-1]},dispatchEvent:function(t,e){var r=this["_"+t+"Handlers"];if(r)for(var n=0;n<r.length;n++)r[n].call(this,e);this["on"+t]&&this["on"+t].call(this,e)},addEventListener:function(t,e){this["_"+t+"Handlers"]||(this["_"+t+"Handlers"]=[]),this["_"+t+"Handlers"].push(e)},removeEventListener:function(t,e){var r=this["_"+t+"Handlers"];if(r)for(var n=r.length-1;n>=0;--n)if(r[n]===e){r.splice(n,1);break}},_pollTimer:null,_noactivityTimer:null,_xhr:null,lastEventId:null,cache:"",cursor:0,onerror:null,onmessage:null,onopen:null,readyState:0,urlWithParams:function(t,e){var r=[];if(e){var n,i,o=encodeURIComponent;for(n in e)e.hasOwnProperty(n)&&(i=o(n)+"="+o(e[n]),r.push(i))}return r.length>0?t.indexOf("?")==-1?t+"?"+r.join("&"):t+"&"+r.join("&"):t},lastMessageIndex:function(t){var e=t.lastIndexOf("\n\n"),r=t.lastIndexOf("\r\r"),n=t.lastIndexOf("\r\n\r\n");return n>Math.max(e,r)?[n,n+4]:[Math.max(e,r),Math.max(e,r)+2]},trimWhiteSpace:function(t){var e=/^(\s|\u00A0)+|(\s|\u00A0)+$/g;return t.replace(e,"")},normalizeToLF:function(t){return t.replace(/\r\n|\r/g,"\n")}},r()){i.isPolyfill="IE_8-9";var o=i.prototype.defaultOptions;o.xhrHeaders=null,o.getArgs.evs_preamble=2056,i.prototype.XHR=function(t){request=new XDomainRequest,this._request=request,request.onprogress=function(){request._ready=!0,t.ondata()},request.onload=function(){this._loaded=!0,t.ondata()},request.onerror=function(){this._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"XDomainRequest error"})},request.ontimeout=function(){this._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"XDomainRequest timed out"})};var e={};if(t.getArgs){var r=t.getArgs;for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);t.lastEventId&&(e.evs_last_event_id=t.lastEventId)}request.open("GET",t.urlWithParams(t.URL,e)),request.send()},i.prototype.XHR.prototype={useXDomainRequest:!0,_request:null,_ready:!1,_loaded:!1,_failed:!1,isReady:function(){return this._request._ready},isDone:function(){return this._request._loaded},hasError:function(){return this._request._failed},getBuffer:function(){var t="";try{t=this._request.responseText||""}catch(t){}return t},abort:function(){this._request&&this._request.abort()}}}else i.isPolyfill="XHR",i.prototype.XHR=function(t){request=new XMLHttpRequest,this._request=request,t._xhr=this,request.onreadystatechange=function(){request.readyState>1&&t.readyState!=t.CLOSED&&(200==request.status||request.status>=300&&request.status<400?t.ondata():(request._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"The server responded with "+request.status}),t.close()))},request.onprogress=function(){},request.open("GET",t.urlWithParams(t.URL,t.getArgs),!0);var e=t.xhrHeaders;for(var r in e)e.hasOwnProperty(r)&&request.setRequestHeader(r,e[r]);t.lastEventId&&request.setRequestHeader("Last-Event-Id",t.lastEventId),request.send()},i.prototype.XHR.prototype={useXDomainRequest:!1,_request:null,_failed:!1,isReady:function(){return this._request.readyState>=2},isDone:function(){return 4==this._request.readyState},hasError:function(){return this._failed||this._request.status>=400},getBuffer:function(){var t="";try{t=this._request.responseText||""}catch(t){}return t},abort:function(){this._request&&this._request.abort()}};t[n]=i}}(this)},{}],26:[function(t,e,r){function n(t,e,r){if(!u(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===a.call(t)?i(t,e,r):"string"==typeof t?o(t,e,r):s(t,e,r)}function i(t,e,r){for(var n=0,i=t.length;n<i;n++)c.call(t,n)&&e.call(r,t[n],n,t)}function o(t,e,r){for(var n=0,i=t.length;n<i;n++)e.call(r,t.charAt(n),n,t)}function s(t,e,r){for(var n in t)c.call(t,n)&&e.call(r,t[n],n,t)}var u=t("is-function");e.exports=n;var a=Object.prototype.toString,c=Object.prototype.hasOwnProperty},{"is-function":28}],27:[function(t,e,r){(function(t){"undefined"!=typeof window?e.exports=window:"undefined"!=typeof t?e.exports=t:"undefined"!=typeof self?e.exports=self:e.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(t,e,r){function n(t){var e=i.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}e.exports=n;var i=Object.prototype.toString},{}],29:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],30:[function(t,e,r){var n=t("trim"),i=t("for-each"),o=function(t){return"[object Array]"===Object.prototype.toString.call(t)};e.exports=function(t){if(!t)return{};var e={};return i(n(t).split("\n"),function(t){var r=t.indexOf(":"),i=n(t.slice(0,r)).toLowerCase(),s=n(t.slice(r+1));"undefined"==typeof e[i]?e[i]=s:o(e[i])?e[i].push(s):e[i]=[e[i],s]}),e}},{"for-each":26,trim:48}],31:[function(t,e,r){"use strict";var n=t("./util/root"),i=t("./util/toSubscriber"),o=t("./symbol/observable"),s=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,o=i.toSubscriber(t,e,r);if(n?n.call(o,this):o.add(this._subscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype.forEach=function(t,e){var r=this;if(e||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?e=n.root.Rx.config.Promise:n.root.Promise&&(e=n.root.Promise)),
!e)throw new Error("no Promise impl found");return new e(function(e,n){var i=r.subscribe(function(e){if(i)try{t(e)}catch(t){n(t),i.unsubscribe()}else t(e)},n,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[o.$$observable]=function(){return this},t.create=function(e){return new t(e)},t}();r.Observable=s},{"./symbol/observable":38,"./util/root":45,"./util/toSubscriber":46}],32:[function(t,e,r){"use strict";r.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},{}],33:[function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=t("./util/isFunction"),o=t("./Subscription"),s=t("./Observer"),u=t("./symbol/rxSubscriber"),a=function(t){function e(r,n,i){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.empty;break;case 1:if(!r){this.destination=s.empty;break}if("object"==typeof r){r instanceof e?(this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,r,n,i)}}return n(e,t),e.prototype[u.$$rxSubscriber]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e}(o.Subscription);r.Subscriber=a;var c=function(t){function e(e,r,n,o){t.call(this),this._parent=e;var s,u=this;i.isFunction(r)?s=r:r&&(u=r,s=r.next,n=r.error,o=r.complete,i.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this)),this._context=u,this._next=s,this._error=n,this._complete=o}return n(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parent;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parent;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){if(!this.isStopped){var t=this._parent;this._complete?t.syncErrorThrowable?(this.__tryOrSetError(t,this._complete),this.unsubscribe()):(this.__tryOrUnsub(this._complete),this.unsubscribe()):this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parent;this._context=null,this._parent=null,t.unsubscribe()},e}(a)},{"./Observer":32,"./Subscription":34,"./symbol/rxSubscriber":39,"./util/isFunction":43}],34:[function(t,e,r){"use strict";var n=t("./util/isArray"),i=t("./util/isObject"),o=t("./util/isFunction"),s=t("./util/tryCatch"),u=t("./util/errorObject"),a=t("./util/UnsubscriptionError"),c=function(){function t(t){this.closed=!1,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){this.closed=!0;var r=this,c=r._unsubscribe,l=r._subscriptions;if(this._subscriptions=null,o.isFunction(c)){var f=s.tryCatch(c).call(this);f===u.errorObject&&(e=!0,(t=t||[]).push(u.errorObject.e))}if(n.isArray(l))for(var h=-1,p=l.length;++h<p;){var d=l[h];if(i.isObject(d)){var f=s.tryCatch(d.unsubscribe).call(d);if(f===u.errorObject){e=!0,t=t||[];var b=u.errorObject.e;b instanceof a.UnsubscriptionError?t=t.concat(b.errors):t.push(b)}}}if(e)throw new a.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)break;this.closed?r.unsubscribe():(this._subscriptions||(this._subscriptions=[])).push(r);break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return r},t.prototype.remove=function(e){if(null!=e&&e!==this&&e!==t.EMPTY){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();r.Subscription=c},{"./util/UnsubscriptionError":40,"./util/errorObject":41,"./util/isArray":42,"./util/isFunction":43,"./util/isObject":44,"./util/tryCatch":47}],35:[function(t,e,r){"use strict";function n(t,e){return this.lift(new s(t,e))}var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("../Subscriber");r.filter=n;var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e._subscribe(new u(t,this.predicate,this.thisArg))},t}(),u=function(t){function e(e,r,n){t.call(this,e),this.predicate=r,this.thisArg=n,this.count=0,this.predicate=r}return i(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(o.Subscriber)},{"../Subscriber":33}],36:[function(t,e,r){"use strict";function n(t,e){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new s(t,e))}var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("../Subscriber");r.map=n;var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e._subscribe(new u(t,this.project,this.thisArg))},t}();r.MapOperator=s;var u=function(t){function e(e,r,n){t.call(this,e),this.project=r,this.count=0,this.thisArg=n||this}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.Subscriber)},{"../Subscriber":33}],37:[function(t,e,r){"use strict";function n(t,e){var r=!1;return arguments.length>=2&&(r=!0),this.lift(new s(t,e,r))}var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("../Subscriber");r.reduce=n;var s=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e._subscribe(new u(t,this.accumulator,this.seed,this.hasSeed))},t}();r.ReduceOperator=s;var u=function(t){function e(e,r,n,i){t.call(this,e),this.accumulator=r,this.hasSeed=i,this.hasValue=!1,this.acc=n}return i(e,t),e.prototype._next=function(t){this.hasValue||(this.hasValue=this.hasSeed)?this._tryReduce(t):(this.acc=t,this.hasValue=!0)},e.prototype._tryReduce=function(t){var e;try{e=this.accumulator(this.acc,t)}catch(t){return void this.destination.error(t)}this.acc=e},e.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc),this.destination.complete()},e}(o.Subscriber);r.ReduceSubscriber=u},{"../Subscriber":33}],38:[function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}var i=t("../util/root");r.getSymbolObservable=n,r.$$observable=n(i.root)},{"../util/root":45}],39:[function(t,e,r){"use strict";var n=t("../util/root"),i=n.root.Symbol;r.$$rxSubscriber="function"==typeof i&&"function"==typeof i.for?i.for("rxSubscriber"):"@@rxSubscriber"},{"../util/root":45}],40:[function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=function(t){function e(e){t.call(this),this.errors=e;var r=Error.call(this,e?e.length+" errors occurred during unsubscription:\n "+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return n(e,t),e}(Error);r.UnsubscriptionError=i},{}],41:[function(t,e,r){"use strict";r.errorObject={e:{}}},{}],42:[function(t,e,r){"use strict";r.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},{}],43:[function(t,e,r){"use strict";function n(t){return"function"==typeof t}r.isFunction=n},{}],44:[function(t,e,r){"use strict";function n(t){return null!=t&&"object"==typeof t}r.isObject=n},{}],45:[function(t,e,r){(function(t){"use strict";if(r.root="object"==typeof window&&window.window===window&&window||"object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t,!r.root)throw new Error("RxJS could not find any global context (window, self, global)")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(t,e,r){"use strict";function n(t,e,r){if(t){if(t instanceof i.Subscriber)return t;if(t[o.$$rxSubscriber])return t[o.$$rxSubscriber]()}return t||e||r?new i.Subscriber(t,e,r):new i.Subscriber(s.empty)}var i=t("../Subscriber"),o=t("../symbol/rxSubscriber"),s=t("../Observer");r.toSubscriber=n},{"../Observer":32,"../Subscriber":33,"../symbol/rxSubscriber":39}],47:[function(t,e,r){"use strict";function n(){try{return o.apply(this,arguments)}catch(t){return s.errorObject.e=t,s.errorObject}}function i(t){return o=t,n}var o,s=t("./errorObject");r.tryCatch=i},{"./errorObject":41}],48:[function(t,e,r){function n(t){return t.replace(/^\s*|\s*$/g,"")}r=e.exports=n,r.left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],49:[function(t,e,r){function n(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)i.call(r,n)&&(t[n]=r[n])}return t}e.exports=n;var i=Object.prototype.hasOwnProperty},{}],50:[function(t,e,r){function n(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)i.call(r,n)&&(t[n]=r[n])}return t}e.exports=n;var i=Object.prototype.hasOwnProperty},{}]},{},[14])(14)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.SanityClient=t()}}(function(){return function t(e,r,n){function i(s,u){if(!r[s]){if(!e[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};e[s][0].call(f.exports,function(t){var r=e[s][1][t];return i(r?r:t)},f,f.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable"),o=t("../validators"),s={image:"images",file:"files"};i(n.prototype,{upload:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.validateAssetType(t);var n=o.hasDataset(this.client.clientConfig),u="contentType"in r?{"Content-Type":r.contentType}:{},a=s[t],c=r.label?"?label="+encodeURIComponent(r.label):"",f="/assets/"+a+"/"+n+c;return this.client.requestObservable({method:"POST",headers:i({Accept:"application/json"},u),uri:f,body:e,json:!1,timeout:0}).map(function(t){return"response"!==t.type?t:i({},t,{body:JSON.parse(t.body)})})}}),e.exports=n},{"../validators":18,"xtend/mutable":51}],2:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable");i(n.prototype,{getLoginProviders:function(){return this.client.request({uri:"/auth/providers"})},logout:function(){return this.client.request({uri:"/auth/logout"})}}),e.exports=n},{"xtend/mutable":51}],3:[function(t,e,r){"use strict";var n=t("xtend/mutable"),i=t("./validators"),o=r.defaultConfig={apiHost:"https://api.sanity.io",useProjectHostname:!0};r.initConfig=function(t,e){var r=n({},o,e,t),s=r.useProjectHostname;if("undefined"==typeof Promise)throw new Error("No native `Promise`-implementation found, polyfill needed");if(s&&!r.projectId)throw new Error("Configuration must contain `projectId`");s&&i.projectId(r.projectId),r.dataset&&i.dataset(r.dataset);var u=r.apiHost.split("://",2),a=u[0],c=u[1];return r.useProjectHostname?r.url=a+"://"+r.projectId+"."+c+"/v1":r.url=r.apiHost+"/v1",r}},{"./validators":18,"xtend/mutable":51}],4:[function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=t("xtend/mutable"),o=t("../validators"),s=t("./encodeQueryString"),u=t("./transaction"),a=t("./patch"),c=t("./listen"),f=function(t,e){var r="undefined"==typeof t?e:t;return t===!1?void 0:r},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{returnIds:!0,returnDocuments:f(t.returnDocuments,!0),visibility:t.visibility||"sync"}},h=1948;e.exports={listen:c,fetch:function(t,e){return this.dataRequest("query",{query:t,params:e}).then(function(t){return t.result||[]})},getDocument:function(t){return this.request({uri:"/data/doc/"+t,json:!0}).then(function(t){return t.documents&&t.documents[0]})},create:function(t,e){return this._create(t,"create",e)},createIfNotExists:function(t,e){return this._create(t,"createIfNotExists",e)},createOrReplace:function(t,e){return this._create(t,"createOrReplace",e)},patch:function(t,e){return new a(t,e,this)},delete:function(t,e){return o.validateDocumentId("delete",t),this.dataRequest("mutate",{mutations:[{delete:{id:t}}]},e)},mutate:function(t,e){var r=t instanceof a?t.serialize():t,n=Array.isArray(r)?r:[r];return this.dataRequest("mutate",{mutations:n},e)},transaction:function(t){return new u(t,this)},dataRequest:function(t,e){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u="mutate"===t,a=!u&&s(e),c=!u&&a.length<h,f=c?a:"",p=i.returnFirst;return o.promise.hasDataset(this.clientConfig).then(function(n){return r.request({method:c?"GET":"POST",uri:"/data/"+t+"/"+n+f,json:!0,body:c?void 0:e,query:u&&l(i)})}).then(function(t){if(!u)return t;var e=t.results||[];if(i.returnDocuments)return p?e[0]&&e[0].document:e.map(function(t){return t.document});var r=p?"documentId":"documentIds",o=p?e[0]&&e[0].id:e.map(function(t){return t.id});return n({transactionId:t.transactionId},r,o)})},_create:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o.hasDataset(this.clientConfig),u=n({},e,i({},t,{_id:t._id||s+"/"})),a=i({returnFirst:!0,returnDocuments:!0},r);return this.dataRequest("mutate",{mutations:[u]},a)}}},{"../validators":18,"./encodeQueryString":5,"./listen":6,"./patch":7,"./transaction":8,"xtend/mutable":51}],5:[function(t,e,r){"use strict";var n=encodeURIComponent;e.exports=function(t){var e=t.query,r=t.params,i=void 0===r?{}:r,o=t.options,s=void 0===o?{}:o,u=Object.keys(i).reduce(function(t,e){return t+"&"+n("$"+e)+"="+n(JSON.stringify(i[e]))},"?query="+n(e));return Object.keys(s).reduce(function(t,e){return s[e]?t+"&"+n(e)+"="+n(s[e]):t},u)}},{}],6:[function(t,e,r){"use strict";function n(t){try{var e=t.data&&JSON.parse(t.data)||{};return o({type:t.type},e)}catch(t){return t}}function i(t){if(t instanceof Error)return t;var e=n(t);return e instanceof Error?e:new Error(e.error||e.message||"Unknown listener error")}var o=t("xtend/mutable"),s=t("@sanity/observable/minimal"),u=t("./encodeQueryString"),a=t("../validators"),c=t("../util/pick"),f=t("../util/defaults"),l="undefined"!=typeof window&&window.EventSource?window.EventSource:t("@sanity/eventsource"),h=function(t,e,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.removeListener(e,r)},p=["includePreviousRevision","includeResult"],d={includeResult:!0};e.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},b=f(r,d),y=c(b,p),v=u({query:t,params:e,options:y}),m=a.hasDataset(this.clientConfig),g=this.getUrl("/data/listen/"+m+v),w=this.clientConfig.token,_=b.events?b.events:["mutation"],x=_.indexOf("reconnect")!==-1,E=new l(g,o({withCredentials:!0},w?{headers:{"Sanity-Token":w}}:{}));return new s(function(t){function e(){E.readyState===l.CLOSED?t.complete():E.readyState===l.CONNECTING&&a()}function r(e){t.error(i(e))}function o(e){var r=n(e);return r instanceof Error?t.error(r):t.next(r)}function s(e){t.complete(),u()}function u(){_.forEach(function(t){return h(E,t,o)}),h(E,"error",e),h(E,"channelError",r),h(E,"disconnect",s),E.close()}function a(){x&&t.next({type:"reconnect"})}return E.addEventListener("error",e,!1),E.addEventListener("channelError",r,!1),E.addEventListener("disconnect",s,!1),_.forEach(function(t){return E.addEventListener(t,o,!1)}),u})}},{"../util/defaults":16,"../util/pick":17,"../validators":18,"./encodeQueryString":5,"@sanity/eventsource":20,"@sanity/observable/minimal":22,"xtend/mutable":51}],7:[function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.selection=t,this.operations=u({},e),this.client=r}function o(t){if("string"==typeof t||Array.isArray(t))return{id:t};if(t&&t.query)return{query:t.query};var e=["* Dataset-prefixed document ID (<dataset/docId>)","* Array of dataset-prefixed document IDs","* Object containing `query`"].join("\n");throw new Error("Unknown selection for patch - must be one of:\n\n"+e)}var s=t("deep-assign"),u=t("xtend/mutable"),a=t("../validators"),c=a.validateObject,f=a.validateInsert;u(i.prototype,{clone:function(){return new i(this.selection,u({},this.operations),this.client)},merge:function(t){return c("merge",t),this._assign("merge",s(this.operations.merge||{},t))},set:function(t){return this._assign("set",t)},diffMatchPatch:function(t){return c("diffMatchPatch",t),this._assign("diffMatchPatch",t)},unset:function(t){if(!Array.isArray(t))throw new Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=u({},this.operations,{unset:t}),this},setIfMissing:function(t){return this._assign("setIfMissing",t)},replace:function(t){return c("replace",t),this._set("set",{$:t})},inc:function(t){return this._assign("inc",t)},dec:function(t){return this._assign("dec",t)},insert:function(t,e,r){var i;return f(t,e,r),this._assign("insert",(i={},n(i,t,e),n(i,"items",r),i))},append:function(t,e){return this.insert("after",t+"[-1]",e)},prepend:function(t,e){return this.insert("before",t+"[0]",e)},splice:function(t,e,r,n){var i="undefined"==typeof r||r===-1,o=e<0?e-1:e,s=i?-1:Math.max(0,e+r),u=o<0&&s>=0?"":s,a=t+"["+o+":"+u+"]";return this.insert("replace",a,n||[])},serialize:function(){return u(o(this.selection),this.operations)},toJSON:function(){return this.serialize()},commit:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.client)throw new Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");var e="string"==typeof this.selection,r=u({returnFirst:e,returnDocuments:!0},t);return this.client.mutate({patch:this.serialize()},r)},reset:function(){return this.operations={},this},_set:function(t,e){return this._assign(t,e,!1)},_assign:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return c(t,e),this.operations=u({},this.operations,n({},t,u({},r&&this.operations[t]||{},e))),this}}),e.exports=i},{"../validators":18,"deep-assign":24,"xtend/mutable":51}],8:[function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];this.operations=t,this.client=e}var o=t("xtend/mutable"),s=t("../validators"),u=t("./patch"),a={returnDocuments:!1};o(i.prototype,{clone:function(){return new i(this.operations.slice(0),this.client)},create:function(t){return this._create(t,"create")},createIfNotExists:function(t){return this._create(t,"createIfNotExists")},createOrReplace:function(t){return this._create(t,"createOrReplace")},delete:function(t){return s.validateDocumentId("delete",t),this._add({delete:{id:t}})},patch:function t(e,r){var n="function"==typeof r,i=e instanceof u;if(i)return this._add({patch:e.serialize()});if(n){var t=r(new u(e,{},this.client));if(!(t instanceof u))throw new Error("function passed to `patch()` must return the patch");return this._add({patch:t.serialize()})}return this._add({patch:o({id:e},r)})},serialize:function(){return this.operations.slice()},toJSON:function(){return this.serialize()},commit:function(t){if(!this.client)throw new Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.client.mutate(this.serialize(),t||a)},reset:function(){return this.operations=[],this},_create:function(t,e){if(!t._id&&!this.client)throw new Error('Document needs an _id property when transaction is create outside a client scope. Pass `{_id: "<datasetName>:"}` to have Sanity generate an ID for you.');s.validateObject(e,t);var r=s.hasDataset(this.client.clientConfig),i=n({},e,o({},t,{_id:t._id||r+"/"}));return this._add(i)},_add:function(t){return this.operations.push(t),this}}),e.exports=i},{"../validators":18,"./patch":7,"xtend/mutable":51}],9:[function(t,e,r){"use strict";function n(t){this.request=t.request.bind(t)}var i=t("xtend/mutable"),o=t("../validators");i(n.prototype,{create:function(t){return this._modify("PUT",t)},delete:function(t){return this._modify("DELETE",t)},list:function(){return this.request({uri:"/datasets"})},_modify:function(t,e){return o.dataset(e),this.request({method:t,uri:"/datasets/"+e})}}),e.exports=n},{"../validators":18,"xtend/mutable":51}],10:[function(t,e,r){"use strict";function n(t){var e=function(e,r){return"undefined"==typeof t[r]?e:e.concat(i(r)+"="+i(t[r]))};return Object.keys(t).reduce(e,[]).join("&")}var i=function(t){return encodeURIComponent(t)};r.stringify=n},{}],11:[function(t,e,r){"use strict";function n(t,e){if(t.error&&t.message)return new Error(t.error+" - "+t.message);if(t.error&&t.error.description){var r=new Error(t.error.description);return r.details=t.error,r}return new Error(t.error||t.message||o(e))}function i(t,e,r){t.responseBody=s(e,r),t.statusCode=r.statusCode}function o(t){var e=t.statusMessage?" "+t.statusMessage:"";return"Server responded with HTTP "+t.statusCode+e+", no description"}function s(t,e){var r=(e.headers["content-type"]||"").toLowerCase(),n=r.indexOf("application/json")!==-1;return n?JSON.stringify(t,null,2):t}var u=t("@sanity/request"),a=t("./queryString"),c=t("@sanity/observable/minimal"),f=t("xtend/mutable"),l="".indexOf("sanity")!==-1,h=function(){};e.exports=function(t){t.query&&(t.uri+="?"+a.stringify(t.query)),l&&(h("HTTP %s %s",t.method||"GET",t.uri),"POST"===t.method&&t.body&&h("Request body: %s",JSON.stringify(t.body,null,2)));var e=new c(function(e){function r(t){return function(r){var n=r.lengthComputable?r.loaded/r.total*100:-1;e.next({type:"progress",stage:t,percent:n})}}var a=f({},t,{beforeSend:function(n){t.beforeSend&&t.beforeSend(n),"upload"in n&&"onprogress"in n.upload&&(n.upload.onprogress=r("upload")),"onprogress"in n&&(n.onprogress=r("download")),n.onabort=function(){e.next({type:"abort"}),e.complete()}}}),c=u(a,function(t,r,u){if(t)return void e.error(t);h("Response code: %s",r.statusCode),l&&u&&h("Response body: %s",s(u,r));var a=r.statusCode>=400;if(a&&u){var c=n(u,r);return i(c,u,r),void e.error(c)}if(a){var f=new Error(o(r));return f.statusCode=r.statusCode,void e.error(f)}e.next({type:"response",body:u}),e.complete()});return function(){return c.abort()}});return e.toPromise=function(){var t=void 0;return e.forEach(function(e){t=e}).then(function(){return t.body})},e}},{"./queryString":10,"@sanity/observable/minimal":22,"@sanity/request":23,"xtend/mutable":51}],12:[function(t,e,r){"use strict";var n="Sanity-Token",i="Sanity-Project-ID";e.exports=function(t){var e={};return t.token&&(e[n]=t.token),!t.useProjectHostname&&t.projectId&&(e[i]=t.projectId),{headers:e,timeout:"timeout"in t?t.timeout:15e3,withCredentials:!0,json:!0}}},{}],13:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable");i(n.prototype,{list:function(){return this.client.request({uri:"/projects"})},getById:function(t){return this.client.request({uri:"/projects/"+t})}}),e.exports=n},{"xtend/mutable":51}],14:[function(t,e,r){"use strict";function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;this.config(t),this.assets=new h(this),this.datasets=new f(this),this.projects=new l(this),this.users=new p(this),this.auth=new d(this)}function i(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=e.reduce(function(t,e){return t||e.headers?s(t||{},e.headers||{}):null},null);return s.apply(void 0,e.concat([n?{headers:n}:{}]))}function o(t){return new n(t)}var s=t("xtend/mutable"),u=t("./data/patch"),a=t("./data/transaction"),c=t("./data/dataMethods"),f=t("./datasets/datasetsClient"),l=t("./projects/projectsClient"),h=t("./assets/assetsClient"),p=t("./users/usersClient"),d=t("./auth/authClient"),b=t("./http/request"),y=t("./http/requestOptions"),v=t("./config"),m=v.defaultConfig,g=v.initConfig;s(n.prototype,c),s(n.prototype,{config:function(t){return"undefined"==typeof t?this.clientConfig:(this.clientConfig=g(t,this.clientConfig||{}),this)},getUrl:function(t){return this.clientConfig.url+"/"+t.replace(/^\//,"")},request:function(t){return this.requestObservable(t).toPromise()},requestObservable:function(t){return b(i(y(this.clientConfig),t,{uri:this.getUrl(t.uri)}))}}),o.Patch=u,o.Transaction=a,e.exports=o},{"./assets/assetsClient":1,"./auth/authClient":2,"./config":3,"./data/dataMethods":4,"./data/patch":7,"./data/transaction":8,"./datasets/datasetsClient":9,"./http/request":11,"./http/requestOptions":12,"./projects/projectsClient":13,"./users/usersClient":15,"xtend/mutable":51}],15:[function(t,e,r){"use strict";function n(t){this.client=t}var i=t("xtend/mutable");i(n.prototype,{getById:function(t){return this.client.request({uri:"/users/"+t})}}),e.exports=n},{"xtend/mutable":51}],16:[function(t,e,r){"use strict";e.exports=function(t,e){return Object.keys(e).concat(Object.keys(t)).reduce(function(r,n){return r[n]="undefined"==typeof t[n]?e[n]:t[n],r},{})}},{}],17:[function(t,e,r){"use strict";e.exports=function(t,e){return e.reduce(function(e,r){return"undefined"==typeof t[r]?e:(e[r]=t[r],e)},{})}},{}],18:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=["image","file"],o=["before","after","replace"];r.dataset=function(t){if(!/^[-\w]{1,128}$/.test(t))throw new Error("Datasets can only contain lowercase characters, numbers, underscores and dashes")},r.projectId=function(t){if(!/^[-a-z0-9]+$/i.test(t))throw new Error("`projectId` can only contain only a-z, 0-9 and dashes")},r.validateAssetType=function(t){if(i.indexOf(t)===-1)throw new Error("Invalid asset type: "+t+". Must be one of "+i.join(", "))},r.validateObject=function(t,e){if(null===e||"object"!==("undefined"==typeof e?"undefined":n(e))||Array.isArray(e))throw new Error(t+"() takes an object of properties")},r.validateDocumentId=function(t,e){if("string"!=typeof e||!/^[-_a-z0-9]{1,128}\/[-_a-z0-9\/]+$/i.test(e))throw new Error(t+"() takes a document ID in format dataset/docId")},r.validateInsert=function(t,e,r){var n="insert(at, selector, items)";if(o.indexOf(t)===-1){var i=o.map(function(t){return'"'+t+'"'}).join(", ");throw new Error(n+' takes an "at"-argument which is one of: '+i)}if("string"!=typeof e)throw new Error(n+' takes a "selector"-argument which must be a string');if(!Array.isArray(r))throw new Error(n+' takes an "items"-argument which must be an array')},r.hasDataset=function(t){if(!t.dataset)throw new Error("`dataset` must be provided to perform queries");return t.dataset},r.promise={hasDataset:function(t){return new Promise(function(e){return e(r.hasDataset(t))})}}},{}],19:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t.length;r++)e(t[r])}function i(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function o(t,e,r){var n=t;return l(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=p(e,{uri:t}),n.callback=r,n}function s(t,e,r){return e=o(t,e,r),u(e)}function u(t){function e(){4===l.readyState&&o()}function r(){var t=void 0;if(t=l.response?l.response:l.responseText||a(l),_)try{t=JSON.parse(t)}catch(t){}return t}function n(t){return clearTimeout(b),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,c(t,f)}function o(){if(!d){var e;clearTimeout(b),e=t.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var n=f,i=null;return 0!==e?(n={body:r(),statusCode:e,method:v,headers:{},url:y,rawRequest:l},l.getAllResponseHeaders&&(n.headers=h(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),c(i,n,n.body)}}if("undefined"==typeof t.callback)throw new Error("callback argument missing");var u=!1,c=function(e,r,n){u||(u=!0,t.callback(e,r,n))},f={body:void 0,headers:{},statusCode:0,method:v,url:y,rawRequest:l},l=t.xhr||null;l||(l=t.cors||t.useXDR?new s.XDomainRequest:new s.XMLHttpRequest);var p,d,b,y=l.url=t.uri||t.url,v=l.method=t.method||"GET",m=t.body||t.data||null,g=l.headers=t.headers||{},w=!!t.sync,_=!1;if(t.json===!0&&(_=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),m=JSON.stringify(t.body))),l.onreadystatechange=e,l.onload=o,l.onerror=n,l.onprogress=function(){},l.ontimeout=n,l.open(v,y,!w,t.username,t.password),w||(l.withCredentials=!!t.withCredentials),!w&&t.timeout>0&&(b=setTimeout(function(){d=!0,l.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",n(t)},t.timeout)),l.setRequestHeader)for(p in g)g.hasOwnProperty(p)&&l.setRequestHeader(p,g[p]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(l),l.send(m),l}function a(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;return""!==t.responseType||e?null:t.responseXML}function c(){}var f=t("global/window"),l=t("is-function"),h=t("parse-headers"),p=t("xtend");e.exports=s,s.XMLHttpRequest=f.XMLHttpRequest||c,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:f.XDomainRequest,n(["get","put","post","patch","head","delete"],function(t){s["delete"===t?"del":t]=function(e,r,n){return r=o(e,r,n),r.method=t.toUpperCase(),u(r)}})},{"global/window":27,"is-function":28,"parse-headers":30,xtend:50}],20:[function(t,e,r){e.exports=t("eventsource-polyfill/dist/eventsource")},{"eventsource-polyfill/dist/eventsource":25}],21:[function(t,e,r){"use strict";function n(){o.apply(this,arguments)}var i=t("rxjs/Observable"),o=i.Observable,s=t("rxjs/operator/map"),u=s.map,a=t("rxjs/operator/filter"),c=a.filter,f=t("rxjs/operator/reduce"),l=f.reduce,h=t("rxjs/operator/toPromise"),p=h.toPromise;n.prototype=Object.create(o.prototype),Object.defineProperty(n.prototype,"constructor",{value:n,enumerable:!1,writable:!0,configurable:!0}),n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.map=u,n.prototype.filter=c,n.prototype.reduce=l,n.prototype.toPromise=p,e.exports=n},{"rxjs/Observable":31,"rxjs/operator/filter":35,"rxjs/operator/map":36,"rxjs/operator/reduce":37,"rxjs/operator/toPromise":38}],22:[function(t,e,r){e.exports=t("./lib/SanityObservableMinimal")},{"./lib/SanityObservableMinimal":21}],23:[function(t,e,r){e.exports=t("@bjoerge/xhr")},{"@bjoerge/xhr":19}],24:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Sources cannot be null or undefined");return Object(t)}function i(t,e,r){var n=e[r];if(void 0!==n&&null!==n){if(u.call(t,r)&&(void 0===t[r]||null===t[r]))throw new TypeError("Cannot convert undefined or null to object ("+r+")");u.call(t,r)&&s(n)?t[r]=o(Object(t[r]),e[r]):t[r]=n}}function o(t,e){if(t===e)return t;e=Object(e);for(var r in e)u.call(e,r)&&i(t,e,r);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(e),o=0;o<n.length;o++)a.call(e,n[o])&&i(t,e,n[o]);return t}var s=t("is-obj"),u=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(t){t=n(t);for(var e=1;e<arguments.length;e++)o(t,arguments[e]);return t}},{"is-obj":29}],25:[function(t,e,r){!function(t){function e(t,e,r,n){this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.data=e||null,this.origin=r||"",this.lastEventId=n||"",this.type=t||"message"}function r(){return!(!window.XDomainRequest||!window.XMLHttpRequest||void 0!==(new XMLHttpRequest).responseType)}if(!t.EventSource||t._eventSourceImportPrefix){var n=(t._eventSourceImportPrefix||"")+"EventSource",i=function(t,e){if(!t||"string"!=typeof t)throw new SyntaxError("Not enough arguments");this.URL=t,this.setOptions(e);var r=this;setTimeout(function(){r.poll()},0)};if(i.prototype={CONNECTING:0,OPEN:1,CLOSED:2,defaultOptions:{loggingEnabled:!1,loggingPrefix:"eventsource",interval:500,bufferSizeLimit:262144,silentTimeout:3e5,getArgs:{evs_buffer_size_limit:262144},xhrHeaders:{Accept:"text/event-stream","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}},setOptions:function(t){var e,r=this.defaultOptions;for(e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);for(e in t)e in r&&t.hasOwnProperty(e)&&(this[e]=t[e]);this.getArgs&&this.bufferSizeLimit&&(this.getArgs.evs_buffer_size_limit=this.bufferSizeLimit),"undefined"!=typeof console&&"undefined"!=typeof console.log||(this.loggingEnabled=!1)},log:function(t){this.loggingEnabled&&console.log("["+this.loggingPrefix+"]:"+t)},poll:function(){try{if(this.readyState==this.CLOSED)return;this.cleanup(),this.readyState=this.CONNECTING,this.cursor=0,this.cache="",this._xhr=new this.XHR(this),this.resetNoActivityTimer()}catch(t){this.log("There were errors inside the pool try-catch"),this.dispatchEvent("error",{type:"error",data:t.message})}},pollAgain:function(t){var e=this;e.readyState=e.CONNECTING,e.dispatchEvent("error",{type:"error",data:"Reconnecting "}),this._pollTimer=setTimeout(function(){e.poll()},t||0)},cleanup:function(){this.log("evs cleaning up"),this._pollTimer&&(clearInterval(this._pollTimer),this._pollTimer=null),this._noActivityTimer&&(clearInterval(this._noActivityTimer),this._noActivityTimer=null),this._xhr&&(this._xhr.abort(),this._xhr=null)},resetNoActivityTimer:function(){if(this.silentTimeout){this._noActivityTimer&&clearInterval(this._noActivityTimer);var t=this;this._noActivityTimer=setTimeout(function(){t.log("Timeout! silentTImeout:"+t.silentTimeout),t.pollAgain()},this.silentTimeout)}},close:function(){this.readyState=this.CLOSED,this.log("Closing connection. readyState: "+this.readyState),this.cleanup()},ondata:function(){var t=this._xhr;if(t.isReady()&&!t.hasError()){this.resetNoActivityTimer(),this.readyState==this.CONNECTING&&(this.readyState=this.OPEN,this.dispatchEvent("open",{type:"open"}));var e=t.getBuffer();e.length>this.bufferSizeLimit&&(this.log("buffer.length > this.bufferSizeLimit"),this.pollAgain()),0==this.cursor&&e.length>0&&"\ufeff"==e.substring(0,1)&&(this.cursor=1);var r=this.lastMessageIndex(e);if(r[0]>=this.cursor){var n=r[1],i=e.substring(this.cursor,n);this.parseStream(i),this.cursor=n}t.isDone()&&(this.log("request.isDone(). reopening the connection"),this.pollAgain(this.interval))}else this.readyState!==this.CLOSED&&(this.log("this.readyState !== this.CLOSED"),this.pollAgain(this.interval))},parseStream:function(t){t=this.cache+this.normalizeToLF(t);var r,n,i,o,s,u,a=t.split("\n\n");for(r=0;r<a.length-1;r++){for(i="message",o=[],parts=a[r].split("\n"),n=0;n<parts.length;n++)s=this.trimWhiteSpace(parts[n]),0==s.indexOf("event")?i=s.replace(/event:?\s*/,""):0==s.indexOf("retry")?(u=parseInt(s.replace(/retry:?\s*/,"")),isNaN(u)||(this.interval=u)):0==s.indexOf("data")?o.push(s.replace(/data:?\s*/,"")):0==s.indexOf("id:")?this.lastEventId=s.replace(/id:?\s*/,""):0==s.indexOf("id")&&(this.lastEventId=null);if(o.length){var c=new e(i,o.join("\n"),window.location.origin,this.lastEventId);this.dispatchEvent(i,c)}}this.cache=a[a.length-1]},dispatchEvent:function(t,e){var r=this["_"+t+"Handlers"];if(r)for(var n=0;n<r.length;n++)r[n].call(this,e);this["on"+t]&&this["on"+t].call(this,e)},addEventListener:function(t,e){this["_"+t+"Handlers"]||(this["_"+t+"Handlers"]=[]),this["_"+t+"Handlers"].push(e)},removeEventListener:function(t,e){var r=this["_"+t+"Handlers"];if(r)for(var n=r.length-1;n>=0;--n)if(r[n]===e){r.splice(n,1);break}},_pollTimer:null,_noactivityTimer:null,_xhr:null,lastEventId:null,cache:"",cursor:0,onerror:null,onmessage:null,onopen:null,readyState:0,urlWithParams:function(t,e){var r=[];if(e){var n,i,o=encodeURIComponent;for(n in e)e.hasOwnProperty(n)&&(i=o(n)+"="+o(e[n]),r.push(i))}return r.length>0?t.indexOf("?")==-1?t+"?"+r.join("&"):t+"&"+r.join("&"):t},lastMessageIndex:function(t){var e=t.lastIndexOf("\n\n"),r=t.lastIndexOf("\r\r"),n=t.lastIndexOf("\r\n\r\n");return n>Math.max(e,r)?[n,n+4]:[Math.max(e,r),Math.max(e,r)+2]},trimWhiteSpace:function(t){var e=/^(\s|\u00A0)+|(\s|\u00A0)+$/g;return t.replace(e,"")},normalizeToLF:function(t){return t.replace(/\r\n|\r/g,"\n")}},r()){i.isPolyfill="IE_8-9";var o=i.prototype.defaultOptions;o.xhrHeaders=null,o.getArgs.evs_preamble=2056,i.prototype.XHR=function(t){request=new XDomainRequest,this._request=request,request.onprogress=function(){request._ready=!0,t.ondata()},request.onload=function(){this._loaded=!0,t.ondata()},request.onerror=function(){this._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"XDomainRequest error"})},request.ontimeout=function(){this._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"XDomainRequest timed out"})};var e={};if(t.getArgs){var r=t.getArgs;for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);t.lastEventId&&(e.evs_last_event_id=t.lastEventId)}request.open("GET",t.urlWithParams(t.URL,e)),request.send()},i.prototype.XHR.prototype={useXDomainRequest:!0,_request:null,_ready:!1,_loaded:!1,_failed:!1,isReady:function(){return this._request._ready},isDone:function(){return this._request._loaded},hasError:function(){return this._request._failed},getBuffer:function(){var t="";try{t=this._request.responseText||""}catch(t){}return t},abort:function(){this._request&&this._request.abort()}}}else i.isPolyfill="XHR",i.prototype.XHR=function(t){request=new XMLHttpRequest,this._request=request,t._xhr=this,request.onreadystatechange=function(){request.readyState>1&&t.readyState!=t.CLOSED&&(200==request.status||request.status>=300&&request.status<400?t.ondata():(request._failed=!0,t.readyState=t.CLOSED,t.dispatchEvent("error",{type:"error",data:"The server responded with "+request.status}),t.close()))},request.onprogress=function(){},request.open("GET",t.urlWithParams(t.URL,t.getArgs),!0);var e=t.xhrHeaders;for(var r in e)e.hasOwnProperty(r)&&request.setRequestHeader(r,e[r]);t.lastEventId&&request.setRequestHeader("Last-Event-Id",t.lastEventId),request.send()},i.prototype.XHR.prototype={useXDomainRequest:!1,_request:null,_failed:!1,isReady:function(){return this._request.readyState>=2},isDone:function(){return 4==this._request.readyState},hasError:function(){return this._failed||this._request.status>=400},getBuffer:function(){var t="";try{t=this._request.responseText||""}catch(t){}return t},abort:function(){this._request&&this._request.abort()}};t[n]=i}}(this)},{}],26:[function(t,e,r){function n(t,e,r){if(!u(e))throw new TypeError("iterator must be a function");arguments.length<3&&(r=this),"[object Array]"===a.call(t)?i(t,e,r):"string"==typeof t?o(t,e,r):s(t,e,r)}function i(t,e,r){for(var n=0,i=t.length;n<i;n++)c.call(t,n)&&e.call(r,t[n],n,t)}function o(t,e,r){for(var n=0,i=t.length;n<i;n++)e.call(r,t.charAt(n),n,t)}function s(t,e,r){for(var n in t)c.call(t,n)&&e.call(r,t[n],n,t)}var u=t("is-function");e.exports=n;var a=Object.prototype.toString,c=Object.prototype.hasOwnProperty},{"is-function":28}],27:[function(t,e,r){(function(t){"undefined"!=typeof window?e.exports=window:"undefined"!=typeof t?e.exports=t:"undefined"!=typeof self?e.exports=self:e.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(t,e,r){function n(t){var e=i.call(t);return"[object Function]"===e||"function"==typeof t&&"[object RegExp]"!==e||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}e.exports=n;var i=Object.prototype.toString},{}],29:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],30:[function(t,e,r){var n=t("trim"),i=t("for-each"),o=function(t){return"[object Array]"===Object.prototype.toString.call(t)};e.exports=function(t){if(!t)return{};var e={};return i(n(t).split("\n"),function(t){var r=t.indexOf(":"),i=n(t.slice(0,r)).toLowerCase(),s=n(t.slice(r+1));"undefined"==typeof e[i]?e[i]=s:o(e[i])?e[i].push(s):e[i]=[e[i],s]}),e}},{"for-each":26,trim:49}],31:[function(t,e,r){"use strict";var n=t("./util/root"),i=t("./util/toSubscriber"),o=t("./symbol/observable"),s=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,o=i.toSubscriber(t,e,r);if(n?n.call(o,this):o.add(this._subscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,
o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype.forEach=function(t,e){var r=this;if(e||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?e=n.root.Rx.config.Promise:n.root.Promise&&(e=n.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,n){var i=r.subscribe(function(e){if(i)try{t(e)}catch(t){n(t),i.unsubscribe()}else t(e)},n,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[o.$$observable]=function(){return this},t.create=function(e){return new t(e)},t}();r.Observable=s},{"./symbol/observable":39,"./util/root":46,"./util/toSubscriber":47}],32:[function(t,e,r){"use strict";r.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},{}],33:[function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=t("./util/isFunction"),o=t("./Subscription"),s=t("./Observer"),u=t("./symbol/rxSubscriber"),a=function(t){function e(r,n,i){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.empty;break;case 1:if(!r){this.destination=s.empty;break}if("object"==typeof r){r instanceof e?(this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,r,n,i)}}return n(e,t),e.prototype[u.$$rxSubscriber]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e}(o.Subscription);r.Subscriber=a;var c=function(t){function e(e,r,n,o){t.call(this),this._parent=e;var s,u=this;i.isFunction(r)?s=r:r&&(u=r,s=r.next,n=r.error,o=r.complete,i.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this)),this._context=u,this._next=s,this._error=n,this._complete=o}return n(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parent;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parent;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){if(!this.isStopped){var t=this._parent;this._complete?t.syncErrorThrowable?(this.__tryOrSetError(t,this._complete),this.unsubscribe()):(this.__tryOrUnsub(this._complete),this.unsubscribe()):this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parent;this._context=null,this._parent=null,t.unsubscribe()},e}(a)},{"./Observer":32,"./Subscription":34,"./symbol/rxSubscriber":40,"./util/isFunction":44}],34:[function(t,e,r){"use strict";var n=t("./util/isArray"),i=t("./util/isObject"),o=t("./util/isFunction"),s=t("./util/tryCatch"),u=t("./util/errorObject"),a=t("./util/UnsubscriptionError"),c=function(){function t(t){this.closed=!1,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){this.closed=!0;var r=this,c=r._unsubscribe,f=r._subscriptions;if(this._subscriptions=null,o.isFunction(c)){var l=s.tryCatch(c).call(this);l===u.errorObject&&(e=!0,(t=t||[]).push(u.errorObject.e))}if(n.isArray(f))for(var h=-1,p=f.length;++h<p;){var d=f[h];if(i.isObject(d)){var l=s.tryCatch(d.unsubscribe).call(d);if(l===u.errorObject){e=!0,t=t||[];var b=u.errorObject.e;b instanceof a.UnsubscriptionError?t=t.concat(b.errors):t.push(b)}}}if(e)throw new a.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)break;this.closed?r.unsubscribe():(this._subscriptions||(this._subscriptions=[])).push(r);break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return r},t.prototype.remove=function(e){if(null!=e&&e!==this&&e!==t.EMPTY){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();r.Subscription=c},{"./util/UnsubscriptionError":41,"./util/errorObject":42,"./util/isArray":43,"./util/isFunction":44,"./util/isObject":45,"./util/tryCatch":48}],35:[function(t,e,r){"use strict";function n(t,e){return this.lift(new s(t,e))}var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("../Subscriber");r.filter=n;var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e._subscribe(new u(t,this.predicate,this.thisArg))},t}(),u=function(t){function e(e,r,n){t.call(this,e),this.predicate=r,this.thisArg=n,this.count=0,this.predicate=r}return i(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(o.Subscriber)},{"../Subscriber":33}],36:[function(t,e,r){"use strict";function n(t,e){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new s(t,e))}var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("../Subscriber");r.map=n;var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e._subscribe(new u(t,this.project,this.thisArg))},t}();r.MapOperator=s;var u=function(t){function e(e,r,n){t.call(this,e),this.project=r,this.count=0,this.thisArg=n||this}return i(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.Subscriber)},{"../Subscriber":33}],37:[function(t,e,r){"use strict";function n(t,e){var r=!1;return arguments.length>=2&&(r=!0),this.lift(new s(t,e,r))}var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},o=t("../Subscriber");r.reduce=n;var s=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e._subscribe(new u(t,this.accumulator,this.seed,this.hasSeed))},t}();r.ReduceOperator=s;var u=function(t){function e(e,r,n,i){t.call(this,e),this.accumulator=r,this.hasSeed=i,this.hasValue=!1,this.acc=n}return i(e,t),e.prototype._next=function(t){this.hasValue||(this.hasValue=this.hasSeed)?this._tryReduce(t):(this.acc=t,this.hasValue=!0)},e.prototype._tryReduce=function(t){var e;try{e=this.accumulator(this.acc,t)}catch(t){return void this.destination.error(t)}this.acc=e},e.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc),this.destination.complete()},e}(o.Subscriber);r.ReduceSubscriber=u},{"../Subscriber":33}],38:[function(t,e,r){"use strict";function n(t){var e=this;if(t||(i.root.Rx&&i.root.Rx.config&&i.root.Rx.config.Promise?t=i.root.Rx.config.Promise:i.root.Promise&&(t=i.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})}var i=t("../util/root");r.toPromise=n},{"../util/root":46}],39:[function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}var i=t("../util/root");r.getSymbolObservable=n,r.$$observable=n(i.root)},{"../util/root":46}],40:[function(t,e,r){"use strict";var n=t("../util/root"),i=n.root.Symbol;r.$$rxSubscriber="function"==typeof i&&"function"==typeof i.for?i.for("rxSubscriber"):"@@rxSubscriber"},{"../util/root":46}],41:[function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=function(t){function e(e){t.call(this),this.errors=e;var r=Error.call(this,e?e.length+" errors occurred during unsubscription:\n "+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return n(e,t),e}(Error);r.UnsubscriptionError=i},{}],42:[function(t,e,r){"use strict";r.errorObject={e:{}}},{}],43:[function(t,e,r){"use strict";r.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},{}],44:[function(t,e,r){"use strict";function n(t){return"function"==typeof t}r.isFunction=n},{}],45:[function(t,e,r){"use strict";function n(t){return null!=t&&"object"==typeof t}r.isObject=n},{}],46:[function(t,e,r){(function(t){"use strict";if(r.root="object"==typeof window&&window.window===window&&window||"object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t,!r.root)throw new Error("RxJS could not find any global context (window, self, global)")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,e,r){"use strict";function n(t,e,r){if(t){if(t instanceof i.Subscriber)return t;if(t[o.$$rxSubscriber])return t[o.$$rxSubscriber]()}return t||e||r?new i.Subscriber(t,e,r):new i.Subscriber(s.empty)}var i=t("../Subscriber"),o=t("../symbol/rxSubscriber"),s=t("../Observer");r.toSubscriber=n},{"../Observer":32,"../Subscriber":33,"../symbol/rxSubscriber":40}],48:[function(t,e,r){"use strict";function n(){try{return o.apply(this,arguments)}catch(t){return s.errorObject.e=t,s.errorObject}}function i(t){return o=t,n}var o,s=t("./errorObject");r.tryCatch=i},{"./errorObject":42}],49:[function(t,e,r){function n(t){return t.replace(/^\s*|\s*$/g,"")}r=e.exports=n,r.left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],50:[function(t,e,r){function n(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)i.call(r,n)&&(t[n]=r[n])}return t}e.exports=n;var i=Object.prototype.hasOwnProperty},{}],51:[function(t,e,r){function n(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)i.call(r,n)&&(t[n]=r[n])}return t}e.exports=n;var i=Object.prototype.hasOwnProperty},{}]},{},[14])(14)});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc