@cloudbase/js-sdk 2.6.5-beta.0 → 2.6.6-beta.0
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/miniprogram_dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase",[],e):"object"==typeof exports?exports.cloudbase=e():t.cloudbase=e()}("undefined"!=typeof window?window:this,(function(){return function(){var t={313:function(t,e,n){"use strict";var r=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(227)),o=n(878);r.default.registerVersion(o.version);try{window.cloudbase=r.default}catch(t){}e.default=r.default,t.exports=r.default},227:function(t,e,n){"use strict";n.r(e),n.d(e,{cloudbase:function(){return St},default:function(){return xt},getBaseEndPoint:function(){return et}});var r="@cloudbase/js-sdk";function o(){return r}var i,a="https:",c={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"};!function(t){t.local="local",t.none="none",t.session="session"}(i||(i={}));var s=function(){};function u(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";for(var i in n)""===o?!r&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(n[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}function l(t){return"[object FormData]"===Object.prototype.toString.call(t)}function f(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";return Object.keys(n).forEach((function(t){""===o?!r&&(e+="?"):o+="&",o+="".concat(t,"=").concat(encodeURIComponent(n[t]))})),/^http(s)?:\/\//.test(e+=o)?e:"".concat(t).concat(e)}function p(t,e){console.warn("[".concat(o(),"][").concat(t,"]:").concat(e))}var h,d,y=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},h(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}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},v.apply(this,arguments)},g=function(t){function e(e){var n=t.call(this)||this,r=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return y(e,t),e.prototype.get=function(t){return this.request(v(v({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(v(v({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(v(v({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,n=t.file,r=t.name,o=t.method,i=t.headers,a=void 0===i?{}:i,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",s=new FormData;return"post"===c?(Object.keys(e).forEach((function(t){s.append(t,e[t])})),s.append("key",r),s.append("file",n),this.request(v(v({},t),{data:s,method:c}),this.restrictedMethods.includes("upload"))):this.request(v(v({},t),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return e=this,n=void 0,o=function(){var e,n,r,o;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(v(v({},t),{headers:{},responseType:"blob"}))];case 1:return e=i.sent().data,n=window.URL.createObjectURL(new Blob([e])),r=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o.throw(t))}catch(t){i(t)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,c)}s((o=o.apply(e,n||[])).next())}));var e,n,r,o},e.prototype.request=function(t,e){var n=this;void 0===e&&(e=!1);var r=String(t.method).toLowerCase()||"get";return new Promise((function(o){var i,c,s=t.url,u=t.headers,p=void 0===u?{}:u,h=t.data,d=t.responseType,y=t.withCredentials,v=t.body,g=t.onUploadProgress,m=f(a,s,"get"===r?h:{}),b=new XMLHttpRequest;b.open(r,m),d&&(b.responseType=d),Object.keys(p).forEach((function(t){b.setRequestHeader(t,p[t])})),g&&b.upload.addEventListener("progress",g),b.onreadystatechange=function(){var t={};if(4===b.readyState){var e=b.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};e.forEach((function(t){var e=t.split(": "),r=e.shift().toLowerCase(),o=e.join(": ");n[r]=o})),t.header=n,t.statusCode=b.status;try{t.data="blob"===d?b.response:JSON.parse(b.responseText)}catch(e){t.data="blob"===d?b.response:b.responseText}clearTimeout(i),o(t)}},e&&n.timeout&&(i=setTimeout((function(){console.warn(n.timeoutMsg),b.abort()}),n.timeout)),c=l(h)?h:"application/x-www-form-urlencoded"===p["content-type"]?function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(n){e.push("".concat(n,"=").concat(encodeURIComponent(t[n])))})),e.join("&")}(h):v||(h?JSON.stringify(h):void 0),y&&(b.withCredentials=!0),b.send(c)}))},e}(s);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(d||(d={}));var m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))},w=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}},O=function(t){function e(e){var n=t.call(this)||this;return n.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),n}return m(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}((function(){})),E=function(){function t(t){this.keys={};var e=t.persistence,n=t.platformInfo,r=void 0===n?{}:n,o=t.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:(p(c.INVALID_PARAMS,"localStorage is not supported on current platform"),new O(e.root));case"none":return new O(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,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(r))}catch(t){throw new Error(JSON.stringify({code:c.OPERATION_FAIL,msg:"[".concat(o(),"][").concat(c.OPERATION_FAIL,"]setStore failed"),info:t}))}}else p(c.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,n){return b(this,void 0,void 0,(function(){var r;return w(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]),r={version:n||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},t.prototype.getStore=function(t,e){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var r=this.storage.getItem(t);return r&&r.indexOf(e)>=0?JSON.parse(r).content:""}p(c.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var n;return b(this,void 0,void 0,(function(){var r;return w(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(r=o.sent())&&r.indexOf(e)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):p(c.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return b(this,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))},t}(),A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t,e){this.data=e||null,this.name=t},S=function(t){function e(e,n){var r=t.call(this,"error",{error:e,data:n})||this;return r.error=e,r}return A(e,t),e}(_);new(function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,n){n[t]=n[t]||[],n[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,n){if(null==n?void 0:n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if(t instanceof S)return console.error(t.error),this;var n="string"==typeof t?new _(t,e||{}):t,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,i=this.listeners[r]?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.listeners[r],!0):[];o<i.length;o++)i[o].call(this,n)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}());"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox");function x(t){this.message=t}function I(t){this.message=t}x.prototype=new Error,x.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),I.prototype=new Error,I.prototype.name="InvalidTokenError";var P=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(){return C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},C.apply(this,arguments)},j=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this,r=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return n._timeout=r||0,n._timeoutMsg=o||"请求超时",n._restrictedMethods=i||["get","post","upload","download"],n}return P(e,t),e.prototype.post=function(t){var e=this;return new Promise((function(n,r){var o=t.url,i=t.data,a=t.headers,c=wx.request({url:u("https:",o),data:i,timeout:e._timeout,method:"POST",header:a,success:function(t){n(t)},fail:function(t){r(t)},complete:function(t){if(t&&t.errMsg&&e._timeout&&-1!==e._restrictedMethods.indexOf("post")&&"request:fail timeout"===t.errMsg){console.warn(e._timeoutMsg);try{c.abort()}catch(t){}}}})}))},e.prototype.upload=function(t){var e=this,n=this;return new Promise((function(r){return o=e,i=void 0,c=function(){var e,o,i,a,c,s;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,(function(u){return e=t.url,o=t.file,i=t.data,a=t.headers,c=t.onUploadProgress,s=wx.uploadFile({url:e,filePath:o,name:"file",formData:C({},i),header:a,timeout:this._timeout,success:function(t){var e={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&i.success_action_status&&(e.statusCode=parseInt(i.success_action_status,10)),r(e)},fail:function(t){r(t)},complete:function(t){if(t&&t.errMsg&&n._timeout&&-1!==n._restrictedMethods.indexOf("upload")&&"request:fail timeout"===t.errMsg){console.warn(n._timeoutMsg);try{s.abort()}catch(t){}}}}),c&&s.onProgressUpdate((function(t){c(t)})),[2]}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{s(c.next(t))}catch(t){e(t)}}function r(t){try{s(c.throw(t))}catch(t){e(t)}}function s(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}s((c=c.apply(o,i||[])).next())}));var o,i,a,c}))},e.prototype.download=function(t){var e=this,n=this;return new Promise((function(r,o){var i=t.url,a=t.headers,c=wx.downloadFile({url:u("https:",i),header:a,timeout:e._timeout,success:function(t){200===t.statusCode&&t.tempFilePath?r({statusCode:200,tempFilePath:t.tempFilePath}):r(t)},fail:function(t){o(t)},complete:function(t){if(t&&t.errMsg&&n._timeout&&-1!==n._restrictedMethods.indexOf("download")&&"request:fail timeout"===t.errMsg){console.warn(n._timeoutMsg);try{c.abort()}catch(t){}}}})}))},e}(s),N={setItem:function(t,e){wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()}},k=function(t,e){void 0===e&&(e={});var n=wx.connectSocket(C({url:t},e));return{set onopen(t){n.onOpen(t)},set onmessage(t){n.onMessage(t)},set onclose(t){n.onClose(t)},set onerror(t){n.onError(t)},send:function(t){return n.send({data:t})},close:function(t,e){return n.close({code:t,reason:e})},get readyState(){return n.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}},T={genAdapter:function(){return{root:{},reqClass:j,wsClass:k,localStorage:N,primaryStorage:i.local,getAppSign:function(){var t=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?t&&t.miniProgram?t.miniProgram.appId:"":t&&t.plugin?t.plugin.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof Page)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0},runtime:"wx_mp"},L=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},R=c,M={};function q(t,e){var n=e.name,r=e.namespace,o=e.entity,i=e.injectEvents,a=e.IIFE,c=void 0!==a&&a;if(M[n]||r&&t[r])throw new Error(JSON.stringify({code:R.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(c){if(!o||"function"!=typeof o)throw new Error(JSON.stringify({code:R.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));o.call(t)}if(M[n]=e,r?t.prototype[r]=o:U(t.prototype,o),i){var s=i.bus,u=i.events;if(!s||!u||0===u.length)return;var l=t.prototype.fire||function(){};t.prototype.events||(t.prototype.events={}),(t.prototype.events||{})[n]?t.prototype.events[n].events=L(L([],t.prototype.events[n].events,!0),u,!0):t.prototype.events[n]={bus:s,events:u},t.prototype.fire=function(t,e){l(t,e);for(var n=0,r=Object.keys(this.events);n<r.length;n++){var o=r[n],i=this.events[o],a=i.bus;if(i.events.includes(t)){a.fire(t,e);break}}}}}function U(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=U(t[o],e[o]))}return t}var D={},F=function(){return F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},F.apply(this,arguments)},V="user_info",W=E,J={},B={};function G(t){var e=t.env,n=t.platformInfo,r={userInfoKey:"".concat(V,"_").concat(e)};J[e]=J[e]||new W(F(F({},t),{keys:r,platformInfo:n})),B[e]=B[e]||new W(F(F({},t),{keys:r,platformInfo:n,persistence:"local"}))}function H(t){return B[t]}var X,K=function(t){a=t},Y="",Q="@cloudbase/js-sdk",z="https:",Z="//tcb-api.tencentcloudapi.com/web";function $(t,e){Z=t,e&&(z=e,K(e))}function tt(){return{BASE_URL:Z,PROTOCOL:z}}function et(){var t=tt(),e=t.PROTOCOL,n=t.BASE_URL;return"".concat(e).concat(n).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}!function(t){t.NULL="NULL",t.ANONYMOUS="ANONYMOUS",t.WECHAT="WECHAT",t.WECHAT_PUBLIC="WECHAT-PUBLIC",t.WECHAT_OPEN="WECHAT-OPEN",t.CUSTOM="CUSTOM",t.EMAIL="EMAIL",t.USERNAME="USERNAME",t.PHONE="PHONE"}(X||(X={}));var nt=function(){return nt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nt.apply(this,arguments)},rt=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))},ot=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}},it=c,at=function(){return Math.random().toString(16).slice(2)},ct=l,st=f,ut=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function lt(t,e,n){var r=t[e];t[e]=function(e){var o={},i={};n.forEach((function(n){var r=n.call(t,e),a=r.data,c=r.headers;Object.assign(o,a),Object.assign(i,c)}));var a=e.data;return a&&(ct(a)?Object.keys(o).forEach((function(t){a.append(t,o[t])})):e.data=nt(nt({},a),o)),e.headers=nt(nt({},e.headers||{}),i),r.call(t,e)}}function ft(){var t=at();return{data:{seqId:t},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat(Y),"x-seqid":t}}}var pt=function(){function t(t){this.throwWhenRequestFail=!1,this.config=t;var e={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"]};this.reqClass=new D.adapter.reqClass(e),this.throwWhenRequestFail=t.throw||!1,this.localCache=H(this.config.env),lt(this.reqClass,"post",[ft]),lt(this.reqClass,"upload",[ft]),lt(this.reqClass,"download",[ft])}return t.prototype.post=function(t){return rt(this,void 0,void 0,(function(){return ot(this,(function(e){switch(e.label){case 0:return[4,this.reqClass.post(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.upload=function(t){return rt(this,void 0,void 0,(function(){return ot(this,(function(e){switch(e.label){case 0:return[4,this.reqClass.upload(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.download=function(t){return rt(this,void 0,void 0,(function(){return ot(this,(function(e){switch(e.label){case 0:return[4,this.reqClass.download(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.getBaseEndPoint=function(){return et()},t.prototype.getOauthAccessTokenV2=function(t){return rt(this,void 0,void 0,(function(){var e,n;return ot(this,(function(r){switch(r.label){case 0:return[4,t.getAccessToken()];case 1:return e=r.sent(),[4,t.getCredentials()];case 2:return n=r.sent(),[2,{accessToken:e,accessTokenExpire:new Date(n.expires_at).getTime()}]}}))}))},t.prototype.request=function(t,e,n){var r,o;return rt(this,void 0,void 0,(function(){var i,a,c,s,u,l,f,p,h,d,y,v,g,m,b,w,O,E,A,_;return ot(this,(function(S){switch(S.label){case 0:if(i="x-tcb-trace_".concat(this.config.env),a="application/x-www-form-urlencoded",c=nt({action:t,dataVersion:"2020-01-10",env:this.config.env},e),-1!==ut.indexOf(t))return[3,2];if(!(s=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return u=s.oauthInstance,l=u.oauth2client,f=c,[4,this.getOauthAccessTokenV2(l)];case 1:f.access_token=S.sent().accessToken,S.label=2;case 2:return"storage.uploadFile"===t?(p=new FormData,Object.keys(p).forEach((function(t){Object.prototype.hasOwnProperty.call(p,t)&&void 0!==p[t]&&p.append(t,c[t])})),a="multipart/form-data"):(a="application/json;charset=UTF-8",p={},Object.keys(c).forEach((function(t){void 0!==c[t]&&(p[t]=c[t])}))),h={headers:{"content-type":a}},(null==n?void 0:n.onUploadProgress)&&(h.onUploadProgress=n.onUploadProgress),this.config.region&&(h.headers["X-TCB-Region"]=this.config.region),(d=this.localCache.getStore(i))&&(h.headers["X-TCB-Trace"]=d),y=void 0!==(null==n?void 0:n.parse)?n.parse:e.parse,v=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:e.inQuery,g=void 0!==(null==n?void 0:n.search)?n.search:e.search,m={env:this.config.env},y&&(m.parse=!0),v&&(m=nt(nt({},v),m)),b=tt(),w=b.BASE_URL,O=b.PROTOCOL,E=n.pathname?st(O,"".concat(null===(r=et())||void 0===r?void 0:r.replace(/^https?:/,""),"/").concat(n.pathname),m):st(O,w,m),g&&(E+=g),[4,this.post(nt({url:E,data:p},h))];case 3:if(A=S.sent(),(_=null===(o=A.header)||void 0===o?void 0:o["x-tcb-trace"])&&this.localCache.setStore(i,_),200!==Number(A.status)&&200!==Number(A.statusCode)||!A.data)throw new Error("network request error");return[2,A]}}))}))},t.prototype.send=function(t,e){return void 0===e&&(e={}),rt(this,void 0,void 0,(function(){var n;return ot(this,(function(r){switch(r.label){case 0:return[4,this.request(t,e,{onUploadProgress:e.onUploadProgress})];case 1:if((n=r.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:it.OPERATION_FAIL,msg:"[".concat(n.data.code,"] ").concat(n.data.message)}));return[2,n.data]}}))}))},t}(),ht={},dt=function(){return dt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dt.apply(this,arguments)},yt=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},vt=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gt=c,mt="https://support.qq.com/products/148793",bt=p,wt=function(t){t.mode,t.customInfo,t.title,t.messages;return function(t,e,n){}},Ot={timeout:15e3,persistence:"local"},Et=6e5,At={},_t=function(){function t(t){this.cloudbaseConfig=t||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null}return Object.defineProperty(t.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"platform",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cache",{get:function(){return t=this.cloudbaseConfig.env,J[t];var t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCache",{get:function(){return H(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return t=this.cloudbaseConfig.env,ht[t];var t},enumerable:!1,configurable:!0}),t.prototype.init=function(e){if(!e.env)throw new Error(JSON.stringify({code:gt.INVALID_PARAMS,msg:"env must not be specified"}));D.adapter||this.useDefaultAdapter();var n={timeout:e.timeout||5e3,timeoutMsg:"[".concat(Q,"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(e.timeout/1e3,"s")};this.requestClient=new D.adapter.reqClass(n),this.cloudbaseConfig=dt(dt({},Ot),e),this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var r=this.cloudbaseConfig,o=r.env,i=r.persistence,a=r.debug,c=r.timeout,s=r.oauthClient;G({env:o,persistence:i,debug:a,platformInfo:this.platform}),function(t,e,n){$(e?"//".concat(t,".").concat(e,".tcb-api.tencentcloudapi.com/web"):"//".concat(t,".ap-shanghai.tcb-api.tencentcloudapi.com/web"),void 0)}(o,e.region||"");var u=new t(this.cloudbaseConfig);return function(t){ht[t.env]=new pt(nt(nt({},t),{throw:!0}))}({env:o,region:e.region||"",timeout:c,oauthClient:s,_fromApp:u}),u.requestClient=this.requestClient,u},t.prototype.updateConfig=function(t){var e=t.persistence,n=t.debug;this.cloudbaseConfig.persistence=e,this.cloudbaseConfig.debug=n,G({env:this.cloudbaseConfig.env,persistence:e,debug:n,platformInfo:this.platform})},t.prototype.registerExtension=function(t){At[t.name]=t},t.prototype.invokeExtension=function(t,e){return n=this,r=void 0,i=function(){var n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}(this,(function(r){switch(r.label){case 0:if(!(n=At[t]))throw new Error(JSON.stringify({code:gt.INVALID_PARAMS,msg:"extension:".concat(t," must be registered before invoke")}));return[4,n.invoke(e,this)];case 1:return[2,r.sent()]}}))},new((o=void 0)||(o=Promise))((function(t,e){function a(t){try{s(i.next(t))}catch(t){e(t)}}function c(t){try{s(i.throw(t))}catch(t){e(t)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}s((i=i.apply(n,r||[])).next())}));var n,r,o,i},t.prototype.useAdapters=function(t){var e=function(t){for(var e,n=0,r=(e=t,"[object Array]"===Object.prototype.toString.call(e)?t:[t]);n<r.length;n++){var o=r[n],i=o.isMatch,a=o.genAdapter,c=o.runtime;if(i())return{adapter:a(),runtime:c}}}(t)||{},n=e.adapter,r=e.runtime;n&&(D.adapter=n),r&&(D.runtime=r)},t.prototype.registerHook=function(e){!function(t,e){var n=e.entity,r=e.target;if(Object.prototype.hasOwnProperty.call(t,r))throw new Error(JSON.stringify({code:R.INVALID_OPERATION,msg:"target:".concat(r," is not exist")}));var o=t.prototype[r];if("function"!=typeof o)throw new Error(JSON.stringify({code:R.INVALID_OPERATION,msg:"target:".concat(r," is not a function which is the only type supports hook")}));t.prototype[r]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,L([this],t,!1)),o.call.apply(o,L([this],t,!1))}}(t,e)},t.prototype.registerComponent=function(e){q(t,e)},t.prototype.registerVersion=function(t){!function(t){Y=t}(t)},t.prototype.registerSdkName=function(t){!function(t){Q=t,function(t){r=t}(t)}(t)},t.prototype.registerEndPoint=function(t,e){$(t,e)},t.prototype.useDefaultAdapter=function(){var t={adapter:{root:window,reqClass:g,wsClass:WebSocket,localStorage:localStorage},runtime:d.WEB},e=t.adapter,n=t.runtime;D.adapter=e,D.runtime=n},t.prototype.formatTimeout=function(t){switch(!0){case t>Et:return bt(gt.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),Et;case t<100:return bt(gt.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return t}},yt([wt({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(mt)]}),vt("design:type",Function),vt("design:paramtypes",[Object]),vt("design:returntype",t)],t.prototype,"init",null),yt([wt({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(mt)]}),vt("design:type",Function),vt("design:paramtypes",[String,Object]),vt("design:returntype",Promise)],t.prototype,"invokeExtension",null),t}(),St=new _t;St.useAdapters(T);var xt=St},47:function(t){var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new j(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};u(w,a,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(N([])));E&&E!==n&&r.call(E,a)&&(w=E);var A=b.prototype=g.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(t,e,n){var r=p;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=I(a,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=f(t,e,n);if("normal"===s.type){if(r=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=y,n.method="throw",n.arg=s.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:k}}function k(){return{value:e,done:!0}}return m.prototype=b,o(A,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=u(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(A),t},t.awrap=function(t){return{__await:t}},_(S.prototype),u(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(A),u(A,s,"Generator"),u(A,a,(function(){return this})),u(A,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},878:function(t){"use strict";t.exports=JSON.parse('{"version":"2.6.5-beta.0"}')}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}return n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(47),n(313)}()}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase",[],e):"object"==typeof exports?exports.cloudbase=e():t.cloudbase=e()}("undefined"!=typeof window?window:this,(function(){return function(){var t={313:function(t,e,n){"use strict";var r=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(227)),o=n(878);r.default.registerVersion(o.version);try{window.cloudbase=r.default}catch(t){}e.default=r.default,t.exports=r.default},227:function(t,e,n){"use strict";n.r(e),n.d(e,{cloudbase:function(){return St},default:function(){return xt},getBaseEndPoint:function(){return et}});var r="@cloudbase/js-sdk";function o(){return r}var i,a="https:",c={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"};!function(t){t.local="local",t.none="none",t.session="session"}(i||(i={}));var s=function(){};function u(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";for(var i in n)""===o?!r&&(e+="?"):o+="&",o+=i+"="+encodeURIComponent(n[i]);return/^http(s)?\:\/\//.test(e+=o)?e:""+t+e}function l(t){return"[object FormData]"===Object.prototype.toString.call(t)}function f(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";return Object.keys(n).forEach((function(t){""===o?!r&&(e+="?"):o+="&",o+="".concat(t,"=").concat(encodeURIComponent(n[t]))})),/^http(s)?:\/\//.test(e+=o)?e:"".concat(t).concat(e)}function p(t,e){console.warn("[".concat(o(),"][").concat(t,"]:").concat(e))}var h,d,y=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},h(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}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},v.apply(this,arguments)},g=function(t){function e(e){var n=t.call(this)||this,r=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}return y(e,t),e.prototype.get=function(t){return this.request(v(v({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(v(v({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(v(v({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,n=t.file,r=t.name,o=t.method,i=t.headers,a=void 0===i?{}:i,c={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",s=new FormData;return"post"===c?(Object.keys(e).forEach((function(t){s.append(t,e[t])})),s.append("key",r),s.append("file",n),this.request(v(v({},t),{data:s,method:c}),this.restrictedMethods.includes("upload"))):this.request(v(v({},t),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return e=this,n=void 0,o=function(){var e,n,r,o;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(v(v({},t),{headers:{},responseType:"blob"}))];case 1:return e=i.sent().data,n=window.URL.createObjectURL(new Blob([e])),r=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o.throw(t))}catch(t){i(t)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,c)}s((o=o.apply(e,n||[])).next())}));var e,n,r,o},e.prototype.request=function(t,e){var n=this;void 0===e&&(e=!1);var r=String(t.method).toLowerCase()||"get";return new Promise((function(o){var i,c,s=t.url,u=t.headers,p=void 0===u?{}:u,h=t.data,d=t.responseType,y=t.withCredentials,v=t.body,g=t.onUploadProgress,m=f(a,s,"get"===r?h:{}),b=new XMLHttpRequest;b.open(r,m),d&&(b.responseType=d),Object.keys(p).forEach((function(t){b.setRequestHeader(t,p[t])})),g&&b.upload.addEventListener("progress",g),b.onreadystatechange=function(){var t={};if(4===b.readyState){var e=b.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};e.forEach((function(t){var e=t.split(": "),r=e.shift().toLowerCase(),o=e.join(": ");n[r]=o})),t.header=n,t.statusCode=b.status;try{t.data="blob"===d?b.response:JSON.parse(b.responseText)}catch(e){t.data="blob"===d?b.response:b.responseText}clearTimeout(i),o(t)}},e&&n.timeout&&(i=setTimeout((function(){console.warn(n.timeoutMsg),b.abort()}),n.timeout)),c=l(h)?h:"application/x-www-form-urlencoded"===p["content-type"]?function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(n){e.push("".concat(n,"=").concat(encodeURIComponent(t[n])))})),e.join("&")}(h):v||(h?JSON.stringify(h):void 0),y&&(b.withCredentials=!0),b.send(c)}))},e}(s);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(d||(d={}));var m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))},w=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}},O=function(t){function e(e){var n=t.call(this)||this;return n.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),n}return m(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}((function(){})),E=function(){function t(t){this.keys={};var e=t.persistence,n=t.platformInfo,r=void 0===n?{}:n,o=t.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:(p(c.INVALID_PARAMS,"localStorage is not supported on current platform"),new O(e.root));case"none":return new O(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,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(r))}catch(t){throw new Error(JSON.stringify({code:c.OPERATION_FAIL,msg:"[".concat(o(),"][").concat(c.OPERATION_FAIL,"]setStore failed"),info:t}))}}else p(c.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,n){return b(this,void 0,void 0,(function(){var r;return w(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]),r={version:n||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},t.prototype.getStore=function(t,e){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var r=this.storage.getItem(t);return r&&r.indexOf(e)>=0?JSON.parse(r).content:""}p(c.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var n;return b(this,void 0,void 0,(function(){var r;return w(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(r=o.sent())&&r.indexOf(e)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):p(c.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return b(this,void 0,void 0,(function(){return w(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))},t}(),A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t,e){this.data=e||null,this.name=t},S=function(t){function e(e,n){var r=t.call(this,"error",{error:e,data:n})||this;return r.error=e,r}return A(e,t),e}(_);new(function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,n){n[t]=n[t]||[],n[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,n){if(null==n?void 0:n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if(t instanceof S)return console.error(t.error),this;var n="string"==typeof t?new _(t,e||{}):t,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,i=this.listeners[r]?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.listeners[r],!0):[];o<i.length;o++)i[o].call(this,n)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}());"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox");function x(t){this.message=t}function I(t){this.message=t}x.prototype=new Error,x.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),I.prototype=new Error,I.prototype.name="InvalidTokenError";var P=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(){return C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},C.apply(this,arguments)},j=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this,r=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return n._timeout=r||0,n._timeoutMsg=o||"请求超时",n._restrictedMethods=i||["get","post","upload","download"],n}return P(e,t),e.prototype.post=function(t){var e=this;return new Promise((function(n,r){var o=t.url,i=t.data,a=t.headers,c=wx.request({url:u("https:",o),data:i,timeout:e._timeout,method:"POST",header:a,success:function(t){n(t)},fail:function(t){r(t)},complete:function(t){if(t&&t.errMsg&&e._timeout&&-1!==e._restrictedMethods.indexOf("post")&&"request:fail timeout"===t.errMsg){console.warn(e._timeoutMsg);try{c.abort()}catch(t){}}}})}))},e.prototype.upload=function(t){var e=this,n=this;return new Promise((function(r){return o=e,i=void 0,c=function(){var e,o,i,a,c,s;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,(function(u){return e=t.url,o=t.file,i=t.data,a=t.headers,c=t.onUploadProgress,s=wx.uploadFile({url:e,filePath:o,name:"file",formData:C({},i),header:a,timeout:this._timeout,success:function(t){var e={statusCode:t.statusCode,data:t.data||{}};200===t.statusCode&&i.success_action_status&&(e.statusCode=parseInt(i.success_action_status,10)),r(e)},fail:function(t){r(t)},complete:function(t){if(t&&t.errMsg&&n._timeout&&-1!==n._restrictedMethods.indexOf("upload")&&"request:fail timeout"===t.errMsg){console.warn(n._timeoutMsg);try{s.abort()}catch(t){}}}}),c&&s.onProgressUpdate((function(t){c(t)})),[2]}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{s(c.next(t))}catch(t){e(t)}}function r(t){try{s(c.throw(t))}catch(t){e(t)}}function s(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}s((c=c.apply(o,i||[])).next())}));var o,i,a,c}))},e.prototype.download=function(t){var e=this,n=this;return new Promise((function(r,o){var i=t.url,a=t.headers,c=wx.downloadFile({url:u("https:",i),header:a,timeout:e._timeout,success:function(t){200===t.statusCode&&t.tempFilePath?r({statusCode:200,tempFilePath:t.tempFilePath}):r(t)},fail:function(t){o(t)},complete:function(t){if(t&&t.errMsg&&n._timeout&&-1!==n._restrictedMethods.indexOf("download")&&"request:fail timeout"===t.errMsg){console.warn(n._timeoutMsg);try{c.abort()}catch(t){}}}})}))},e}(s),N={setItem:function(t,e){wx.setStorageSync(t,e)},getItem:function(t){return wx.getStorageSync(t)},removeItem:function(t){wx.removeStorageSync(t)},clear:function(){wx.clearStorageSync()}},k=function(t,e){void 0===e&&(e={});var n=wx.connectSocket(C({url:t},e));return{set onopen(t){n.onOpen(t)},set onmessage(t){n.onMessage(t)},set onclose(t){n.onClose(t)},set onerror(t){n.onError(t)},send:function(t){return n.send({data:t})},close:function(t,e){return n.close({code:t,reason:e})},get readyState(){return n.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}},T={genAdapter:function(){return{root:{},reqClass:j,wsClass:k,localStorage:N,primaryStorage:i.local,getAppSign:function(){var t=wx.getAccountInfoSync();return"undefined"!=typeof App||"undefined"!=typeof getApp||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?t&&t.miniProgram?t.miniProgram.appId:"":t&&t.plugin?t.plugin.appId:""}}},isMatch:function(){if("undefined"==typeof wx)return!1;if("undefined"==typeof Page)return!1;if(!wx.getSystemInfoSync)return!1;if(!wx.getStorageSync)return!1;if(!wx.setStorageSync)return!1;if(!wx.connectSocket)return!1;if(!wx.request)return!1;try{if(!wx.getSystemInfoSync())return!1;if("qq"===wx.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0},runtime:"wx_mp"},L=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},R=c,M={};function q(t,e){var n=e.name,r=e.namespace,o=e.entity,i=e.injectEvents,a=e.IIFE,c=void 0!==a&&a;if(M[n]||r&&t[r])throw new Error(JSON.stringify({code:R.INVALID_OPERATION,msg:"Duplicate component ".concat(n)}));if(c){if(!o||"function"!=typeof o)throw new Error(JSON.stringify({code:R.INVALID_PARAMS,msg:"IIFE component's entity must be a function"}));o.call(t)}if(M[n]=e,r?t.prototype[r]=o:U(t.prototype,o),i){var s=i.bus,u=i.events;if(!s||!u||0===u.length)return;var l=t.prototype.fire||function(){};t.prototype.events||(t.prototype.events={}),(t.prototype.events||{})[n]?t.prototype.events[n].events=L(L([],t.prototype.events[n].events,!0),u,!0):t.prototype.events[n]={bus:s,events:u},t.prototype.fire=function(t,e){l(t,e);for(var n=0,r=Object.keys(this.events);n<r.length;n++){var o=r[n],i=this.events[o],a=i.bus;if(i.events.includes(t)){a.fire(t,e);break}}}}}function U(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=U(t[o],e[o]))}return t}var D={},F=function(){return F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},F.apply(this,arguments)},V="user_info",W=E,J={},B={};function G(t){var e=t.env,n=t.platformInfo,r={userInfoKey:"".concat(V,"_").concat(e)};J[e]=J[e]||new W(F(F({},t),{keys:r,platformInfo:n})),B[e]=B[e]||new W(F(F({},t),{keys:r,platformInfo:n,persistence:"local"}))}function H(t){return B[t]}var X,K=function(t){a=t},Y="",Q="@cloudbase/js-sdk",z="https:",Z="//tcb-api.tencentcloudapi.com/web";function $(t,e){Z=t,e&&(z=e,K(e))}function tt(){return{BASE_URL:Z,PROTOCOL:z}}function et(){var t=tt(),e=t.PROTOCOL,n=t.BASE_URL;return"".concat(e).concat(n).match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}!function(t){t.NULL="NULL",t.ANONYMOUS="ANONYMOUS",t.WECHAT="WECHAT",t.WECHAT_PUBLIC="WECHAT-PUBLIC",t.WECHAT_OPEN="WECHAT-OPEN",t.CUSTOM="CUSTOM",t.EMAIL="EMAIL",t.USERNAME="USERNAME",t.PHONE="PHONE"}(X||(X={}));var nt=function(){return nt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nt.apply(this,arguments)},rt=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))},ot=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}},it=c,at=function(){return Math.random().toString(16).slice(2)},ct=l,st=f,ut=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"];function lt(t,e,n){var r=t[e];t[e]=function(e){var o={},i={};n.forEach((function(n){var r=n.call(t,e),a=r.data,c=r.headers;Object.assign(o,a),Object.assign(i,c)}));var a=e.data;return a&&(ct(a)?Object.keys(o).forEach((function(t){a.append(t,o[t])})):e.data=nt(nt({},a),o)),e.headers=nt(nt({},e.headers||{}),i),r.call(t,e)}}function ft(){var t=at();return{data:{seqId:t},headers:{"X-SDK-Version":"@cloudbase/js-sdk/".concat(Y),"x-seqid":t}}}var pt=function(){function t(t){this.throwWhenRequestFail=!1,this.config=t;var e={timeout:this.config.timeout,timeoutMsg:"[@cloudbase/js-sdk] 请求在".concat(this.config.timeout/1e3,"s内未完成,已中断"),restrictedMethods:["post","put"]};this.reqClass=new D.adapter.reqClass(e),this.throwWhenRequestFail=t.throw||!1,this.localCache=H(this.config.env),lt(this.reqClass,"post",[ft]),lt(this.reqClass,"upload",[ft]),lt(this.reqClass,"download",[ft])}return t.prototype.post=function(t){return rt(this,void 0,void 0,(function(){return ot(this,(function(e){switch(e.label){case 0:return[4,this.reqClass.post(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.upload=function(t){return rt(this,void 0,void 0,(function(){return ot(this,(function(e){switch(e.label){case 0:return[4,this.reqClass.upload(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.download=function(t){return rt(this,void 0,void 0,(function(){return ot(this,(function(e){switch(e.label){case 0:return[4,this.reqClass.download(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.getBaseEndPoint=function(){return et()},t.prototype.getOauthAccessTokenV2=function(t){return rt(this,void 0,void 0,(function(){var e,n;return ot(this,(function(r){switch(r.label){case 0:return[4,t.getAccessToken()];case 1:return e=r.sent(),[4,t.getCredentials()];case 2:return n=r.sent(),[2,{accessToken:e,accessTokenExpire:new Date(n.expires_at).getTime()}]}}))}))},t.prototype.request=function(t,e,n){var r,o;return rt(this,void 0,void 0,(function(){var i,a,c,s,u,l,f,p,h,d,y,v,g,m,b,w,O,E,A,_;return ot(this,(function(S){switch(S.label){case 0:if(i="x-tcb-trace_".concat(this.config.env),a="application/x-www-form-urlencoded",c=nt({action:t,dataVersion:"2020-01-10",env:this.config.env},e),-1!==ut.indexOf(t))return[3,2];if(!(s=this.config._fromApp).oauthInstance)throw new Error("you can't request without auth");return u=s.oauthInstance,l=u.oauth2client,f=c,[4,this.getOauthAccessTokenV2(l)];case 1:f.access_token=S.sent().accessToken,S.label=2;case 2:return"storage.uploadFile"===t?(p=new FormData,Object.keys(p).forEach((function(t){Object.prototype.hasOwnProperty.call(p,t)&&void 0!==p[t]&&p.append(t,c[t])})),a="multipart/form-data"):(a="application/json;charset=UTF-8",p={},Object.keys(c).forEach((function(t){void 0!==c[t]&&(p[t]=c[t])}))),h={headers:{"content-type":a}},(null==n?void 0:n.onUploadProgress)&&(h.onUploadProgress=n.onUploadProgress),this.config.region&&(h.headers["X-TCB-Region"]=this.config.region),(d=this.localCache.getStore(i))&&(h.headers["X-TCB-Trace"]=d),y=void 0!==(null==n?void 0:n.parse)?n.parse:e.parse,v=void 0!==(null==n?void 0:n.inQuery)?n.inQuery:e.inQuery,g=void 0!==(null==n?void 0:n.search)?n.search:e.search,m={env:this.config.env},y&&(m.parse=!0),v&&(m=nt(nt({},v),m)),b=tt(),w=b.BASE_URL,O=b.PROTOCOL,E=n.pathname?st(O,"".concat(null===(r=et())||void 0===r?void 0:r.replace(/^https?:/,""),"/").concat(n.pathname),m):st(O,w,m),g&&(E+=g),[4,this.post(nt({url:E,data:p},h))];case 3:if(A=S.sent(),(_=null===(o=A.header)||void 0===o?void 0:o["x-tcb-trace"])&&this.localCache.setStore(i,_),200!==Number(A.status)&&200!==Number(A.statusCode)||!A.data)throw new Error("network request error");return[2,A]}}))}))},t.prototype.send=function(t,e){return void 0===e&&(e={}),rt(this,void 0,void 0,(function(){var n;return ot(this,(function(r){switch(r.label){case 0:return[4,this.request(t,e,{onUploadProgress:e.onUploadProgress})];case 1:if((n=r.sent()).data.code&&this.throwWhenRequestFail)throw new Error(JSON.stringify({code:it.OPERATION_FAIL,msg:"[".concat(n.data.code,"] ").concat(n.data.message)}));return[2,n.data]}}))}))},t}(),ht={},dt=function(){return dt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dt.apply(this,arguments)},yt=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},vt=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gt=c,mt="https://support.qq.com/products/148793",bt=p,wt=function(t){t.mode,t.customInfo,t.title,t.messages;return function(t,e,n){}},Ot={timeout:15e3,persistence:"local"},Et=6e5,At={},_t=function(){function t(t){this.cloudbaseConfig=t||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null}return Object.defineProperty(t.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"platform",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cache",{get:function(){return t=this.cloudbaseConfig.env,J[t];var t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCache",{get:function(){return H(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return t=this.cloudbaseConfig.env,ht[t];var t},enumerable:!1,configurable:!0}),t.prototype.init=function(e){if(!e.env)throw new Error(JSON.stringify({code:gt.INVALID_PARAMS,msg:"env must not be specified"}));D.adapter||this.useDefaultAdapter();var n={timeout:e.timeout||5e3,timeoutMsg:"[".concat(Q,"][REQUEST TIMEOUT] request had been abort since didn't finished within").concat(e.timeout/1e3,"s")};this.requestClient=new D.adapter.reqClass(n),this.cloudbaseConfig=dt(dt({},Ot),e),this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var r=this.cloudbaseConfig,o=r.env,i=r.persistence,a=r.debug,c=r.timeout,s=r.oauthClient;G({env:o,persistence:i,debug:a,platformInfo:this.platform}),function(t,e,n){$(e?"//".concat(t,".").concat(e,".tcb-api.tencentcloudapi.com/web"):"//".concat(t,".ap-shanghai.tcb-api.tencentcloudapi.com/web"),void 0)}(o,e.region||"");var u=new t(this.cloudbaseConfig);return function(t){ht[t.env]=new pt(nt(nt({},t),{throw:!0}))}({env:o,region:e.region||"",timeout:c,oauthClient:s,_fromApp:u}),u.requestClient=this.requestClient,u},t.prototype.updateConfig=function(t){var e=t.persistence,n=t.debug;this.cloudbaseConfig.persistence=e,this.cloudbaseConfig.debug=n,G({env:this.cloudbaseConfig.env,persistence:e,debug:n,platformInfo:this.platform})},t.prototype.registerExtension=function(t){At[t.name]=t},t.prototype.invokeExtension=function(t,e){return n=this,r=void 0,i=function(){var n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}(this,(function(r){switch(r.label){case 0:if(!(n=At[t]))throw new Error(JSON.stringify({code:gt.INVALID_PARAMS,msg:"extension:".concat(t," must be registered before invoke")}));return[4,n.invoke(e,this)];case 1:return[2,r.sent()]}}))},new((o=void 0)||(o=Promise))((function(t,e){function a(t){try{s(i.next(t))}catch(t){e(t)}}function c(t){try{s(i.throw(t))}catch(t){e(t)}}function s(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}s((i=i.apply(n,r||[])).next())}));var n,r,o,i},t.prototype.useAdapters=function(t){var e=function(t){for(var e,n=0,r=(e=t,"[object Array]"===Object.prototype.toString.call(e)?t:[t]);n<r.length;n++){var o=r[n],i=o.isMatch,a=o.genAdapter,c=o.runtime;if(i())return{adapter:a(),runtime:c}}}(t)||{},n=e.adapter,r=e.runtime;n&&(D.adapter=n),r&&(D.runtime=r)},t.prototype.registerHook=function(e){!function(t,e){var n=e.entity,r=e.target;if(Object.prototype.hasOwnProperty.call(t,r))throw new Error(JSON.stringify({code:R.INVALID_OPERATION,msg:"target:".concat(r," is not exist")}));var o=t.prototype[r];if("function"!=typeof o)throw new Error(JSON.stringify({code:R.INVALID_OPERATION,msg:"target:".concat(r," is not a function which is the only type supports hook")}));t.prototype[r]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,L([this],t,!1)),o.call.apply(o,L([this],t,!1))}}(t,e)},t.prototype.registerComponent=function(e){q(t,e)},t.prototype.registerVersion=function(t){!function(t){Y=t}(t)},t.prototype.registerSdkName=function(t){!function(t){Q=t,function(t){r=t}(t)}(t)},t.prototype.registerEndPoint=function(t,e){$(t,e)},t.prototype.useDefaultAdapter=function(){var t={adapter:{root:window,reqClass:g,wsClass:WebSocket,localStorage:localStorage},runtime:d.WEB},e=t.adapter,n=t.runtime;D.adapter=e,D.runtime=n},t.prototype.formatTimeout=function(t){switch(!0){case t>Et:return bt(gt.INVALID_PARAMS,"timeout is greater than maximum value[10min]"),Et;case t<100:return bt(gt.INVALID_PARAMS,"timeout is less than maximum value[100ms]"),100;default:return t}},yt([wt({mode:"sync",title:"Cloudbase 初始化失败",messages:["请确认以下各项:"," 1 - 调用 cloudbase.init() 的语法或参数是否正确"," 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(mt)]}),vt("design:type",Function),vt("design:paramtypes",[Object]),vt("design:returntype",t)],t.prototype,"init",null),yt([wt({title:"调用扩展能力失败",messages:["请确认以下各项:"," 1 - 调用 invokeExtension() 的语法或参数是否正确"," 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(mt)]}),vt("design:type",Function),vt("design:paramtypes",[String,Object]),vt("design:returntype",Promise)],t.prototype,"invokeExtension",null),t}(),St=new _t;St.useAdapters(T);var xt=St},47:function(t){var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new j(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};u(w,a,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(N([])));E&&E!==n&&r.call(E,a)&&(w=E);var A=b.prototype=g.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(t,e,n){var r=p;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=I(a,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=f(t,e,n);if("normal"===s.type){if(r=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=y,n.method="throw",n.arg=s.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:k}}function k(){return{value:e,done:!0}}return m.prototype=b,o(A,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=u(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(A),t},t.awrap=function(t){return{__await:t}},_(S.prototype),u(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(A),u(A,s,"Generator"),u(A,a,(function(){return this})),u(A,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},878:function(t){"use strict";t.exports=JSON.parse('{"version":"2.6.6-beta.0"}')}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}return n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(47),n(313)}()}));
|