PageSourceSearch

https://gsxone.ai/assets/firebase-storage-C3_x6E22.js

js gsxone.ai collected 2026-10-05 13:09:12 UTC 15,508 bytes, 134 lines download raw bytes

1import{_ as e,C as t,r as s,S as n,c as r,F as o,d as i,l as a,y as c,n as l,k as u,p as h,u as _,z as p}from"./firebase-core-IgwuAbwy.js";
2/**
3 * @license
4 * Copyright 2017 Google LLC
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */const d="firebasestorage.googleapis.com";
18/**
19 * @license
20 * Copyright 2017 Google LLC
21 *
22 * Licensed under the Apache License, Version 2.0 (the "License");
23 * you may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at
25 *
26 *   http://www.apache.org/licenses/LICENSE-2.0
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 */
34class m extends o{constructor(e,t,s=0){super(E(e),`Firebase Storage: ${t} (${E(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,m.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return E(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var g,f,R,k;function E(e){return"storage/"+e}function T(e){return new m(g.INVALID_ARGUMENT,e)}function I(){return new m(g.APP_DELETED,"The Firebase app was deleted.")}(f=g||(g={})).UNKNOWN="unknown",f.OBJECT_NOT_FOUND="object-not-found",f.BUCKET_NOT_FOUND="bucket-not-found",f.PROJECT_NOT_FOUND="project-not-found",f.QUOTA_EXCEEDED="quota-exceeded",f.UNAUTHENTICATED="unauthenticated",f.UNAUTHORIZED="unauthorized",f.UNAUTHORIZED_APP="unauthorized-app",f.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",f.INVALID_CHECKSUM="invalid-checksum",f.CANCELED="canceled",f.INVALID_EVENT_NAME="invalid-event-name",f.INVALID_URL="invalid-url",f.INVALID_DEFAULT_BUCKET="invalid-default-bucket",f.NO_DEFAULT_BUCKET="no-default-bucket",f.CANNOT_SLICE_BLOB="cannot-slice-blob",f.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",f.NO_DOWNLOAD_URL="no-download-url",f.INVALID_ARGUMENT="invalid-argument",f.INVALID_ARGUMENT_COUNT="invalid-argument-count",f.APP_DELETED="app-deleted",f.INVALID_ROOT_OPERATION="invalid-root-operation",f.INVALID_FORMAT="invalid-format",f.INTERNAL_ERROR="internal-error",f.UNSUPPORTED_ENVIRONMENT="unsupported-environment";
35/**
36 * @license
37 * Copyright 2017 Google LLC
38 *
39 * Licensed under the Apache License, Version 2.0 (the "License");
40 * you may not use this file except in compliance with the License.
41 * You may obtain a copy of the License at
42 *
43 *   http://www.apache.org/licenses/LICENSE-2.0
44 *
45 * Unless required by applicable law or agreed to in writing, software
46 * distributed under the License is distributed on an "AS IS" BASIS,
47 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48 * See the License for the specific language governing permissions and
49 * limitations under the License.
50 */
51class b{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let s;try{s=b.makeFromUrl(e,t)}catch(r){return new b(e,"")}if(""===s.path)return s;throw n=e,new m(g.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+n+"'.");var n}static makeFromUrl(e,t){let s=null;const n="([A-Za-z0-9.\\-_]+)";const r=new RegExp("^gs://"+n+"(/(.*))?$","i");function o(e){e.path_=decodeURIComponent(e.path)}
51const i=t.replace(/[.]/g,"\\."),a=[{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:new RegExp(`^https?://${i}/v[A-Za-z0-9_]+/b/${n}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:o},{regex:new RegExp(`^https?://${t===d?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${n}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:o}];for(let c=0;c<a.length;c++){const t=a[c],n=t.regex.exec(e);if(n){const e=n[t.indices.bucket];let r=n[t.indices.path];r||(r=""),s=new b(e,r),t.postModify(s);break}}if(null==s)throw function(e){return new m(g.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return s}}class O{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}
52/**
53 * @license
54 * Copyright 2017 Google LLC
55 *
56 * Licensed under the Apache License, Version 2.0 (the "License");
57 * you may not use this file except in compliance with the License.
58 * You may obtain a copy of the License at
59 *
60 *   http://www.apache.org/licenses/LICENSE-2.0
61 *
62 * Unless required by applicable law or agreed to in writing, software
63 * distributed under the License is distributed on an "AS IS" BASIS,
64 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
65 * See the License for the specific language governing permissions and
66 * limitations under the License.
67 */function N(e,t,s,n){if(n<t)throw T(`Invalid value for '${e}'. Expected ${t} or greater.`);if(n>s)throw T(`Invalid value for '${e}'. Expected ${s} or less.`)}(k=R||(R={}))[k.NO_ERROR=0]="NO_ERROR",k[k.NETWORK_ERROR=1]="NETWORK_ERROR",k[k.ABORT=2]="ABORT";
68/**
69 * @license
70 * Copyright 2017 Google LLC
71 *
72 * Licensed under the Apache License, Version 2.0 (the "License");
73 * you may not use this file except in compliance with the License.
74 * You may obtain a copy of the License at
75 *
76 *   http://www.apache.org/licenses/LICENSE-2.0
77 *
78 * Unless required by applicable law or agreed to in writing, software
79 * distributed under the License is distributed on an "AS IS" BASIS,
80 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81 * See the License for the specific language governing permissions and
82 * limitations under the License.
83 */
84class C{constructor(e,t,s,n,r,o,i,a,c,l,u,h=!0,_=!1){this.url_=e,this.method_=t,this.headers_=s,this.body_=n,this.successCodes_=r,this.additionalRetryCodes_=o,this.callback_=i,this.errorCallback_=a,this.timeout_=c,this.progressCallback_=l,this.connectionFactory_=u,this.retry=h,this.isUsingEmulator=_,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{if(t)return void e(!1,new v(!1,null,!0));const s=this.connectionFactory_();this.pendingConnection_=s;const n=e=>{const t=e.loaded,s=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,s)};null!==this.progressCallback_&&s.addUploadProgressListener(n),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&s.removeUploadProgressListener(n),this.pendingConnection_=null;const t=s.getErrorCode()===R.NO_ERROR,r=s.getStatus();if(!t||
85/**
86 * @license
87 * Copyright 2022 Google LLC
88 *
89 * Licensed under the Apache License, Version 2.0 (the "License");
90 * you may not use this file except in compliance with the License.
91 * You may obtain a copy of the License at
92 *
93 *   http://www.apache.org/licenses/LICENSE-2.0
94 *
95 * Unless required by applicable law or agreed to in writing, software
96 * distributed under the License is distributed on an "AS IS" BASIS,
97 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
98 * See the License for the specific language governing permissions and
99 * limitations under the License.
100 */
101function(e,t){const s=e>=500&&e<600,n=-1!==[408,429].indexOf(e),r=-1!==t.indexOf(e);return s||n||r}(r,this.additionalRetryCodes_)&&this.retry){const t=s.getErrorCode()===R.ABORT;return void e(!1,new v(!1,null,t))}const o=-1!==this.successCodes_.indexOf(r);e(!0,new v(o,s))})},t=(e,t)=>{const s=this.resolve_,n=this.reject_,r=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(r,r.getResponse());void 0!==e?s(e):s()}catch(o){n(o)}else if(null!==r){const e=new m(g.UNKNOWN,"An unknown error occurred, please check the error payload for server response.");e.serverResponse=r.getErrorText(),this.errorCallback_?n(this.errorCallback_(r,e)):n(e)}else if(t.canceled){n(this.appDelete_?I():new m(g.CANCELED,"User canceled the upload/download."))}else{n(new m(g.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again."))}};this.canceled_?t(0,new v(!1,null,!0)):this.backoffId_=function(e,t,s){let n=1,r=null,o=null,i=!1,a=0;function c(){return 2===a}let l=!1;function u(...e){l||(l=!0,t.apply(null,e))}function h(t){r=setTimeout(()=>{r=null,e(p,c())},t)}function _(){o&&clearTimeout(o)}function p(e,...t){if(l)return void _();if(e)return _(),void u.call(null,e,...t);if(c()||i)return _(),void u.call(null,e,...t);let s;n<64&&(n*=2),1===a?(a=2,s=0):s=1e3*(n+Math.random()),h(s)}let d=!1;function m(e){d||(d=!0,_(),l||(null!==r?(e||(a=2),clearTimeout(r),h(0)):e||(a=1)))}return h(0),o=setTimeout(()=>{i=!0,m(!0)},s),m}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class v{constructor(e,t,s){this.wasSuccessCode=e,this.connection=t,this.canceled=!!s}}function U(e,t,s,n,r,o,i=!0,a=!1){const c=function(e){const t=encodeURIComponent;let s="?";for(const n in e)e.hasOwnProperty(n)&&(s=s+(t(n)+"=")+t(e[n])+"&");return s=s.slice(0,-1),s}
101(e.urlParams),l=e.url+c,u=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(u,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(u,s),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!=t?t:"AppManager")}(u,o),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(u,n),new C(l,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,r,i,a)}
102/**
103 * @license
104 * Copyright 2017 Google LLC
105 *
106 * Licensed under the Apache License, Version 2.0 (the "License");
107 * you may not use this file except in compliance with the License.
108 * You may obtain a copy of the License at
109 *
110 *   http://www.apache.org/licenses/LICENSE-2.0
111 *
112 * Unless required by applicable law or agreed to in writing, software
113 * distributed under the License is distributed on an "AS IS" BASIS,
114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
115 * See the License for the specific language governing permissions and
116 * limitations under the License.
117 */
118/**
119 * @license
120 * Copyright 2019 Google LLC
121 *
122 * Licensed under the Apache License, Version 2.0 (the "License");
123 * you may not use this file except in compliance with the License.
124 * You may obtain a copy of the License at
125 *
126 *   http://www.apache.org/licenses/LICENSE-2.0
127 *
128 * Unless required by applicable law or agreed to in writing, software
129 * distributed under the License is distributed on an "AS IS" BASIS,
130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131 * See the License for the specific language governing permissions and
132 * limitations under the License.
133 */
134class A{constructor(e,t){this._service=e,this._location=t instanceof b?t:b.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new A(e,t)}get root(){const e=new b(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return function(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new b(this._location.bucket,e);return new A(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new m(g.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').")}(e)}}function w(e,t){const s=null==t?void 0:t.storageBucket;return null==s?null:b.makeFromBucketSpec(s,e)}class D{constructor(e,t,s,n,r,o=!1){this.app=e,this._authProvider=t,this._appCheckProvider=s,this._url=n,this._firebaseVersion=r,this._isUsingEmulator=o,this._bucket=null,this._host=d,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=n?b.makeFromBucketSpec(n,this._host):w(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=b.makeFromBucketSpec(this._url,e):this._bucket=w(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){N("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){N("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if(r(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEac
134h(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new A(this,e)}_makeRequest(e,t,s,n,r=!0){if(this._deleted)return new O(I());{const o=U(e,this._appId,s,n,t,this._firebaseVersion,r,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,t){const[s,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,s,n).getPromise()}}const y="@firebase/storage",P="0.13.14",L="storage";function x(e=l(),t){e=i(e);const s=a(e,L).getImmediate({identifier:t}),n=c("storage");return n&&function(e,t,s,n={}){!function(e,t,s,n={}){e.host=`${t}:${s}`;const r=u(t);r&&(h(`https://${e.host}/b`),_("Storage",!0)),e._isUsingEmulator=!0,e._protocol=r?"https":"http";const{mockUserToken:o}=n;o&&(e._overrideAuthToken="string"==typeof o?o:p(o,e.app.options.projectId))}(e,t,s,n)}(s,...n),s}function F(e,{instanceIdentifier:t}){const s=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return new D(s,r,o,t,n)}e(new t(L,F,"PUBLIC").setMultipleInstances(!0)),s(y,P,""),s(y,P,"esm2017");export{x as g};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.