text: /*! @license Firebase v4.0.0
  Build: rev-c054dab
  Terms: https://firebase.google.com/terms/ */
  
  try{webpackJsonp([0],[function(e,t,n){"use strict";function r(e){return null!=e}function a(e){return void 0!==e}function o(e){return"function"==typeof e}function i(e){return"object"===(void 0===e?"undefined":h(e))}function u(e){return i(e)&&null!==e}function s(e){return i(e)&&!Array.isArray(e)}function l(e){return"string"==typeof e||e instanceof String}function c(e){return"number"==typeof e||e instanceof Number}function f(e){return d()&&e instanceof Blob}function d(){return"undefined"!=typeof Blob}Object.defineProperty(t,"__esModule",{value:!0});var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isDef=r,t.isJustDef=a,t.isFunction=o,t.isObject=i,t.isNonNullObject=u,t.isNonArrayObject=s,t.isString=l,t.isNumber=c,t.isNativeBlob=f,t.isNativeBlobDefined=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return"storage/"+e}function o(){return new C(A.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function i(e){return new C(A.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function u(e){return new C(A.BUCKET_NOT_FOUND,"Bucket '"+e+"' does not exist.")}function s(e){return new C(A.PROJECT_NOT_FOUND,"Project '"+e+"' does not exist.")}function l(e){return new C(A.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function c(){return new C(A.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again.")}function f(e){return new C(A.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function d(){return new C(A.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function h(e,t,n){return new C(A.INVALID_CHECKSUM,"Uploaded/downloaded object '"+e+"' has checksum '"+t+"' which does not match '"+n+"'. Please retry the upload/download.")}function p(){return new C(A.CANCELED,"User canceled the upload/download.")}function v(e){return new C(A.INVALID_EVENT_NAME,"Invalid event name '"+e+"'.")}function _(e){return new C(A.INVALID_URL,"Invalid URL '"+e+"'.")}function y(e){return new C(A.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function b(){return new C(A.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+N.configOption+"' property when initializing the app?")}function m(){return new C(A.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function k(){return new C(A.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function g(){return new C(A.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function R(e,t,n){return new C(A.INVALID_ARGUMENT,"Invalid argument in `"+t+"` at index "+e+": "+n)}function w(e,t,n,r){var a=void 0,o=void 0;return e===t?(a=e,o=1===e?"argument":"arguments"):(a="between "+e+" and "+t,o="arguments"),new C(A.INVALID_ARGUMENT_COUNT,"Invalid argument count in `"+n+"`: Expected "+a+" "+o+", received "+r+".")}function S(){return new C(A.APP_DELETED,"The Firebase app was deleted.")}function E(e){return new C(A.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function T(e,t){return new C(A.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function O(e){throw new C(A.INTERNAL_ERROR,"Internal error: "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Code=t.errors=t.FirebaseStorageError=void 0;var U=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.prependCode=a,t.unknown=o,t.objectNotFound=i,t.bucketNotFound=u,t.projectNotFound=s,t.quotaExceeded=l,t.unauthenticated=c,t.unauthorized=f,t.retryLimitExceeded=d,t.invalidChecksum=h,t.canceled=p,t.invalidEventName=v,t.invalidUrl=_,t.invalidDefaultBucket=y,t.noDefaultBucket=b,t.cannotSliceBlob=m,t.serverFileWrongSize=k,t.noDownloadURL=g,t.invalidArgument=R,t.invalidArgumentCount=w,t.appDeleted=S,t.invalidRootOperation=E,t.invalidFormat=T,t.internalError=O;var N=n(6),C=t.FirebaseStorageError=function(){function e(t,n){r(this,e),this.code_=a(t),this.message_="Firebase Storage: "+n,this.serverResponse_=null,this.name_="FirebaseError"}return U(e,[{key:"codeProp",value:function(){return this.code}},{key:"codeEquals",value:function(e){return a(e)===this.codeProp()}},{key:"serverResponseProp",value:function(){return this.serverResponse_}},{key:"setServerResponseProp",value:function(e){this.serverResponse_=e}},{key:"name",get:function(){return this.name_}},{key:"code",get:function(){return this.code_}},{key:"message",get:function(){return this.message_}},{key:"serverResponse",get:function(){return this.serverResponse_}}]),e}(),A=(t.errors={},t.Code={UNKNOWN:"unknown",OBJECT_NOT_FOUND:"object-not-found",BUCKET_NOT_FOUND:"bucket-not-found",PROJECT_NOT_FOUND:"project-not-found",QUOTA_EXCEEDED:"quota-exceeded",UNAUTHENTICATED:"unauthenticated",UNAUTHORIZED:"unauthorized",RETRY_LIMIT_EXCEEDED:"retry-limit-exceeded",INVALID_CHECKSUM:"invalid-checksum",CANCELED:"canceled",INVALID_EVENT_NAME:"invalid-event-name",INVALID_URL:"invalid-url",INVALID_DEFAULT_BUCKET:"invalid-default-bucket",NO_DEFAULT_BUCKET:"no-default-bucket",CANNOT_SLICE_BLOB:"cannot-slice-blob",SERVER_FILE_WRONG_SIZE:"server-file-wrong-size",NO_DOWNLOAD_URL:"no-download-url",INVALID_ARGUMENT:"invalid-argument",INVALID_ARGUMENT_COUNT:"invalid-argument-count",APP_DELETED:"app-deleted",INVALID_ROOT_OPERATION:"invalid-root-operation",INVALID_FORMAT:"invalid-format",INTERNAL_ERROR:"internal-error"})},function(e,t,n){"use strict";function r(e){return new i.local.Promise(e)}function a(e){return i.local.Promise.resolve(e)}function o(e){return i.local.Promise.reject(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.make=r,t.resolve=a,t.reject=o;var i=n(10)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){for(var n in e)r(e,n)&&t(n,e[n])}function o(e){if(null==e)return{};var t={};return a(e,function(e,n){t[e]=n}),t}Object.defineProperty(t,"__esModule",{value:!0}),t.contains=r,t.forEach=a,t.clone=o},,,function(e,t,n){"use strict";function r(e){e=e}Object.defineProperty(t,"__esModule",{value:!0}),t.setDomainBase=r;t.domainBase="https://firebasestorage.googleapis.com",t.downloadBase="https://firebasestorage.googleapis.com",t.apiBaseUrl="/v0",t.apiUploadBaseUrl="/v0",t.configOption="storageBucket",t.shortMaxOperationRetryTime=6e4,t.defaultMaxOperationRetryTime=12e4,t.defaultMaxUploadRetryTime=6e4,t.minSafeInteger=-9007199254740991},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Location=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o);t.Location=function(){function e(t,n){r(this,e),this.bucket=t,this.path_=n}return a(e,[{key:"fullServerUrl",value:function(){var e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}},{key:"bucketOnlyServerUrl",value:function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}},{key:"path",get:function(){return this.path_}}],[{key:"makeFromBucketSpec",value:function(t){var n=void 0;try{n=e.makeFromUrl(t)}catch(n){return new e(t,"")}if(""===n.path)return n;throw i.invalidDefaultBucket(t)}},{key:"makeFromUrl",value:function(t){for(var n=null,r=new RegExp("^gs://([A-Za-z0-9.\\-]+)(/(.*))?$","i"),a=new RegExp("^https?://firebasestorage\\.googleapis\\.com/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-]+)/o(/([^?#]*).*)?$","i"),o=[{regex:r,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:a,indices:{bucket:1,path:3},postModify:function(e){e.path_=decodeURIComponent(e.path)}}],u=0;u<o.length;u++){var s=o[u],l=s.regex.exec(t);if(l){var c=l[s.indices.bucket],f=l[s.indices.path];f||(f=""),n=new e(c,f),s.postModify(n);break}}if(null==n)throw i.invalidUrl(t);return n}}]),e}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){switch(e){case p.RAW:case p.BASE64:case p.BASE64URL:case p.DATA_URL:return;default:throw"Expected one of the event types: ["+p.RAW+", "+p.BASE64+", "+p.BASE64URL+", "+p.DATA_URL+"]."}}function o(e,t){switch(e){case p.RAW:return new v(i(t));case p.BASE64:case p.BASE64URL:return new v(s(e,t));case p.DATA_URL:return new v(l(t),c(t))}throw h.unknown()}function i(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(r);else if(r<=2047)t.push(192|r>>6,128|63&r);else if(55296==(64512&r)){var a=n<e.length-1&&56320==(64512&e.charCodeAt(n+1));if(a){var o=r,i=e.charCodeAt(++n);r=65536|(1023&o)<<10|1023&i,t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else t.push(239,191,189)}else 56320==(64512&r)?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(t)}function u(e){var t=void 0;try{t=decodeURIComponent(e)}catch(e){throw h.invalidFormat(p.DATA_URL,"Malformed data URL.")}return i(t)}function s(e,t){switch(e){case p.BASE64:var n=-1!==t.indexOf("-"),r=-1!==t.indexOf("_");if(n||r){var a=n?"-":"_";throw h.invalidFormat(e,"Invalid character '"+a+"' found: is it base64url encoded?")}break;case p.BASE64URL:var o=-1!==t.indexOf("+"),i=-1!==t.indexOf("/");if(o||i){var u=o?"+":"/";throw h.invalidFormat(e,"Invalid character '"+u+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/")}var s=void 0;try{s=atob(t)}catch(t){throw h.invalidFormat(e,"Invalid character found")}for(var l=new Uint8Array(s.length),c=0;c<s.length;c++)l[c]=s.charCodeAt(c);return l}function l(e){var t=new _(e);return t.base64?s(p.BASE64,t.rest):u(t.rest)}function c(e){return new _(e).contentType}function f(e,t){return!!(e.length>=t.length)&&e.substring(e.length-t.length)===t}Object.defineProperty(t,"__esModule",{value:!0}),t.StringData=t.StringFormat=void 0,t.formatValidator=a,t.dataFromString=o,t.utf8Bytes_=i,t.percentEncodedBytes_=u,t.base64Bytes_=s,t.dataURLBytes_=l,t.dataURLContentType_=c;var d=n(1),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(d),p=t.StringFormat={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},v=t.StringData=function e(t,n){r(this,e),this.data=t,this.contentType=n||null},_=function e(t){r(this,e),this.base64=!1,this.contentType=null;var n=t.match(/^data:([^,]+)?,/);if(null===n)throw h.invalidFormat(p.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var a=n[1]||null;null!=a&&(this.base64=f(a,";base64"),this.contentType=this.base64?a.substring(0,a.length-";base64".length):a),this.rest=t.substring(t.indexOf(",")+1)}},,,function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){for(var r=t.length,a=t.length,o=0;o<t.length;o++)if(t[o].optional){r=o;break}if(!(r<=n.length&&n.length<=a))throw p.invalidArgumentCount(r,a,e,n.length);for(var i=0;i<n.length;i++)try{t[i].validator(n[i])}catch(t){throw t instanceof Error?p.invalidArgument(i,e,t.message):p.invalidArgument(i,e,t)}}function i(e,t){return function(n){e(n),t(n)}}function u(e,t){function n(e){if(!b.isString(e))throw"Expected string."}var r=void 0;return r=e?i(n,e):n,new m(r,t)}function s(){return new m(function(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||b.isNativeBlobDefined()&&e instanceof Blob))throw"Expected Blob or File."})}function l(e){return new m(_.metadataValidator,e)}function c(){return new m(function(e){if(!(b.isNumber(e)&&e>=0))throw"Expected a number 0 or greater."})}function f(e,t){return new m(function(t){if(!(null===t||b.isDef(t)&&t instanceof Object))throw"Expected an Object.";void 0!==e&&null!==e&&e(t)},t)}function d(e){return new m(function(e){if(null!==e&&!b.isFunction(e))throw"Expected a Function."},e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ArgSpec=void 0,t.validate=o,t.and_=i,t.stringSpec=u,t.uploadDataSpec=s,t.metadataSpec=l,t.nonNegativeNumberSpec=c,t.looseObjectSpec=f,t.nullFunctionSpec=d;var h=n(1),p=r(h),v=n(13),_=r(v),y=n(0),b=r(y),m=t.ArgSpec=function e(t,n){a(this,e);var r=this;this.validator=function(e){r.optional&&!b.isJustDef(e)||t(e)},this.optional=!!n}},function(e,t,n){"use strict";function r(e,t){return-1!==e.indexOf(t)}function a(e){return Array.prototype.slice.call(e)}function o(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}Object.defineProperty(t,"__esModule",{value:!0}),t.contains=r,t.clone=a,t.remove=o},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return t}function i(e){return!m.isString(e)||e.length<2?e:(e=e,y.lastComponent(e))}function u(){if(w)return w;var e=[];e.push(new R("bucket")),e.push(new R("generation")),e.push(new R("metageneration")),e.push(new R("name","fullPath",!0));var t=new R("name");t.xform=function(e,t){return i(t)},e.push(t);var n=new R("size");return n.xform=function(e,t){return m.isDef(t)?+t:t},e.push(n),e.push(new R("timeCreated")),e.push(new R("updated")),e.push(new R("md5Hash",null,!0)),e.push(new R("cacheControl",null,!0)),e.push(new R("contentDisposition",null,!0)),e.push(new R("contentEncoding",null,!0)),e.push(new R("contentLanguage",null,!0)),e.push(new R("contentType",null,!0)),e.push(new R("metadata","customMetadata",!0)),e.push(new R("downloadTokens","downloadURLs",!1,function(e,t){if(!(m.isString(t)&&t.length>0))return[];var n=encodeURIComponent;return t.split(",").map(function(t){var r=e.bucket,a=e.fullPath,o="/b/"+n(r)+"/o/"+n(a);return g.makeDownloadUrl(o)+g.makeQueryString({alt:"media",token:t})})})),w=e}function s(e,t){Object.defineProperty(e,"ref",{get:function(){var n=e.bucket,r=e.fullPath,a=new v.Location(n,r);return t.makeStorageReference(a)}})}function l(e,t,n){var r={};r.type="file";for(var a=n.length,o=0;o<a;o++){var i=n[o];r[i.local]=i.xform(r,t[i.server])}return s(r,e),r}function c(e,t,n){var r=p.jsonObjectOrNull(t);return null===r?null:l(e,r,n)}function f(e,t){for(var n={},r=t.length,a=0;a<r;a++){var o=t[a];o.writable&&(n[o.server]=e[o.local])}return JSON.stringify(n)}function d(e){if(!e||!m.isObject(e))throw"Expected Metadata object.";for(var t in e){var n=e[t];if("customMetadata"===t){if(!m.isObject(n))throw"Expected object for 'customMetadata' mapping."}else if(m.isNonNullObject(n))throw"Mapping for '"+t+"' cannot be an object."}}Object.defineProperty(t,"__esModule",{value:!0}),t.Mapping=void 0,t.noXform_=o,t.xformPath=i,t.getMappings=u,t.addRef=s,t.fromResource=l,t.fromResourceString=c,t.toResourceString=f,t.metadataValidator=d;var h=n(43),p=r(h),v=n(7),_=n(23),y=r(_),b=n(0),m=r(b),k=n(14),g=r(k),R=t.Mapping=function e(t,n,r,i){a(this,e),this.server=t,this.local=n||t,this.writable=!!r,this.xform=i||o},w=null},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e){return l.domainBase+l.apiBaseUrl+e}function o(e){return l.downloadBase+l.apiBaseUrl+e}function i(e){return l.domainBase+l.apiUploadBaseUrl+e}function u(e){var t=encodeURIComponent,n="?";return f.forEach(e,function(e,r){var a=t(e)+"="+t(r);n=n+a+"&"}),n=n.slice(0,-1)}Object.defineProperty(t,"__esModule",{value:!0}),t.makeNormalUrl=a,t.makeDownloadUrl=o,t.makeUploadUrl=i,t.makeQueryString=u;var s=n(6),l=r(s),c=n(3),f=r(c)},function(e,t,n){"use strict";function r(e){switch(e){case a.RUNNING:case a.PAUSING:case a.CANCELING:return o.RUNNING;case a.PAUSED:return o.PAUSED;case a.SUCCESS:return o.SUCCESS;case a.CANCELED:return o.CANCELED;case a.ERROR:default:return o.ERROR}}Object.defineProperty(t,"__esModule",{value:!0}),t.taskStateFromInternalTaskState=r;var a=(t.TaskEvent={STATE_CHANGED:"state_changed"},t.InternalTaskState={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"}),o=t.TaskState={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Reference=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(11),u=r(i),s=n(22),l=n(1),c=r(l),f=n(7),d=n(13),h=r(d),p=n(3),v=r(p),_=n(23),y=r(_),b=n(24),m=r(b),k=n(8),g=r(k),R=n(0),w=r(R),S=n(49);t.Reference=function(){function e(t,n){a(this,e),this.authWrapper=t,n instanceof f.Location?this.location=n:this.location=f.Location.makeFromUrl(n)}return o(e,[{key:"toString",value:function(){return u.validate("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path}},{key:"newRef",value:function(t,n){return new e(t,n)}},{key:"mappings",value:function(){return h.getMappings()}},{key:"child",value:function(e){u.validate("child",[u.stringSpec()],arguments);var t=y.child(this.location.path,e),n=new f.Location(this.location.bucket,t);return this.newRef(this.authWrapper,n)}},{key:"put",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return u.validate("put",[u.uploadDataSpec(),u.metadataSpec(!0)],arguments),this.throwIfRoot_("put"),new S.UploadTask(this,this.authWrapper,this.location,this.mappings(),new s.FbsBlob(e),t)}},{key:"putString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k.StringFormat.RAW,n=arguments[2];u.validate("putString",[u.stringSpec(),u.stringSpec(g.formatValidator,!0),u.metadataSpec(!0)],arguments),this.throwIfRoot_("putString");var r=g.dataFromString(t,e),a=v.clone(n);return!w.isDef(a.contentType)&&w.isDef(r.contentType)&&(a.contentType=r.contentType),new S.UploadTask(this,this.authWrapper,this.location,this.mappings(),new s.FbsBlob(r.data,!0),a)}},{key:"delete",value:function(){u.validate("delete",[],arguments),this.throwIfRoot_("delete");var e=this;return this.authWrapper.getAuthToken().then(function(t){var n=m.deleteObject(e.authWrapper,e.location);return e.authWrapper.makeRequest(n,t).getPromise()})}},{key:"getMetadata",value:function(){u.validate("getMetadata",[],arguments),this.throwIfRoot_("getMetadata");var e=this;return this.authWrapper.getAuthToken().then(function(t){var n=m.getMetadata(e.authWrapper,e.location,e.mappings());return e.authWrapper.makeRequest(n,t).getPromise()})}},{key:"updateMetadata",value:function(e){u.validate("updateMetadata",[u.metadataSpec()],arguments),this.throwIfRoot_("updateMetadata");var t=this;return this.authWrapper.getAuthToken().then(function(n){var r=m.updateMetadata(t.authWrapper,t.location,e,t.mappings());return t.authWrapper.makeRequest(r,n).getPromise()})}},{key:"getDownloadURL",value:function(){return u.validate("getDownloadURL",[],arguments),this.throwIfRoot_("getDownloadURL"),this.getMetadata().then(function(e){var t=e.downloadURLs[0];if(w.isDef(t))return t;throw c.noDownloadURL()})}},{key:"throwIfRoot_",value:function(e){if(""===this.location.path)throw c.invalidRootOperation(e)}},{key:"parent",get:function(){var e=y.parent(this.location.path);if(null===e)return null;var t=new f.Location(this.location.bucket,e);return this.newRef(this.authWrapper,t)}},{key:"root",get:function(){var e=new f.Location(this.location.bucket,"");return this.newRef(this.authWrapper,e)}},{key:"bucket",get:function(){return this.location.bucket}},{key:"fullPath",get:function(){return this.location.path}},{key:"name",get:function(){return y.lastComponent(this.location.path)}},{key:"storage",get:function(){return this.authWrapper.service()}}]),e}()},,,,,,function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.FbsBlob=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(42),u=r(i),s=n(8),l=r(s),c=n(0),f=r(c);t.FbsBlob=function(){function e(t,n){a(this,e);var r=0,o="";f.isNativeBlob(t)?(this.data_=t,r=t.size,o=t.type):t instanceof ArrayBuffer?(n?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),r=this.data_.length):t instanceof Uint8Array&&(n?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),r=t.length),this.size_=r,this.type_=o}return o(e,[{key:"size",value:function(){return this.size_}},{key:"type",value:function(){return this.type_}},{key:"slice",value:function(t,n){if(f.isNativeBlob(this.data_)){var r=this.data_,a=u.sliceBlob(r,t,n);return null===a?null:new e(a)}return new e(new Uint8Array(this.data_.buffer,t,n-t),!0)}},{key:"uploadData",value:function(){return this.data_}}],[{key:"getBlob",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if(f.isNativeBlobDefined()){var a=n.map(function(t){return t instanceof e?t.data_:t});return new e(u.getBlob.apply(null,a))}var o=n.map(function(e){return f.isString(e)?l.dataFromString(s.StringFormat.RAW,e).data:e.data_}),i=0;o.forEach(function(e){i+=e.byteLength});var c=new Uint8Array(i),d=0;return o.forEach(function(e){for(var t=0;t<e.length;t++)c[d++]=e[t]}),new e(c,!0)}}]),e}()},function(e,t,n){"use strict";function r(e){if(0==e.length)return null;var t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}function a(e,t){var n=t.split("/").filter(function(e){return e.length>0}).join("/");return 0===e.length?n:e+"/"+n}function o(e){var t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}Object.defineProperty(t,"__esModule",{value:!0}),t.parent=r,t.child=a,t.lastComponent=o},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){if(!e)throw w.unknown()}function i(e,t){return function(n,r){var a=E.fromResourceString(e,r,t);return o(null!==a),a}}function u(e){return function(t,n){var r=void 0;return r=401===t.getStatus()?w.unauthenticated():402===t.getStatus()?w.quotaExceeded(e.bucket):403===t.getStatus()?w.unauthorized(e.path):n,r.setServerResponseProp(n.serverResponseProp()),r}}function s(e){var t=u(e);return function(n,r){var a=t(n,r);return 404===n.getStatus()&&(a=w.objectNotFound(e.path)),a.setServerResponseProp(r.serverResponseProp()),a}}function l(e,t,n){var r=t.fullServerUrl(),a=I.makeNormalUrl(r),o=e.maxOperationRetryTime(),u=new U.RequestInfo(a,"GET",i(e,n),o);return u.errorHandler=s(t),u}function c(e,t,n,r){var a=t.fullServerUrl(),o=I.makeNormalUrl(a),u=E.toResourceString(n,r),l=e.maxOperationRetryTime(),c=new U.RequestInfo(o,"PATCH",i(e,r),l);return c.headers={"Content-Type":"application/json; charset=utf-8"},c.body=u,c.errorHandler=s(t),c}function f(e,t){var n=t.fullServerUrl(),r=I.makeNormalUrl(n),a=e.maxOperationRetryTime(),o=new U.RequestInfo(r,"DELETE",function(){},a);return o.successCodes=[200,204],o.errorHandler=s(t),o}function d(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}function h(e,t,n){var r=O.clone(n);return r.fullPath=e.path,r.size=t.size(),r.contentType||(r.contentType=d(null,t)),r}function p(e,t,n,r,a){var o=t.bucketOnlyServerUrl(),s={"X-Goog-Upload-Protocol":"multipart"},l=function(){for(var e="",t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();s["Content-Type"]="multipart/related; boundary="+l;var c=h(t,r,a),f=E.toResourceString(c,n),d="--"+l+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+f+"\r\n--"+l+"\r\nContent-Type: "+c.contentType+"\r\n\r\n",p=g.FbsBlob.getBlob(d,r,"\r\n--"+l+"--");if(null===p)throw w.cannotSliceBlob();var v={name:c.fullPath},_=I.makeUploadUrl(o),y=e.maxUploadRetryTime(),b=new U.RequestInfo(_,"POST",i(e,n),y);return b.urlParams=v,b.headers=s,b.body=p.uploadData(),b.errorHandler=u(t),b}function v(e,t){var n=void 0;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){o(!1)}return o(k.contains(t||["active"],n)),n}function _(e,t,n,r,a){var i=t.bucketOnlyServerUrl(),s=h(t,r,a),l={name:s.fullPath},c=I.makeUploadUrl(i),f={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":s.contentType,"Content-Type":"application/json; charset=utf-8"},d=E.toResourceString(s,n),p=e.maxUploadRetryTime(),_=new U.RequestInfo(c,"POST",function(e){v(e);var t=void 0;try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){o(!1)}return o(C.isString(t)),t},p);return _.urlParams=l,_.headers=f,_.body=d,_.errorHandler=u(t),_}function y(e,t,n,r){var a=e.maxUploadRetryTime(),i=new U.RequestInfo(n,"POST",function(e){var t=v(e,["active","final"]),n=void 0;try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){o(!1)}var a=parseInt(n,10);return o(!isNaN(a)),new P(a,r.size(),"final"===t)},a);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=u(t),i}function b(e,t,n,r,a,o,s,l){var c=new P(0,0);if(s?(c.current=s.current,c.total=s.total):(c.current=0,c.total=r.size()),r.size()!==c.total)throw w.serverFileWrongSize();var f=c.total-c.current,d=f;a>0&&(d=Math.min(d,a));var h=c.current,p=h+d,_=d===f?"upload, finalize":"upload",y={"X-Goog-Upload-Command":_,"X-Goog-Upload-Offset":c.current},b=r.slice(h,p);if(null===b)throw w.cannotSliceBlob();var m=t.maxUploadRetryTime(),k=new U.RequestInfo(n,"POST",function(e,n){var a=v(e,["active","final"]),u=c.current+d,s=r.size(),l=void 0;return l="final"===a?i(t,o)(e,n):null,new P(u,s,"final"===a,l)},m);return k.headers=y,k.body=b.uploadData(),k.progressCallback=l||null,k.errorHandler=u(e),k}Object.defineProperty(t,"__esModule",{value:!0}),t.resumableUploadChunkSize=t.ResumableUploadStatus=void 0,t.handlerCheck=o,t.metadataHandler=i,t.sharedErrorHandler=u,t.objectErrorHandler=s,t.getMetadata=l,t.updateMetadata=c,t.deleteObject=f,t.determineContentType_=d,t.metadataForUpload_=h,t.multipartUpload=p,t.checkResumeHeader_=v,t.createResumableUpload=_,t.getResumableUploadStatus=y,t.continueResumableUpload=b;var m=n(12),k=r(m),g=n(22),R=n(1),w=r(R),S=n(13),E=r(S),T=n(3),O=r(T),U=n(46),N=n(0),C=r(N),A=n(14),I=r(A),P=t.ResumableUploadStatus=function e(t,n,r,o){a(this,e),this.current=t,this.total=n,this.finalized=!!r,this.metadata=o||null};t.resumableUploadChunkSize=262144},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.ErrorCode=void 0;!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(r||(t.ErrorCode=r={}))},,,,,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.XhrIoPool=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(48);t.XhrIoPool=function(){function e(){r(this,e)}return a(e,[{key:"createXhrIo",value:function(){return new o.NetworkXhrIo}}]),e}()},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceInternals=t.Service=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(11),u=r(i),s=n(39),l=n(7),c=n(2),f=r(c),d=n(45),h=r(d),p=n(16),v=(t.Service=function(){function e(t,n,r){if(a(this,e),this.bucket_=null,this.authWrapper_=new s.AuthWrapper(t,function(e,t){return new p.Reference(e,t)},h.makeRequest,this,n),this.app_=t,null!=r)this.bucket_=l.Location.makeFromBucketSpec(r);else{var o=this.authWrapper_.bucket();null!=o&&(this.bucket_=new l.Location(o,""))}this.internals_=new v(this)}return o(e,[{key:"ref",value:function(e){if(u.validate("ref",[u.stringSpec(function(e){if(/^[A-Za-z]+:\/\//.test(e))throw"Expected child path but got a URL, use refFromURL instead."},!0)],arguments),null==this.bucket_)throw new Error("No Storage Bucket defined in Firebase Options.");var t=new p.Reference(this.authWrapper_,this.bucket_);return null!=e?t.child(e):t}},{key:"refFromURL",value:function(e){return u.validate("refFromURL",[u.stringSpec(function(e){if(!/^[A-Za-z]+:\/\//.test(e))throw"Expected full URL but got a child path, use ref instead.";try{l.Location.makeFromUrl(e)}catch(e){throw"Expected valid full URL but got an invalid one."}},!1)],arguments),new p.Reference(this.authWrapper_,e)}},{key:"setMaxUploadRetryTime",value:function(e){u.validate("setMaxUploadRetryTime",[u.nonNegativeNumberSpec()],arguments),this.authWrapper_.setMaxUploadRetryTime(e)}},{key:"setMaxOperationRetryTime",value:function(e){u.validate("setMaxOperationRetryTime",[u.nonNegativeNumberSpec()],arguments),this.authWrapper_.setMaxOperationRetryTime(e)}},{key:"maxUploadRetryTime",get:function(){return this.authWrapper_.maxUploadRetryTime()}},{key:"maxOperationRetryTime",get:function(){return this.authWrapper_.maxOperationRetryTime()}},{key:"app",get:function(){return this.app_}},{key:"INTERNAL",get:function(){return this.internals_}}]),e}(),t.ServiceInternals=function(){function e(t){a(this,e),this.service_=t}return o(e,[{key:"delete",value:function(){return this.service_.authWrapper_.deleteApp(),f.resolve(void 0)}}]),e}())},,,,,,function(e,t,n){"use strict";function r(e,t,n){return new l.Service(e,new u.XhrIoPool,n)}function a(e){e.INTERNAL.registerService(f,r,{TaskState:i.TaskState,TaskEvent:i.TaskEvent,StringFormat:o.StringFormat,Storage:l.Service,Reference:s.Reference},void 0,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=a;var o=n(8),i=n(15),u=n(30),s=n(16),l=n(31),c=n(4),f="storage";a(function(e){return e&&e.__esModule?e:{default:e}}(c).default)},function(e,t,n){"use strict";function r(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];o.resolve(!0).then(function(){e.apply(null,n)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.async=r;var a=n(2),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.AuthWrapper=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(6),u=r(i),s=n(1),l=r(s),c=n(41),f=n(7),d=n(2),h=r(d),p=n(47),v=n(0),_=r(v);t.AuthWrapper=function(){function e(t,n,r,o,i){if(a(this,e),this.bucket_=null,this.deleted_=!1,this.app_=t,null!==this.app_){var s=this.app_.options;_.isDef(s)&&(this.bucket_=e.extractBucket_(s))}this.storageRefMaker_=n,this.requestMaker_=r,this.pool_=i,this.service_=o,this.maxOperationRetryTime_=u.defaultMaxOperationRetryTime,this.maxUploadRetryTime_=u.defaultMaxUploadRetryTime,this.requestMap_=new p.RequestMap}return o(e,[{key:"getAuthToken",value:function(){return null!==this.app_&&_.isDef(this.app_.INTERNAL)&&_.isDef(this.app_.INTERNAL.getToken)?this.app_.INTERNAL.getToken().then(function(e){return null!==e?e.accessToken:null},function(){return null}):h.resolve(null)}},{key:"bucket",value:function(){if(this.deleted_)throw l.appDeleted();return this.bucket_}},{key:"service",value:function(){return this.service_}},{key:"makeStorageReference",value:function(e){return this.storageRefMaker_(this,e)}},{key:"makeRequest",value:function(e,t){if(this.deleted_)return new c.FailRequest(l.appDeleted());var n=this.requestMaker_(e,t,this.pool_);return this.requestMap_.addRequest(n),n}},{key:"deleteApp",value:function(){this.deleted_=!0,this.app_=null,this.requestMap_.clear()}},{key:"maxUploadRetryTime",value:function(){return this.maxUploadRetryTime_}},{key:"setMaxUploadRetryTime",value:function(e){this.maxUploadRetryTime_=e}},{key:"maxOperationRetryTime",value:function(){return this.maxOperationRetryTime_}},{key:"setMaxOperationRetryTime",value:function(e){this.maxOperationRetryTime_=e}}],[{key:"extractBucket_",value:function(e){var t=e[u.configOption]||null;return null==t?null:f.Location.makeFromBucketSpec(t).bucket}}]),e}()},function(e,t,n){"use strict";function r(e,t,n){function r(){return 2===f}function a(){d||(d=!0,t.apply(null,arguments))}function o(t){l=setTimeout(function(){l=null,e(i,r())},t)}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!d){if(e)return void a.apply(null,arguments);if(r()||c)return void a.apply(null,arguments);s<64&&(s*=2);var u=void 0;1===f?(f=2,u=0):u=1e3*(s+Math.random()),o(u)}}function u(e){h||(h=!0,d||(null!==l?(e||(f=2),clearTimeout(l),o(0)):e||(f=1)))}var s=1,l=null,c=!1,f=0,d=!1,h=!1;return o(0),setTimeout(function(){c=!0,u(!0)},n),u}function a(e){e(!1)}Object.defineProperty(t,"__esModule",{value:!0}),t.start=r,t.stop=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.FailRequest=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o);t.FailRequest=function(){function e(t){r(this,e),this.promise_=i.reject(t)}return a(e,[{key:"getPromise",value:function(){return this.promise_}},{key:"cancel",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]}}]),e}()},function(e,t,n){"use strict";function r(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function a(){for(var e=r(),t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];if(void 0!==e){for(var o=new e,i=0;i<n.length;i++)o.append(n[i]);return o.getBlob()}if(u.isNativeBlobDefined())return new Blob(n);throw Error("This browser doesn't seem to support creating Blobs")}function o(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}Object.defineProperty(t,"__esModule",{value:!0}),t.getBlob=a,t.sliceBlob=o;var i=n(0),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i)},function(e,t,n){"use strict";function r(e){var t=void 0;try{t=JSON.parse(e)}catch(e){return null}return o.isNonArrayObject(t)?t:null}Object.defineProperty(t,"__esModule",{value:!0}),t.jsonObjectOrNull=r;var a=n(0),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Observer=void 0;var a=n(0),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a);t.Observer=function e(t,n,a){if(r(this,e),o.isFunction(t)||o.isDef(n)||o.isDef(a))this.next=t,this.error=n||null,this.complete=a||null;else{var i=t;this.next=i.next,this.error=i.error,this.complete=i.complete}}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}function i(e){var t="undefined"!=typeof firebase?firebase.SDK_VERSION:"AppManager";e["X-Firebase-Storage-Version"]="webjs/"+t}function u(e,t,n){var r=R.makeQueryString(e.urlParams),a=e.url+r,u=_.clone(e.headers);return o(u,t),i(u),new E(a,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.RequestEndStatus=void 0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.addAuthHeader_=o,t.addVersionHeader_=i,t.makeRequest=u;var l=n(12),c=r(l),f=n(40),d=r(f),h=n(1),p=r(h),v=n(3),_=r(v),y=n(2),b=r(y),m=n(0),k=r(m),g=n(14),R=r(g),w=n(25),S=r(w),E=function(){function e(t,n,r,o,i,u,s,l,c,f,d){a(this,e),this.pendingXhr_=null,this.backoffId_=null,this.resolve_=null,this.reject_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=n,this.headers_=r,this.body_=o,this.successCodes_=i.slice(),this.additionalRetryCodes_=u.slice(),this.callback_=s,this.errorCallback_=l,this.progressCallback_=f,this.timeout_=c,this.pool_=d;var h=this;this.promise_=b.make(function(e,t){h.resolve_=e,h.reject_=t,h.start_()})}return s(e,[{key:"start_",value:function(){function e(e,t){function r(e){var t=e.loaded,r=e.lengthComputable?e.total:-1;null!==n.progressCallback_&&n.progressCallback_(t,r)}if(t)return void e(!1,new T(!1,null,!0));var a=n.pool_.createXhrIo();n.pendingXhr_=a,null!==n.progressCallback_&&a.addUploadProgressListener(r),a.send(n.url_,n.method_,n.body_,n.headers_).then(function(t){null!==n.progressCallback_&&t.removeUploadProgressListener(r),n.pendingXhr_=null,t=t;var a=t.getErrorCode()===S.ErrorCode.NO_ERROR,o=t.getStatus();if(!a||n.isRetryStatusCode_(o)){var i=t.getErrorCode()===S.ErrorCode.ABORT;return void e(!1,new T(!1,null,i))}var u=c.contains(n.successCodes_,o);e(!0,new T(u,t))})}function t(e,t){var r=n.resolve_,a=n.reject_,o=t.xhr;if(t.wasSuccessCode)try{var i=n.callback_(o,o.getResponseText());k.isJustDef(i)?r(i):r()}catch(e){a(e)}else if(null!==o){var u=p.unknown();u.setServerResponseProp(o.getResponseText()),a(n.errorCallback_?n.errorCallback_(o,u):u)}else if(t.canceled){var s=n.appDelete_?p.appDeleted():p.canceled();a(s)}else{var l=p.retryLimitExceeded();a(l)}}var n=this;this.canceled_?t(!1,new T(!1,null,!0)):this.backoffId_=d.start(e,t,this.timeout_)}},{key:"getPromise",value:function(){return this.promise_}},{key:"cancel",value:function(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&d.stop(this.backoffId_),null!==this.pendingXhr_&&this.pendingXhr_.abort()}},{key:"isRetryStatusCode_",value:function(e){var t=c.contains([408,429],e),n=c.contains(this.additionalRetryCodes_,e);return e>=500&&e<600||t||n}}]),e}(),T=t.RequestEndStatus=function e(t,n,r){a(this,e),this.wasSuccessCode=t,this.xhr=n,this.canceled=!!r}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});t.RequestInfo=function e(t,n,a,o){r(this,e),this.url=t,this.method=n,this.handler=a,this.timeout=o,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.RequestMap=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(3),u=r(i),s=n(6),l=r(s);t.RequestMap=function(){function e(){a(this,e),this.map_={},this.id_=l.minSafeInteger}return o(e,[{key:"addRequest",value:function(e){function t(){delete r.map_[n]}var n=this.id_;this.id_++,this.map_[n]=e;var r=this;e.getPromise().then(t,t)}},{key:"clear",value:function(){u.forEach(this.map_,function(e,t){t&&t.cancel(!0)}),this.map_={}}}]),e}()},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkXhrIo=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),u=r(i),s=n(3),l=r(s),c=n(2),f=r(c),d=n(0),h=r(d),p=n(25),v=r(p);t.NetworkXhrIo=function(){function e(){var t=this;a(this,e),this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=v.ErrorCode.NO_ERROR,this.sendPromise_=f.make(function(e){t.xhr_.addEventListener("abort",function(){t.errorCode_=v.ErrorCode.ABORT,e(t)}),t.xhr_.addEventListener("error",function(){t.errorCode_=v.ErrorCode.NETWORK_ERROR,e(t)}),t.xhr_.addEventListener("load",function(){e(t)})})}return o(e,[{key:"send",value:function(e,t,n,r){var a=this;if(this.sent_)throw u.internalError("cannot .send() more than once");return this.sent_=!0,this.xhr_.open(t,e,!0),h.isDef(r)&&l.forEach(r,function(e,t){a.xhr_.setRequestHeader(e,t.toString())}),h.isDef(n)?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}},{key:"getErrorCode",value:function(){if(!this.sent_)throw u.internalError("cannot .getErrorCode() before sending");return this.errorCode_}},{key:"getStatus",value:function(){if(!this.sent_)throw u.internalError("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}},{key:"getResponseText",value:function(){if(!this.sent_)throw u.internalError("cannot .getResponseText() before sending");return this.xhr_.responseText}},{key:"abort",value:function(){this.xhr_.abort()}},{key:"getResponseHeader",value:function(e){return this.xhr_.getResponseHeader(e)}},{key:"addUploadProgressListener",value:function(e){h.isDef(this.xhr_.upload)&&this.xhr_.upload.addEventListener("progress",e)}},{key:"removeUploadProgressListener",value:function(e){h.isDef(this.xhr_.upload)&&this.xhr_.upload.removeEventListener("progress",e)}}]),e}()},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.UploadTask=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(15),u=r(i),s=n(44),l=n(50),c=n(11),f=r(c),d=n(12),h=r(d),p=n(38),v=n(1),_=r(v),y=n(2),b=r(y),m=n(24),k=r(m),g=n(0),R=r(g);t.UploadTask=function(){function e(t,n,r,o,u){var s=this,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;a(this,e),this.transferred_=0,this.needToFetchStatus_=!1,this.needToFetchMetadata_=!1,this.observers_=[],this.error_=null,this.uploadUrl_=null,this.request_=null,this.chunkMultiplier_=1,this.resolve_=null,this.reject_=null,this.ref_=t,this.authWrapper_=n,this.location_=r,this.blob_=u,this.metadata_=l,this.mappings_=o,this.resumable_=this.shouldDoResumable_(this.blob_),this.state_=i.InternalTaskState.RUNNING,this.errorHandler_=function(e){s.request_=null,s.chunkMultiplier_=1,e.codeEquals(_.Code.CANCELED)?(s.needToFetchStatus_=!0,s.completeTransitions_()):(s.error_=e,s.transition_(i.InternalTaskState.ERROR))},this.metadataErrorHandler_=function(e){s.request_=null,e.codeEquals(_.Code.CANCELED)?s.completeTransitions_():(s.error_=e,s.transition_(i.InternalTaskState.ERROR))},this.promise_=b.make(function(e,t){s.resolve_=e,s.reject_=t,s.start_()}),this.promise_.then(null,function(){})}return o(e,[{key:"makeProgressCallback_",value:function(){var e=this,t=this.transferred_;return function(n){e.updateProgress_(t+n)}}},{key:"shouldDoResumable_",value:function(e){return e.size()>262144}},{key:"start_",value:function(){this.state_===i.InternalTaskState.RUNNING&&null===this.request_&&(this.resumable_?null===this.uploadUrl_?this.createResumable_():this.needToFetchStatus_?this.fetchStatus_():this.needToFetchMetadata_?this.fetchMetadata_():this.continueUpload_():this.oneShotUpload_())}},{key:"resolveToken_",value:function(e){var t=this;this.authWrapper_.getAuthToken().then(function(n){switch(t.state_){case i.InternalTaskState.RUNNING:e(n);break;case i.InternalTaskState.CANCELING:t.transition_(i.InternalTaskState.CANCELED);break;case i.InternalTaskState.PAUSING:t.transition_(i.InternalTaskState.PAUSED)}})}},{key:"createResumable_",value:function(){var e=this;this.resolveToken_(function(t){var n=k.createResumableUpload(e.authWrapper_,e.location_,e.mappings_,e.blob_,e.metadata_),r=e.authWrapper_.makeRequest(n,t);e.request_=r,r.getPromise().then(function(t){e.request_=null,e.uploadUrl_=t,e.needToFetchStatus_=!1,e.completeTransitions_()},e.errorHandler_)})}},{key:"fetchStatus_",value:function(){var e=this,t=this.uploadUrl_;this.resolveToken_(function(n){var r=k.getResumableUploadStatus(e.authWrapper_,e.location_,t,e.blob_),a=e.authWrapper_.makeRequest(r,n);e.request_=a,a.getPromise().then(function(t){t=t,e.request_=null,e.updateProgress_(t.current),e.needToFetchStatus_=!1,t.finalized&&(e.needToFetchMetadata_=!0),e.completeTransitions_()},e.errorHandler_)})}},{key:"continueUpload_",value:function(){var e=this,t=k.resumableUploadChunkSize*this.chunkMultiplier_,n=new k.ResumableUploadStatus(this.transferred_,this.blob_.size()),r=this.uploadUrl_;this.resolveToken_(function(a){var o=void 0;try{o=k.continueResumableUpload(e.location_,e.authWrapper_,r,e.blob_,t,e.mappings_,n,e.makeProgressCallback_())}catch(t){return e.error_=t,void e.transition_(i.InternalTaskState.ERROR)}var u=e.authWrapper_.makeRequest(o,a);e.request_=u,u.getPromise().then(function(t){e.increaseMultiplier_(),e.request_=null,e.updateProgress_(t.current),t.finalized?(e.metadata_=t.metadata,e.transition_(i.InternalTaskState.SUCCESS)):e.completeTransitions_()},e.errorHandler_)})}},{key:"increaseMultiplier_",value:function(){k.resumableUploadChunkSize*this.chunkMultiplier_<33554432&&(this.chunkMultiplier_*=2)}},{key:"fetchMetadata_",value:function(){var e=this;this.resolveToken_(function(t){var n=k.getMetadata(e.authWrapper_,e.location_,e.mappings_),r=e.authWrapper_.makeRequest(n,t);e.request_=r,r.getPromise().then(function(t){e.request_=null,e.metadata_=t,e.transition_(i.InternalTaskState.SUCCESS)},e.metadataErrorHandler_)})}},{key:"oneShotUpload_",value:function(){var e=this;this.resolveToken_(function(t){var n=k.multipartUpload(e.authWrapper_,e.location_,e.mappings_,e.blob_,e.metadata_),r=e.authWrapper_.makeRequest(n,t);e.request_=r,r.getPromise().then(function(t){e.request_=null,e.metadata_=t,e.updateProgress_(e.blob_.size()),e.transition_(i.InternalTaskState.SUCCESS)},e.errorHandler_)})}},{key:"updateProgress_",value:function(e){var t=this.transferred_;this.transferred_=e,this.transferred_!==t&&this.notifyObservers_()}},{key:"transition_",value:function(e){if(this.state_!==e)switch(e){case i.InternalTaskState.CANCELING:case i.InternalTaskState.PAUSING:this.state_=e,null!==this.request_&&this.request_.cancel();break;case i.InternalTaskState.RUNNING:var t=this.state_===i.InternalTaskState.PAUSED;this.state_=e,t&&(this.notifyObservers_(),this.start_());break;case i.InternalTaskState.PAUSED:this.state_=e,this.notifyObservers_();break;case i.InternalTaskState.CANCELED:this.error_=_.canceled(),this.state_=e,this.notifyObservers_();break;case i.InternalTaskState.ERROR:case i.InternalTaskState.SUCCESS:this.state_=e,this.notifyObservers_()}}},{key:"completeTransitions_",value:function(){switch(this.state_){case i.InternalTaskState.PAUSING:this.transition_(i.InternalTaskState.PAUSED);break;case i.InternalTaskState.CANCELING:this.transition_(i.InternalTaskState.CANCELED);break;case i.InternalTaskState.RUNNING:this.start_()}}},{key:"on",value:function(e){function t(e){try{return void l(e)}catch(e){}try{c(e);if(!(R.isJustDef(e.next)||R.isJustDef(e.error)||R.isJustDef(e.complete)))throw""}catch(e){throw u}}function n(e){return function(t,n){null!==e&&f.validate("on",e,arguments);var r=new s.Observer(t,n,o);return h.addObserver_(r),function(){h.removeObserver_(r)}}}var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,u="Expected a function or an Object with one of `next`, `error`, `complete` properties.",l=f.nullFunctionSpec(!0).validator,c=f.looseObjectSpec(null,!0).validator,d=[f.stringSpec(function(){if(e!==i.TaskEvent.STATE_CHANGED)throw"Expected one of the event types: ["+i.TaskEvent.STATE_CHANGED+"]."}),f.looseObjectSpec(t,!0),f.nullFunctionSpec(!0),f.nullFunctionSpec(!0)];f.validate("on",d,arguments);var h=this,p=[f.looseObjectSpec(function(e){if(null===e)throw u;t(e)}),f.nullFunctionSpec(!0),f.nullFunctionSpec(!0)];return R.isJustDef(r)||R.isJustDef(a)||R.isJustDef(o)?n(null)(r,a,o):n(p)}},{key:"then",value:function(e,t){return this.promise_.then(e,t)}},{key:"catch",value:function(e){return this.then(null,e)}},{key:"addObserver_",value:function(e){this.observers_.push(e),this.notifyObserver_(e)}},{key:"removeObserver_",value:function(e){h.remove(this.observers_,e)}},{key:"notifyObservers_",value:function(){var e=this;this.finishPromise_(),h.clone(this.observers_).forEach(function(t){e.notifyObserver_(t)})}},{key:"finishPromise_",value:function(){if(null!==this.resolve_){var e=!0;switch(u.taskStateFromInternalTaskState(this.state_)){case i.TaskState.SUCCESS:(0,p.async)(this.resolve_.bind(null,this.snapshot))();break;case i.TaskState.CANCELED:case i.TaskState.ERROR:var t=this.reject_;(0,p.async)(t.bind(null,this.error_))();break;default:e=!1}e&&(this.resolve_=null,this.reject_=null)}}},{key:"notifyObserver_",value:function(e){switch(u.taskStateFromInternalTaskState(this.state_)){case i.TaskState.RUNNING:case i.TaskState.PAUSED:null!==e.next&&(0,p.async)(e.next.bind(e,this.snapshot))();break;case i.TaskState.SUCCESS:null!==e.complete&&(0,p.async)(e.complete.bind(e))();break;case i.TaskState.CANCELED:case i.TaskState.ERROR:null!==e.error&&(0,p.async)(e.error.bind(e,this.error_))();break;default:null!==e.error&&(0,p.async)(e.error.bind(e,this.error_))()}}},{key:"resume",value:function(){f.validate("resume",[],arguments);var e=this.state_===i.InternalTaskState.PAUSED||this.state_===i.InternalTaskState.PAUSING;return e&&this.transition_(i.InternalTaskState.RUNNING),e}},{key:"pause",value:function(){f.validate("pause",[],arguments);var e=this.state_===i.InternalTaskState.RUNNING;return e&&this.transition_(i.InternalTaskState.PAUSING),e}},{key:"cancel",value:function(){f.validate("cancel",[],arguments);var e=this.state_===i.InternalTaskState.RUNNING||this.state_===i.InternalTaskState.PAUSING;return e&&this.transition_(i.InternalTaskState.CANCELING),e}},{key:"snapshot",get:function(){var e=u.taskStateFromInternalTaskState(this.state_);return new l.UploadTaskSnapshot(this.transferred_,this.blob_.size(),e,this.metadata_,this,this.ref_)}}]),e}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.UploadTaskSnapshot=function(){function e(t,n,a,o,i,u){r(this,e),this.bytesTransferred=t,this.totalBytes=n,this.state=a,this.metadata=o,this.task=i,this.ref=u}return a(e,[{key:"downloadURL",get:function(){if(null!==this.metadata){var e=this.metadata.downloadURLs;return null!=e&&null!=e[0]?e[0]:null}return null}}]),e}()}],[37])}catch(e){throw new Error("Cannot instantiate firebase-storage.js - be sure to load firebase-app.js first.")}
  //# sourceMappingURL=firebase-storage.js.map
  