pict 1.0.76 → 1.0.78
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/dist/pict.compatible.js +2 -2
- package/dist/pict.compatible.min.js +1 -1
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +2 -2
- package/dist/pict.min.js +1 -1
- package/dist/pict.min.js.map +1 -1
- package/package.json +4 -5
- package/source/Pict-Application.js +1 -1
- package/source/Pict-View.js +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -2884,7 +2884,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
2884
2884
|
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],107:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],108:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultPictSettings={Name:'DefaultPictApplication',InitializeOnLoad:true,// The main "viewport" is the view that is used to host our application
|
|
2885
2885
|
MainViewportView:'Default-View',MainViewportRenderable:'Application-Default-View-Renderable',MainViewportDestinationAddress:'Application-Destination-Address',MainViewportDefaultDataAddress:'',// Whether or not we should automatically render the main viewport when appropriate
|
|
2886
2886
|
AutoRenderMainViewportView:false,Manifests:{},// The prefix to prepend on all template destination hashes
|
|
2887
|
-
IdentifierAddressPrefix:'PICT-'};var PictApplication=/*#__PURE__*/function(_libFableServiceBase10){_inherits(PictApplication,_libFableServiceBase10);var _super20=_createSuper(PictApplication);function PictApplication(pFable,pOptions,pServiceHash){var _this34;_classCallCheck2(this,PictApplication);_this34=_super20.call(this,pFable,pOptions,pServiceHash);_this34.options=_this34.fable.Utility.extend(defaultPictSettings,_this34.options);_this34.serviceType='PictApplication';_this34.AppData=_this34.fable.AppData;_this34.initializationFunctionSet=[];var tmpManifestKeys=Object.keys(_this34.options.Manifests);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
|
|
2887
|
+
IdentifierAddressPrefix:'PICT-'};var PictApplication=/*#__PURE__*/function(_libFableServiceBase10){_inherits(PictApplication,_libFableServiceBase10);var _super20=_createSuper(PictApplication);function PictApplication(pFable,pOptions,pServiceHash){var _this34;_classCallCheck2(this,PictApplication);_this34=_super20.call(this,pFable,pOptions,pServiceHash);_this34.options=_this34.fable.Utility.extend(JSON.parse(JSON.stringify(defaultPictSettings)),_this34.options);_this34.serviceType='PictApplication';_this34.AppData=_this34.fable.AppData;_this34.initializationFunctionSet=[];var tmpManifestKeys=Object.keys(_this34.options.Manifests);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
|
|
2888
2888
|
var tmpManifestKey=tmpManifestKeys[i];_this34.fable.serviceManager.instantiateServiceProvider('Manifest',_this34.options.Manifests[tmpManifestKey],tmpManifestKey);}}if(_this34.options.InitializeOnLoad){return _possibleConstructorReturn(_this34,_this34.initialize());}if(_this34.options.AutoRenderMainViewportView){_this34.log.info("Pict Application ".concat(_this34.options.Name,"[").concat(_this34.UUID,"]::[").concat(_this34.Hash,"] beginning auto render of [").concat(_this34.options.MainViewportView,"::").concat(_this34.options.MainViewportRenderable,"]."));_this34.renderAsync(_this34.options.MainViewportView,_this34.options.MainViewportRenderable,_this34.options.MainViewportDestinationAddress,_this34.options.MainViewportDefaultDataAddress,function(){});}return _this34;}// TODO: do we need an asynchronous version of this?
|
|
2889
2889
|
_createClass2(PictApplication,[{key:"solve",value:function solve(){this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] executing solve() function..."));return true;}},{key:"internalInitialize",value:function internalInitialize(){return true;}},{key:"initialize",value:function initialize(){this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] beginning initialization..."));this.internalInitialize();this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] initialization complete."));}},{key:"render",value:function render(pViewHash,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress){var tmpView=typeof pViewHash==='string'?this.services.PictView[pViewHash]:false;if(!tmpView){this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(pViewHash," because it is not a valid view."));return false;}return tmpView.render(pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress);}},{key:"renderAsync",value:function renderAsync(pViewHash,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var tmpView=typeof pViewHash==='string'?this.services.PictView[pViewHash]:false;if(!tmpView){this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(pViewHash," because it is not a valid view."));return false;}return tmpView.renderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback);}}]);return PictApplication;}(libFableServiceBase);module.exports=PictApplication;},{"fable":39}],109:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase11){_inherits(PictContentAssignment,_libFableServiceBase11);var _super21=_createSuper(PictContentAssignment);function PictContentAssignment(pFable,pOptions,pServiceHash){var _this35;_classCallCheck2(this,PictContentAssignment);_this35=_super21.call(this,pFable,pOptions,pServiceHash);_this35.serviceType='PictContentAssignment';// Check to see if we are running in a browser
|
|
2890
2890
|
_this35.inBrowser=false;_this35.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this35.inBrowser=true;// Now check that the browser has a document object
|
|
@@ -2930,7 +2930,7 @@ _this40.loadTemplateFunction=function(pTemplateHash){return false;};return _this
|
|
|
2930
2930
|
*/for(var i=0;i<this.defaultTemplates.length;i++){if(pTemplateHash.indexOf(this.defaultTemplates[i].postfix)==pTemplateHash.length-this.defaultTemplates[i].postfix.length&&pTemplateHash.indexOf(this.defaultTemplates[i].prefix)==0){this.templates[pTemplateHash]=this.defaultTemplates[i].template;this.templateSources[pTemplateHash]="Auto created in checkDefaultTemplateHash('".concat(pTemplateHash,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(this.defaultTemplates[i].prefix,"]...[").concat(this.defaultTemplates[i].postfix,"]");return this.templates[pTemplateHash];}}return false;}},{key:"getTemplate",value:function getTemplate(pTemplateHash){// TODO: Optimize this.
|
|
2931
2931
|
// If the template doesn't exist, try to load it with the loading function
|
|
2932
2932
|
if(!this.templates.hasOwnProperty(pTemplateHash)){this.loadTemplate(pTemplateHash);}// If the loading function fails, try to load it from the default templates
|
|
2933
|
-
if(!this.templates.hasOwnProperty(pTemplateHash)){this.checkDefaultTemplateHash(pTemplateHash);}if(this.templates.hasOwnProperty(pTemplateHash)){return this.templates[pTemplateHash];}else{return false;}}},{key:"loadTemplate",value:function loadTemplate(pTemplateHash){var tmpTemplate=this.loadTemplateFunction(pTemplateHash);if(tmpTemplate){this.templates[pTemplateHash]=tmpTemplate.template;this.templateSources[pTemplateHash]="Loaded in loadTemplate('".concat(pTemplateHash,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(tmpTemplate.source,"]");}return tmpTemplate;}}]);return PictTemplateProvider;}(libFableServiceBase);module.exports=PictTemplateProvider;},{"fable":39}],113:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultPictViewSettings={DefaultRenderable:false,DefaultDestinationAddress:false,DefaultTemplateRecordAddress:false,ViewIdentifier:'DEFAULT',InitializeOnLoad:true,RenderOnLoad:false,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};var PictView=/*#__PURE__*/function(_libFableServiceBase15){_inherits(PictView,_libFableServiceBase15);var _super25=_createSuper(PictView);function PictView(pFable,pOptions,pServiceHash){var _this41;_classCallCheck2(this,PictView);_this41=_super25.call(this,pFable,pOptions,pServiceHash);_this41.options=_this41.fable.Utility.extend(defaultPictViewSettings,_this41.options);_this41.serviceType='PictView';// Wire in the essential Pict service
|
|
2933
|
+
if(!this.templates.hasOwnProperty(pTemplateHash)){this.checkDefaultTemplateHash(pTemplateHash);}if(this.templates.hasOwnProperty(pTemplateHash)){return this.templates[pTemplateHash];}else{return false;}}},{key:"loadTemplate",value:function loadTemplate(pTemplateHash){var tmpTemplate=this.loadTemplateFunction(pTemplateHash);if(tmpTemplate){this.templates[pTemplateHash]=tmpTemplate.template;this.templateSources[pTemplateHash]="Loaded in loadTemplate('".concat(pTemplateHash,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(tmpTemplate.source,"]");}return tmpTemplate;}}]);return PictTemplateProvider;}(libFableServiceBase);module.exports=PictTemplateProvider;},{"fable":39}],113:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultPictViewSettings={DefaultRenderable:false,DefaultDestinationAddress:false,DefaultTemplateRecordAddress:false,ViewIdentifier:'DEFAULT',InitializeOnLoad:true,RenderOnLoad:false,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};var PictView=/*#__PURE__*/function(_libFableServiceBase15){_inherits(PictView,_libFableServiceBase15);var _super25=_createSuper(PictView);function PictView(pFable,pOptions,pServiceHash){var _this41;_classCallCheck2(this,PictView);_this41=_super25.call(this,pFable,pOptions,pServiceHash);_this41.options=_this41.fable.Utility.extend(JSON.parse(JSON.stringify(defaultPictViewSettings)),_this41.options);_this41.serviceType='PictView';// Wire in the essential Pict service
|
|
2934
2934
|
_this41.AppData=_this41.fable.AppData;// Load all templates from the array in the options
|
|
2935
2935
|
// Templates are in the form of {Hash:'Some-Template-Hash',Template:'Template content',Source:'TemplateSource'}
|
|
2936
2936
|
for(var i=0;i<_this41.options.Templates.length;i++){var tmpTemplate=_this41.options.Templates[i];if(!tmpTemplate.hasOwnProperty('Hash')||!tmpTemplate.hasOwnProperty('Template')){_this41.log.error("PictView [".concat(_this41.UUID,"]::[").concat(_this41.Hash,"] ").concat(_this41.options.ViewIdentifier," could not load Template ").concat(i," in the options array."),tmpTemplate);}else{if(!tmpTemplate.Source){tmpTemplate.Source="PictView [".concat(_this41.UUID,"]::[").concat(_this41.Hash,"] ").concat(_this41.options.ViewIdentifier," options object.");}_this41.fable.TemplateProvider.addTemplate(tmpTemplate.Hash,tmpTemplate.Template,tmpTemplate.Source);}}// Load all default templates from the array in the options
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @description Process text streams, parsing out meta-template expressions.
|
|
10
10
|
*/
|
|
11
|
-
var n=e("./WordTree.js"),i=e("./StringParser.js"),a=function(){function e(){_classCallCheck2(this,e),this.WordTree=new n,this.StringParser=new i,this.ParseTree=this.WordTree.ParseTree}return _createClass2(e,[{key:"addPattern",value:function(e,t,r){return this.WordTree.addPattern(e,t,r)}},{key:"parseString",value:function(e,t){return this.StringParser.parseString(e,this.ParseTree,t)}}]),e}();t.exports=a},{"./StringParser.js":72,"./WordTree.js":73}],72:[function(e,t,r){var n=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"newParserState",value:function(e){return{ParseTree:e,Asynchronous:!1,Output:"",OutputBuffer:"",Pattern:!1,PatternMatch:!1,PatternMatchOutputBuffer:""}}},{key:"assignNode",value:function(e,t){t.PatternMatch=e,t.PatternMatch.hasOwnProperty("PatternEnd")&&(t.Pattern=t.PatternMatch)}},{key:"appendOutputBuffer",value:function(e,t){t.OutputBuffer+=e}},{key:"flushOutputBuffer",value:function(e){e.Output+=e.OutputBuffer,e.OutputBuffer=""}},{key:"checkPatternEnd",value:function(e,t){e.OutputBuffer.length>=e.Pattern.PatternEnd.length+e.Pattern.PatternStart.length&&e.OutputBuffer.substr(-e.Pattern.PatternEnd.length)===e.Pattern.PatternEnd&&(e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStart.length,e.OutputBuffer.length-(e.Pattern.PatternStart.length+e.Pattern.PatternEnd.length)),t),this.flushOutputBuffer(e),e.Pattern=!1,e.PatternMatch=!1)}},{key:"parseCharacter",value:function(e,t,r){!t.PatternMatch&&t.ParseTree.hasOwnProperty(e)?(this.assignNode(t.ParseTree[e],t),this.appendOutputBuffer(e,t)):t.PatternMatch?(t.PatternMatch.hasOwnProperty(e)&&this.assignNode(t.PatternMatch[e],t),this.appendOutputBuffer(e,t),t.Pattern&&this.checkPatternEnd(t,r)):t.Output+=e}},{key:"parseString",value:function(e,t,r){for(var n=this.newParserState(t),i=0;i<e.length;i++)this.parseCharacter(e[i],n,r);return this.flushOutputBuffer(n),n.Output}}]),e}();t.exports=n},{}],73:[function(e,t,r){var n=function(){function e(){_classCallCheck2(this,e),this.ParseTree={}}return _createClass2(e,[{key:"addChild",value:function(e,t,r){return e.hasOwnProperty(t[r])||(e[t[r]]={}),e[t[r]]}},{key:"addPattern",value:function(e,t,r){if(e.length<1)return!1;if("string"==typeof t&&t.length<1)return!1;for(var n=this.ParseTree,i=0;i<e.length;i++)n=this.addChild(n,e,i);return n.PatternStart=e,n.PatternEnd="string"==typeof t&&t.length>0?t:e,n.Parse="function"==typeof r?r:"string"==typeof r?function(){return r}:function(e){return e},!0}}]),e}();t.exports=n},{}],74:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(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(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!f){var e=u(p);f=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new g(e,t)),1!==l.length||f||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=y,a.addListener=y,a.once=y,a.off=y,a.removeListener=y,a.removeAllListeners=y,a.emit=y,a.prependListener=y,a.prependOnceListener=y,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],75:[function(e,t,r){(function(e){(function(){!function(n){var i="object"==_typeof(r)&&r&&!r.nodeType&&r,a="object"==_typeof(t)&&t&&!t.nodeType&&t,o="object"==_typeof(e)&&e;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var s,u,c=2147483647,l=36,f=1,h=26,p=38,d=700,g=72,y=128,v="-",m=/^xn--/,b=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=l-f,P=Math.floor,T=String.fromCharCode;function C(e){throw new RangeError(w[e])}function A(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function O(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+A((e=e.replace(_,".")).split("."),t).join(".")}function k(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function E(e){return A(e,(function(e){var t="";return e>65535&&(t+=T((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=T(e)})).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?P(e/d):e>>1,e+=P(e/t);e>S*h>>1;n+=l)e=P(e/S);return P(n+(S+1)*e/(e+p))}function M(e){var t,r,n,i,a,o,s,u,p,d,m,b=[],_=e.length,w=0,S=y,T=g;for((r=e.lastIndexOf(v))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&C("not-basic"),b.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<_;){for(a=w,o=1,s=l;i>=_&&C("invalid-input"),((u=(m=e.charCodeAt(i++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:l)>=l||u>P((c-w)/o))&&C("overflow"),w+=u*o,!(u<(p=s<=T?f:s>=T+h?h:s-T));s+=l)o>P(c/(d=l-p))&&C("overflow"),o*=d;T=x(w-a,t=b.length+1,0==a),P(w/t)>c-S&&C("overflow"),S+=P(w/t),w%=t,b.splice(w++,0,S)}return E(b)}function j(e){var t,r,n,i,a,o,s,u,p,d,m,b,_,w,S,A=[];for(b=(e=k(e)).length,t=y,r=0,a=g,o=0;o<b;++o)(m=e[o])<128&&A.push(T(m));for(n=i=A.length,i&&A.push(v);n<b;){for(s=c,o=0;o<b;++o)(m=e[o])>=t&&m<s&&(s=m);for(s-t>P((c-r)/(_=n+1))&&C("overflow"),r+=(s-t)*_,t=s,o=0;o<b;++o)if((m=e[o])<t&&++r>c&&C("overflow"),m==t){for(u=r,p=l;!(u<(d=p<=a?f:p>=a+h?h:p-a));p+=l)S=u-d,w=l-d,A.push(T(R(d+S%w,0))),u=P(S/w);A.push(T(R(u,0))),a=x(r,_,n==i),r=0,++n}++r,++t}return A.join("")}if(s={version:"1.4.1",ucs2:{decode:k,encode:E},decode:M,encode:j,toASCII:function(e){return O(e,(function(e){return b.test(e)?"xn--"+j(e):e}))},toUnicode:function(e){return O(e,(function(e){return m.test(e)?M(e.slice(4).toLowerCase()):e}))}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",(function(){return s}));else if(i&&a)if(t.exports==i)a.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else n.punycode=s}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],76:[function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var f,h,p,d,g=e[l].replace(s,"%20"),y=g.indexOf(r);y>=0?(f=g.substr(0,y),h=g.substr(y+1)):(f=g,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),n(o,p)?i(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],77:[function(e,t,r){var n=function(e){switch(_typeof(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"===_typeof(e)?a(o(e),(function(o){var s=encodeURIComponent(n(o))+r;return i(e[o])?a(e[o],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[o]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],78:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":76,"./encode":77}],79:[function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=e("buffer"),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:19}],80:[function(e,t,r){(function(e){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=function(t,r){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){r&&r(null,e.concat(n)),r=null})),t.once("error",(function(e){r&&r(e),r=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:19}],81:[function(e,t,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=f;var n=e("simple-concat"),i=e("decompress-response"),a=e("http"),o=e("https"),s=e("once"),u=e("querystring"),c=e("url"),l=function(e){return null!==e&&"object"===_typeof(e)&&"function"==typeof e.pipe};function f(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=s(t),e.url){var n=c.parse(e.url),h=n.hostname,p=n.port,d=n.protocol,g=n.auth,y=n.path;delete e.url,h||p||d||g?Object.assign(e,{hostname:h,port:p,protocol:d,auth:g,path:y}):e.path=y}var v,m={"accept-encoding":"gzip, deflate"};e.headers&&Object.keys(e.headers).forEach((function(t){return m[t.toLowerCase()]=e.headers[t]})),e.headers=m,e.body?v=e.json&&!l(e.body)?JSON.stringify(e.body):e.body:e.form&&(v="string"==typeof e.form?e.form:u.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),v&&(e.method||(e.method="POST"),l(v)||(e.headers["content-length"]=r.byteLength(v)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());var b=e.hostname,_=("https:"===e.protocol?o:a).request(e,(function(r){if(!1!==e.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){e.url=r.headers.location,delete e.headers.host,r.resume();var n=c.parse(e.url).hostname;return null!==n&&n!==b&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(r.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):f(e,t)}var a="function"==typeof i&&"HEAD"!==e.method;t(null,a?i(r):r)}));return _.on("timeout",(function(){_.abort(),t(new Error("Request timed out"))})),_.on("error",t),l(v)?v.on("error",t).pipe(_):_.end(v),_}f.concat=function(e,t){return f(e,(function(r,i){if(r)return t(r);n(i,(function(r,n){if(r)return t(r);if(e.json)try{n=JSON.parse(n.toString())}catch(r){return t(r,i,n)}t(null,i,n)}))}))},["get","post","put","patch","head","delete"].forEach((function(e){f[e]=function(t,r){return"string"==typeof t&&(t={url:t}),f(Object.assign({method:e.toUpperCase()},t),r)}}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:19,"decompress-response":17,http:82,https:55,once:69,querystring:78,"simple-concat":80,url:103}],82:[function(e,t,r){(function(t){(function(){var n=e("./lib/request"),i=e("./lib/response"),a=e("xtend"),o=e("builtin-status-codes"),s=e("url"),u=r;u.request=function(e,r){e="string"==typeof e?s.parse(e):a(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||i,u=e.hostname||e.host,c=e.port,l=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?o+"//"+u:"")+(c?":"+c:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on("response",r),f},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":84,"./lib/response":85,"builtin-status-codes":20,url:103,xtend:107}],83:[function(e,t,r){(function(e){(function(){var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}r.fetch=a(e.fetch)&&a(e.ReadableStream),r.writableStream=a(e.WritableStream),r.abortController=a(e.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&a(n().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],84:[function(e,t,r){(function(r,n,i){(function(){var a=e("./capability"),o=e("inherits"),s=e("./response"),u=e("readable-stream"),c=s.IncomingMessage,l=s.readyStates;var f=t.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+i.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":"text"}(t,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};o(f,u.Writable),f.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===h.indexOf(r)&&(this._headers[r]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var i=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(i["content-type"]||{}).value||""}));var s=[];if(Object.keys(i).forEach((function(e){var t=i[e].name,r=i[e].value;Array.isArray(r)?r.forEach((function(e){s.push([t,e])})):s.push([t,r])})),"fetch"===e._mode){var u=null;if(a.abortController){var c=new AbortController;u=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:s,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var f=e._xhr=new n.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}"responseType"in f&&(f.responseType=e._mode),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){f.setRequestHeader(e[0],e[1])})),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case l.LOADING:case l.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{f.send(o)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}}}},f.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},f.prototype._write=function(e,t,r){this._body.push(e),r()},f.prototype._resetTimers=function(e){var t=this;n.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},f.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},f.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var h=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":83,"./response":85,_process:74,buffer:19,inherits:57,"readable-stream":100}],85:[function(e,t,r){(function(t,n,i){(function(){var a=e("./capability"),o=e("inherits"),s=e("readable-stream"),u=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=r.IncomingMessage=function(e,r,n,o){var u=this;if(s.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===n){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)})),a.writableStream){var c=new WritableStream({write:function(e){return o(!1),new Promise((function(t,r){u._destroyed?r():u.push(i.from(e))?t():u._resumeFetch=t}))},close:function(){o(!0),u._destroyed||u.push(null)},abort:function(e){o(!0),u._destroyed||u.emit("error",e)}});try{return void r.body.pipeTo(c).catch((function(e){o(!0),u._destroyed||u.emit("error",e)}))}catch(e){}}var l=r.body.getReader();!function e(){l.read().then((function(t){u._destroyed||(o(t.done),t.done?u.push(null):(u.push(i.from(t.value)),e()))})).catch((function(e){o(!0),u._destroyed||u.emit("error",e)}))}()}else{if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}})),u._charset="x-user-defined",!a.overrideMimeType){var f=u.rawHeaders["mime-type"];if(f){var h=f.match(/;\s*charset=([^;])(;|$)/);h&&(u._charset=h[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};o(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,a=null;switch(t._mode){case"text":if((a=r.responseText).length>t._pos){var o=a.substr(t._pos);if("x-user-defined"===t._charset){for(var s=i.alloc(o.length),c=0;c<o.length;c++)s[c]=255&o.charCodeAt(c);t.push(s)}else t.push(o,t._charset);t._pos=a.length}break;case"arraybuffer":if(r.readyState!==u.DONE||!r.response)break;a=r.response,t.push(i.from(new Uint8Array(a)));break;case"moz-chunked-arraybuffer":if(a=r.response,r.readyState!==u.LOADING||!a)break;t.push(i.from(new Uint8Array(a)));break;case"ms-stream":if(a=r.response,r.readyState!==u.LOADING)break;var l=new n.MSStreamReader;l.onprogress=function(){l.result.byteLength>t._pos&&(t.push(i.from(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){e(!0),t.push(null)},l.readAsArrayBuffer(a)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":83,_process:74,buffer:19,inherits:57,"readable-stream":100}],86:[function(e,t,r){var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,o,s;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(a(t,"type"))}return s+=". Received type ".concat(_typeof(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],87:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(c,i);for(var o=n(a.prototype),s=0;s<o.length;s++){var u=o[s];c.prototype[u]||(c.prototype[u]=a.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":89,"./_stream_writable":91,_process:74,inherits:57}],88:[function(e,t,r){t.exports=i;var n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":90,inherits:57}],89:[function(e,t,r){(function(r,n){(function(){var i;t.exports=C,C.ReadableState=T;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},o=e("./internal/streams/stream"),s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=e("util");c=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,p,d=e("./internal/streams/buffer_list"),g=e("./internal/streams/destroy"),y=e("./internal/streams/state").getHighWaterMark,v=e("../errors").codes,m=v.ERR_INVALID_ARG_TYPE,b=v.ERR_STREAM_PUSH_AFTER_EOF,_=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(C,o);var S=g.errorOrDestroy,P=["error","close","destroy","pause","resume"];function T(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",n),this.buffer=new d,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function C(t){if(i=i||e("./_stream_duplex"),!(this instanceof C))return new C(t);var r=this instanceof i;this._readableState=new T(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function A(e,t,r,n,i){c("readableAddChunk",t);var a,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}(e,o);else if(i||(a=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(o,t)),a)S(e,a);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)o.endEmitted?S(e,new w):O(e,o,t,!0);else if(o.ended)S(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?O(e,o,t,!1):M(e,o)):O(e,o,t,!1)}else n||(o.reading=!1,M(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),M(e,t)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=g.destroy,C.prototype._undestroy=g.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},C.prototype.unshift=function(e){return A(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(t){f||(f=e("string_decoder/").StringDecoder);var r=new f(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var k=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(x,e))}function x(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function M(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function D(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){c("readable nexttick read 0"),e.read(0)}function I(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(F,t,e))}function F(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function H(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}C.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):R(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},C.prototype._read=function(e){S(this,new _("_read()"))},C.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:y;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",d),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",h),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",l);var f=!1;function h(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==H(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===a(e,"error")&&S(e,t)}function d(){e.removeListener("finish",g),y()}function g(){c("onfinish"),e.removeListener("close",d),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",d),e.once("finish",g),e.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},C.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(L,this))),n},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(D,this),n},C.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(D,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(I,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<P.length;a++)e.on(P[a],this.emit.bind(this,P[a]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=e("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=B,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(C,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":86,"./_stream_duplex":87,"./internal/streams/async_iterator":92,"./internal/streams/buffer_list":93,"./internal/streams/destroy":94,"./internal/streams/from":96,"./internal/streams/state":98,"./internal/streams/stream":99,_process:74,buffer:19,events:24,inherits:57,"string_decoder/":101,util:17}],90:[function(e,t,r){t.exports=l;var n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,a=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=e("./_stream_duplex");function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new a);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;return e.push(null)}e("inherits")(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":86,"./_stream_duplex":87,inherits:57}],91:[function(e,t,r){(function(r,n){(function(){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var a;t.exports=C,C.WritableState=T;var o={deprecate:e("util-deprecate")},s=e("./internal/streams/stream"),u=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,f=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,d=p.ERR_INVALID_ARG_TYPE,g=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,v=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,_=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function P(){}function T(t,n,o){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof o&&(o=n instanceof a),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if("function"!=typeof a)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(x,e,t),e._writableState.errorEmitted=!0,S(e,i)):(a(i),e._writableState.errorEmitted=!0,S(e,i),x(e,t))}(e,n,i,t,a);else{var o=E(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||k(e,n),i?r.nextTick(O,e,n,o,a):O(e,n,o,a)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function C(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!l.call(C,this))return new C(t);this._writableState=new T(t,this,r),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)),s.call(this)}function A(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),x(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)a[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;a.allBuffers=u,A(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),x(e,t)}))}function x(e,t){var n=E(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}e("inherits")(C,s),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===C&&(e&&e._writableState instanceof T)}})):l=function(e){return e instanceof this},C.prototype.pipe=function(){S(this,new v)},C.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=P),a.ending?function(e,t){var n=new _;S(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a;return null===n?a=new b:"string"==typeof n||t.objectMode||(a=new d("chunk",["string","Buffer"],n)),!a||(S(e,a),r.nextTick(i,a),!1)}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,i,a);return c}(this,a,s,e,t,n)),o},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,r){r(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,x(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=f.destroy,C.prototype._undestroy=f.undestroy,C.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":86,"./_stream_duplex":87,"./internal/streams/destroy":94,"./internal/streams/state":98,"./internal/streams/stream":99,_process:74,buffer:19,inherits:57,"util-deprecate":105}],92:[function(e,t,r){(function(r){(function(){var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[o];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[o]=null,e[s]=null,t(p(r,!1)))}}function g(e){r.nextTick(d,e)}var y=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[u]?n(e[u]):t(p(void 0,!0))}))}));var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),y);t.exports=function(e){var t,r=Object.create(v,(i(t={},h,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[o]=null,r[s]=null,e(p(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[l]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",g.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":95,_process:74}],93:[function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}var u=e("buffer").Buffer,c=e("util").inspect,l=c&&c.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),a=this.head,o=0;a;)t=a.data,r=i,n=o,u.prototype.copy.call(t,r,n),o+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0==(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:19,util:17}],94:[function(e,t,r){(function(e){(function(){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,a){var o=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(a?a(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!a&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(n,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):a?(e.nextTick(n,o),a(t)):e.nextTick(n,o)})),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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:74}],95:[function(e,t,r){var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,a){if("function"==typeof r)return e(t,null,r);r||(r={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(a||i);var o=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){s=!1,c=!0,o||a.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){o=!1,f=!0,s||a.call(t)},p=function(e){a.call(t,e)},d=function(){var e;return o&&!f?(t._readableState&&t._readableState.ended||(e=new n),a.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),a.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",l),t.on("abort",d),t.req?g():t.on("request",g)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",l),t.removeListener("abort",d),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},{"../../../errors":86}],96:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],97:[function(e,t,r){var n;var i=e("../../../errors").codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new a("streams");var h=r.map((function(t,i){var a=i<r.length-1;return function(t,r,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},(function(e){if(e)return a(e);s=!0,a()}));var u=!1;return function(e){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void a(e||new o("pipe"))}}(t,a,i>0,(function(e){l||(l=e),e&&h.forEach(u),a||(h.forEach(u),f(l))}))}));return r.reduce(c)}},{"../../../errors":86,"./end-of-stream":95}],98:[function(e,t,r){var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":86}],99:[function(e,t,r){t.exports=e("events").EventEmitter},{events:24}],100:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":87,"./lib/_stream_passthrough.js":88,"./lib/_stream_readable.js":89,"./lib/_stream_transform.js":90,"./lib/_stream_writable.js":91,"./lib/internal/streams/end-of-stream.js":95,"./lib/internal/streams/pipeline.js":97}],101:[function(e,t,r){var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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 a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":79}],102:[function(e,t,r){(function(t,n){(function(){var i=e("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":74,timers:102}],103:[function(e,t,r){var n=e("punycode"),i=e("./util");function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=b,r.resolve=function(e,t){return b(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},r.format=function(e){i.isString(e)&&(e=b(e));return e instanceof a?e.format():a.prototype.format.call(e)},r.Url=a;var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=e("querystring");function b(e,t,r){if(e&&i.isObject(e)&&e instanceof a)return e;var n=new a;return n.parse(e,t,r),n}a.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+_typeof(e));var a=e.indexOf("?"),s=-1!==a&&a<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(b);if(w){var S=(w=w[0]).toLowerCase();this.protocol=S,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var P="//"===b.substr(0,2);!P||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(P||w&&!v[w])){for(var T,C,A=-1,O=0;O<h.length;O++){-1!==(k=b.indexOf(h[O]))&&(-1===A||k<A)&&(A=k)}-1!==(C=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(T=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(T)),A=-1;for(O=0;O<f.length;O++){var k;-1!==(k=b.indexOf(f[O]))&&(-1===A||k<A)&&(A=k)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var E="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!E)for(var R=this.hostname.split(/\./),x=(O=0,R.length);O<x;O++){var M=R[O];if(M&&!M.match(p)){for(var j="",D=0,L=M.length;D<L;D++)M.charCodeAt(D)>127?j+="x":j+=M[D];if(!j.match(p)){var I=R.slice(0,O),N=R.slice(O+1),B=M.match(d);B&&(I.push(B[1]),N.unshift(B[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[S])for(O=0,x=l.length;O<x;O++){var H=l[O];if(-1!==b.indexOf(H)){var V=encodeURIComponent(H);V===H&&(V=escape(H)),b=b.split(H).join(V)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var q=b.indexOf("?");if(-1!==q?(this.search=b.substr(q),this.query=b.substr(q+1),t&&(this.query=m.parse(this.query)),b=b.slice(0,q)):t&&(this.search="",this.query={}),b&&(this.pathname=b),v[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var J=this.search||"";this.path=U+J}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",a=!1,o="";this.host?a=e+this.host:this.hostname&&(a=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=m.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==a?(a="//"+(a||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):a||(a=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+a+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},a.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(i.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var r=new a,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=e[l])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var p=f[h];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||r.host&&e.pathname,S=w,P=r.pathname&&r.pathname.split("/")||[],T=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===P[0]?P[0]=r.host:P.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===P[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,P=d;else if(d.length)P||(P=[]),P.pop(),P=P.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(T)r.hostname=r.host=P.shift(),(E=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!P.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=P.slice(-1)[0],A=(r.host||e.host||P.length>1)&&("."===C||".."===C)||""===C,O=0,k=P.length;k>=0;k--)"."===(C=P[k])?P.splice(k,1):".."===C?(P.splice(k,1),O++):O&&(P.splice(k,1),O--);if(!w&&!S)for(;O--;O)P.unshift("..");!w||""===P[0]||P[0]&&"/"===P[0].charAt(0)||P.unshift(""),A&&"/"!==P.join("/").substr(-1)&&P.push("");var E,R=""===P[0]||P[0]&&"/"===P[0].charAt(0);T&&(r.hostname=r.host=R?"":P.length?P.shift():"",(E=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift()));return(w=w||r.host&&P.length)&&!R&&P.unshift(""),P.length?r.pathname=P.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":104,punycode:75,querystring:78}],104:[function(e,t,r){t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===_typeof(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],105:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],106:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},{}],107:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],108:[function(e,t,r){var n=e("fable").ServiceProviderBase,i={Name:"DefaultPictApplication",InitializeOnLoad:!0,MainViewportView:"Default-View",MainViewportRenderable:"Application-Default-View-Renderable",MainViewportDestinationAddress:"Application-Destination-Address",MainViewportDefaultDataAddress:"",AutoRenderMainViewportView:!1,Manifests:{},IdentifierAddressPrefix:"PICT-"},a=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,a){var o;_classCallCheck2(this,r),(o=t.call(this,e,n,a)).options=o.fable.Utility.extend(i,o.options),o.serviceType="PictApplication",o.AppData=o.fable.AppData,o.initializationFunctionSet=[];var s=Object.keys(o.options.Manifests);if(s.length>0)for(var u=0;u<s.length;u++){var c=s[u];o.fable.serviceManager.instantiateServiceProvider("Manifest",o.options.Manifests[c],c)}return o.options.InitializeOnLoad?_possibleConstructorReturn(o,o.initialize()):(o.options.AutoRenderMainViewportView&&(o.log.info("Pict Application ".concat(o.options.Name,"[").concat(o.UUID,"]::[").concat(o.Hash,"] beginning auto render of [").concat(o.options.MainViewportView,"::").concat(o.options.MainViewportRenderable,"].")),o.renderAsync(o.options.MainViewportView,o.options.MainViewportRenderable,o.options.MainViewportDestinationAddress,o.options.MainViewportDefaultDataAddress,(function(){}))),o)}return _createClass2(r,[{key:"solve",value:function(){return this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] executing solve() function...")),!0}},{key:"internalInitialize",value:function(){return!0}},{key:"initialize",value:function(){this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] beginning initialization...")),this.internalInitialize(),this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] initialization complete."))}},{key:"render",value:function(e,t,r,n){var i="string"==typeof e&&this.services.PictView[e];return i?i.render(t,r,n):(this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(e," because it is not a valid view.")),!1)}},{key:"renderAsync",value:function(e,t,r,n,i){var a="string"==typeof e&&this.services.PictView[e];return a?a.renderAsync(t,r,n,i):(this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(e," because it is not a valid view.")),!1)}}]),r}(n);t.exports=a},{fable:39}],109:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),(a=t.call(this,e,n,i)).serviceType="PictContentAssignment",a.inBrowser=!1,a.hasDocument=!1,"object"==("undefined"==typeof window?"undefined":_typeof(window))&&(a.inBrowser=!0,void 0!==window.document&&"function"==typeof window.document.querySelectorAll&&(a.hasDocument=!0)),a.hasJquery=!1,a.jQuery=!1,a.inBrowser&&void 0!==window.jQuery&&(a.hasJquery=!0),a.customAssignFunction=!1,a.customAppendFunction=!1,a.customReadFunction=!1,a.customGetElementFunction=!1,a}return _createClass2(r,[{key:"getElement",value:function(e){if(this.customGetElementFunction)return this.customGetElementFunction(e);if(this.hasJquery){var t=window.jQuery(e);if(0==t.length)return!1;if(1==t.length)return t[0];for(var r=[],n=0;n<t.length;n++)r.push(t[n]);return r}return this.inBrowser&&this.hasDocument?window.document.querySelectorAll(e):(this.log.trace("PICT Content GET ELEMENT for [".concat(e,"]")),!1)}},{key:"assignContent",value:function(e,t){if(this.customAssignFunction)return this.customAssignFunction(e,t);if(this.hasJquery)window.jQuery(e).html(t);else if(this.inBrowser&&this.hasDocument)for(var r=window.document.querySelectorAll(e),n=0;n<r.length;n++)r[n].innerHTML=t;else this.log.trace("PICT Content ASSIGN to [".concat(e,"]:"),t)}},{key:"appendContent",value:function(e,t){if(this.customAppendFunction)return this.customAppendFunction(e,t);if(this.hasJquery)window.jQuery(e).append(t);else if(this.inBrowser&&this.hasDocument)for(var r=window.document.querySelectorAll(e),n=0;n<r.length;n++)r[n].insertAdjacentHTML("beforeend",t);else this.log.trace("PICT Content APPEND to [".concat(e,"]:"),t)}},{key:"readContent",value:function(e,t){var r="string"==typeof t?t:"value";if(this.customReadFunction)return this.customReadFunction(e,t);if(this.hasJquery)return window.jQuery(e).html();if(!this.inBrowser||!this.hasDocument)return this.log.trace("PICT Content READ from [".concat(e,"] type [").concat(r,"]...")),"";var n=window.document.querySelectorAll(e);return n.length<1?"":1==n.length?n[0].innerHTML:void 0}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],110:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),(a=t.call(this,e,n,i)).serviceType="PictDataProvider",a}return _createClass2(r,[{key:"getDataByAddress",value:function(e,t){var r=void 0===t?{}:t;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:r},e)}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],111:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),_defineProperty2(_assertThisInitialized(a=t.call(this,e,n,i)),"getEntitySet",(function(e,t,r){var n=this;this.initializeCache(e),this.cache[e].prune((function(){var i={url:"".concat(n.options.urlPrefix).concat(e,"s/Count/FilteredTo/").concat(t)};return i=n.prepareRequestOptions(i),n.restClient.getJSON(i,(function(a,o,s){if(a)return n.log.error("Error getting bulk entity count of [".concat(e,"] filtered to [").concat(t,"] from server [").concat(i.url,"]: ").concat(a)),r(a);var u=0;s.Count&&(u=s.Count);for(var c=[],l=n.options.downloadBatchSize,f=0;f<u/l;f++)c.push("".concat(n.options.urlPrefix).concat(e,"s/FilteredTo/").concat(t,"/").concat(f*l,"/").concat(l));var h=[];n.fable.Utility.eachLimit(c,1,(function(e,t){var r={url:"".concat(n.options.urlPrefix).concat(e)};r=n.prepareRequestOptions(r),n.restClient.getJSON(e,(function(e,r,n){return h=h.concat(n),t(e)}))}),(function(e){return r(e,h)}))}))}))})),a.serviceType="PictMeadowProvider",a.fable.settings.PictDefaultURLPrefix?a.options.urlPrefix=a.fable.settings.PictDefaultURLPrefix:a.options.urlPrefix||(a.options.urlPrefix="/1.0/"),a.fable.settings.PictDefaultDownloadBatchSize?a.options.downloadBatchSize=a.fable.settings.PictDefaultDownloadBatchSize:a.options.downloadBatchSize||(a.options.downloadBatchSize=100),a.restClient=a.fable.serviceManager.instantiateServiceProviderWithoutRegistration("RestClient"),a.cache={},a.prepareRequestOptions=function(e){return e},a}return _createClass2(r,[{key:"initializeCache",value:function(e){this.cache.hasOwnProperty(e)||(this.cache[e]=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("ObjectCache"),this.cache[e].maxAge=3e4,this.cache[e].maxLength=1e4,this.fable.Bundle[e]=this.cache[e].RecordMap)}},{key:"getEntity",value:function(e,t,r){var n=this;this.initializeCache(e),this.cache[e].prune((function(){var i=n.cache[e].read(t);if(i)return i;var a={url:"".concat(n.options.urlPrefix).concat(e,"/").concat(t)};return a=n.prepareRequestOptions(a),n.restClient.getJSON(a,(function(i,a,o){return o&&n.cache[e].put(o,t),r(i,o)}))}))}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],112:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),(a=t.call(this,e,n,i)).serviceType="PictTemplateProvider",a.templates={},a.templateSources={},a.defaultTemplates=[],a.loadTemplateFunction=function(e){return!1},a}return _createClass2(r,[{key:"addTemplate",value:function(e,t,r){this.templates[e]=t,this.templateSources[e]="string"==typeof r?r:"Direct addTemplate('".concat(e,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")}},{key:"addDefaultTemplate",value:function(e,t,r,n){var i={prefix:e,postfix:t,template:r,source:"string"==typeof n?n:"Direct addDefaultTemplate('".concat(e,"','").concat(t,"',..) function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")};"string"!=typeof r&&this.log.error("PictTemplateProvider.addDefaultTemplate: pTemplate is not a string."),this.defaultTemplates.push(i)}},{key:"checkDefaultTemplateHash",value:function(e){for(var t=0;t<this.defaultTemplates.length;t++)if(e.indexOf(this.defaultTemplates[t].postfix)==e.length-this.defaultTemplates[t].postfix.length&&0==e.indexOf(this.defaultTemplates[t].prefix))return this.templates[e]=this.defaultTemplates[t].template,this.templateSources[e]="Auto created in checkDefaultTemplateHash('".concat(e,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(this.defaultTemplates[t].prefix,"]...[").concat(this.defaultTemplates[t].postfix,"]"),this.templates[e];return!1}},{key:"getTemplate",value:function(e){return this.templates.hasOwnProperty(e)||this.loadTemplate(e),this.templates.hasOwnProperty(e)||this.checkDefaultTemplateHash(e),!!this.templates.hasOwnProperty(e)&&this.templates[e]}},{key:"loadTemplate",value:function(e){var t=this.loadTemplateFunction(e);return t&&(this.templates[e]=t.template,this.templateSources[e]="Loaded in loadTemplate('".concat(e,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(t.source,"]")),t}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],113:[function(e,t,r){var n=e("fable").ServiceProviderBase,i={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:"DEFAULT",InitializeOnLoad:!0,RenderOnLoad:!1,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}},a=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,a){var o;_classCallCheck2(this,r),(o=t.call(this,e,n,a)).options=o.fable.Utility.extend(i,o.options),o.serviceType="PictView",o.AppData=o.fable.AppData;for(var s=0;s<o.options.Templates.length;s++){var u=o.options.Templates[s];u.hasOwnProperty("Hash")&&u.hasOwnProperty("Template")?(u.Source||(u.Source="PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," options object.")),o.fable.TemplateProvider.addTemplate(u.Hash,u.Template,u.Source)):o.log.error("PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," could not load Template ").concat(s," in the options array."),u)}for(var c=0;c<o.options.DefaultTemplates.length;c++){var l=o.options.DefaultTemplates[c];l.hasOwnProperty("Postfix")&&l.hasOwnProperty("Template")?(l.Source||(l.Source="PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," options object.")),o.fable.TemplateProvider.addDefaultTemplate(l.Prefix,l.Postfix,l.Template,l.Source)):o.log.error("PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," could not load Default Template ").concat(c," in the options array."),l)}o.renderables={};for(var f=0;f<o.options.Renderables.length;f++){var h=o.options.Renderables[f];h.hasOwnProperty("RenderableHash")&&h.hasOwnProperty("TemplateHash")?o.renderables[h.RenderableHash]=h:o.log.error("PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," could not load Renderable ").concat(f," in the options array."),h)}return o.options.InitializeOnLoad&&o.initialize(),o.options.RenderOnLoad&&(o.render(o.options.DefaultRenderable,o.options.DefaultDestinationAddress,o.options.DefaultTemplateRecordAddress),o.postInitialRenderInitialize()),o}return _createClass2(r,[{key:"internalInitialize",value:function(){return!0}},{key:"postInitialRenderInitialize",value:function(){return!0}},{key:"initialize",value:function(){this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization...")),this.internalInitialize(),this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization complete."))}},{key:"render",value:function(e,t,r){var n="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;if(!n)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it is not a valid renderable.")),!1;var i=this.renderables[n];if(!i)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it does not exist.")),!1;var a="string"==typeof t?t:"string"==typeof i.ContentDestinationAddress?i.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!a)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it does not have a valid destination address.")),!1;var o="string"==typeof r?r:"string"==typeof i.RecordAddress?i.RecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,s="string"==typeof o?this.fable.DataProvider.getDataByAddress(o):void 0,u=this.fable.parseTemplateByHash(i.TemplateHash,s);return this.fable.ContentAssignment.assignContent(a,u)}},{key:"renderAsync",value:function(e,t,r,n){var i=this,a="string"==typeof e&&e;if(!a)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(a," (param ").concat(e,"because it is not a valid renderable.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(a," (param ").concat(e,"because it is not a valid renderable.")));var o=this.renderables[a];if(!o)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(a," (param ").concat(e,") because it does not exist.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(a," (param ").concat(e,") because it does not exist.")));var s="string"==typeof t?t:"string"==typeof o.ContentDestinationAddress?o.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(a," (param ").concat(e,") because it does not have a valid destination address.")),n(Error("Could not render ".concat(a)));var u="string"==typeof r?r:"string"==typeof o.RecordAddress?o.RecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,c="string"==typeof u?this.fable.DataProvider.getDataByAddress(u):void 0;this.fable.parseTemplateByHash(o.TemplateHash,c,(function(t,r){return t?(i.log.error("PictView [".concat(i.UUID,"]::[").concat(i.Hash,"] ").concat(i.options.ViewIdentifier," could not render (asynchronously) ").concat(a," (param ").concat(e,") because it did not parse the template."),t),n(t)):(i.fable.ContentAssignment.assignContent(s,r),n(null,r))}))}}]),r}(n);t.exports=a},{fable:39}],114:[function(e,t,r){var n=function(t){_inherits(n,t);var r=_createSuper(n);function n(t){var i;if(_classCallCheck2(this,n),(i=r.call(this,t)).isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}"),i.serviceManager.addAndInstantiateServiceType("TemplateProvider",e("./Pict-Template-Provider.js")),i.serviceManager.addAndInstantiateServiceType("EntityProvider",e("./Pict-Meadow-EntityProvider.js")),i.serviceManager.addAndInstantiateServiceType("DataProvider",e("./Pict-DataProvider.js")),i.serviceManager.addAndInstantiateServiceType("ContentAssignment",e("./Pict-Content-Assignment.js")),i.serviceManager.instantiateServiceProvider("MetaTemplate"),i.serviceManager.instantiateServiceProvider("DataGeneration"),i.manifest=i.serviceManager.instantiateServiceProvider("Manifest"),i.AppData={},i.Bundle={},i.LogNoisiness=0,"object"==_typeof(i.settings.Manifests)){var a=Object.keys(i.settings.Manifests);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];i.serviceManager.instantiateServiceProvider("Manifest",i.settings.Manifests[s],s)}}return i._DefaultPictTemplatesInitialized=!1,i.initializePictTemplates(),i.serviceManager.addServiceType("PictView",e("./Pict-View.js")),i.serviceManager.addServiceType("PictApplication",e("./Pict-Application.js")),i}return _createClass2(n,[{key:"addView",value:function(e,t,r){var n="object"==_typeof(e)?e:{},i="string"==typeof t?t:this.fable.getUUID();return void 0!==r?this.serviceManager.instantiateServiceProviderFromPrototype("PictView",n,i,r):this.serviceManager.instantiateServiceProvider("PictView",n,i)}},{key:"addApplication",value:function(e,t,r){var n="object"==_typeof(e)?e:{},i="string"==typeof t?t:this.fable.getUUID();return void 0!==r?this.serviceManager.instantiateServiceProviderFromPrototype("PictApplication",n,i,r):this.serviceManager.instantiateServiceProvider("PictApplication",n,i)}},{key:"initializePictTemplates",value:function(){var e=this;if(!this._DefaultPictTemplatesInitialized){var t=function(t,r,n){var i=t.trim(),a="object"===_typeof(r)?r:{},o=!1,s=!1,u=!1;if(i.indexOf("|")<0){var c=i.indexOf(":");o=i.substring(0,c),s=i.substring(c+1)}else{var l=i.indexOf(":");o=i.substring(0,l);var f=i.indexOf("|");s=i.substring(l+1,f),u=i.substring(f+1)}if(s=isNaN(s)?e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:a},s):parseInt(s),!o||!s)return e.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(i,"]")),n(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(i,"]")),"");e.EntityProvider.getEntity(o,s,(function(t,r){return t?(e.log.error("Pict: Entity Render: Error getting entity [".concat(o,"] with ID [").concat(s,"] for [").concat(i,"]: ").concat(t),t),n(t,"")):n(null,u?e.parseTemplateByHash(u,r):"")}))};this.defaultServices.MetaTemplate.addPatternAsync("{~E:","~}",t),this.defaultServices.MetaTemplate.addPatternAsync("{~Entity:","~}",t);var r=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=n.split("|");return e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},a[0])?a[1]:""};this.defaultServices.MetaTemplate.addPattern("{~NotEmpty:","~}",r),this.defaultServices.MetaTemplate.addPattern("{~NE:","~}",r);var n=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=!1,o=!1,s=n.indexOf(":");return a=n.substring(0,s),s>-1?o=n.substring(s+1):a=n,a?o?e.parseTemplateByHash(a,e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},o)):e.parseTemplateByHash(a,r):(e.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(n,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(n,"]"))};this.defaultServices.MetaTemplate.addPattern("{~T:","~}",n),this.defaultServices.MetaTemplate.addPattern("{~Template:","~}",n);var i=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=!1,o=!1,s=n.indexOf(":");return a=n.substring(0,s),s>-1?o=n.substring(s+1):a=n,a?o?e.parseTemplateSetByHash(a,e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},o)):e.parseTemplateSetByHash(a,r):(e.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(n,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(n,"]"))};this.defaultServices.MetaTemplate.addPattern("{~TS:","~}",i),this.defaultServices.MetaTemplate.addPattern("{~TemplateSet:","~}",i);var a=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return null==a||"undefined"==a||void 0===a?"":a};this.defaultServices.MetaTemplate.addPattern("{~D:","~}",a),this.defaultServices.MetaTemplate.addPattern("{~Data:","~}",a),this.defaultServices.MetaTemplate.addPattern("{~Dollars:","~}",(function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return e.defaultServices.DataFormat.formatterDollars(a)})),this.defaultServices.MetaTemplate.addPattern("{~Digits:","~}",(function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return e.defaultServices.DataFormat.formatterAddCommasToNumber(e.defaultServices.DataFormat.formatterRoundNumber(a,2))}));var o=function(t,r){var n=t.trim(),i=4,a=9999;if(n.length>0){var o=n.split(",");o.length>0&&(i=parseInt(o[0])),o.length>1&&(a=parseInt(o[1]))}return e.defaultServices.DataGeneration.randomNumericString(i,a)};this.defaultServices.MetaTemplate.addPattern("{~RandomNumberString:","~}",o),this.defaultServices.MetaTemplate.addPattern("{~RNS:","~}",o);this.defaultServices.MetaTemplate.addPattern("{~PascalCaseIdentifier:","~}",(function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return null==a||"undefined"==a||void 0===a?"":e.defaultServices.DataFormat.cleanNonAlphaCharacters(e.defaultServices.DataFormat.capitalizeEachWord(a))})),this._DefaultPictTemplatesInitialized=!0}}},{key:"parseTemplate",value:function(e,t,r){var n="object"===_typeof(t)?t:{};return this.defaultServices.MetaTemplate.parseString(e,n,r)}},{key:"parseTemplateByHash",value:function(e,t,r){var n=this.defaultServices.TemplateProvider.getTemplate(e);return n?this.parseTemplate(n,t,r):""}},{key:"parseTemplateSet",value:function(e,t,r){var n=this,i="";if("function"!=typeof r){if(Array.isArray(t)||"object"==_typeof(t)){if(Array.isArray(t))for(var a=0;a<t.length;a++)i+=this.parseTemplate(e,t[a]);else for(var o=Object.keys(t),s=0;s<o.length;s++)i+=this.parseTemplate(e,t[o[s]]);return i}return""}if(!Array.isArray(t)&&"object"!=_typeof(t))return r(Error("Pict: Template Set: pDataSet is not an array or object."),"");this.defaultServices.Utility.eachLimit(t,1,(function(t,r){return n.parseTemplate(e,t,(function(e,t){return i+=t,r()}))}),(function(e){return r(e,i)}))}},{key:"parseTemplateSetByHash",value:function(e,t,r){var n=this.defaultServices.TemplateProvider.getTemplate(e);return n?this.parseTemplateSet(n,t,r):""}}]),n}(e("fable"));t.exports=n,t.exports.PictApplicationClass=e("./Pict-Application.js"),t.exports.PictViewClass=e("./Pict-View.js"),t.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}")},{"./Pict-Application.js":108,"./Pict-Content-Assignment.js":109,"./Pict-DataProvider.js":110,"./Pict-Meadow-EntityProvider.js":111,"./Pict-Template-Provider.js":112,"./Pict-View.js":113,fable:39}]},{},[114]);
|
|
11
|
+
var n=e("./WordTree.js"),i=e("./StringParser.js"),a=function(){function e(){_classCallCheck2(this,e),this.WordTree=new n,this.StringParser=new i,this.ParseTree=this.WordTree.ParseTree}return _createClass2(e,[{key:"addPattern",value:function(e,t,r){return this.WordTree.addPattern(e,t,r)}},{key:"parseString",value:function(e,t){return this.StringParser.parseString(e,this.ParseTree,t)}}]),e}();t.exports=a},{"./StringParser.js":72,"./WordTree.js":73}],72:[function(e,t,r){var n=function(){function e(){_classCallCheck2(this,e)}return _createClass2(e,[{key:"newParserState",value:function(e){return{ParseTree:e,Asynchronous:!1,Output:"",OutputBuffer:"",Pattern:!1,PatternMatch:!1,PatternMatchOutputBuffer:""}}},{key:"assignNode",value:function(e,t){t.PatternMatch=e,t.PatternMatch.hasOwnProperty("PatternEnd")&&(t.Pattern=t.PatternMatch)}},{key:"appendOutputBuffer",value:function(e,t){t.OutputBuffer+=e}},{key:"flushOutputBuffer",value:function(e){e.Output+=e.OutputBuffer,e.OutputBuffer=""}},{key:"checkPatternEnd",value:function(e,t){e.OutputBuffer.length>=e.Pattern.PatternEnd.length+e.Pattern.PatternStart.length&&e.OutputBuffer.substr(-e.Pattern.PatternEnd.length)===e.Pattern.PatternEnd&&(e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStart.length,e.OutputBuffer.length-(e.Pattern.PatternStart.length+e.Pattern.PatternEnd.length)),t),this.flushOutputBuffer(e),e.Pattern=!1,e.PatternMatch=!1)}},{key:"parseCharacter",value:function(e,t,r){!t.PatternMatch&&t.ParseTree.hasOwnProperty(e)?(this.assignNode(t.ParseTree[e],t),this.appendOutputBuffer(e,t)):t.PatternMatch?(t.PatternMatch.hasOwnProperty(e)&&this.assignNode(t.PatternMatch[e],t),this.appendOutputBuffer(e,t),t.Pattern&&this.checkPatternEnd(t,r)):t.Output+=e}},{key:"parseString",value:function(e,t,r){for(var n=this.newParserState(t),i=0;i<e.length;i++)this.parseCharacter(e[i],n,r);return this.flushOutputBuffer(n),n.Output}}]),e}();t.exports=n},{}],73:[function(e,t,r){var n=function(){function e(){_classCallCheck2(this,e),this.ParseTree={}}return _createClass2(e,[{key:"addChild",value:function(e,t,r){return e.hasOwnProperty(t[r])||(e[t[r]]={}),e[t[r]]}},{key:"addPattern",value:function(e,t,r){if(e.length<1)return!1;if("string"==typeof t&&t.length<1)return!1;for(var n=this.ParseTree,i=0;i<e.length;i++)n=this.addChild(n,e,i);return n.PatternStart=e,n.PatternEnd="string"==typeof t&&t.length>0?t:e,n.Parse="function"==typeof r?r:"string"==typeof r?function(){return r}:function(e){return e},!0}}]),e}();t.exports=n},{}],74:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(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(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?l=c.concat(l):h=-1,l.length&&d())}function d(){if(!f){var e=u(p);f=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new g(e,t)),1!==l.length||f||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=y,a.addListener=y,a.once=y,a.off=y,a.removeListener=y,a.removeAllListeners=y,a.emit=y,a.prependListener=y,a.prependOnceListener=y,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],75:[function(e,t,r){(function(e){(function(){!function(n){var i="object"==_typeof(r)&&r&&!r.nodeType&&r,a="object"==_typeof(t)&&t&&!t.nodeType&&t,o="object"==_typeof(e)&&e;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var s,u,c=2147483647,l=36,f=1,h=26,p=38,d=700,g=72,y=128,v="-",m=/^xn--/,b=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=l-f,P=Math.floor,T=String.fromCharCode;function C(e){throw new RangeError(w[e])}function A(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function O(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+A((e=e.replace(_,".")).split("."),t).join(".")}function k(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function E(e){return A(e,(function(e){var t="";return e>65535&&(t+=T((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=T(e)})).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?P(e/d):e>>1,e+=P(e/t);e>S*h>>1;n+=l)e=P(e/S);return P(n+(S+1)*e/(e+p))}function M(e){var t,r,n,i,a,o,s,u,p,d,m,b=[],_=e.length,w=0,S=y,T=g;for((r=e.lastIndexOf(v))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&C("not-basic"),b.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<_;){for(a=w,o=1,s=l;i>=_&&C("invalid-input"),((u=(m=e.charCodeAt(i++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:l)>=l||u>P((c-w)/o))&&C("overflow"),w+=u*o,!(u<(p=s<=T?f:s>=T+h?h:s-T));s+=l)o>P(c/(d=l-p))&&C("overflow"),o*=d;T=x(w-a,t=b.length+1,0==a),P(w/t)>c-S&&C("overflow"),S+=P(w/t),w%=t,b.splice(w++,0,S)}return E(b)}function j(e){var t,r,n,i,a,o,s,u,p,d,m,b,_,w,S,A=[];for(b=(e=k(e)).length,t=y,r=0,a=g,o=0;o<b;++o)(m=e[o])<128&&A.push(T(m));for(n=i=A.length,i&&A.push(v);n<b;){for(s=c,o=0;o<b;++o)(m=e[o])>=t&&m<s&&(s=m);for(s-t>P((c-r)/(_=n+1))&&C("overflow"),r+=(s-t)*_,t=s,o=0;o<b;++o)if((m=e[o])<t&&++r>c&&C("overflow"),m==t){for(u=r,p=l;!(u<(d=p<=a?f:p>=a+h?h:p-a));p+=l)S=u-d,w=l-d,A.push(T(R(d+S%w,0))),u=P(S/w);A.push(T(R(u,0))),a=x(r,_,n==i),r=0,++n}++r,++t}return A.join("")}if(s={version:"1.4.1",ucs2:{decode:k,encode:E},decode:M,encode:j,toASCII:function(e){return O(e,(function(e){return b.test(e)?"xn--"+j(e):e}))},toUnicode:function(e){return O(e,(function(e){return m.test(e)?M(e.slice(4).toLowerCase()):e}))}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",(function(){return s}));else if(i&&a)if(t.exports==i)a.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else n.punycode=s}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],76:[function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var f,h,p,d,g=e[l].replace(s,"%20"),y=g.indexOf(r);y>=0?(f=g.substr(0,y),h=g.substr(y+1)):(f=g,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),n(o,p)?i(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],77:[function(e,t,r){var n=function(e){switch(_typeof(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"===_typeof(e)?a(o(e),(function(o){var s=encodeURIComponent(n(o))+r;return i(e[o])?a(e[o],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[o]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],78:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":76,"./encode":77}],79:[function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=e("buffer"),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:19}],80:[function(e,t,r){(function(e){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=function(t,r){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){r&&r(null,e.concat(n)),r=null})),t.once("error",(function(e){r&&r(e),r=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:19}],81:[function(e,t,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=f;var n=e("simple-concat"),i=e("decompress-response"),a=e("http"),o=e("https"),s=e("once"),u=e("querystring"),c=e("url"),l=function(e){return null!==e&&"object"===_typeof(e)&&"function"==typeof e.pipe};function f(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=s(t),e.url){var n=c.parse(e.url),h=n.hostname,p=n.port,d=n.protocol,g=n.auth,y=n.path;delete e.url,h||p||d||g?Object.assign(e,{hostname:h,port:p,protocol:d,auth:g,path:y}):e.path=y}var v,m={"accept-encoding":"gzip, deflate"};e.headers&&Object.keys(e.headers).forEach((function(t){return m[t.toLowerCase()]=e.headers[t]})),e.headers=m,e.body?v=e.json&&!l(e.body)?JSON.stringify(e.body):e.body:e.form&&(v="string"==typeof e.form?e.form:u.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),v&&(e.method||(e.method="POST"),l(v)||(e.headers["content-length"]=r.byteLength(v)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());var b=e.hostname,_=("https:"===e.protocol?o:a).request(e,(function(r){if(!1!==e.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){e.url=r.headers.location,delete e.headers.host,r.resume();var n=c.parse(e.url).hostname;return null!==n&&n!==b&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(r.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):f(e,t)}var a="function"==typeof i&&"HEAD"!==e.method;t(null,a?i(r):r)}));return _.on("timeout",(function(){_.abort(),t(new Error("Request timed out"))})),_.on("error",t),l(v)?v.on("error",t).pipe(_):_.end(v),_}f.concat=function(e,t){return f(e,(function(r,i){if(r)return t(r);n(i,(function(r,n){if(r)return t(r);if(e.json)try{n=JSON.parse(n.toString())}catch(r){return t(r,i,n)}t(null,i,n)}))}))},["get","post","put","patch","head","delete"].forEach((function(e){f[e]=function(t,r){return"string"==typeof t&&(t={url:t}),f(Object.assign({method:e.toUpperCase()},t),r)}}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:19,"decompress-response":17,http:82,https:55,once:69,querystring:78,"simple-concat":80,url:103}],82:[function(e,t,r){(function(t){(function(){var n=e("./lib/request"),i=e("./lib/response"),a=e("xtend"),o=e("builtin-status-codes"),s=e("url"),u=r;u.request=function(e,r){e="string"==typeof e?s.parse(e):a(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||i,u=e.hostname||e.host,c=e.port,l=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?o+"//"+u:"")+(c?":"+c:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on("response",r),f},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":84,"./lib/response":85,"builtin-status-codes":20,url:103,xtend:107}],83:[function(e,t,r){(function(e){(function(){var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}r.fetch=a(e.fetch)&&a(e.ReadableStream),r.writableStream=a(e.WritableStream),r.abortController=a(e.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&a(n().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],84:[function(e,t,r){(function(r,n,i){(function(){var a=e("./capability"),o=e("inherits"),s=e("./response"),u=e("readable-stream"),c=s.IncomingMessage,l=s.readyStates;var f=t.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+i.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":"text"}(t,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};o(f,u.Writable),f.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===h.indexOf(r)&&(this._headers[r]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var i=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(i["content-type"]||{}).value||""}));var s=[];if(Object.keys(i).forEach((function(e){var t=i[e].name,r=i[e].value;Array.isArray(r)?r.forEach((function(e){s.push([t,e])})):s.push([t,r])})),"fetch"===e._mode){var u=null;if(a.abortController){var c=new AbortController;u=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:s,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var f=e._xhr=new n.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}"responseType"in f&&(f.responseType=e._mode),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){f.setRequestHeader(e[0],e[1])})),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case l.LOADING:case l.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{f.send(o)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}}}},f.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},f.prototype._write=function(e,t,r){this._body.push(e),r()},f.prototype._resetTimers=function(e){var t=this;n.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},f.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},f.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var h=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":83,"./response":85,_process:74,buffer:19,inherits:57,"readable-stream":100}],85:[function(e,t,r){(function(t,n,i){(function(){var a=e("./capability"),o=e("inherits"),s=e("readable-stream"),u=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=r.IncomingMessage=function(e,r,n,o){var u=this;if(s.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===n){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)})),a.writableStream){var c=new WritableStream({write:function(e){return o(!1),new Promise((function(t,r){u._destroyed?r():u.push(i.from(e))?t():u._resumeFetch=t}))},close:function(){o(!0),u._destroyed||u.push(null)},abort:function(e){o(!0),u._destroyed||u.emit("error",e)}});try{return void r.body.pipeTo(c).catch((function(e){o(!0),u._destroyed||u.emit("error",e)}))}catch(e){}}var l=r.body.getReader();!function e(){l.read().then((function(t){u._destroyed||(o(t.done),t.done?u.push(null):(u.push(i.from(t.value)),e()))})).catch((function(e){o(!0),u._destroyed||u.emit("error",e)}))}()}else{if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}})),u._charset="x-user-defined",!a.overrideMimeType){var f=u.rawHeaders["mime-type"];if(f){var h=f.match(/;\s*charset=([^;])(;|$)/);h&&(u._charset=h[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};o(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,a=null;switch(t._mode){case"text":if((a=r.responseText).length>t._pos){var o=a.substr(t._pos);if("x-user-defined"===t._charset){for(var s=i.alloc(o.length),c=0;c<o.length;c++)s[c]=255&o.charCodeAt(c);t.push(s)}else t.push(o,t._charset);t._pos=a.length}break;case"arraybuffer":if(r.readyState!==u.DONE||!r.response)break;a=r.response,t.push(i.from(new Uint8Array(a)));break;case"moz-chunked-arraybuffer":if(a=r.response,r.readyState!==u.LOADING||!a)break;t.push(i.from(new Uint8Array(a)));break;case"ms-stream":if(a=r.response,r.readyState!==u.LOADING)break;var l=new n.MSStreamReader;l.onprogress=function(){l.result.byteLength>t._pos&&(t.push(i.from(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){e(!0),t.push(null)},l.readAsArrayBuffer(a)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":83,_process:74,buffer:19,inherits:57,"readable-stream":100}],86:[function(e,t,r){var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,o,s;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(a(t,"type"))}return s+=". Received type ".concat(_typeof(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],87:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(c,i);for(var o=n(a.prototype),s=0;s<o.length;s++){var u=o[s];c.prototype[u]||(c.prototype[u]=a.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":89,"./_stream_writable":91,_process:74,inherits:57}],88:[function(e,t,r){t.exports=i;var n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":90,inherits:57}],89:[function(e,t,r){(function(r,n){(function(){var i;t.exports=C,C.ReadableState=T;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},o=e("./internal/streams/stream"),s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=e("util");c=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,p,d=e("./internal/streams/buffer_list"),g=e("./internal/streams/destroy"),y=e("./internal/streams/state").getHighWaterMark,v=e("../errors").codes,m=v.ERR_INVALID_ARG_TYPE,b=v.ERR_STREAM_PUSH_AFTER_EOF,_=v.ERR_METHOD_NOT_IMPLEMENTED,w=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(C,o);var S=g.errorOrDestroy,P=["error","close","destroy","pause","resume"];function T(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",n),this.buffer=new d,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function C(t){if(i=i||e("./_stream_duplex"),!(this instanceof C))return new C(t);var r=this instanceof i;this._readableState=new T(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function A(e,t,r,n,i){c("readableAddChunk",t);var a,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}(e,o);else if(i||(a=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(o,t)),a)S(e,a);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)o.endEmitted?S(e,new w):O(e,o,t,!0);else if(o.ended)S(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?O(e,o,t,!1):M(e,o)):O(e,o,t,!1)}else n||(o.reading=!1,M(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),M(e,t)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=g.destroy,C.prototype._undestroy=g.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},C.prototype.unshift=function(e){return A(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(t){f||(f=e("string_decoder/").StringDecoder);var r=new f(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var k=1073741824;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(x,e))}function x(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function M(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function D(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){c("readable nexttick read 0"),e.read(0)}function I(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(F,t,e))}function F(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function H(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}C.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):R(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},C.prototype._read=function(e){S(this,new _("_read()"))},C.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:y;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",d),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",h),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",l);var f=!1;function h(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==H(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===a(e,"error")&&S(e,t)}function d(){e.removeListener("finish",g),y()}function g(){c("onfinish"),e.removeListener("close",d),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",d),e.once("finish",g),e.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},C.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(L,this))),n},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(D,this),n},C.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(D,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(I,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<P.length;a++)e.on(P[a],this.emit.bind(this,P[a]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=e("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=B,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(C,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":86,"./_stream_duplex":87,"./internal/streams/async_iterator":92,"./internal/streams/buffer_list":93,"./internal/streams/destroy":94,"./internal/streams/from":96,"./internal/streams/state":98,"./internal/streams/stream":99,_process:74,buffer:19,events:24,inherits:57,"string_decoder/":101,util:17}],90:[function(e,t,r){t.exports=l;var n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,a=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=e("./_stream_duplex");function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new a);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;return e.push(null)}e("inherits")(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":86,"./_stream_duplex":87,inherits:57}],91:[function(e,t,r){(function(r,n){(function(){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var a;t.exports=C,C.WritableState=T;var o={deprecate:e("util-deprecate")},s=e("./internal/streams/stream"),u=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,f=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,d=p.ERR_INVALID_ARG_TYPE,g=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,v=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,_=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function P(){}function T(t,n,o){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof o&&(o=n instanceof a),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if("function"!=typeof a)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(x,e,t),e._writableState.errorEmitted=!0,S(e,i)):(a(i),e._writableState.errorEmitted=!0,S(e,i),x(e,t))}(e,n,i,t,a);else{var o=E(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||k(e,n),i?r.nextTick(O,e,n,o,a):O(e,n,o,a)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function C(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!l.call(C,this))return new C(t);this._writableState=new T(t,this,r),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)),s.call(this)}function A(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),x(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)a[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;a.allBuffers=u,A(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),x(e,t)}))}function x(e,t){var n=E(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}e("inherits")(C,s),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===C&&(e&&e._writableState instanceof T)}})):l=function(e){return e instanceof this},C.prototype.pipe=function(){S(this,new v)},C.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=P),a.ending?function(e,t){var n=new _;S(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a;return null===n?a=new b:"string"==typeof n||t.objectMode||(a=new d("chunk",["string","Buffer"],n)),!a||(S(e,a),r.nextTick(i,a),!1)}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,i,a);return c}(this,a,s,e,t,n)),o},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,r){r(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,x(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=f.destroy,C.prototype._undestroy=f.undestroy,C.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":86,"./_stream_duplex":87,"./internal/streams/destroy":94,"./internal/streams/state":98,"./internal/streams/stream":99,_process:74,buffer:19,inherits:57,"util-deprecate":105}],92:[function(e,t,r){(function(r){(function(){var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[o];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[o]=null,e[s]=null,t(p(r,!1)))}}function g(e){r.nextTick(d,e)}var y=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[u]?n(e[u]):t(p(void 0,!0))}))}));var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),y);t.exports=function(e){var t,r=Object.create(v,(i(t={},h,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[o]=null,r[s]=null,e(p(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[l]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",g.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":95,_process:74}],93:[function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_typeof(t)?t:String(t)}var u=e("buffer").Buffer,c=e("util").inspect,l=c&&c.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),a=this.head,o=0;a;)t=a.data,r=i,n=o,u.prototype.copy.call(t,r,n),o+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0==(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:19,util:17}],94:[function(e,t,r){(function(e){(function(){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,a){var o=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(a?a(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!a&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(n,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):a?(e.nextTick(n,o),a(t)):e.nextTick(n,o)})),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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:74}],95:[function(e,t,r){var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,a){if("function"==typeof r)return e(t,null,r);r||(r={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(a||i);var o=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){s=!1,c=!0,o||a.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){o=!1,f=!0,s||a.call(t)},p=function(e){a.call(t,e)},d=function(){var e;return o&&!f?(t._readableState&&t._readableState.ended||(e=new n),a.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),a.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",l),t.on("abort",d),t.req?g():t.on("request",g)),t.on("end",h),t.on("finish",l),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",l),t.removeListener("abort",d),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",d)}}},{"../../../errors":86}],96:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],97:[function(e,t,r){var n;var i=e("../../../errors").codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new a("streams");var h=r.map((function(t,i){var a=i<r.length-1;return function(t,r,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},(function(e){if(e)return a(e);s=!0,a()}));var u=!1;return function(e){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void a(e||new o("pipe"))}}(t,a,i>0,(function(e){l||(l=e),e&&h.forEach(u),a||(h.forEach(u),f(l))}))}));return r.reduce(c)}},{"../../../errors":86,"./end-of-stream":95}],98:[function(e,t,r){var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":86}],99:[function(e,t,r){t.exports=e("events").EventEmitter},{events:24}],100:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":87,"./lib/_stream_passthrough.js":88,"./lib/_stream_readable.js":89,"./lib/_stream_transform.js":90,"./lib/_stream_writable.js":91,"./lib/internal/streams/end-of-stream.js":95,"./lib/internal/streams/pipeline.js":97}],101:[function(e,t,r){var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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 a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":79}],102:[function(e,t,r){(function(t,n){(function(){var i=e("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":74,timers:102}],103:[function(e,t,r){var n=e("punycode"),i=e("./util");function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=b,r.resolve=function(e,t){return b(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},r.format=function(e){i.isString(e)&&(e=b(e));return e instanceof a?e.format():a.prototype.format.call(e)},r.Url=a;var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=e("querystring");function b(e,t,r){if(e&&i.isObject(e)&&e instanceof a)return e;var n=new a;return n.parse(e,t,r),n}a.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+_typeof(e));var a=e.indexOf("?"),s=-1!==a&&a<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(b);if(w){var S=(w=w[0]).toLowerCase();this.protocol=S,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var P="//"===b.substr(0,2);!P||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(P||w&&!v[w])){for(var T,C,A=-1,O=0;O<h.length;O++){-1!==(k=b.indexOf(h[O]))&&(-1===A||k<A)&&(A=k)}-1!==(C=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(T=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(T)),A=-1;for(O=0;O<f.length;O++){var k;-1!==(k=b.indexOf(f[O]))&&(-1===A||k<A)&&(A=k)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var E="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!E)for(var R=this.hostname.split(/\./),x=(O=0,R.length);O<x;O++){var M=R[O];if(M&&!M.match(p)){for(var j="",D=0,L=M.length;D<L;D++)M.charCodeAt(D)>127?j+="x":j+=M[D];if(!j.match(p)){var I=R.slice(0,O),N=R.slice(O+1),B=M.match(d);B&&(I.push(B[1]),N.unshift(B[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[S])for(O=0,x=l.length;O<x;O++){var H=l[O];if(-1!==b.indexOf(H)){var V=encodeURIComponent(H);V===H&&(V=escape(H)),b=b.split(H).join(V)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var q=b.indexOf("?");if(-1!==q?(this.search=b.substr(q),this.query=b.substr(q+1),t&&(this.query=m.parse(this.query)),b=b.slice(0,q)):t&&(this.search="",this.query={}),b&&(this.pathname=b),v[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var J=this.search||"";this.path=U+J}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",a=!1,o="";this.host?a=e+this.host:this.hostname&&(a=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=m.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==a?(a="//"+(a||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):a||(a=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+a+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},a.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(i.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var r=new a,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=e[l])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var p=f[h];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||r.host&&e.pathname,S=w,P=r.pathname&&r.pathname.split("/")||[],T=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===P[0]?P[0]=r.host:P.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===P[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,P=d;else if(d.length)P||(P=[]),P.pop(),P=P.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(T)r.hostname=r.host=P.shift(),(E=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!P.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=P.slice(-1)[0],A=(r.host||e.host||P.length>1)&&("."===C||".."===C)||""===C,O=0,k=P.length;k>=0;k--)"."===(C=P[k])?P.splice(k,1):".."===C?(P.splice(k,1),O++):O&&(P.splice(k,1),O--);if(!w&&!S)for(;O--;O)P.unshift("..");!w||""===P[0]||P[0]&&"/"===P[0].charAt(0)||P.unshift(""),A&&"/"!==P.join("/").substr(-1)&&P.push("");var E,R=""===P[0]||P[0]&&"/"===P[0].charAt(0);T&&(r.hostname=r.host=R?"":P.length?P.shift():"",(E=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift()));return(w=w||r.host&&P.length)&&!R&&P.unshift(""),P.length?r.pathname=P.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":104,punycode:75,querystring:78}],104:[function(e,t,r){t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===_typeof(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],105:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],106:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},{}],107:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],108:[function(e,t,r){var n=e("fable").ServiceProviderBase,i={Name:"DefaultPictApplication",InitializeOnLoad:!0,MainViewportView:"Default-View",MainViewportRenderable:"Application-Default-View-Renderable",MainViewportDestinationAddress:"Application-Destination-Address",MainViewportDefaultDataAddress:"",AutoRenderMainViewportView:!1,Manifests:{},IdentifierAddressPrefix:"PICT-"},a=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,a){var o;_classCallCheck2(this,r),(o=t.call(this,e,n,a)).options=o.fable.Utility.extend(JSON.parse(JSON.stringify(i)),o.options),o.serviceType="PictApplication",o.AppData=o.fable.AppData,o.initializationFunctionSet=[];var s=Object.keys(o.options.Manifests);if(s.length>0)for(var u=0;u<s.length;u++){var c=s[u];o.fable.serviceManager.instantiateServiceProvider("Manifest",o.options.Manifests[c],c)}return o.options.InitializeOnLoad?_possibleConstructorReturn(o,o.initialize()):(o.options.AutoRenderMainViewportView&&(o.log.info("Pict Application ".concat(o.options.Name,"[").concat(o.UUID,"]::[").concat(o.Hash,"] beginning auto render of [").concat(o.options.MainViewportView,"::").concat(o.options.MainViewportRenderable,"].")),o.renderAsync(o.options.MainViewportView,o.options.MainViewportRenderable,o.options.MainViewportDestinationAddress,o.options.MainViewportDefaultDataAddress,(function(){}))),o)}return _createClass2(r,[{key:"solve",value:function(){return this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] executing solve() function...")),!0}},{key:"internalInitialize",value:function(){return!0}},{key:"initialize",value:function(){this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] beginning initialization...")),this.internalInitialize(),this.log.info("Pict Application ".concat(this.options.Name,"[").concat(this.UUID,"]::[").concat(this.Hash,"] initialization complete."))}},{key:"render",value:function(e,t,r,n){var i="string"==typeof e&&this.services.PictView[e];return i?i.render(t,r,n):(this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(e," because it is not a valid view.")),!1)}},{key:"renderAsync",value:function(e,t,r,n,i){var a="string"==typeof e&&this.services.PictView[e];return a?a.renderAsync(t,r,n,i):(this.log.error("PictApplication [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(e," because it is not a valid view.")),!1)}}]),r}(n);t.exports=a},{fable:39}],109:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),(a=t.call(this,e,n,i)).serviceType="PictContentAssignment",a.inBrowser=!1,a.hasDocument=!1,"object"==("undefined"==typeof window?"undefined":_typeof(window))&&(a.inBrowser=!0,void 0!==window.document&&"function"==typeof window.document.querySelectorAll&&(a.hasDocument=!0)),a.hasJquery=!1,a.jQuery=!1,a.inBrowser&&void 0!==window.jQuery&&(a.hasJquery=!0),a.customAssignFunction=!1,a.customAppendFunction=!1,a.customReadFunction=!1,a.customGetElementFunction=!1,a}return _createClass2(r,[{key:"getElement",value:function(e){if(this.customGetElementFunction)return this.customGetElementFunction(e);if(this.hasJquery){var t=window.jQuery(e);if(0==t.length)return!1;if(1==t.length)return t[0];for(var r=[],n=0;n<t.length;n++)r.push(t[n]);return r}return this.inBrowser&&this.hasDocument?window.document.querySelectorAll(e):(this.log.trace("PICT Content GET ELEMENT for [".concat(e,"]")),!1)}},{key:"assignContent",value:function(e,t){if(this.customAssignFunction)return this.customAssignFunction(e,t);if(this.hasJquery)window.jQuery(e).html(t);else if(this.inBrowser&&this.hasDocument)for(var r=window.document.querySelectorAll(e),n=0;n<r.length;n++)r[n].innerHTML=t;else this.log.trace("PICT Content ASSIGN to [".concat(e,"]:"),t)}},{key:"appendContent",value:function(e,t){if(this.customAppendFunction)return this.customAppendFunction(e,t);if(this.hasJquery)window.jQuery(e).append(t);else if(this.inBrowser&&this.hasDocument)for(var r=window.document.querySelectorAll(e),n=0;n<r.length;n++)r[n].insertAdjacentHTML("beforeend",t);else this.log.trace("PICT Content APPEND to [".concat(e,"]:"),t)}},{key:"readContent",value:function(e,t){var r="string"==typeof t?t:"value";if(this.customReadFunction)return this.customReadFunction(e,t);if(this.hasJquery)return window.jQuery(e).html();if(!this.inBrowser||!this.hasDocument)return this.log.trace("PICT Content READ from [".concat(e,"] type [").concat(r,"]...")),"";var n=window.document.querySelectorAll(e);return n.length<1?"":1==n.length?n[0].innerHTML:void 0}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],110:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),(a=t.call(this,e,n,i)).serviceType="PictDataProvider",a}return _createClass2(r,[{key:"getDataByAddress",value:function(e,t){var r=void 0===t?{}:t;return this.fable.manifest.getValueByHash({AppData:this.AppData,Bundle:this.Bundle,Record:r},e)}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],111:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),_defineProperty2(_assertThisInitialized(a=t.call(this,e,n,i)),"getEntitySet",(function(e,t,r){var n=this;this.initializeCache(e),this.cache[e].prune((function(){var i={url:"".concat(n.options.urlPrefix).concat(e,"s/Count/FilteredTo/").concat(t)};return i=n.prepareRequestOptions(i),n.restClient.getJSON(i,(function(a,o,s){if(a)return n.log.error("Error getting bulk entity count of [".concat(e,"] filtered to [").concat(t,"] from server [").concat(i.url,"]: ").concat(a)),r(a);var u=0;s.Count&&(u=s.Count);for(var c=[],l=n.options.downloadBatchSize,f=0;f<u/l;f++)c.push("".concat(n.options.urlPrefix).concat(e,"s/FilteredTo/").concat(t,"/").concat(f*l,"/").concat(l));var h=[];n.fable.Utility.eachLimit(c,1,(function(e,t){var r={url:"".concat(n.options.urlPrefix).concat(e)};r=n.prepareRequestOptions(r),n.restClient.getJSON(e,(function(e,r,n){return h=h.concat(n),t(e)}))}),(function(e){return r(e,h)}))}))}))})),a.serviceType="PictMeadowProvider",a.fable.settings.PictDefaultURLPrefix?a.options.urlPrefix=a.fable.settings.PictDefaultURLPrefix:a.options.urlPrefix||(a.options.urlPrefix="/1.0/"),a.fable.settings.PictDefaultDownloadBatchSize?a.options.downloadBatchSize=a.fable.settings.PictDefaultDownloadBatchSize:a.options.downloadBatchSize||(a.options.downloadBatchSize=100),a.restClient=a.fable.serviceManager.instantiateServiceProviderWithoutRegistration("RestClient"),a.cache={},a.prepareRequestOptions=function(e){return e},a}return _createClass2(r,[{key:"initializeCache",value:function(e){this.cache.hasOwnProperty(e)||(this.cache[e]=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("ObjectCache"),this.cache[e].maxAge=3e4,this.cache[e].maxLength=1e4,this.fable.Bundle[e]=this.cache[e].RecordMap)}},{key:"getEntity",value:function(e,t,r){var n=this;this.initializeCache(e),this.cache[e].prune((function(){var i=n.cache[e].read(t);if(i)return i;var a={url:"".concat(n.options.urlPrefix).concat(e,"/").concat(t)};return a=n.prepareRequestOptions(a),n.restClient.getJSON(a,(function(i,a,o){return o&&n.cache[e].put(o,t),r(i,o)}))}))}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],112:[function(e,t,r){var n=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,i){var a;return _classCallCheck2(this,r),(a=t.call(this,e,n,i)).serviceType="PictTemplateProvider",a.templates={},a.templateSources={},a.defaultTemplates=[],a.loadTemplateFunction=function(e){return!1},a}return _createClass2(r,[{key:"addTemplate",value:function(e,t,r){this.templates[e]=t,this.templateSources[e]="string"==typeof r?r:"Direct addTemplate('".concat(e,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")}},{key:"addDefaultTemplate",value:function(e,t,r,n){var i={prefix:e,postfix:t,template:r,source:"string"==typeof n?n:"Direct addDefaultTemplate('".concat(e,"','").concat(t,"',..) function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]")};"string"!=typeof r&&this.log.error("PictTemplateProvider.addDefaultTemplate: pTemplate is not a string."),this.defaultTemplates.push(i)}},{key:"checkDefaultTemplateHash",value:function(e){for(var t=0;t<this.defaultTemplates.length;t++)if(e.indexOf(this.defaultTemplates[t].postfix)==e.length-this.defaultTemplates[t].postfix.length&&0==e.indexOf(this.defaultTemplates[t].prefix))return this.templates[e]=this.defaultTemplates[t].template,this.templateSources[e]="Auto created in checkDefaultTemplateHash('".concat(e,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(this.defaultTemplates[t].prefix,"]...[").concat(this.defaultTemplates[t].postfix,"]"),this.templates[e];return!1}},{key:"getTemplate",value:function(e){return this.templates.hasOwnProperty(e)||this.loadTemplate(e),this.templates.hasOwnProperty(e)||this.checkDefaultTemplateHash(e),!!this.templates.hasOwnProperty(e)&&this.templates[e]}},{key:"loadTemplate",value:function(e){var t=this.loadTemplateFunction(e);return t&&(this.templates[e]=t.template,this.templateSources[e]="Loaded in loadTemplate('".concat(e,"') function by PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"] from [").concat(t.source,"]")),t}}]),r}(e("fable").ServiceProviderBase);t.exports=n},{fable:39}],113:[function(e,t,r){var n=e("fable").ServiceProviderBase,i={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:"DEFAULT",InitializeOnLoad:!0,RenderOnLoad:!1,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}},a=function(e){_inherits(r,e);var t=_createSuper(r);function r(e,n,a){var o;_classCallCheck2(this,r),(o=t.call(this,e,n,a)).options=o.fable.Utility.extend(JSON.parse(JSON.stringify(i)),o.options),o.serviceType="PictView",o.AppData=o.fable.AppData;for(var s=0;s<o.options.Templates.length;s++){var u=o.options.Templates[s];u.hasOwnProperty("Hash")&&u.hasOwnProperty("Template")?(u.Source||(u.Source="PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," options object.")),o.fable.TemplateProvider.addTemplate(u.Hash,u.Template,u.Source)):o.log.error("PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," could not load Template ").concat(s," in the options array."),u)}for(var c=0;c<o.options.DefaultTemplates.length;c++){var l=o.options.DefaultTemplates[c];l.hasOwnProperty("Postfix")&&l.hasOwnProperty("Template")?(l.Source||(l.Source="PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," options object.")),o.fable.TemplateProvider.addDefaultTemplate(l.Prefix,l.Postfix,l.Template,l.Source)):o.log.error("PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," could not load Default Template ").concat(c," in the options array."),l)}o.renderables={};for(var f=0;f<o.options.Renderables.length;f++){var h=o.options.Renderables[f];h.hasOwnProperty("RenderableHash")&&h.hasOwnProperty("TemplateHash")?o.renderables[h.RenderableHash]=h:o.log.error("PictView [".concat(o.UUID,"]::[").concat(o.Hash,"] ").concat(o.options.ViewIdentifier," could not load Renderable ").concat(f," in the options array."),h)}return o.options.InitializeOnLoad&&o.initialize(),o.options.RenderOnLoad&&(o.render(o.options.DefaultRenderable,o.options.DefaultDestinationAddress,o.options.DefaultTemplateRecordAddress),o.postInitialRenderInitialize()),o}return _createClass2(r,[{key:"internalInitialize",value:function(){return!0}},{key:"postInitialRenderInitialize",value:function(){return!0}},{key:"initialize",value:function(){this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization...")),this.internalInitialize(),this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization complete."))}},{key:"render",value:function(e,t,r){var n="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;if(!n)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it is not a valid renderable.")),!1;var i=this.renderables[n];if(!i)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it does not exist.")),!1;var a="string"==typeof t?t:"string"==typeof i.ContentDestinationAddress?i.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!a)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n," (param ").concat(e,") because it does not have a valid destination address.")),!1;var o="string"==typeof r?r:"string"==typeof i.RecordAddress?i.RecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,s="string"==typeof o?this.fable.DataProvider.getDataByAddress(o):void 0,u=this.fable.parseTemplateByHash(i.TemplateHash,s);return this.fable.ContentAssignment.assignContent(a,u)}},{key:"renderAsync",value:function(e,t,r,n){var i=this,a="string"==typeof e&&e;if(!a)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(a," (param ").concat(e,"because it is not a valid renderable.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(a," (param ").concat(e,"because it is not a valid renderable.")));var o=this.renderables[a];if(!o)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(a," (param ").concat(e,") because it does not exist.")),n(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(a," (param ").concat(e,") because it does not exist.")));var s="string"==typeof t?t:"string"==typeof o.ContentDestinationAddress?o.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress;if(!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(a," (param ").concat(e,") because it does not have a valid destination address.")),n(Error("Could not render ".concat(a)));var u="string"==typeof r?r:"string"==typeof o.RecordAddress?o.RecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,c="string"==typeof u?this.fable.DataProvider.getDataByAddress(u):void 0;this.fable.parseTemplateByHash(o.TemplateHash,c,(function(t,r){return t?(i.log.error("PictView [".concat(i.UUID,"]::[").concat(i.Hash,"] ").concat(i.options.ViewIdentifier," could not render (asynchronously) ").concat(a," (param ").concat(e,") because it did not parse the template."),t),n(t)):(i.fable.ContentAssignment.assignContent(s,r),n(null,r))}))}}]),r}(n);t.exports=a},{fable:39}],114:[function(e,t,r){var n=function(t){_inherits(n,t);var r=_createSuper(n);function n(t){var i;if(_classCallCheck2(this,n),(i=r.call(this,t)).isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}"),i.serviceManager.addAndInstantiateServiceType("TemplateProvider",e("./Pict-Template-Provider.js")),i.serviceManager.addAndInstantiateServiceType("EntityProvider",e("./Pict-Meadow-EntityProvider.js")),i.serviceManager.addAndInstantiateServiceType("DataProvider",e("./Pict-DataProvider.js")),i.serviceManager.addAndInstantiateServiceType("ContentAssignment",e("./Pict-Content-Assignment.js")),i.serviceManager.instantiateServiceProvider("MetaTemplate"),i.serviceManager.instantiateServiceProvider("DataGeneration"),i.manifest=i.serviceManager.instantiateServiceProvider("Manifest"),i.AppData={},i.Bundle={},i.LogNoisiness=0,"object"==_typeof(i.settings.Manifests)){var a=Object.keys(i.settings.Manifests);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];i.serviceManager.instantiateServiceProvider("Manifest",i.settings.Manifests[s],s)}}return i._DefaultPictTemplatesInitialized=!1,i.initializePictTemplates(),i.serviceManager.addServiceType("PictView",e("./Pict-View.js")),i.serviceManager.addServiceType("PictApplication",e("./Pict-Application.js")),i}return _createClass2(n,[{key:"addView",value:function(e,t,r){var n="object"==_typeof(e)?e:{},i="string"==typeof t?t:this.fable.getUUID();return void 0!==r?this.serviceManager.instantiateServiceProviderFromPrototype("PictView",n,i,r):this.serviceManager.instantiateServiceProvider("PictView",n,i)}},{key:"addApplication",value:function(e,t,r){var n="object"==_typeof(e)?e:{},i="string"==typeof t?t:this.fable.getUUID();return void 0!==r?this.serviceManager.instantiateServiceProviderFromPrototype("PictApplication",n,i,r):this.serviceManager.instantiateServiceProvider("PictApplication",n,i)}},{key:"initializePictTemplates",value:function(){var e=this;if(!this._DefaultPictTemplatesInitialized){var t=function(t,r,n){var i=t.trim(),a="object"===_typeof(r)?r:{},o=!1,s=!1,u=!1;if(i.indexOf("|")<0){var c=i.indexOf(":");o=i.substring(0,c),s=i.substring(c+1)}else{var l=i.indexOf(":");o=i.substring(0,l);var f=i.indexOf("|");s=i.substring(l+1,f),u=i.substring(f+1)}if(s=isNaN(s)?e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:a},s):parseInt(s),!o||!s)return e.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(i,"]")),n(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(i,"]")),"");e.EntityProvider.getEntity(o,s,(function(t,r){return t?(e.log.error("Pict: Entity Render: Error getting entity [".concat(o,"] with ID [").concat(s,"] for [").concat(i,"]: ").concat(t),t),n(t,"")):n(null,u?e.parseTemplateByHash(u,r):"")}))};this.defaultServices.MetaTemplate.addPatternAsync("{~E:","~}",t),this.defaultServices.MetaTemplate.addPatternAsync("{~Entity:","~}",t);var r=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=n.split("|");return e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},a[0])?a[1]:""};this.defaultServices.MetaTemplate.addPattern("{~NotEmpty:","~}",r),this.defaultServices.MetaTemplate.addPattern("{~NE:","~}",r);var n=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=!1,o=!1,s=n.indexOf(":");return a=n.substring(0,s),s>-1?o=n.substring(s+1):a=n,a?o?e.parseTemplateByHash(a,e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},o)):e.parseTemplateByHash(a,r):(e.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(n,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(n,"]"))};this.defaultServices.MetaTemplate.addPattern("{~T:","~}",n),this.defaultServices.MetaTemplate.addPattern("{~Template:","~}",n);var i=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=!1,o=!1,s=n.indexOf(":");return a=n.substring(0,s),s>-1?o=n.substring(s+1):a=n,a?o?e.parseTemplateSetByHash(a,e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},o)):e.parseTemplateSetByHash(a,r):(e.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(n,"]")),"Pict: Template Render: TemplateHash not resolved for [".concat(n,"]"))};this.defaultServices.MetaTemplate.addPattern("{~TS:","~}",i),this.defaultServices.MetaTemplate.addPattern("{~TemplateSet:","~}",i);var a=function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return null==a||"undefined"==a||void 0===a?"":a};this.defaultServices.MetaTemplate.addPattern("{~D:","~}",a),this.defaultServices.MetaTemplate.addPattern("{~Data:","~}",a),this.defaultServices.MetaTemplate.addPattern("{~Dollars:","~}",(function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return e.defaultServices.DataFormat.formatterDollars(a)})),this.defaultServices.MetaTemplate.addPattern("{~Digits:","~}",(function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return e.defaultServices.DataFormat.formatterAddCommasToNumber(e.defaultServices.DataFormat.formatterRoundNumber(a,2))}));var o=function(t,r){var n=t.trim(),i=4,a=9999;if(n.length>0){var o=n.split(",");o.length>0&&(i=parseInt(o[0])),o.length>1&&(a=parseInt(o[1]))}return e.defaultServices.DataGeneration.randomNumericString(i,a)};this.defaultServices.MetaTemplate.addPattern("{~RandomNumberString:","~}",o),this.defaultServices.MetaTemplate.addPattern("{~RNS:","~}",o);this.defaultServices.MetaTemplate.addPattern("{~PascalCaseIdentifier:","~}",(function(t,r){var n=t.trim(),i="object"===_typeof(r)?r:{},a=e.manifest.getValueByHash({AppData:e.AppData,Bundle:e.Bundle,Record:i},n);return null==a||"undefined"==a||void 0===a?"":e.defaultServices.DataFormat.cleanNonAlphaCharacters(e.defaultServices.DataFormat.capitalizeEachWord(a))})),this._DefaultPictTemplatesInitialized=!0}}},{key:"parseTemplate",value:function(e,t,r){var n="object"===_typeof(t)?t:{};return this.defaultServices.MetaTemplate.parseString(e,n,r)}},{key:"parseTemplateByHash",value:function(e,t,r){var n=this.defaultServices.TemplateProvider.getTemplate(e);return n?this.parseTemplate(n,t,r):""}},{key:"parseTemplateSet",value:function(e,t,r){var n=this,i="";if("function"!=typeof r){if(Array.isArray(t)||"object"==_typeof(t)){if(Array.isArray(t))for(var a=0;a<t.length;a++)i+=this.parseTemplate(e,t[a]);else for(var o=Object.keys(t),s=0;s<o.length;s++)i+=this.parseTemplate(e,t[o[s]]);return i}return""}if(!Array.isArray(t)&&"object"!=_typeof(t))return r(Error("Pict: Template Set: pDataSet is not an array or object."),"");this.defaultServices.Utility.eachLimit(t,1,(function(t,r){return n.parseTemplate(e,t,(function(e,t){return i+=t,r()}))}),(function(e){return r(e,i)}))}},{key:"parseTemplateSetByHash",value:function(e,t,r){var n=this.defaultServices.TemplateProvider.getTemplate(e);return n?this.parseTemplateSet(n,t,r):""}}]),n}(e("fable"));t.exports=n,t.exports.PictApplicationClass=e("./Pict-Application.js"),t.exports.PictViewClass=e("./Pict-View.js"),t.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}")},{"./Pict-Application.js":108,"./Pict-Content-Assignment.js":109,"./Pict-DataProvider.js":110,"./Pict-Meadow-EntityProvider.js":111,"./Pict-Template-Provider.js":112,"./Pict-View.js":113,fable:39}]},{},[114]);
|
|
12
12
|
//# sourceMappingURL=pict.compatible.min.js.map
|