@cloudbase/js-sdk 3.6.2 → 3.6.3
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/CHANGELOG.md +6 -0
- package/ai/dist/index.esm.js +1 -1
- package/ai/dist/index.esm.js.map +1 -1
- package/ai/dist/index.js +1 -1
- package/ai/dist/index.js.map +1 -1
- package/app/dist/index.esm.js +1 -1
- package/app/dist/index.esm.js.map +1 -1
- package/app/dist/index.js +1 -1
- package/app/dist/index.js.map +1 -1
- package/app/dist/index.node.esm.js +1 -1
- package/app/dist/index.node.esm.js.map +1 -1
- package/app/dist/index.node.js +1 -1
- package/app/dist/index.node.js.map +1 -1
- package/auth/dist/index.esm.js +1 -1
- package/auth/dist/index.esm.js.map +1 -1
- package/auth/dist/index.js +1 -1
- package/auth/dist/index.js.map +1 -1
- package/core.d.ts +4331 -0
- package/core.node.d.ts +294 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +1 -1
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm.js +1 -1
- package/dist/index.node.esm.js.map +1 -1
- package/index.d.ts +5 -4268
- package/index.node.d.ts +13 -0
- package/miniprogram_dist/ai/index.d.ts +42 -0
- package/miniprogram_dist/ai/index.js +2 -0
- package/miniprogram_dist/apis/index.d.ts +5 -0
- package/miniprogram_dist/{apis.js → apis/index.js} +1 -1
- package/miniprogram_dist/app/index.d.ts +67 -0
- package/miniprogram_dist/app/index.js +2 -0
- package/miniprogram_dist/auth/index.d.ts +284 -0
- package/miniprogram_dist/auth/index.js +2 -0
- package/miniprogram_dist/cloudrun/index.d.ts +4 -0
- package/miniprogram_dist/cloudrun/index.js +1 -0
- package/miniprogram_dist/container/index.d.ts +13 -0
- package/miniprogram_dist/container/index.js +1 -0
- package/miniprogram_dist/database/index.d.ts +3 -0
- package/miniprogram_dist/functions/index.d.ts +2 -0
- package/miniprogram_dist/functions/index.js +1 -0
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/model/index.d.ts +5 -0
- package/miniprogram_dist/model/index.js +1 -0
- package/miniprogram_dist/mysql/index.d.ts +3 -0
- package/miniprogram_dist/mysql/index.js +1 -0
- package/miniprogram_dist/oauth/index.d.ts +22 -0
- package/miniprogram_dist/oauth/index.js +2 -0
- package/miniprogram_dist/realtime/index.d.ts +2 -0
- package/miniprogram_dist/realtime/index.js +1 -0
- package/miniprogram_dist/storage/index.d.ts +13 -0
- package/miniprogram_dist/{storage.js → storage/index.js} +1 -1
- package/oauth/dist/index.esm.js +1 -1
- package/oauth/dist/index.esm.js.map +1 -1
- package/oauth/dist/index.js +1 -1
- package/oauth/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/types/package.json +1 -1
- package/utilities/package.json +2 -2
- package/dist/index.d.ts +0 -9
- package/miniprogram_dist/ai.js +0 -2
- package/miniprogram_dist/app.js +0 -2
- package/miniprogram_dist/auth.js +0 -2
- package/miniprogram_dist/cloudrun.js +0 -1
- package/miniprogram_dist/container.js +0 -1
- package/miniprogram_dist/functions.js +0 -1
- package/miniprogram_dist/model.js +0 -1
- package/miniprogram_dist/mysql.js +0 -1
- package/miniprogram_dist/oauth.js +0 -2
- package/miniprogram_dist/realtime.js +0 -1
- /package/miniprogram_dist/{database.js → database/index.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_storage",[],e):"object"==typeof exports?exports.cloudbase_storage=e():t.cloudbase_storage=e()}("undefined"!=typeof window?window:this,()=>(()=>{var t={829:(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{AbstractSDKRequest:()=>o,AbstractStorage:()=>i,StorageType:()=>n,formatUrl:()=>a}),function(t){t.local="local",t.none="none",t.session="session"}(n||(n={}));var o=function(){},i=function(){};function a(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var i in r)""===o?!n&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}},891:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseStorage=e.COMPONENT_NAME=e.EUploadMethod=void 0;var c,u=r(877),l=r(90),d=r(388);!function(t){t.put="put",t.post="post"}(c=e.EUploadMethod||(e.EUploadMethod={}));var f=u.constants.getSdkName,h=u.constants.ERRORS,p=u.constants.COMMUNITY_SITE_URL,v=u.utils.isArray,y=u.utils.isString,g=u.utils.isPalinObject,m=u.utils.execCallback,b=u.helpers.catchErrorsDecorator;e.COMPONENT_NAME="storage";var w=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i,a;return s(this,function(s){switch(s.label){case 0:return[4,t.gateWay({path:"storages",name:"get-objects-upload-info",data:[n({objectId:e.path},e.signedHeader?{signedHeader:e.signedHeader}:{})]},r)];case 1:return o=s.sent(),i=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,n(n({},o),{data:n(n({},i.code?n({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}})})},O=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i;return s(this,function(a){switch(a.label){case 0:return[4,t.gateWay({path:"storages",name:"get-objects-download-info",data:e.convertedFileList.map(function(t){return{cloudObjectId:t.fileid}})},r)];case 1:return o=a.sent(),[2,n(n({},o),{data:{download_list:null===(i=o.data)||void 0===i?void 0:i.map(function(t){return{code:t.code||"SUCCESS",message:t.message,fileid:t.cloudObjectId,download_url:t.downloadUrl,fileID:t.cloudObjectId,tempFileURL:t.downloadUrl}})}})]}})})},_=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i;return s(this,function(a){switch(a.label){case 0:return[4,t.gateWay({path:"storages",name:"delete-objects",data:e.fileList.map(function(t){return{cloudObjectId:t}})},r)];case 1:return o=a.sent(),[2,n(n({},o),{data:{delete_list:null===(i=o.data)||void 0===i?void 0:i.map(function(t){return{code:t.code||"SUCCESS",fileID:t.cloudObjectId,message:t.message}})}})]}})})},S=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i;return s(this,function(a){switch(a.label){case 0:return[4,t.gateWay({path:"storages",name:"copy-objects",data:e.convertedFileList.map(function(t){return{srcPath:t.src_path,dstPath:t.dst_path,overwrite:t.overwrite,removeOriginal:t.remove_original}})},r)];case 1:return o=a.sent(),[2,n(n({},o),{data:{copy_list:null===(i=o.data)||void 0===i?void 0:i.map(function(t){return{code:t.code||"SUCCESS",fileID:t.cloudObjectId,message:t.message}})}})]}})})},E={txt:"text/plain",json:"application/json",html:"text/html",htm:"text/html",css:"text/css",js:"application/javascript",csv:"text/csv",xml:"application/xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",pdf:"application/pdf",zip:"application/zip",gz:"application/gzip",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav"};function P(t,e){if("undefined"!=typeof Blob&&t instanceof Blob&&t.type)return t.type;var r=/\.([a-zA-Z0-9]+)$/.exec(e||""),n=r?r[1].toLowerCase():"";return E[n]||"application/octet-stream"}function I(t,e){var r=e.toLowerCase();return Object.keys(t).some(function(t){return t.toLowerCase()===r})}function j(t){return Object.keys(t).reduce(function(e,r){var o;return n(n({},e),((o={})[r]=[t[r]],o))},{})}e.CloudbaseStorage=function(){function t(t){this.context=t}var r,u,E,N,C,x,T,A,R,U,k,L,F,M,D,B;return Object.defineProperty(t.prototype,"config",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.request},enumerable:!1,configurable:!0}),t.prototype.isGateWay=function(){return"GATEWAY"===(this.config.endPointMode||"CLOUD_API")},t.prototype.uploadFile=function(t,r){return a(this,void 0,Promise,function(){var o,i,a,u,d,p,v,g,b,w,O,_,S,E,N,C,x,T,A,R,U,k,L,F,M,D,B,q,G,W,V;return s(this,function(s){switch(s.label){case 0:if(o=t.cloudPath,i=t.filePath,a=t.onUploadProgress,G=t.method,u=void 0===G?"put":G,W=t.headers,d=void 0===W?{}:W,p=t.fileContent,!y(o)||!i&&!p)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".uploadFile] invalid params")}));return v={put:c.put,post:c.post}[u.toLocaleLowerCase()]||c.put,g=this.isGateWay(),b=n({},d),w=Object.keys(d).reduce(function(t,e){return"content-length"!==e.toLowerCase()&&(t[e]=d[e]),t},{}),v===c.put&&g&&(I(b,"content-length")||(O=function(t,e){var r=null!=t?t:e;if(null!==r){if("undefined"!=typeof Blob&&r instanceof Blob)return r.size;if("undefined"!=typeof ArrayBuffer){if(r instanceof ArrayBuffer)return r.byteLength;if("function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(r))return r.byteLength}if("string"==typeof r){if("undefined"!=typeof Blob)return new Blob([r]).size;var n=(0,l.getStringByteLength)(r);return"number"==typeof n?n:r.length}return"object"==typeof r&&"number"==typeof r.size?r.size:void 0}}(i,p),"number"==typeof O&&(b["content-length"]=String(O))),I(b,"content-type")||(b["content-type"]=P(i,o)),I(w,"content-type")||(w["content-type"]=P(i,o))),[4,this.getUploadMetadata({cloudPath:o,method:v,headers:v!==c.put||g?void 0:w,signedHeader:v===c.put&&g?j(b):void 0,customReqOpts:t.customReqOpts})];case 1:return _=s.sent(),S=_.data,E=_.requestId,(null==(N=S)?void 0:N.code)||!(null==N?void 0:N.url)?(C=(null==N?void 0:N.code)||h.OPERATION_FAIL,x=(null==N?void 0:N.message)||"get upload info failed",[2,m(r,new Error("[".concat(f(),"][").concat(C,"][").concat(e.COMPONENT_NAME,"]:").concat(x)))]):(T=S.url,A=S.authorization,R=S.token,U=S.fileId,k=S.cosFileId,L=S.download_url,M=n(n({},F={url:T,file:i,name:o,onUploadProgress:a,fileContent:p,fileId:U,requestId:E}),{method:c.put,headers:n(n({},w),{authorization:A,"x-cos-meta-fileid":k,"x-cos-security-token":R})}),D=n(n({},F),{method:c.post,data:{key:o,signature:A,"x-cos-meta-fileid":k,success_action_status:"201","x-cos-security-token":R}}),(V={})[c.put]={params:M,isSuccess:function(t){return t>=200&&t<300}},V[c.post]={params:D,isSuccess:function(t){return 201===t}},B=V,[4,this.request.upload(B[v].params)]);case 2:return q=s.sent(),B[v].isSuccess(q.statusCode)?[2,m(r,null,{fileID:U,download_url:L,requestId:E})]:[2,m(r,new Error("[".concat(f(),"][").concat(h.OPERATION_FAIL,"][").concat(e.COMPONENT_NAME,"]:").concat(q.data)))]}})})},t.prototype.getUploadMetadata=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,u,l,d,f,p,v;return s(this,function(s){switch(s.label){case 0:if(n=t.cloudPath,o=t.method,i=t.headers,a=t.signedHeader,!y(n))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getUploadMetadata] invalid cloudPath")}));u=this.request,l="storage.getUploadMetadata",s.label=1;case 1:return s.trys.push([1,6,,7]),d=void 0,f={path:n},p=this.isGateWay(),o&&(f.method=o),o===c.put&&(p&&a?f.signedHeader=a:!p&&i&&(f.headers=i)),p?[4,w(u,f,t.customReqOpts)]:[3,3];case 2:return d=s.sent(),[3,5];case 3:return[4,u.send(l,f,t.customReqOpts)];case 4:d=s.sent(),s.label=5;case 5:return[2,m(r,null,d)];case 6:return v=s.sent(),[2,m(r,v)];case 7:return[2]}})})},t.prototype.deleteFile=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u,l,d;return s(this,function(s){switch(s.label){case 0:if(!(n=t.fileList)||!v(n)||0===n.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".deleteFile] fileList must not be empty")}));for(o=0,i=n;o<i.length;o++)if(!(a=i[o])||!y(a))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".deleteFile] fileID must be string")}));return c="storage.batchDeleteFile",u=this.request,l={},this.isGateWay()?[4,_(u,{fileList:n},t.customReqOpts)]:[3,2];case 1:return l=s.sent(),[3,4];case 2:return[4,u.send(c,{fileid_list:n},t.customReqOpts)];case 3:l=s.sent(),s.label=4;case 4:return l.code?[2,m(r,null,l)]:(d={fileList:l.data.delete_list,requestId:l.requestId},[2,m(r,null,d)])}})})},t.prototype.getTempFileURL=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u,l,d;return s(this,function(s){switch(s.label){case 0:if(!(n=t.fileList)||!v(n)||0===n.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] fileList must not be empty")}));for(o=[],i=0,a=n;i<a.length;i++)if(c=a[i],g(c)){if(!Object.prototype.hasOwnProperty.call(c,"fileID"))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] file info must include fileID")}));o.push({fileid:c.fileID,max_age:c.maxAge||7200})}else{if(!y(c))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] invalid fileList")}));o.push({fileid:c})}return u="storage.batchGetDownloadUrl",l=this.request,d={},this.isGateWay()?[4,O(l,{convertedFileList:o},t.customReqOpts)]:[3,2];case 1:return d=s.sent(),[3,4];case 2:return[4,l.send(u,{file_list:o},t.customReqOpts)];case 3:d=s.sent(),s.label=4;case 4:return d.code?[2,m(r,null,d)]:[2,m(r,null,{fileList:d.data.download_list,requestId:d.requestId})]}})})},t.prototype.downloadFile=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u;return s(this,function(s){switch(s.label){case 0:if(n=t.fileID,!y(n))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:t.customReqOpts})];case 1:return o=s.sent(),"SUCCESS"!==(i=o.fileList[0]).code?[2,m(r,i)]:(a=this.request,c=encodeURI(i.download_url),[4,a.download({url:c,tempFilePath:t.tempFilePath})]);case 2:return u=s.sent(),[2,m(r,null,u)]}})})},t.prototype.copyFile=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u,l,d,f;return s(this,function(s){switch(s.label){case 0:if(!(n=t.fileList)||!v(n)||0===n.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".copyFile] fileList must not be empty")}));for(o=[],i=0,a=n;i<a.length;i++){if(c=a[i],u=c.srcPath,l=c.dstPath,!u||!l||"string"!=typeof u||"string"!=typeof l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".copyFile] srcPath and dstPath may not be empty")}));if(u===l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".copyFile] srcPath and dstPath can not be the same")}));o.push({src_path:u,dst_path:l,overwrite:c.overwrite,remove_original:c.removeOriginal})}return d=this.request,f={},this.isGateWay()?[4,S(d,{convertedFileList:o},t.customReqOpts)]:[3,2];case 1:return f=s.sent(),[3,4];case 2:return[4,d.send("storage.batchCopyFile",{file_list:o},t.customReqOpts)];case 3:f=s.sent(),s.label=4;case 4:return f.code?[2,m(r,null,f)]:[2,m(r,null,{fileList:f.data.copy_list,requestId:f.requestId})]}})})},t.prototype.getFileInfo=function(t){var e;return a(this,void 0,Promise,function(){var r,n=this;return s(this,function(o){switch(o.label){case 0:return[4,this.getTempFileURL(t)];case 1:return(null==(r=o.sent())?void 0:r.fileList)&&(null===(e=null==r?void 0:r.fileList)||void 0===e?void 0:e.length)>0?[4,Promise.all(r.fileList.map(function(t){return a(n,void 0,void 0,function(){var e,r,n,o,i,a,c;return s(this,function(s){switch(s.label){case 0:if("SUCCESS"!==t.code)return[2,{code:t.code,fileID:t.fileID,tempFileURL:t.tempFileURL,message:t.message}];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request.fetch({url:t.tempFileURL,method:"HEAD"})];case 2:return e=s.sent(),r=e.header,"undefined"!=typeof Headers&&r instanceof Headers&&(n={},r.forEach(function(t,e){n[e]=t}),r=n),o=parseInt(r["content-length"])||0,i=r["content-type"]||"",[400,404].includes(Number(e.statusCode))?[2,{code:"FILE_NOT_FOUND",fileID:t.fileID,tempFileURL:t.tempFileURL,message:"file not found"}]:[2,{code:t.code,fileID:t.fileID,tempFileURL:t.tempFileURL,cloudId:t.fileID,fileName:t.fileID.split("/").pop(),contentType:i,mime:i.split(";")[0].trim(),size:o,etag:r.etag||"",lastModified:r["last-modified"]||"",cacheControl:r["cache-control"]||""}];case 3:return a=s.sent(),c="object"==typeof a&&null!==a&&"message"in a?String(a.message):void 0,[2,{code:"FETCH_FILE_INFO_ERROR",fileID:t.fileID,tempFileURL:t.tempFileURL,message:c}];case 4:return[2]}})})}))]:[3,3];case 2:return[2,{fileList:o.sent(),requestId:r.requestId}];case 3:return[2,{fileList:[],requestId:r.requestId}]}})})},o([b({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),i("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],t.prototype,"uploadFile",null),o([b({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(E="undefined"!=typeof Function&&Function)?E:Object]),i("design:returntype","function"==typeof(N="undefined"!=typeof Promise&&Promise)?N:Object)],t.prototype,"getUploadMetadata",null),o([b({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(C=void 0!==d.ICloudbaseDeleteFileParams&&d.ICloudbaseDeleteFileParams)?C:Object,"function"==typeof(x="undefined"!=typeof Function&&Function)?x:Object]),i("design:returntype","function"==typeof(T="undefined"!=typeof Promise&&Promise)?T:Object)],t.prototype,"deleteFile",null),o([b({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(A=void 0!==d.ICloudbaseGetTempFileURLParams&&d.ICloudbaseGetTempFileURLParams)?A:Object,"function"==typeof(R="undefined"!=typeof Function&&Function)?R:Object]),i("design:returntype","function"==typeof(U="undefined"!=typeof Promise&&Promise)?U:Object)],t.prototype,"getTempFileURL",null),o([b({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(k=void 0!==d.ICloudbaseDownloadFileParams&&d.ICloudbaseDownloadFileParams)?k:Object,"function"==typeof(L="undefined"!=typeof Function&&Function)?L:Object]),i("design:returntype","function"==typeof(F="undefined"!=typeof Promise&&Promise)?F:Object)],t.prototype,"downloadFile",null),o([b({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(M=void 0!==d.ICloudbaseCopyFileParams&&d.ICloudbaseCopyFileParams)?M:Object,"function"==typeof(D="undefined"!=typeof Function&&Function)?D:Object]),i("design:returntype","function"==typeof(B="undefined"!=typeof Promise&&Promise)?B:Object)],t.prototype,"copyFile",null),t}()},656:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadBuilder=e.StreamDownloadBuilder=void 0;var a=r(957),s=r(90);function c(t){return(0,a.isStorageError)(t)?t:new a.StorageError((null==t?void 0:t.message)||String(t))}function u(t){var e={};return void 0!==(null==t?void 0:t.download)&&(e.download=!0===t.download?"":t.download),void 0!==(null==t?void 0:t.cacheNonce)&&(e.cacheNonce=String(t.cacheNonce)),{headers:{},query:e}}var l=function(){function t(t){this.ctx=t}return t.prototype.then=function(t,e){return this.execute().then(t,e)},t.prototype.execute=function(){var t,e;return o(this,void 0,Promise,function(){var r,o,l,d,f;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=u(this.ctx.options),o=r.headers,l=r.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:n(n({},this.ctx.headers),o),query:l,signal:null===(t=this.ctx.parameters)||void 0===t?void 0:t.signal,cache:null===(e=this.ctx.parameters)||void 0===e?void 0:e.cache})];case 1:if(!(d=i.sent().response).body)throw new a.StorageApiError("Response body is empty",d.status,"STORAGE_PG_EMPTY_BODY");return[2,{data:d.body,error:null}];case 2:if(f=i.sent(),this.ctx.shouldThrowOnError)throw f;return[2,{data:null,error:c(f)}];case 3:return[2]}})})},t}();e.StreamDownloadBuilder=l;var d=function(){function t(t){this.ctx=t}return t.prototype.asStream=function(){return new l(this.ctx)},t.prototype.then=function(t,e){return this.execute().then(t,e)},t.prototype.execute=function(){var t,e;return o(this,void 0,Promise,function(){var r,o,a,l,d,f;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),r=u(this.ctx.options),o=r.headers,a=r.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:n(n({},this.ctx.headers),o),query:a,signal:null===(t=this.ctx.parameters)||void 0===t?void 0:t.signal,cache:null===(e=this.ctx.parameters)||void 0===e?void 0:e.cache})];case 1:return l=i.sent().response,f={},[4,l.blob()];case 2:return[2,(f.data=i.sent(),f.error=null,f)];case 3:if(d=i.sent(),this.ctx.shouldThrowOnError)throw d;return[2,{data:null,error:c(d)}];case 4:return[2]}})})},t}();e.DownloadBuilder=d},90:(t,e)=>{"use strict";function r(){return globalThis.Buffer}Object.defineProperty(e,"__esModule",{value:!0}),e.encodeObjectName=e.toBase64=e.getStringByteLength=void 0,e.getStringByteLength=function(t){var e;return null===(e=r())||void 0===e?void 0:e.byteLength(t)},e.toBase64=function(t){var e=r();return e?e.from(t).toString("base64"):btoa(t)},e.encodeObjectName=function(t){return t.split("/").map(function(t){return encodeURIComponent(t)}).join("/")}},98:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Http=e.handleOperation=void 0;var a=r(957),s="/v1/storages";e.handleOperation=function(t,e){return o(this,void 0,Promise,function(){var r;return i(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,{data:n.sent(),error:null}];case 2:if(r=n.sent(),e)throw r;return(0,a.isStorageError)(r)?[2,{data:null,error:r}]:[2,{data:null,error:new a.StorageError((null==r?void 0:r.message)||String(r))}];case 3:return[2]}})})};var c=function(){function t(t){this.ctx=t}return Object.defineProperty(t.prototype,"request",{get:function(){return this.ctx.request},enumerable:!1,configurable:!0}),t.prototype.gatewayOrigin=function(){return this.request.getBaseEndPoint("GATEWAY")},t.prototype.buildUrl=function(t,e){var r="".concat(this.gatewayOrigin()).concat(s).concat(t),n=function(t){if(!t)return"";var e=[];return Object.keys(t).forEach(function(r){var n=t[r];null!=n&&e.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(n))))}),e.join("&")}(e);return n&&(r+=(r.includes("?")?"&":"?")+n),r},t.prototype.toFullUrl=function(t){return t?/^https?:\/\//.test(t)||t.startsWith("//")?t:"".concat(this.gatewayOrigin()).concat(s).concat(t.startsWith("/")?"":"/").concat(t):t},t.prototype.send=function(t){return o(this,void 0,Promise,function(){var e,r,o,a,s,c;return i(this,function(i){switch(i.label){case 0:return e=this.buildUrl(t.path,t.query),r=t.method.toUpperCase(),o=["GET","HEAD"].includes(r),a=n({},t.headers||{}),o||(void 0!==t.rawBody?s=t.rawBody:void 0!==t.json&&(a["Content-Type"]=a["Content-Type"]||"application/json",s=JSON.stringify(t.json))),[4,this.request.fetch(n(n(n(n({url:e,method:r,headers:a},void 0!==s?{body:s}:{}),{withCredentials:!1!==t.withCredentials,shouldThrowOnError:!1}),t.signal?{signal:t.signal}:{}),t.cache?{cache:t.cache}:{}))];case 1:return c=i.sent(),[2,this.unwrap(c,e)]}})})},t.prototype.download=function(t){var e,r;return o(this,void 0,Promise,function(){var o,s,c,u;return i(this,function(i){switch(i.label){case 0:return o=this.buildUrl(t.path,t.query),[4,this.request.fetch(n(n({url:o,method:"GET",headers:n({},t.headers||{}),stream:!0,withCredentials:!1!==t.withCredentials,shouldThrowOnError:!1},t.signal?{signal:t.signal}:{}),t.cache?{cache:t.cache}:{}))];case 1:if(s=i.sent(),null===(e=t.signal)||void 0===e?void 0:e.aborted)throw new a.StorageApiError("The download was aborted",0,"STORAGE_PG_ABORTED");if(304===(c=Number(null!==(r=null==s?void 0:s.statusCode)&&void 0!==r?r:200)))throw new a.StorageApiError("Not Modified",c,"STORAGE_PG_NOT_MODIFIED");if(c>=400)throw new a.StorageApiError("Download failed with status ".concat(c),c,"STORAGE_PG_REQUEST_FAIL");if(!(u=null==s?void 0:s.response))throw new a.StorageApiError("Underlying adapter did not expose the raw Response",c,"STORAGE_PG_NO_RESPONSE");return[2,{response:u,status:c,header:null==s?void 0:s.header}]}})})},t.prototype.unwrap=function(t,e){var r,n;return o(this,void 0,Promise,function(){var o,s,c,u;return i(this,function(i){switch(i.label){case 0:o=Number(null!==(n=null!==(r=null==t?void 0:t.statusCode)&&void 0!==r?r:null==t?void 0:t.status)&&void 0!==n?n:200),s=null==t?void 0:t.data,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s];case 2:return s=i.sent(),[3,4];case 3:return i.sent(),s=void 0,[3,4];case 4:if(o>=200&&o<300)return[2,s];throw c=(null==s?void 0:s.code)||(null==s?void 0:s.error)||"STORAGE_PG_REQUEST_FAIL",u=(null==s?void 0:s.message)||"Storage request failed with status ".concat(o,": ").concat(e),new a.StorageApiError(u,o,c)}})})},t}();e.Http=c},456:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.registerStorage=e.StorageClient=e.StorageFileApi=e.ClassicStorageFileApi=e.CloudbaseStorage=e.COMPONENT_NAME=void 0;var i=r(502),a=r(14),s=r(504),c=r(891),u=r(77),l=r(891);Object.defineProperty(e,"COMPONENT_NAME",{enumerable:!0,get:function(){return l.COMPONENT_NAME}}),Object.defineProperty(e,"CloudbaseStorage",{enumerable:!0,get:function(){return l.CloudbaseStorage}});var d=r(77);Object.defineProperty(e,"ClassicStorageFileApi",{enumerable:!0,get:function(){return d.ClassicStorageFileApi}});var f=r(502);Object.defineProperty(e,"StorageFileApi",{enumerable:!0,get:function(){return f.StorageFileApi}});var h=new c.CloudbaseStorage,p={name:c.COMPONENT_NAME,entity:{uploadFile:h.uploadFile,deleteFile:h.deleteFile,getTempFileURL:h.getTempFileURL,downloadFile:h.downloadFile,getUploadMetadata:h.getUploadMetadata,copyFile:h.copyFile,getFileInfo:h.getFileInfo,isGateWay:h.isGateWay}},v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.from=function(t){return t?((0,s.assertValidBucketId)(t,"from"),new i.StorageFileApi(this.http,t,this.shouldThrowOnError)):new u.ClassicStorageFileApi(this.http.ctx,this.shouldThrowOnError)},e}(a.StorageBucketApi);e.StorageClient=v;var y={name:"".concat(c.COMPONENT_NAME,"/supabase"),IIFE:!0,entity:function(){var t=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(t.has(this))return t.get(this);var e=this,r=new Proxy({},{get:function(t,r){return"config"===r?e.config:"request"===r?e.request:void 0}}),n=new v(r);return t.set(this,n),n},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(p),cloudbase.registerComponent(y)}catch(t){}function g(t){try{t.registerComponent(p),t.registerComponent(y)}catch(t){console.warn(t)}}e.registerStorage=g;try{window.registerStorage=g}catch(t){}},14:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.StorageBucketApi=void 0;var i=r(98),a=r(504),s=function(){function t(t,e){void 0===e&&(e=!1),this.http=new i.Http(t),this.shouldThrowOnError=e}return t.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},t.prototype.listBuckets=function(t){return n(this,void 0,Promise,function(){var e=this;return o(this,function(r){return[2,(0,i.handleOperation)(function(){var r={};return void 0!==(null==t?void 0:t.limit)&&(r.limit=t.limit),void 0!==(null==t?void 0:t.offset)&&(r.offset=t.offset),(null==t?void 0:t.sortColumn)&&(r.sortColumn=t.sortColumn),(null==t?void 0:t.sortOrder)&&(r.sortOrder=t.sortOrder),(null==t?void 0:t.search)&&(r.search=t.search),e.http.send({method:"GET",path:"/bucket/",query:r})},this.shouldThrowOnError)]})})},t.prototype.getBucket=function(t){return n(this,void 0,Promise,function(){var e=this;return o(this,function(r){return[2,(0,i.handleOperation)(function(){return(0,a.assertValidBucketId)(t,"getBucket"),e.http.send({method:"GET",path:"/bucket/".concat(t)})},this.shouldThrowOnError)]})})},t.prototype.createBucket=function(t,e){return n(this,void 0,Promise,function(){var r=this;return o(this,function(n){return[2,(0,i.handleOperation)(function(){var n;return(0,a.assertValidBucketId)(t,"createBucket"),r.http.send({method:"POST",path:"/bucket/",json:{id:t,name:t,public:null!==(n=null==e?void 0:e.public)&&void 0!==n&&n,type:null==e?void 0:e.type,file_size_limit:null==e?void 0:e.fileSizeLimit,allowed_mime_types:null==e?void 0:e.allowedMimeTypes}})},this.shouldThrowOnError)]})})},t.prototype.updateBucket=function(t,e){return n(this,void 0,Promise,function(){var r=this;return o(this,function(n){return[2,(0,i.handleOperation)(function(){return(0,a.assertValidBucketId)(t,"updateBucket"),r.http.send({method:"PUT",path:"/bucket/".concat(t),json:{public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes}})},this.shouldThrowOnError)]})})},t.prototype.deleteBucket=function(t){return n(this,void 0,Promise,function(){var e=this;return o(this,function(r){return[2,(0,i.handleOperation)(function(){return(0,a.assertValidBucketId)(t,"deleteBucket"),e.http.send({method:"DELETE",path:"/bucket/".concat(t)})},this.shouldThrowOnError)]})})},t}();e.StorageBucketApi=s},77:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.ClassicStorageFileApi=void 0;var a=r(877),s=r(957),c=r(891),u=r(90),l=a.constants.ERRORS,d=function(){function t(t,e){void 0===e&&(e=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=t,this.shouldThrowOnError=e,this.storage=new c.CloudbaseStorage(t)}return Object.defineProperty(t.prototype,"config",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.request},enumerable:!1,configurable:!0}),t.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},t.prototype.upload=function(t,e,r){return o(this,void 0,Promise,function(){var o,a,u,d,f,h,p,v,y;return i(this,function(i){switch(i.label){case 0:o=n({upsert:!0},r),a=o.cacheControl,u=o.contentType,d=o.metadata,i.label=1;case 1:return i.trys.push([1,3,,4]),f=this.getCloudPath(t),h={cloudPath:f,filePath:e},(a||u||d)&&(p={},a&&(p["cache-control"]=a),u&&(p["content-type"]=u),d&&(p["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(d))),h.headers=p),[4,this.storage.uploadFile(h)];case 2:if(!(v=i.sent()).fileID)throw new Error(JSON.stringify({code:l.OPERATION_FAIL,msg:"[".concat(c.COMPONENT_NAME,".update] no fileID returned")}));return[2,{data:{id:v.fileID,path:t,fullPath:t},error:null}];case 3:if(y=i.sent(),this.shouldThrowOnError)throw y;if((0,s.isStorageError)(y))return[2,{data:null,error:y}];throw y;case 4:return[2]}})})},t.prototype.uploadToSignedUrl=function(t,e,r,n){return o(this,void 0,Promise,function(){return i(this,function(e){return[2,this.upload(t,r,n)]})})},t.prototype.createSignedUploadUrl=function(t){return o(this,void 0,Promise,function(){var e,r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e=this.getCloudPath(t),[4,this.storage.getUploadMetadata({cloudPath:e})];case 1:return[2,{data:{signedUrl:(r=o.sent().data).url,token:r.token,path:t,authorization:r.authorization,id:r.fileId,cosFileId:r.cosFileId,downloadUrl:r.download_url},error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;return[2,{data:null,error:n instanceof s.StorageError?n:new s.StorageError(n.message)}];case 3:return[2]}})})},t.prototype.update=function(t,e,r){return o(this,void 0,Promise,function(){return i(this,function(o){return[2,this.upload(t,e,n(n({},r),{upsert:!0}))]})})},t.prototype.move=function(t,e){return o(this,void 0,Promise,function(){var r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(t),dstPath:this.getCloudPath(e),overwrite:!0,removeOriginal:!0}]})];case 1:if((r=o.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new s.StorageError(r.fileList[0].message||"Move failed");return[2,{data:{message:"File moved from ".concat(t," to ").concat(e)},error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.copy=function(t,e){return o(this,void 0,Promise,function(){var r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(t),dstPath:this.getCloudPath(e),overwrite:!0,removeOriginal:!1}]})];case 1:if((r=o.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new s.StorageError(r.fileList[0].message||"Copy failed");return[2,{data:{path:this.getCloudPath(e)},error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.createSignedUrl=function(t,e,r){return o(this,void 0,Promise,function(){var n,o,a,c,u,l,d;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=this.normalizeCloudId(t),[4,this.storage.getTempFileURL({fileList:[{fileID:n,maxAge:e}]})];case 1:if("SUCCESS"!==(o=i.sent()).fileList[0].code)throw new s.StorageError("Failed to create signed URL: [".concat(o.fileList[0].code,"] ").concat(o.fileList[0].fileID));return a=o.fileList[0].download_url,c=[],void 0!==(null==r?void 0:r.download)&&("string"==typeof r.download?c.push("download=".concat(encodeURIComponent(r.download))):!0===r.download&&c.push("download=true")),(null==r?void 0:r.transform)&&(u=this.transformOptsToQueryString(r.transform))&&c.push(u),c.length>0&&(l=a.includes("?")?"&":"?",a="".concat(a).concat(l).concat(c.join("&"))),[2,{data:{signedUrl:a},error:null}];case 2:if(d=i.sent(),this.shouldThrowOnError)throw d;if((0,s.isStorageError)(d))return[2,{data:null,error:d}];throw d;case 3:return[2]}})})},t.prototype.createSignedUrls=function(t,e){return o(this,void 0,Promise,function(){var r,n,o=this;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=t.map(function(t){return{fileID:o.normalizeCloudId(t),maxAge:e}}),[4,this.storage.getTempFileURL({fileList:r})];case 1:return[2,{data:i.sent().fileList.map(function(e,r){return{path:t[r],signedUrl:e.tempFileURL||"",error:"SUCCESS"===e.code?null:e.message}}),error:null}];case 2:if(n=i.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.download=function(t,e){return o(this,void 0,Promise,function(){var r,n,a=this;return i(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),n={},[4,o(a,void 0,void 0,function(){var r,n,o,a;return i(this,function(i){switch(i.label){case 0:return[4,this.createSignedUrl(t,600,{transform:e})];case 1:if((r=i.sent()).error)throw r.error;return n=encodeURI(null===(a=r.data)||void 0===a?void 0:a.signedUrl),[4,this.request.reqClass.get({url:n,headers:{},responseType:"blob"})];case 2:if(!(o=i.sent().data))throw new s.StorageError("Download failed: no file content");return[2,new Blob([o])]}})})];case 1:return[2,(n.data=c.sent(),n.error=null,n)];case 2:if(r=c.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},t.prototype.info=function(t){return o(this,void 0,Promise,function(){var e,r,n,o,a,c,u,l;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=t.startsWith("cloud://"),r=e?this.extractPathFromFileId(t):t,n=e?this.extractBucketFromFileId(t):this.bucketId,[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(t)]})];case 1:if(o=i.sent(),"SUCCESS"!==(a=o.fileList[0]).code)throw new s.StorageError(a.message);return c=(new Date).toISOString(),u=(a.lastModified?new Date(a.lastModified):new Date).toISOString(),[2,{data:{id:a.fileID,version:"1",name:r,bucketId:n,updatedAt:u,createdAt:u,lastAccessedAt:c,size:a.size,cacheControl:a.cacheControl,contentType:a.contentType,etag:a.etag,lastModified:u,metadata:{}},error:null}];case 2:if(l=i.sent(),this.shouldThrowOnError)throw l;return[2,{data:null,error:l instanceof s.StorageError?l:new s.StorageError(l.message)}];case 3:return[2]}})})},t.prototype.exists=function(t){return o(this,void 0,Promise,function(){var e,r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(t)]})];case 1:if(e=o.sent(),"FILE_NOT_FOUND"===(r=e.fileList[0]).code)return[2,{data:!1,error:null}];if("SUCCESS"!==r.code)throw new s.StorageError(r.message);return[2,{data:!0,error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.getPublicUrl=function(t,e){return o(this,void 0,Promise,function(){var r;return i(this,function(n){switch(n.label){case 0:return[4,this.createSignedUrl(t,600,e)];case 1:return(r=n.sent()).data?[2,{data:{publicUrl:r.data.signedUrl}}]:[2,{data:null,error:r.error}]}})})},t.prototype.remove=function(t){return o(this,void 0,Promise,function(){var e,r,n,o,a,c,u,l,d,f,h=this;return i(this,function(i){switch(i.label){case 0:for(i.trys.push([0,3,,4]),e=10,r=[],n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return[4,Promise.all(r.map(function(t){return Promise.all(t.map(function(t){return h.info(t)}))}))];case 1:return o=i.sent(),a=new Map,o.forEach(function(r,n){r.forEach(function(r,o){r.data&&a.set(t[n*e+o],r.data)})}),c=t.map(function(t){return h.normalizeCloudId(t)}),[4,this.storage.deleteFile({fileList:c})];case 2:if(u=i.sent(),(l=u.fileList.filter(function(t){return"SUCCESS"!==t.code})).length>0)throw new s.StorageError("Delete failed for ".concat(l.length," file(s)"));return d=(new Date).toISOString(),[2,{data:t.map(function(t){var e=a.get(t);return{name:null==e?void 0:e.name,id:null==e?void 0:e.id,bucket_id:null==e?void 0:e.bucketId,owner:void 0,updated_at:(null==e?void 0:e.updatedAt)||d,created_at:null==e?void 0:e.createdAt,last_accessed_at:(null==e?void 0:e.lastAccessedAt)||d,metadata:(null==e?void 0:e.metadata)||{},buckets:{id:null==e?void 0:e.bucketId,name:null==e?void 0:e.bucketId,owner:void 0,public:!1,created_at:"",updated_at:d}}}),error:null}];case 3:if(f=i.sent(),this.shouldThrowOnError)throw f;if((0,s.isStorageError)(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}})})},t.prototype.list=function(){return o(this,void 0,void 0,function(){return i(this,function(t){throw new s.StorageError("Not implemented")})})},t.prototype.getCloudPath=function(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")},t.prototype.normalizeCloudId=function(t){var e;if(/^cloud:\/\//.test(t))return t;var r=this.getCloudPath(t);if(!this.bucketId)throw new s.StorageError("bucketId is not set");var n=(null===(e=this.config)||void 0===e?void 0:e.env)||"";return n?"cloud://".concat(n,".").concat(this.bucketId,"/").concat(r):void 0},t.prototype.toBase64=function(t){return(0,u.toBase64)(t)},t.prototype.transformOptsToQueryString=function(t){var e=["imageMogr2"];if(t.width||t.height){var r=t.width||"",n=t.height||"";"fill"===t.resize?e.push("thumbnail/".concat(r,"x").concat(n,"!")):"contain"===t.resize?e.push("thumbnail/".concat(r,"x").concat(n)):e.push("thumbnail/".concat(r,"x").concat(n,"^"))}if(t.format&&"origin"!==t.format&&e.push("format/".concat(t.format)),void 0!==t.quality){var o=Math.max(1,Math.min(100,t.quality));e.push("quality/".concat(o))}return e.join("/")},t.prototype.extractPathFromFileId=function(t){var e=t.replace(/^cloud:\/\//,"").split("/");return e.length<2?t:e.slice(1).join("/")},t.prototype.extractBucketFromFileId=function(t){var e=t.replace(/^cloud:\/\//,"").split("/");if(e.length<1)return"";var r=e[0],n=r.indexOf(".");return-1===n?r:r.substring(n+1)},t}();e.ClassicStorageFileApi=d},502:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.StorageFileApi=void 0;var a=r(957),s=r(90),c=r(98),u=r(656),l="3600",d=function(){function t(t,e,r){void 0===r&&(r=!1),this.headers={},this.http=t,this.bucketId=e,this.shouldThrowOnError=r}return t.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},t.prototype.setHeader=function(t,e){var r;if("string"!=typeof t||""===t.trim())throw new a.StorageError("setHeader requires a non-empty header name");if(/[\r\n]/.test(t)||"string"==typeof e&&/[\r\n]/.test(e))throw new a.StorageError("setHeader does not allow CR/LF characters in header name or value");return this.headers=n(n({},this.headers),((r={})[t]=String(e),r)),this},t.prototype.upload=function(t,e,r){return o(this,void 0,Promise,function(){return i(this,function(n){return[2,this.uploadOrUpdate("POST",t,e,r)]})})},t.prototype.update=function(t,e,r){return o(this,void 0,Promise,function(){return i(this,function(n){return[2,this.uploadOrUpdate("PUT",t,e,r)]})})},t.prototype.download=function(t,e,r){return new u.DownloadBuilder({http:this.http,bucketId:this.bucketId,cleanName:this.cleanPath(t),options:e,parameters:r,headers:this.headers,shouldThrowOnError:this.shouldThrowOnError})},t.prototype.list=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n;return i(this,function(o){return n={prefix:t||""},void 0!==(null==e?void 0:e.limit)&&(n.limit=e.limit),void 0!==(null==e?void 0:e.cursor)&&(n.cursor=e.cursor),void 0!==(null==e?void 0:e.withDelimiter)&&(n.with_delimiter=e.withDelimiter),void 0!==(null==e?void 0:e.sortBy)&&(n.sortBy=e.sortBy),[2,this.send({method:"POST",path:"/object/list/".concat(this.bucketId),json:n,signal:null==r?void 0:r.signal,cache:null==r?void 0:r.cache})]})})},this.shouldThrowOnError)]})})},t.prototype.remove=function(t){return o(this,void 0,Promise,function(){var e=this;return i(this,function(r){return[2,(0,c.handleOperation)(function(){return o(e,void 0,void 0,function(){var e,r,n,o,a,s=this;return i(this,function(i){switch(i.label){case 0:e=t.map(function(t){return s.cleanPath(t)}),r=[],n=0,i.label=1;case 1:return n<e.length?(o=e.slice(n,n+100),[4,this.send({method:"DELETE",path:"/object/".concat(this.bucketId),json:{prefixes:o}})]):[3,4];case 2:a=i.sent(),Array.isArray(a)&&r.push.apply(r,a),i.label=3;case 3:return n+=100,[3,1];case 4:return[2,r]}})})},this.shouldThrowOnError)]})})},t.prototype.copy=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n;return i(this,function(o){switch(o.label){case 0:return n=this.buildCopyMoveHeaders(r),[4,this.send({method:"POST",path:"/object/copy",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(t),destinationKey:this.cleanPath(e),destinationBucket:null==r?void 0:r.destinationBucket,copyMetadata:null==r?void 0:r.copyMetadata,metadata:null==r?void 0:r.metadata},headers:n})];case 1:return[2,{path:o.sent().Key}]}})})},this.shouldThrowOnError)]})})},t.prototype.move=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,this.send({method:"POST",path:"/object/move",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(t),destinationKey:this.cleanPath(e),destinationBucket:null==r?void 0:r.destinationBucket}})];case 1:return[2,{message:n.sent().message||"Successfully moved"}]}})})},this.shouldThrowOnError)]})})},t.prototype.info=function(t){return o(this,void 0,Promise,function(){var e=this;return i(this,function(r){return[2,(0,c.handleOperation)(function(){return o(e,void 0,void 0,function(){var e,r;return i(this,function(n){switch(n.label){case 0:return e=this.cleanPath(t),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(e))})];case 1:return[2,{id:(r=n.sent()).id,name:r.name,version:r.version,bucketId:r.bucket_id,size:r.size,contentType:r.content_type,cacheControl:r.cache_control,etag:r.etag,metadata:r.metadata,lastModified:r.last_modified,createdAt:r.created_at}]}})})},this.shouldThrowOnError)]})})},t.prototype.exists=function(t){return o(this,void 0,Promise,function(){var e,r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e=this.cleanPath(t),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(e))})];case 1:return o.sent(),[2,{data:!0,error:null}];case 2:if(r=o.sent(),void 0!==(n=null==r?void 0:r.status)&&[400,404].includes(Number(n)))return[2,{data:!1,error:null}];if(this.shouldThrowOnError)throw r;return[2,{data:null,error:r instanceof a.StorageError?r:new a.StorageError((null==r?void 0:r.message)||String(r))}];case 3:return[2]}})})},t.prototype.createSignedUrl=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n,o,a;return i(this,function(i){switch(i.label){case 0:return n=this.cleanPath(t),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId,"/").concat(this.encodePath(n)),json:{expiresIn:e}})];case 1:return o=i.sent(),a=o.fullSignedURL||this.http.toFullUrl(o.signedURL||""),[2,{fullSignedURL:this.appendUrlOptions(a,r)}]}})})},this.shouldThrowOnError)]})})},t.prototype.createSignedUrls=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n,o,a,s,c=this;return i(this,function(i){switch(i.label){case 0:n=t.map(function(t){return c.cleanPath(t)}),o=[],a=0,i.label=1;case 1:return a<n.length?(s=n.slice(a,a+500),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId),json:{expiresIn:e,paths:s}})]):[3,4];case 2:i.sent().forEach(function(t){var e,n=t.fullSignedURL||(t.signedURL?c.http.toFullUrl(t.signedURL):null);o.push({path:t.path,fullSignedURL:n?c.appendUrlOptions(n,r):null,error:null!==(e=t.error)&&void 0!==e?e:null})}),i.label=3;case 3:return a+=500,[3,1];case 4:return[2,o]}})})},this.shouldThrowOnError)]})})},t.prototype.createSignedUploadUrl=function(t,e){return o(this,void 0,Promise,function(){var r=this;return i(this,function(n){return[2,(0,c.handleOperation)(function(){return o(r,void 0,void 0,function(){var r,n,o;return i(this,function(i){switch(i.label){case 0:return r=this.cleanPath(t),n={},(null==e?void 0:e.upsert)&&(n["x-upsert"]="true"),[4,this.send({method:"POST",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(r)),headers:n})];case 1:return[2,{fullSignedURL:(o=i.sent()).fullURL||this.http.toFullUrl(o.url||""),path:r,token:o.token}]}})})},this.shouldThrowOnError)]})})},t.prototype.uploadToSignedUrl=function(t,e,r,n){return o(this,void 0,Promise,function(){var a=this;return i(this,function(s){return[2,(0,c.handleOperation)(function(){return o(a,void 0,void 0,function(){var o,a,s,c,u;return i(this,function(i){switch(i.label){case 0:return o=this.cleanPath(t),a=this.buildUploadBody(r,n),s=a.body,c=a.headers,[4,this.send({method:"PUT",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(o)),query:{token:e},rawBody:s,headers:c,withCredentials:!1})];case 1:return u=i.sent(),[2,{path:o,fullPath:u.Key}]}})})},this.shouldThrowOnError)]})})},t.prototype.getPublicUrl=function(t,e){var r=this.cleanPath(t),n=this.http.buildUrl("/object/public/".concat(this.bucketId,"/").concat(this.encodePath(r)));return{data:{publicUrl:this.appendUrlOptions(n,e)}}},t.prototype.send=function(t){return this.http.send(n(n({},t),{headers:n(n({},this.headers),t.headers||{})}))},t.prototype.uploadOrUpdate=function(t,e,r,n){return o(this,void 0,Promise,function(){var a=this;return i(this,function(s){return[2,(0,c.handleOperation)(function(){return o(a,void 0,void 0,function(){var o,a,s,c,u;return i(this,function(i){switch(i.label){case 0:return o=this.cleanPath(e),a=this.buildUploadBody(r,n),s=a.body,c=a.headers,"POST"===t&&(c["x-upsert"]=String(Boolean(null==n?void 0:n.upsert))),[4,this.send({method:t,path:"/object/".concat(this.bucketId,"/").concat(this.encodePath(o)),rawBody:s,headers:c})];case 1:return[2,{id:(u=i.sent()).Id,path:o,fullPath:u.Key}]}})})},this.shouldThrowOnError)]})})},t.prototype.cleanPath=function(t){var e=t.replace(/^\/+|\/+$/g,"").replace(/\/+/g,"/");if(e.split("/").some(function(t){return".."===t}))throw new a.StorageError('invalid path: ".." segment is not allowed');return e},t.prototype.encodePath=function(t){return(0,s.encodeObjectName)(t)},t.prototype.buildUploadBody=function(t,e){var r,o,i,a,s,c=n({},(null==e?void 0:e.headers)||{}),u=t,d="undefined"!=typeof FormData&&t instanceof FormData;if("undefined"!=typeof Blob&&t instanceof Blob||d){var f=void 0,h={};if(d){var p=this.extractFromFormData(t);f=p.file,h=p.fields}else f=t;var v=null!==(o=null!==(r=null==e?void 0:e.cacheControl)&&void 0!==r?r:h.cacheControl)&&void 0!==o?o:l,y=null!==(i=null==e?void 0:e.contentType)&&void 0!==i?i:h.contentType,g=void 0!==(null==e?void 0:e.metadata)?JSON.stringify(e.metadata):h.metadata,m=new FormData;void 0!==v&&m.append("cacheControl",String(v)),void 0!==y&&m.append("contentType",y),void 0!==g&&m.append("metadata",g),m.append("",f),u=m}else u=t,v=null!==(a=null==e?void 0:e.cacheControl)&&void 0!==a?a:l,y=null!==(s=null==e?void 0:e.contentType)&&void 0!==s?s:"text/plain;charset=UTF-8",c["cache-control"]="max-age=".concat(v),y&&(c["content-type"]=y),(null==e?void 0:e.metadata)&&(c["x-metadata"]=this.toBase64(JSON.stringify(e.metadata)));return{body:u,headers:c}},t.prototype.extractFromFormData=function(t){var e,r={},n=0,o=[];if(t.forEach(function(t,i){if("undefined"!=typeof Blob&&t instanceof Blob)return e=t,void(n+=1);"cacheControl"!==i&&"contentType"!==i&&"metadata"!==i?o.push(i):r[i]=String(t)}),o.length>0&&console.warn("Ignored unsupported FormData field(s): [".concat(o.join(", "),"]. Only file, cacheControl, contentType and metadata are supported")),0===n||!e)throw new a.StorageError("FormData must contain a file");if(n>1)throw new a.StorageError("FormData must contain exactly one file");return{file:e,fields:r}},t.prototype.buildCopyMoveHeaders=function(t){var e={};return(null==t?void 0:t.upsert)&&(e["x-upsert"]="true"),!1===(null==t?void 0:t.copyMetadata)&&(null==t?void 0:t.metadata)&&(e["x-metadata"]=this.toBase64(JSON.stringify(t.metadata))),e},t.prototype.appendUrlOptions=function(t,e){var r=[];if(void 0!==(null==e?void 0:e.download)){var n=!0===e.download?"":String(e.download);r.push("download=".concat(encodeURIComponent(n)))}if(void 0!==(null==e?void 0:e.cacheNonce)&&r.push("cacheNonce=".concat(encodeURIComponent(String(e.cacheNonce)))),0===r.length)return t;var o=t.includes("?")?"&":"?";return"".concat(t).concat(o).concat(r.join("&"))},t.prototype.toBase64=function(t){return(0,s.toBase64)(t)},t}();e.StorageFileApi=d},957:function(t,e){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StorageUnknownError=e.StorageApiError=e.isStorageError=e.StorageError=void 0;var o=function(t){function e(e){var r=t.call(this,e)||this;return r.__isStorageError=!0,r.name="StorageError",r}return n(e,t),e}(Error);e.StorageError=o,e.isStorageError=function(t){return"object"==typeof t&&null!==t&&"__isStorageError"in t};var i=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.name="StorageApiError",o.status=r,o.statusCode=n,o}return n(e,t),e.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},e}(o);e.StorageApiError=i;var a=function(t){function e(e,r){var n=t.call(this,e)||this;return n.name="StorageUnknownError",n.originalError=r,n}return n(e,t),e}(o);e.StorageUnknownError=a},504:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidBucketId=e.isValidBucketId=void 0;var n=r(957),o=/[\x00-\x20\x7f/\\?#%]/;e.isValidBucketId=function(t){return"string"==typeof t&&t.length>0&&t.length<=256&&!o.test(t)},e.assertValidBucketId=function(t,e){if("string"!=typeof t||0===t.length)throw new n.StorageError("[storage.".concat(e,"] bucketId is required"));if(t.length>256)throw new n.StorageError("[storage.".concat(e,"] invalid bucketId: length must be 1-").concat(256));var r=o.exec(t);if(r){var i="[storage.".concat(e,'] invalid bucketId "').concat(t,'": ')+"contains forbidden character ".concat(JSON.stringify(r[0]),"; ")+'must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"';throw new n.StorageError(i)}}},563:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var s,c=a(r(92)),u=r(962);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(s=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(t,e){for(var r=0,o=(0,u.isArray)(t)?t:[t];r<o.length;r++){var i=o[r],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:n({isMatch:a},s(e)),runtime:c}}},e.useDefaultAdapter=function(){return{adapter:n({},c.genAdapter()),runtime:s.WEB}}},92:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRequest=e.genAdapter=void 0;var c=r(829),u=r(962),l=r(464),d=function(t){function e(e){var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return r.timeout=n||0,r.timeoutMsg=o||"请求超时",r.restrictedMethods=i||["get","post","upload","download"],r}return o(e,t),e.prototype.get=function(t){return this.request(i(i({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(i(i({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(i(i({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,n=t.name,o=t.method,a=t.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(e).forEach(function(t){u.append(t,e[t])}),u.append("key",n),u.append("file",r),this.request(i(i({},t),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},t),{method:"put",headers:s,body:r}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return a(this,void 0,Promise,function(){var e,r,n,o;return s(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},t),{headers:{},responseType:"blob"}))];case 1:return e=a.sent().data,r=window.URL.createObjectURL(new Blob([e])),n=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=r,o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(r),document.body.removeChild(o),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(e){e({statusCode:200,tempFilePath:t.url})})]}})})},e.prototype.fetch=function(t){var e;return a(this,void 0,Promise,function(){var r,n,o,c,u,l,d,f,h,p,v,y,g,m=this;return s(this,function(b){switch(b.label){case 0:return r=new AbortController,n=t.url,o=t.enableAbort,c=void 0!==o&&o,u=t.stream,l=void 0!==u&&u,d=t.signal,f=t.timeout,h=t.shouldThrowOnError,p=void 0===h||h,v=null!=f?f:this.timeout,d&&(d.aborted&&r.abort(),d.addEventListener("abort",function(){return r.abort()})),y=null,c&&v&&(y=setTimeout(function(){console.warn(m.timeoutMsg),r.abort(new Error(m.timeoutMsg))},v)),[4,fetch(n,i(i({},t),{signal:r.signal})).then(function(t){return a(m,void 0,void 0,function(){var e,r,n;return s(this,function(o){switch(o.label){case 0:return clearTimeout(y),p?t.ok?(e=t,[3,3]):[3,1]:[3,4];case 1:return n=(r=Promise).reject,[4,t.json()];case 2:e=n.apply(r,[o.sent()]),o.label=3;case 3:return[2,e];case 4:return[2,t]}})})}).catch(function(t){return clearTimeout(y),Promise.reject(t)})];case 1:return g=b.sent(),[2,{data:l?g.body:(null===(e=g.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}})})},e.prototype.request=function(t,e){var r=this;void 0===e&&(e=!1);var n=String(t.method).toLowerCase()||"get";return new Promise(function(o){var i=t.url,a=t.headers,s=void 0===a?{}:a,c=t.data,d=t.responseType,f=t.withCredentials,h=t.body,p=t.onUploadProgress,v=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===n?c:{}),y=new XMLHttpRequest;y.open(n,v),d&&(y.responseType=d);var g,m,b=t.signal;b&&(b.aborted?y.abort():b.addEventListener("abort",function(){return y.abort()},{once:!0})),Object.keys(s).forEach(function(t){y.setRequestHeader(t,s[t])}),p&&y.upload.addEventListener("progress",p),y.onreadystatechange=function(){var t={};if(4===y.readyState){var e=y.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach(function(t){var e=t.split(": "),n=e.shift().toLowerCase(),o=e.join(": ");r[n]=o}),t.header=r,t.statusCode=y.status;try{t.data="blob"===d?y.response:JSON.parse(y.responseText)}catch(e){t.data="blob"===d?y.response:y.responseText}clearTimeout(g),o(t)}},e&&r.timeout&&(g=setTimeout(function(){console.warn(r.timeoutMsg),y.abort()},r.timeout)),m=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):h||(c?JSON.stringify(c):void 0),f&&(y.withCredentials=!0),y.send(m)})},e}(c.AbstractSDKRequest);e.WebRequest=d,e.genAdapter=function(){return{type:"default",root:window,reqClass:d,wsClass:WebSocket,localStorage}}},464:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.COMMUNITY_SITE_URL=e.IS_DEBUG_MODE=e.getProtocol=e.setProtocol=e.getSdkName=e.setSdkName=void 0;var r="@cloudbase/js-sdk";e.setSdkName=function(t){r=t},e.getSdkName=function(){return r};var n="https:";e.setProtocol=function(t){n=t},e.getProtocol=function(){return n},e.IS_DEBUG_MODE=!1,e.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},519:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERRORS=void 0,e.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},778:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.OATUH_LOGINTYPE=void 0,o(r(464),e),o(r(519),e),e.OATUH_LOGINTYPE="constants"},517:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.catchErrorsDecorator=void 0;var i=r(962),a=r(778),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(t){var e=t.err,r=t.className,n=t.methodName,o=t.sourceLink;if(!o)return null;var i,a=e.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]")),d=a.findIndex(function(t){return c.test(t)});if(-1!==d){var f=a.filter(function(t,e){return e>d});f.unshift(a[d].replace(l,"".concat(r,".").concat(n)).replace(u,o)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(f.join("\n"))}return i}e.catchErrorsDecorator=function(t){var e=t.mode,r=void 0===e?"async":e,s=t.customInfo,d=void 0===s?{}:s,f=t.title,h=t.messages,p=void 0===h?[]:h;return function(t,e,s){if(a.IS_DEBUG_MODE){var h=d.className||t.constructor.name,v=d.methodName||e,y=s.value,g=function(){var t="",e=(new Error).stack.split("\n"),r=e.findIndex(function(t){return c.test(t)});if(-1!==r){var n=u.exec(e[r+1]||"");t=n?n[0]:""}return t}();s.value="sync"===r?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=l({err:new Error,className:h,methodName:v,sourceLink:g});try{return y.apply(this,t)}catch(t){var n=t,o=t.message,a=t.error,s=t.error_description,c={title:f||"".concat(h,".").concat(v," failed"),content:[{type:"error",body:t}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(r?(r.code=u.code,r.msg=u.msg):(t.code=u.code,t.message=u.msg),n=r||t,c.content=p.map(function(t){return{type:"info",body:t}}))}throw a&&s&&(c.subtitle=s,r?(r.code=a,r.msg=s):(t.code=a,t.message=s),n=r||t,c.content=p.map(function(t){return{type:"info",body:t}})),(0,i.printGroupLog)(c),n}}:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(this,void 0,void 0,function(){var e,r,n,a,s,c,u,d;return o(this,function(o){switch(o.label){case 0:e=l({err:new Error,className:h,methodName:v,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,y.apply(this,t)];case 2:return[2,o.sent()];case 3:throw r=o.sent(),n=r,a=r.message,s=r.error,c=r.error_description,u={title:f||"".concat(h,".").concat(v," failed"),content:[{type:"error",body:r}]},a&&/^\{.*\}$/.test(a)&&(d=JSON.parse(a),u.subtitle=d,d.code&&(e?(e.code=d.code,e.message=d.msg):(r.code=d.code,r.message=d.msg),n=e||r,u.content=p.map(function(t){return{type:"info",body:t}}))),s&&c&&(u.subtitle=c,e?(e.code=s,e.msg=c):(r.code=s,r.message=c),n=e||r,u.content=p.map(function(t){return{type:"info",body:t}})),(0,i.printGroupLog)(u),n;case 4:return[2]}})})}}}}},260:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(517),e)},877:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.langEvent=e.AbortController=e.jwt=e.helpers=e.utils=e.events=e.cache=e.adapters=e.constants=void 0;var s=i(r(778));e.constants=s;var c=i(r(563));e.adapters=c;var u=i(r(865));e.cache=u;var l=i(r(940));e.events=l;var d=i(r(991));e.langEvent=d;var f=i(r(962));e.utils=f;var h=i(r(260));e.helpers=h;var p=a(r(644));e.AbortController=p.default;var v={decode:a(r(949)).default};e.jwt=v},644:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){var t=this;this.listeners=[],this.signal={aborted:!1,addEventListener:function(e,r){"abort"===e&&t.listeners.push(r)}}}return t.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.listeners.forEach(function(t){return t()}))},t}();e.default=r},865:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseCache=void 0;var s=r(829),c=r(962),u=r(778),l=function(t){function e(e){var r=t.call(this)||this;return r.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return o(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}(s.AbstractStorage),d=function(){function t(t){this.keys={};var e=t.persistence,r=t.platformInfo,n=void 0===r?{}:r,o=t.keys,i=void 0===o?{}:o;this.platformInfo=n,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(e.root));case"none":return new l(e.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}return Object.defineProperty(t.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),t.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this.storage)try{var n={version:r||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(n))}catch(t){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:t}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,r){return i(this,void 0,void 0,function(){var n;return a(this,function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),n={version:r||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(n))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}})})},t.prototype.getStore=function(t,e){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var n=this.storage.getItem(t);return n&&n.indexOf(e)>=0?JSON.parse(n).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var r;return i(this,void 0,void 0,function(){var n;return a(this,function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(n=o.sent())&&n.indexOf(e)>=0?[2,JSON.parse(n).content]:[2,""]}})})},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return i(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}})})},t}();e.CloudbaseCache=d},940:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.activateEvent=e.addEventListener=e.CloudbaseEventEmitter=e.IErrorEvent=e.CloudbaseEvent=void 0;var a=r(962),s=function(t,e){this.data=e||null,this.name=t};e.CloudbaseEvent=s;var c=function(t){function e(e,r){var n=t.call(this,"error",{error:e,data:r})||this;return n.error=e,n}return o(e,t),e}(s);e.IErrorEvent=c;var u=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if((0,a.isInstanceOf)(t,c))return console.error(t.error),this;var r=(0,a.isString)(t)?new s(t,e||{}):t,n=r.name;if(this.listens(n)){r.target=this;for(var o=0,u=this.listeners[n]?i([],this.listeners[n],!0):[];o<u.length;o++)u[o].call(this,r)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}();e.CloudbaseEventEmitter=u;var l=new u;e.addEventListener=function(t,e){l.on(t,e)},e.activateEvent=function(t,e){void 0===e&&(e={}),l.fire(t,e)},e.removeEventListener=function(t,e){l.off(t,e)}},991:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LANG_CHANGE_EVENT=e.bus=void 0;var n=r(940);e.bus=new n.CloudbaseEventEmitter,e.LANG_CHANGE_EVENT="lang_change"},962:function(t,e,r){"use strict";var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.parseCaptcha=e.parseQueryString=e.transformPhone=e.sleep=e.printGroupLog=e.throwError=e.printInfo=e.printError=e.printWarn=e.execCallback=e.createPromiseCallback=e.removeParam=e.getHash=e.getQuery=e.toQueryString=e.formatUrl=e.generateRequestId=e.genSeqId=e.isFormData=e.isInstanceOf=e.isNull=e.isPalinObject=e.isUndefined=e.isString=e.isArray=void 0;var o=r(778);e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isUndefined=function(t){return void 0===t},e.isPalinObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isNull=function(t){return"[object Null]"===Object.prototype.toString.call(t)},e.isInstanceOf=function(t,e){return t instanceof e},e.isFormData=function(t){return"[object FormData]"===Object.prototype.toString.call(t)},e.genSeqId=function(){return Math.random().toString(16).slice(2)},e.generateRequestId=function(){var t=(new Date).getTime(),e=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var n=16*Math.random();return t>0?(n=(t+n)%16|0,t=Math.floor(t/16)):(n=(e+n)%16|0,e=Math.floor(e/16)),("x"===r?n:7&n|8).toString(16)})},e.formatUrl=function(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";return Object.keys(r).forEach(function(t){""===o?!n&&(e+="?"):o+="&",o+="".concat(t,"=").concat(encodeURIComponent(r[t]))}),/^http(s)?:\/\//.test(e+=o)?e:"".concat(t).concat(e)},e.toQueryString=function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach(function(r){e.push("".concat(r,"=").concat(encodeURIComponent(t[r])))}),e.join("&")},e.getQuery=function(t,e){if("undefined"==typeof window)return!1;var r=e||decodeURIComponent(window.location.search),n=new RegExp("(^|&)".concat(t,"=([^&]*)(&|$)")),o=r.substr(r.indexOf("?")+1).match(n);return null!=o?o[2]:""},e.getHash=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]".concat(t,"=([^&#]*)")));return e?e[1]:""},e.removeParam=function(t,e){var r=e.split("?")[0],n=[],o=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==o){for(var i=(n=o.split("&")).length-1;i>=0;i-=1)n[i].split("=")[0]===t&&n.splice(i,1);r="".concat(r,"?").concat(n.join("&"))}return r},e.createPromiseCallback=function(){var t={};if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var r=new Promise(function(e,r){t=function(t,n){return t?r(t):e(n)}});return t.promise=r,t},e.execCallback=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},e.printWarn=function(t,e){console.warn("[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e))},e.printError=function(t,e){console.error({code:t,msg:"[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e)})},e.printInfo=function(t,e){console.log("[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e))},e.throwError=function(t,e){throw new Error(JSON.stringify({code:t,msg:"[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e)}))},e.printGroupLog=function(t){var e,r=t.title,n=t.subtitle,o=void 0===n?"":n,i=t.content,a=void 0===i?[]:i,s=t.printTrace,c=void 0!==s&&s,u=t.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(r,o):(console.group||console.error)(r,o);for(var l=0,d=a;l<d.length;l++){var f=d[l],h=f.type,p=f.body;switch(h){case"info":console.log(p);break;case"warn":console.warn(p);break;case"error":console.error(p)}}c&&(console.trace||console.log)("stack trace:"),null===(e=console.groupEnd)||void 0===e||e.call(console)},e.sleep=function(t){return void 0===t&&(t=0),new Promise(function(e){return setTimeout(e,t)})},e.transformPhone=function(t){return"+86".concat(t)},e.parseQueryString=function(t){t=t.replace(/^\?/,"");var e={};return t.split("&").forEach(function(t){var r=t.split("="),n=r[0],o=r[1];n=decodeURIComponent(n),o=decodeURIComponent(o),n&&(e[n]?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o)}),e},e.parseCaptcha=function(t){var r={},o=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){t=o[1];var i=o[2];i&&(r=(0,e.parseQueryString)(i))}var a=r.token,s=n(r,["token"]);return/^data:/.test(t)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(t)}:a?{state:s.state,token:a,captchaData:t}:{error:"unimplemented",error_description:"need to impl captcha data"}}},388:t=>{t.exports={}},949:(t,e,r)=>{"use strict";function n(t){this.message=t}r.r(e),r.d(e,{InvalidTokenError:()=>a,default:()=>s}),n.prototype=new Error,n.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,i=0,a=0,s="";o=e.charAt(a++);~o&&(r=i%4?64*r+o:o,i++%4)?s+=String.fromCharCode(255&r>>(-2*i&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return s};function i(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(o(t).replace(/(.)/g,function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(e)}catch(t){return o(e)}}function a(t){this.message=t}a.prototype=new Error,a.prototype.name="InvalidTokenError";const s=function(t,e){if("string"!=typeof t)throw new a("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(i(t.split(".")[r]))}catch(t){throw new a("Invalid token specified: "+t.message)}}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=void 0;var e=r(456);t.registerStorage=e.registerStorage})(),n})());
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_storage",[],e):"object"==typeof exports?exports.cloudbase_storage=e():t.cloudbase_storage=e()}("undefined"!=typeof window?window:this,()=>(()=>{var t={829:(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{AbstractSDKRequest:()=>o,AbstractStorage:()=>i,StorageType:()=>n,formatUrl:()=>a}),function(t){t.local="local",t.none="none",t.session="session"}(n||(n={}));var o=function(){},i=function(){};function a(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";for(var i in r)""===o?!n&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}},891:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseStorage=e.COMPONENT_NAME=e.EUploadMethod=void 0;var c,u=r(877),l=r(90),d=r(388);!function(t){t.put="put",t.post="post"}(c=e.EUploadMethod||(e.EUploadMethod={}));var f=u.constants.getSdkName,h=u.constants.ERRORS,p=u.constants.COMMUNITY_SITE_URL,v=u.utils.isArray,y=u.utils.isString,g=u.utils.isPalinObject,m=u.utils.execCallback,b=u.helpers.catchErrorsDecorator;e.COMPONENT_NAME="storage";var w=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i,a;return s(this,function(s){switch(s.label){case 0:return[4,t.gateWay({path:"storages",name:"get-objects-upload-info",data:[n({objectId:e.path},e.signedHeader?{signedHeader:e.signedHeader}:{})]},r)];case 1:return o=s.sent(),i=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,n(n({},o),{data:n(n({},i.code?n({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}})})},O=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i;return s(this,function(a){switch(a.label){case 0:return[4,t.gateWay({path:"storages",name:"get-objects-download-info",data:e.convertedFileList.map(function(t){return{cloudObjectId:t.fileid}})},r)];case 1:return o=a.sent(),[2,n(n({},o),{data:{download_list:null===(i=o.data)||void 0===i?void 0:i.map(function(t){return{code:t.code||"SUCCESS",message:t.message,fileid:t.cloudObjectId,download_url:t.downloadUrl,fileID:t.cloudObjectId,tempFileURL:t.downloadUrl}})}})]}})})},_=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i;return s(this,function(a){switch(a.label){case 0:return[4,t.gateWay({path:"storages",name:"delete-objects",data:e.fileList.map(function(t){return{cloudObjectId:t}})},r)];case 1:return o=a.sent(),[2,n(n({},o),{data:{delete_list:null===(i=o.data)||void 0===i?void 0:i.map(function(t){return{code:t.code||"SUCCESS",fileID:t.cloudObjectId,message:t.message}})}})]}})})},S=function(t,e,r){return a(void 0,void 0,void 0,function(){var o,i;return s(this,function(a){switch(a.label){case 0:return[4,t.gateWay({path:"storages",name:"copy-objects",data:e.convertedFileList.map(function(t){return{srcPath:t.src_path,dstPath:t.dst_path,overwrite:t.overwrite,removeOriginal:t.remove_original}})},r)];case 1:return o=a.sent(),[2,n(n({},o),{data:{copy_list:null===(i=o.data)||void 0===i?void 0:i.map(function(t){return{code:t.code||"SUCCESS",fileID:t.cloudObjectId,message:t.message}})}})]}})})},E={txt:"text/plain",json:"application/json",html:"text/html",htm:"text/html",css:"text/css",js:"application/javascript",csv:"text/csv",xml:"application/xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",pdf:"application/pdf",zip:"application/zip",gz:"application/gzip",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav"};function P(t,e){if("undefined"!=typeof Blob&&t instanceof Blob&&t.type)return t.type;var r=/\.([a-zA-Z0-9]+)$/.exec(e||""),n=r?r[1].toLowerCase():"";return E[n]||"application/octet-stream"}function I(t,e){var r=e.toLowerCase();return Object.keys(t).some(function(t){return t.toLowerCase()===r})}function j(t){return Object.keys(t).reduce(function(e,r){var o;return n(n({},e),((o={})[r]=[t[r]],o))},{})}e.CloudbaseStorage=function(){function t(t){this.context=t}var r,u,E,N,C,x,T,A,R,U,k,L,F,M,D,B;return Object.defineProperty(t.prototype,"config",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.request},enumerable:!1,configurable:!0}),t.prototype.isGateWay=function(){return"GATEWAY"===(this.config.endPointMode||"CLOUD_API")},t.prototype.uploadFile=function(t,r){return a(this,void 0,Promise,function(){var o,i,a,u,d,p,v,g,b,w,O,_,S,E,N,C,x,T,A,R,U,k,L,F,M,D,B,q,G,W,V;return s(this,function(s){switch(s.label){case 0:if(o=t.cloudPath,i=t.filePath,a=t.onUploadProgress,G=t.method,u=void 0===G?"put":G,W=t.headers,d=void 0===W?{}:W,p=t.fileContent,!y(o)||!i&&!p)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".uploadFile] invalid params")}));return v={put:c.put,post:c.post}[u.toLocaleLowerCase()]||c.put,g=this.isGateWay(),b=n({},d),w=Object.keys(d).reduce(function(t,e){return"content-length"!==e.toLowerCase()&&(t[e]=d[e]),t},{}),v===c.put&&g&&(I(b,"content-length")||(O=function(t,e){var r=null!=t?t:e;if(null!==r){if("undefined"!=typeof Blob&&r instanceof Blob)return r.size;if("undefined"!=typeof ArrayBuffer){if(r instanceof ArrayBuffer)return r.byteLength;if("function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(r))return r.byteLength}if("string"==typeof r){if("undefined"!=typeof Blob)return new Blob([r]).size;var n=(0,l.getStringByteLength)(r);return"number"==typeof n?n:r.length}return"object"==typeof r&&"number"==typeof r.size?r.size:void 0}}(i,p),"number"==typeof O&&(b["content-length"]=String(O))),I(b,"content-type")||(b["content-type"]=P(i,o)),I(w,"content-type")||(w["content-type"]=P(i,o))),[4,this.getUploadMetadata({cloudPath:o,method:v,headers:v!==c.put||g?void 0:w,signedHeader:v===c.put&&g?j(b):void 0,customReqOpts:t.customReqOpts})];case 1:return _=s.sent(),S=_.data,E=_.requestId,(null==(N=S)?void 0:N.code)||!(null==N?void 0:N.url)?(C=(null==N?void 0:N.code)||h.OPERATION_FAIL,x=(null==N?void 0:N.message)||"get upload info failed",[2,m(r,new Error("[".concat(f(),"][").concat(C,"][").concat(e.COMPONENT_NAME,"]:").concat(x)))]):(T=S.url,A=S.authorization,R=S.token,U=S.fileId,k=S.cosFileId,L=S.download_url,M=n(n({},F={url:T,file:i,name:o,onUploadProgress:a,fileContent:p,fileId:U,requestId:E}),{method:c.put,headers:n(n({},w),{authorization:A,"x-cos-meta-fileid":k,"x-cos-security-token":R})}),D=n(n({},F),{method:c.post,data:{key:o,signature:A,"x-cos-meta-fileid":k,success_action_status:"201","x-cos-security-token":R}}),(V={})[c.put]={params:M,isSuccess:function(t){return t>=200&&t<300}},V[c.post]={params:D,isSuccess:function(t){return 201===t}},B=V,[4,this.request.upload(B[v].params)]);case 2:return q=s.sent(),B[v].isSuccess(q.statusCode)?[2,m(r,null,{fileID:U,download_url:L,requestId:E})]:[2,m(r,new Error("[".concat(f(),"][").concat(h.OPERATION_FAIL,"][").concat(e.COMPONENT_NAME,"]:").concat(q.data)))]}})})},t.prototype.getUploadMetadata=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,u,l,d,f,p,v;return s(this,function(s){switch(s.label){case 0:if(n=t.cloudPath,o=t.method,i=t.headers,a=t.signedHeader,!y(n))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getUploadMetadata] invalid cloudPath")}));u=this.request,l="storage.getUploadMetadata",s.label=1;case 1:return s.trys.push([1,6,,7]),d=void 0,f={path:n},p=this.isGateWay(),o&&(f.method=o),o===c.put&&(p&&a?f.signedHeader=a:!p&&i&&(f.headers=i)),p?[4,w(u,f,t.customReqOpts)]:[3,3];case 2:return d=s.sent(),[3,5];case 3:return[4,u.send(l,f,t.customReqOpts)];case 4:d=s.sent(),s.label=5;case 5:return[2,m(r,null,d)];case 6:return v=s.sent(),[2,m(r,v)];case 7:return[2]}})})},t.prototype.deleteFile=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u,l,d;return s(this,function(s){switch(s.label){case 0:if(!(n=t.fileList)||!v(n)||0===n.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".deleteFile] fileList must not be empty")}));for(o=0,i=n;o<i.length;o++)if(!(a=i[o])||!y(a))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".deleteFile] fileID must be string")}));return c="storage.batchDeleteFile",u=this.request,l={},this.isGateWay()?[4,_(u,{fileList:n},t.customReqOpts)]:[3,2];case 1:return l=s.sent(),[3,4];case 2:return[4,u.send(c,{fileid_list:n},t.customReqOpts)];case 3:l=s.sent(),s.label=4;case 4:return l.code?[2,m(r,null,l)]:(d={fileList:l.data.delete_list,requestId:l.requestId},[2,m(r,null,d)])}})})},t.prototype.getTempFileURL=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u,l,d;return s(this,function(s){switch(s.label){case 0:if(!(n=t.fileList)||!v(n)||0===n.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] fileList must not be empty")}));for(o=[],i=0,a=n;i<a.length;i++)if(c=a[i],g(c)){if(!Object.prototype.hasOwnProperty.call(c,"fileID"))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] file info must include fileID")}));o.push({fileid:c.fileID,max_age:c.maxAge||7200})}else{if(!y(c))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] invalid fileList")}));o.push({fileid:c})}return u="storage.batchGetDownloadUrl",l=this.request,d={},this.isGateWay()?[4,O(l,{convertedFileList:o},t.customReqOpts)]:[3,2];case 1:return d=s.sent(),[3,4];case 2:return[4,l.send(u,{file_list:o},t.customReqOpts)];case 3:d=s.sent(),s.label=4;case 4:return d.code?[2,m(r,null,d)]:[2,m(r,null,{fileList:d.data.download_list,requestId:d.requestId})]}})})},t.prototype.downloadFile=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u;return s(this,function(s){switch(s.label){case 0:if(n=t.fileID,!y(n))throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:t.customReqOpts})];case 1:return o=s.sent(),"SUCCESS"!==(i=o.fileList[0]).code?[2,m(r,i)]:(a=this.request,c=encodeURI(i.download_url),[4,a.download({url:c,tempFilePath:t.tempFilePath})]);case 2:return u=s.sent(),[2,m(r,null,u)]}})})},t.prototype.copyFile=function(t,r){return a(this,void 0,Promise,function(){var n,o,i,a,c,u,l,d,f;return s(this,function(s){switch(s.label){case 0:if(!(n=t.fileList)||!v(n)||0===n.length)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".copyFile] fileList must not be empty")}));for(o=[],i=0,a=n;i<a.length;i++){if(c=a[i],u=c.srcPath,l=c.dstPath,!u||!l||"string"!=typeof u||"string"!=typeof l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".copyFile] srcPath and dstPath may not be empty")}));if(u===l)throw new Error(JSON.stringify({code:h.INVALID_PARAMS,msg:"[".concat(e.COMPONENT_NAME,".copyFile] srcPath and dstPath can not be the same")}));o.push({src_path:u,dst_path:l,overwrite:c.overwrite,remove_original:c.removeOriginal})}return d=this.request,f={},this.isGateWay()?[4,S(d,{convertedFileList:o},t.customReqOpts)]:[3,2];case 1:return f=s.sent(),[3,4];case 2:return[4,d.send("storage.batchCopyFile",{file_list:o},t.customReqOpts)];case 3:f=s.sent(),s.label=4;case 4:return f.code?[2,m(r,null,f)]:[2,m(r,null,{fileList:f.data.copy_list,requestId:f.requestId})]}})})},t.prototype.getFileInfo=function(t){var e;return a(this,void 0,Promise,function(){var r,n=this;return s(this,function(o){switch(o.label){case 0:return[4,this.getTempFileURL(t)];case 1:return(null==(r=o.sent())?void 0:r.fileList)&&(null===(e=null==r?void 0:r.fileList)||void 0===e?void 0:e.length)>0?[4,Promise.all(r.fileList.map(function(t){return a(n,void 0,void 0,function(){var e,r,n,o,i,a,c;return s(this,function(s){switch(s.label){case 0:if("SUCCESS"!==t.code)return[2,{code:t.code,fileID:t.fileID,tempFileURL:t.tempFileURL,message:t.message}];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request.fetch({url:t.tempFileURL,method:"HEAD"})];case 2:return e=s.sent(),r=e.header,"undefined"!=typeof Headers&&r instanceof Headers&&(n={},r.forEach(function(t,e){n[e]=t}),r=n),o=parseInt(r["content-length"])||0,i=r["content-type"]||"",[400,404].includes(Number(e.statusCode))?[2,{code:"FILE_NOT_FOUND",fileID:t.fileID,tempFileURL:t.tempFileURL,message:"file not found"}]:[2,{code:t.code,fileID:t.fileID,tempFileURL:t.tempFileURL,cloudId:t.fileID,fileName:t.fileID.split("/").pop(),contentType:i,mime:i.split(";")[0].trim(),size:o,etag:r.etag||"",lastModified:r["last-modified"]||"",cacheControl:r["cache-control"]||""}];case 3:return a=s.sent(),c="object"==typeof a&&null!==a&&"message"in a?String(a.message):void 0,[2,{code:"FETCH_FILE_INFO_ERROR",fileID:t.fileID,tempFileURL:t.tempFileURL,message:c}];case 4:return[2]}})})}))]:[3,3];case 2:return[2,{fileList:o.sent(),requestId:r.requestId}];case 3:return[2,{fileList:[],requestId:r.requestId}]}})})},o([b({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),i("design:returntype","function"==typeof(u="undefined"!=typeof Promise&&Promise)?u:Object)],t.prototype,"uploadFile",null),o([b({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",[Object,"function"==typeof(E="undefined"!=typeof Function&&Function)?E:Object]),i("design:returntype","function"==typeof(N="undefined"!=typeof Promise&&Promise)?N:Object)],t.prototype,"getUploadMetadata",null),o([b({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(C=void 0!==d.ICloudbaseDeleteFileParams&&d.ICloudbaseDeleteFileParams)?C:Object,"function"==typeof(x="undefined"!=typeof Function&&Function)?x:Object]),i("design:returntype","function"==typeof(T="undefined"!=typeof Promise&&Promise)?T:Object)],t.prototype,"deleteFile",null),o([b({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(A=void 0!==d.ICloudbaseGetTempFileURLParams&&d.ICloudbaseGetTempFileURLParams)?A:Object,"function"==typeof(R="undefined"!=typeof Function&&Function)?R:Object]),i("design:returntype","function"==typeof(U="undefined"!=typeof Promise&&Promise)?U:Object)],t.prototype,"getTempFileURL",null),o([b({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(k=void 0!==d.ICloudbaseDownloadFileParams&&d.ICloudbaseDownloadFileParams)?k:Object,"function"==typeof(L="undefined"!=typeof Function&&Function)?L:Object]),i("design:returntype","function"==typeof(F="undefined"!=typeof Promise&&Promise)?F:Object)],t.prototype,"downloadFile",null),o([b({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p)]}),i("design:type",Function),i("design:paramtypes",["function"==typeof(M=void 0!==d.ICloudbaseCopyFileParams&&d.ICloudbaseCopyFileParams)?M:Object,"function"==typeof(D="undefined"!=typeof Function&&Function)?D:Object]),i("design:returntype","function"==typeof(B="undefined"!=typeof Promise&&Promise)?B:Object)],t.prototype,"copyFile",null),t}()},656:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadBuilder=e.StreamDownloadBuilder=void 0;var a=r(957),s=r(90);function c(t){return(0,a.isStorageError)(t)?t:new a.StorageError((null==t?void 0:t.message)||String(t))}function u(t){var e={};return void 0!==(null==t?void 0:t.download)&&(e.download=!0===t.download?"":t.download),void 0!==(null==t?void 0:t.cacheNonce)&&(e.cacheNonce=String(t.cacheNonce)),{headers:{},query:e}}var l=function(){function t(t){this.ctx=t}return t.prototype.then=function(t,e){return this.execute().then(t,e)},t.prototype.execute=function(){var t,e;return o(this,void 0,Promise,function(){var r,o,l,d,f;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=u(this.ctx.options),o=r.headers,l=r.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:n(n({},this.ctx.headers),o),query:l,signal:null===(t=this.ctx.parameters)||void 0===t?void 0:t.signal,cache:null===(e=this.ctx.parameters)||void 0===e?void 0:e.cache})];case 1:if(!(d=i.sent().response).body)throw new a.StorageApiError("Response body is empty",d.status,"STORAGE_PG_EMPTY_BODY");return[2,{data:d.body,error:null}];case 2:if(f=i.sent(),this.ctx.shouldThrowOnError)throw f;return[2,{data:null,error:c(f)}];case 3:return[2]}})})},t}();e.StreamDownloadBuilder=l;var d=function(){function t(t){this.ctx=t}return t.prototype.asStream=function(){return new l(this.ctx)},t.prototype.then=function(t,e){return this.execute().then(t,e)},t.prototype.execute=function(){var t,e;return o(this,void 0,Promise,function(){var r,o,a,l,d,f;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),r=u(this.ctx.options),o=r.headers,a=r.query,[4,this.ctx.http.download({path:"/object/".concat(this.ctx.bucketId,"/").concat((0,s.encodeObjectName)(this.ctx.cleanName)),headers:n(n({},this.ctx.headers),o),query:a,signal:null===(t=this.ctx.parameters)||void 0===t?void 0:t.signal,cache:null===(e=this.ctx.parameters)||void 0===e?void 0:e.cache})];case 1:return l=i.sent().response,f={},[4,l.blob()];case 2:return[2,(f.data=i.sent(),f.error=null,f)];case 3:if(d=i.sent(),this.ctx.shouldThrowOnError)throw d;return[2,{data:null,error:c(d)}];case 4:return[2]}})})},t}();e.DownloadBuilder=d},90:(t,e)=>{"use strict";function r(){return globalThis.Buffer}Object.defineProperty(e,"__esModule",{value:!0}),e.encodeObjectName=e.toBase64=e.getStringByteLength=void 0,e.getStringByteLength=function(t){var e;return null===(e=r())||void 0===e?void 0:e.byteLength(t)},e.toBase64=function(t){var e=r();return e?e.from(t).toString("base64"):btoa(t)},e.encodeObjectName=function(t){return t.split("/").map(function(t){return encodeURIComponent(t)}).join("/")}},98:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Http=e.handleOperation=void 0;var a=r(957),s="/v1/storages";e.handleOperation=function(t,e){return o(this,void 0,Promise,function(){var r;return i(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,{data:n.sent(),error:null}];case 2:if(r=n.sent(),e)throw r;return(0,a.isStorageError)(r)?[2,{data:null,error:r}]:[2,{data:null,error:new a.StorageError((null==r?void 0:r.message)||String(r))}];case 3:return[2]}})})};var c=function(){function t(t){this.ctx=t}return Object.defineProperty(t.prototype,"request",{get:function(){return this.ctx.request},enumerable:!1,configurable:!0}),t.prototype.gatewayOrigin=function(){return this.request.getBaseEndPoint("GATEWAY")},t.prototype.buildUrl=function(t,e){var r="".concat(this.gatewayOrigin()).concat(s).concat(t),n=function(t){if(!t)return"";var e=[];return Object.keys(t).forEach(function(r){var n=t[r];null!=n&&e.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(n))))}),e.join("&")}(e);return n&&(r+=(r.includes("?")?"&":"?")+n),r},t.prototype.toFullUrl=function(t){return t?/^https?:\/\//.test(t)||t.startsWith("//")?t:"".concat(this.gatewayOrigin()).concat(s).concat(t.startsWith("/")?"":"/").concat(t):t},t.prototype.send=function(t){return o(this,void 0,Promise,function(){var e,r,o,a,s,c;return i(this,function(i){switch(i.label){case 0:return e=this.buildUrl(t.path,t.query),r=t.method.toUpperCase(),o=["GET","HEAD"].includes(r),a=n({},t.headers||{}),o||(void 0!==t.rawBody?s=t.rawBody:void 0!==t.json&&(a["Content-Type"]=a["Content-Type"]||"application/json",s=JSON.stringify(t.json))),[4,this.request.fetch(n(n(n(n({url:e,method:r,headers:a},void 0!==s?{body:s}:{}),{withCredentials:!1!==t.withCredentials,shouldThrowOnError:!1}),t.signal?{signal:t.signal}:{}),t.cache?{cache:t.cache}:{}))];case 1:return c=i.sent(),[2,this.unwrap(c,e)]}})})},t.prototype.download=function(t){var e,r;return o(this,void 0,Promise,function(){var o,s,c,u;return i(this,function(i){switch(i.label){case 0:return o=this.buildUrl(t.path,t.query),[4,this.request.fetch(n(n({url:o,method:"GET",headers:n({},t.headers||{}),stream:!0,withCredentials:!1!==t.withCredentials,shouldThrowOnError:!1},t.signal?{signal:t.signal}:{}),t.cache?{cache:t.cache}:{}))];case 1:if(s=i.sent(),null===(e=t.signal)||void 0===e?void 0:e.aborted)throw new a.StorageApiError("The download was aborted",0,"STORAGE_PG_ABORTED");if(304===(c=Number(null!==(r=null==s?void 0:s.statusCode)&&void 0!==r?r:200)))throw new a.StorageApiError("Not Modified",c,"STORAGE_PG_NOT_MODIFIED");if(c>=400)throw new a.StorageApiError("Download failed with status ".concat(c),c,"STORAGE_PG_REQUEST_FAIL");if(!(u=null==s?void 0:s.response))throw new a.StorageApiError("Underlying adapter did not expose the raw Response",c,"STORAGE_PG_NO_RESPONSE");return[2,{response:u,status:c,header:null==s?void 0:s.header}]}})})},t.prototype.unwrap=function(t,e){var r,n;return o(this,void 0,Promise,function(){var o,s,c,u;return i(this,function(i){switch(i.label){case 0:o=Number(null!==(n=null!==(r=null==t?void 0:t.statusCode)&&void 0!==r?r:null==t?void 0:t.status)&&void 0!==n?n:200),s=null==t?void 0:t.data,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,s];case 2:return s=i.sent(),[3,4];case 3:return i.sent(),s=void 0,[3,4];case 4:if(o>=200&&o<300)return[2,s];throw c=(null==s?void 0:s.code)||(null==s?void 0:s.error)||"STORAGE_PG_REQUEST_FAIL",u=(null==s?void 0:s.message)||"Storage request failed with status ".concat(o,": ").concat(e),new a.StorageApiError(u,o,c)}})})},t}();e.Http=c},456:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.registerStorage=e.StorageClient=e.StorageFileApi=e.ClassicStorageFileApi=e.CloudbaseStorage=e.COMPONENT_NAME=void 0;var i=r(502),a=r(14),s=r(504),c=r(891),u=r(77),l=r(891);Object.defineProperty(e,"COMPONENT_NAME",{enumerable:!0,get:function(){return l.COMPONENT_NAME}}),Object.defineProperty(e,"CloudbaseStorage",{enumerable:!0,get:function(){return l.CloudbaseStorage}});var d=r(77);Object.defineProperty(e,"ClassicStorageFileApi",{enumerable:!0,get:function(){return d.ClassicStorageFileApi}});var f=r(502);Object.defineProperty(e,"StorageFileApi",{enumerable:!0,get:function(){return f.StorageFileApi}});var h=new c.CloudbaseStorage,p={name:c.COMPONENT_NAME,entity:{uploadFile:h.uploadFile,deleteFile:h.deleteFile,getTempFileURL:h.getTempFileURL,downloadFile:h.downloadFile,getUploadMetadata:h.getUploadMetadata,copyFile:h.copyFile,getFileInfo:h.getFileInfo,isGateWay:h.isGateWay}},v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.from=function(t){return t?((0,s.assertValidBucketId)(t,"from"),new i.StorageFileApi(this.http,t,this.shouldThrowOnError)):new u.ClassicStorageFileApi(this.http.ctx,this.shouldThrowOnError)},e}(a.StorageBucketApi);e.StorageClient=v;var y={name:"".concat(c.COMPONENT_NAME,"/supabase"),IIFE:!0,entity:function(){var t=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(t.has(this))return t.get(this);var e=this,r=new Proxy({},{get:function(t,r){return"config"===r?e.config:"request"===r?e.request:void 0}}),n=new v(r);return t.set(this,n),n},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(p),cloudbase.registerComponent(y)}catch(t){}function g(t){try{t.registerComponent(p),t.registerComponent(y)}catch(t){console.warn(t)}}e.registerStorage=g;try{window.registerStorage=g}catch(t){}},14:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.StorageBucketApi=void 0;var i=r(98),a=r(504),s=function(){function t(t,e){void 0===e&&(e=!1),this.http=new i.Http(t),this.shouldThrowOnError=e}return t.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},t.prototype.listBuckets=function(t){return n(this,void 0,Promise,function(){var e=this;return o(this,function(r){return[2,(0,i.handleOperation)(function(){var r={};return void 0!==(null==t?void 0:t.limit)&&(r.limit=t.limit),void 0!==(null==t?void 0:t.offset)&&(r.offset=t.offset),(null==t?void 0:t.sortColumn)&&(r.sortColumn=t.sortColumn),(null==t?void 0:t.sortOrder)&&(r.sortOrder=t.sortOrder),(null==t?void 0:t.search)&&(r.search=t.search),e.http.send({method:"GET",path:"/bucket/",query:r})},this.shouldThrowOnError)]})})},t.prototype.getBucket=function(t){return n(this,void 0,Promise,function(){var e=this;return o(this,function(r){return[2,(0,i.handleOperation)(function(){return(0,a.assertValidBucketId)(t,"getBucket"),e.http.send({method:"GET",path:"/bucket/".concat(t)})},this.shouldThrowOnError)]})})},t.prototype.createBucket=function(t,e){return n(this,void 0,Promise,function(){var r=this;return o(this,function(n){return[2,(0,i.handleOperation)(function(){var n;return(0,a.assertValidBucketId)(t,"createBucket"),r.http.send({method:"POST",path:"/bucket/",json:{id:t,name:t,public:null!==(n=null==e?void 0:e.public)&&void 0!==n&&n,type:null==e?void 0:e.type,file_size_limit:null==e?void 0:e.fileSizeLimit,allowed_mime_types:null==e?void 0:e.allowedMimeTypes}})},this.shouldThrowOnError)]})})},t.prototype.updateBucket=function(t,e){return n(this,void 0,Promise,function(){var r=this;return o(this,function(n){return[2,(0,i.handleOperation)(function(){return(0,a.assertValidBucketId)(t,"updateBucket"),r.http.send({method:"PUT",path:"/bucket/".concat(t),json:{public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes}})},this.shouldThrowOnError)]})})},t.prototype.deleteBucket=function(t){return n(this,void 0,Promise,function(){var e=this;return o(this,function(r){return[2,(0,i.handleOperation)(function(){return(0,a.assertValidBucketId)(t,"deleteBucket"),e.http.send({method:"DELETE",path:"/bucket/".concat(t)})},this.shouldThrowOnError)]})})},t}();e.StorageBucketApi=s},77:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.ClassicStorageFileApi=void 0;var a=r(877),s=r(957),c=r(891),u=r(90),l=a.constants.ERRORS,d=function(){function t(t,e){void 0===e&&(e=!1),this.shouldThrowOnError=!1,this.bucketId="",this.context=t,this.shouldThrowOnError=e,this.storage=new c.CloudbaseStorage(t)}return Object.defineProperty(t.prototype,"config",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.request},enumerable:!1,configurable:!0}),t.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},t.prototype.upload=function(t,e,r){return o(this,void 0,Promise,function(){var o,a,u,d,f,h,p,v,y;return i(this,function(i){switch(i.label){case 0:o=n({upsert:!0},r),a=o.cacheControl,u=o.contentType,d=o.metadata,i.label=1;case 1:return i.trys.push([1,3,,4]),f=this.getCloudPath(t),h={cloudPath:f,filePath:e},(a||u||d)&&(p={},a&&(p["cache-control"]=a),u&&(p["content-type"]=u),d&&(p["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(d))),h.headers=p),[4,this.storage.uploadFile(h)];case 2:if(!(v=i.sent()).fileID)throw new Error(JSON.stringify({code:l.OPERATION_FAIL,msg:"[".concat(c.COMPONENT_NAME,".update] no fileID returned")}));return[2,{data:{id:v.fileID,path:t,fullPath:t},error:null}];case 3:if(y=i.sent(),this.shouldThrowOnError)throw y;if((0,s.isStorageError)(y))return[2,{data:null,error:y}];throw y;case 4:return[2]}})})},t.prototype.uploadToSignedUrl=function(t,e,r,n){return o(this,void 0,Promise,function(){return i(this,function(e){return[2,this.upload(t,r,n)]})})},t.prototype.createSignedUploadUrl=function(t){return o(this,void 0,Promise,function(){var e,r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e=this.getCloudPath(t),[4,this.storage.getUploadMetadata({cloudPath:e})];case 1:return[2,{data:{signedUrl:(r=o.sent().data).url,token:r.token,path:t,authorization:r.authorization,id:r.fileId,cosFileId:r.cosFileId,downloadUrl:r.download_url},error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;return[2,{data:null,error:n instanceof s.StorageError?n:new s.StorageError(n.message)}];case 3:return[2]}})})},t.prototype.update=function(t,e,r){return o(this,void 0,Promise,function(){return i(this,function(o){return[2,this.upload(t,e,n(n({},r),{upsert:!0}))]})})},t.prototype.move=function(t,e){return o(this,void 0,Promise,function(){var r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(t),dstPath:this.getCloudPath(e),overwrite:!0,removeOriginal:!0}]})];case 1:if((r=o.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new s.StorageError(r.fileList[0].message||"Move failed");return[2,{data:{message:"File moved from ".concat(t," to ").concat(e)},error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.copy=function(t,e){return o(this,void 0,Promise,function(){var r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(t),dstPath:this.getCloudPath(e),overwrite:!0,removeOriginal:!1}]})];case 1:if((r=o.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new s.StorageError(r.fileList[0].message||"Copy failed");return[2,{data:{path:this.getCloudPath(e)},error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.createSignedUrl=function(t,e,r){return o(this,void 0,Promise,function(){var n,o,a,c,u,l,d;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=this.normalizeCloudId(t),[4,this.storage.getTempFileURL({fileList:[{fileID:n,maxAge:e}]})];case 1:if("SUCCESS"!==(o=i.sent()).fileList[0].code)throw new s.StorageError("Failed to create signed URL: [".concat(o.fileList[0].code,"] ").concat(o.fileList[0].fileID));return a=o.fileList[0].download_url,c=[],void 0!==(null==r?void 0:r.download)&&("string"==typeof r.download?c.push("download=".concat(encodeURIComponent(r.download))):!0===r.download&&c.push("download=true")),(null==r?void 0:r.transform)&&(u=this.transformOptsToQueryString(r.transform))&&c.push(u),c.length>0&&(l=a.includes("?")?"&":"?",a="".concat(a).concat(l).concat(c.join("&"))),[2,{data:{signedUrl:a},error:null}];case 2:if(d=i.sent(),this.shouldThrowOnError)throw d;if((0,s.isStorageError)(d))return[2,{data:null,error:d}];throw d;case 3:return[2]}})})},t.prototype.createSignedUrls=function(t,e){return o(this,void 0,Promise,function(){var r,n,o=this;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=t.map(function(t){return{fileID:o.normalizeCloudId(t),maxAge:e}}),[4,this.storage.getTempFileURL({fileList:r})];case 1:return[2,{data:i.sent().fileList.map(function(e,r){return{path:t[r],signedUrl:e.tempFileURL||"",error:"SUCCESS"===e.code?null:e.message}}),error:null}];case 2:if(n=i.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.download=function(t,e){return o(this,void 0,Promise,function(){var r,n,a=this;return i(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),n={},[4,o(a,void 0,void 0,function(){var r,n,o,a;return i(this,function(i){switch(i.label){case 0:return[4,this.createSignedUrl(t,600,{transform:e})];case 1:if((r=i.sent()).error)throw r.error;return n=encodeURI(null===(a=r.data)||void 0===a?void 0:a.signedUrl),[4,this.request.reqClass.get({url:n,headers:{},responseType:"blob"})];case 2:if(!(o=i.sent().data))throw new s.StorageError("Download failed: no file content");return[2,new Blob([o])]}})})];case 1:return[2,(n.data=c.sent(),n.error=null,n)];case 2:if(r=c.sent(),this.shouldThrowOnError)throw r;if((0,s.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}})})},t.prototype.info=function(t){return o(this,void 0,Promise,function(){var e,r,n,o,a,c,u,l;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=t.startsWith("cloud://"),r=e?this.extractPathFromFileId(t):t,n=e?this.extractBucketFromFileId(t):this.bucketId,[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(t)]})];case 1:if(o=i.sent(),"SUCCESS"!==(a=o.fileList[0]).code)throw new s.StorageError(a.message);return c=(new Date).toISOString(),u=(a.lastModified?new Date(a.lastModified):new Date).toISOString(),[2,{data:{id:a.fileID,version:"1",name:r,bucketId:n,updatedAt:u,createdAt:u,lastAccessedAt:c,size:a.size,cacheControl:a.cacheControl,contentType:a.contentType,etag:a.etag,lastModified:u,metadata:{}},error:null}];case 2:if(l=i.sent(),this.shouldThrowOnError)throw l;return[2,{data:null,error:l instanceof s.StorageError?l:new s.StorageError(l.message)}];case 3:return[2]}})})},t.prototype.exists=function(t){return o(this,void 0,Promise,function(){var e,r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(t)]})];case 1:if(e=o.sent(),"FILE_NOT_FOUND"===(r=e.fileList[0]).code)return[2,{data:!1,error:null}];if("SUCCESS"!==r.code)throw new s.StorageError(r.message);return[2,{data:!0,error:null}];case 2:if(n=o.sent(),this.shouldThrowOnError)throw n;if((0,s.isStorageError)(n))return[2,{data:null,error:n}];throw n;case 3:return[2]}})})},t.prototype.getPublicUrl=function(t,e){return o(this,void 0,Promise,function(){var r;return i(this,function(n){switch(n.label){case 0:return[4,this.createSignedUrl(t,600,e)];case 1:return(r=n.sent()).data?[2,{data:{publicUrl:r.data.signedUrl}}]:[2,{data:null,error:r.error}]}})})},t.prototype.remove=function(t){return o(this,void 0,Promise,function(){var e,r,n,o,a,c,u,l,d,f,h=this;return i(this,function(i){switch(i.label){case 0:for(i.trys.push([0,3,,4]),e=10,r=[],n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return[4,Promise.all(r.map(function(t){return Promise.all(t.map(function(t){return h.info(t)}))}))];case 1:return o=i.sent(),a=new Map,o.forEach(function(r,n){r.forEach(function(r,o){r.data&&a.set(t[n*e+o],r.data)})}),c=t.map(function(t){return h.normalizeCloudId(t)}),[4,this.storage.deleteFile({fileList:c})];case 2:if(u=i.sent(),(l=u.fileList.filter(function(t){return"SUCCESS"!==t.code})).length>0)throw new s.StorageError("Delete failed for ".concat(l.length," file(s)"));return d=(new Date).toISOString(),[2,{data:t.map(function(t){var e=a.get(t);return{name:null==e?void 0:e.name,id:null==e?void 0:e.id,bucket_id:null==e?void 0:e.bucketId,owner:void 0,updated_at:(null==e?void 0:e.updatedAt)||d,created_at:null==e?void 0:e.createdAt,last_accessed_at:(null==e?void 0:e.lastAccessedAt)||d,metadata:(null==e?void 0:e.metadata)||{},buckets:{id:null==e?void 0:e.bucketId,name:null==e?void 0:e.bucketId,owner:void 0,public:!1,created_at:"",updated_at:d}}}),error:null}];case 3:if(f=i.sent(),this.shouldThrowOnError)throw f;if((0,s.isStorageError)(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}})})},t.prototype.list=function(){return o(this,void 0,void 0,function(){return i(this,function(t){throw new s.StorageError("Not implemented")})})},t.prototype.getCloudPath=function(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")},t.prototype.normalizeCloudId=function(t){var e;if(/^cloud:\/\//.test(t))return t;var r=this.getCloudPath(t);if(!this.bucketId)throw new s.StorageError("bucketId is not set");var n=(null===(e=this.config)||void 0===e?void 0:e.env)||"";return n?"cloud://".concat(n,".").concat(this.bucketId,"/").concat(r):void 0},t.prototype.toBase64=function(t){return(0,u.toBase64)(t)},t.prototype.transformOptsToQueryString=function(t){var e=["imageMogr2"];if(t.width||t.height){var r=t.width||"",n=t.height||"";"fill"===t.resize?e.push("thumbnail/".concat(r,"x").concat(n,"!")):"contain"===t.resize?e.push("thumbnail/".concat(r,"x").concat(n)):e.push("thumbnail/".concat(r,"x").concat(n,"^"))}if(t.format&&"origin"!==t.format&&e.push("format/".concat(t.format)),void 0!==t.quality){var o=Math.max(1,Math.min(100,t.quality));e.push("quality/".concat(o))}return e.join("/")},t.prototype.extractPathFromFileId=function(t){var e=t.replace(/^cloud:\/\//,"").split("/");return e.length<2?t:e.slice(1).join("/")},t.prototype.extractBucketFromFileId=function(t){var e=t.replace(/^cloud:\/\//,"").split("/");if(e.length<1)return"";var r=e[0],n=r.indexOf(".");return-1===n?r:r.substring(n+1)},t}();e.ClassicStorageFileApi=d},502:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.StorageFileApi=void 0;var a=r(957),s=r(90),c=r(98),u=r(656),l="3600",d=function(){function t(t,e,r){void 0===r&&(r=!1),this.headers={},this.http=t,this.bucketId=e,this.shouldThrowOnError=r}return t.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},t.prototype.setHeader=function(t,e){var r;if("string"!=typeof t||""===t.trim())throw new a.StorageError("setHeader requires a non-empty header name");if(/[\r\n]/.test(t)||"string"==typeof e&&/[\r\n]/.test(e))throw new a.StorageError("setHeader does not allow CR/LF characters in header name or value");return this.headers=n(n({},this.headers),((r={})[t]=String(e),r)),this},t.prototype.upload=function(t,e,r){return o(this,void 0,Promise,function(){return i(this,function(n){return[2,this.uploadOrUpdate("POST",t,e,r)]})})},t.prototype.update=function(t,e,r){return o(this,void 0,Promise,function(){return i(this,function(n){return[2,this.uploadOrUpdate("PUT",t,e,r)]})})},t.prototype.download=function(t,e,r){return new u.DownloadBuilder({http:this.http,bucketId:this.bucketId,cleanName:this.cleanPath(t),options:e,parameters:r,headers:this.headers,shouldThrowOnError:this.shouldThrowOnError})},t.prototype.list=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n;return i(this,function(o){return n={prefix:t||""},void 0!==(null==e?void 0:e.limit)&&(n.limit=e.limit),void 0!==(null==e?void 0:e.cursor)&&(n.cursor=e.cursor),void 0!==(null==e?void 0:e.withDelimiter)&&(n.with_delimiter=e.withDelimiter),void 0!==(null==e?void 0:e.sortBy)&&(n.sortBy=e.sortBy),[2,this.send({method:"POST",path:"/object/list/".concat(this.bucketId),json:n,signal:null==r?void 0:r.signal,cache:null==r?void 0:r.cache})]})})},this.shouldThrowOnError)]})})},t.prototype.remove=function(t){return o(this,void 0,Promise,function(){var e=this;return i(this,function(r){return[2,(0,c.handleOperation)(function(){return o(e,void 0,void 0,function(){var e,r,n,o,a,s=this;return i(this,function(i){switch(i.label){case 0:e=t.map(function(t){return s.cleanPath(t)}),r=[],n=0,i.label=1;case 1:return n<e.length?(o=e.slice(n,n+100),[4,this.send({method:"DELETE",path:"/object/".concat(this.bucketId),json:{prefixes:o}})]):[3,4];case 2:a=i.sent(),Array.isArray(a)&&r.push.apply(r,a),i.label=3;case 3:return n+=100,[3,1];case 4:return[2,r]}})})},this.shouldThrowOnError)]})})},t.prototype.copy=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n;return i(this,function(o){switch(o.label){case 0:return n=this.buildCopyMoveHeaders(r),[4,this.send({method:"POST",path:"/object/copy",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(t),destinationKey:this.cleanPath(e),destinationBucket:null==r?void 0:r.destinationBucket,copyMetadata:null==r?void 0:r.copyMetadata,metadata:null==r?void 0:r.metadata},headers:n})];case 1:return[2,{path:o.sent().Key}]}})})},this.shouldThrowOnError)]})})},t.prototype.move=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return[4,this.send({method:"POST",path:"/object/move",json:{bucketId:this.bucketId,sourceKey:this.cleanPath(t),destinationKey:this.cleanPath(e),destinationBucket:null==r?void 0:r.destinationBucket}})];case 1:return[2,{message:n.sent().message||"Successfully moved"}]}})})},this.shouldThrowOnError)]})})},t.prototype.info=function(t){return o(this,void 0,Promise,function(){var e=this;return i(this,function(r){return[2,(0,c.handleOperation)(function(){return o(e,void 0,void 0,function(){var e,r;return i(this,function(n){switch(n.label){case 0:return e=this.cleanPath(t),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(e))})];case 1:return[2,{id:(r=n.sent()).id,name:r.name,version:r.version,bucketId:r.bucket_id,size:r.size,contentType:r.content_type,cacheControl:r.cache_control,etag:r.etag,metadata:r.metadata,lastModified:r.last_modified,createdAt:r.created_at}]}})})},this.shouldThrowOnError)]})})},t.prototype.exists=function(t){return o(this,void 0,Promise,function(){var e,r,n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e=this.cleanPath(t),[4,this.send({method:"GET",path:"/object/info/".concat(this.bucketId,"/").concat(this.encodePath(e))})];case 1:return o.sent(),[2,{data:!0,error:null}];case 2:if(r=o.sent(),void 0!==(n=null==r?void 0:r.status)&&[400,404].includes(Number(n)))return[2,{data:!1,error:null}];if(this.shouldThrowOnError)throw r;return[2,{data:null,error:r instanceof a.StorageError?r:new a.StorageError((null==r?void 0:r.message)||String(r))}];case 3:return[2]}})})},t.prototype.createSignedUrl=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n,o,a;return i(this,function(i){switch(i.label){case 0:return n=this.cleanPath(t),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId,"/").concat(this.encodePath(n)),json:{expiresIn:e}})];case 1:return o=i.sent(),a=o.fullSignedURL||this.http.toFullUrl(o.signedURL||""),[2,{fullSignedURL:this.appendUrlOptions(a,r)}]}})})},this.shouldThrowOnError)]})})},t.prototype.createSignedUrls=function(t,e,r){return o(this,void 0,Promise,function(){var n=this;return i(this,function(a){return[2,(0,c.handleOperation)(function(){return o(n,void 0,void 0,function(){var n,o,a,s,c=this;return i(this,function(i){switch(i.label){case 0:n=t.map(function(t){return c.cleanPath(t)}),o=[],a=0,i.label=1;case 1:return a<n.length?(s=n.slice(a,a+500),[4,this.send({method:"POST",path:"/object/sign/".concat(this.bucketId),json:{expiresIn:e,paths:s}})]):[3,4];case 2:i.sent().forEach(function(t){var e,n=t.fullSignedURL||(t.signedURL?c.http.toFullUrl(t.signedURL):null);o.push({path:t.path,fullSignedURL:n?c.appendUrlOptions(n,r):null,error:null!==(e=t.error)&&void 0!==e?e:null})}),i.label=3;case 3:return a+=500,[3,1];case 4:return[2,o]}})})},this.shouldThrowOnError)]})})},t.prototype.createSignedUploadUrl=function(t,e){return o(this,void 0,Promise,function(){var r=this;return i(this,function(n){return[2,(0,c.handleOperation)(function(){return o(r,void 0,void 0,function(){var r,n,o;return i(this,function(i){switch(i.label){case 0:return r=this.cleanPath(t),n={},(null==e?void 0:e.upsert)&&(n["x-upsert"]="true"),[4,this.send({method:"POST",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(r)),headers:n})];case 1:return[2,{fullSignedURL:(o=i.sent()).fullURL||this.http.toFullUrl(o.url||""),path:r,token:o.token}]}})})},this.shouldThrowOnError)]})})},t.prototype.uploadToSignedUrl=function(t,e,r,n){return o(this,void 0,Promise,function(){var a=this;return i(this,function(s){return[2,(0,c.handleOperation)(function(){return o(a,void 0,void 0,function(){var o,a,s,c,u;return i(this,function(i){switch(i.label){case 0:return o=this.cleanPath(t),a=this.buildUploadBody(r,n),s=a.body,c=a.headers,[4,this.send({method:"PUT",path:"/object/upload/sign/".concat(this.bucketId,"/").concat(this.encodePath(o)),query:{token:e},rawBody:s,headers:c,withCredentials:!1})];case 1:return u=i.sent(),[2,{path:o,fullPath:u.Key}]}})})},this.shouldThrowOnError)]})})},t.prototype.getPublicUrl=function(t,e){var r=this.cleanPath(t),n=this.http.buildUrl("/object/public/".concat(this.bucketId,"/").concat(this.encodePath(r)));return{data:{publicUrl:this.appendUrlOptions(n,e)}}},t.prototype.send=function(t){return this.http.send(n(n({},t),{headers:n(n({},this.headers),t.headers||{})}))},t.prototype.uploadOrUpdate=function(t,e,r,n){return o(this,void 0,Promise,function(){var a=this;return i(this,function(s){return[2,(0,c.handleOperation)(function(){return o(a,void 0,void 0,function(){var o,a,s,c,u;return i(this,function(i){switch(i.label){case 0:return o=this.cleanPath(e),a=this.buildUploadBody(r,n),s=a.body,c=a.headers,"POST"===t&&(c["x-upsert"]=String(Boolean(null==n?void 0:n.upsert))),[4,this.send({method:t,path:"/object/".concat(this.bucketId,"/").concat(this.encodePath(o)),rawBody:s,headers:c})];case 1:return[2,{id:(u=i.sent()).Id,path:o,fullPath:u.Key}]}})})},this.shouldThrowOnError)]})})},t.prototype.cleanPath=function(t){var e=t.replace(/^\/+|\/+$/g,"").replace(/\/+/g,"/");if(e.split("/").some(function(t){return".."===t}))throw new a.StorageError('invalid path: ".." segment is not allowed');return e},t.prototype.encodePath=function(t){return(0,s.encodeObjectName)(t)},t.prototype.buildUploadBody=function(t,e){var r,o,i,a,s,c=n({},(null==e?void 0:e.headers)||{}),u=t,d="undefined"!=typeof FormData&&t instanceof FormData;if("undefined"!=typeof Blob&&t instanceof Blob||d){var f=void 0,h={};if(d){var p=this.extractFromFormData(t);f=p.file,h=p.fields}else f=t;var v=null!==(o=null!==(r=null==e?void 0:e.cacheControl)&&void 0!==r?r:h.cacheControl)&&void 0!==o?o:l,y=null!==(i=null==e?void 0:e.contentType)&&void 0!==i?i:h.contentType,g=void 0!==(null==e?void 0:e.metadata)?JSON.stringify(e.metadata):h.metadata,m=new FormData;void 0!==v&&m.append("cacheControl",String(v)),void 0!==y&&m.append("contentType",y),void 0!==g&&m.append("metadata",g),m.append("",f),u=m}else u=t,v=null!==(a=null==e?void 0:e.cacheControl)&&void 0!==a?a:l,y=null!==(s=null==e?void 0:e.contentType)&&void 0!==s?s:"text/plain;charset=UTF-8",c["cache-control"]="max-age=".concat(v),y&&(c["content-type"]=y),(null==e?void 0:e.metadata)&&(c["x-metadata"]=this.toBase64(JSON.stringify(e.metadata)));return{body:u,headers:c}},t.prototype.extractFromFormData=function(t){var e,r={},n=0,o=[];if(t.forEach(function(t,i){if("undefined"!=typeof Blob&&t instanceof Blob)return e=t,void(n+=1);"cacheControl"!==i&&"contentType"!==i&&"metadata"!==i?o.push(i):r[i]=String(t)}),o.length>0&&console.warn("Ignored unsupported FormData field(s): [".concat(o.join(", "),"]. Only file, cacheControl, contentType and metadata are supported")),0===n||!e)throw new a.StorageError("FormData must contain a file");if(n>1)throw new a.StorageError("FormData must contain exactly one file");return{file:e,fields:r}},t.prototype.buildCopyMoveHeaders=function(t){var e={};return(null==t?void 0:t.upsert)&&(e["x-upsert"]="true"),!1===(null==t?void 0:t.copyMetadata)&&(null==t?void 0:t.metadata)&&(e["x-metadata"]=this.toBase64(JSON.stringify(t.metadata))),e},t.prototype.appendUrlOptions=function(t,e){var r=[];if(void 0!==(null==e?void 0:e.download)){var n=!0===e.download?"":String(e.download);r.push("download=".concat(encodeURIComponent(n)))}if(void 0!==(null==e?void 0:e.cacheNonce)&&r.push("cacheNonce=".concat(encodeURIComponent(String(e.cacheNonce)))),0===r.length)return t;var o=t.includes("?")?"&":"?";return"".concat(t).concat(o).concat(r.join("&"))},t.prototype.toBase64=function(t){return(0,s.toBase64)(t)},t}();e.StorageFileApi=d},957:function(t,e){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StorageUnknownError=e.StorageApiError=e.isStorageError=e.StorageError=void 0;var o=function(t){function e(e){var r=t.call(this,e)||this;return r.__isStorageError=!0,r.name="StorageError",r}return n(e,t),e}(Error);e.StorageError=o,e.isStorageError=function(t){return"object"==typeof t&&null!==t&&"__isStorageError"in t};var i=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.name="StorageApiError",o.status=r,o.statusCode=n,o}return n(e,t),e.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},e}(o);e.StorageApiError=i;var a=function(t){function e(e,r){var n=t.call(this,e)||this;return n.name="StorageUnknownError",n.originalError=r,n}return n(e,t),e}(o);e.StorageUnknownError=a},504:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidBucketId=e.isValidBucketId=void 0;var n=r(957),o=/[\x00-\x20\x7f/\\?#%]/;e.isValidBucketId=function(t){return"string"==typeof t&&t.length>0&&t.length<=256&&!o.test(t)},e.assertValidBucketId=function(t,e){if("string"!=typeof t||0===t.length)throw new n.StorageError("[storage.".concat(e,"] bucketId is required"));if(t.length>256)throw new n.StorageError("[storage.".concat(e,"] invalid bucketId: length must be 1-").concat(256));var r=o.exec(t);if(r){var i="[storage.".concat(e,'] invalid bucketId "').concat(t,'": ')+"contains forbidden character ".concat(JSON.stringify(r[0]),"; ")+'must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"';throw new n.StorageError(i)}}},563:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var s,c=a(r(92)),u=r(962);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(s=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(t,e){for(var r=0,o=(0,u.isArray)(t)?t:[t];r<o.length;r++){var i=o[r],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:n({isMatch:a},s(e)),runtime:c}}},e.useDefaultAdapter=function(){return{adapter:n({},c.genAdapter()),runtime:s.WEB}}},92:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRequest=e.genAdapter=void 0;var c=r(829),u=r(962),l=r(464),d=function(t){function e(e){var r=t.call(this)||this,n=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return r.timeout=n||0,r.timeoutMsg=o||"请求超时",r.restrictedMethods=i||["get","post","upload","download"],r}return o(e,t),e.prototype.get=function(t){return this.request(i(i({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(i(i({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(i(i({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,n=t.name,o=t.method,a=t.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(e).forEach(function(t){u.append(t,e[t])}),u.append("key",n),u.append("file",r),this.request(i(i({},t),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},t),{method:"put",headers:s,body:r}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return a(this,void 0,Promise,function(){var e,r,n,o;return s(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},t),{headers:{},responseType:"blob"}))];case 1:return e=a.sent().data,r=window.URL.createObjectURL(new Blob([e])),n=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=r,o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(r),document.body.removeChild(o),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(e){e({statusCode:200,tempFilePath:t.url})})]}})})},e.prototype.fetch=function(t){var e;return a(this,void 0,Promise,function(){var r,n,o,c,u,l,d,f,h,p,v,y,g,m=this;return s(this,function(b){switch(b.label){case 0:return r=new AbortController,n=t.url,o=t.enableAbort,c=void 0!==o&&o,u=t.stream,l=void 0!==u&&u,d=t.signal,f=t.timeout,h=t.shouldThrowOnError,p=void 0===h||h,v=null!=f?f:this.timeout,d&&(d.aborted&&r.abort(),d.addEventListener("abort",function(){return r.abort()})),y=null,c&&v&&(y=setTimeout(function(){console.warn(m.timeoutMsg),r.abort(new Error(m.timeoutMsg))},v)),[4,fetch(n,i(i({},t),{signal:r.signal})).then(function(t){return a(m,void 0,void 0,function(){var e,r,n;return s(this,function(o){switch(o.label){case 0:return clearTimeout(y),p?t.ok?(e=t,[3,3]):[3,1]:[3,4];case 1:return n=(r=Promise).reject,[4,t.json()];case 2:e=n.apply(r,[o.sent()]),o.label=3;case 3:return[2,e];case 4:return[2,t]}})})}).catch(function(t){return clearTimeout(y),Promise.reject(t)})];case 1:return g=b.sent(),[2,{data:l?g.body:(null===(e=g.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))?g.json():g.text(),statusCode:g.status,header:g.headers,response:g}]}})})},e.prototype.request=function(t,e){var r=this;void 0===e&&(e=!1);var n=String(t.method).toLowerCase()||"get";return new Promise(function(o){var i=t.url,a=t.headers,s=void 0===a?{}:a,c=t.data,d=t.responseType,f=t.withCredentials,h=t.body,p=t.onUploadProgress,v=(0,u.formatUrl)((0,l.getProtocol)(),i,"get"===n?c:{}),y=new XMLHttpRequest;y.open(n,v),d&&(y.responseType=d);var g,m,b=t.signal;b&&(b.aborted?y.abort():b.addEventListener("abort",function(){return y.abort()},{once:!0})),Object.keys(s).forEach(function(t){y.setRequestHeader(t,s[t])}),p&&y.upload.addEventListener("progress",p),y.onreadystatechange=function(){var t={};if(4===y.readyState){var e=y.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach(function(t){var e=t.split(": "),n=e.shift().toLowerCase(),o=e.join(": ");r[n]=o}),t.header=r,t.statusCode=y.status;try{t.data="blob"===d?y.response:JSON.parse(y.responseText)}catch(e){t.data="blob"===d?y.response:y.responseText}clearTimeout(g),o(t)}},e&&r.timeout&&(g=setTimeout(function(){console.warn(r.timeoutMsg),y.abort()},r.timeout)),m=(0,u.isFormData)(c)?c:"application/x-www-form-urlencoded"===s["content-type"]?(0,u.toQueryString)(c):h||(c?JSON.stringify(c):void 0),f&&(y.withCredentials=!0),y.send(m)})},e}(c.AbstractSDKRequest);e.WebRequest=d,e.genAdapter=function(){return{type:"default",root:window,reqClass:d,wsClass:WebSocket,localStorage}}},464:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.COMMUNITY_SITE_URL=e.IS_DEBUG_MODE=e.getProtocol=e.setProtocol=e.getSdkName=e.setSdkName=void 0;var r="@cloudbase/js-sdk";e.setSdkName=function(t){r=t},e.getSdkName=function(){return r};var n="https:";e.setProtocol=function(t){n=t},e.getProtocol=function(){return n},e.IS_DEBUG_MODE=!1,e.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},519:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERRORS=void 0,e.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},778:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.OATUH_LOGINTYPE=void 0,o(r(464),e),o(r(519),e),e.OATUH_LOGINTYPE="constants"},517:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.catchErrorsDecorator=void 0;var i=r(962),a=r(778),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(t){var e=t.err,r=t.className,n=t.methodName,o=t.sourceLink;if(!o)return null;var i,a=e.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]")),d=a.findIndex(function(t){return c.test(t)});if(-1!==d){var f=a.filter(function(t,e){return e>d});f.unshift(a[d].replace(l,"".concat(r,".").concat(n)).replace(u,o)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(f.join("\n"))}return i}e.catchErrorsDecorator=function(t){var e=t.mode,r=void 0===e?"async":e,s=t.customInfo,d=void 0===s?{}:s,f=t.title,h=t.messages,p=void 0===h?[]:h;return function(t,e,s){if(a.IS_DEBUG_MODE){var h=d.className||t.constructor.name,v=d.methodName||e,y=s.value,g=function(){var t="",e=(new Error).stack.split("\n"),r=e.findIndex(function(t){return c.test(t)});if(-1!==r){var n=u.exec(e[r+1]||"");t=n?n[0]:""}return t}();s.value="sync"===r?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=l({err:new Error,className:h,methodName:v,sourceLink:g});try{return y.apply(this,t)}catch(t){var n=t,o=t.message,a=t.error,s=t.error_description,c={title:f||"".concat(h,".").concat(v," failed"),content:[{type:"error",body:t}]};if(o&&/^\{.*\}$/.test(o)){var u=JSON.parse(o);c.subtitle=o,u.code&&(r?(r.code=u.code,r.msg=u.msg):(t.code=u.code,t.message=u.msg),n=r||t,c.content=p.map(function(t){return{type:"info",body:t}}))}throw a&&s&&(c.subtitle=s,r?(r.code=a,r.msg=s):(t.code=a,t.message=s),n=r||t,c.content=p.map(function(t){return{type:"info",body:t}})),(0,i.printGroupLog)(c),n}}:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(this,void 0,void 0,function(){var e,r,n,a,s,c,u,d;return o(this,function(o){switch(o.label){case 0:e=l({err:new Error,className:h,methodName:v,sourceLink:g}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,y.apply(this,t)];case 2:return[2,o.sent()];case 3:throw r=o.sent(),n=r,a=r.message,s=r.error,c=r.error_description,u={title:f||"".concat(h,".").concat(v," failed"),content:[{type:"error",body:r}]},a&&/^\{.*\}$/.test(a)&&(d=JSON.parse(a),u.subtitle=d,d.code&&(e?(e.code=d.code,e.message=d.msg):(r.code=d.code,r.message=d.msg),n=e||r,u.content=p.map(function(t){return{type:"info",body:t}}))),s&&c&&(u.subtitle=c,e?(e.code=s,e.msg=c):(r.code=s,r.message=c),n=e||r,u.content=p.map(function(t){return{type:"info",body:t}})),(0,i.printGroupLog)(u),n;case 4:return[2]}})})}}}}},260:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(517),e)},877:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.langEvent=e.AbortController=e.jwt=e.helpers=e.utils=e.events=e.cache=e.adapters=e.constants=void 0;var s=i(r(778));e.constants=s;var c=i(r(563));e.adapters=c;var u=i(r(865));e.cache=u;var l=i(r(940));e.events=l;var d=i(r(991));e.langEvent=d;var f=i(r(962));e.utils=f;var h=i(r(260));e.helpers=h;var p=a(r(644));e.AbortController=p.default;var v={decode:a(r(949)).default};e.jwt=v},644:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){var t=this;this.listeners=[],this.signal={aborted:!1,addEventListener:function(e,r){"abort"===e&&t.listeners.push(r)}}}return t.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.listeners.forEach(function(t){return t()}))},t}();e.default=r},865:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseCache=void 0;var s=r(829),c=r(962),u=r(778),l=function(t){function e(e){var r=t.call(this)||this;return r.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return o(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}(s.AbstractStorage),d=function(){function t(t){this.keys={};var e=t.persistence,r=t.platformInfo,n=void 0===r?{}:r,o=t.keys,i=void 0===o?{}:o;this.platformInfo=n,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(e.root));case"none":return new l(e.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}return Object.defineProperty(t.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),t.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this.storage)try{var n={version:r||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(n))}catch(t){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:t}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,r){return i(this,void 0,void 0,function(){var n;return a(this,function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),n={version:r||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(n))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}})})},t.prototype.getStore=function(t,e){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var n=this.storage.getItem(t);return n&&n.indexOf(e)>=0?JSON.parse(n).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var r;return i(this,void 0,void 0,function(){var n;return a(this,function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(n=o.sent())&&n.indexOf(e)>=0?[2,JSON.parse(n).content]:[2,""]}})})},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return i(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}})})},t}();e.CloudbaseCache=d},940:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.activateEvent=e.addEventListener=e.CloudbaseEventEmitter=e.IErrorEvent=e.CloudbaseEvent=void 0;var a=r(962),s=function(t,e){this.data=e||null,this.name=t};e.CloudbaseEvent=s;var c=function(t){function e(e,r){var n=t.call(this,"error",{error:e,data:r})||this;return n.error=e,n}return o(e,t),e}(s);e.IErrorEvent=c;var u=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if((0,a.isInstanceOf)(t,c))return console.error(t.error),this;var r=(0,a.isString)(t)?new s(t,e||{}):t,n=r.name;if(this.listens(n)){r.target=this;for(var o=0,u=this.listeners[n]?i([],this.listeners[n],!0):[];o<u.length;o++)u[o].call(this,r)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}();e.CloudbaseEventEmitter=u;var l=new u;e.addEventListener=function(t,e){l.on(t,e)},e.activateEvent=function(t,e){void 0===e&&(e={}),l.fire(t,e)},e.removeEventListener=function(t,e){l.off(t,e)}},991:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LANG_CHANGE_EVENT=e.bus=void 0;var n=r(940);e.bus=new n.CloudbaseEventEmitter,e.LANG_CHANGE_EVENT="lang_change"},962:function(t,e,r){"use strict";var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.parseCaptcha=e.parseQueryString=e.transformPhone=e.sleep=e.printGroupLog=e.throwError=e.printInfo=e.printError=e.printWarn=e.execCallback=e.createPromiseCallback=e.removeParam=e.getHash=e.getQuery=e.toQueryString=e.formatUrl=e.generateRequestId=e.genSeqId=e.isFormData=e.isInstanceOf=e.isNull=e.isPalinObject=e.isUndefined=e.isString=e.isArray=void 0;var o=r(778);e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isUndefined=function(t){return void 0===t},e.isPalinObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isNull=function(t){return"[object Null]"===Object.prototype.toString.call(t)},e.isInstanceOf=function(t,e){return t instanceof e},e.isFormData=function(t){return"[object FormData]"===Object.prototype.toString.call(t)},e.genSeqId=function(){return Math.random().toString(16).slice(2)},e.generateRequestId=function(){var t=(new Date).getTime(),e=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var n=16*Math.random();return t>0?(n=(t+n)%16|0,t=Math.floor(t/16)):(n=(e+n)%16|0,e=Math.floor(e/16)),("x"===r?n:7&n|8).toString(16)})},e.formatUrl=function(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),o="";return Object.keys(r).forEach(function(t){""===o?!n&&(e+="?"):o+="&",o+="".concat(t,"=").concat(encodeURIComponent(r[t]))}),/^http(s)?:\/\//.test(e+=o)?e:"".concat(t).concat(e)},e.toQueryString=function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach(function(r){e.push("".concat(r,"=").concat(encodeURIComponent(t[r])))}),e.join("&")},e.getQuery=function(t,e){if("undefined"==typeof window)return!1;var r=e||decodeURIComponent(window.location.search),n=new RegExp("(^|&)".concat(t,"=([^&]*)(&|$)")),o=r.substr(r.indexOf("?")+1).match(n);return null!=o?o[2]:""},e.getHash=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]".concat(t,"=([^&#]*)")));return e?e[1]:""},e.removeParam=function(t,e){var r=e.split("?")[0],n=[],o=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==o){for(var i=(n=o.split("&")).length-1;i>=0;i-=1)n[i].split("=")[0]===t&&n.splice(i,1);r="".concat(r,"?").concat(n.join("&"))}return r},e.createPromiseCallback=function(){var t={};if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var r=new Promise(function(e,r){t=function(t,n){return t?r(t):e(n)}});return t.promise=r,t},e.execCallback=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},e.printWarn=function(t,e){console.warn("[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e))},e.printError=function(t,e){console.error({code:t,msg:"[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e)})},e.printInfo=function(t,e){console.log("[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e))},e.throwError=function(t,e){throw new Error(JSON.stringify({code:t,msg:"[".concat((0,o.getSdkName)(),"][").concat(t,"]:").concat(e)}))},e.printGroupLog=function(t){var e,r=t.title,n=t.subtitle,o=void 0===n?"":n,i=t.content,a=void 0===i?[]:i,s=t.printTrace,c=void 0!==s&&s,u=t.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(r,o):(console.group||console.error)(r,o);for(var l=0,d=a;l<d.length;l++){var f=d[l],h=f.type,p=f.body;switch(h){case"info":console.log(p);break;case"warn":console.warn(p);break;case"error":console.error(p)}}c&&(console.trace||console.log)("stack trace:"),null===(e=console.groupEnd)||void 0===e||e.call(console)},e.sleep=function(t){return void 0===t&&(t=0),new Promise(function(e){return setTimeout(e,t)})},e.transformPhone=function(t){return"+86".concat(t)},e.parseQueryString=function(t){t=t.replace(/^\?/,"");var e={};return t.split("&").forEach(function(t){var r=t.split("="),n=r[0],o=r[1];n=decodeURIComponent(n),o=decodeURIComponent(o),n&&(e[n]?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o)}),e},e.parseCaptcha=function(t){var r={},o=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(o){t=o[1];var i=o[2];i&&(r=(0,e.parseQueryString)(i))}var a=r.token,s=n(r,["token"]);return/^data:/.test(t)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(t)}:a?{state:s.state,token:a,captchaData:t}:{error:"unimplemented",error_description:"need to impl captcha data"}}},388:t=>{t.exports={}},949:(t,e,r)=>{"use strict";function n(t){this.message=t}r.r(e),r.d(e,{InvalidTokenError:()=>a,default:()=>s}),n.prototype=new Error,n.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,i=0,a=0,s="";o=e.charAt(a++);~o&&(r=i%4?64*r+o:o,i++%4)?s+=String.fromCharCode(255&r>>(-2*i&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return s};function i(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(o(t).replace(/(.)/g,function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(e)}catch(t){return o(e)}}function a(t){this.message=t}a.prototype=new Error,a.prototype.name="InvalidTokenError";const s=function(t,e){if("string"!=typeof t)throw new a("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(i(t.split(".")[r]))}catch(t){throw new a("Invalid token specified: "+t.message)}}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(456)})());
|