jsforce2 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +74 -0
- package/bin/jsforce +3 -0
- package/bower.json +30 -0
- package/build/jsforce-api-analytics.js +393 -0
- package/build/jsforce-api-analytics.min.js +2 -0
- package/build/jsforce-api-analytics.min.js.map +1 -0
- package/build/jsforce-api-apex.js +183 -0
- package/build/jsforce-api-apex.min.js +2 -0
- package/build/jsforce-api-apex.min.js.map +1 -0
- package/build/jsforce-api-bulk.js +1054 -0
- package/build/jsforce-api-bulk.min.js +2 -0
- package/build/jsforce-api-bulk.min.js.map +1 -0
- package/build/jsforce-api-chatter.js +320 -0
- package/build/jsforce-api-chatter.min.js +2 -0
- package/build/jsforce-api-chatter.min.js.map +1 -0
- package/build/jsforce-api-metadata.js +3020 -0
- package/build/jsforce-api-metadata.min.js +2 -0
- package/build/jsforce-api-metadata.min.js.map +1 -0
- package/build/jsforce-api-soap.js +403 -0
- package/build/jsforce-api-soap.min.js +2 -0
- package/build/jsforce-api-soap.min.js.map +1 -0
- package/build/jsforce-api-streaming.js +3479 -0
- package/build/jsforce-api-streaming.min.js +2 -0
- package/build/jsforce-api-streaming.min.js.map +1 -0
- package/build/jsforce-api-tooling.js +319 -0
- package/build/jsforce-api-tooling.min.js +2 -0
- package/build/jsforce-api-tooling.min.js.map +1 -0
- package/build/jsforce-core.js +25250 -0
- package/build/jsforce-core.min.js +2 -0
- package/build/jsforce-core.min.js.map +1 -0
- package/build/jsforce.js +31637 -0
- package/build/jsforce.min.js +2 -0
- package/build/jsforce.min.js.map +1 -0
- package/core.js +1 -0
- package/index.js +1 -0
- package/lib/VERSION.js +2 -0
- package/lib/_required.js +29 -0
- package/lib/api/analytics.js +387 -0
- package/lib/api/apex.js +177 -0
- package/lib/api/bulk.js +862 -0
- package/lib/api/chatter.js +314 -0
- package/lib/api/index.js +8 -0
- package/lib/api/metadata.js +848 -0
- package/lib/api/soap.js +397 -0
- package/lib/api/streaming-extension.js +136 -0
- package/lib/api/streaming.js +270 -0
- package/lib/api/tooling.js +313 -0
- package/lib/browser/canvas.js +90 -0
- package/lib/browser/client.js +241 -0
- package/lib/browser/core.js +5 -0
- package/lib/browser/jsforce.js +6 -0
- package/lib/browser/jsonp.js +52 -0
- package/lib/browser/request.js +70 -0
- package/lib/cache.js +252 -0
- package/lib/cli/cli.js +431 -0
- package/lib/cli/repl.js +337 -0
- package/lib/connection.js +1881 -0
- package/lib/core.js +16 -0
- package/lib/csv.js +50 -0
- package/lib/date.js +163 -0
- package/lib/http-api.js +300 -0
- package/lib/jsforce.js +10 -0
- package/lib/logger.js +52 -0
- package/lib/oauth2.js +206 -0
- package/lib/process.js +275 -0
- package/lib/promise.js +164 -0
- package/lib/query.js +881 -0
- package/lib/quick-action.js +90 -0
- package/lib/record-stream.js +305 -0
- package/lib/record.js +107 -0
- package/lib/registry/file-registry.js +48 -0
- package/lib/registry/index.js +3 -0
- package/lib/registry/registry.js +111 -0
- package/lib/require.js +14 -0
- package/lib/soap.js +207 -0
- package/lib/sobject.js +558 -0
- package/lib/soql-builder.js +236 -0
- package/lib/transport.js +233 -0
- package/package.json +110 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsforce=t()}(function(){return function n(i,o,s){function a(e,t){if(!o[e]){if(!i[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(u)return u(e,!0);throw(r=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",r}r=o[e]={exports:{}},i[e][0].call(r.exports,function(t){return a(i[e][1][t]||t)},r,r.exports,n,i,o,s)}return o[e].exports}for(var u="function"==typeof require&&require,t=0;t<s.length;t++)a(s[t]);return a}({1:[function(t,e,r){"use strict";var n=t("../core");n.browser=t("./client"),e.exports=n},{"../core":10,"./client":5}],2:[function(t,e,r){"use strict";e.exports="1.10.0"},{}],3:[function(t,e,r){"use strict";e.exports={inherits:t("inherits"),util:t("util"),events:t("events"),"lodash/core":t("lodash/core"),"readable-stream":t("readable-stream"),multistream:t("multistream"),"./VERSION":t("./VERSION"),"./cache":t("./cache"),"./connection":t("./connection"),"./core":t("./core"),"./csv":t("./csv"),"./date":t("./date"),"./http-api":t("./http-api"),"./logger":t("./logger"),"./oauth2":t("./oauth2"),"./process":t("./process"),"./promise":t("./promise"),"./query":t("./query"),"./quick-action":t("./quick-action"),"./record-stream":t("./record-stream"),"./record":t("./record"),"./soap":t("./soap"),"./sobject":t("./sobject"),"./soql-builder":t("./soql-builder"),"./transport":t("./transport")}},{"./VERSION":2,"./cache":8,"./connection":9,"./core":10,"./csv":11,"./date":12,"./http-api":13,"./logger":14,"./oauth2":15,"./process":16,"./promise":17,"./query":18,"./quick-action":19,"./record":21,"./record-stream":20,"./soap":23,"./sobject":24,"./soql-builder":25,"./transport":26,events:37,inherits:39,"lodash/core":43,multistream:44,"readable-stream":62,util:72}],4:[function(t,e,r){"use strict";var c=t("readable-stream").Duplex,l=t("lodash/core");e.exports={supported:"object"==typeof Sfdc&&void 0!==Sfdc.canvas,createRequest:function(u){return function(n,i){var o,s=new c;s._read=function(t){o&&s.push(o.body)};var a=[],t=!1;function e(t){var e={client:u.client,method:n.method,data:t};if(n.headers)for(var r in e.headers={},n.headers)"content-type"===r.toLowerCase()?e.contentType=n.headers[r]:e.headers[r]=n.headers[r];e.success=function(t){var r,e=(n=t.responseHeaders,r={},n.split(/\n/).forEach(function(t){var e=t.split(/\s*:\s*/),t=e[0].toLowerCase(),e=e[1];r[t]=e}),r),n=t.payload;l.isString(n)||(n=JSON.stringify(n)),o={statusCode:t.status,headers:e,body:n},i&&i(null,o,o.body),s.end()},e.failure=function(t){i&&i(t)},Sfdc.canvas.client.ajax(n.url,e)}return s._write=function(t,e,r){a.push(t.toString(e)),r()},s.on("finish",function(){t||(e(a.join("")),t=!0)}),!n.body&&""!==n.body&&/^(put|post|patch)$/i.test(n.method)||(e(n.body),t=!0),s}}}},{"lodash/core":43,"readable-stream":62}],5:[function(t,e,r){"use strict";var n=t("events"),i=t("inherits"),o=t("querystring"),s=t("lodash/core"),a=t("../connection"),d=t("../oauth2");function u(){var t=function(){var t;if(window.location.hash){if((t=o.parse(window.location.hash.substring(1))).access_token)return{success:!0,body:t}}else if(window.location.search&&(t=o.parse(window.location.search.substring(1))).error)return{success:!1,body:t}}(),e=localStorage.getItem("jsforce_state");if(t&&e&&t.body.state===e){localStorage.removeItem("jsforce_state");var r=e.split("."),e=r[0],r=r[1],e=new c(e);return t.success?(e._storeTokens(t.body),location.hash=""):e._storeError(t.body),"popup"===r&&window.close(),1}}function c(t){this._prefix=t||"jsforce"+l++,this.connection=null}var l=0;i(c,n.EventEmitter),c.prototype.init=function(t){var e;u()||(this.config=t,this.connection=new a(t),(t=this._getTokens())&&(this.connection.initialize(t),e=this,setTimeout(function(){e.emit("connect",e.connection)},10)))},c.prototype.login=function(t,e){s.isFunction(t)&&(e=t,t={}),t=t||{},e=e||function(){},s.extend(t,this.config);this._prompt(t,e)},c.prototype._prompt=function(t,e){var r=this,n=new d(t),i=Math.random().toString(36).substring(2),o=[this._prefix,"popup",i].join(".");localStorage.setItem("jsforce_state",o);var s,a,u,c,l=n.getAuthorizationUrl({response_type:"token",scope:t.scope,state:o}),h=t.size||{},f=(s=l,a=h.width||912,u=h.height||513,c=screen.width/2-a/2,h=screen.height/2-u/2,window.open(s,null,"location=yes,toolbar=no,status=no,menubar=no,width="+a+",height="+u+",top="+h+",left="+c));if(!f)return o=[this._prefix,"redirect",i].join("."),localStorage.setItem("jsforce_state",o),l=n.getAuthorizationUrl({response_type:"token",scope:t.scope,state:o}),void(location.href=l);r._removeTokens();var p=setInterval(function(){try{var t;f&&!f.closed||(clearInterval(p),(t=r._getTokens())?(r.connection.initialize(t),r.emit("connect",r.connection),e(null,{status:"connect"})):(t=r._getError())?e(new Error(t.error+": "+t.error_description)):e(null,{status:"cancel"}))}catch(t){}},1e3)},c.prototype.isLoggedIn=function(){return!(!this.connection||!this.connection.accessToken)},c.prototype.logout=function(){this.connection.logout(),this._removeTokens(),this.emit("disconnect")},c.prototype._getTokens=function(){var t=new RegExp("(^|;\\s*)"+this._prefix+"_loggedin=true(;|$)");if(document.cookie.match(t)){t=Number(localStorage.getItem(this._prefix+"_issued_at"));if(Date.now()<t+72e5){var e,t=localStorage.getItem(this._prefix+"_id");return t&&(e={id:(e=t.split("/")).pop(),organizationId:e.pop(),url:t}),{accessToken:localStorage.getItem(this._prefix+"_access_token"),instanceUrl:localStorage.getItem(this._prefix+"_instance_url"),userInfo:e}}}return null},c.prototype._storeTokens=function(t){localStorage.setItem(this._prefix+"_access_token",t.access_token),localStorage.setItem(this._prefix+"_instance_url",t.instance_url),localStorage.setItem(this._prefix+"_issued_at",t.issued_at),localStorage.setItem(this._prefix+"_id",t.id),document.cookie=this._prefix+"_loggedin=true;"},c.prototype._removeTokens=function(){localStorage.removeItem(this._prefix+"_access_token"),localStorage.removeItem(this._prefix+"_instance_url"),localStorage.removeItem(this._prefix+"_issued_at"),localStorage.removeItem(this._prefix+"_id"),document.cookie=this._prefix+"_loggedin="},c.prototype._getError=function(){try{var t=JSON.parse(localStorage.getItem(this._prefix+"_error"));return localStorage.removeItem(this._prefix+"_error"),t}catch(t){}},c.prototype._storeError=function(t){localStorage.setItem(this._prefix+"_error",JSON.stringify(t))},e.exports=new c,e.exports.Client=c},{"../connection":9,"../oauth2":15,events:37,inherits:39,"lodash/core":43,querystring:51}],6:[function(t,e,r){"use strict";var c=0;e.exports={supported:"undefined"!=typeof window&&"undefined"!=typeof document,createRequest:function(a,u){return a=a||"callback",u=u||1e4,function(t,e){if("GET"!==t.method.toUpperCase())return e(new Error("JSONP only supports GET request."));var r="_jsforce_jsonpCallback_"+ ++c,n=window,t=t.url;t+=0<t.indexOf("?")?"&":"?",t+=a+"="+r;var i=document.createElement("script");i.type="text/javascript",i.src=t,document.documentElement.appendChild(i);var o=setTimeout(function(){s(),e(new Error("JSONP call time out."))},u);n[r]=function(t){s(),e(null,{statusCode:200,headers:{"content-type":"application/json"},body:JSON.stringify(t)})};var s=function(){clearTimeout(o),document.documentElement.removeChild(i),delete n[r]}}}}},{}],7:[function(t,e,r){"use strict";var u=t("readable-stream").Duplex,c=t("lodash/core");e.exports=function(t,r){var n,i=new XMLHttpRequest;if(i.open(t.method,t.url),t.headers)for(var e in t.headers)i.setRequestHeader(e,t.headers[e]);i.setRequestHeader("Accept","*/*");var o=new u;o._read=function(t){n&&o.push(n.body)};var s=[],a=!1;return o._write=function(t,e,r){s.push(t.toString("buffer"===e?"binary":e)),r()},o.on("finish",function(){a||(i.send(s.join("")),a=!0)}),!t.body&&""!==t.body&&/^(put|post|patch)$/i.test(t.method)||(i.send(t.body),a=!0),i.onreadystatechange=function(){var t,e;4===i.readyState&&(t=function(t){t=(t.getAllResponseHeaders()||"").split(/[\r\n]+/);return c.map(t,function(t){return t.split(/\s*:/)[0].toLowerCase()})}(i),e={},c.forEach(t,function(t){t&&(e[t]=i.getResponseHeader(t))}),(n={statusCode:i.status,headers:e,body:i.response}).statusCode||(n.statusCode=400,n.body="Access Declined"),r&&r(null,n,n.body),o.end())},o}},{"lodash/core":43,"readable-stream":62}],8:[function(t,e,r){"use strict";function n(){this.fetching=!1}var i=t("events"),o=t("inherits"),l=t("lodash/core");o(n,i.EventEmitter),n.prototype.get=function(t){if(!t)return this._value;this.once("value",t),l.isUndefined(this._value)||this.emit("value",this._value)},n.prototype.set=function(t){this._value=t,this.emit("value",this._value)},n.prototype.clear=function(){this.fetching=!1,delete this._value};i=function(){this._entries={}};function h(t,e){return e=Array.prototype.slice.apply(e),t+"("+l.map(e,function(t){return JSON.stringify(t)}).join(",")+")"}i.prototype.get=function(t){if(t&&this._entries[t])return this._entries[t];var e=new n;return this._entries[t]=e},i.prototype.clear=function(t){for(var e in this._entries)t&&0!==e.indexOf(t)||this._entries[e].clear()},i.prototype.makeResponseCacheable=function(s,a,u){var c=this;return u=u||{},function(){var t=Array.prototype.slice.apply(arguments),e=t.pop();l.isFunction(e)||(t.push(e),e=null);var r=l.isString(u.key)?u.key:l.isFunction(u.key)?u.key.apply(a,t):h(u.namespace,t);Array.isArray(r)||(r=[r]);var n,i,o=[];r.forEach(function(t){t=c.get(t);t.fetching=!0,o.push(t)}),e&&t.push(function(r,n){Array.isArray(n)&&n.length==o.length?o.forEach(function(t,e){t.set({error:r,result:n[e]})}):o.forEach(function(t){t.set({error:r,result:n})}),e(r,n)});try{n=s.apply(a||this,t)}catch(t){i=t}if(n&&l.isFunction(n.then))return e?n:n.then(function(r){return Array.isArray(r)&&r.length==o.length?o.forEach(function(t,e){t.set({error:void 0,result:r[e]})}):o.forEach(function(t){t.set({error:void 0,result:r})}),r},function(r){throw Array.isArray(r)&&r.length==o.length?o.forEach(function(t,e){t.set({error:r[e],result:void 0})}):o.forEach(function(t){t.set({error:r,result:void 0})}),r});if(Array.isArray(n)&&n.length==o.length?o.forEach(function(t,e){t.set({error:i,result:n[e]})}):o.forEach(function(t){t.set({error:i,result:n})}),i)throw i;return n}},i.prototype.makeCacheable=function(i,o,s){var a=this;s=s||{};function t(){var t=Array.prototype.slice.apply(arguments),e=t.pop();l.isFunction(e)||t.push(e);var r=l.isString(s.key)?s.key:l.isFunction(s.key)?s.key.apply(o,t):h(s.namespace,t),n=a.get(r);if(!l.isFunction(e)){r=n.get();if(!r)throw new Error("Function call result is not cached yet.");if(r.error)throw r.error;return r.result}n.get(function(t){e(t.error,t.result)}),n.fetching||(n.fetching=!0,t.push(function(t,e){n.set({error:t,result:e})}),i.apply(o||this,t))}return t.clear=function(){var t=l.isString(s.key)?s.key:l.isFunction(s.key)?s.key.apply(o,arguments):h(s.namespace,arguments);a.clear(t)},t},e.exports=i},{events:37,inherits:39,"lodash/core":43}],9:[function(T,S,t){(function(r){"use strict";var t=T("events"),e=T("inherits"),u=T("lodash/core"),c=T("./promise"),n=T("./logger"),i=T("./oauth2"),o=T("./query"),s=T("./sobject"),a=T("./quick-action"),l=T("./http-api"),h=T("./transport"),f=T("./process"),p=T("./cache"),d="https://login.salesforce.com",y="",m="42.0",g=200,_=S.exports=function(t){t=t||{},this._logger=new n(t.logLevel);var e=t.oauth2||{loginUrl:t.loginUrl,clientId:t.clientId,clientSecret:t.clientSecret,redirectUri:t.redirectUri,proxyUrl:t.proxyUrl,httpProxy:t.httpProxy};this.oauth2=e=e instanceof i?e:new i(e),this.loginUrl=t.loginUrl||e.loginUrl||d,this.version=t.version||m,this.maxRequest=t.maxRequest||this.maxRequest||10,t.proxyUrl?this._transport=new h.ProxyTransport(t.proxyUrl):t.httpProxy?this._transport=new h.HttpProxyTransport(t.httpProxy):this._transport=new h,this.callOptions=t.callOptions,T("./core").emit("connection:new",this),this.process=new f(this),this.cache=new p;var r=t.refreshFn;!r&&this.oauth2.clientId&&(r=v),r&&(this._refreshDelegate=new l.SessionRefreshDelegate(this,r));e={key:function(t){return t?t.type?"describe."+t.type:"describe."+t:"describe"}};this.describe$=this.cache.makeCacheable(this.describe,this,e),this.describe=this.cache.makeResponseCacheable(this.describe,this,e),this.describeSObject$=this.describe$,this.describeSObject=this.describe;r={key:function(t){var e=t.types,t=t.autofetch||!1,e=!(25<e.length)||t?e:e.slice(0,25),r=[];return e.forEach(function(t){r.push("describe."+t)}),r}};this.batchDescribe=this.cache.makeResponseCacheable(this.batchDescribe,this,r),this.batchDescribeSObjects=this.batchDescribe,e={key:"describeGlobal"},this.describeGlobal$=this.cache.makeCacheable(this.describeGlobal,this,e),this.describeGlobal=this.cache.makeResponseCacheable(this.describeGlobal,this,e),this.initialize(t)};function v(r,n){r.oauth2.refreshToken(r.refreshToken,function(t,e){if(t)return n(t);t=w(e.id);r.initialize({instanceUrl:e.instance_url,accessToken:e.access_token,userInfo:t}),n(null,e.access_token,e)})}function b(t){function e(t){return t<10?"0"+t:t}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"+00:00"}function w(t){var e=t.split("/");return{id:e.pop(),organizationId:e.pop(),url:t}}function E(t){return t&&String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}e(_,t.EventEmitter),_.prototype.initialize=function(t){if(!t.instanceUrl&&t.serverUrl&&(t.instanceUrl=t.serverUrl.split("/").slice(0,3).join("/")),this.instanceUrl=t.instanceUrl||t.serverUrl||this.instanceUrl||y,this.accessToken=t.sessionId||t.accessToken||this.accessToken,this.refreshToken=t.refreshToken||this.refreshToken,this.refreshToken&&!this._refreshDelegate)throw new Error("Refresh token is specified without oauth2 client information or refresh function");this.signedRequest=t.signedRequest&&function(t){if(u.isString(t)){if("{"===t[0])return JSON.parse(t);var e=t.split(".").pop(),e=r.from(e,"base64").toString("utf-8");return JSON.parse(e)}return t}(t.signedRequest),this.signedRequest&&(this.accessToken=this.signedRequest.client.oauthToken,h.CanvasTransport.supported&&(this._transport=new h.CanvasTransport(this.signedRequest))),t.userInfo&&(this.userInfo=t.userInfo),this.limitInfo={},this.sobjects={},this.cache.clear(),this.cache.get("describeGlobal").removeAllListeners("value"),this.cache.get("describeGlobal").on("value",u.bind(function(t){t.result&&u.map(t.result.sobjects,function(t){return t.name}).forEach(this.sobject,this)},this)),this.tooling&&this.tooling.initialize(),this._sessionType=t.sessionId?"soap":"oauth2"},_.prototype._baseUrl=function(){return[this.instanceUrl,"services/data","v"+this.version].join("/")},_.prototype._normalizeUrl=function(t){return"/"===t[0]?0===t.indexOf("/services/")?this.instanceUrl+t:this._baseUrl()+t:t},_.prototype.request=function(t,e,r){"function"==typeof e&&(r=e,e=null),e=e||{};var n=this;u.isString(t)&&(t={method:"GET",url:t}),t.url=this._normalizeUrl(t.url);e=new l(this,e);return e.on("response",function(t){t.headers&&t.headers["sforce-limit-info"]&&((t=t.headers["sforce-limit-info"].match(/api\-usage=(\d+)\/(\d+)/))&&(n.limitInfo={apiUsage:{used:parseInt(t[1],10),limit:parseInt(t[2],10)}}))}),e.request(t).thenCall(r)},_.prototype.requestGet=function(t,e,r){t={method:"GET",url:t};return this.request(t,e,r)},_.prototype.requestPost=function(t,e,r,n){e={method:"POST",url:t,body:JSON.stringify(e),headers:{"content-type":"application/json"}};return this.request(e,r,n)},_.prototype.requestPut=function(t,e,r,n){e={method:"PUT",url:t,body:JSON.stringify(e),headers:{"content-type":"application/json"}};return this.request(e,r,n)},_.prototype.requestPatch=function(t,e,r,n){e={method:"PATCH",url:t,body:JSON.stringify(e),headers:{"content-type":"application/json"}};return this.request(e,r,n)},_.prototype.requestDelete=function(t,e,r){t={method:"DELETE",url:t};return this.request(t,e,r)},_.prototype.query=function(t,e,r){"function"==typeof e&&(r=e,e=void 0);e=new o(this,t,e);return r&&e.run(r),e},_.prototype.queryAll=function(t,e,r){"function"==typeof e&&(r=e,e=void 0);e=new o(this,t,e);return e.scanAll(!0),r&&e.run(r),e},_.prototype.queryMore=function(t,e,r){"function"==typeof e&&(r=e,e=void 0);e=new o(this,{locator:t},e);return r&&e.run(r),e},_.prototype._ensureVersion=function(t){var e=this.version.split(".");return parseInt(e[0],10)>=t},_.prototype._supports=function(t){return"sobject-collection"===t&&this._ensureVersion(42)},_.prototype.retrieve=function(t,e,r,n){return"function"==typeof r&&(n=r,r={}),r=r||{},(u.isArray(e)?this._supports("sobject-collection")?this._retrieveMany(t,e,r):this._retrieveParallel(t,e,r):this._retrieveSingle(t,e,r)).thenCall(n)},_.prototype._retrieveSingle=function(t,e,r){if(!e)return c.reject(new Error("Invalid record ID. Specify valid record ID value"));e=[this._baseUrl(),"sobjects",t,e].join("/");return r.fields&&(e+="?fields="+r.fields.join(",")),this.request({method:"GET",url:e,headers:r.headers})},_.prototype._retrieveParallel=function(e,t,r){if(t.length>this.maxRequest)return c.reject(new Error("Exceeded max limit of concurrent call"));var n=this;return c.all(t.map(function(t){return n._retrieveSingle(e,t,r).catch(function(t){if(r.allOrNone||"NOT_FOUND"!==t.errorCode)throw t;return null})}))},_.prototype._retrieveMany=function(t,e,r){if(0===e.length)return c.resolve([]);var n=[this._baseUrl(),"composite","sobjects",t].join("/"),i=this;return(r.fields?c.resolve(r.fields):new c(function(r,n){i.describe$(t,function(t,e){t?n(t):(e=e.fields.map(function(t){return t.name}),r(e))})})).then(function(t){return i.request({method:"POST",url:n,body:JSON.stringify({ids:e,fields:t}),headers:u.defaults(r.headers||{},{"Content-Type":"application/json"})})})},_.prototype._toRecordResult=function(t,e){var r={statusCode:e.errorCode,message:e.message};e.content&&(r.content=e.content),e.fields&&(r.fields=e.fields);r={success:!1,errors:[r]};return t&&(r.id=t),r},_.prototype.insert=_.prototype.create=function(t,e,r,n){return u.isString(t)||(n=r,r=e,e=t,t=null),"function"==typeof r&&(n=r,r={}),r=r||{},(u.isArray(e)?this._supports("sobject-collection")?this._createMany(t,e,r):this._createParallel(t,e,r):this._createSingle(t,e,r)).thenCall(n)},_.prototype._createSingle=function(t,e,r){t=t||e.attributes&&e.attributes.type||e.type;if(!t)return c.reject(new Error("No SObject Type defined in record"));delete(e=u.clone(e)).Id,delete e.type,delete e.attributes;t=[this._baseUrl(),"sobjects",t].join("/");return this.request({method:"POST",url:t,body:JSON.stringify(e),headers:u.defaults(r.headers||{},{"Content-Type":"application/json"})})},_.prototype._createParallel=function(e,t,r){if(t.length>this.maxRequest)return c.reject(new Error("Exceeded max limit of concurrent call"));var n=this;return c.all(t.map(function(t){return n._createSingle(e,t,r).catch(function(t){if(r.allOrNone||!t.errorCode)throw t;return this._toRecordResult(null,t)})}))},_.prototype._createMany=function(r,t,n){if(0===t.length)return c.resolve([]);if(t.length>g&&n.allowRecursive){var i=this;return i._createMany(r,t.slice(0,g),n).then(function(e){return i._createMany(r,t.slice(g),n).then(function(t){return e.concat(t)})})}t=u.map(t,function(t){var e=r||t.attributes&&t.attributes.type||t.type;return e?(delete(t=u.clone(t)).Id,delete t.type,t.attributes={type:e},t):c.reject(new Error("No SObject Type defined in record"))});var e=[this._baseUrl(),"composite","sobjects"].join("/");return this.request({method:"POST",url:e,body:JSON.stringify({allOrNone:n.allOrNone||!1,records:t}),headers:u.defaults(n.headers||{},{"Content-Type":"application/json"})})},_.prototype.update=function(t,e,r,n){return u.isString(t)||(n=r,r=e,e=t,t=null),"function"==typeof r&&(n=r,r={}),r=r||{},(u.isArray(e)?this._supports("sobject-collection")?this._updateMany(t,e,r):this._updateParallel(t,e,r):this._updateSingle(t,e,r)).thenCall(n)},_.prototype._updateSingle=function(t,e,r){var n=e.Id;if(!n)return c.reject(new Error("Record id is not found in record."));t=t||e.attributes&&e.attributes.type||e.type;if(!t)return c.reject(new Error("No SObject Type defined in record"));delete(e=u.clone(e)).Id,delete e.type,delete e.attributes;t=[this._baseUrl(),"sobjects",t,n].join("/");return this.request({method:"PATCH",url:t,body:JSON.stringify(e),headers:u.defaults(r.headers||{},{"Content-Type":"application/json"})},{noContentResponse:{id:n,success:!0,errors:[]}})},_.prototype._updateParallel=function(t,e,r){if(e.length>this.maxRequest)return c.reject(new Error("Exceeded max limit of concurrent call"));var n=this;return c.all(e.map(function(e){return n._updateSingle(t,e,r).catch(function(t){if(r.allOrNone||!t.errorCode)throw t;return this._toRecordResult(e.Id,t)})}))},_.prototype._updateMany=function(n,t,r){if(0===t.length)return c.resolve([]);if(t.length>g&&r.allowRecursive){var i=this;return i._updateMany(n,t.slice(0,g),r).then(function(e){return i._updateMany(n,t.slice(g),r).then(function(t){return e.concat(t)})})}t=u.map(t,function(t){var e=t.Id;if(!e)throw new Error("Record id is not found in record.");var r=n||t.attributes&&t.attributes.type||t.type;if(!r)throw new Error("No SObject Type defined in record");return delete(t=u.clone(t)).Id,t.id=e,delete t.type,t.attributes={type:r},t});var e=[this._baseUrl(),"composite","sobjects"].join("/");return this.request({method:"PATCH",url:e,body:JSON.stringify({allOrNone:r.allOrNone||!1,records:t}),headers:u.defaults(r.headers||{},{"Content-Type":"application/json"})})},_.prototype.upsert=function(n,t,i,o,e){u.isString(n)||(e=o,o=i,i=t,t=n,n=null),"function"==typeof o&&(e=o,o={}),o=o||{};var s=this,a=u.isArray(t);return((t=a?t:[t]).length>this.maxRequest?c.reject(new Error("Exceeded max limit of concurrent call")):c.all(u.map(t,function(t){var e=n||t.attributes&&t.attributes.type||t.type,r=t[i];delete(t=u.clone(t))[i],delete t.type,delete t.attributes;r=[s._baseUrl(),"sobjects",e,i,r].join("/");return s.request({method:"PATCH",url:r,body:JSON.stringify(t),headers:u.defaults(o.headers||{},{"Content-Type":"application/json"})},{noContentResponse:{success:!0,errors:[]}}).catch(function(t){if(!a||o.allOrNone||!t.errorCode)throw t;return s._toRecordResult(null,t)})})).then(function(t){return!a&&u.isArray(t)?t[0]:t})).thenCall(e)},_.prototype.delete=_.prototype.del=_.prototype.destroy=function(t,e,r,n){return"function"==typeof r&&(n=r,r={}),r=r||{},(u.isArray(e)?this._supports("sobject-collection")?this._destroyMany(t,e,r):this._destroyParallel(t,e,r):this._destroySingle(t,e,r)).thenCall(n)},_.prototype._destroySingle=function(t,e,r){t=[this._baseUrl(),"sobjects",t,e].join("/");return this.request({method:"DELETE",url:t,headers:r.headers||null},{noContentResponse:{id:e,success:!0,errors:[]}})},_.prototype._destroyParallel=function(t,e,r){if(e.length>this.maxRequest)return c.reject(new Error("Exceeded max limit of concurrent call"));var n=this;return c.all(e.map(function(e){return n._destroySingle(t,e,r).catch(function(t){if(r.allOrNone||!t.errorCode)throw t;return this._toRecordResult(e,t)})}))},_.prototype._destroyMany=function(t,r,n){if(0===r.length)return c.resolve([]);if(r.length>g&&n.allowRecursive){var i=this;return i._destroyMany(t,r.slice(0,g),n).then(function(e){return i._destroyMany(t,r.slice(g),n).then(function(t){return e.concat(t)})})}var e=[this._baseUrl(),"composite","sobjects?ids="].join("/")+r.join(",");return n.allOrNone&&(e+="&allOrNone=true"),this.request({method:"DELETE",url:e,headers:n.headers||null})},_.prototype.search=function(t,e){t=this._baseUrl()+"/search?q="+encodeURIComponent(t);return this.request(t).thenCall(e)},_.prototype.describe=_.prototype.describeSObject=function(t,e){var r=t.type||t,r=[this._baseUrl(),"sobjects",r,"describe"].join("/"),t=t.ifModifiedSince?{"If-Modified-Since":t.ifModifiedSince}:{};return this.request({method:"GET",url:r,headers:t}).then(function(t){return""===t?c.resolve(void 0):c.resolve(t)}).thenCall(e)},_.prototype.batchDescribe=_.prototype.batchDescribeSObjects=function(t,e){var r=t.types,n=t.autofetch||!1,i=Math.min(t.maxConcurrentRequests||15,15),o=[];do{var s=25<r.length?r.slice(0,25):r}while(o.push(s),0<(r=25<r.length?r.slice(25):[]).length&&n);var a=[];do{var u=o.length>i?o.slice(0,i):o}while(a.push(u),0<(o=o.length>i?o.slice(i):[]).length);return this.doBatchDescribeRequestBatches(a).thenCall(e)},_.prototype.doBatchDescribeRequestBatches=function(e){var r=this,n=[],t=e.shift();return r.doBatchOfBatchDescribeRequests(t).then(function(t){return t.forEach(function(t){n.push(t)}),0<e.length?r.doBatchDescribeRequestBatches(e).then(function(t){return t.forEach(function(t){n.push(t)}),c.resolve(n)}):c.resolve(n)})},_.prototype.doBatchOfBatchDescribeRequests=function(t){var e=this;return c.all(t.map(function(t){return e.doBatchDescribeRequest(t)})).then(function(t){var e=[];return t.forEach(function(t){t.forEach(function(t){e.push(t)})}),c.resolve(e)})},_.prototype.doBatchDescribeRequest=function(t){var n=[],e=[this._baseUrl(),"composite/batch"].join("/"),r="v"+this.version,i=[];return t.forEach(function(t){i.push({method:"GET",url:[r,"sobjects",t,"describe"].join("/")})}),this.request({method:"POST",url:e,body:JSON.stringify({batchRequests:i}),headers:{"Content-Type":"application/json"}}).then(function(t){if(t.results)for(var e=0,e=0;e<t.results.length;e++){var r=t.results[e];Array.isArray(r.result)?r.result[0].errorCode&&r.result[0].message&&this._logger.error("Error: "+r.result[0].errorCode+" "+r.result[0].message+" - "+typesToFetch[e]):n.push(r.result)}return c.resolve(n)})},_.prototype.describeGlobal=function(t){var e=this._baseUrl()+"/sobjects";return this.request(e).thenCall(t)},_.prototype.sobject=function(t){return this.sobjects=this.sobjects||{},this.sobjects[t]=this.sobjects[t]||new s(this,t)},_.prototype.identity=function(t,e){"function"==typeof t&&(e=t,t={}),t=t||{};var r=this,n=this.userInfo&&this.userInfo.url;return c.resolve(n?{identity:n}:this.request({method:"GET",url:this._baseUrl(),headers:t.headers})).then(function(t){t=t.identity;return r.request({method:"GET",url:t})}).then(function(t){return r.userInfo={id:t.user_id,organizationId:t.organization_id,url:t.id},t}).thenCall(e)},_.prototype.authorize=function(t,e,r){"function"==typeof e&&(r=e,e={});var n=this,i=this._logger;return this.oauth2.requestToken(t,e).then(function(t){var e=w(t.id);return n.initialize({instanceUrl:t.instance_url,accessToken:t.access_token,refreshToken:t.refresh_token,userInfo:e}),i.debug("<login> completed. user id = "+e.id+", org id = "+e.organizationId),e}).thenCall(r)},_.prototype.login=function(t,e,r){var n,i;return this._refreshDelegate=new l.SessionRefreshDelegate(this,(n=t,i=e,function(e,r){e.login(n,i,function(t){return t?r(t):void r(null,e.accessToken)})})),this.oauth2&&this.oauth2.clientId&&this.oauth2.clientSecret?this.loginByOAuth2(t,e,r):this.loginBySoap(t,e,r)},_.prototype.loginByOAuth2=function(t,e,r){var n=this,i=this._logger;return this.oauth2.authenticate(t,e).then(function(t){var e=w(t.id);return n.initialize({instanceUrl:t.instance_url,accessToken:t.access_token,userInfo:e}),i.debug("<login> completed. user id = "+e.id+", org id = "+e.organizationId),e}).thenCall(r)},_.prototype.loginBySoap=function(t,e,r){var o=this,s=this._logger,e=['<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/">',"<se:Header/>","<se:Body>",'<login xmlns="urn:partner.soap.sforce.com">',"<username>"+E(t)+"</username>","<password>"+E(e)+"</password>","</login>","</se:Body>","</se:Envelope>"].join(""),a=[this.loginUrl,"services/Soap/u",this.version].join("/");return this._transport.httpRequest({method:"POST",url:a,body:e,headers:{"Content-Type":"text/xml",SOAPAction:'""'}}).then(function(t){if(400<=t.statusCode){var e=(i=t.body.match(/<faultstring>([^<]+)<\/faultstring>/))&&i[1];throw new Error(e||t.body)}s.debug("SOAP response = "+t.body);var r=(i=t.body.match(/<serverUrl>([^<]+)<\/serverUrl>/))&&i[1],n=(i=t.body.match(/<sessionId>([^<]+)<\/sessionId>/))&&i[1],e=(i=t.body.match(/<userId>([^<]+)<\/userId>/))&&i[1],t=(i=t.body.match(/<organizationId>([^<]+)<\/organizationId>/))&&i[1],i=a.split("/").slice(0,3).join("/"),i={id:e,organizationId:t,url:i+="/id/"+t+"/"+e};return o.initialize({serverUrl:r.split("/").slice(0,3).join("/"),sessionId:n,userInfo:i}),s.debug("<login> completed. user id = "+e+", org id = "+t),i}).thenCall(r)},_.prototype.logout=function(t,e){return"function"==typeof t&&(e=t,t=!1),"oauth2"===this._sessionType?this.logoutByOAuth2(t,e):this.logoutBySoap(t,e)},_.prototype.logoutByOAuth2=function(t,e){"function"==typeof t&&(e=t,t=!1);var r=this;this._logger;return this.oauth2.revokeToken(t?this.refreshToken:this.accessToken).then(function(){r.accessToken=null,r.userInfo=null,r.refreshToken=null,r.instanceUrl=null,r.cache.clear()}).thenCall(e)},_.prototype.logoutBySoap=function(t,e){"function"==typeof t&&(e=t,t=!1);var r=this,n=this._logger,t=['<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/">',"<se:Header>",'<SessionHeader xmlns="urn:partner.soap.sforce.com">',"<sessionId>"+E(t?this.refreshToken:this.accessToken)+"</sessionId>","</SessionHeader>","</se:Header>","<se:Body>",'<logout xmlns="urn:partner.soap.sforce.com"/>',"</se:Body>","</se:Envelope>"].join("");return this._transport.httpRequest({method:"POST",url:[this.instanceUrl,"services/Soap/u",this.version].join("/"),body:t,headers:{"Content-Type":"text/xml",SOAPAction:'""'}}).then(function(t){if(n.debug("SOAP statusCode = "+t.statusCode+", response = "+t.body),400<=t.statusCode){var e=t.body.match(/<faultstring>([^<]+)<\/faultstring>/),e=e&&e[1];throw new Error(e||t.body)}r.accessToken=null,r.userInfo=null,r.refreshToken=null,r.instanceUrl=null,r.cache.clear()}).thenCall(e)},_.prototype.recent=function(t,e,r){var n;return u.isString(t)||(r=e,e=t,t=void 0),u.isNumber(e)||(r=e,e=void 0),t?(n=[this._baseUrl(),"sobjects",t].join("/"),this.request(n).then(function(t){return e?t.recentItems.slice(0,e):t.recentItems}).thenCall(r)):(n=this._baseUrl()+"/recent",e&&(n+="?limit="+e),this.request(n).thenCall(r))},_.prototype.updated=function(t,e,r,n){t=[this._baseUrl(),"sobjects",t,"updated"].join("/");return"string"==typeof e&&(e=new Date(e)),e instanceof Date&&(e=b(e)),e&&(t+="?start="+encodeURIComponent(e)),"string"==typeof r&&(r=new Date(r)),r instanceof Date&&(r=b(r)),r&&(t+="&end="+encodeURIComponent(r)),this.request(t).thenCall(n)},_.prototype.deleted=function(t,e,r,n){t=[this._baseUrl(),"sobjects",t,"deleted"].join("/");return"string"==typeof e&&(e=new Date(e)),e instanceof Date&&(e=b(e)),e&&(t+="?start="+encodeURIComponent(e)),"string"==typeof r&&(r=new Date(r)),r instanceof Date&&(r=b(r)),r&&(t+="&end="+encodeURIComponent(r)),this.request(t).thenCall(n)},_.prototype.tabs=function(t){var e=[this._baseUrl(),"tabs"].join("/");return this.request(e).thenCall(t)},_.prototype.limits=function(t){var e=[this._baseUrl(),"limits"].join("/");return this.request(e).thenCall(t)},_.prototype.theme=function(t){var e=[this._baseUrl(),"theme"].join("/");return this.request(e).thenCall(t)},_.prototype.quickActions=function(t){return this.request("/quickActions").thenCall(t)},_.prototype.quickAction=function(t){return new a(this,"/quickActions/"+t)}}).call(this,T("buffer").Buffer)},{"./cache":8,"./core":10,"./http-api":13,"./logger":14,"./oauth2":15,"./process":16,"./promise":17,"./query":18,"./quick-action":19,"./sobject":24,"./transport":26,buffer:30,events:37,inherits:39,"lodash/core":43}],10:[function(t,e,r){"use strict";var n=t("events").EventEmitter,n=e.exports=new n;n.VERSION=t("./VERSION"),n.Connection=t("./connection"),n.OAuth2=t("./oauth2"),n.Date=n.SfDate=t("./date"),n.RecordStream=t("./record-stream"),n.Promise=t("./promise"),n.require=t("./require")},{"./VERSION":2,"./connection":9,"./date":12,"./oauth2":15,"./promise":17,"./record-stream":20,"./require":22,events:37}],11:[function(t,e,r){"use strict";var n=t("lodash/core"),i=t("csv-parse/lib/es5"),o=t("csv-parse/lib/es5/sync"),s=t("csv-stringify"),a=t("csv-stringify/lib/sync");e.exports={parseCSV:function(t,e){return e=n.extend({},e,{columns:!0}),o(t,e)},toCSV:function(t,e){return e=n.extend({},e,{header:!0}),a(t,e)},parseCSVStream:function(t){return t=n.extend({},t,{columns:!0}),i(t)},serializeCSVStream:function(t){return t=n.extend({},t,{header:!0}),s(t)}}},{"csv-parse/lib/es5":33,"csv-parse/lib/es5/sync":34,"csv-stringify":35,"csv-stringify/lib/sync":36,"lodash/core":43}],12:[function(t,e,r){"use strict";var s=t("lodash/core"),a=e.exports=function(t){this._literal=t};function u(t){return(t<10?"0":"")+t}a.prototype.toString=a.prototype.toJSON=function(){return this._literal},a.toDateLiteral=function(t){s.isNumber(t)?t=new Date(t):s.isString(t)&&(t=a.parseDate(t));var e=t.getFullYear(),r=t.getMonth()+1,t=t.getDate(),t=[e,u(r),u(t)].join("-");return new a(t)},a.toDateTimeLiteral=function(t){s.isNumber(t)?t=new Date(t):s.isString(t)&&(t=a.parseDate(t));var e=t.getUTCFullYear(),r=t.getUTCMonth()+1,n=t.getUTCDate(),i=t.getUTCHours(),o=t.getUTCMinutes(),t=t.getUTCSeconds(),t=[e,u(r),u(n)].join("-")+"T"+[u(i),u(o),u(t)].join(":")+"Z";return new a(t)},a.parseDate=function(t){var e=new Date,r=t.match(/^([\d]{4})-?([\d]{2})-?([\d]{2})(T([\d]{2}):?([\d]{2}):?([\d]{2})(.([\d]{3}))?(Z|([\+\-])([\d]{2}):?([\d]{2})))?$/);if(r){var n,e=new Date(0);return r[4]?(e.setUTCFullYear(parseInt(r[1],10)),e.setUTCDate(parseInt(r[3],10)),e.setUTCMonth(parseInt(r[2],10)-1),e.setUTCHours(parseInt(r[5],10)),e.setUTCMinutes(parseInt(r[6],10)),e.setUTCSeconds(parseInt(r[7],10)),e.setUTCMilliseconds(parseInt(r[9]||"0",10)),r[10]&&"Z"!==r[10]&&(n=60*parseInt(r[12],10)+parseInt(r[13],10),e.setTime(("+"===r[11]?-1:1)*n*60*1e3+e.getTime()))):(e.setFullYear(parseInt(r[1],10)),e.setDate(parseInt(r[3],10)),e.setMonth(parseInt(r[2],10)-1),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)),e}throw new Error("Invalid date format is specified : "+t)};var n,i={YESTERDAY:1,TODAY:1,TOMORROW:1,LAST_WEEK:1,THIS_WEEK:1,NEXT_WEEK:1,LAST_MONTH:1,THIS_MONTH:1,NEXT_MONTH:1,LAST_90_DAYS:1,NEXT_90_DAYS:1,LAST_N_DAYS:2,NEXT_N_DAYS:2,NEXT_N_WEEKS:2,LAST_N_WEEKS:2,NEXT_N_MONTHS:2,LAST_N_MONTHS:2,THIS_QUARTER:1,LAST_QUARTER:1,NEXT_QUARTER:1,NEXT_N_QUARTERS:2,LAST_N_QUARTERS:2,THIS_YEAR:1,LAST_YEAR:1,NEXT_YEAR:1,NEXT_N_YEARS:2,LAST_N_YEARS:2,THIS_FISCAL_QUARTER:1,LAST_FISCAL_QUARTER:1,NEXT_FISCAL_QUARTER:1,NEXT_N_FISCAL_QUARTERS:2,LAST_N_FISCAL_QUARTERS:2,THIS_FISCAL_YEAR:1,LAST_FISCAL_YEAR:1,NEXT_FISCAL_YEAR:1,NEXT_N_FISCAL_YEARS:2,LAST_N_FISCAL_YEARS:2};for(n in i){var o=i[n];a[n]=1===o?new a(n):function(e){return function(t){return new a(e+":"+t)}}(n)}},{"lodash/core":43}],13:[function(e,t,r){"use strict";function n(e,t){t=t||{},this._conn=e,this.on("resume",function(t){e.emit("resume",t)}),this._responseType=t.responseType,this._transport=t.transport||e._transport,this._noContentResponse=t.noContentResponse}var i=e("inherits"),o=e("events"),s=e("lodash/core"),l=e("./promise");function a(t){return JSON.parse(t)}function u(t){var r={};if(e("xml2js").parseString(t,{explicitArray:!1},function(t,e){r={error:t,result:e}}),r.error)throw r.error;return r.result}function c(t){return e("./csv").parseCSV(t)}function h(t){return t}i(n,o.EventEmitter),n.prototype.request=function(r,t){function n(t){t?u.reject(t):(a!==e.instanceUrl&&(r.url=r.url.replace(a,e.instanceUrl)),i.request(r).then(function(t){u.resolve(t)},function(t){u.reject(t)}))}var i=this,e=this._conn,o=e._logger,s=this.getRefreshDelegate(),a=e.instanceUrl,u=l.defer();if(s&&s._refreshing)return s.once("resume",n),u.promise.thenCall(t);i.beforeSend(r),i.emit("request",r),o.debug("<request> method="+r.method+", url="+r.url);var c=Date.now();return this._transport.httpRequest(r).then(function(t){var e=Date.now();if(o.debug("elapsed time : "+(e-c)+"msec"),o.debug("<response> status="+t.statusCode+", url="+r.url),i.emit("response",t),i.isSessionExpired(t)&&s)return s.refresh(c,n),u.promise;if(i.isErrorResponse(t))throw i.getError(t);return i.getResponseBody(t)},function(t){var e=Date.now();throw o.debug("elapsed time : "+(e-c)+"msec"),o.error(t),t}).thenCall(t)},n.prototype.getRefreshDelegate=function(){return this._conn._refreshDelegate},n.prototype.beforeSend=function(t){if(t.headers=t.headers||{},this._conn.accessToken&&(t.headers.Authorization="Bearer "+this._conn.accessToken),this._conn.callOptions){var e,r=[];for(e in this._conn.callOptions)r.push(e+"="+this._conn.callOptions[e]);t.headers["Sforce-Call-Options"]=r.join(", ")}},n.prototype.getResponseContentType=function(t){return this._responseType||t.headers&&t.headers["content-type"]},n.prototype.parseResponseBody=function(e){var t=this.getResponseContentType(e),r=/^(text|application)\/xml(;|$)/.test(t)?u:/^application\/json(;|$)/.test(t)?a:/^text\/csv(;|$)/.test(t)?c:h;try{return r(e.body)}catch(t){return e.body}},n.prototype.getResponseBody=function(t){if(204===t.statusCode)return this._noContentResponse;var e,r=this.parseResponseBody(t);if(this.hasErrorInResponseBody(r))throw e=this.getError(t,r);if(300===t.statusCode)throw(e=new Error("Multiple records found")).name="MULTIPLE_CHOICES",e.content=r,e;return r},n.prototype.isSessionExpired=function(t){return 401===t.statusCode},n.prototype.isErrorResponse=function(t){return 400<=t.statusCode},n.prototype.hasErrorInResponseBody=function(t){return!1},n.prototype.parseError=function(t){return s.isArray(t)?t[0]:t},n.prototype.getError=function(t,e){var r;try{r=this.parseError(e||this.parseResponseBody(t))}catch(t){}r=s.isObject(r)&&s.isString(r.message)?r:{errorCode:"ERROR_HTTP_"+t.statusCode,message:t.body};var n,i=new Error(r.message);for(n in i.name=r.errorCode,r)i[n]=r[n];return i};function f(t,e){this._conn=t,this._refreshFn=e,this._refreshing=!1}i(f,o.EventEmitter),f.prototype.refresh=function(t,e){if(this._lastRefreshedAt>t)return e();var n=this,i=this._conn,o=i._logger;return n.once("resume",e),n._refreshing?void 0:(o.debug("<refresh token>"),n._refreshing=!0,n._refreshFn(i,function(t,e,r){t||(o.debug("Connection refresh completed."),i.accessToken=e,i.emit("refresh",e,r)),n._lastRefreshedAt=Date.now(),n._refreshing=!1,n.emit("resume",t)}))},n.SessionRefreshDelegate=f,t.exports=n},{"./csv":11,"./promise":17,events:37,inherits:39,"lodash/core":43,xml2js:78}],14:[function(t,e,r){"use strict";var n,i=e.exports=function(t){"string"==typeof t&&(t=o[t]),t=t||o.INFO,this._logLevel=t},o=i.LogLevels={DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5};for(n in i.prototype.log=function(t,e){this._logLevel<=t&&(t<o.ERROR?console.log(e):console.error(e))},o)i.prototype[n.toLowerCase()]=function(e){return function(t){this.log(e,t)}}(o[n])},{}],15:[function(t,e,r){"use strict";var n=t("querystring"),i=t("lodash/core"),o=t("./transport"),s="https://login.salesforce.com",e=e.exports=function(t){t.authzServiceUrl&&t.tokenServiceUrl?(this.loginUrl=t.authzServiceUrl.split("/").slice(0,3).join("/"),this.authzServiceUrl=t.authzServiceUrl,this.tokenServiceUrl=t.tokenServiceUrl,this.revokeServiceUrl=t.revokeServiceUrl):(this.loginUrl=t.loginUrl||s,this.authzServiceUrl=this.loginUrl+"/services/oauth2/authorize",this.tokenServiceUrl=this.loginUrl+"/services/oauth2/token",this.revokeServiceUrl=this.loginUrl+"/services/oauth2/revoke"),this.clientId=t.clientId,this.clientSecret=t.clientSecret,this.redirectUri=t.redirectUri,t.proxyUrl?this._transport=new o.ProxyTransport(t.proxyUrl):t.httpProxy?this._transport=new o.HttpProxyTransport(t.httpProxy):this._transport=new o};i.extend(e.prototype,{getAuthorizationUrl:function(t){return t=i.extend({response_type:"code",client_id:this.clientId,redirect_uri:this.redirectUri},t||{}),this.authzServiceUrl+(0<=this.authzServiceUrl.indexOf("?")?"&":"?")+n.stringify(t)},refreshToken:function(t,e){t={grant_type:"refresh_token",refresh_token:t,client_id:this.clientId};return this.clientSecret&&(t.client_secret=this.clientSecret),this._postParams(t,e)},requestToken:function(t,e,r){return"function"==typeof e&&(r=e,e={}),e=i.extend({grant_type:"authorization_code",code:t,client_id:this.clientId,redirect_uri:this.redirectUri},e||{}),this.clientSecret&&(e.client_secret=this.clientSecret),this._postParams(e,r)},authenticate:function(t,e,r){return this._postParams({grant_type:"password",username:t,password:e,client_id:this.clientId,client_secret:this.clientSecret,redirect_uri:this.redirectUri},r)},revokeToken:function(t,e){return this._transport.httpRequest({method:"POST",url:this.revokeServiceUrl,body:n.stringify({token:t}),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(t){if(400<=t.statusCode){var e=n.parse(t.body);e&&e.error||(e={error:"ERROR_HTTP_"+t.statusCode,error_description:t.body});t=new Error(e.error_description);throw t.name=e.error,t}}).thenCall(e)},_postParams:function(t,e){return this._transport.httpRequest({method:"POST",url:this.tokenServiceUrl,body:n.stringify(t),headers:{"content-type":"application/x-www-form-urlencoded"}}).then(function(t){var e;try{e=JSON.parse(t.body)}catch(t){}if(400<=t.statusCode){e=e||{error:"ERROR_HTTP_"+t.statusCode,error_description:t.body};var r=new Error(e.error_description);throw r.name=e.error,r}return e}).thenCall(e)}})},{"./transport":26,"lodash/core":43,querystring:51}],16:[function(t,e,r){"use strict";var o=t("lodash/core"),n=(t("./promise"),t("./connection"),e.exports=function(t){this.rule=new n(t),this.approval=new i(t)},function(t){this._conn=t});n.prototype.list=function(t){return this._conn.request("/process/rules").then(function(t){return t.rules}).thenCall(t)},n.prototype.trigger=function(t,e){return t=o.isArray(t)?t:[t],this._conn.request({method:"POST",url:"/process/rules/",body:JSON.stringify({contextIds:t}),headers:{"content-type":"application/json"}}).thenCall(e)};var i=function(t){this._conn=t};i.prototype.list=function(t){return this._conn.request("/process/approvals").then(function(t){return t.approvals}).thenCall(t)},i.prototype.request=function(t,e){return t=t.map(function(t){return t._request||t}),this._conn.request({method:"POST",url:"/process/approvals",headers:{"content-type":"application/json"},body:JSON.stringify({requests:t})}).thenCall(e)},i.prototype._createRequest=function(t,e,r,n,i){"function"==typeof r&&(i=r,r=n=null),"function"==typeof n&&(i=n,n=null),n=n||{};r={actionType:t,contextId:e,comments:r};return o.extend(r,n),new s(this,r).thenCall(i)},i.prototype.submit=function(t,e,r,n){return this._createRequest("Submit",t,e,r,n)},i.prototype.approve=function(t,e,r,n){return this._createRequest("Approve",t,e,r,n)},i.prototype.reject=function(t,e,r,n){return this._createRequest("Reject",t,e,r,n)};var s=function(t,e){this._process=t,this._request=e};s.prototype.then=function(t,e){this._promise||(this._promise=this._process.request([this]).then(function(t){return t[0]})),this._promise.then(t,e)},s.prototype.thenCall=function(e){return e?this.then(function(t){e(null,t)},function(t){e(t)}):this}},{"./connection":9,"./promise":17,"lodash/core":43}],17:[function(i,o,t){(function(r){"use strict";var t=i("lodash/core"),e=i("promise/lib/es6-extensions");e.prototype.thenCall=function(e){return t.isFunction(e)&&this.then(function(t){r.nextTick(function(){e(null,t)})},function(t){r.nextTick(function(){e(t)})}),this},e.prototype.fail=e.prototype.catch,e.defer=function(){return new n};var n=function(){var r=this;this.promise=new e(function(t,e){r.resolve=t,r.reject=e})};o.exports=e}).call(this,i("_process"))},{_process:46,"lodash/core":43,"promise/lib/es6-extensions":48}],18:[function(s,u,t){(function(r){"use strict";var t=s("inherits"),e=(s("events"),s("readable-stream")),c=s("lodash/core"),l=s("./promise"),n=(s("./date"),s("./soql-builder")),i=s("./record-stream"),o=u.exports=function(t,e,r){o.super_.call(this,{objectMode:!0}),this._conn=t,c.isString(e)?this._soql=e:e.locator&&0<=e.locator.indexOf("/")?this._locator=e.locator.split("/").pop():(this._config=e,this.select(e.fields),e.includes&&this.include(e.includes),e.sort&&this.sort(e.sort)),this._options=c.defaults(r||{},{maxFetch:1e4,autoFetch:!1,scanAll:!1,responseTarget:h.QueryResult}),this._executed=!1,this._finished=!1,this._chaining=!1,this._deferred=l.defer()};t(o,e.Readable),o.prototype.select=function(t){if(this._soql)throw Error("Cannot set select fields for the query which has already built SOQL.");if(t=t||"*",c.isString(t))t=t.split(/\s*,\s*/);else if(c.isObject(t)&&!c.isArray(t)){var e,r=[];for(e in t)t[e]&&r.push(e);t=r}return this._config.fields=t,this},o.prototype.where=function(t){if(this._soql)throw Error("Cannot set where conditions for the query which has already built SOQL.");return this._config.conditions=t,this},o.prototype.limit=function(t){if(this._soql)throw Error("Cannot set limit for the query which has already built SOQL.");return this._config.limit=t,this},o.prototype.skip=o.prototype.offset=function(t){if(this._soql)throw Error("Cannot set skip/offset for the query which has already built SOQL.");return this._config.offset=t,this},o.prototype.sort=o.prototype.orderby=function(t,e){if(this._soql)throw Error("Cannot set sort for the query which has already built SOQL.");return c.isString(t)&&c.isString(e)&&(t=[[t,e]]),this._config.sort=t,this},o.prototype.include=function(t,e,r,n){if(this._soql)throw Error("Cannot include child relationship into the query which has already built SOQL.");if(!c.isObject(t)){n={table:t,conditions:e,fields:r,limit:n&&n.limit,offset:n&&(n.offset||n.skip),sort:n&&n.sort};c.isArray(this._config.includes)||(this._config.includes=[]),this._config.includes.push(n);n=new a(this._conn,this,n);return this._children=this._children||[],this._children.push(n),n}var i,o=t;for(i in o){var s=o[i];this.include(i,s.conditions,s.fields,s)}},o.prototype.maxFetch=function(t){return this._options.maxFetch=t,this},o.prototype.autoFetch=function(t){return this._options.autoFetch=t,this},o.prototype.scanAll=function(t){return this._options.scanAll=t,this};var h=o.ResponseTargets={};["QueryResult","Records","SingleRecord","Count"].forEach(function(t){h[t]=t}),o.prototype.setResponseTarget=function(t){return t in h&&(this._options.responseTarget=t),this},o.prototype.run=o.prototype.exec=o.prototype.execute=function(r,n){var i=this,o=this._conn._logger,s=this._deferred;if(this._executed)return s.reject(new Error("re-executing already executed query")),this;if(this._finished)return s.reject(new Error("executing already closed query")),this;"function"==typeof r&&(n=r,r={}),r={headers:(r=r||{}).headers||i._options.headers,responseTarget:r.responseTarget||i._options.responseTarget,autoFetch:r.autoFetch||i._options.autoFetch,maxFetch:r.maxFetch||i._options.maxFetch,scanAll:r.scanAll||i._options.scanAll};function e(e,t){if(c.isFunction(n))try{t=n(e,t),e=null}catch(t){e=t}e?s.reject(e):s.resolve(t)}return this.once("response",function(t){e(null,t)}),this.once("error",function(t){e(t)}),this.once("fetch",function(){var e,t;r.responseTarget===h.Records&&(i._chaining||n)&&(o.debug("--- collecting all fetched records ---"),e=[],t=function(t){e.push(t)},i.on("record",t),i.once("end",function(){i.removeListener("record",t),i.emit("response",e,i)}))}),this._executed=!0,o.debug(">>> Query start >>>"),this._execute(r).then(function(){o.debug("*** Query finished ***")}).fail(function(t){o.debug("--- Query error ---"),i.emit("error",t)}),this},o.prototype._execute=function(o){var s=this,e=this._conn._logger,a=o.responseTarget,u=o.autoFetch,c=o.maxFetch,r=o.scanAll;return l.resolve(s._locator?s._conn._baseUrl()+"/query/"+s._locator:s.toSOQL().then(function(t){return s.totalFetched=0,e.debug("SOQL = "+t),s._conn._baseUrl()+"/"+(r?"queryAll":"query")+"?q="+encodeURIComponent(t)})).then(function(t){return s._conn.request({method:"GET",url:t,headers:o.headers})}).then(function(t){var e;switch(s.emit("fetch"),s.totalSize=t.totalSize,a){case h.SingleRecord:e=t.records&&0<t.records.length?t.records[0]:null;break;case h.Records:e=t.records;break;case h.Count:e=t.totalSize;break;default:e=t}a!==h.Records&&s.emit("response",e,s);for(var r=t.records&&t.records.length||0,n=0;n<r;n++){if(s.totalFetched>=c){s._finished=!0;break}var i=t.records[n];s.push(i),s.emit("record",i,s.totalFetched++,s)}return t.nextRecordsUrl&&(s._locator=t.nextRecordsUrl.split("/").pop()),s._finished=s._finished||t.done||!u,s._finished?s.push(null):s._execute(o),e})},o.prototype._read=function(t){this._finished||this._executed||this.execute({autoFetch:!0})},o.prototype.on=function(t,e){var r;return"record"===t&&(r=this).on("readable",function(){for(;null!==r.read(););}),o.super_.prototype.on.call(this,t,e)},o.prototype.addListener=o.prototype.on,o.prototype._expandFields=function(){if(this._soql)return l.reject(new Error("Cannot expand fields for the query which has already built SOQL."));var r,t,n=this,s=n._conn._logger,e=this._conn,i=this._config.table,o=this._config.fields||[];return s.debug("_expandFields: table = "+i+", fields = "+o.join(", ")),l.all([l.resolve(n._parent?(r=i,t=n._parent._config.table,s.debug('finding table for relation "'+r+'" in "'+t+'"...'),a(t).then(function(t){var e=r.toUpperCase(),t=c.find(t.childRelationships,function(t){return(t.relationshipName||"").toUpperCase()===e});return t?t.childSObject:l.reject(new Error("No child relationship found: "+r))})):i).then(function(e){return l.all(c.map(o,function(t){return function n(i,t){s.debug('expanding field "'+t+'" in "'+i+'"...');var o=t.split(".");return"*"===o[o.length-1]?a(i).then(function(t){if(s.debug("table "+i+"has been described"),1<o.length){var e=o.shift(),r=c.find(t.fields,function(t){return t.relationshipName&&t.relationshipName.toUpperCase()===e.toUpperCase()});if(r){var r=1===r.referenceTo.length?r.referenceTo[0]:"Name";return n(r,o.join(".")).then(function(t){return c.map(t,function(t){return e+"."+t})})}return[]}return c.map(t.fields,function(t){return t.name})}):l.resolve([t])}(e,t)})).then(function(t){n._config.fields=c.flatten(t)})}),l.all(c.map(n._children||[],function(t){return t._expandFields()}))]);function a(t){s.debug("describe cache: "+t);var r=l.defer();return e.describe$(t,function(t,e){s.debug("... done."),t?r.reject(t):r.resolve(e)}),r.promise}},o.prototype.explain=function(t){var e=this,r=this._conn._logger;return e.toSOQL().then(function(t){r.debug("SOQL = "+t);t="/query/?explain="+encodeURIComponent(t);return e._conn.request(t)}).thenCall(t)},o.prototype.toSOQL=function(t){var e=this;return l.resolve(e._soql||e._expandFields().then(function(){return n.createSOQL(e._config)})).thenCall(t)},o.prototype.stream=i.Serializable.prototype.stream,o.prototype.map=i.prototype.map,o.prototype.filter=i.prototype.map;o.prototype.delete=o.prototype.del=o.prototype.destroy=function(o,t,e){if("function"==typeof o?(e=o,t={},o=null):"object"==typeof o&&null!==o&&(e=t,t=o,o=null),t=t||{},!(o=o||this._config&&this._config.table))throw new Error("SOQL based query needs SObject type information to bulk delete.");var s=!1===t.allowBulk?-1:"number"==typeof t.bulkThreshold?t.bulkThreshold:this._conn._ensureVersion(42)?200:this._conn.maxRequest/2,a=this;return new l(function(e,r){var n=[],i=null;a.on("data",function(t){t.Id?(t={Id:t.Id},i?i.write(t):(n.push(t),(s<0||n.length>s)&&(i=a._conn.sobject(o).deleteBulk().on("response",e).on("error",r),n.forEach(function(t){i.write(t)}),n=[]))):a.emit("error",new Error("Queried record does not include Salesforce record ID."))}).on("end",function(){var t;i?i.end():(t=n.map(function(t){return t.Id}),a._conn.sobject(o).destroy(t,{allowRecursive:!0}).then(e,r))}).on("error",r)}).thenCall(e)},o.prototype.update=function(t,o,e,r){if("function"==typeof o?(r=o,e={},o=null):"object"==typeof o&&null!==o&&(r=e,e=o,o=null),e=e||{},!(o=o||this._config&&this._config.table))throw new Error("SOQL based query needs SObject type information to bulk update.");var s=c.isFunction(t)?i.map(t):i.recordMapStream(t),a=!1===e.allowBulk?-1:"number"==typeof e.bulkThreshold?e.bulkThreshold:this._conn._ensureVersion(42)?200:this._conn.maxRequest/2,u=this;return new l(function(e,r){var n=[],i=null;u.on("error",r).pipe(s).on("data",function(t){i?i.write(t):(n.push(t),(a<0||n.length>a)&&(i=u._conn.sobject(o).updateBulk().on("response",e).on("error",r),n.forEach(function(t){i.write(t)}),n=[]))}).on("end",function(){i?i.end():u._conn.sobject(o).update(n,{allowRecursive:!0}).then(e,r)}).on("error",r)}).thenCall(r)},o.prototype.then=function(t,e){return this._chaining=!0,this._finished||this._executed||this.execute(),this._deferred.promise.then.apply(this._deferred.promise,arguments)},o.prototype.thenCall=function(e){return c.isFunction(e)&&this.then(function(t){r.nextTick(function(){e(null,t)})},function(t){r.nextTick(function(){e(t)})}),this};var a=function(t,e,r){a.super_.call(this,t,r),this._parent=e};t(a,o),a.prototype.include=function(){throw new Error("Not allowed to include another subquery in subquery.")},a.prototype.end=function(){return this._parent},a.prototype.run=a.prototype.exec=a.prototype.execute=function(){return this._parent.execute.apply(this._parent,arguments)}}).call(this,s("_process"))},{"./date":12,"./promise":17,"./record-stream":20,"./soql-builder":25,_process:46,events:37,inherits:39,"lodash/core":43,"readable-stream":62}],19:[function(t,e,r){"use strict";e=e.exports=function(t,e){this._conn=t,this._path=e};e.prototype.describe=function(t){var e=this._path+"/describe";return this._conn.request(e).thenCall(t)},e.prototype.defaultValues=function(t,e){"function"==typeof t&&(e=t,t=null);var r=this._path+"/defaultValues";return t&&(r+="/"+t),this._conn.request(r).thenCall(e)},e.prototype.execute=function(t,e,r){e={contextId:t,record:e};return this._conn.requestPost(this._path,e).thenCall(r)}},{}],20:[function(t,e,r){"use strict";t("events");var n=t("readable-stream"),i=(n.Duplex,n.Transform),o=n.PassThrough,n=t("inherits"),a=t("lodash/core"),s=t("./csv"),u=e.exports=function(){u.super_.call(this,{objectMode:!0})};n(u,i),u.prototype._transform=function(t,e,r){this.emit("record",t),this.push(t),r()},u.prototype.map=function(t){return this.pipe(u.map(t))},u.prototype.filter=function(t){return this.pipe(u.filter(t))};var c=u.Serializable=function(){c.super_.call(this),this._dataStream=null};n(c,u),c.prototype.stream=function(t,e){var r=h[t=t||"csv"];if(!r)throw new Error("Converting ["+t+"] data stream is not supported.");return this._dataStream||(this._dataStream=new o,this.pipe(r.serialize(e)).pipe(this._dataStream)),this._dataStream};var l=u.Parsable=function(){l.super_.call(this),this._dataStream=null};n(l,u),l.prototype.stream=function(t,e){var r=h[t=t||"csv"],n=this;if(!r)throw new Error("Converting ["+t+"] data stream is not supported.");return this._dataStream||(this._dataStream=new o,this._parserStream=r.parse(e).on("error",function(t){n.emit("error",t)}),this._parserStream.pipe(this).pipe(new o({objectMode:!0,highWaterMark:5e5}))),this._dataStream},l.prototype.on=function(t,e){return"readable"!==t&&"record"!==t||this._dataStream.pipe(this._parserStream),l.super_.prototype.on.call(this,t,e)},l.prototype.addListener=l.prototype.on,u.map=function(n){var t=new u.Serializable;return t._transform=function(t,e,r){t=n(t)||t;this.push(t),r()},t},u.recordMapStream=function(n,i){return u.map(function(t){var e,r={Id:t.Id};for(e in n)r[e]=i?n[e]:function(t,r){{if(a.isString(t)){var e=/^\$\{(\w+)\}$/.exec(t);return e?r[e[1]]:t.replace(/\$\{(\w+)\}/g,function(t,e){e=r[e];return a.isNull(e)||a.isUndefined(e)?"":String(e)})}return t}}(n[e],t);return r})},u.filter=function(n){var t=new u.Serializable;return t._transform=function(t,e,r){n(t)&&this.push(t),r()},t};var n={serialize:function(e){return e=e||{},r=u.map(function(t){return function o(t,s){return Object.keys(t).reduce(function(t,r){var n,e=t[r],i={};return"attributes"===r?delete(t=a.extend({},t))[r]:s.nullValue&&null===e?(i[r]=s.nullValue,t=a.extend({},t,i)):null!==e&&"object"==typeof e&&(n=o(e,s),t=Object.keys(n).reduce(function(t,e){return t[r+"."+e]=n[e],t},a.extend({},t))),t},t)}(t,e)}),n=s.serializeCSVStream(e),(i=new o).on("pipe",function(t){t.unpipe(i),t.pipe(r).pipe(n)}),i.pipe=function(t,e){return n.pipe(t,e)},i;var r,n,i},parse:function(t){return s.parseCSVStream(t)}},h=u.DataStreamConverters={csv:n}},{"./csv":11,events:37,inherits:39,"lodash/core":43,"readable-stream":62}],21:[function(t,e,r){"use strict";var n=t("lodash/core"),e=e.exports=function(t,e,r){this._conn=t,this.type=e,this.id=r};e.prototype.retrieve=function(t,e){return"function"==typeof t&&(e=t,t={}),this._conn.retrieve(this.type,this.id,t,e)},e.prototype.update=function(t,e,r){return"function"==typeof e&&(r=e,e={}),(t=n.clone(t)).Id=this.id,this._conn.update(this.type,t,e,r)},e.prototype.delete=e.prototype.del=e.prototype.destroy=function(t,e){return"function"==typeof t&&(e=t,t={}),this._conn.destroy(this.type,this.id,t,e)},e.prototype.blob=function(t){t=[this._conn._baseUrl(),"sobjects",this.type,this.id,t].join("/");return this._conn.request(t).stream()}},{"lodash/core":43}],22:[function(t,e,r){"use strict";var n=t("./_required");e.exports=function(t){"./jsforce"!==t&&"jsforce"!==t||(t="./core");var e=n[t];if(void 0===e)throw new Error("Cannot find module '"+t+"'");return e}},{"./_required":3}],23:[function(t,e,r){"use strict";var n=t("inherits"),s=t("lodash/core"),t=(t("xml2js"),t("./http-api")),i=e.exports=function(t,e){i.super_.apply(this,arguments),this._endpointUrl=e.endpointUrl,this._xmlns=e.xmlns||"urn:partner.soap.sforce.com"};function o(t,e){var r=e.shift();if(r){for(var n in t)if(r.test(n))return o(t[n],e);return null}return t}function a(e,t){if(s.isObject(e)&&(t=e,e=null),s.isArray(t))return s.map(t,function(t){return a(e,t)}).join("");var r=[],n=[];if(s.isObject(t)){for(var i in t){var o=t[i];"@"===i[0]?(i=i.substring(1),r.push(i+'="'+o+'"')):n.push(a(i,o))}t=n.join("")}else t=String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return(e?"<"+e+(0<r.length?" "+r.join(" "):"")+">":"")+t+(e?"</"+e+">":"")}n(i,t),i.prototype.invoke=function(t,e,r,n){"function"==typeof r&&(n=r,r=null);var i={};return i[t]=e,this.request({method:"POST",url:this._endpointUrl,headers:{"Content-Type":"text/xml",SOAPAction:'""'},message:i}).then(function(t){return r?function e(t,r){{if(s.isArray(t))return t.map(function(t){return e(t,r&&r[0])});if(s.isObject(t)){if(t.$&&"true"===t.$["xsi:nil"])return null;if(s.isArray(r))return[e(t,r[0])];var n,i={};for(n in t)i[n]=e(t[n],r&&r[n]);return i}if(s.isArray(r))return[e(t,r[0])];if(s.isObject(r))return{};switch(r){case"string":return String(t);case"number":return Number(t);case"boolean":return"true"===t;default:return t}}}(t,r):t}).thenCall(n)},i.prototype.beforeSend=function(t){t.body=this._createEnvelope(t.message)},i.prototype.isSessionExpired=function(t){return 500===t.statusCode&&/<faultcode>[a-zA-Z]+:INVALID_SESSION_ID<\/faultcode>/.test(t.body)},i.prototype.parseError=function(t){t=o(t,[/:Envelope$/,/:Body$/,/:Fault$/]);return{errorCode:t.faultcode,message:t.faultstring}},i.prototype.getResponseBody=function(t){return o(i.super_.prototype.getResponseBody.call(this,t),[/:Envelope$/,/:Body$/,/.+/])},i.prototype._createEnvelope=function(t){var e={},r=this._conn;return r.accessToken&&(e.SessionHeader={sessionId:this._conn.accessToken}),r.callOptions&&(e.CallOptions=r.callOptions),['<?xml version="1.0" encoding="UTF-8"?>','<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"',' xmlns:xsd="http://www.w3.org/2001/XMLSchema"',' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">','<soapenv:Header xmlns="'+this._xmlns+'">',a(e),"</soapenv:Header>",'<soapenv:Body xmlns="'+this._xmlns+'">',a(t),"</soapenv:Body>","</soapenv:Envelope>"].join("")}},{"./http-api":13,inherits:39,"lodash/core":43,xml2js:78}],24:[function(t,e,r){"use strict";var i=t("lodash/core"),n=t("./record"),o=t("./query"),s=(t("./cache"),t("./quick-action")),e=e.exports=function(t,e){this._conn=t,this.type=e;e={key:"describe."+this.type};this.describe$=t.cache.makeCacheable(this.describe,this,e),this.describe=t.cache.makeResponseCacheable(this.describe,this,e),e={key:"layouts."+this.type},this.layouts$=t.cache.makeCacheable(this.layouts,this,e),this.layouts=t.cache.makeResponseCacheable(this.layouts,this,e),e={key:"compactLayouts."+this.type},this.compactLayouts$=t.cache.makeCacheable(this.compactLayouts,this,e),this.compactLayouts=t.cache.makeResponseCacheable(this.compactLayouts,this,e),e={key:"approvalLayouts."+this.type},this.approvalLayouts$=t.cache.makeCacheable(this.approvalLayouts,this,e),this.approvalLayouts=t.cache.makeResponseCacheable(this.approvalLayouts,this,e)};e.prototype.insert=e.prototype.create=function(t,e,r){return"function"==typeof e&&(r=e,e={}),this._conn.create(this.type,t,e,r)},e.prototype.retrieve=function(t,e,r){return"function"==typeof e&&(r=e,e={}),this._conn.retrieve(this.type,t,e,r)},e.prototype.update=function(t,e,r){return"function"==typeof e&&(r=e,e={}),this._conn.update(this.type,t,e,r)},e.prototype.upsert=function(t,e,r,n){return"function"==typeof r&&(n=r,r={}),this._conn.upsert(this.type,t,e,r,n)},e.prototype.delete=e.prototype.del=e.prototype.destroy=function(t,e,r){return"function"==typeof e&&(r=e,e={}),this._conn.destroy(this.type,t,e,r)},e.prototype.describe=function(t){return this._conn.describe(this.type,t)},e.prototype.record=function(t){return new n(this._conn,this.type,t)},e.prototype.find=function(t,e,r,n){"function"==typeof t?(n=t,t={},r=e=null):"function"==typeof e?(n=e,r=e=null):"function"==typeof r&&(n=r,r=null);t={fields:e,includes:(r=r||{}).includes,table:this.type,conditions:t,limit:r.limit,sort:r.sort,offset:r.offset||r.skip},r=new o(this._conn,t,r);return r.setResponseTarget(o.ResponseTargets.Records),n&&r.run(n),r},e.prototype.findOne=function(t,e,r,n){"function"==typeof t?(n=t,t={},r=e=null):"function"==typeof e?(n=e,r=e=null):"function"==typeof r&&(n=r,r=null),r=i.extend(r||{},{limit:1});r=this.find(t,e,r);return r.setResponseTarget(o.ResponseTargets.SingleRecord),n&&r.run(n),r},e.prototype.select=function(t,e){return this.find(null,t,null,e)},e.prototype.count=function(t,e){"function"==typeof t&&(e=t,t={});t=this.find(t,{"count()":!0});return t.setResponseTarget("Count"),e&&t.run(e),t},e.prototype.bulkload=function(t,e,r,n){return this._conn.bulk.load(this.type,t,e,r,n)},e.prototype.insertBulk=e.prototype.createBulk=function(t,e){return this.bulkload("insert",t,e)},e.prototype.updateBulk=function(t,e){return this.bulkload("update",t,e)},e.prototype.upsertBulk=function(t,e,r){return this.bulkload("upsert",{extIdField:e},t,r)},e.prototype.deleteBulk=e.prototype.destroyBulk=function(t,e){return this.bulkload("delete",t,e)},e.prototype.deleteHardBulk=e.prototype.destroyHardBulk=function(t,e){return this.bulkload("hardDelete",t,e)},e.prototype.recent=function(t){return this._conn.recent(this.type,t)},e.prototype.updated=function(t,e,r){return this._conn.updated(this.type,t,e,r)},e.prototype.deleted=function(t,e,r){return this._conn.deleted(this.type,t,e,r)},e.prototype.layouts=function(t,e){"function"==typeof t&&(e=t,t=null);t="/sobjects/"+this.type+"/describe/"+(t?"namedLayouts/"+t:"layouts");return this._conn.request(t,e)},e.prototype.compactLayouts=function(t){var e="/sobjects/"+this.type+"/describe/compactLayouts";return this._conn.request(e,t)},e.prototype.approvalLayouts=function(t){var e="/sobjects/"+this.type+"/describe/approvalLayouts";return this._conn.request(e,t)},e.prototype.listviews=function(t){var e=this._conn._baseUrl()+"/sobjects/"+this.type+"/listviews";return this._conn.request(e,t)},e.prototype.listview=function(t){return new a(this._conn,this.type,t)},e.prototype.quickActions=function(t){return this._conn.request("/sobjects/"+this.type+"/quickActions").thenCall(t)},e.prototype.quickAction=function(t){return new s(this._conn,"/sobjects/"+this.type+"/quickActions/"+t)};var a=function(t,e,r){this._conn=t,this.type=e,this.id=r};a.prototype.results=function(t){var e=this._conn._baseUrl()+"/sobjects/"+this.type+"/listviews/"+this.id+"/results";return this._conn.request(e,t)},a.prototype.describe=function(t,e){"function"==typeof t&&(e=t,t={}),t=t||{};var r=this._conn._baseUrl()+"/sobjects/"+this.type+"/listviews/"+this.id+"/describe";return this._conn.request({method:"GET",url:r,headers:t.headers},e)},a.prototype.explain=function(t){var e="/query/?explain="+this.id;return this._conn.request(e,t)}},{"./cache":8,"./query":18,"./quick-action":19,"./record":21,"lodash/core":43}],25:[function(t,e,r){"use strict";var a=t("lodash/core"),n=t("./date");function i(t){var e,e=["SELECT ",(e=t.fields,r=t.includes,r=a.map(a.values(r||{}),function(t){return"("+i(t)+")"}),(e||["Id"]).concat(r).join(", "))," FROM ",t.table].join(""),r=function n(i,o,s){if(a.isString(i))return i;i=i||[];o=o||"AND";s=s||0;i=l(i)?i.map(function(t){var e,r=[];for(e in t)r.push({key:e,value:t[e]});return 1<r.length?r:r[0]}):a.keys(i).map(function(t){return{key:t,value:i[t]}});i=i.map(function(t){var e,r=s+1;switch(t.key){case"$or":case"$and":case"$not":return"NOT"!==o&&1===i.length&&(r=s),e="$or"===t.key?"OR":"$and"===t.key?"AND":"NOT",n(t.value,e,r);default:return u(t.key,t.value)}}).filter(function(t){return t});var t;return"NOT"===o?((t=0<s)?"(":"")+"NOT "+i[0]+(t?")":""):((t=0<s&&1<i.length)?"(":"")+i.join(" "+o+" ")+(t?")":"")}(t.conditions);r&&(e+=" WHERE "+r);r=function(e){if(e=e||[],a.isString(e)){if(/,|\s+(asc|desc)\s*$/.test(e))return e;e=e.split(/\s+/).map(function(t){var e="ASC",r=t[0];return"-"===r?(e="DESC",t=t.substring(1)):"+"===r&&(t=t.substring(1)),[t,e]})}else l(e)||(e=a.keys(e).map(function(t){return[t,e[t]]}));return e.map(function(t){var e=t[0],r=t[1];switch(String(r)){case"DESC":case"desc":case"descending":case"-":case"-1":r="DESC";break;default:r="ASC"}return e+" "+r}).join(", ")}(t.sort);return r&&(e+=" ORDER BY "+r),t.limit&&(e+=" LIMIT "+t.limit),t.offset&&(e+=" OFFSET "+t.offset),e}var o={"=":"=",$eq:"=","!=":"!=",$ne:"!=",">":">",$gt:">","<":"<",$lt:"<",">=":">=",$gte:">=","<=":"<=",$lte:"<=",$like:"LIKE",$nlike:"NOT LIKE",$in:"IN",$nin:"NOT IN",$includes:"INCLUDES",$excludes:"EXCLUDES",$exists:"EXISTS"};function u(r,t){return a.isArray(t)?s(r,"$in",t):a.isObject(t)?a.map(t,function(t,e){if("$"===e[0])return s(r,e,t)}).join(" AND "):s(r,"$eq",t)}function s(t,e,r){var n=o[e];if(!n||a.isUndefined(r))return null;var i=c(r);if(a.isUndefined(i))return null;switch(n){case"NOT LIKE":return"("+["NOT",t,"LIKE",i].join(" ")+")";case"EXISTS":return[t,r?"!=":"=","null"].join(" ");default:return[t,n,i].join(" ")}}function c(t){return l(t)?0<t.length?"("+t.map(c).join(", ")+")":void 0:t instanceof n?t.toString():a.isString(t)?"'"+String(t||"").replace(/'/g,"\\'")+"'":a.isNumber(t)?t.toString():a.isNull(t)?"null":t}function l(t){return a.isObject(t)&&a.isFunction(t.pop)}r.createSOQL=i},{"./date":12,"lodash/core":43}],26:[function(h,f,t){(function(t){"use strict";var e,o,r=h("inherits"),s=h("./promise"),n=h("request"),i=h("./browser/canvas"),a=h("./browser/jsonp");n.defaults&&(e={followAllRedirects:!0},t.env.HTTP_PROXY&&(e.proxy=t.env.HTTP_PROXY),parseInt(t.env.HTTP_TIMEOUT)&&(e.timeout=parseInt(t.env.HTTP_TIMEOUT)),n=n.defaults(e)),o="undefined"==typeof window?t.env.LOCATION_BASE_URL||"":(u=function(t){var e=/(\w+)\.(visual\.force|salesforce)\.com$/.exec(t);e&&(t=e[1]+".salesforce.com");return t}(window.location.host))?"https://"+u:"";t=f.exports=function(){};t.prototype.httpRequest=function(t,e){var r,n=s.defer(),i=this._getHttpRequestModule();return function t(e,r){var n=e.then;return e.then=function(){return r(),t(n.apply(e,arguments),r)},e.stream=r,e}(n.promise,function(){return r=r||i(t,function(t,e){t?n.reject(t):n.resolve(e)})}).thenCall(e)},t.prototype._getHttpRequestModule=function(){return n};var u=t.JsonpTransport=function(t){this._jsonpParam=t};r(u,t),u.prototype._getHttpRequestModule=function(){return a.createRequest(this._jsonpParam)},u.supported=a.supported;u=t.CanvasTransport=function(t){this._signedRequest=t};r(u,t),u.prototype._getHttpRequestModule=function(){return i.createRequest(this._signedRequest)},u.supported=i.supported;var c=t.ProxyTransport=function(t){this._proxyUrl=t};r(c,t),c.prototype.httpRequest=function(t,e){var r=t.url;0===r.indexOf("/")&&(r=o+r);var n={method:t.method,url:this._proxyUrl+"?"+Date.now()+"."+(""+Math.random()).substring(2),headers:{"salesforceproxy-endpoint":r}};if(!t.body&&""!==t.body||(n.body=t.body),t.headers)for(var i in t.headers)n.headers[i]=t.headers[i];return c.super_.prototype.httpRequest.call(this,n,e)};var l=t.HttpProxyTransport=function(t){this._httpProxy=t};r(l,t),l.prototype.httpRequest=function(t,e){var r=t.url;0===r.indexOf("/")&&(r=o+r);var n={method:t.method,url:t.url,proxy:this._httpProxy,headers:{}};if(!t.body&&""!==t.body||(n.body=t.body),t.headers)for(var i in t.headers)n.headers[i]=t.headers[i];return l.super_.prototype.httpRequest.call(this,n,e)}}).call(this,h("_process"))},{"./browser/canvas":4,"./browser/jsonp":6,"./promise":17,_process:46,inherits:39,request:7}],27:[function(t,h,e){(function(t){"use strict";function e(t){n.length||(r(),0),n[n.length]=t}h.exports=e;var r,n=[],i=0;function o(){for(;i<n.length;){var t=i;if(i+=1,n[t].call(),1024<i){for(var e=0,r=n.length-i;e<r;e++)n[e]=n[e+i];n.length-=i,i=0}}n.length=0,i=0,0}var s,a,u,t=void 0!==t?t:self,c=t.MutationObserver||t.WebKitMutationObserver;function l(n){return function(){var t=setTimeout(r,0),e=setInterval(r,50);function r(){clearTimeout(t),clearInterval(e),n()}}}r="function"==typeof c?(a=1,s=new c(s=o),u=document.createTextNode(""),s.observe(u,{characterData:!0}),function(){a=-a,u.data=a}):l(o),e.requestFlush=r,e.makeRequestCallFromTimer=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(t,e,r){"use strict";r.byteLength=function(t){var e=l(t),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(t){for(var e,r=l(t),n=r[0],r=r[1],i=new c(function(t,e){return 3*(t+e)/4-e}(n,r)),o=0,s=0<r?n-4:n,a=0;a<s;a+=4)e=u[t.charCodeAt(a)]<<18|u[t.charCodeAt(a+1)]<<12|u[t.charCodeAt(a+2)]<<6|u[t.charCodeAt(a+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=255&e;2===r&&(e=u[t.charCodeAt(a)]<<2|u[t.charCodeAt(a+1)]>>4,i[o++]=255&e);1===r&&(e=u[t.charCodeAt(a)]<<10|u[t.charCodeAt(a+1)]<<4|u[t.charCodeAt(a+2)]>>2,i[o++]=e>>8&255,i[o++]=255&e);return i},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(function(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(function(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}(n));return i.join("")}(t,o,s<o+16383?s:o+16383));1==n?(e=t[r-1],i.push(a[e>>2]+a[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],i.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return i.join("")};for(var a=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)a[i]=n[i],u[n.charCodeAt(i)]=i;function l(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return-1===t&&(t=e),[t,t===e?0:4-t%4]}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],29:[function(t,e,r){},{}],30:[function(t,e,r){"use strict";var a=t("base64-js"),o=t("ieee754");r.Buffer=h,r.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},r.INSPECT_MAX_BYTES=50;var n=2147483647;function i(t){if(n<t)throw new RangeError("Invalid typed array length");t=new Uint8Array(t);return t.__proto__=h.prototype,t}function h(t,e,r){if("number"!=typeof t)return s(t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}function s(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return C(t)||t&&C(t.buffer)?function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');r=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return r.__proto__=h.prototype,r}(t,e,r):"string"==typeof t?function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=i(r),e=n.write(t,e);e!==r&&(n=n.slice(0,e));return n}(t,e):function(t){if(h.isBuffer(t)){var e=0|f(t.length),r=i(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(ArrayBuffer.isView(t)||"length"in t)return"number"!=typeof t.length||L(t.length)?i(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}(t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t){return u(t),i(t<0?0:0|f(t))}function l(t){for(var e=t.length<0?0:0|f(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(n)return A(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n,i,o,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[o]);return i}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":return n=this,o=r,0===(i=e)&&o===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,e,r);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),L(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o=1,s=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s/=o=2,a/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var c=-1,l=r;l<s;l++)if(u(t,l)===u(e,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===a)return c*o}else-1!==c&&(l-=l-c),c=-1;else for(s<r+a&&(r=s-a),l=r;0<=l;l--){for(var h=!0,f=0;f<a;f++)if(u(t,l+f)!==u(e,f)){h=!1;break}if(h)return l}return-1}function _(t,e,r,n){return N(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return N(function(t,e){for(var r,n,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,n=n%256,i.push(n),i.push(r);return i}(e,t.length-r),t,r,n)}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,c=t[i],l=null,h=239<c?4:223<c?3:191<c?2:1;if(i+h<=r)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&c)<<6|63&o)&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&c)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(l=u)}null===l?(l=65533,h=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=w));return r}(n)}r.kMaxLength=n,(h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{get:function(){if(this instanceof h)return this.buffer}}),Object.defineProperty(h.prototype,"offset",{get:function(){if(this instanceof h)return this.byteOffset}}),"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=s,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(t,e,r){return e=e,r=r,u(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)},h.allocUnsafe=c,h.allocUnsafeSlow=c,h.isBuffer=function(t){return null!=t&&!0===t._isBuffer},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);if(void 0===e)for(i=e=0;i<t.length;++i)e+=t[i].length;for(var r=h.allocUnsafe(e),n=0,i=0;i<t.length;++i){var o=t[i];if(ArrayBuffer.isView(o)&&(o=h.from(o)),!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},h.byteLength=p,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},h.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},h.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?b(this,0,t):d.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,n,i){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=t.slice(e,r),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},h.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,u=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;(!n||i<(n=Number(n)))&&(n=i),(i=e.length)/2<n&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(L(s))return o;t[r+o]=s}return o}(this,t,e,r);case"utf8":case"utf-8":return s=e,a=r,N(A(t,(o=this).length-s),o,s,a);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return o=this,s=e,a=r,N(D(t),o,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function E(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,i,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,i){return e=+e,r>>>=0,i||S(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function O(t,e,r,n,i){return e=+e,r>>>=0,i||S(t,0,r,8),o.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t);e=this.subarray(t,e);return e.__proto__=h.prototype,e},h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},h.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),o.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),o.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),o.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),o.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||T(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||T(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,n){t=+t,e>>>=0,n||T(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){t=+t,e>>>=0,n||T(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),e=e||0,0<n&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;0<=o;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},h.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i;1===t.length&&(i=t.charCodeAt(0),("utf8"===n&&i<128||"latin1"===n)&&(t=i))}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(o=e;o<r;++o)this[o]=t;else{var s=h.isBuffer(t)?t:new h(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var I=/[^+/0-9A-Za-z-_]/g;function A(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,r<128){if(--e<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return a.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function L(t){return t!=t}},{"base64-js":28,ieee754:38}],31:[function(t,e,r){(function(t){function e(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===e(t)},r.isObject=function(t){return"object"==typeof t&&null!==t},r.isDate=function(t){return"[object Date]"===e(t)},r.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":40}],32:[function(t,e,r){(function(i){"use strict";function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var t=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:100;!function(t){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.size=t,this.length=0,this.buf=i.alloc(t)}var t,r,n;return t=e,(r=[{key:"prepend",value:function(t){var e=this.length++;e===this.size&&this.resize();var r=this.clone();this.buf[0]=t,r.copy(this.buf,1,0,e)}},{key:"append",value:function(t){var e=this.length++;e===this.size&&this.resize(),this.buf[e]=t}},{key:"clone",value:function(){return i.from(this.buf.slice(0,this.length))}},{key:"resize",value:function(){var t=this.length;this.size=2*this.size;var e=i.alloc(this.size);this.buf.copy(e,0,0,t),this.buf=e}},{key:"toString",value:function(){return this.buf.slice(0,this.length).toString()}},{key:"toJSON",value:function(){return this.toString()}},{key:"reset",value:function(){this.length=0}}])&&o(t.prototype,r),n&&o(t,n),e}();e.exports=t}).call(this,t("buffer").Buffer)},{buffer:30}],33:[function(T,S,t){(function(k,u){"use strict";function e(t){var n="function"==typeof Map?new Map:void 0;return(e=function(t){if(null===t||(e=t,-1===Function.toString.call(e).indexOf("[native code]")))return t;var e;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return i(t,arguments,y(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,t)})(t)}function i(t,e,r){return(i=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(t){return}}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);n=new(Function.bind.apply(t,n));return r&&a(n,r.prototype),n}).apply(null,arguments)}function c(t){return(c="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})(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function r(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function h(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach(function(t){var e,r;e=n,t=i[r=t],r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(i,t))})}return n}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?d(t):e}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function t(){var t,e,r,n;for(n in arguments){var i=arguments[n],o=c(i);if(void 0!==t||"string"!=typeof i&&!k.isBuffer(i))if(void 0===e&&b(i))e=i;else{if(void 0!==r||"function"!==o)throw new U("CSV_INVALID_ARGUMENT",["Invalid argument:","got ".concat(JSON.stringify(i)," at index ").concat(n)]);r=i}else t=i}var s,a=new _(e);return r&&(s=void 0===e||void 0===e.objname?[]:{},a.on("readable",function(){for(var t;null!==(t=this.read());)void 0===e||void 0===e.objname?s.push(t):s[t[0]]=t[1]}),a.on("error",function(t){r(t,void 0,a.info)}),a.on("end",function(){r(void 0,s,a.info)})),void 0!==t&&("function"==typeof u?u(function(){a.write(t),a.end()}):(a.write(t),a.end())),a}var m=T("stream").Transform,g=T("./ResizeableBuffer"),M=k.from([239,187,191]),_=function(){function a(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};f(this,a),t=p(this,y(a).call(this,h({},{readableObjectMode:!0},{},e)));var r,n={};for(r in e)n[v(r)]=e[r];if(void 0===n.bom||null===n.bom||!1===n.bom)n.bom=!1;else if(!0!==n.bom)throw new U("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,","got ".concat(JSON.stringify(n.bom))]);var i=null;if(void 0===n.cast||null===n.cast||!1===n.cast||""===n.cast)n.cast=void 0;else if("function"==typeof n.cast)i=n.cast,n.cast=!0;else if(!0!==n.cast)throw new U("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,","got ".concat(JSON.stringify(n.cast))]);if(void 0===n.cast_date||null===n.cast_date||!1===n.cast_date||""===n.cast_date)n.cast_date=!1;else if(!0===n.cast_date)n.cast_date=function(t){var e=Date.parse(t);return isNaN(e)?t:new Date(e)};else if("function"!=typeof n.cast_date)throw new U("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,","got ".concat(JSON.stringify(n.cast_date))]);var o=null;if(!0===n.columns)o=void 0;else if("function"==typeof n.columns)o=n.columns,n.columns=!0;else if(Array.isArray(n.columns))n.columns=E(n.columns);else{if(void 0!==n.columns&&null!==n.columns&&!1!==n.columns)throw new U("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an object, a function or true,","got ".concat(JSON.stringify(n.columns))]);n.columns=!1}if(void 0===n.columns_duplicates_to_array||null===n.columns_duplicates_to_array||!1===n.columns_duplicates_to_array)n.columns_duplicates_to_array=!1;else if(!0!==n.columns_duplicates_to_array)throw new U("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","expect an boolean,","got ".concat(JSON.stringify(n.columns_duplicates_to_array))]);if(void 0===n.comment||null===n.comment||!1===n.comment||""===n.comment)n.comment=null;else if("string"==typeof n.comment&&(n.comment=k.from(n.comment)),!k.isBuffer(n.comment))throw new U("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,","got ".concat(JSON.stringify(n.comment))]);var s=JSON.stringify(n.delimiter);if(Array.isArray(n.delimiter)||(n.delimiter=[n.delimiter]),0===n.delimiter.length)throw new U("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,","got ".concat(s)]);if(n.delimiter=n.delimiter.map(function(t){if(null==t||!1===t)return k.from(",");if("string"==typeof t&&(t=k.from(t)),!k.isBuffer(t)||0===t.length)throw new U("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,","got ".concat(s)]);return t}),void 0===n.escape||null===n.escape?n.escape=k.from('"'):"string"==typeof n.escape&&(n.escape=k.from(n.escape)),!k.isBuffer(n.escape))throw new Error("Invalid Option: escape must be a buffer or a string, got ".concat(JSON.stringify(n.escape)));if(1!==n.escape.length)throw new Error("Invalid Option Length: escape must be one character, got ".concat(n.escape.length));if(n.escape=n.escape[0],void 0===n.from||null===n.from)n.from=1;else{if("string"==typeof n.from&&/\d+/.test(n.from)&&(n.from=parseInt(n.from)),!Number.isInteger(n.from))throw new Error("Invalid Option: from must be an integer, got ".concat(JSON.stringify(n.from)));if(n.from<0)throw new Error("Invalid Option: from must be a positive integer, got ".concat(JSON.stringify(e.from)))}if(void 0===n.from_line||null===n.from_line)n.from_line=1;else{if("string"==typeof n.from_line&&/\d+/.test(n.from_line)&&(n.from_line=parseInt(n.from_line)),!Number.isInteger(n.from_line))throw new Error("Invalid Option: from_line must be an integer, got ".concat(JSON.stringify(e.from_line)));if(n.from_line<=0)throw new Error("Invalid Option: from_line must be a positive integer greater than 0, got ".concat(JSON.stringify(e.from_line)))}if(void 0===n.info||null===n.info||!1===n.info)n.info=!1;else if(!0!==n.info)throw new Error("Invalid Option: info must be true, got ".concat(JSON.stringify(n.info)));if(void 0===n.max_record_size||null===n.max_record_size||!1===n.max_record_size)n.max_record_size=0;else if(!(Number.isInteger(n.max_record_size)&&0<=n.max_record_size)){if("string"!=typeof n.max_record_size||!/\d+/.test(n.max_record_size))throw new Error("Invalid Option: max_record_size must be a positive integer, got ".concat(JSON.stringify(n.max_record_size)));n.max_record_size=parseInt(n.max_record_size)}if(void 0===n.objname||null===n.objname||!1===n.objname)n.objname=void 0;else if(k.isBuffer(n.objname)){if(0===n.objname.length)throw new Error("Invalid Option: objname must be a non empty buffer");n.objname=n.objname.toString()}else{if("string"!=typeof n.objname)throw new Error("Invalid Option: objname must be a string or a buffer, got ".concat(n.objname));if(0===n.objname.length)throw new Error("Invalid Option: objname must be a non empty string")}if(void 0===n.on_record||null===n.on_record)n.on_record=void 0;else if("function"!=typeof n.on_record)throw new U("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,","got ".concat(JSON.stringify(n.on_record))]);if(null===n.quote||!1===n.quote||""===n.quote)n.quote=null;else{if(void 0===n.quote||!0===n.quote?n.quote=k.from('"'):"string"==typeof n.quote&&(n.quote=k.from(n.quote)),!k.isBuffer(n.quote))throw new Error("Invalid Option: quote must be a buffer or a string, got ".concat(JSON.stringify(n.quote)));if(1!==n.quote.length)throw new Error("Invalid Option Length: quote must be one character, got ".concat(n.quote.length));n.quote=n.quote[0]}if(void 0===n.raw||null===n.raw||!1===n.raw)n.raw=!1;else if(!0!==n.raw)throw new Error("Invalid Option: raw must be true, got ".concat(JSON.stringify(n.raw)));if(n.record_delimiter?Array.isArray(n.record_delimiter)||(n.record_delimiter=[n.record_delimiter]):n.record_delimiter=[],n.record_delimiter=n.record_delimiter.map(function(t){return"string"==typeof t&&(t=k.from(t)),t}),"boolean"!=typeof n.relax){if(void 0!==n.relax&&null!==n.relax)throw new Error("Invalid Option: relax must be a boolean, got ".concat(JSON.stringify(n.relax)));n.relax=!1}if("boolean"!=typeof n.relax_column_count){if(void 0!==n.relax_column_count&&null!==n.relax_column_count)throw new Error("Invalid Option: relax_column_count must be a boolean, got ".concat(JSON.stringify(n.relax_column_count)));n.relax_column_count=!1}if("boolean"!=typeof n.relax_column_count_less){if(void 0!==n.relax_column_count_less&&null!==n.relax_column_count_less)throw new Error("Invalid Option: relax_column_count_less must be a boolean, got ".concat(JSON.stringify(n.relax_column_count_less)));n.relax_column_count_less=!1}if("boolean"!=typeof n.relax_column_count_more){if(void 0!==n.relax_column_count_more&&null!==n.relax_column_count_more)throw new Error("Invalid Option: relax_column_count_more must be a boolean, got ".concat(JSON.stringify(n.relax_column_count_more)));n.relax_column_count_more=!1}if("boolean"!=typeof n.skip_empty_lines){if(void 0!==n.skip_empty_lines&&null!==n.skip_empty_lines)throw new Error("Invalid Option: skip_empty_lines must be a boolean, got ".concat(JSON.stringify(n.skip_empty_lines)));n.skip_empty_lines=!1}if("boolean"!=typeof n.skip_lines_with_empty_values){if(void 0!==n.skip_lines_with_empty_values&&null!==n.skip_lines_with_empty_values)throw new Error("Invalid Option: skip_lines_with_empty_values must be a boolean, got ".concat(JSON.stringify(n.skip_lines_with_empty_values)));n.skip_lines_with_empty_values=!1}if("boolean"!=typeof n.skip_lines_with_error){if(void 0!==n.skip_lines_with_error&&null!==n.skip_lines_with_error)throw new Error("Invalid Option: skip_lines_with_error must be a boolean, got ".concat(JSON.stringify(n.skip_lines_with_error)));n.skip_lines_with_error=!1}if(void 0===n.rtrim||null===n.rtrim||!1===n.rtrim)n.rtrim=!1;else if(!0!==n.rtrim)throw new Error("Invalid Option: rtrim must be a boolean, got ".concat(JSON.stringify(n.rtrim)));if(void 0===n.ltrim||null===n.ltrim||!1===n.ltrim)n.ltrim=!1;else if(!0!==n.ltrim)throw new Error("Invalid Option: ltrim must be a boolean, got ".concat(JSON.stringify(n.ltrim)));if(void 0===n.trim||null===n.trim||!1===n.trim)n.trim=!1;else if(!0!==n.trim)throw new Error("Invalid Option: trim must be a boolean, got ".concat(JSON.stringify(n.trim)));if(!0===n.trim&&!1!==e.ltrim?n.ltrim=!0:!0!==n.ltrim&&(n.ltrim=!1),!0===n.trim&&!1!==e.rtrim?n.rtrim=!0:!0!==n.rtrim&&(n.rtrim=!1),void 0===n.to||null===n.to)n.to=-1;else{if("string"==typeof n.to&&/\d+/.test(n.to)&&(n.to=parseInt(n.to)),!Number.isInteger(n.to))throw new Error("Invalid Option: to must be an integer, got ".concat(JSON.stringify(e.to)));if(n.to<=0)throw new Error("Invalid Option: to must be a positive integer greater than 0, got ".concat(JSON.stringify(e.to)))}if(void 0===n.to_line||null===n.to_line)n.to_line=-1;else{if("string"==typeof n.to_line&&/\d+/.test(n.to_line)&&(n.to_line=parseInt(n.to_line)),!Number.isInteger(n.to_line))throw new Error("Invalid Option: to_line must be an integer, got ".concat(JSON.stringify(e.to_line)));if(n.to_line<=0)throw new Error("Invalid Option: to_line must be a positive integer greater than 0, got ".concat(JSON.stringify(e.to_line)))}return t.info={comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},t.options=n,t.state={bomSkipped:!1,castField:i,commenting:!1,enabled:1===n.from_line,escaping:!1,escapeIsQuote:n.escape===n.quote,expectedRecordLength:null===n.columns?0:n.columns.length,field:new g(20),firstLineToHeaders:o,info:Object.assign({},t.info),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new g(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===n.record_delimiter.length?2:Math.max.apply(Math,l(n.record_delimiter.map(function(t){return t.length}))),trimChars:[k.from(" ")[0],k.from("\t")[0]],wasQuoting:!1,wasRowDelimiter:!1},t}var t,e,r;return s(a,m),t=a,(e=[{key:"_transform",value:function(t,e,r){!0!==this.state.stop&&(void 0!==(t=this.__parse(t,!1))&&(this.state.stop=!0),r(t))}},{key:"_flush",value:function(t){!0!==this.state.stop&&t(this.__parse(void 0,!0))}},{key:"__parse",value:function(t,e){var r,n=this.options,i=n.bom,o=n.comment,s=n.escape,a=n.from_line,u=n.info,c=n.ltrim,l=n.max_record_size,h=n.quote,f=n.raw,p=n.relax,d=n.rtrim,y=n.skip_empty_lines,m=n.to,g=n.to_line,_=this.options.record_delimiter,v=this.state,b=v.bomSkipped,n=v.previousBuf,w=v.rawBuffer,E=v.escapeIsQuote;if(void 0===n){if(void 0===t)return void this.push(null);r=t}else r=void 0!==n&&void 0===t?n:k.concat([n,t]);if(!1===b)if(!1===i)this.state.bomSkipped=!0;else if(r.length<3){if(!1===e)return void(this.state.previousBuf=r)}else 0===M.compare(r,0,3)&&(r=r.slice(3)),this.state.bomSkipped=!0;for(var T=r.length,S=0;S<T&&!this.__needMoreData(S,T,e);S++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,!0===u&&0===this.state.record.length&&0===this.state.field.length&&!1===this.state.wasQuoting&&(this.state.info=Object.assign({},this.info)),this.state.wasRowDelimiter=!1),-1!==g&&this.info.lines>g)return this.state.stop=!0,void this.push(null);!1===this.state.quoting&&0===_.length&&this.__autoDiscoverRowDelimiter(r,S)&&(_=this.options.record_delimiter);var x=r[S];if(!0===f&&w.append(x),13!==x&&10!==x||!1!==this.state.wasRowDelimiter||(this.state.wasRowDelimiter=!0),!0===this.state.escaping)this.state.escaping=!1;else{if(!0===this.state.quoting&&x===s&&S+1<T){if(!E){this.state.escaping=!0;continue}if(r[S+1]===h){this.state.escaping=!0;continue}}if(!1===this.state.commenting&&x===h)if(!0===this.state.quoting){var O=r[S+1],I=d&&this.__isCharTrimable(O),A=null!==o&&this.__compareBytes(o,r,S+1,O),D=this.__isDelimiter(O,r,S+1),N=0===_.length?this.__autoDiscoverRowDelimiter(r,S+1):this.__isRecordDelimiter(O,r,S+1);if(x===s&&O===h)S++;else{if(!O||D||N||A||I){this.state.quoting=!1,this.state.wasQuoting=!0;continue}if(!1===p){O=this.__error(new U("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",'got "'.concat(String.fromCharCode(O),'"'),"at line ".concat(this.info.lines),"instead of delimiter, row delimiter, trimable character","(if activated) or comment"],this.__context()));if(void 0!==O)return O}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(h)}}else{if(0===this.state.field.length){this.state.quoting=!0;continue}if(!1===p){var C=this.__error(new U("INVALID_OPENING_QUOTE",["Invalid Opening Quote:","a quote is found inside a field at line ".concat(this.info.lines)],this.__context(),{field:this.state.field}));if(void 0!==C)return C}}if(!1===this.state.quoting){C=this.__isRecordDelimiter(x,r,S);if(0!==C){if(this.state.commenting&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length)this.info.comment_lines++;else{if(!0===y&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,S+=C-1;continue}if(!1===this.state.enabled&&this.info.lines+(!0===this.state.wasRowDelimiter?1:0)>=a){this.state.enabled=!0,this.__resetField(),this.__resetRow(),S+=C-1;continue}var L=this.__onField();if(void 0!==L)return L;L=this.__onRow();if(void 0!==L)return L;if(-1!==m&&this.info.records>=m)return this.state.stop=!0,void this.push(null)}this.state.commenting=!1,S+=C-1;continue}if(this.state.commenting)continue;if(0!==(null===o?0:this.__compareBytes(o,r,S,x))){this.state.commenting=!0;continue}L=this.__isDelimiter(x,r,S);if(0!==L){C=this.__onField();if(void 0!==C)return C;S+=L-1;continue}}}if(!1===this.state.commenting&&0!==l&&this.state.record_length+this.state.field.length>l){var j=this.__error(new U("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes","of ".concat(l),"at line ".concat(this.info.lines)],this.__context()));if(void 0!==j)return j}L=!1===c||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(x),j=!1===d||!1===this.state.wasQuoting;if(!0==L&&!0==j)this.state.field.append(x);else if(!0===d&&!this.__isCharTrimable(x)){x=this.__error(new U("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote","at line ".concat(this.info.lines)],this.__context()));if(void 0!==x)return x}}if(!0===e)if(!0===this.state.quoting){var R=this.__error(new U("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:","the parsing is finished with an opening quote at line ".concat(this.info.lines)],this.__context()));if(void 0!==R)return R}else if(!0===this.state.wasQuoting||0!==this.state.record.length||0!==this.state.field.length){R=this.__onField();if(void 0!==R)return R;R=this.__onRow();if(void 0!==R)return R}else!0===this.state.wasRowDelimiter?this.info.empty_lines++:!0===this.state.commenting&&this.info.comment_lines++;else this.state.previousBuf=r.slice(S);!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)}},{key:"__isCharTrimable",value:function(t){return 32===t||9===t||13===t||10===t||12===t}},{key:"__onRow",value:function(){var t=this.options,e=t.columns,r=t.columns_duplicates_to_array,n=t.info,i=t.from,o=t.relax_column_count,s=t.relax_column_count_less,a=t.relax_column_count_more,u=t.raw,c=t.skip_lines_with_empty_values,l=this.state,t=l.enabled,h=l.record;if(!1===t)return this.__resetRow();t=h.length;if(!0===e)return w(h)?void this.__resetRow():this.__firstLineToColumns(h);if(!1===e&&0===this.info.records&&(this.state.expectedRecordLength=t),t!==this.state.expectedRecordLength)if(!0===o||!0===s&&t<this.state.expectedRecordLength||!0===a&&t>this.state.expectedRecordLength)this.info.invalid_field_length++;else if(!1===e){a=this.__error(new U("CSV_INCONSISTENT_RECORD_LENGTH",["Invalid Record Length:","expect ".concat(this.state.expectedRecordLength,","),"got ".concat(t," on line ").concat(this.info.lines)],this.__context(),{record:h}));if(void 0!==a)return a}else{t=this.__error(new U("CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH",["Invalid Record Length:","columns length is ".concat(e.length,","),"got ".concat(t," on line ").concat(this.info.lines)],this.__context(),{record:h}));if(void 0!==t)return t}if(!0===c&&w(h))this.__resetRow();else{if(!0===this.state.recordHasError)return this.__resetRow(),void(this.state.recordHasError=!1);if(this.info.records++,1===i||this.info.records>=i)if(!1!==e){for(var f={},p=0,d=h.length;p<d;p++)void 0===e[p]||e[p].disabled||(!0===r&&f[e[p].name]?Array.isArray(f[e[p].name])?f[e[p].name]=f[e[p].name].concat(h[p]):f[e[p].name]=[f[e[p].name],h[p]]:f[e[p].name]=h[p]);c=this.options.objname;if(void 0===c)if(!0===u||!0===n){i=this.__push(Object.assign({record:f},!0===u?{raw:this.state.rawBuffer.toString()}:{},!0===n?{info:this.state.info}:{}));if(i)return i}else{var y=this.__push(f);if(y)return y}else if(!0===u||!0===n){y=this.__push(Object.assign({record:[f[c],f]},!0===u?{raw:this.state.rawBuffer.toString()}:{},!0===n?{info:this.state.info}:{}));if(y)return y}else{c=this.__push([f[c],f]);if(c)return c}}else if(!0===u||!0===n){var m=this.__push(Object.assign({record:h},!0===u?{raw:this.state.rawBuffer.toString()}:{},!0===n?{info:this.state.info}:{}));if(m)return m}else{m=this.__push(h);if(m)return m}this.__resetRow()}}},{key:"__firstLineToColumns",value:function(t){var e=this.state.firstLineToHeaders;try{var r=void 0===e?t:e.call(null,t);if(!Array.isArray(r))return this.__error(new U("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,","got ".concat(JSON.stringify(r))],this.__context(),{headers:r}));r=E(r);return this.state.expectedRecordLength=r.length,this.options.columns=r,void this.__resetRow()}catch(t){return t}}},{key:"__resetRow",value:function(){!0===this.options.raw&&this.state.rawBuffer.reset(),this.state.record=[],this.state.record_length=0}},{key:"__onField",value:function(){var t=this.options,e=t.cast,r=t.rtrim,n=t.max_record_size,i=this.state,t=i.enabled,i=i.wasQuoting;if(!1===t)return this.__resetField();t=this.state.field.toString();if(!0===r&&!1===i&&(t=t.trimRight()),!0===e){i=o(this.__cast(t),2),e=i[0],i=i[1];if(void 0!==e)return e;t=i}this.state.record.push(t),0!==n&&"string"==typeof t&&(this.state.record_length+=t.length),this.__resetField()}},{key:"__resetField",value:function(){this.state.field.reset(),this.state.wasQuoting=!1}},{key:"__push",value:function(t){var e=this.options.on_record;if(void 0!==e){var r=this.__context();try{t=e.call(null,t,r)}catch(t){return t}if(null==t)return}this.push(t)}},{key:"__cast",value:function(t){var e=this.options,r=e.columns,e=e.relax_column_count;if(!0===Array.isArray(r)&&e&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];var n=this.__context();if(null!==this.state.castField)try{return[void 0,this.state.castField.call(null,t,n)]}catch(t){return[t]}return this.__isFloat(t)?[void 0,parseFloat(t)]:!1!==this.options.cast_date?[void 0,this.options.cast_date.call(null,t,n)]:[void 0,t]}},{key:"__isFloat",value:function(t){return 0<=t-parseFloat(t)+1}},{key:"__compareBytes",value:function(t,e,r,n){if(t[0]!==n)return 0;for(var i=t.length,o=1;o<i;o++)if(t[o]!==e[r+o])return 0;return i}},{key:"__needMoreData",value:function(t,e,r){if(r)return!1;var n=this.options,i=n.comment,o=n.delimiter,r=this.state,n=r.quoting,r=r.recordDelimiterMaxLength;return e-t-1<Math.max(i?i.length:0,r,n?1+r:0,o.length,1)}},{key:"__isDelimiter",value:function(t,e,r){var n=this.options.delimiter;t:for(var i=0;i<n.length;i++){var o=n[i];if(o[0]===t){for(var s=1;s<o.length;s++)if(o[s]!==e[r+s])continue t;return o.length}}return 0}},{key:"__isRecordDelimiter",value:function(t,e,r){var n=this.options.record_delimiter,i=n.length;t:for(var o=0;o<i;o++){var s=n[o],a=s.length;if(s[0]===t){for(var u=1;u<a;u++)if(s[u]!==e[r+u])continue t;return s.length}}return 0}},{key:"__autoDiscoverRowDelimiter",value:function(t,e){var r=t[e];return 13===r?10===t[e+1]?(this.options.record_delimiter.push(k.from("\r\n")),this.state.recordDelimiterMaxLength=2):(this.options.record_delimiter.push(k.from("\r")),this.state.recordDelimiterMaxLength=1):10===r?(this.options.record_delimiter.push(k.from("\n")),this.state.recordDelimiterMaxLength=1):0}},{key:"__error",value:function(t){var e=this.options.skip_lines_with_error,t="string"==typeof t?new Error(t):t;if(!e)return t;this.state.recordHasError=!0,this.emit("skip",t)}},{key:"__context",value:function(){var t=this.options.columns;return{column:!0===Array.isArray(t)?t.length>this.state.record.length?t[this.state.record.length].name:null:this.state.record.length,empty_lines:this.info.empty_lines,header:!0===t,index:this.state.record.length,invalid_field_length:this.info.invalid_field_length,quoting:this.state.wasQuoting,lines:this.info.lines,records:this.info.records}}}])&&n(t.prototype,e),r&&n(t,r),a}(),U=function(){function h(t,e){var r;f(this,h),Array.isArray(e)&&(e=e.join(" ")),r=p(this,y(h).call(this,e)),void 0!==Error.captureStackTrace&&Error.captureStackTrace(d(r),h),r.code=t;for(var n=arguments.length,i=new Array(2<n?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];for(var s=0,a=i;s<a.length;s++){var u,c=a[s];for(u in c){var l=c[u];r[u]=k.isBuffer(l)?l.toString():null==l?l:JSON.parse(JSON.stringify(l))}}return r}return s(h,e(Error)),h}();t.Parser=_,t.CsvError=U,S.exports=t;var v=function(t){return t.replace(/([A-Z])/g,function(t,e){return"_"+e.toLowerCase()})},b=function(t){return"object"===c(t)&&null!==t&&!Array.isArray(t)},w=function(t){return t.every(function(t){return null==t||t.toString&&""===t.toString().trim()})},E=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r];if(null==i||!1===i)e[r]={disabled:!0};else if("string"==typeof i)e[r]={name:i};else{if(!b(i))throw new U("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,","got ".concat(JSON.stringify(i)," at position ").concat(r)]);if("string"!=typeof i.name)throw new U("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",'property "name" is required at position '.concat(r),"when column is an object literal"]);e[r]=i}}return e}}).call(this,T("buffer").Buffer,T("timers").setImmediate)},{"./ResizeableBuffer":32,buffer:30,stream:67,timers:69}],34:[function(t,e,r){(function(i){"use strict";var o=t(".");e.exports=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof t&&(t=i.from(t));var r=e&&e.objname?{}:[],n=new o.Parser(e);n.push=function(t){null!==t&&(void 0===e.objname?r.push(t):r[t[0]]=t[1])};t=n.__parse(t,!1);if(void 0!==t)throw t;n=n.__parse(void 0,!0);if(void 0!==n)throw n;return r}}).call(this,t("buffer").Buffer)},{".":33,buffer:30}],35:[function(e,r,t){(function(o){var s,a=e("stream"),t=e("util"),b=e("lodash.get");r.exports=function(){var e,r,n,t,i;return 3===arguments.length?(n=arguments[0],t=arguments[1],e=arguments[2]):2===arguments.length?(Array.isArray(arguments[0])?n=arguments[0]:t=arguments[0],"function"==typeof arguments[1]?e=arguments[1]:t=arguments[1]):1===arguments.length&&("function"==typeof arguments[0]?e=arguments[0]:Array.isArray(arguments[0])?n=arguments[0]:t=arguments[0]),null==t&&(t={}),i=new s(t),n&&o.nextTick(function(){for(var t,e=0,r=n.length;e<r;e++)t=n[e],i.write(t);return i.end()}),e&&(r=[],i.on("readable",function(){for(var t,e=[];t=i.read();)e.push(r.push(t));return e}),i.on("error",function(t){return e(t)}),i.on("end",function(){return e(null,r.join(""))})),i},s=function(t){var e,r,n,i;for(r in null==t&&(t={}),n={},t)i=t[r],n[r]=i;switch(a.Transform.call(this,n),this.options=n,null==(e=this.options).delimiter&&(e.delimiter=","),null==(e=this.options).quote&&(e.quote='"'),null==(e=this.options).quoted&&(e.quoted=!1),null==(e=this.options).quotedEmpty&&(e.quotedEmpty=void 0),null==(e=this.options).quotedString&&(e.quotedString=!1),null==(e=this.options).eof&&(e.eof=!0),null==(e=this.options).escape&&(e.escape='"'),null==(e=this.options).columns&&(e.columns=null),null==(e=this.options).header&&(e.header=!1),null==(e=this.options).formatters&&(e.formatters={}),null==(e=this.options.formatters).date&&(e.date=function(t){return""+t.getTime()}),null==(e=this.options.formatters).bool&&(e.bool=function(t){return t?"1":""}),null==(e=this.options.formatters).object&&(e.object=function(t){return JSON.stringify(t)}),null==(e=this.options).rowDelimiter&&(e.rowDelimiter="\n"),null==this.countWriten&&(this.countWriten=0),this.options.rowDelimiter){case"auto":this.options.rowDelimiter=null;break;case"unix":this.options.rowDelimiter="\n";break;case"mac":this.options.rowDelimiter="\r";break;case"windows":this.options.rowDelimiter="\r\n";break;case"unicode":this.options.rowDelimiter="\u2028"}return this},t.inherits(s,a.Transform),(r.exports.Stringifier=s).prototype.headers=function(){var e,r,n;if(this.options.header&&this.options.columns)return"object"==typeof(n=this.options.columns)&&(n=function(){var t=[];for(e in n)r=n[e],t.push(r);return t}()),n=this.options.eof?this.stringify(n)+this.options.rowDelimiter:this.stringify(n),a.Transform.prototype.write.call(this,n)},s.prototype.end=function(t,e,r){return 0===this.countWriten&&this.headers(),a.Transform.prototype.end.apply(this,arguments)},s.prototype.write=function(t,e,r){var n,i;if(null!=t){if(!(i="object"!=typeof t)){0!==this.countWriten||Array.isArray(t)||null==(n=this.options).columns&&(n.columns=Object.keys(t));try{this.emit("record",t,this.countWriten)}catch(t){return this.emit("error",t)}this.options.eof?t=this.stringify(t)+this.options.rowDelimiter:(t=this.stringify(t),(this.options.header||this.countWriten)&&(t=this.options.rowDelimiter+t))}return"number"==typeof t&&(t=""+t),0===this.countWriten&&this.headers(),i||this.countWriten++,a.Transform.prototype.write.call(this,t,e,r)}},s.prototype._transform=function(t,e,r){return this.push(t),r()},s.prototype.stringify=function(t){var e,r,n,i,o,s,a,u,c,l,h,f,p,d,y,m,g,_,v;if("object"!=typeof t)return t;if("object"!=typeof(n=this.options.columns)||null===n||Array.isArray(n)||(n=Object.keys(n)),a=this.options.delimiter,d=this.options.quote,u=this.options.escape,Array.isArray(t))n&&t.splice(n.length);else{if(e=[],n)for(l=h=0,y=n.length;0<=y?h<y:y<h;l=0<=y?++h:--h)r=n[l],v=b(t,r),e[l]=null==v?"":v;else for(r in t)e.push(t[r]);t=e,e=null}if(Array.isArray(t)){for(p="",l=f=0,m=t.length;0<=m?f<m:m<f;l=0<=m?++f:--f)"string"==typeof(c=t[l])||("number"==typeof c?c=""+c:"boolean"==typeof c?c=this.options.formatters.bool(c):c instanceof Date?c=this.options.formatters.date(c):"object"==typeof c&&null!==c&&(c=this.options.formatters.object(c))),c?(s=0<=c.indexOf(a),o=0<=c.indexOf(d),i=0<=c.indexOf(u)&&u!==d,_=0<=c.indexOf("\r")||0<=c.indexOf("\n"),(_=o||s||_||this.options.quoted||this.options.quotedString&&"string"==typeof t[l])&&i&&(g="\\"===u?new RegExp(u+u,"g"):new RegExp(u,"g"),c=c.replace(g,u+u)),o&&(g=new RegExp(d,"g"),c=c.replace(g,u+d)),_&&(c=d+c+d),p+=c):(this.options.quotedEmpty||null==this.options.quotedEmpty&&""===t[l]&&this.options.quotedString)&&(p+=d+d),l!==t.length-1&&(p+=a);t=p}return t}}).call(this,e("_process"))},{_process:46,"lodash.get":42,stream:67,util:72}],36:[function(t,e,r){(function(a){var u=t("string_decoder").StringDecoder,c=t("./index");e.exports=function(t,e){var r,n,i,o,s;for(null==e&&(e={}),r=[],t instanceof a&&(t=(new u).write(t)),(s=new c.Stringifier(e)).push=function(t){if(t)return r.push(t.toString())},n=0,i=t.length;n<i;n++)o=t[n],s.write(o);return s.end(),r.join("")}}).call(this,t("buffer").Buffer)},{"./index":35,buffer:30,string_decoder:68}],37:[function(t,e,r){var a=Object.create||function(t){function e(){}return e.prototype=t,new e},s=Object.keys||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return e},n=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function i(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=a(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}((e.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0;var o,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),o=0===c.x}catch(t){o=!1}function l(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');return(i=t._events)?(i.newListener&&(t.emit("newListener",e,r.listener||r),i=t._events),o=i[e]):(i=t._events=a(null),t._eventsCount=0),o?("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),o.warned||(n=l(t))&&0<n&&o.length>n&&(o.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+o.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.')).name="MaxListenersExceededWarning",n.emitter=t,n.type=e,n.count=o.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",n.name,n.message))):(o=i[e]=r,++t._eventsCount),t}function f(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function p(t,e,r){t={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},e=n.call(f,t);return e.listener=r,t.wrapFn=e}function d(t,e,r){t=t._events;if(!t)return[];e=t[e];return e?"function"==typeof e?r?[e.listener||e]:[e]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(e):m(e,e.length):[]}function y(t){var e=this._events;if(e){t=e[t];if("function"==typeof t)return 1;if(t)return t.length}return 0}function m(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}o?Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');u=t}}):i.defaultMaxListeners=u,i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(t,e,r,n){var i,o,s,a,u="error"===t,c=this._events;if(c)u=u&&null==c.error;else if(!u)return!1;if(u){if(1<arguments.length&&(i=e),i instanceof Error)throw i;u=new Error('Unhandled "error" event. ('+i+")");throw u.context=i,u}if(!(o=c[t]))return!1;var l,h="function"==typeof o;switch(l=arguments.length){case 1:!function(t,e){if(h)t.call(e);else for(var r=t.length,n=m(t,r),i=0;i<r;++i)n[i].call(e)}(o,this);break;case 2:!function(t,e,r){if(h)t.call(e,r);else for(var n=t.length,i=m(t,n),o=0;o<n;++o)i[o].call(e,r)}(o,this,e);break;case 3:!function(t,e,r,n){if(h)t.call(e,r,n);else for(var i=t.length,o=m(t,i),s=0;s<i;++s)o[s].call(e,r,n)}(o,this,e,r);break;case 4:!function(t,e,r,n,i){if(h)t.call(e,r,n,i);else for(var o=t.length,s=m(t,o),a=0;a<o;++a)s[a].call(e,r,n,i)}(o,this,e,r,n);break;default:for(s=new Array(l-1),a=1;a<l;a++)s[a-1]=arguments[a];!function(t,e,r){if(h)t.apply(e,r);else for(var n=t.length,i=m(t,n),o=0;o<n;++o)i[o].apply(e,r)}(o,this,s)}return!0},i.prototype.on=i.prototype.addListener=function(t,e){return h(this,t,e,!1)},i.prototype.prependListener=function(t,e){return h(this,t,e,!0)},i.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,p(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,p(this,t,e)),this},i.prototype.removeListener=function(t,e){var r,n,i,o,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=a(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;0<=o;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t){for(var e=i,r=e+1,n=t.length;r<n;e+=1,r+=1)t[e]=t[r];t.pop()}(r),1===r.length&&(n[t]=r[0]),n.removeListener&&this.emit("removeListener",t,s||e)}return this},i.prototype.removeAllListeners=function(t){var e,r=this._events;if(!r)return this;if(!r.removeListener)return 0===arguments.length?(this._events=a(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=a(null):delete r[t]),this;if(0===arguments.length){for(var n,i=s(r),o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=a(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(o=e.length-1;0<=o;o--)this.removeListener(t,e[o]);return this},i.prototype.listeners=function(t){return d(this,t,!0)},i.prototype.rawListeners=function(t){return d(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},i.prototype.listenerCount=y,i.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]}},{}],38:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,r=t[e+h];for(h+=f,o=r&(1<<-l)-1,r>>=-l,l+=a;0<l;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;0<l;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(r?-1:1);s+=Math.pow(2,n),o-=c}return(r?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u=8*o-i-1,c=(1<<u)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(e+=1<=s+l?h/n:h*Math.pow(2,1-l))*n&&(s++,n/=2),c<=s+l?(a=0,s=c):1<=s+l?(a=(e*n-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));8<=i;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;0<u;t[r+f]=255&s,f+=p,s/=256,u-=8);t[r+f-p]|=128*o}},{}],39:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;function r(){}r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],40:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))||!!t._isBuffer);var e}},{}],41:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],42:[function(t,q,e){(function(t){var e="Expected a function",n="__lodash_hash_undefined__",o=1/0,r="[object Function]",i="[object GeneratorFunction]",s="[object Symbol]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,d="object"==typeof self&&self&&self.Object===Object&&self,y=p||d||Function("return this")();var m=Array.prototype,t=Function.prototype,p=Object.prototype,d=y["__core-js_shared__"],g=(d=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",_=t.toString,v=p.hasOwnProperty,b=p.toString,w=RegExp("^"+_.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),p=y.Symbol,E=m.splice,T=j(y,"Map"),S=j(Object,"create"),p=p?p.prototype:void 0,x=p?p.toString:void 0;function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function I(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function A(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function D(t,e){for(var r,n,i=t.length;i--;)if((r=t[i][0])===(n=e)||r!=r&&n!=n)return i;return-1}function N(t,e){for(var r,n=0,i=(e=function(t,e){if(M(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||P(t))return!0;return u.test(t)||!a.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:M(r=e)?r:R(r)).length;null!=t&&n<i;)t=t[function(t){if("string"==typeof t||P(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e[n++])];return n&&n==i?t:void 0}function C(t){var e;return U(t)&&(e=t,!(g&&g in e))&&(function(t){t=U(t)?b.call(t):"";return t==r||t==i}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?w:f).test(function(t){if(null!=t){try{return _.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function L(t,e){var r,n=t.__data__;return("string"==(t=typeof(r=e))||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==r:null===r)?n["string"==typeof e?"string":"hash"]:n.map}function j(t,e){e=e,e=null==(t=t)?void 0:t[e];return C(e)?e:void 0}O.prototype.clear=function(){this.__data__=S?S(null):{}},O.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},O.prototype.get=function(t){var e=this.__data__;if(S){var r=e[t];return r===n?void 0:r}return v.call(e,t)?e[t]:void 0},O.prototype.has=function(t){var e=this.__data__;return S?void 0!==e[t]:v.call(e,t)},O.prototype.set=function(t,e){return this.__data__[t]=S&&void 0===e?n:e,this},I.prototype.clear=function(){this.__data__=[]},I.prototype.delete=function(t){var e=this.__data__;return!((t=D(e,t))<0)&&(t==e.length-1?e.pop():E.call(e,t,1),!0)},I.prototype.get=function(t){var e=this.__data__;return(t=D(e,t))<0?void 0:e[t][1]},I.prototype.has=function(t){return-1<D(this.__data__,t)},I.prototype.set=function(t,e){var r=this.__data__,n=D(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},A.prototype.clear=function(){this.__data__={hash:new O,map:new(T||I),string:new O}},A.prototype.delete=function(t){return L(this,t).delete(t)},A.prototype.get=function(t){return L(this,t).get(t)},A.prototype.has=function(t){return L(this,t).has(t)},A.prototype.set=function(t,e){return L(this,t).set(t,e),this};var R=k(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(P(t))return x?x.call(t):"";var e=t+"";return"0"==e&&1/t==-o?"-0":e}(e);var i=[];return c.test(t)&&i.push(""),t.replace(l,function(t,e,r,n){i.push(r?n.replace(h,"$1"):e||t)}),i});function k(n,i){if("function"!=typeof n||i&&"function"!=typeof i)throw new TypeError(e);var o=function(){var t=arguments,e=i?i.apply(this,t):t[0],r=o.cache;if(r.has(e))return r.get(e);t=n.apply(this,t);return o.cache=r.set(e,t),t};return o.cache=new(k.Cache||A),o}k.Cache=A;var M=Array.isArray;function U(t){var e=typeof t;return t&&("object"==e||"function"==e)}function P(t){return"symbol"==typeof t||!!(e=t)&&"object"==typeof e&&b.call(t)==s;var e}q.exports=function(t,e,r){return void 0===(e=null==t?void 0:N(t,e))?r:e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],43:[function(t,ue,ce){(function(ae){(function(){var g,n="Expected a function",_=1,d=2,a=9007199254740991,y="[object Arguments]",m="[object Array]",e="[object AsyncFunction]",v="[object Boolean]",b="[object Date]",w="[object Error]",r="[object Function]",i="[object GeneratorFunction]",E="[object Number]",T="[object Object]",o="[object Proxy]",S="[object RegExp]",x="[object String]",s=/[&<>"']/g,u=RegExp(s.source),c=/^(?:0|[1-9]\d*)$/,t="object"==typeof ae&&ae&&ae.Object===Object&&ae,l="object"==typeof self&&self&&self.Object===Object&&self,f=t||l||Function("return this")(),h="object"==typeof ce&&ce&&!ce.nodeType&&ce,p=h&&"object"==typeof ue&&ue&&!ue.nodeType&&ue;function O(t,e){return t.push.apply(t,e),t}function I(e){return function(t){return null==t?g:t[e]}}var A,D=(A={"&":"&","<":"<",">":">",'"':""","'":"'"},function(t){return null==A?g:A[t]});var N,C,L=Array.prototype,j=Object.prototype,R=j.hasOwnProperty,k=0,M=j.toString,U=f._,P=Object.create,q=j.propertyIsEnumerable,B=f.isFinite,F=(N=Object.keys,C=Object,function(t){return N(C(t))}),X=Math.max;function V(t){return t instanceof W?t:new W(t)}var z=function(t){if(!Vt(t))return{};if(P)return P(t);H.prototype=t;t=new H;return H.prototype=g,t};function H(){}function W(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e}function G(t,e,r){t[e]=r}function Y(t,e,r){if("function"!=typeof t)throw new TypeError(n);return setTimeout(function(){t.apply(g,r)},e)}(W.prototype=z(V.prototype)).constructor=W;var Q,$,J=(Q=nt,function(t,e){if(null==t)return t;if(!Bt(t))return Q(t,e);for(var r=t.length,n=$?r:-1,i=Object(t);($?n--:++n<r)&&!1!==e(i[n],n,i););return t});function K(t,e,r){for(var n=-1,i=t.length;++n<i;){var o,s,a=t[n],u=e(a);null!=u&&(o===g?u==u:r(u,o))&&(o=u,s=a)}return s}function Z(t,n){var i=[];return J(t,function(t,e,r){n(t,e,r)&&i.push(t)}),i}function tt(t,e,r,n,i){var o=-1,s=t.length;for(r=r||bt,i=i||[];++o<s;){var a=t[o];0<e&&r(a)?1<e?tt(a,e-1,r,n,i):O(i,a):n||(i[i.length]=a)}return i}var et,rt=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var a=o[et?s:++n];if(!1===e(i[a],a,i))break}return t};function nt(t,e){return t&&rt(t,e,te)}function it(e,t){return Z(t,function(t){return Xt(e[t])})}function ot(t){return t=t,M.call(t)}function st(t,e){return e<t}var at=se;function ut(t,e,r,n,i){return t===e||(null==t||null==e||!zt(t)&&!zt(e)?t!=t&&e!=e:function(e,r,t,n,i,o){var s=qt(e),a=qt(r),u=s?m:ot(e),c=a?m:ot(r),l=(u=u==y?T:u)==T,h=(c=c==y?T:c)==T,f=u==c;o=o||[];a=Nt(o,function(t){return t[0]==e}),c=Nt(o,function(t){return t[0]==r});if(a&&c)return a[1]==r;if(o.push([e,r]),o.push([r,e]),f&&!l){var p=s?function(t,e,r,n,i,o){var s=r&_,a=t.length,u=e.length;if(a!=u&&!(s&&a<u))return!1;var c=-1,l=!0,h=r&d?[]:g;for(;++c<a;){var f=t[c],p=e[c];if(void 0!==g){void 0,l=!1;break}if(h){if(!mt(e,function(t,e){if(!It(h,e)&&(f===t||i(f,t,r,n,o)))return h.push(e)})){l=!1;break}}else if(f!==p&&!i(f,p,r,n,o)){l=!1;break}}return l}(e,r,t,n,i,o):function(t,e,r){switch(r){case v:case b:case E:return Ut(+t,+e);case w:return t.name==e.name&&t.message==e.message;case S:case x:return t==e+""}return!1}(e,r,u);return o.pop(),p}if(!(t&_)){l=l&&R.call(e,"__wrapped__"),h=h&&R.call(r,"__wrapped__");if(l||h){l=l?e.value():e,h=h?r.value():r,p=i(l,h,t,n,o);return o.pop(),p}}if(!f)return!1;p=function(t,e,r,n,i,o){var s=r&_,a=te(t),u=a.length,c=te(e).length;if(u!=c&&!s)return!1;var l=u;for(;l--;){var h=a[l];if(!(s?h in e:R.call(e,h)))return!1}var f=!0,p=s;for(;++l<u;){h=a[l];var d=t[h],y=e[h];if(void 0!==g||d!==y&&!i(d,y,r,n,o)){f=!1;break}p=p||"constructor"==h}{var m;f&&!p&&(m=t.constructor,c=e.constructor,m!=c&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof c&&c instanceof c)&&(f=!1))}return f}(e,r,t,n,i,o);return o.pop(),p}(t,e,r,n,ut,i))}function ct(t){return"function"==typeof t?t:null==t?ne:("object"==typeof t?ft:I)(t)}function lt(t,e){return t<e}function ht(t,n){var i=-1,o=Bt(t)?Array(t.length):[];return J(t,function(t,e,r){o[++i]=n(t,e,r)}),o}function ft(n){var i=F(n);return function(t){var e=i.length;if(null==t)return!e;for(t=Object(t);e--;){var r=i[e];if(!(r in t&&ut(n[r],t[r],_|d)))return!1}return!0}}function pt(t,e){return St(Tt(t,e,ne),t+"")}function dt(t,e,r){var n=-1,i=t.length;e<0&&(e=i<-e?0:i+e),(r=i<r?i:r)<0&&(r+=i),i=r<e?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function yt(t){return dt(t,0,t.length)}function mt(t,n){var i;return J(t,function(t,e,r){return!(i=n(t,e,r))}),!!i}function gt(t,e,r,n){var i=!r;r=r||{};for(var o,s,a=-1,u=e.length;++a<u;){var c=e[a],l=n?n(r[c],t[c],c,r,t):g;l===g&&(l=t[c]),i?G(r,c,l):(o=l,s=void 0,s=(l=r)[c=c],R.call(l,c)&&Ut(s,o)&&(o!==g||c in l)||G(l,c,o))}return r}function _t(s){return pt(function(t,e){var r=-1,n=e.length,i=1<n?e[n-1]:g,i=3<s.length&&"function"==typeof i?(n--,i):g;for(t=Object(t);++r<n;){var o=e[r];o&&s(t,o,r,i)}return t})}function vt(a,t,u,c){if("function"!=typeof a)throw new TypeError(n);var r,l=1&t,h=(r=a,function(){var t=arguments,e=z(r.prototype),t=r.apply(e,t);return Vt(t)?t:e});return function t(){for(var e=-1,r=arguments.length,n=-1,i=c.length,o=Array(i+r),s=this&&this!==f&&this instanceof t?h:a;++n<i;)o[n]=c[n];for(;r--;)o[n++]=arguments[++e];return s.apply(l?u:this,o)}}function bt(t){return qt(t)||Pt(t)}function wt(t,e,r){if(Vt(r)){var n,i,o,s=typeof e;return("number"==s?Bt(r)&&(n=e,i=r.length,o=typeof n,(i=null==i?a:i)&&("number"==o||"symbol"!=o&&c.test(n))&&-1<n&&n%1==0&&n<i):"string"==s&&e in r)&&Ut(r[e],t)}}function Et(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}function Tt(o,s,a){return s=X(s===g?o.length-1:s,0),function(){for(var t=arguments,e=-1,r=X(t.length-s,0),n=Array(r);++e<r;)n[e]=t[s+e];e=-1;for(var i=Array(s+1);++e<s;)i[e]=t[e];return i[s]=a(n),o.apply(this,i)}}var St=ne;function xt(t){return(null==t?0:t.length)?tt(t,1):[]}function Ot(t){return t&&t.length?t[0]:g}function It(t,e,r){for(var n=null==t?0:t.length,i=((r="number"==typeof r?r<0?X(n+r,0):r:0)||0)-1,o=e==e;++i<n;){var s=t[i];if(o?s===e:s!=s)return i}return-1}function At(t){t=V(t);return t.__chain__=!0,t}var Dt,Nt=(Dt=function(t,e,r){var n=null==t?0:t.length;return n?((r=null==r?0:Yt(r))<0&&(r=X(n+r,0)),function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,ct(e),r)):-1},function(t,e,r){var n,i=Object(t);Bt(t)||(n=ct(e),t=te(t),e=function(t){return n(i[t],t,i)});r=Dt(t,e,r);return-1<r?i[n?t[r]:r]:g});function Ct(t,e){return J(t,ct(e))}function Lt(t,e,r){return n=t,i=ct(e),o=r,s=arguments.length<3,J(n,function(t,e,r){o=s?(s=!1,t):i(o,t,e,r)}),o;var n,i,o,s}function jt(t,e){var r;if("function"!=typeof e)throw new TypeError(n);return t=Yt(t),function(){return 0<--t&&(r=e.apply(this,arguments)),t<=1&&(e=g),r}}var Rt=pt(function(t,e,r){return vt(t,33,e,r)}),kt=pt(function(t,e){return Y(t,1,e)}),Mt=pt(function(t,e,r){return Y(t,Qt(e)||0,r)});function Ut(t,e){return t===e||t!=t&&e!=e}var Pt=at(function(){return arguments}())?at:function(t){return zt(t)&&R.call(t,"callee")&&!q.call(t,"callee")},qt=Array.isArray;function Bt(t){return null!=t&&("number"==typeof(e=t.length)&&-1<e&&e%1==0&&e<=a)&&!Xt(t);var e}function Ft(t){return zt(t)&&ot(t)==b}function Xt(t){if(!Vt(t))return!1;t=ot(t);return t==r||t==i||t==e||t==o}function Vt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zt(t){return null!=t&&"object"==typeof t}function Ht(t){return"number"==typeof t||zt(t)&&ot(t)==E}function Wt(t){return zt(t)&&ot(t)==S}function Gt(t){return"string"==typeof t||!qt(t)&&zt(t)&&ot(t)==x}var Yt=Number,Qt=Number;function $t(t){return"string"==typeof t?t:null==t?"":t+""}var Jt=_t(function(t,e){gt(e,F(e),t)}),Kt=_t(function(t,e){gt(e,Et(e),t)});t=pt(function(t,e){t=Object(t);var r=-1,n=e.length,i=2<n?e[2]:g;for(i&&wt(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=ee(o),a=-1,u=s.length;++a<u;){var c=s[a],l=t[c];(l===g||Ut(l,j[c])&&!R.call(t,c))&&(t[c]=o[c])}return t});var Zt,te=F,ee=Et,l=St(Tt(Zt=function(t,e){return null==t?{}:(r=t,e=e,r=Object(r),Lt(e,function(t,e){return e in r&&(t[e]=r[e]),t},{}));var r},g,xt),Zt+"");function re(t){return null==t?[]:ht(te(e=t),function(t){return e[t]});var e}function ne(t){return t}var ie,at=ct;function oe(n,e,t){var r=te(e),i=it(e,r);null!=t||Vt(e)&&(i.length||!r.length)||(t=e,e=n,n=this,i=it(e,te(e)));var o=!(Vt(t)&&"chain"in t&&!t.chain),s=Xt(n);return J(i,function(t){var r=e[t];n[t]=r,s&&(n.prototype[t]=function(){var t=this.__chain__;if(o||t){var e=n(this.__wrapped__);return(e.__actions__=yt(this.__actions__)).push({func:r,args:arguments,thisArg:n}),e.__chain__=t,e}return r.apply(n,O([this.value()],arguments))})}),n}function se(){}V.assignIn=Kt,V.before=jt,V.bind=Rt,V.chain=At,V.compact=function(t){return Z(t,Boolean)},V.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),r=arguments[0],n=t;n--;)e[n-1]=arguments[n];return O(qt(r)?yt(r):[r],tt(e,1))},V.create=function(t,e){return t=z(t),null==e?t:Jt(t,e)},V.defaults=t,V.defer=kt,V.delay=Mt,V.filter=function(t,e){return Z(t,ct(e))},V.flatten=xt,V.flattenDeep=function(t){return(null==t?0:t.length)?tt(t,1/0):[]},V.iteratee=at,V.keys=te,V.map=function(t,e){return ht(t,ct(e))},V.matches=function(t){return ft(Jt({},t))},V.mixin=oe,V.negate=function(e){if("function"!=typeof e)throw new TypeError(n);return function(){var t=arguments;return!e.apply(this,t)}},V.once=function(t){return jt(2,t)},V.pick=l,V.slice=function(t,e,r){var n=null==t?0:t.length;return e=null==e?0:+e,r=r===g?n:+r,n?dt(t,e,r):[]},V.sortBy=function(t,n){var i=0;return n=ct(n),ht(ht(t,function(t,e,r){return{value:t,index:i++,criteria:n(t,e,r)}}).sort(function(t,e){return function(t,e){if(t!==e){var r=t!==g,n=null===t,i=t==t,o=e!==g,s=null===e,a=e==e;if(!s&&e<t||n&&o&&a||!r&&a||!i)return 1;if(!n&&t<e||s&&r&&i||!o&&i||!a)return-1}return 0}(t.criteria,e.criteria)||t.index-e.index}),I("value"))},V.tap=function(t,e){return e(t),t},V.thru=function(t,e){return e(t)},V.toArray=function(t){return Bt(t)?t.length?yt(t):[]:re(t)},V.values=re,V.extend=Kt,oe(V,V),V.clone=function(t){return Vt(t)?qt(t)?yt(t):gt(t,F(t)):t},V.escape=function(t){return(t=$t(t))&&u.test(t)?t.replace(s,D):t},V.every=function(t,e,r){return t=t,n=ct(e=r?g:e),i=!0,J(t,function(t,e,r){return i=!!n(t,e,r)}),i;var n,i},V.find=Nt,V.forEach=Ct,V.has=function(t,e){return null!=t&&R.call(t,e)},V.head=Ot,V.identity=ne,V.indexOf=It,V.isArguments=Pt,V.isArray=qt,V.isBoolean=function(t){return!0===t||!1===t||zt(t)&&ot(t)==v},V.isDate=Ft,V.isEmpty=function(t){return Bt(t)&&(qt(t)||Gt(t)||Xt(t.splice)||Pt(t))?!t.length:!F(t).length},V.isEqual=function(t,e){return ut(t,e)},V.isFinite=function(t){return"number"==typeof t&&B(t)},V.isFunction=Xt,V.isNaN=function(t){return Ht(t)&&t!=+t},V.isNull=function(t){return null===t},V.isNumber=Ht,V.isObject=Vt,V.isRegExp=Wt,V.isString=Gt,V.isUndefined=function(t){return t===g},V.last=function(t){var e=null==t?0:t.length;return e?t[e-1]:g},V.max=function(t){return t&&t.length?K(t,ne,st):g},V.min=function(t){return t&&t.length?K(t,ne,lt):g},V.noConflict=function(){return f._===this&&(f._=U),this},V.noop=se,V.reduce=Lt,V.result=function(t,e,r){return(e=null==t?g:t[e])===g&&(e=r),Xt(e)?e.call(t):e},V.size=function(t){return null==t?0:(t=Bt(t)?t:F(t)).length},V.some=function(t,e,r){return mt(t,ct(e=r?g:e))},V.uniqueId=function(t){var e=++k;return $t(t)+e},V.each=Ct,V.first=Ot,oe(V,(ie={},nt(V,function(t,e){R.call(V.prototype,e)||(ie[e]=t)}),ie),{chain:!1}),V.VERSION="4.17.15",J(["pop","join","replace","reverse","split","push","shift","sort","splice","unshift"],function(t){var r=(/^(?:replace|split)$/.test(t)?String.prototype:L)[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|join|replace|shift)$/.test(t);V.prototype[t]=function(){var e=arguments;if(!i||this.__chain__)return this[n](function(t){return r.apply(qt(t)?t:[],e)});var t=this.value();return r.apply(qt(t)?t:[],e)}}),V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=function(){return t=this.__wrapped__,Lt(this.__actions__,function(t,e){return e.func.apply(e.thisArg,O([t],e.args))},t);var t},p&&((p.exports=V)._=V,h._=V)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(t,e,r){e.exports=i;var e=t("inherits"),n=t("readable-stream");function i(t,e){var r=this;if(!(r instanceof i))return new i(t,e);n.Readable.call(r,e),r.destroyed=!1,r._drained=!1,r._forwarding=!1,r._current=null,r._toStreams2=e&&e.objectMode?o:s,"function"==typeof t?r._queue=t:(r._queue=t.map(r._toStreams2),r._queue.forEach(function(t){"function"!=typeof t&&r._attachErrorListener(t)})),r._next()}function o(t){return a(t,{objectMode:!0,highWaterMark:16})}function s(t){return a(t)}function a(t,e){if(!t||"function"==typeof t||t._readableState)return t;e=new n.Readable(e).wrap(t);return t.destroy&&(e.destroy=t.destroy.bind(t)),e}e(i,n.Readable),i.obj=function(t){return new i(t,{objectMode:!0,highWaterMark:16})},i.prototype._read=function(){this._drained=!0,this._forward()},i.prototype._forward=function(){if(!this._forwarding&&this._drained&&this._current){var t;for(this._forwarding=!0;null!==(t=this._current.read());)this._drained=this.push(t);this._forwarding=!1}},i.prototype.destroy=function(t){this.destroyed||(this.destroyed=!0,this._current&&this._current.destroy&&this._current.destroy(),"function"!=typeof this._queue&&this._queue.forEach(function(t){t.destroy&&t.destroy()}),t&&this.emit("error",t),this.emit("close"))},i.prototype._next=function(){var t,r=this;r._current=null,"function"==typeof r._queue?r._queue(function(t,e){return t?r.destroy(t):(e=r._toStreams2(e),r._attachErrorListener(e),void r._gotNextStream(e))}):("function"==typeof(t=r._queue.shift())&&(t=r._toStreams2(t()),r._attachErrorListener(t)),r._gotNextStream(t))},i.prototype._gotNextStream=function(e){var r=this;if(!e)return r.push(null),void r.destroy();function n(){r._forward()}function i(){e._readableState.ended||r.destroy()}r._current=e,r._forward(),e.on("readable",n),e.once("end",function t(){r._current=null;e.removeListener("readable",n);e.removeListener("end",t);e.removeListener("close",i);r._next()}),e.once("close",i)},i.prototype._attachErrorListener=function(r){var n=this;r&&r.once("error",function t(e){r.removeListener("error",t);n.destroy(e)})}},{inherits:39,"readable-stream":62}],45:[function(t,e,r){(function(a){"use strict";!a.version||0===a.version.indexOf("v0.")||0===a.version.indexOf("v1.")&&0!==a.version.indexOf("v1.8.")?e.exports={nextTick:function(t,e,r,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return a.nextTick(t);case 2:return a.nextTick(function(){t.call(null,e)});case 3:return a.nextTick(function(){t.call(null,e,r)});case 4:return a.nextTick(function(){t.call(null,e,r,n)});default:for(i=new Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return a.nextTick(function(){t.apply(null,i)})}}}:e.exports=a}).call(this,t("_process"))},{_process:46}],46:[function(t,e,r){var n,i,e=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=a(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=y,e.addListener=y,e.once=y,e.off=y,e.removeListener=y,e.removeAllListeners=y,e.emit=y,e.prependListener=y,e.prependOnceListener=y,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}],47:[function(t,e,r){"use strict";var i=t("asap/raw");function s(){}var o=null,a={};function u(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("Promise constructor's argument is not a function");this._40=0,this._65=0,this._55=null,this._72=null,t!==s&&p(t,this)}function c(t,e){for(;3===t._65;)t=t._55;if(u._37&&u._37(t),0===t._65)return 0===t._40?(t._40=1,void(t._72=e)):1===t._40?(t._40=2,void(t._72=[t._72,e])):void t._72.push(e);var r,n;r=t,n=e,i(function(){var t=1===r._65?n.onFulfilled:n.onRejected;null!==t?(t=function(t,e){try{return t(e)}catch(t){return o=t,a}}(t,r._55))===a?h(n.promise,o):l(n.promise,t):(1===r._65?l:h)(n.promise,r._55)})}function l(t,e){if(e===t)return h(t,new TypeError("A promise cannot be resolved with itself.")),0;if(e&&("object"==typeof e||"function"==typeof e)){var r=function(t){try{return t.then}catch(t){return o=t,a}}(e);if(r===a)return h(t,o),0;if(r===t.then&&e instanceof u)return t._65=3,t._55=e,void n(t);if("function"==typeof r)return void p(r.bind(e),t)}t._65=1,t._55=e,n(t)}function h(t,e){t._65=2,t._55=e,u._87&&u._87(t,e),n(t)}function n(t){if(1===t._40&&(c(t,t._72),t._72=null),2===t._40){for(var e=0;e<t._72.length;e++)c(t,t._72[e]);t._72=null}}function f(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function p(t,e){var r=!1,t=function(t,e,r){try{t(e,r)}catch(t){return o=t,a}}(t,function(t){r||(r=!0,l(e,t))},function(t){r||(r=!0,h(e,t))});r||t!==a||(r=!0,h(e,o))}(e.exports=u)._37=null,u._87=null,u._61=s,u.prototype.then=function(t,e){if(this.constructor!==u)return i=t,o=e,new(n=this).constructor(function(t,e){var r=new u(s);r.then(t,e),c(n,new f(i,o,r))});var n,i,o,r=new u(s);return c(this,new f(t,e,r)),r}},{"asap/raw":27}],48:[function(t,e,r){"use strict";var u=t("./core.js");e.exports=u;var n=l(!0),i=l(!1),o=l(null),s=l(void 0),a=l(0),c=l("");function l(t){var e=new u(u._61);return e._65=1,e._55=t,e}u.resolve=function(t){if(t instanceof u)return t;if(null===t)return o;if(void 0===t)return s;if(!0===t)return n;if(!1===t)return i;if(0===t)return a;if(""===t)return c;if("object"==typeof t||"function"==typeof t)try{var e=t.then;if("function"==typeof e)return new u(e.bind(t))}catch(r){return new u(function(t,e){e(r)})}return l(t)},u.all=function(t){var a=Array.prototype.slice.call(t);return new u(function(i,o){if(0===a.length)return i([]);var s=a.length;for(var t=0;t<a.length;t++)!function e(r,t){if(t&&("object"==typeof t||"function"==typeof t)){if(t instanceof u&&t.then===u.prototype.then){for(;3===t._65;)t=t._55;return 1===t._65?e(r,t._55):(2===t._65&&o(t._55),void t.then(function(t){e(r,t)},o))}var n=t.then;if("function"==typeof n)return void new u(n.bind(t)).then(function(t){e(r,t)},o)}a[r]=t,0==--s&&i(a)}(t,a[t])})},u.reject=function(r){return new u(function(t,e){e(r)})},u.race=function(t){return new u(function(e,r){t.forEach(function(t){u.resolve(t).then(e,r)})})},u.prototype.catch=function(t){return this.then(null,t)}},{"./core.js":47}],49:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){e=e||"&",r=r||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(e);e=1e3;n&&"number"==typeof n.maxKeys&&(e=n.maxKeys);var s=t.length;0<e&&e<s&&(s=e);for(var a=0;a<s;++a){var u,c=t[a].replace(o,"%20"),l=c.indexOf(r),h=0<=l?(u=c.substr(0,l),c.substr(l+1)):(u=c,""),f=decodeURIComponent(u),l=decodeURIComponent(h);c=i,h=f,Object.prototype.hasOwnProperty.call(c,h)?p(i[f])?i[f].push(l):i[f]=[i[f],l]:i[f]=l}return i};var p=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],50:[function(t,e,r){"use strict";function o(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}e.exports=function(r,n,i,t){return n=n||"&",i=i||"=",null===r&&(r=void 0),"object"==typeof r?a(u(r),function(t){var e=encodeURIComponent(o(t))+i;return s(r[t])?a(r[t],function(t){return e+encodeURIComponent(o(t))}).join(n):e+encodeURIComponent(o(r[t]))}).join(n):t?encodeURIComponent(o(t))+i+encodeURIComponent(o(r)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function a(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var u=Object.keys||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r}},{}],51:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":49,"./encode":50}],52:[function(t,e,r){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":53}],53:[function(t,e,r){"use strict";var n=t("process-nextick-args"),i=Object.keys||function(t){var e,r=[];for(e in t)r.push(e);return r};e.exports=l;e=t("core-util-is");e.inherits=t("inherits");var o=t("./_stream_readable"),s=t("./_stream_writable");e.inherits(l,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(t){if(!(this instanceof l))return new l(t);o.call(this,t),s.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},{"./_stream_readable":55,"./_stream_writable":57,"core-util-is":31,inherits:39,"process-nextick-args":45}],54:[function(t,e,r){"use strict";e.exports=i;var n=t("./_stream_transform"),e=t("core-util-is");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}e.inherits=t("inherits"),e.inherits(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":56,"core-util-is":31,inherits:39}],55:[function(C,L,t){(function(g,t){"use strict";var _=C("process-nextick-args");L.exports=i;var o,v=C("isarray");i.ReadableState=n;function b(t,e){return t.listeners(e).length}C("events").EventEmitter;var r=C("./internal/streams/stream"),l=C("safe-buffer").Buffer,h=t.Uint8Array||function(){};var e=C("core-util-is");e.inherits=C("inherits");var s,t=C("util"),w=void 0,w=t&&t.debuglog?t.debuglog("stream"):function(){},a=C("./internal/streams/BufferList"),t=C("./internal/streams/destroy");e.inherits(i,r);var u=["error","close","destroy","pause","resume"];function n(t,e){t=t||{};var r=e instanceof(o=o||C("./_stream_duplex"));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,i=t.readableHighWaterMark,e=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(i||0===i)?i:e,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new a,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s=s||C("string_decoder/").StringDecoder,this.decoder=new s(t.encoding),this.encoding=t.encoding)}function i(t){if(o=o||C("./_stream_duplex"),!(this instanceof i))return new i(t);this._readableState=new n(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function c(t,e,r,n,i){var o,s,a,u,c=t._readableState;return null===e?(c.reading=!1,s=t,(a=c).ended||(!a.decoder||(u=a.decoder.end())&&u.length&&(a.buffer.push(u),a.length+=a.objectMode?1:u.length),a.ended=!0,y(s))):(i||(o=function(t,e){var r;(function(t){return l.isBuffer(t)||t instanceof h})(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(c,e)),o?t.emit("error",o):c.objectMode||e&&0<e.length?("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===l.prototype||(o=e,e=l.from(o)),n?c.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):f(t,c,e,!0):c.ended?t.emit("error",new Error("stream.push() after EOF")):(c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?f(t,c,e,!1):E(t,c)):f(t,c,e,!1))):n||(c.reading=!1)),!(c=c).ended&&(c.needReadable||c.length<c.highWaterMark||0===c.length)}function f(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&y(t)),E(t,e)}Object.defineProperty(i.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),i.prototype.destroy=t.destroy,i.prototype._undestroy=t.undestroy,i.prototype._destroy=function(t,e){this.push(null),e(t)},i.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=l.from(t,e),e=""),r=!0),c(this,t,e,!1,r)},i.prototype.unshift=function(t){return c(this,t,null,!0,!1)},i.prototype.isPaused=function(){return!1===this._readableState.flowing},i.prototype.setEncoding=function(t){return s=s||C("string_decoder/").StringDecoder,this._readableState.decoder=new s(t),this._readableState.encoding=t,this};var p=8388608;function d(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?(e.flowing&&e.length?e.buffer.head.data:e).length:(t>e.highWaterMark&&(e.highWaterMark=(p<=(r=t)?r=p:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function y(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(w("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?_.nextTick(m,t):m(t))}function m(t){w("emit readable"),t.emit("readable"),O(t)}function E(t,e){e.readingMore||(e.readingMore=!0,_.nextTick(T,t,e))}function T(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(w("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function S(t){w("readable nexttick read 0"),t.read(0)}function x(t,e){e.reading||(w("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(w("flow",e.flowing);e.flowing&&null!==t.read(););}function I(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():(r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r).data=o.slice(s);break}++n}return e.length-=n,i}:function(t,e){var r=l.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n).data=o.slice(s);break}++i}return e.length-=i,r})(t,e);return n}(t,e.buffer,e.decoder),r);var r}function A(t){var e=t._readableState;if(0<e.length)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,_.nextTick(D,e,t))}function D(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}i.prototype.read=function(t){w("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return w("read: emitReadable",e.length,e.ended),(0===e.length&&e.ended?A:y)(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&A(this),null;var n=e.needReadable;return w("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&w("length less than watermark",n=!0),e.ended||e.reading?w("reading or ended",n=!1):n&&(w("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=d(r,e))),null===(n=0<t?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&A(this)),null!==n&&this.emit("data",n),n},i.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},i.prototype.pipe=function(r,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=r;break;case 1:i.pipes=[i.pipes,r];break;default:i.pipes.push(r)}i.pipesCount+=1,w("pipe count=%d opts=%j",i.pipesCount,t);var e=(!t||!1!==t.end)&&r!==g.stdout&&r!==g.stderr?s:m;function o(t,e){w("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,w("cleanup"),r.removeListener("close",d),r.removeListener("finish",y),r.removeListener("drain",u),r.removeListener("error",p),r.removeListener("unpipe",o),n.removeListener("end",s),n.removeListener("end",m),n.removeListener("data",f),c=!0,!i.awaitDrain||r._writableState&&!r._writableState.needDrain||u())}function s(){w("onend"),r.end()}i.endEmitted?_.nextTick(e):n.once("end",e),r.on("unpipe",o);var a,u=(a=n,function(){var t=a._readableState;w("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&b(a,"data")&&(t.flowing=!0,O(a))});r.on("drain",u);var c=!1;var l,h=!1;function f(t){w("ondata"),(h=!1)!==r.write(t)||h||((1===i.pipesCount&&i.pipes===r||1<i.pipesCount&&-1!==N(i.pipes,r))&&!c&&(w("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function p(t){w("onerror",t),m(),r.removeListener("error",p),0===b(r,"error")&&r.emit("error",t)}function d(){r.removeListener("finish",y),m()}function y(){w("onfinish"),r.removeListener("close",d),m()}function m(){w("unpipe"),n.unpipe(r)}return n.on("data",f),l="error",t=p,"function"==typeof(e=r).prependListener?e.prependListener(l,t):e._events&&e._events[l]?v(e._events[l])?e._events[l].unshift(t):e._events[l]=[t,e._events[l]]:e.on(l,t),r.once("close",d),r.once("finish",y),r.emit("pipe",n),i.flowing||(w("pipe resume"),n.resume()),r},i.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t=t||e.pipes,e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=N(e.pipes,t);return-1===s||(e.pipes.splice(s,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},i.prototype.addListener=i.prototype.on=function(t,e){e=r.prototype.on.call(this,t,e);return"data"===t?!1!==this._readableState.flowing&&this.resume():"readable"===t&&((t=this._readableState).endEmitted||t.readableListening||(t.readableListening=t.needReadable=!0,t.emittedReadable=!1,t.reading?t.length&&y(this):_.nextTick(S,this))),e},i.prototype.resume=function(){var t,e=this._readableState;return e.flowing||(w("resume"),e.flowing=!0,t=this,(e=e).resumeScheduled||(e.resumeScheduled=!0,_.nextTick(x,t,e))),this},i.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(e){var t,r=this,n=this._readableState,i=!1;for(t in e.on("end",function(){var t;w("wrapped end"),!n.decoder||n.ended||(t=n.decoder.end())&&t.length&&r.push(t),r.push(null)}),e.on("data",function(t){w("wrapped data"),n.decoder&&(t=n.decoder.write(t)),n.objectMode&&null==t||(n.objectMode||t&&t.length)&&(r.push(t)||(i=!0,e.pause()))}),e)void 0===this[t]&&"function"==typeof e[t]&&(this[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t));for(var o=0;o<u.length;o++)e.on(u[o],this.emit.bind(this,u[o]));return this._read=function(t){w("wrapped _read",t),i&&(i=!1,e.resume())},this},Object.defineProperty(i.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),i._fromList=I}).call(this,C("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":53,"./internal/streams/BufferList":58,"./internal/streams/destroy":59,"./internal/streams/stream":60,_process:46,"core-util-is":31,events:37,inherits:39,isarray:41,"process-nextick-args":45,"safe-buffer":65,"string_decoder/":68,util:29}],56:[function(t,e,r){"use strict";e.exports=i;var n=t("./_stream_duplex"),e=t("core-util-is");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t),this._transformState={afterTransform:function(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,(r.writecb=null)!=e&&this.push(e),n(t),(t=this._readableState).reading=!1,(t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",o)}function o(){var r=this;"function"==typeof this._flush?this._flush(function(t,e){s(r,t,e)}):s(this,null,null)}function s(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}e.inherits=t("inherits"),e.inherits(i,n),i.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},i.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},i.prototype._write=function(t,e,r){var n=this._transformState;n.writecb=r,n.writechunk=t,n.writeencoding=e,n.transforming||(e=this._readableState,(n.needTransform||e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark))},i.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},i.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,function(t){e(t),r.emit("close")})}},{"./_stream_duplex":53,"core-util-is":31,inherits:39}],57:[function(w,E,t){(function(t,e,r){"use strict";var f=w("process-nextick-args");function l(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}E.exports=c;var s,a=!t.browser&&-1<["v0.10","v0.9."].indexOf(t.version.slice(0,5))?r:f.nextTick;c.WritableState=u;r=w("core-util-is");r.inherits=w("inherits");var n={deprecate:w("util-deprecate")},i=w("./internal/streams/stream"),p=w("safe-buffer").Buffer,d=e.Uint8Array||function(){};var o,e=w("./internal/streams/destroy");function y(){}function u(t,o){s=s||w("./_stream_duplex"),t=t||{};var e=o instanceof s;this.objectMode=!!t.objectMode,e&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,n=t.writableHighWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:e&&(n||0===n)?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;i=(this.destroyed=!1)===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var e,r,n,i;r=t,n=(e=o)._writableState,i=n.sync,t=n.writecb,function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),r?function(t,e,r,n,i){--e.pendingcb,r?(f.nextTick(i,n),f.nextTick(b,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),b(t,e))}(e,n,i,r,t):((r=_(n))||n.corked||n.bufferProcessing||!n.bufferedRequest||g(e,n),i?a(h,e,n,r,t):h(e,n,r,t))},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function c(t){if(s=s||w("./_stream_duplex"),!(o.call(c,this)||this instanceof s))return new c(t);this._writableState=new u(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),i.call(this)}function m(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function h(t,e,r,n){var i;r||(i=t,0===(r=e).length&&r.needDrain&&(r.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),b(t,e)}function g(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),n=e.corkedRequestsFree;n.entry=r;for(var o=0,s=!0;r;)(i[o]=r).isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,m(t,e,!0,e.length,i,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new l(e),e.bufferedRequestCount=0}else{for(;r;){var a=r.chunk,u=r.encoding,c=r.callback;if(m(t,e,!1,e.objectMode?1:a.length,a,u,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function v(e,r){e._final(function(t){r.pendingcb--,t&&e.emit("error",t),r.prefinished=!0,e.emit("prefinish"),b(e,r)})}function b(t,e){var r,n,i=_(e);return i&&(r=t,(n=e).prefinished||n.finalCalled||("function"==typeof r._final?(n.pendingcb++,n.finalCalled=!0,f.nextTick(v,r,n)):(n.prefinished=!0,r.emit("prefinish"))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),i}r.inherits(c,i),u.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(u.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===c&&(t&&t._writableState instanceof u)}})):o=function(t){return t instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(t,e,r){var n,i,o,s,a,u,c=this._writableState,l=!1,h=!c.objectMode&&(i=t,p.isBuffer(i)||i instanceof d);return h&&!p.isBuffer(t)&&(o=t,t=p.from(o)),"function"==typeof e&&(r=e,e=null),e=h?"buffer":e||c.defaultEncoding,"function"!=typeof r&&(r=y),c.ended?(s=this,a=r,u=new Error("write after end"),s.emit("error",u),f.nextTick(a,u)):(h||(n=this,i=c,o=r,a=!(s=!0),null===(u=t)?a=new TypeError("May not write null values to stream"):"string"==typeof u||void 0===u||i.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(n.emit("error",a),f.nextTick(o,a),s=!1),s))&&(c.pendingcb++,l=function(t,e,r,n,i,o){r||(u=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,r));return e}(e,n,i),n!==u&&(r=!0,i="buffer",n=u));var s=e.objectMode?1:n.length;e.length+=s;var a=e.length<e.highWaterMark;a||(e.needDrain=!0);{var u;e.writing||e.corked?(u=e.lastBufferedRequest,e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1):m(t,e,!1,s,n,i,o)}return a}(this,c,h,t,e,r)),l},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||g(this,t))},c.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),c.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,e=t=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||(e=this,r=r,(n=n).ending=!0,b(e,n),r&&(n.finished?f.nextTick(r):e.once("finish",r)),n.ended=!0,e.writable=!1)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),c.prototype.destroy=e.destroy,c.prototype._undestroy=e.undestroy,c.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,w("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("timers").setImmediate)},{"./_stream_duplex":53,"./internal/streams/destroy":59,"./internal/streams/stream":60,_process:46,"core-util-is":31,inherits:39,"process-nextick-args":45,"safe-buffer":65,timers:69,"util-deprecate":70}],58:[function(t,e,r){"use strict";var a=t("safe-buffer").Buffer,n=t("util");function i(){!function(t){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this),this.head=null,this.tail=null,this.length=0}e.exports=(i.prototype.push=function(t){t={data:t,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(t){t={data:t,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},i.prototype.concat=function(t){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,e.copy(r,n),s+=o.data.length,o=o.next;return i},i),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var t=n.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":65,util:29}],59:[function(t,e,r){"use strict";var o=t("process-nextick-args");function s(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?e?e(t):!t||this._writableState&&this._writableState.errorEmitted||o.nextTick(s,this,t):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(o.nextTick(s,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":45}],60:[function(t,e,r){e.exports=t("events").EventEmitter},{events:37}],61:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":62}],62:[function(t,e,r){(((r=e.exports=t("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":53,"./lib/_stream_passthrough.js":54,"./lib/_stream_readable.js":55,"./lib/_stream_transform.js":56,"./lib/_stream_writable.js":57}],63:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":62}],64:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":57}],65:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");t=i(t);return void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:30}],66:[function(U,t,e){(function(r){!function(a){a.parser=function(t,e){return new i(t,e)},a.SAXParser=i,a.SAXStream=s,a.createStream=function(t,e){return new s(t,e)},a.MAX_BUFFER_LENGTH=65536;var n,u=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(t,e){if(!(this instanceof i))return new i(t,e);var r=this;!function(t){for(var e=0,r=u.length;e<r;e++)t[u[e]]=""}(r),r.q=r.c="",r.bufferCheckPosition=a.MAX_BUFFER_LENGTH,r.opt=e||{},r.opt.lowercase=r.opt.lowercase||r.opt.lowercasetags,r.looseCase=r.opt.lowercase?"toLowerCase":"toUpperCase",r.tags=[],r.closed=r.closedRoot=r.sawRoot=!1,r.tag=r.error=null,r.strict=!!t,r.noscript=!(!t&&!r.opt.noscript),r.state=T.BEGIN,r.strictEntities=r.opt.strictEntities,r.ENTITIES=r.strictEntities?Object.create(a.XML_ENTITIES):Object.create(a.ENTITIES),r.attribList=[],r.opt.xmlns&&(r.ns=Object.create(p)),r.trackPosition=!1!==r.opt.position,r.trackPosition&&(r.position=r.line=r.column=0),S(r,"onready")}a.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e,r=[];for(e in t)t.hasOwnProperty(e)&&r.push(e);return r}),i.prototype={end:function(){D(this)},write:function(t){var e=this;if(this.error)throw this.error;if(e.closed)return A(e,"Cannot write after close. Assign an onready handler.");if(null===t)return D(e);"object"==typeof t&&(t=t.toString());var r,n,i=0,o="";for(;o=M(t,i++),e.c=o;)switch(e.trackPosition&&(e.position++,"\n"===o?(e.line++,e.column=0):e.column++),e.state){case T.BEGIN:if(e.state=T.BEGIN_WHITESPACE,"\ufeff"===o)continue;k(e,o);continue;case T.BEGIN_WHITESPACE:k(e,o);continue;case T.TEXT:if(e.sawRoot&&!e.closedRoot){for(var s=i-1;o&&"<"!==o&&"&"!==o;)(o=M(t,i++))&&e.trackPosition&&(e.position++,"\n"===o?(e.line++,e.column=0):e.column++);e.textNode+=t.substring(s,i-1)}"<"!==o||e.sawRoot&&e.closedRoot&&!e.strict?(_(o)||e.sawRoot&&!e.closedRoot||N(e,"Text data outside of root node."),"&"===o?e.state=T.TEXT_ENTITY:e.textNode+=o):(e.state=T.OPEN_WAKA,e.startTagPosition=e.position);continue;case T.SCRIPT:"<"===o?e.state=T.SCRIPT_ENDING:e.script+=o;continue;case T.SCRIPT_ENDING:"/"===o?e.state=T.CLOSE_TAG:(e.script+="<"+o,e.state=T.SCRIPT);continue;case T.OPEN_WAKA:"!"===o?(e.state=T.SGML_DECL,e.sgmlDecl=""):_(o)||(b(d,o)?(e.state=T.OPEN_TAG,e.tagName=o):"/"===o?(e.state=T.CLOSE_TAG,e.tagName=""):"?"===o?(e.state=T.PROC_INST,e.procInstName=e.procInstBody=""):(N(e,"Unencoded <"),e.startTagPosition+1<e.position&&(s=e.position-e.startTagPosition,o=new Array(s).join(" ")+o),e.textNode+="<"+o,e.state=T.TEXT));continue;case T.SGML_DECL:(e.sgmlDecl+o).toUpperCase()===c?(x(e,"onopencdata"),e.state=T.CDATA,e.sgmlDecl="",e.cdata=""):e.sgmlDecl+o==="--"?(e.state=T.COMMENT,e.comment="",e.sgmlDecl=""):(e.sgmlDecl+o).toUpperCase()===l?(e.state=T.DOCTYPE,(e.doctype||e.sawRoot)&&N(e,"Inappropriately located doctype declaration"),e.doctype="",e.sgmlDecl=""):">"===o?(x(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=T.TEXT):(v(o)&&(e.state=T.SGML_DECL_QUOTED),e.sgmlDecl+=o);continue;case T.SGML_DECL_QUOTED:o===e.q&&(e.state=T.SGML_DECL,e.q=""),e.sgmlDecl+=o;continue;case T.DOCTYPE:">"===o?(e.state=T.TEXT,x(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=o,"["===o?e.state=T.DOCTYPE_DTD:v(o)&&(e.state=T.DOCTYPE_QUOTED,e.q=o));continue;case T.DOCTYPE_QUOTED:e.doctype+=o,o===e.q&&(e.q="",e.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:e.doctype+=o,"]"===o?e.state=T.DOCTYPE:v(o)&&(e.state=T.DOCTYPE_DTD_QUOTED,e.q=o);continue;case T.DOCTYPE_DTD_QUOTED:e.doctype+=o,o===e.q&&(e.state=T.DOCTYPE_DTD,e.q="");continue;case T.COMMENT:"-"===o?e.state=T.COMMENT_ENDING:e.comment+=o;continue;case T.COMMENT_ENDING:"-"===o?(e.state=T.COMMENT_ENDED,e.comment=I(e.opt,e.comment),e.comment&&x(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+o,e.state=T.COMMENT);continue;case T.COMMENT_ENDED:">"!==o?(N(e,"Malformed comment"),e.comment+="--"+o,e.state=T.COMMENT):e.state=T.TEXT;continue;case T.CDATA:"]"===o?e.state=T.CDATA_ENDING:e.cdata+=o;continue;case T.CDATA_ENDING:"]"===o?e.state=T.CDATA_ENDING_2:(e.cdata+="]"+o,e.state=T.CDATA);continue;case T.CDATA_ENDING_2:">"===o?(e.cdata&&x(e,"oncdata",e.cdata),x(e,"onclosecdata"),e.cdata="",e.state=T.TEXT):"]"===o?e.cdata+="]":(e.cdata+="]]"+o,e.state=T.CDATA);continue;case T.PROC_INST:"?"===o?e.state=T.PROC_INST_ENDING:_(o)?e.state=T.PROC_INST_BODY:e.procInstName+=o;continue;case T.PROC_INST_BODY:if(!e.procInstBody&&_(o))continue;"?"===o?e.state=T.PROC_INST_ENDING:e.procInstBody+=o;continue;case T.PROC_INST_ENDING:">"===o?(x(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=T.TEXT):(e.procInstBody+="?"+o,e.state=T.PROC_INST_BODY);continue;case T.OPEN_TAG:b(y,o)?e.tagName+=o:(function(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,r=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(r.ns=e.ns),t.attribList.length=0,x(t,"onopentagstart",r)}(e),">"===o?j(e):"/"===o?e.state=T.OPEN_TAG_SLASH:(_(o)||N(e,"Invalid character in tag name"),e.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:">"===o?(j(e,!0),R(e)):(N(e,"Forward-slash in opening tag not followed by >"),e.state=T.ATTRIB);continue;case T.ATTRIB:if(_(o))continue;">"===o?j(e):"/"===o?e.state=T.OPEN_TAG_SLASH:b(d,o)?(e.attribName=o,e.attribValue="",e.state=T.ATTRIB_NAME):N(e,"Invalid attribute name");continue;case T.ATTRIB_NAME:"="===o?e.state=T.ATTRIB_VALUE:">"===o?(N(e,"Attribute without value"),e.attribValue=e.attribName,L(e),j(e)):_(o)?e.state=T.ATTRIB_NAME_SAW_WHITE:b(y,o)?e.attribName+=o:N(e,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if("="===o)e.state=T.ATTRIB_VALUE;else{if(_(o))continue;N(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",x(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",">"===o?j(e):b(d,o)?(e.attribName=o,e.state=T.ATTRIB_NAME):(N(e,"Invalid attribute name"),e.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(_(o))continue;v(o)?(e.q=o,e.state=T.ATTRIB_VALUE_QUOTED):(N(e,"Unquoted attribute value"),e.state=T.ATTRIB_VALUE_UNQUOTED,e.attribValue=o);continue;case T.ATTRIB_VALUE_QUOTED:if(o!==e.q){"&"===o?e.state=T.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=o;continue}L(e),e.q="",e.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:_(o)?e.state=T.ATTRIB:">"===o?j(e):"/"===o?e.state=T.OPEN_TAG_SLASH:b(d,o)?(N(e,"No whitespace between attributes"),e.attribName=o,e.attribValue="",e.state=T.ATTRIB_NAME):N(e,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!function(t){return">"===t||_(t)}(o)){"&"===o?e.state=T.ATTRIB_VALUE_ENTITY_U:e.attribValue+=o;continue}L(e),">"===o?j(e):e.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(e.tagName)">"===o?R(e):b(y,o)?e.tagName+=o:e.script?(e.script+="</"+e.tagName,e.tagName="",e.state=T.SCRIPT):(_(o)||N(e,"Invalid tagname in closing tag"),e.state=T.CLOSE_TAG_SAW_WHITE);else{if(_(o))continue;!function(t,e){return!b(t,e)}(d,o)?e.tagName=o:e.script?(e.script+="</"+o,e.state=T.SCRIPT):N(e,"Invalid tagname in closing tag.")}continue;case T.CLOSE_TAG_SAW_WHITE:if(_(o))continue;">"===o?R(e):N(e,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:switch(e.state){case T.TEXT_ENTITY:r=T.TEXT,n="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:r=T.ATTRIB_VALUE_QUOTED,n="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:r=T.ATTRIB_VALUE_UNQUOTED,n="attribValue"}";"===o?(e[n]+=function(t){var e,r=t.entity,n=r.toLowerCase(),i="";if(t.ENTITIES[r])return t.ENTITIES[r];if(t.ENTITIES[n])return t.ENTITIES[n];"#"===(r=n).charAt(0)&&(i="x"===r.charAt(1)?(r=r.slice(2),(e=parseInt(r,16)).toString(16)):(r=r.slice(1),(e=parseInt(r,10)).toString(10)));if(r=r.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==r)return N(t,"Invalid character entity"),"&"+t.entity+";";return String.fromCodePoint(e)}(e),e.entity="",e.state=r):b(e.entity.length?g:m,o)?e.entity+=o:(N(e,"Invalid character in entity name"),e[n]+="&"+e.entity+o,e.entity="",e.state=r);continue;default:throw new Error(e,"Unknown state: "+e.state)}e.position>=e.bufferCheckPosition&&function(t){for(var e=Math.max(a.MAX_BUFFER_LENGTH,10),r=0,n=0,i=u.length;n<i;n++){var o=t[u[n]].length;if(e<o)switch(u[n]){case"textNode":O(t);break;case"cdata":x(t,"oncdata",t.cdata),t.cdata="";break;case"script":x(t,"onscript",t.script),t.script="";break;default:A(t,"Max buffer length exceeded: "+u[n])}r=Math.max(r,o)}var s=a.MAX_BUFFER_LENGTH-r;t.bufferCheckPosition=s+t.position}(e);return e},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;O(t=this),""!==t.cdata&&(x(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(x(t,"onscript",t.script),t.script="")}};try{n=U("stream").Stream}catch(t){n=function(){}}var o=a.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function s(t,e){if(!(this instanceof s))return new s(t,e);n.apply(this),this._parser=new i(t,e),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(t){r.emit("error",t),r._parser.error=null},this._decoder=null,o.forEach(function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t;r.on(e,t)},enumerable:!0,configurable:!1})})}(s.prototype=Object.create(n.prototype,{constructor:{value:s}})).write=function(t){var e;return"function"==typeof r&&"function"==typeof r.isBuffer&&r.isBuffer(t)&&(this._decoder||(e=U("string_decoder").StringDecoder,this._decoder=new e("utf8")),t=this._decoder.write(t)),this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},s.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===o.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)};var c="[CDATA[",l="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",f="http://www.w3.org/2000/xmlns/",p={xml:h,xmlns:f},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function _(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function v(t){return'"'===t||"'"===t}function b(t,e){return t.test(e)}var t,w,E,T=0;for(t in a.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},a.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},a.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(a.ENTITIES).forEach(function(t){var e=a.ENTITIES[t],e="number"==typeof e?String.fromCharCode(e):e;a.ENTITIES[t]=e}),a.STATE)a.STATE[a.STATE[t]]=t;function S(t,e,r){t[e]&&t[e](r)}function x(t,e,r){t.textNode&&O(t),S(t,e,r)}function O(t){t.textNode=I(t.opt,t.textNode),t.textNode&&S(t,"ontext",t.textNode),t.textNode=""}function I(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function A(t,e){return O(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,S(t,"onerror",e),t}function D(t){return t.sawRoot&&!t.closedRoot&&N(t,"Unclosed root tag"),t.state!==T.BEGIN&&t.state!==T.BEGIN_WHITESPACE&&t.state!==T.TEXT&&A(t,"Unexpected end"),O(t),t.c="",t.closed=!0,S(t,"onend"),i.call(t,t.strict,t.opt),t}function N(t,e){if("object"!=typeof t||!(t instanceof i))throw new Error("bad call to strictFail");t.strict&&A(t,e)}function C(t,e){var r=t.indexOf(":")<0?["",t]:t.split(":"),n=r[0],r=r[1];return e&&"xmlns"===t&&(n="xmlns",r=""),{prefix:n,local:r}}function L(t){var e,r,n;t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName)||(t.opt.xmlns?(n=(r=C(t.attribName,!0)).prefix,e=r.local,"xmlns"===n&&("xml"===e&&t.attribValue!==h?N(t,"xml: prefix must be bound to "+h+"\nActual: "+t.attribValue):"xmlns"===e&&t.attribValue!==f?N(t,"xmlns: prefix must be bound to "+f+"\nActual: "+t.attribValue):(r=t.tag,n=t.tags[t.tags.length-1]||t,r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[e]=t.attribValue)),t.attribList.push([t.attribName,t.attribValue])):(t.tag.attributes[t.attribName]=t.attribValue,x(t,"onattribute",{name:t.attribName,value:t.attribValue}))),t.attribName=t.attribValue=""}function j(e,t){if(e.opt.xmlns){var r=e.tag,n=C(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(N(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);n=e.tags[e.tags.length-1]||e;r.ns&&n.ns!==r.ns&&Object.keys(r.ns).forEach(function(t){x(e,"onopennamespace",{prefix:t,uri:r.ns[t]})});for(var i=0,o=e.attribList.length;i<o;i++){var s=e.attribList[i],a=s[0],u=s[1],c=C(a,!0),l=c.prefix,s=c.local,c=""!==l&&r.ns[l]||"",s={name:a,value:u,prefix:l,local:s,uri:c};l&&"xmlns"!==l&&!c&&(N(e,"Unbound namespace prefix: "+JSON.stringify(l)),s.uri=l),e.tag.attributes[a]=s,x(e,"onattribute",s)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),x(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=T.TEXT:e.state=T.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function R(r){if(!r.tagName)return N(r,"Weird empty close tag."),r.textNode+="</>",void(r.state=T.TEXT);if(r.script){if("script"!==r.tagName)return r.script+="</"+r.tagName+">",r.tagName="",void(r.state=T.SCRIPT);x(r,"onscript",r.script),r.script=""}var t=r.tags.length,e=r.tagName;r.strict||(e=e[r.looseCase]());for(var n=e;t--;){if(r.tags[t].name===n)break;N(r,"Unexpected close tag")}if(t<0)return N(r,"Unmatched closing tag: "+r.tagName),r.textNode+="</"+r.tagName+">",void(r.state=T.TEXT);r.tagName=e;for(var i=r.tags.length;i-- >t;){var o=r.tag=r.tags.pop();r.tagName=r.tag.name,x(r,"onclosetag",r.tagName);var s,a={};for(s in o.ns)a[s]=o.ns[s];var u=r.tags[r.tags.length-1]||r;r.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach(function(t){var e=o.ns[t];x(r,"onclosenamespace",{prefix:t,uri:e})})}0===t&&(r.closedRoot=!0),r.tagName=r.attribValue=r.attribName="",r.attribList.length=0,r.state=T.TEXT}function k(t,e){"<"===e?(t.state=T.OPEN_WAKA,t.startTagPosition=t.position):_(e)||(N(t,"Non-whitespace before first tag."),t.textNode=e,t.state=T.TEXT)}function M(t,e){var r="";return e<t.length&&(r=t.charAt(e)),r}function e(){var t,e=[],r=-1,n=arguments.length;if(!n)return"";for(var i="";++r<n;){var o=Number(arguments[r]);if(!isFinite(o)||o<0||1114111<o||E(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?e.push(o):(t=55296+((o-=65536)>>10),o=o%1024+56320,e.push(t,o)),(r+1===n||16384<e.length)&&(i+=w.apply(null,e),e.length=0)}return i}T=a.STATE,String.fromCodePoint||(w=String.fromCharCode,E=Math.floor,Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:e,configurable:!0,writable:!0}):String.fromCodePoint=e)}(void 0===e?this.sax={}:e)}).call(this,U("buffer").Buffer)},{buffer:30,stream:67,string_decoder:68}],67:[function(t,e,r){e.exports=n;var l=t("events").EventEmitter;function n(){l.call(this)}t("inherits")(n,l),n.Readable=t("readable-stream/readable.js"),n.Writable=t("readable-stream/writable.js"),n.Duplex=t("readable-stream/duplex.js"),n.Transform=t("readable-stream/transform.js"),n.PassThrough=t("readable-stream/passthrough.js"),(n.Stream=n).prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,e.end())}function a(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(t){if(c(),0===l.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},{events:37,inherits:39,"readable-stream/duplex.js":52,"readable-stream/passthrough.js":61,"readable-stream/readable.js":62,"readable-stream/transform.js":63,"readable-stream/writable.js":64}],68:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}function s(t){var e;switch(this.encoding=o(t),this.encoding){case"utf16le":this.text=c,this.end=l,e=4;break;case"utf8":this.fillLast=u,e=4;break;case"base64":this.text=h,this.end=f,e=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function u(t){var e,r,n=this.lastTotal-this.lastNeed,e=(e=this,128!=(192&(r=t)[0])?(e.lastNeed=0,"�"):1<e.lastNeed&&1<r.length?128!=(192&r[1])?(e.lastNeed=1,"�"):2<e.lastNeed&&2<r.length&&128!=(192&r[2])?(e.lastNeed=2,"�"):void 0:void 0);return void 0!==e?e:this.lastNeed<=t.length?(t.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,n,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1);var r=t.toString("utf16le",e);if(r){e=r.charCodeAt(r.length-1);if(55296<=e&&e<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function h(t,e){var r=(t.length-e)%3;return 0==r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}(r.StringDecoder=s).prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+"�":t},s.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=a(e[n]);if(0<=i)return 0<i&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(0<=(i=a(e[n])))return 0<i&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(0<=(i=a(e[n])))return 0<i&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;r=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":65}],69:[function(u,t,c){(function(t,e){var n=u("process/browser.js").nextTick,r=Function.prototype.apply,i=Array.prototype.slice,o={},s=0;function a(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new a(r.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new a(r.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=s++,r=!(arguments.length<2)&&i.call(arguments,1);return o[e]=!0,n(function(){o[e]&&(r?t.apply(null,r):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete o[t]}}).call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":46,timers:69}],70:[function(t,r,e){(function(e){function n(t){try{if(!e.localStorage)return}catch(t){return}t=e.localStorage[t];return null!=t&&"true"===String(t).toLowerCase()}r.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],71:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],72:[function(O,t,I){(function(n,i){var a=/%[sdj%]/g;I.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(a,function(t){if("%%"===t)return"%";if(i<=r)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r<i;s=n[++r])y(s)||!b(s)?o+=" "+s:o+=" "+u(s);return o},I.deprecate=function(t,e){if(_(i.process))return function(){return I.deprecate(t,e).apply(this,arguments)};if(!0===n.noDeprecation)return t;var r=!1;return function(){if(!r){if(n.throwDeprecation)throw new Error(e);n.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}};var t,o={};function u(t,e){var r={seen:[],stylize:c};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),d(e)?r.showHidden=e:e&&I._extend(r,e),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),l(r,t,r.depth)}function s(t,e){e=u.styles[e];return e?"["+u.colors[e][0]+"m"+t+"["+u.colors[e][1]+"m":t}function c(t,e){return t}function l(e,r,n){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==I.inspect&&(!r.constructor||r.constructor.prototype!==r)){var t=r.inspect(n,e);return g(t)||(t=l(e,t,n)),t}var i=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(y(e))return t.stylize("null","null")}(e,r);if(i)return i;var o,t=Object.keys(r),s=(o={},t.forEach(function(t,e){o[t]=!0}),o);if(e.showHidden&&(t=Object.getOwnPropertyNames(r)),E(r)&&(0<=t.indexOf("message")||0<=t.indexOf("description")))return h(r);if(0===t.length){if(T(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return h(r)}var i="",u=!1,a=["{","}"];return p(r)&&(u=!0,a=["[","]"]),T(r)&&(i=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(i=" "+RegExp.prototype.toString.call(r)),w(r)&&(i=" "+Date.prototype.toUTCString.call(r)),E(r)&&(i=" "+h(r)),0!==t.length||u&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),t=u?function(e,r,n,i,t){for(var o=[],s=0,a=r.length;s<a;++s)x(r,String(s))?o.push(f(e,r,n,i,String(s),!0)):o.push("");return t.forEach(function(t){t.match(/^\d+$/)||o.push(f(e,r,n,i,t,!0))}),o}(e,r,n,s,t):t.map(function(t){return f(e,r,n,s,t,u)}),e.seen.pop(),function(t,e,r){if(60<t.reduce(function(t,e){return 0<=e.indexOf("\n")&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0))return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(t,i,a)):a[0]+i+a[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i,o){var s,a,e=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]};if(e.get?a=e.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.set&&(a=t.stylize("[Setter]","special")),x(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(e.value)<0?-1<(a=y(r)?l(t,e.value,null):l(t,e.value,r-1)).indexOf("\n")&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return a;s=(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function y(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function _(t){return void 0===t}function v(t){return b(t)&&"[object RegExp]"===e(t)}function b(t){return"object"==typeof t&&null!==t}function w(t){return b(t)&&"[object Date]"===e(t)}function E(t){return b(t)&&("[object Error]"===e(t)||t instanceof Error)}function T(t){return"function"==typeof t}function e(t){return Object.prototype.toString.call(t)}function r(t){return t<10?"0"+t.toString(10):t.toString(10)}I.debuglog=function(e){var r;return _(t)&&(t=n.env.NODE_DEBUG||""),e=e.toUpperCase(),o[e]||(new RegExp("\\b"+e+"\\b","i").test(t)?(r=n.pid,o[e]=function(){var t=I.format.apply(I,arguments);console.error("%s %d: %s",e,r,t)}):o[e]=function(){}),o[e]},(I.inspect=u).colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},I.isArray=p,I.isBoolean=d,I.isNull=y,I.isNullOrUndefined=function(t){return null==t},I.isNumber=m,I.isString=g,I.isSymbol=function(t){return"symbol"==typeof t},I.isUndefined=_,I.isRegExp=v,I.isObject=b,I.isDate=w,I.isError=E,I.isFunction=T,I.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},I.isBuffer=O("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(t,e){return Object.prototype.hasOwnProperty.call(t,e)}I.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[r(t.getHours()),r(t.getMinutes()),r(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],e].join(" ")),I.format.apply(I,arguments))},I.inherits=O("inherits"),I._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,O("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":71,_process:46,inherits:39}],73:[function(t,e,r){(function(){"use strict";r.stripBOM=function(t){return"\ufeff"===t[0]?t.substring(1):t}}).call(this)},{}],74:[function(n,t,o){(function(){"use strict";var r,i,e,f,p,d={}.hasOwnProperty;function t(t){var e,r,n;for(e in this.options={},r=i[.2])d.call(r,e)&&(n=r[e],this.options[e]=n);for(e in t)d.call(t,e)&&(n=t[e],this.options[e]=n)}r=n("xmlbuilder"),i=n("./defaults").defaults,f=function(t){return"string"==typeof t&&(0<=t.indexOf("&")||0<=t.indexOf(">")||0<=t.indexOf("<"))},p=function(t){return"<![CDATA["+e(t)+"]]>"},e=function(t){return t.replace("]]>","]]]]><![CDATA[>")},o.Builder=(t.prototype.buildObject=function(t){var u,e,c,l=this.options.attrkey,h=this.options.charkey;return 1===Object.keys(t).length&&this.options.rootName===i[.2].rootName?t=t[e=Object.keys(t)[0]]:e=this.options.rootName,c=this,u=function(t,e){var r,n,i,o,s,a;if("object"!=typeof e)c.options.cdata&&f(e)?t.raw(p(e)):t.txt(e);else if(Array.isArray(e)){for(o in e)if(d.call(e,o))for(s in n=e[o])i=n[s],t=u(t.ele(s),i).up()}else for(s in e)if(d.call(e,s))if(n=e[s],s===l){if("object"==typeof n)for(r in n)a=n[r],t=t.att(r,a)}else if(s===h)t=c.options.cdata&&f(n)?t.raw(p(n)):t.txt(n);else if(Array.isArray(n))for(o in n)d.call(n,o)&&(t=("string"==typeof(i=n[o])?c.options.cdata&&f(i)?t.ele(s).raw(p(i)):t.ele(s,i):u(t.ele(s),i)).up());else t="object"==typeof n?u(t.ele(s),n).up():"string"==typeof n&&c.options.cdata&&f(n)?t.ele(s).raw(p(n)).up():(null==n&&(n=""),t.ele(s,n.toString()).up());return t},e=r.create(e,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),u(e,t).end(this.options.renderOpts)},t)}).call(this)},{"./defaults":75,xmlbuilder:100}],75:[function(t,e,r){(function(){r.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(this)},{}],76:[function(r,t,c){(function(){"use strict";function i(t,e){return function(){return t.apply(e,arguments)}}var n,o,t,f,p,s,u,a,d={}.hasOwnProperty;function e(t){var e,r,n;if(this.parseString=i(this.parseString,this),this.reset=i(this.reset,this),this.assignOrPush=i(this.assignOrPush,this),this.processAsync=i(this.processAsync,this),!(this instanceof c.Parser))return new c.Parser(t);for(e in this.options={},r=o[.2])d.call(r,e)&&(n=r[e],this.options[e]=n);for(e in t)d.call(t,e)&&(n=t[e],this.options[e]=n);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}u=r("sax"),t=r("events"),n=r("./bom"),s=r("./processors"),a=r("timers").setImmediate,o=r("./defaults").defaults,f=function(t){return"object"==typeof t&&null!=t&&0===Object.keys(t).length},p=function(t,e,r){for(var n=0,i=t.length;n<i;n++)e=(0,t[n])(e,r);return e},c.Parser=(function(t,e){for(var r in e)d.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,t.EventEmitter),e.prototype.processAsync=function(){var t,e;try{return this.remaining.length<=this.options.chunkSize?(t=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(t),this.saxParser.close()):(t=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(t),a(this.processAsync))}catch(t){if(e=t,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(e)}},e.prototype.assignOrPush=function(t,e,r){return e in t?(t[e]instanceof Array||(t[e]=[t[e]]),t[e].push(r)):this.options.explicitArray?t[e]=[r]:t[e]=r},e.prototype.reset=function(){var s,c,e,l,r,t,a,h,n;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(r=this,function(t){if(r.saxParser.resume(),!r.saxParser.errThrown)return r.saxParser.errThrown=!0,r.emit("error",t)}),this.saxParser.onend=(t=this,function(){if(!t.saxParser.ended)return t.saxParser.ended=!0,t.emit("end",t.resultObject)}),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,l=[],s=this.options.attrkey,c=this.options.charkey,this.saxParser.onopentag=(a=this,function(t){var e,r,n,i,o={};if(o[c]="",!a.options.ignoreAttrs)for(e in i=t.attributes)d.call(i,e)&&(s in o||a.options.mergeAttrs||(o[s]={}),r=a.options.attrValueProcessors?p(a.options.attrValueProcessors,t.attributes[e],e):t.attributes[e],n=a.options.attrNameProcessors?p(a.options.attrNameProcessors,e):e,a.options.mergeAttrs?a.assignOrPush(o,n,r):o[s][n]=r);return o["#name"]=a.options.tagNameProcessors?p(a.options.tagNameProcessors,t.name):t.name,a.options.xmlns&&(o[a.options.xmlnskey]={uri:t.uri,local:t.local}),l.push(o)}),this.saxParser.onclosetag=(h=this,function(){var t,e,n,r,i,o,s,a=l.pop(),u=a["#name"];if(h.options.explicitChildren&&h.options.preserveChildrenOrder||delete a["#name"],!0===a.cdata&&(t=a.cdata,delete a.cdata),o=l[l.length-1],a[c].match(/^\s*$/)&&!t?(i=a[c],delete a[c]):(h.options.trim&&(a[c]=a[c].trim()),h.options.normalize&&(a[c]=a[c].replace(/\s{2,}/g," ").trim()),a[c]=h.options.valueProcessors?p(h.options.valueProcessors,a[c],u):a[c],1===Object.keys(a).length&&c in a&&!h.EXPLICIT_CHARKEY&&(a=a[c])),f(a)&&(a=""!==h.options.emptyTag?h.options.emptyTag:i),null!=h.options.validator&&(s="/"+function(){for(var t=[],e=0,r=l.length;e<r;e++)n=l[e],t.push(n["#name"]);return t}().concat(u).join("/"),function(){try{a=h.options.validator(s,o&&o[u],a)}catch(t){return h.emit("error",t)}}()),h.options.explicitChildren&&!h.options.mergeAttrs&&"object"==typeof a)if(h.options.preserveChildrenOrder){if(o){for(e in o[h.options.childkey]=o[h.options.childkey]||[],r={},a)d.call(a,e)&&(r[e]=a[e]);o[h.options.childkey].push(r),delete a["#name"],1===Object.keys(a).length&&c in a&&!h.EXPLICIT_CHARKEY&&(a=a[c])}}else n={},h.options.attrkey in a&&(n[h.options.attrkey]=a[h.options.attrkey],delete a[h.options.attrkey]),!h.options.charsAsChildren&&h.options.charkey in a&&(n[h.options.charkey]=a[h.options.charkey],delete a[h.options.charkey]),0<Object.getOwnPropertyNames(a).length&&(n[h.options.childkey]=a),a=n;return 0<l.length?h.assignOrPush(o,u,a):(h.options.explicitRoot&&(i=a,(a={})[u]=i),h.resultObject=a,h.saxParser.ended=!0,h.emit("end",h.resultObject))}),e=function(t){var e,r=l[l.length-1];if(r)return r[c]+=t,n.options.explicitChildren&&n.options.preserveChildrenOrder&&n.options.charsAsChildren&&(n.options.includeWhiteChars||""!==t.replace(/\\n/g,"").trim())&&(r[n.options.childkey]=r[n.options.childkey]||[],(e={"#name":"__text__"})[c]=t,n.options.normalize&&(e[c]=e[c].replace(/\s{2,}/g," ").trim()),r[n.options.childkey].push(e)),r},(n=this).saxParser.ontext=e,this.saxParser.oncdata=function(t){t=e(t);if(t)return t.cdata=!0}},e.prototype.parseString=function(t,e){var r;null!=e&&"function"==typeof e&&(this.on("end",function(t){return this.reset(),e(null,t)}),this.on("error",function(t){return this.reset(),e(t)}));try{return""===(t=t.toString()).trim()?(this.emit("end",null),!0):(t=n.stripBOM(t),this.options.async?(this.remaining=t,a(this.processAsync),this.saxParser):this.saxParser.write(t).close())}catch(t){if(r=t,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",r),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw r}},e),c.parseString=function(t,e,r){var n,i;return null!=r?("function"==typeof r&&(n=r),"object"==typeof e&&(i=e)):("function"==typeof e&&(n=e),i={}),new c.Parser(i).parseString(t,n)}}).call(this)},{"./bom":73,"./defaults":75,"./processors":77,events:37,sax:66,timers:69}],77:[function(t,e,r){(function(){"use strict";var e=new RegExp(/(?!xmlns)^.*:/);r.normalize=function(t){return t.toLowerCase()},r.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},r.stripPrefix=function(t){return t.replace(e,"")},r.parseNumbers=function(t){return isNaN(t)||(t=t%1==0?parseInt(t,10):parseFloat(t)),t},r.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t="true"===t.toLowerCase()),t}}).call(this)},{}],78:[function(s,t,a){(function(){"use strict";var t,e,r,n,i={}.hasOwnProperty;function o(t){this.message=t}e=s("./defaults"),t=s("./builder"),r=s("./parser"),n=s("./processors"),a.defaults=e.defaults,a.processors=n,a.ValidationError=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(o,Error),o),a.Builder=t.Builder,a.Parser=r.Parser,a.parseString=r.parseString}).call(this)},{"./builder":74,"./defaults":75,"./parser":76,"./processors":77}],79:[function(t,o,e){(function(){var s=[].slice,a={}.hasOwnProperty,t=function(){var t,e,r,n,i=arguments[0],o=2<=arguments.length?s.call(arguments,1):[];if(u(Object.assign))Object.assign.apply(null,arguments);else for(t=0,r=o.length;t<r;t++)if(null!=(n=o[t]))for(e in n)a.call(n,e)&&(i[e]=n[e]);return i},u=function(t){return!!t&&"[object Function]"===Object.prototype.toString.call(t)},n=function(t){return!!t&&("function"==(t=typeof t)||"object"==t)},r=function(t){return u(Array.isArray)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},e=function(t){if(r(t))return!t.length;for(var e in t)if(a.call(t,e))return!1;return!0},i=function(t){var e,r;return n(t)&&(r=Object.getPrototypeOf(t))&&(e=r.constructor)&&"function"==typeof e&&e instanceof e&&Function.prototype.toString.call(e)===Function.prototype.toString.call(Object)};o.exports.assign=t,o.exports.isFunction=u,o.exports.isObject=n,o.exports.isArray=r,o.exports.isEmpty=e,o.exports.isPlainObject=i}).call(this)},{}],80:[function(t,e,r){(function(){function t(t,e,r){if(this.options=t.options,this.stringify=t.stringify,null==e)throw new Error("Missing attribute name of element "+t.name);if(null==r)throw new Error("Missing attribute value for attribute "+e+" of element "+t.name);this.name=this.stringify.attName(e),this.value=this.stringify.attValue(r)}e.exports=(t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(t){return this.options.writer.set(t).attribute(this)},t)}).call(this)},{}],81:[function(e,n,t){(function(){var t,i={}.hasOwnProperty;function r(t,e){if(r.__super__.constructor.call(this,t),null==e)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(e)}t=e("./XMLNode"),n.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(r,t),r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(t){return this.options.writer.set(t).cdata(this)},r)}).call(this)},{"./XMLNode":92}],82:[function(e,n,t){(function(){var t,i={}.hasOwnProperty;function r(t,e){if(r.__super__.constructor.call(this,t),null==e)throw new Error("Missing comment text");this.text=this.stringify.comment(e)}t=e("./XMLNode"),n.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(r,t),r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(t){return this.options.writer.set(t).comment(this)},r)}).call(this)},{"./XMLNode":92}],83:[function(e,r,t){(function(){var t,i={}.hasOwnProperty;function s(t,e,r,n,i,o){if(s.__super__.constructor.call(this,t),null==e)throw new Error("Missing DTD element name");if(null==r)throw new Error("Missing DTD attribute name");if(!n)throw new Error("Missing DTD attribute type");if(!i)throw new Error("Missing DTD attribute default");if(0!==i.indexOf("#")&&(i="#"+i),!i.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(o&&!i.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(e),this.attributeName=this.stringify.attName(r),this.attributeType=this.stringify.dtdAttType(n),this.defaultValue=this.stringify.dtdAttDefault(o),this.defaultValueType=i}t=e("./XMLNode"),r.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(s,t),s.prototype.toString=function(t){return this.options.writer.set(t).dtdAttList(this)},s)}).call(this)},{"./XMLNode":92}],84:[function(e,r,t){(function(){var t,i={}.hasOwnProperty;function n(t,e,r){if(n.__super__.constructor.call(this,t),null==e)throw new Error("Missing DTD element name");r=r||"(#PCDATA)",Array.isArray(r)&&(r="("+r.join(",")+")"),this.name=this.stringify.eleName(e),this.value=this.stringify.dtdElementValue(r)}t=e("./XMLNode"),r.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.set(t).dtdElement(this)},n)}).call(this)},{"./XMLNode":92}],85:[function(e,r,t){(function(){var t,i,o={}.hasOwnProperty;function s(t,e,r,n){if(s.__super__.constructor.call(this,t),null==r)throw new Error("Missing entity name");if(null==n)throw new Error("Missing entity value");if(this.pe=!!e,this.name=this.stringify.eleName(r),i(n)){if(!n.pubID&&!n.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(n.pubID&&!n.sysID)throw new Error("System identifier is required for a public external entity");if(null!=n.pubID&&(this.pubID=this.stringify.dtdPubID(n.pubID)),null!=n.sysID&&(this.sysID=this.stringify.dtdSysID(n.sysID)),null!=n.nData&&(this.nData=this.stringify.dtdNData(n.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(n)}i=e("./Utility").isObject,t=e("./XMLNode"),r.exports=(function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(s,t),s.prototype.toString=function(t){return this.options.writer.set(t).dtdEntity(this)},s)}).call(this)},{"./Utility":79,"./XMLNode":92}],86:[function(e,r,t){(function(){var t,i={}.hasOwnProperty;function n(t,e,r){if(n.__super__.constructor.call(this,t),null==e)throw new Error("Missing notation name");if(!r.pubID&&!r.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(e),null!=r.pubID&&(this.pubID=this.stringify.dtdPubID(r.pubID)),null!=r.sysID&&(this.sysID=this.stringify.dtdSysID(r.sysID))}t=e("./XMLNode"),r.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,t),n.prototype.toString=function(t){return this.options.writer.set(t).dtdNotation(this)},n)}).call(this)},{"./XMLNode":92}],87:[function(e,r,t){(function(){var t,i,o={}.hasOwnProperty;function s(t,e,r,n){s.__super__.constructor.call(this,t),i(e)&&(e=(t=e).version,r=t.encoding,n=t.standalone),e=e||"1.0",this.version=this.stringify.xmlVersion(e),null!=r&&(this.encoding=this.stringify.xmlEncoding(r)),null!=n&&(this.standalone=this.stringify.xmlStandalone(n))}i=e("./Utility").isObject,t=e("./XMLNode"),r.exports=(function(t,e){for(var r in e)o.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(s,t),s.prototype.toString=function(t){return this.options.writer.set(t).declaration(this)},s)}).call(this)},{"./Utility":79,"./XMLNode":92}],88:[function(e,c,t){(function(){var o,r,n,i,t,s,a={}.hasOwnProperty;function u(t,e,r){var n;u.__super__.constructor.call(this,t),this.documentObject=t,s(e)&&(e=(n=e).pubID,r=n.sysID),null==r&&(r=(n=[e,r])[0],e=n[1]),null!=e&&(this.pubID=this.stringify.dtdPubID(e)),null!=r&&(this.sysID=this.stringify.dtdSysID(r))}s=e("./Utility").isObject,t=e("./XMLNode"),o=e("./XMLDTDAttList"),n=e("./XMLDTDEntity"),r=e("./XMLDTDElement"),i=e("./XMLDTDNotation"),c.exports=(function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(u,t),u.prototype.element=function(t,e){e=new r(this,t,e);return this.children.push(e),this},u.prototype.attList=function(t,e,r,n,i){i=new o(this,t,e,r,n,i);return this.children.push(i),this},u.prototype.entity=function(t,e){e=new n(this,!1,t,e);return this.children.push(e),this},u.prototype.pEntity=function(t,e){e=new n(this,!0,t,e);return this.children.push(e),this},u.prototype.notation=function(t,e){e=new i(this,t,e);return this.children.push(e),this},u.prototype.toString=function(t){return this.options.writer.set(t).docType(this)},u.prototype.ele=function(t,e){return this.element(t,e)},u.prototype.att=function(t,e,r,n,i){return this.attList(t,e,r,n,i)},u.prototype.ent=function(t,e){return this.entity(t,e)},u.prototype.pent=function(t,e){return this.pEntity(t,e)},u.prototype.not=function(t,e){return this.notation(t,e)},u.prototype.up=function(){return this.root()||this.documentObject},u)}).call(this)},{"./Utility":79,"./XMLDTDAttList":83,"./XMLDTDElement":84,"./XMLDTDEntity":85,"./XMLDTDNotation":86,"./XMLNode":92}],89:[function(s,a,t){(function(){var t,e,r,n,i={}.hasOwnProperty;function o(t){o.__super__.constructor.call(this,null),(t=t||{}).writer||(t.writer=new e),this.options=t,this.stringify=new r(t),this.isDocument=!0}n=s("./Utility").isPlainObject,t=s("./XMLNode"),r=s("./XMLStringifier"),e=s("./XMLStringWriter"),a.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(o,t),o.prototype.end=function(t){return t?n(t)&&(t=this.options.writer.set(t)):t=this.options.writer,t.document(this)},o.prototype.toString=function(t){return this.options.writer.set(t).document(this)},o)}).call(this)},{"./Utility":79,"./XMLNode":92,"./XMLStringWriter":96,"./XMLStringifier":97}],90:[function(w,E,t){(function(){var i,e,r,o,n,s,a,u,c,l,h,f,p,d,y,m,g,_,t,v={}.hasOwnProperty;function b(t,e,r){var n;(t=t||{}).writer?_(t.writer)&&(n=t.writer,t.writer=new p(n)):t.writer=new p(t),this.options=t,this.writer=t.writer,this.stringify=new d(t),this.onDataCallback=e||function(){},this.onEndCallback=r||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}t=w("./Utility"),g=t.isObject,m=t.isFunction,_=t.isPlainObject,l=w("./XMLElement"),e=w("./XMLCData"),r=w("./XMLComment"),f=w("./XMLRaw"),y=w("./XMLText"),h=w("./XMLProcessingInstruction"),u=w("./XMLDeclaration"),c=w("./XMLDocType"),o=w("./XMLDTDAttList"),s=w("./XMLDTDEntity"),n=w("./XMLDTDElement"),a=w("./XMLDTDNotation"),i=w("./XMLAttribute"),d=w("./XMLStringifier"),p=w("./XMLStringWriter"),E.exports=(b.prototype.node=function(t,e,r){var n;if(null==t)throw new Error("Missing node name");if(this.root&&-1===this.currentLevel)throw new Error("Document can only have one root node");return this.openCurrent(),t=t.valueOf(),null==e&&(e={}),e=e.valueOf(),g(e)||(r=(n=[e,r])[0],e=n[1]),this.currentNode=new l(this,t,e),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,null!=r&&this.text(r),this},b.prototype.element=function(t,e,r){return this.currentNode&&this.currentNode instanceof c?this.dtdElement.apply(this,arguments):this.node(t,e,r)},b.prototype.attribute=function(t,e){var r,n;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(null!=t&&(t=t.valueOf()),g(t))for(r in t)v.call(t,r)&&(n=t[r],this.attribute(r,n));else m(e)&&(e=e.apply()),this.options.skipNullAttributes&&null==e||(this.currentNode.attributes[t]=new i(this,t,e));return this},b.prototype.text=function(t){return this.openCurrent(),t=new y(this,t),this.onData(this.writer.text(t,this.currentLevel+1)),this},b.prototype.cdata=function(t){return this.openCurrent(),t=new e(this,t),this.onData(this.writer.cdata(t,this.currentLevel+1)),this},b.prototype.comment=function(t){return this.openCurrent(),t=new r(this,t),this.onData(this.writer.comment(t,this.currentLevel+1)),this},b.prototype.raw=function(t){return this.openCurrent(),t=new f(this,t),this.onData(this.writer.raw(t,this.currentLevel+1)),this},b.prototype.instruction=function(t,e){var r,n,i,o;if(this.openCurrent(),null!=t&&(t=t.valueOf()),null!=e&&(e=e.valueOf()),Array.isArray(t))for(r=0,o=t.length;r<o;r++)n=t[r],this.instruction(n);else if(g(t))for(n in t)v.call(t,n)&&(i=t[n],this.instruction(n,i));else m(e)&&(e=e.apply()),e=new h(this,t,e),this.onData(this.writer.processingInstruction(e,this.currentLevel+1));return this},b.prototype.declaration=function(t,e,r){if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return r=new u(this,t,e,r),this.onData(this.writer.declaration(r,this.currentLevel+1)),this},b.prototype.doctype=function(t,e,r){if(this.openCurrent(),null==t)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new c(this,e,r),this.currentNode.rootNodeName=t,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},b.prototype.dtdElement=function(t,e){return this.openCurrent(),e=new n(this,t,e),this.onData(this.writer.dtdElement(e,this.currentLevel+1)),this},b.prototype.attList=function(t,e,r,n,i){return this.openCurrent(),i=new o(this,t,e,r,n,i),this.onData(this.writer.dtdAttList(i,this.currentLevel+1)),this},b.prototype.entity=function(t,e){return this.openCurrent(),e=new s(this,!1,t,e),this.onData(this.writer.dtdEntity(e,this.currentLevel+1)),this},b.prototype.pEntity=function(t,e){return this.openCurrent(),e=new s(this,!0,t,e),this.onData(this.writer.dtdEntity(e,this.currentLevel+1)),this},b.prototype.notation=function(t,e){return this.openCurrent(),e=new a(this,t,e),this.onData(this.writer.dtdNotation(e,this.currentLevel+1)),this},b.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},b.prototype.end=function(){for(;0<=this.currentLevel;)this.up();return this.onEnd()},b.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},b.prototype.openNode=function(t){if(!t.isOpen)return!this.root&&0===this.currentLevel&&t instanceof l&&(this.root=t),this.onData(this.writer.openNode(t,this.currentLevel)),t.isOpen=!0},b.prototype.closeNode=function(t){if(!t.isClosed)return this.onData(this.writer.closeNode(t,this.currentLevel)),t.isClosed=!0},b.prototype.onData=function(t){return this.documentStarted=!0,this.onDataCallback(t)},b.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},b.prototype.ele=function(){return this.element.apply(this,arguments)},b.prototype.nod=function(t,e,r){return this.node(t,e,r)},b.prototype.txt=function(t){return this.text(t)},b.prototype.dat=function(t){return this.cdata(t)},b.prototype.com=function(t){return this.comment(t)},b.prototype.ins=function(t,e){return this.instruction(t,e)},b.prototype.dec=function(t,e,r){return this.declaration(t,e,r)},b.prototype.dtd=function(t,e,r){return this.doctype(t,e,r)},b.prototype.e=function(t,e,r){return this.element(t,e,r)},b.prototype.n=function(t,e,r){return this.node(t,e,r)},b.prototype.t=function(t){return this.text(t)},b.prototype.d=function(t){return this.cdata(t)},b.prototype.c=function(t){return this.comment(t)},b.prototype.r=function(t){return this.raw(t)},b.prototype.i=function(t,e){return this.instruction(t,e)},b.prototype.att=function(){return(this.currentNode&&this.currentNode instanceof c?this.attList:this.attribute).apply(this,arguments)},b.prototype.a=function(){return(this.currentNode&&this.currentNode instanceof c?this.attList:this.attribute).apply(this,arguments)},b.prototype.ent=function(t,e){return this.entity(t,e)},b.prototype.pent=function(t,e){return this.pEntity(t,e)},b.prototype.not=function(t,e){return this.notation(t,e)},b)}).call(this)},{"./Utility":79,"./XMLAttribute":80,"./XMLCData":81,"./XMLComment":82,"./XMLDTDAttList":83,"./XMLDTDElement":84,"./XMLDTDEntity":85,"./XMLDTDNotation":86,"./XMLDeclaration":87,"./XMLDocType":88,"./XMLElement":91,"./XMLProcessingInstruction":93,"./XMLRaw":94,"./XMLStringWriter":96,"./XMLStringifier":97,"./XMLText":98}],91:[function(e,r,t){(function(){var i,o,s,t,a={}.hasOwnProperty;function n(t,e,r){if(n.__super__.constructor.call(this,t),null==e)throw new Error("Missing element name");this.name=this.stringify.eleName(e),this.attributes={},null!=r&&this.attribute(r),t.isDocument&&(this.isRoot=!0,(this.documentObject=t).rootObject=this)}t=e("./Utility"),s=t.isObject,o=t.isFunction,t=e("./XMLNode"),i=e("./XMLAttribute"),r.exports=(function(t,e){for(var r in e)a.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){var t,e,r,n=Object.create(this);for(e in n.isRoot&&(n.documentObject=null),n.attributes={},r=this.attributes)a.call(r,e)&&(t=r[e],n.attributes[e]=t.clone());return n.children=[],this.children.forEach(function(t){t=t.clone();return(t.parent=n).children.push(t)}),n},n.prototype.attribute=function(t,e){var r,n;if(null!=t&&(t=t.valueOf()),s(t))for(r in t)a.call(t,r)&&(n=t[r],this.attribute(r,n));else o(e)&&(e=e.apply()),this.options.skipNullAttributes&&null==e||(this.attributes[t]=new i(this,t,e));return this},n.prototype.removeAttribute=function(t){var e,r,n;if(null==t)throw new Error("Missing attribute name");if(t=t.valueOf(),Array.isArray(t))for(r=0,n=t.length;r<n;r++)e=t[r],delete this.attributes[e];else delete this.attributes[t];return this},n.prototype.toString=function(t){return this.options.writer.set(t).element(this)},n.prototype.att=function(t,e){return this.attribute(t,e)},n.prototype.a=function(t,e){return this.attribute(t,e)},n)}).call(this)},{"./Utility":79,"./XMLAttribute":80,"./XMLNode":92}],92:[function(c,l,t){(function(){var e,r,i,h,o,s,n,a,p,d,y,t,m={}.hasOwnProperty;function u(t){this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],o||(o=c("./XMLElement"),e=c("./XMLCData"),r=c("./XMLComment"),i=c("./XMLDeclaration"),h=c("./XMLDocType"),n=c("./XMLRaw"),a=c("./XMLText"),s=c("./XMLProcessingInstruction"))}t=c("./Utility"),y=t.isObject,d=t.isFunction,p=t.isEmpty,s=a=n=h=i=r=e=o=null,l.exports=(u.prototype.element=function(t,e,r){var n,i,o,s,a,u,c,l,h,f=null;if(null==e&&(e={}),e=e.valueOf(),y(e)||(r=(l=[e,r])[0],e=l[1]),null!=t&&(t=t.valueOf()),Array.isArray(t))for(o=0,u=t.length;o<u;o++)i=t[o],f=this.element(i);else if(d(t))f=this.element(t.apply());else if(y(t)){for(a in t)if(m.call(t,a))if(h=t[a],d(h)&&(h=h.apply()),y(h)&&p(h)&&(h=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===a.indexOf(this.stringify.convertAttKey))f=this.attribute(a.substr(this.stringify.convertAttKey.length),h);else if(!this.options.separateArrayItems&&Array.isArray(h))for(s=0,c=h.length;s<c;s++)i=h[s],(n={})[a]=i,f=this.element(n);else y(h)?(f=this.element(a)).element(h):f=this.element(a,h)}else f=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===t.indexOf(this.stringify.convertTextKey)?this.text(r):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===t.indexOf(this.stringify.convertCDataKey)?this.cdata(r):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===t.indexOf(this.stringify.convertCommentKey)?this.comment(r):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===t.indexOf(this.stringify.convertRawKey)?this.raw(r):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===t.indexOf(this.stringify.convertPIKey)?this.instruction(t.substr(this.stringify.convertPIKey.length),r):this.node(t,e,r);if(null==f)throw new Error("Could not create any elements with: "+t);return f},u.prototype.insertBefore=function(t,e,r){var n;if(this.isRoot)throw new Error("Cannot insert elements at root level");return n=this.parent.children.indexOf(this),n=this.parent.children.splice(n),r=this.parent.element(t,e,r),Array.prototype.push.apply(this.parent.children,n),r},u.prototype.insertAfter=function(t,e,r){var n;if(this.isRoot)throw new Error("Cannot insert elements at root level");return n=this.parent.children.indexOf(this),n=this.parent.children.splice(n+1),r=this.parent.element(t,e,r),Array.prototype.push.apply(this.parent.children,n),r},u.prototype.remove=function(){var t;if(this.isRoot)throw new Error("Cannot remove the root element");return t=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[t,t-t+1].concat([])),this.parent},u.prototype.node=function(t,e,r){var n;return null!=t&&(t=t.valueOf()),e=(e=e||{}).valueOf(),y(e)||(r=(n=[e,r])[0],e=n[1]),e=new o(this,t,e),null!=r&&e.text(r),this.children.push(e),e},u.prototype.text=function(t){t=new a(this,t);return this.children.push(t),this},u.prototype.cdata=function(t){t=new e(this,t);return this.children.push(t),this},u.prototype.comment=function(t){t=new r(this,t);return this.children.push(t),this},u.prototype.commentBefore=function(t){var e=this.parent.children.indexOf(this),e=this.parent.children.splice(e);this.parent.comment(t);return Array.prototype.push.apply(this.parent.children,e),this},u.prototype.commentAfter=function(t){var e=this.parent.children.indexOf(this),e=this.parent.children.splice(e+1);this.parent.comment(t);return Array.prototype.push.apply(this.parent.children,e),this},u.prototype.raw=function(t){t=new n(this,t);return this.children.push(t),this},u.prototype.instruction=function(t,e){var r,n,i,o;if(null!=t&&(t=t.valueOf()),null!=e&&(e=e.valueOf()),Array.isArray(t))for(i=0,o=t.length;i<o;i++)r=t[i],this.instruction(r);else if(y(t))for(r in t)m.call(t,r)&&(n=t[r],this.instruction(r,n));else d(e)&&(e=e.apply()),e=new s(this,t,e),this.children.push(e);return this},u.prototype.instructionBefore=function(t,e){var r=this.parent.children.indexOf(this),r=this.parent.children.splice(r);this.parent.instruction(t,e);return Array.prototype.push.apply(this.parent.children,r),this},u.prototype.instructionAfter=function(t,e){var r=this.parent.children.indexOf(this),r=this.parent.children.splice(r+1);this.parent.instruction(t,e);return Array.prototype.push.apply(this.parent.children,r),this},u.prototype.declaration=function(t,e,r){var n=this.document(),r=new i(n,t,e,r);return n.children[0]instanceof i?n.children[0]=r:n.children.unshift(r),n.root()||n},u.prototype.doctype=function(t,e){for(var r,n,i,o,s=this.document(),a=new h(s,t,e),u=s.children,c=r=0,l=u.length;r<l;c=++r)if(u[c]instanceof h)return s.children[c]=a;for(c=n=0,i=(o=s.children).length;n<i;c=++n)if(o[c].isRoot)return s.children.splice(c,0,a),a;return s.children.push(a),a},u.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},u.prototype.root=function(){for(var t=this;t;){if(t.isDocument)return t.rootObject;if(t.isRoot)return t;t=t.parent}},u.prototype.document=function(){for(var t=this;t;){if(t.isDocument)return t;t=t.parent}},u.prototype.end=function(t){return this.document().end(t)},u.prototype.prev=function(){var t=this.parent.children.indexOf(this);if(t<1)throw new Error("Already at the first node");return this.parent.children[t-1]},u.prototype.next=function(){var t=this.parent.children.indexOf(this);if(-1===t||t===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[t+1]},u.prototype.importDocument=function(t){t=t.root().clone();return t.parent=this,t.isRoot=!1,this.children.push(t),this},u.prototype.ele=function(t,e,r){return this.element(t,e,r)},u.prototype.nod=function(t,e,r){return this.node(t,e,r)},u.prototype.txt=function(t){return this.text(t)},u.prototype.dat=function(t){return this.cdata(t)},u.prototype.com=function(t){return this.comment(t)},u.prototype.ins=function(t,e){return this.instruction(t,e)},u.prototype.doc=function(){return this.document()},u.prototype.dec=function(t,e,r){return this.declaration(t,e,r)},u.prototype.dtd=function(t,e){return this.doctype(t,e)},u.prototype.e=function(t,e,r){return this.element(t,e,r)},u.prototype.n=function(t,e,r){return this.node(t,e,r)},u.prototype.t=function(t){return this.text(t)},u.prototype.d=function(t){return this.cdata(t)},u.prototype.c=function(t){return this.comment(t)},u.prototype.r=function(t){return this.raw(t)},u.prototype.i=function(t,e){return this.instruction(t,e)},u.prototype.u=function(){return this.up()},u.prototype.importXMLBuilder=function(t){return this.importDocument(t)},u)}).call(this)},{"./Utility":79,"./XMLCData":81,"./XMLComment":82,"./XMLDeclaration":87,"./XMLDocType":88,"./XMLElement":91,"./XMLProcessingInstruction":93,"./XMLRaw":94,"./XMLText":98}],93:[function(e,r,t){(function(){var t,i={}.hasOwnProperty;function n(t,e,r){if(n.__super__.constructor.call(this,t),null==e)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(e),r&&(this.value=this.stringify.insValue(r))}t=e("./XMLNode"),r.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(n,t),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(t){return this.options.writer.set(t).processingInstruction(this)},n)}).call(this)},{"./XMLNode":92}],94:[function(e,n,t){(function(){var t,i={}.hasOwnProperty;function r(t,e){if(r.__super__.constructor.call(this,t),null==e)throw new Error("Missing raw text");this.value=this.stringify.raw(e)}t=e("./XMLNode"),n.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(r,t),r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(t){return this.options.writer.set(t).raw(this)},r)}).call(this)},{"./XMLNode":92}],95:[function(e,n,t){(function(){var l,h,s,a,u,c,f,p,d,y,m,g,t,_={}.hasOwnProperty;function r(t,e){r.__super__.constructor.call(this,e),this.stream=t}f=e("./XMLDeclaration"),p=e("./XMLDocType"),l=e("./XMLCData"),h=e("./XMLComment"),d=e("./XMLElement"),m=e("./XMLRaw"),g=e("./XMLText"),y=e("./XMLProcessingInstruction"),s=e("./XMLDTDAttList"),a=e("./XMLDTDElement"),u=e("./XMLDTDEntity"),c=e("./XMLDTDNotation"),t=e("./XMLWriterBase"),n.exports=(function(t,e){for(var r in e)_.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(r,t),r.prototype.document=function(t){for(var e,r,n,i,o,s=t.children,a=0,u=s.length;a<u;a++)(e=s[a]).isLastRootNode=!1;for(t.children[t.children.length-1].isLastRootNode=!0,o=[],r=0,n=(i=t.children).length;r<n;r++)switch(!1){case!((e=i[r])instanceof f):o.push(this.declaration(e));break;case!(e instanceof p):o.push(this.docType(e));break;case!(e instanceof h):o.push(this.comment(e));break;case!(e instanceof y):o.push(this.processingInstruction(e));break;default:o.push(this.element(e))}return o},r.prototype.attribute=function(t){return this.stream.write(" "+t.name+'="'+t.value+'"')},r.prototype.cdata=function(t,e){return this.stream.write(this.space(e)+"<![CDATA["+t.text+"]]>"+this.endline(t))},r.prototype.comment=function(t,e){return this.stream.write(this.space(e)+"\x3c!-- "+t.text+" --\x3e"+this.endline(t))},r.prototype.declaration=function(t,e){return this.stream.write(this.space(e)),this.stream.write('<?xml version="'+t.version+'"'),null!=t.encoding&&this.stream.write(' encoding="'+t.encoding+'"'),null!=t.standalone&&this.stream.write(' standalone="'+t.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(t))},r.prototype.docType=function(t,e){var r,n,i,o;if(e=e||0,this.stream.write(this.space(e)),this.stream.write("<!DOCTYPE "+t.root().name),t.pubID&&t.sysID?this.stream.write(' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'):t.sysID&&this.stream.write(' SYSTEM "'+t.sysID+'"'),0<t.children.length){for(this.stream.write(" ["),this.stream.write(this.endline(t)),n=0,i=(o=t.children).length;n<i;n++)switch(!1){case!((r=o[n])instanceof s):this.dtdAttList(r,e+1);break;case!(r instanceof a):this.dtdElement(r,e+1);break;case!(r instanceof u):this.dtdEntity(r,e+1);break;case!(r instanceof c):this.dtdNotation(r,e+1);break;case!(r instanceof l):this.cdata(r,e+1);break;case!(r instanceof h):this.comment(r,e+1);break;case!(r instanceof y):this.processingInstruction(r,e+1);break;default:throw new Error("Unknown DTD node type: "+r.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(t))},r.prototype.element=function(t,e){var r,n,i,o,s,a,u,c;for(s in e=e||0,c=this.space(e),this.stream.write(c+"<"+t.name),a=t.attributes)_.call(a,s)&&(r=a[s],this.attribute(r));if(0===t.children.length||t.children.every(function(t){return""===t.value}))this.allowEmpty?this.stream.write("></"+t.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&1===t.children.length&&null!=t.children[0].value)this.stream.write(">"),this.stream.write(t.children[0].value),this.stream.write("</"+t.name+">");else{for(this.stream.write(">"+this.newline),i=0,o=(u=t.children).length;i<o;i++)switch(!1){case!((n=u[i])instanceof l):this.cdata(n,e+1);break;case!(n instanceof h):this.comment(n,e+1);break;case!(n instanceof d):this.element(n,e+1);break;case!(n instanceof m):this.raw(n,e+1);break;case!(n instanceof g):this.text(n,e+1);break;case!(n instanceof y):this.processingInstruction(n,e+1);break;default:throw new Error("Unknown XML node type: "+n.constructor.name)}this.stream.write(c+"</"+t.name+">")}return this.stream.write(this.endline(t))},r.prototype.processingInstruction=function(t,e){return this.stream.write(this.space(e)+"<?"+t.target),t.value&&this.stream.write(" "+t.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(t))},r.prototype.raw=function(t,e){return this.stream.write(this.space(e)+t.value+this.endline(t))},r.prototype.text=function(t,e){return this.stream.write(this.space(e)+t.value+this.endline(t))},r.prototype.dtdAttList=function(t,e){return this.stream.write(this.space(e)+"<!ATTLIST "+t.elementName+" "+t.attributeName+" "+t.attributeType),"#DEFAULT"!==t.defaultValueType&&this.stream.write(" "+t.defaultValueType),t.defaultValue&&this.stream.write(' "'+t.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(t))},r.prototype.dtdElement=function(t,e){return this.stream.write(this.space(e)+"<!ELEMENT "+t.name+" "+t.value),this.stream.write(this.spacebeforeslash+">"+this.endline(t))},r.prototype.dtdEntity=function(t,e){return this.stream.write(this.space(e)+"<!ENTITY"),t.pe&&this.stream.write(" %"),this.stream.write(" "+t.name),t.value?this.stream.write(' "'+t.value+'"'):(t.pubID&&t.sysID?this.stream.write(' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'):t.sysID&&this.stream.write(' SYSTEM "'+t.sysID+'"'),t.nData&&this.stream.write(" NDATA "+t.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(t))},r.prototype.dtdNotation=function(t,e){return this.stream.write(this.space(e)+"<!NOTATION "+t.name),t.pubID&&t.sysID?this.stream.write(' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'):t.pubID?this.stream.write(' PUBLIC "'+t.pubID+'"'):t.sysID&&this.stream.write(' SYSTEM "'+t.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(t))},r.prototype.endline=function(t){return t.isLastRootNode?"":this.newline},r)}).call(this)},{"./XMLCData":81,"./XMLComment":82,"./XMLDTDAttList":83,"./XMLDTDElement":84,"./XMLDTDEntity":85,"./XMLDTDNotation":86,"./XMLDeclaration":87,"./XMLDocType":88,"./XMLElement":91,"./XMLProcessingInstruction":93,"./XMLRaw":94,"./XMLText":98,"./XMLWriterBase":99}],96:[function(r,n,t){(function(){var y,m,a,u,c,l,s,h,g,_,v,b,t,w={}.hasOwnProperty;function e(t){e.__super__.constructor.call(this,t)}s=r("./XMLDeclaration"),h=r("./XMLDocType"),y=r("./XMLCData"),m=r("./XMLComment"),g=r("./XMLElement"),v=r("./XMLRaw"),b=r("./XMLText"),_=r("./XMLProcessingInstruction"),a=r("./XMLDTDAttList"),u=r("./XMLDTDElement"),c=r("./XMLDTDEntity"),l=r("./XMLDTDNotation"),t=r("./XMLWriterBase"),n.exports=(function(t,e){for(var r in e)w.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,t),e.prototype.document=function(t){var e,r,n,i,o;for(this.textispresent=!1,i="",r=0,n=(o=t.children).length;r<n;r++)e=o[r],i+=function(){switch(!1){case!(e instanceof s):return this.declaration(e);case!(e instanceof h):return this.docType(e);case!(e instanceof m):return this.comment(e);case!(e instanceof _):return this.processingInstruction(e);default:return this.element(e,0)}}.call(this);return this.pretty&&i.slice(-this.newline.length)===this.newline&&(i=i.slice(0,-this.newline.length)),i},e.prototype.attribute=function(t){return" "+t.name+'="'+t.value+'"'},e.prototype.cdata=function(t,e){return this.space(e)+"<![CDATA["+t.text+"]]>"+this.newline},e.prototype.comment=function(t,e){return this.space(e)+"\x3c!-- "+t.text+" --\x3e"+this.newline},e.prototype.declaration=function(t,e){e=this.space(e);return e+='<?xml version="'+t.version+'"',null!=t.encoding&&(e+=' encoding="'+t.encoding+'"'),null!=t.standalone&&(e+=' standalone="'+t.standalone+'"'),e+=this.spacebeforeslash+"?>",e+=this.newline},e.prototype.docType=function(t,e){var r,n,i,o,s;if(e=e||0,o=this.space(e),o+="<!DOCTYPE "+t.root().name,t.pubID&&t.sysID?o+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(o+=' SYSTEM "'+t.sysID+'"'),0<t.children.length){for(o+=" [",o+=this.newline,n=0,i=(s=t.children).length;n<i;n++)r=s[n],o+=function(){switch(!1){case!(r instanceof a):return this.dtdAttList(r,e+1);case!(r instanceof u):return this.dtdElement(r,e+1);case!(r instanceof c):return this.dtdEntity(r,e+1);case!(r instanceof l):return this.dtdNotation(r,e+1);case!(r instanceof y):return this.cdata(r,e+1);case!(r instanceof m):return this.comment(r,e+1);case!(r instanceof _):return this.processingInstruction(r,e+1);default:throw new Error("Unknown DTD node type: "+r.constructor.name)}}.call(this);o+="]"}return o+=this.spacebeforeslash+">",o+=this.newline},e.prototype.element=function(t,e){var r,n,i,o,s,a,u,c,l,h,f,p,d;for(u in e=e||0,d=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),c="",c+=(p=this.space(e))+"<"+t.name,l=t.attributes)w.call(l,u)&&(r=l[u],c+=this.attribute(r));if(0===t.children.length||t.children.every(function(t){return""===t.value}))this.allowEmpty?c+="></"+t.name+">"+this.newline:c+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&1===t.children.length&&null!=t.children[0].value)c+=">",c+=t.children[0].value,c+="</"+t.name+">"+this.newline;else{if(this.dontprettytextnodes)for(i=0,s=(h=t.children).length;i<s;i++)if(null!=(n=h[i]).value){this.textispresent++,d=!0;break}for(this.textispresent&&(this.newline="",this.pretty=!1,p=this.space(e)),c+=">"+this.newline,o=0,a=(f=t.children).length;o<a;o++)n=f[o],c+=function(){switch(!1){case!(n instanceof y):return this.cdata(n,e+1);case!(n instanceof m):return this.comment(n,e+1);case!(n instanceof g):return this.element(n,e+1);case!(n instanceof v):return this.raw(n,e+1);case!(n instanceof b):return this.text(n,e+1);case!(n instanceof _):return this.processingInstruction(n,e+1);default:throw new Error("Unknown XML node type: "+n.constructor.name)}}.call(this);d&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),c+=p+"</"+t.name+">"+this.newline}return c},e.prototype.processingInstruction=function(t,e){e=this.space(e)+"<?"+t.target;return t.value&&(e+=" "+t.value),e+=this.spacebeforeslash+"?>"+this.newline},e.prototype.raw=function(t,e){return this.space(e)+t.value+this.newline},e.prototype.text=function(t,e){return this.space(e)+t.value+this.newline},e.prototype.dtdAttList=function(t,e){e=this.space(e)+"<!ATTLIST "+t.elementName+" "+t.attributeName+" "+t.attributeType;return"#DEFAULT"!==t.defaultValueType&&(e+=" "+t.defaultValueType),t.defaultValue&&(e+=' "'+t.defaultValue+'"'),e+=this.spacebeforeslash+">"+this.newline},e.prototype.dtdElement=function(t,e){return this.space(e)+"<!ELEMENT "+t.name+" "+t.value+this.spacebeforeslash+">"+this.newline},e.prototype.dtdEntity=function(t,e){e=this.space(e)+"<!ENTITY";return t.pe&&(e+=" %"),e+=" "+t.name,t.value?e+=' "'+t.value+'"':(t.pubID&&t.sysID?e+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(e+=' SYSTEM "'+t.sysID+'"'),t.nData&&(e+=" NDATA "+t.nData)),e+=this.spacebeforeslash+">"+this.newline},e.prototype.dtdNotation=function(t,e){e=this.space(e)+"<!NOTATION "+t.name;return t.pubID&&t.sysID?e+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.pubID?e+=' PUBLIC "'+t.pubID+'"':t.sysID&&(e+=' SYSTEM "'+t.sysID+'"'),e+=this.spacebeforeslash+">"+this.newline},e.prototype.openNode=function(t,e){var r,n,i,o;if(e=e||0,t instanceof g){for(n in i=this.space(e)+"<"+t.name,o=t.attributes)w.call(o,n)&&(r=o[n],i+=this.attribute(r));return i+=(t.children?">":"/>")+this.newline}return i=this.space(e)+"<!DOCTYPE "+t.rootNodeName,t.pubID&&t.sysID?i+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(i+=' SYSTEM "'+t.sysID+'"'),i+=(t.children?" [":">")+this.newline},e.prototype.closeNode=function(t,e){switch(e=e||0,!1){case!(t instanceof g):return this.space(e)+"</"+t.name+">"+this.newline;case!(t instanceof h):return this.space(e)+"]>"+this.newline}},e)}).call(this)},{"./XMLCData":81,"./XMLComment":82,"./XMLDTDAttList":83,"./XMLDTDElement":84,"./XMLDTDEntity":85,"./XMLDTDNotation":86,"./XMLDeclaration":87,"./XMLDocType":88,"./XMLElement":91,"./XMLProcessingInstruction":93,"./XMLRaw":94,"./XMLText":98,"./XMLWriterBase":99}],97:[function(t,e,r){(function(){var s={}.hasOwnProperty;function t(t){var e,r,n,i,o;for(n in this.assertLegalChar=(e=this.assertLegalChar,r=this,function(){return e.apply(r,arguments)}),t=t||{},this.noDoubleEncoding=t.noDoubleEncoding,i=t.stringify||{})s.call(i,n)&&(o=i[n],this[n]=o)}e.exports=(t.prototype.eleName=function(t){return t=""+t||"",this.assertLegalChar(t)},t.prototype.eleText=function(t){return t=""+t||"",this.assertLegalChar(this.elEscape(t))},t.prototype.cdata=function(t){return t=(t=""+t||"").replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(t)},t.prototype.comment=function(t){if((t=""+t||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+t);return this.assertLegalChar(t)},t.prototype.raw=function(t){return""+t||""},t.prototype.attName=function(t){return""+t||""},t.prototype.attValue=function(t){return t=""+t||"",this.attEscape(t)},t.prototype.insTarget=function(t){return""+t||""},t.prototype.insValue=function(t){if((t=""+t||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+t);return t},t.prototype.xmlVersion=function(t){if(!(t=""+t||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+t);return t},t.prototype.xmlEncoding=function(t){if(!(t=""+t||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+t);return t},t.prototype.xmlStandalone=function(t){return t?"yes":"no"},t.prototype.dtdPubID=function(t){return""+t||""},t.prototype.dtdSysID=function(t){return""+t||""},t.prototype.dtdElementValue=function(t){return""+t||""},t.prototype.dtdAttType=function(t){return""+t||""},t.prototype.dtdAttDefault=function(t){return null!=t?""+t||"":t},t.prototype.dtdEntityValue=function(t){return""+t||""},t.prototype.dtdNData=function(t){return""+t||""},t.prototype.convertAttKey="@",t.prototype.convertPIKey="?",t.prototype.convertTextKey="#text",t.prototype.convertCDataKey="#cdata",t.prototype.convertCommentKey="#comment",t.prototype.convertRawKey="#raw",t.prototype.assertLegalChar=function(t){var e=t.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);if(e)throw new Error("Invalid character in string: "+t+" at index "+e.index);return t},t.prototype.elEscape=function(t){var e=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return t.replace(e,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},t.prototype.attEscape=function(t){var e=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return t.replace(e,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},t)}).call(this)},{}],98:[function(e,n,t){(function(){var t,i={}.hasOwnProperty;function r(t,e){if(r.__super__.constructor.call(this,t),null==e)throw new Error("Missing element text");this.value=this.stringify.eleText(e)}t=e("./XMLNode"),n.exports=(function(t,e){for(var r in e)i.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(r,t),r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(t){return this.options.writer.set(t).text(this)},r)}).call(this)},{"./XMLNode":92}],99:[function(t,e,r){(function(){var s={}.hasOwnProperty;function t(t){var e,r,n,i,o;for(e in t=t||{},this.pretty=t.pretty||!1,this.allowEmpty=null!=(r=t.allowEmpty)&&r,this.pretty?(this.indent=null!=(n=t.indent)?n:" ",this.newline=null!=(n=t.newline)?n:"\n",this.offset=null!=(n=t.offset)?n:0,this.dontprettytextnodes=null!=(n=t.dontprettytextnodes)?n:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=null!=(n=t.spacebeforeslash)?n:"",!0===this.spacebeforeslash&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,i=t.writer||{})s.call(i,e)&&(o=i[e],this[e]=o)}e.exports=(t.prototype.set=function(t){var e,r,n;for(e in"pretty"in(t=t||{})&&(this.pretty=t.pretty),"allowEmpty"in t&&(this.allowEmpty=t.allowEmpty),this.pretty?(this.indent="indent"in t?t.indent:" ",this.newline="newline"in t?t.newline:"\n",this.offset="offset"in t?t.offset:0,this.dontprettytextnodes="dontprettytextnodes"in t?t.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in t?t.spacebeforeslash:"",!0===this.spacebeforeslash&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,r=t.writer||{})s.call(r,e)&&(n=r[e],this[e]=n);return this},t.prototype.space=function(t){var e;return this.pretty&&0<(e=(t||0)+this.offset+1)?new Array(e).join(this.indent):""},t)}).call(this)},{}],100:[function(n,u,t){(function(){var t=n("./Utility"),i=t.assign,o=t.isFunction,s=n("./XMLDocument"),a=n("./XMLDocumentCB"),e=n("./XMLStringWriter"),r=n("./XMLStreamWriter");u.exports.create=function(t,e,r,n){if(null==t)throw new Error("Root element needs a name");return n=i({},e,r,n),t=(r=new s(n)).element(t),n.headless||(r.declaration(n),null==n.pubID&&null==n.sysID||r.doctype(n)),t},u.exports.begin=function(t,e,r){var n;return o(t)&&(e=(n=[t,e])[0],r=n[1],t={}),e?new a(t,e,r):new s(t)},u.exports.stringWriter=function(t){return new e(t)},u.exports.streamWriter=function(t,e){return new r(t,e)}}).call(this)},{"./Utility":79,"./XMLDocument":89,"./XMLDocumentCB":90,"./XMLStreamWriter":95,"./XMLStringWriter":96}]},{},[1])(1)});
|
|
2
|
+
//# sourceMappingURL=jsforce-core.min.js.map
|