import{initVueI18nase}from"@dcloudio/uni-i18n";importtfrom"@/pages.json";"undefined"!=typeofglobalThis?globalThis:"undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself&&self;functionn(e){returne&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}functions(e,t,n){returne(n={path:t,exports:{},require:function(e,t){returnfunction(){thrownewError("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}varo=s((function(e,t){varn;e.exports=(n=n||function(e,t){varn=Object.create||function(){functione(){}returnfunction(t){varn;returne.prototype=t,n=newe,e.prototype=null,n}}(),s={},o=s.lib={},r=o.Base={extend:function(e){vart=n(this);returne&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){vare=this.extend();returne.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(vartine)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){returnthis.init.prototype.extend(this)}},i=o.WordArray=r.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){vart=this.words,n=e.words,s=this.sigBytes,o=e.sigBytes;if(this.clamp(),s%4)for(varr=0;r<o;r++){vari=n[r>>>2]>>>24-r%4*8&255;t[s+r>>>2]|=i<<24-(s+r)%4*8}elsefor(r=0;r<o;r+=4)t[s+r>>>2]=n[r>>>2];returnthis.sigBytes+=o,this},clamp:function(){vart=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){vare=r.clone.call(this);returne.words=this.words.slice(0),e},random:function(t){for(varn,s=[],o=function(t){t=t;varn=987654321,s=4294967295;returnfunction(){varo=((n=36969*(65535&n)+(n>>16)&s)<<16)+(t=18e3*(65535&t)+(t>>16)&s)&s;returno/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},r=0;r<t;r+=4){vara=o(4294967296*(n||e.random()));n=987654071*a(),s.push(4294967296*a()|0)}returnnewi.init(s,t)}}),a=s.enc={},c=a.Hex={stringify:function(e){for(vart=e.words,n=e.sigBytes,s=[],o=0;o<n;o++){varr=t[o>>>2]>>>24-o%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}returns.join("")},parse:function(e){for(vart=e.length,n=[],s=0;s<t;s+=2)n[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;returnnewi.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(vart=e.words,n=e.sigBytes,s=[],o=0;o<n;o++){varr=t[o>>>2]>>>24-o%4*8&255;s.push(String.fromCharCode(r))}returns.join("")},parse:function(e){for(vart=e.length,n=[],s=0;s<t;s++)n[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;returnnewi.init(n,t)}},l=a.Utf8={stringify:function(e){try{returndecodeURIComponent(escape(u.stringify(e)))}catch(e){thrownewError("Malformed UTF-8 data")}},parse:function(e){returnu.parse(unescape(encodeURIComponent(e)))}},h=o.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=newi.init,this._nDataBytes=0},_append:function(e){"string"==typeofe&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){varn=this._data,s=n.words,o=n.sigBytes,r=this.blockSize,a=o/(4*r),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,u=e.min(4*c,o);if(c){for(varl=0;l<c;l+=r)this._doProcessBlock(s,l);varh=s.splice(0,c);n.sigBytes-=u}returnnewi.init(h,u)},clone:function(){vare=r.clone.call(this);returne._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=h.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){returnthis._append(e),this._process(),this},finalize:function(e){returne&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){returnfunction(t,n){returnnewe.init(n).finalize(t)}},_createHmacHelper:function(e){returnfunction(t,n){returnnewd.HMAC.init(e,n).finalize(t)}}});vard=s.algo={};returns}(Math),n)})),r=(s((function(e,t){varn;e.exports=(n=o,function(e){vart=n,s=t.lib,o=s.WordArray,r=s.Hasher,i=t.algo,a=[];!function(){for(vart=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();varc=i.MD5=r.extend({_doReset:function(){this._hash=newo.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(varn=0;n<16;n++){vars=t+n,o=e[s];e[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}varr=this._hash.words,i=e[t+0],c=e[t+1],f=e[t+2],g=e[t+3],p=e[t+4],m=e[t+5],y=e[t+6],_=e[t+7],w=e[t+8],k=e[t+9],v=e[t+10],T=e[t+11],S=e[t+12],P=e[t+13],A=e[t+14],I=e[t+15],b=r[0],O=r[1],C=r[2],E=r[3];b=u(b,O,C,E,i,7,a[0]),E=u(E,b,O,C,c,12,a[1]),C=u(C,E,b,O,f,17,a[2]),O=u(O,C,E,b,g,22,a[3]),b=u(b,O,C,E,p,7,a[4]),E=u(E,b,O,C,m,12,a[5]),C=u(C,E,b,O,y,17,a[6]),O=u(O,C,E,b,_,22,a[7]),b=u(b,O,C,E,w,7,a[8]),E=u(E,b,O,C,k,12,a[9]),C=u(C,E,b,O,v,17,a[10]),O=u(O,C,E,b,T,22,a[11]),b=u(b,O,C,E,S,7,a[12]),E=u(E,b,O,C,P,12,a[13]),C=u(C,E,b,O,A,17,a[14]),b=l(b,O=u(O,C,E,b,I,22,a[15]),C,E,c,5,a[16]),E=l(E,b,O,C,y,9,a[17]),C=l(C,E,b,O,T,14,a[18]),O=l(O,C,E,b,i,20,a[19]),b=l(b,O,C,E,m,5,a[20]),E=l(E,b,O,C,v,9,a[21]),C=l(C,E,b,O,I,14,a[22]),O=l(O,C,E,b,p,20,a[23]),b=l(b,O,C,E,k,5,a[24]),E=l(E,b,O,C,A,9,a[25]),C=l(C,E,b,O,g,14,a[26]),O=l(O,C,E,b,w,20,a[27]),b=l(b,O,C,E,P,5,a[28]),E=l(E,b,O,C,f,9,a[29]),C=l(C,E,b,O,_,14,a[30]),b=h(b,O=l(O,C,E,b,S,20,a[31]),C,E,m,4,a[32]),E=h(E,b,O,C,w,11,a[33]),C=h(C,E,b,O,T,16,a[34]),O=h(O,C,E,b,A,23,a[35]),b=h(b,O,C,E,c,4,a[36]),E=h(E,b,O,C,p,11,a[37]),C=h(C,E,b,O,_,16,a[38]),O=h(O,C,E,b,v,23,a[39]),b=h(b,O,C,E,P,4,a[40]),E=h(E,b,O,C,i,11,a[41]),C=h(C,E,b,O,g,16,a[42]),O=h(O,C,E,b,y,23,a[43]),b=h(b,O,C,E,k,4,a[44]),E=h(E,b,O,C,S,11,a[45]),C=h(C,E,b,O,I,16,a[46]),b=d(b,O=h(O,C,E,b,f,23,a[47]),C,E,i,6,a[48]),E=d(E,b,O,C,_,10,a[49]),C=d(C,E,b,O,A,15,a[50]),O=d(O,C,E,b,m,21,a[51]),b=d(b,O,C,E,S,6,a[52]),E=d(E,b,O,C,g,10,a[53]),C=d(C,E,b,O,v,15,a[54]),O=d(O,C,E,b,c,21,a[55]),b=d(b,O,C,E,w,6,a[56]),E=d(E,b,O,C,I,10,a[57]),C=d(C,E,b,O,y,15,a[58]),O=d(O,C,E,b,P,21,a[59]),b=d(b,O,C,E,p,6,a[60]),E=d(E,b,O,C,T,10,a[61]),C=d(C,E,b,O,f,15,a[62]),O=d(O,C,E,b,k,21,a[63]),r[0]=r[0]+b|0,r[1]=r[1]+O|0,r[2]=r[2]+C|0,r[3]=r[3]+E|0},_doFinalize:function(){vart=this._data,n=t.words,s=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;varr=e.floor(s/4294967296),i=s;n[15+(o+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n[14+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(n.length+1),this._process();for(vara=this._hash,c=a.words,u=0;u<4;u++){varl=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}returna},clone:function(){vare=r.clone.call(this);returne._hash=this._hash.clone(),e}});functionu(e,t,n,s,o,r,i){vara=e+(t&n|~t&s)+o+i;return(a<<r|a>>>32-r)+t}functionl(e,t,n,s,o,r,i){vara=e+(t&s|n&~s)+o+i;return(a<<r|a>>>32-r)+t}functionh(e,t,n,s,o,r,i){vara=e+(t^n^s)+o+i;return(a<<r|a>>>32-r)+t}functiond(e,t,n,s,o,r,i){vara=e+(n^(t|~s))+o+i;return(a<<r|a>>>32-r)+t}t.MD5=r._createHelper(c),t.HmacMD5=r._createHmacHelper(c)}(Math),n.MD5)})),s((function(e,t){varn,s,r;e.exports=(s=(n=o).lib.Base,r=n.enc.Utf8,void(n.algo.HMAC=s.extend({init:function(e,t){e=this._hasher=newe.init,"string"==typeoft&&(t=r.parse(t));varn=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(varo=this._oKey=t.clone(),i=this._iKey=t.clone(),a=o.words,c=i.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;o.sigBytes=i.sigBytes=s,this.reset()},reset:function(){vare=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){returnthis._hasher.update(e),this},finalize:function(e){vart=this._hasher,n=t.finalize(e);returnt.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),s((function(e,t){e.exports=o.HmacMD5})));consti="FUNCTION",a="OBJECT",c="CLIENT_DB";functionu(e){returnObject.prototype.toString.call(e).slice(8,-1).toLowerCase()}functionl(e){return"object"===u(e)}functionh(e){returne&&"string"==typeofe?JSON.parse(e):e}constd="development"===process.env.NODE_ENV,f=process.env.VUE_APP_PLATFORM;letg;switch(f){case"h5":g="web";break;case"app-plus":g="app";break;default:g=f}constp=h(process.env.UNICLOUD_DEBUG),m=h(process.env.UNI_CLOUD_PROVIDER)||[],y=process.env.RUN_BY_HBUILDERX;let_="";try{{conste=require("uni-stat-config").default||require("uni-stat-config");_=e.appid}}catch(e){}letw={};functionk(e,t={}){varn,s;returnn=w,s=e,Object.prototype.hasOwnProperty.call(n,s)||(w[e]=t),w[e]}"app"===g&&(w=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={});constv=["invoke","success","fail","complete"],T=k("_globalUniCloudInterceptor");functionS(e,t){T[e]||(T[e]={}),l(t)&&Object.keys(t).forEach((n=>{v.indexOf(n)>-1&&function(e,t,n){lets=T[e][t];s||(s=T[e][t]=[]),-1===s.indexOf(n)&&"function"==typeofn&&s.push(n)}(e,n,t[n])}))}functionP(e,t){T[e]||(T[e]={}),l(t)?Object.keys(t).forEach((n=>{v.indexOf(n)>-1&&function(e,t,n){consts=T[e][t];if(!s)return;consto=s.indexOf(n);o>-1&&s.splice(o,1)}(e,n,t[n])})):deleteT[e]}functionA(e,t){returne&&0!==e.length?e.reduce(((e,n)=>e.then((()=>n(t)))),Promise.resolve()):Promise.resolve()}functionI(e,t){returnT[e]&&T[e][t]||[]}functionb(e){S("callObject",e)}constO=k("_globalUniCloudListener"),C="response",E="needLogin",R="refreshToken",U="clientdb",x="cloudfunction",L="cloudobject";functionD(e){returnO[e]||(O[e]=[]),O[e]}functionN(e,t){constn=D(e);n.includes(t)||n.push(t)}functionq(e,t){constn=D(e),s=n.indexOf(t);-1!==s&&n.splice(s,1)}functionF(e,t){constn=D(e);for(lete=0;e<n.length;e++){(0,n[e])(t)}}letM=!1;constj=newPromise((e=>{M&&e(),functiont(){if("function"==typeofgetCurrentPages){constt=getCurrentPages();t&&t[0]&&(M=!0,e())}M||setTimeout((()=>{t()}),30)}()}));function$(){returnj}functionK(e,t){returnt?function(n){lets=!1;if("callFunction"===t){conste=n&&n.type||i;s=e!==i}consto="callFunction"===t&&!s;letr;r=this.isReady?Promise.resolve():this.initUniCloud,n=n||{};consta=r.then((()=>s?Promise.resolve():A(I(t,"invoke"),n))).then((()=>e.call(this,n))).then((e=>s?Promise.resolve(e):A(I(t,"success"),e).then((()=>A(I(t,"complete"),e))).then((()=>(o&&F(C,{type:x,content:e}),Promise.resolve(e))))),(e=>s?Promise.reject(e):A(I(t,"fail"),e).then((()=>A(I(t,"complete"),e))).then((()=>(F(C,{type:x,content:e}),Promise.reject(e))))));if(!(n.success||n.fail||n.complete))returna;a.then((e=>{n.success&&n.success(e),n.complete&&n.complete(e),o&&F(C,{type:x,content:e})}),(e=>{n.fail&&n.fail(e),n.complete&&n.complete(e),o&&F(C,{type:x,content:e})}))}:function(t){if(!((t=t||{}).success||t.fail||t.complete))returne.call(this,t);e.call(this,t).then((e=>{t.success&&t.success(e),t.complete&&t.complete(e)}),(e=>{t.fail&&t.fail(e),t.complete&&t.complete(e)}))}}classBextendsError{constructor(e){super(e.message),this.errMsg=e.message||"",this.errCode=this.code=e.code||"SYSTEM_ERROR",this.requestId=e.requestId}}functionH(){lete,t;try{if(uni.getLaunchOptionsSync){if(uni.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:n,channel:s}=uni.getLaunchOptionsSync();e=s,t=n}}catch(e){}return{channel:e,scene:t}}letW;functionz(){conste=uni.getLocale&&uni.getLocale()||"en";if(W)return{...W,locale:e,LOCALE:e};constt=uni.getSystemInfoSync(),{deviceId:n,osName:s,uniPlatform:o,appId:r}=t,i=["pixelRatio","brand","model","system","language","version","platform","host","SDKVersion","swanNativeVersion","app","AppPlatform","fontSizeSetting"];for(lete=0;e<i.length;e++){deletet[i[e]]}returnW={PLATFORM:o,OS:s,APPID:r,DEVICEID:n,...H(),...t},{...W,locale:e,LOCALE:e}}varJ={sign:function(e,t){letn="";returnObject.keys(e).sort().forEach((function(t){e[t]&&(n=n+"&"+t+"="+e[t])})),n=n.slice(1),r(n,t).toString()},wrappedRequest:function(e,t){returnnewPromise(((n,s)=>{t(Object.assign(e,{complete(e){e||(e={}),d&&"web"===g&&e.errMsg&&0===e.errMsg.indexOf("request:fail")&&console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");constt=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400)returns(newB({code:"SYS_ERR",message:e.errMsg||"request:fail",requestId:t}));consto=e.data;if(o.error)returns(newB({code:o.error.code,message:o.error.message,requestId:t}));o.result=o.data,o.requestId=t,deleteo.data,n(o)}}))}))}};varV={request:e=>uni.request(e),uploadFile:e=>uni.uploadFile(e),setStorageSync:(e,t)=>uni.setStorageSync(e,t),getStorageSync:e=>uni.getStorageSync(e),removeStorageSync:e=>uni.removeStorageSync(e),clearStorageSync:()=>uni.clearStorageSync()},Y={"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"};const{t:X}=e({"zh-Hans":{"uniCloud.init.paramRequired":"缺少参数:{param}","uniCloud.uploadFile.fileError":"filePath应为File对象"},"zh-Hant":{"uniCloud.init.paramRequired":"缺少参数:{param}","uniCloud.uploadFile.fileError":"filePath应为File对象"},en:Y,fr:{"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"},es:{"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"},ja:Y},"zh-Hans");varG=class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))thrownewError(X("uniCloud.init.paramRequired",{param:t}))})),this.config=Object.assign({},{endpoint:"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=V,this._getAccessTokenPromise=null,this._getAccessTokenPromiseStatus=null}gethasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){returnJ.wrappedRequest(e,this.adapter.request)}requestAuth(e){returnthis.requestWrapped(e)}request(e,t){returnPromise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>newPromise(((e,n)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?n(t):e()})).then((()=>this.getAccessToken())).then((()=>{constt=this.rebuildRequest(e);returnthis.request(t,!0)})))):this.getAccessToken().then((()=>{constt=this.rebuildRequest(e);returnthis.request(t,!0)}))))}rebuildRequest(e){constt=Object.assign({},e);returnt.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=J.sign(t.data,this.config.clientSecret),t}setupRequest(e,t){constn=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),s={"Content-Type":"application/json"};return"auth"!==t&&(n.token=this.accessToken,s["x-basement-token"]=this.accessToken),s["x-serverless-sign"]=J.sign(n,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:n,dataType:"json",header:s}}getAccessToken(){if("pending"===this._getAccessTokenPromiseStatus)returnthis._getAccessTokenPromise;this._getAccessTokenPromiseStatus="pending";returnthis._getAccessTokenPromise=this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>newPromise(((t,n)=>{e.result&&e.result.accessToken?(this.setAccessToken(e.result.accessToken),this._getAccessTokenPromiseStatus="fulfilled",t(this.accessToken)):(this._getAccessTokenPromiseStatus="rejected",n(newB({code:"AUTH_FAILED",message:"获取accessToken失败"})))}))),(e=>(this._getAccessTokenPromiseStatus="rejected",Promise.reject(e)))),this._getAccessTokenPromise}authorize(){this.getAccessToken()}callFunction(e){constt={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};returnthis.request(this.setupRequest(t))}getOSSUploadOptionsFromPath(e){constt={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};returnthis.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:n,filePath:s,fileType:o,onUploadProgress:r}){returnnewPromise(((i,a)=>{constc=this.adapter.uploadFile({url:e,formData:t,name:n,filePath:s,fileType:o,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?i(e):a(newB({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(newB({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeofr&&c&&"function"==typeofc.onProgressUpdate&&c.onProgressUpdate((e=>{r({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){constt={method:"serverless.file.resource.report",params:JSON.stringify(e)};returnthis.request(this.setupRequest(t))}uploadFile({filePath:e,cloudPath:t,fileType:n="image",onUploadProgress:s,config:o}){if("string"!==u(t))thrownewB({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))thrownewB({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});if(/:\/\//.test(t))thrownewB({code:"INVALID_PARAM",message:"cloudPath不合法"});constr=o&&o.envType||this.config.envType;leti,a;returnthis.getOSSUploadOptionsFromPath({env:r,filename:t}).then((t=>{consto=t.result;i=o.id,a="https://"+o.cdnDomain+"/"+o.ossPath;constr={url:"https://"+o.host,formData:{"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:o.accessKeyId,Signature:o.signature,host:o.host,id:i,key:o.ossPath,policy:o.policy,success_action_status:200},fileName:"file",name:"file",filePath:e,fileType:n};returnthis.uploadFileToOSS(Object.assign({},r,{onUploadProgress:s}))})).then((()=>this.reportOSSUpload({id:i}))).then((t=>newPromise(((n,s)=>{t.success?n({success:!0,filePath:e,fileID:a}):s(newB({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){constt={method:"serverless.file.resource.delete",params:JSON.stringify({id:e[0]})};returnthis.request(this.setupRequest(t))}getTempFileURL({fileList:e}={}){returnnewPromise(((t,n)=>{Array.isArray(e)&&0!==e.length||n(newB({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}};varQ={init(e){constt=newG(e),n={signInAnonymously:function(){returnt.authorize()},getLoginState:function(){returnPromise.resolve(!1)}};returnt.auth=function(){returnn},t.customAuth=t.auth,t}};constZ="undefined"!=typeoflocation&&"http:"===location.protocol?"http:":"https:";varee;!function(e){e.local="local",e.none="none",e.session="session"}(ee||(ee={}));varte=function(){};constne=()=>{lete;if(!Promise){e=()=>{},e.promise={};constt=()=>{thrownewB({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};returnObject.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}constt=newPromise(((t,n)=>{e=(e,s)=>e?n(e):t(s)}));returne.promise=t,e};functionse(e){returnvoid0===e}functionoe(e){return"[object Null]"===Object.prototype.toString.call(e)}varre;functionie(e){constt=(n=e,"[object Array]"===Object.prototype.toString.call(n)?e:[e]);varn;for(consteoft){const{isMatch:t,genAdapter:n,runtime:s}=e;if(t())return{adapter:n(),runtime:s}}}!function(e){e.WEB="web",e.WX_MP="wx_mp"}(re||(re={}));constae={adapter:null,runtime:void0},ce=["anonymousUuidKey"];classueextendste{constructor(){super(),ae.adapter.root.tcbObject||(ae.adapter.root.tcbObject={})}setItem(e,t){ae.adapter.root.tcbObject[e]=t}getItem(e){returnae.adapter.root.tcbObject[e]}removeItem(e){deleteae.adapter.root.tcbObject[e]}clear(){deleteae.adapter.root.tcbObject}}functionle(e,t){switch(e){case"local":returnt.localStorage||newue;case"none":returnnewue;default:returnt.sessionStorage||newue}}classhe{constructor(e){if(!this._storage){this._persistence=ae.adapter.primaryStorage||e.persistence,this._storage=le(this._persistence,ae.adapter);constt=`access_token_${e.env}`,n=`access_token_expire_${e.env}`,s=`refresh_token_${e.env}`,o=`anonymous_uuid_${e.env}`,r=`login_type_${e.env}`,i=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s,anonymousUuidKey:o,loginTypeKey:r,userInfoKey:i}}}updatePersistence(e){if(e===this._persistence)return;constt="local"===this._persistence;this._persistence=e;constn=le(e,ae.adapter);for(consteinthis.keys){consts=this.keys[e];if(t&&ce.includes(e))continue;consto=this._storage.getItem(s);se(o)||oe(o)||(n.setItem(s,o),this._storage.removeItem(s))}this._storage=n}setStore(e,t,n){if(!this._storage)return;consts={version:n||"localCachev1",content:t},o=JSON.stringify(s);try{this._storage.setItem(e,o)}catch(e){throwe}}getStore(e,t){try{if(!this._storage)return}catch(e){return""}t=t||"localCachev1";constn=this._storage.getItem(e);if(!n)return"";if(n.indexOf(t)>=0){returnJSON.parse(n).content}return""}removeStore(e){this._storage.removeItem(e)}}constde={},fe={};functionge(e){returnde[e]}classpe{constructor(e,t){this.data=t||null,this.name=e}}classmeextendspe{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}constye=newclass{constructor(){this._listeners={}}on(e,t){returnfunction(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this._listeners),this}off(e,t){returnfunction(e,t,n){if(n&&n[e]){consts=n[e].indexOf(t);-1!==s&&n[e].splice(s,1)}}(e,t,this._listeners),this}fire(e,t){if(einstanceofme)returnconsole.error(e.error),this;constn="string"==typeofe?newpe(e,t||{}):e;consts=n.name;if(this._listens(s)){n.target=this;conste=this._listeners[s]?[...this._listeners[s]]:[];for(consttofe)t.call(this,n)}returnthis}_listens(e){returnthis._listeners[e]&&this._listeners[e].length>0}};function_e(e,t){ye.on(e,t)}functionwe(e,t={}){ye.fire(e,t)}functionke(e,t){ye.off(e,t)}constve="loginStateChanged",Te="loginStateExpire",Se="loginTypeChanged",Pe="anonymousConverted",Ae="refreshAccessToken";varIe;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}(Ie||(Ie={}));constbe=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Oe={"X-SDK-Version":"1.3.5"};functionCe(e,t,n){consts=e[t];e[t]=function(t){consto={},r={};n.forEach((n=>{const{data:s,headers:i}=n.call(e,t);Object.assign(o,s),Object.assign(r,i)}));consti=t.data;returni&&(()=>{vare;if(e=i,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...i,...o};elsefor(consteino)i.append(e,o[e])})(),t.headers={...t.headers||{},...r},s.call(e,t)}}functionEe(){conste=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Oe,"x-seqid":e}}}classRe{constructor(e={}){vart;this.config=e,this._reqClass=newae.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=ge(this.config.env),this._localCache=(t=this.config.env,fe[t]),Ce(this._reqClass,"post",[Ee]),Ce(this._reqClass,"upload",[Ee]),Ce(this._reqClass,"download",[Ee])}asyncpost(e){returnawaitthis._reqClass.post(e)}asyncupload(e){returnawaitthis._reqClass.upload(e)}asyncdownload(e){returnawaitthis._reqClass.download(e)}asyncrefreshAccessToken(){lete,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=awaitthis._refreshAccessTokenPromise}catch(e){t=e}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throwt;returne}async_refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n,loginTypeKey:s,anonymousUuidKey:o}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);letr=this._cache.getStore(n);if(!r)thrownewB({message:"未登录CloudBase"});consti={refresh_token:r},a=awaitthis.request("auth.fetchAccessTokenWithRefreshToken",i);if(a.data.code){const{code:e}=a.data;if("SIGN_PARAM_INVALID"===e||"REFRESH_TOKEN_EXPIRED"===e||"INVALID_REFRESH_TOKEN"===e){if(this._cache.getStore(s)===Ie.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){conste=this._cache.getStore(o),t=this._cache.getStore(n),s=awaitthis.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});returnthis.setRefreshToken(s.refresh_token),this._refreshAccessToken()}we(Te),this._cache.removeStore(n)}thrownewB({code:a.data.code,message:`刷新access token失败:${a.data.code}`})}if(a.data.access_token)returnwe(Ae),this._cache.setStore(e,a.data.access_token),this._cache.setStore(t,a.data.access_token_expire+Date.now()),{accessToken:a.data.access_token,accessTokenExpire:a.data.access_token_expire};a.data.refresh_token&&(this._cache.removeStore(n),this._cache.setStore(n,a.data.refresh_token),this._refreshAccessToken())}asyncgetAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n}=this._cache.keys;if(!this._cache.getStore(n))thrownewB({message:"refresh token不存在,登录状态异常"});lets=this._cache.getStore(e),o=this._cache.getStore(t),r=!0;returnthis._shouldRefreshAccessTokenHook&&!awaitthis._shouldRefreshAccessTokenHook(s,o)&&(r=!1),(!s||!o||o<Date.now())&&r?this.refreshAccessToken():{accessToken:s,accessTokenExpire:o}}asyncrequest(e,t,n){consts=`x-tcb-trace_${this.config.env}`;leto="application/x-www-form-urlencoded";constr={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===be.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(r.access_token=(awaitthis.getAccessToken()).accessToken)}leti;if("storage.uploadFile"===e){i=newFormData;for(leteini)i.hasOwnProperty(e)&&void0!==i[e]&&i.append(e,r[e]);o="multipart/form-data"}else{o="application/json",i={};for(leteinr)void0!==r[e]&&(i[e]=r[e])}leta={headers:{"content-type":o}};n&&n.onUploadProgress&&(a.onUploadProgress=n.onUploadProgress);constc=this._localCache.getStore(s);c&&(a.headers["X-TCB-Trace"]=c);const{parse:u,inQuery:l,search:h}=t;letd={env:this.config.env};u&&(d.parse=!0),l&&(d={...l,...d});letf=function(e,t,n={}){consts=/\?/.test(t);leto="";for(leteinn)""===o?!s&&(t+="?"):o+="&",o+=`${e}=${encodeURIComponent(n[e])}`;return/^http(s)?\:\/\//.test(t+=o)?t:`${e}${t}`}(Z,"//tcb-api.tencentcloudapi.com/web",d);h&&(f+=h);constg=awaitthis.post({url:f,data:i,...a}),p=g.header&&g.header["x-tcb-trace"];if(p&&this._localCache.setStore(s,p),200!==Number(g.status)&&200!==Number(g.statusCode)||!g.data)thrownewB({code:"NETWORK_ERROR",message:"network request error"});returng}asyncsend(e,t={}){constn=awaitthis.request(e,t,{onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===n.data.code&&-1===be.indexOf(e)){awaitthis.refreshAccessToken();constn=awaitthis.request(e,t,{onUploadProgress:t.onUploadProgress});if(n.data.code)thrownewB({code:n.data.code,message:n.data.message});returnn.data}if(n.data.code)thrownewB({code:n.data.code,message:n.data.message});returnn.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}}constUe={};functionxe(e){returnUe[e]}classLe{constructor(e){this.config=e,this._cache=ge(e.env),this._request=xe(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}setAccessToken(e,t){const{accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys;this._cache.setStore(n,e),this._cache.setStore(s,t)}asyncrefreshUserInfo(){const{data:e}=awaitthis._request.send("auth.getUserInfo",{});returnthis.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}classDe{constructor(e){if(!e)thrownewB({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=ge(this._envId),this._request=xe(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeofe)thrownewB({code:"PARAM_ERROR",message:"ticket must be string"});returnthis._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){returnthis._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){returnthis._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if("string"!=typeofe)thrownewB({code:"PARAM_ERROR",message:"username must be a string"});returnthis._request.send("auth.updateUsername",{username:e})}asyncgetLinkedUidList(){const{data:e}=awaitthis._request.send("auth.getLinkedUidList",{});lett=!1;const{users:n}=e;returnn.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:n,hasPrimaryUid:t}}setPrimaryUid(e){returnthis._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){returnthis._request.send("auth.unlink",{platform:e})}asyncupdate(e){const{nickName:t,gender:n,avatarUrl:s,province:o,country:r,city:i}=e,{data:a}=awaitthis._request.send("auth.updateUserInfo",{nickName:t,gender:n,avatarUrl:s,province:o,country:r,city:i});this.setLocalUserInfo(a)}asyncrefresh(){const{data:e}=awaitthis._request.send("auth.getUserInfo",{});returnthis.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach((e=>{this[e]=t[e]})),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}classNe{constructor(e){if(!e)thrownewB({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=ge(e);const{refreshTokenKey:t,accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys,o=this._cache.getStore(t),r=this._cache.getStore(n),i=this._cache.getStore(s);this.credential={refreshToken:o,accessToken:r,accessTokenExpire:i},this.user=newDe(e)}getisAnonymousAuth(){returnthis.loginType===Ie.ANONYMOUS}getisCustomAuth(){returnthis.loginType===Ie.CUSTOM}getisWeixinAuth(){returnthis.loginType===Ie.WECHAT||this.loginType===Ie.WECHAT_OPEN||this.loginType===Ie.WECHAT_PUBLIC}getloginType(){returnthis._cache.getStore(this._cache.keys.loginTypeKey)}}classqeextendsLe{asyncsignIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,n=this._cache.getStore(e)||void0,s=this._cache.getStore(t)||void0,o=awaitthis._request.send("auth.signInAnonymously",{anonymous_uuid:n,refresh_token:s});if(o.uuid&&o.refresh_token){this._setAnonymousUUID(o.uuid),this.setRefreshToken(o.refresh_token),awaitthis._request.refreshAccessToken(),we(ve),we(Se,{env:this.config.env,loginType:Ie.ANONYMOUS,persistence:"local"});conste=newNe(this.config.env);returnawaite.user.refresh(),e}thrownewB({message:"匿名登录失败"})}asynclinkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:n}=this._cache.keys,s=this._cache.getStore(t),o=this._cache.getStore(n),r=awaitthis._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:s,refresh_token:o,ticket:e});if(r.refresh_token)returnthis._clearAnonymousUUID(),this.setRefreshToken(r.refresh_token),awaitthis._request.refreshAccessToken(),we(Pe,{env:this.config.env}),we(Se,{loginType:Ie.CUSTOM,persistence:"local"}),{credential:{refreshToken:r.refresh_token}};thrownewB({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(n,Ie.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}classFeextendsLe{asyncsignIn(e){if("string"!=typeofe)thrownewB({param:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,n=awaitthis._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(n.refresh_token)returnthis.setRefreshToken(n.refresh_token),awaitthis._request.refreshAccessToken(),we(ve),we(Se,{env:this.config.env,loginType:Ie.CUSTOM,persistence:this.config.persistence}),awaitthis.refreshUserInfo(),newNe(this.config.env);thrownewB({message:"自定义登录失败"})}}classMeextendsLe{asyncsignIn(e,t){if("string"!=typeofe)thrownewB({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:n}=this._cache.keys,s=awaitthis._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:o,access_token:r,access_token_expire:i}=s;if(o)returnthis.setRefreshToken(o),r&&i?this.setAccessToken(r,i):awaitthis._request.refreshAccessToken(),awaitthis.refreshUserInfo(),we(ve),we(Se,{env:this.config.env,loginType:Ie.EMAIL,persistence:this.config.persistence}),newNe(this.config.env);throws.code?newB({code:s.code,message:`邮箱登录失败: ${s.message}`}):newB({message:"邮箱登录失败"})}asyncactivate(e){returnthis._request.send("auth.activateEndUserMail",{token:e})}asyncresetPasswordWithToken(e,t){returnthis._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}classjeextendsLe{asyncsignIn(e,t){if("string"!=typeofe)thrownewB({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeoft&&(t="",console.warn("password is empty"));const{refreshTokenKey:n}=this._cache.keys,s=awaitthis._request.send("auth.signIn",{loginType:Ie.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:o,access_token_expire:r,access_token:i}=s;if(o)returnthis.setRefreshToken(o),i&&r?this.setAccessToken(i,r):awaitthis._request.refreshAccessToken(),awaitthis.refreshUserInfo(),we(ve),we(Se,{env:this.config.env,loginType:Ie.USERNAME,persistence:this.config.persistence}),newNe(this.config.env);throws.code?newB({code:s.code,message:`用户名密码登录失败: ${s.message}`}):newB({message:"用户名密码登录失败"})}}class$e{constructor(e){this.config=e,this._cache=ge(e.env),this._request=xe(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),_e(Se,this._onLoginTypeChanged)}getcurrentUser(){conste=this.hasLoginState();returne&&e.user||null}getloginType(){returnthis._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){returnnewqe(this.config)}customAuthProvider(){returnnewFe(this.config)}emailAuthProvider(){returnnewMe(this.config)}usernameAuthProvider(){returnnewje(this.config)}asyncsignInAnonymously(){returnnewqe(this.config).signIn()}asyncsignInWithEmailAndPassword(e,t){returnnewMe(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){returnnewje(this.config).signIn(e,t)}asynclinkAndRetrieveDataWithTicket(e){this._anonymousAuthProvider||(this._anonymousAuthProvider=newqe(this.config)),_e(Pe,this._onAnonymousConverted);returnawaitthis._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}asyncsignOut(){if(this.loginType===Ie.ANONYMOUS)thrownewB({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:n}=this._cache.keys,s=this._cache.getStore(e);if(!s)return;consto=awaitthis._request.send("auth.logout",{refresh_token:s});returnthis._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(n),we(ve),we(Se,{env:this.config.env,loginType:Ie.NULL,persistence:this.config.persistence}),o}asyncsignUpWithEmailAndPassword(e,t){returnthis._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}asyncsendPasswordResetEmail(e){returnthis._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){_e(ve,(()=>{constt=this.hasLoginState();e.call(this,t)}));constt=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){_e(Te,e.bind(this))}onAccessTokenRefreshed(e){_e(Ae,e.bind(this))}onAnonymousConverted(e){_e(Pe,e.bind(this))}onLoginTypeChanged(e){_e(Se,(()=>{constt=this.hasLoginState();e.call(this,t)}))}asyncgetAccessToken(){return{accessToken:(awaitthis._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{refreshTokenKey:e}=this._cache.keys;returnthis._cache.getStore(e)?newNe(this.config.env):null}asyncisUsernameRegistered(e){if("string"!=typeofe)thrownewB({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=awaitthis._request.send("auth.isUsernameRegistered",{username:e});returnt&&t.isRegistered}getLoginState(){returnPromise.resolve(this.hasLoginState())}asyncsignInWithTicket(e){returnnewFe(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){returnthis._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,n=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+n}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:n,env:s}=e.data;s===this.config.env&&(this._cache.updatePersistence(n),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}constKe=function(e,t){t=t||ne();constn=xe(this.config.env),{cloudPath:s,filePath:o,onUploadProgress:r,fileType:i="image"}=e;returnn.send("storage.getUploadMetadata",{path:s}).then((e=>{const{data:{url:a,authorization:c,token:u,fileId:l,cosFileId:h},requestId:d}=e,f={key:s,signature:c,"x-cos-meta-fileid":h,success_action_status:"201","x-cos-security-token":u};n.upload({url:a,data:f,file:o,name:s,fileType:i,onUploadProgress:r}).then((e=>{201===e.statusCode?t(null,{fileID:l,requestId:d}):t(newB({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},Be=function(e,t){t=t||ne();constn=xe(this.config.env),{cloudPath:s}=e;returnn.send("storage.getUploadMetadata",{path:s}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},He=function({fileList:e},t){if(t=t||ne(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(lettofe)if(!t||"string"!=typeoft)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};constn={fileid_list:e};returnxe(this.config.env).send("storage.batchDeleteFile",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},We=function({fileList:e},t){t=t||ne(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});letn=[];for(letsofe)"object"==typeofs?(s.hasOwnProperty("fileID")&&s.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),n.push({fileid:s.fileID,max_age:s.maxAge})):"string"==typeofs?n.push({fileid:s}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});consts={file_list:n};returnxe(this.config.env).send("storage.batchGetDownloadUrl",s).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},ze=asyncfunction({fileID:e},t){constn=(awaitWe.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==n.code)returnt?t(n):newPromise((e=>{e(n)}));consts=xe(this.config.env);leto=n.download_url;if(o=encodeURI(o),!t)returns.download({url:o});t(awaits.download({url:o}))},Je=function({name:e,data:t,query:n,parse:s,search:o},r){consti=r||ne();leta;try{a=t?JSON.stringify(t):""}catch(e){returnPromise.reject(e)}if(!e)returnPromise.reject(newB({code:"PARAM_ERROR",message:"函数名不能为空"}));constc={inQuery:n,parse:s,search:o,function_name:e,request_data:a};returnxe(this.config.env).send("functions.invokeFunction",c).then((e=>{if(e.code)i(null,e);else{lett=e.data.response_data;if(s)i(null,{result:t,requestId:e.requestId});elsetry{t=JSON.parse(e.data.response_data),i(null,{result:t,requestId:e.requestId})}catch(e){i(newB({message:"response data must be json"}))}}returni.promise})).catch((e=>{i(e)})),i.promise},Ve={timeout:15e3,persistence:"session"},Ye={};classXe{constructor(e){this.config=e||this.config,this.authObj=void0}init(e){switch(ae.adapter||(this.requestClient=newae.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...Ve,...e},!0){casethis.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;casethis.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}returnnewXe(this.config)}auth({persistence:e}={}){if(this.authObj)returnthis.authObj;constt=e||ae.adapter.primaryStorage||Ve.persistence;varn;returnt!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;de[t]=newhe(e),fe[t]=newhe({...e,persistence:"local"})}(this.config),n=this.config,Ue[n.env]=newRe(n),this.authObj=new$e(this.config),this.authObj}on(e,t){return_e.apply(this,[e,t])}off(e,t){returnke.apply(this,[e,t])}callFunction(e,t){returnJe.apply(this,[e,t])}deleteFile(e,t){returnHe.apply(this,[e,t])}getTempFileURL(e,t){returnWe.apply(this,[e,t])}downloadFile(e,t){returnze.apply(this,[e,t])}uploadFile(e,t){returnKe.apply(this,[e,t])}getUploadMetadata(e,t){returnBe.apply(this,[e,t])}registerExtension(e){Ye[e.name]=e}asyncinvokeExtension(e,t){constn=Ye[e];if(!n)thrownewB({message:`扩展${e} 必须先注册`});returnawaitn.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:n}=ie(e)||{};t&&(ae.adapter=t),n&&(ae.runtime=n)}}varGe=newXe;functionQe(e,t,n){void0===n&&(n={});vars=/\?/.test(t),o="";for(varrinn)""===o?!s&&(t+="?"):o+="&",o+=r+"="+encodeURIComponent(n[r]);return/^http(s)?:\/\//.test(t+=o)?t:""+e+t}classZe{post(e){const{url:t,data:n,headers:s}=e;returnnewPromise(((e,o)=>{V.request({url:Qe("https:",t),data:n,method:"POST",header:s,success(t){e(t)},fail(e){o(e)}})}))}upload(e){returnnewPromise(((t,n)=>{const{url:s,file:o,data:r,headers:i,fileType:a}=e,c=V.uploadFile({url:Qe("https:",s),name:"file",formData:Object.assign({},r),filePath:o,fileType:a,header:i,success(e){constn={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&r.success_action_status&&(n.statusCode=parseInt(r.success_action_status,10)),t(n)},fail(e){n(newError(e.errMsg||"uploadFile:fail"))}});"function"==typeofe.onUploadProgress&&c&&"function"==typeofc.onProgressUpdate&&c.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}constet={setItem(e,t){V.setStorageSync(e,t)},getItem:e=>V.getStorageSync(e),removeItem(e){V.removeStorageSync(e)},clear(){V.clearStorageSync()}};vartt={genAdapter:function(){return{root:{},reqClass:Ze,localStorage:et,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};Ge.useAdapters(tt);constnt=Ge,st=nt.init;nt.init=function(e){e.env=e.spaceId;constt=st.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;constn=t.auth;returnt.auth=function(e){constt=n.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{t[e]=K(t[e]).bind(t)})),t},t.customAuth=t.auth,t};varot=nt;functionrt(){return{token:V.getStorageSync("uni_id_token")||V.getStorageSync("uniIdToken"),tokenExpired:V.getStorageSync("uni_id_token_expired")}}functionit({token:e,tokenExpired:t}={}){e&&V.setStorageSync("uni_id_token",e),t&&V.setStorageSync("uni_id_token_expired",t)}functionat(){if(!d||"web"!==g)return;uni.getStorageSync("__LAST_DCLOUD_APPID")!==_&&(uni.setStorageSync("__LAST_DCLOUD_APPID",_),console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"),V.removeStorageSync("uni_id_token"),V.removeStorageSync("uniIdToken"),V.removeStorageSync("uni_id_token_expired"))}varct=classextendsG{getAccessToken(){returnnewPromise(((e,t)=>{constn="Anonymous_Access_token";this.setAccessToken(n),e(n)}))}setupRequest(e,t){constn=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),s={"Content-Type":"application/json"};"auth"!==t&&(n.token=this.accessToken,s["x-basement-token"]=this.accessToken),s["x-serverless-sign"]=J.sign(n,this.config.clientSecret);consto=z();s["x-client-info"]=encodeURIComponent(JSON.stringify(o));const{token:r}=rt();returns["x-client-token"]=r,{url:this.config.requestUrl,method:"POST",data:n,dataType:"json",header:JSON.parse(JSON.stringify(s))}}uploadFileToOSS({url:e,formData:t,name:n,filePath:s,fileType:o,onUploadProgress:r}){returnnewPromise(((i,a)=>{constc=this.adapter.uploadFile({url:e,formData:t,name:n,filePath:s,fileType:o,success(e){e&&e.statusCode<400?i(e):a(newB({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(newB({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeofr&&c&&"function"==typeofc.onProgressUpdate&&c.onProgressUpdate((e=>{r({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}uploadFile({filePath:e,cloudPath:t,fileType:n="image",onUploadProgress:s}){if(!t)thrownewB({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});leto;returnthis.getOSSUploadOptionsFromPath({cloudPath:t}).then((t=>{const{url:r,formData:i,name:a}=t.result;o=t.result.fileUrl;constc={url:r,formData:i,name:a,filePath:e,fileType:n};returnthis.uploadFileToOSS(Object.assign({},c,{onUploadProgress:s}))})).then((()=>this.reportOSSUpload({cloudPath:t}))).then((t=>newPromise(((n,s)=>{t.success?n({success:!0,filePath:e,fileID:o}):s(newB({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){constt={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};returnthis.request(this.setupRequest(t))}getTempFileURL({fileList:e}={}){constt={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e})};returnthis.request(this.setupRequest(t))}};varut={init(e){constt=newct(e),n={signInAnonymously:function(){returnt.authorize()},getLoginState:function(){returnPromise.resolve(!1)}};returnt.auth=function(){returnn},t.customAuth=t.auth,t}};functionlt({data:e}){lett;t=z();constn=JSON.parse(JSON.stringify(e||{}));if(Object.assign(n,{clientInfo:t}),!n.uniIdToken){const{token:e}=rt();e&&(n.uniIdToken=e)}returnn}functionht({name:e,data:t}={}){const{localAddress:n,localPort:s}=this.__dev__,o={aliyun:"aliyun",tencent:"tcb"}[this.config.provider],r=this.config.spaceId,i=`http://${n}:${s}/system/check-function`,a=`http://${n}:${s}/cloudfunctions/${e}`;returnnewPromise(((t,n)=>{V.request({method:"POST",url:i,data:{name:e,platform:g,provider:o,spaceId:r},timeout:3e3,success(e){t(e)},fail(){t({data:{code:"NETWORK_ERROR",message:"连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"}})}})})).then((({data:e}={})=>{const{code:t,message:n}=e||{};return{code:0===t?0:t||"SYS_ERR",message:n||"SYS_ERR"}})).then((({code:n,message:s})=>{if(0!==n){switch(n){case"MODULE_ENCRYPTED":console.error(`此云函数(${e})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);break;case"FUNCTION_ENCRYPTED":console.error(`此云函数(${e})已加密不可本地调试,自动切换为云端已部署的云函数`);break;case"ACTION_ENCRYPTED":console.error(s||"需要访问加密的uni-clientDB-action,自动切换为云端环境");break;case"NETWORK_ERROR":{conste="连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";throwconsole.error(e),newError(e)}case"SWITCH_TO_CLOUD":break;default:{conste=`检测本地调试服务出现错误:${s},请检查网络环境或重启客户端再试`;throwconsole.error(e),newError(e)}}returnthis._callCloudFunction({name:e,data:t})}returnnewPromise(((e,n)=>{consts=lt.call(this,{data:t});V.request({method:"POST",url:a,data:{provider:o,platform:g,param:s},success:({statusCode:t,data:s}={})=>!t||t>=400?n(newB({code:s.code||"SYS_ERR",message:s.message||"request:fail"})):e({result:s}),fail(e){n(newB({code:e.code||e.errCode||"SYS_ERR",message:e.message||e.errMsg||"request:fail"}))}})}))}))}constdt=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];varft=/[\\^$.*+?()[\]{}|]/g,gt=RegExp(ft.source);functionpt(e,t,n){returne.replace(newRegExp((s=t)&>.test(s)?s.replace(ft,"\\$&"):s,"g"),n);vars}functionmt({functionName:e,result:t,logPvd:n}){if(this.__dev__.debugLog&&t&&t.requestId){consts=JSON.stringify({spaceId:this.config.spaceId,functionName:e,requestId:t.requestId});console.log(`[${n}-request]${s}[/${n}-request]`)}}functionyt(e){constt=e.callFunction,n=function(n){consts=n.name;n.data=lt.call(e,{data:n.data});consto={aliyun:"aliyun",tencent:"tcb",tcb:"tcb"}[this.config.provider];returnt.call(this,n).then((e=>(e.errCode=0,mt.call(this,{functionName:s,result:e,logPvd:o}),Promise.resolve(e))),(e=>(mt.call(this,{functionName:s,result:e,logPvd:o}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:n=[]}={}){for(lets=0;s<n.length;s++){const{rule:o,content:r,mode:i}=n[s],a=e.match(o);if(!a)continue;letc=r;for(lete=1;e<a.length;e++)c=pt(c,`{$${e}}`,a[e]);for(consteint)c=pt(c,`{${e}}`,t[e]);return"replace"===i?c:e+c}returne}({message:`[${n.name}]: ${e.message}`,formatter:dt,extraInfo:{functionName:s}})),Promise.reject(e))))};e.callFunction=function(t){lets;d&&e.__dev__.debugInfo&&!e.__dev__.debugInfo.forceRemote&&m?(e._callCloudFunction||(e._callCloudFunction=n,e._callLocalFunction=ht),s=ht):s=n;consto=s.call(this,t);returnObject.defineProperty(o,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),o}}const_t=Symbol("CLIENT_DB_INTERNAL");functionwt(e,t){returne.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=_t,e.__ob__=void0,newProxy(e,{get(e,n,s){if("_uniClient"===n)returnnull;if(nine||"string"!=typeofn){constt=e[n];return"function"==typeoft?t.bind(e):t}returnt.get(e,n,s)}})}functionkt(e){return{on:(t,n)=>{e[t]=e[t]||[],e[t].indexOf(n)>-1||e[t].push(n)},off:(t,n)=>{e[t]=e[t]||[];consts=e[t].indexOf(n);-1!==s&&e[t].splice(s,1)}}}constvt=["db.Geo","db.command","command.aggregate"];functionTt(e,t){returnvt.indexOf(`${e}.${t}`)>-1}functionSt(e){switch(u(e)){case"array":returne.map((e=>St(e)));case"object":returne._internalType===_t||Object.keys(e).forEach((t=>{e[t]=St(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:returne}}functionPt(e){returne&&e.content&&e.content.$method}classAt{constructor(e,t,n){this.content=e,this.prevStage=t||null,this.udb=null,this._database=n}toJSON(){lete=this;constt=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:St(e.$param)})))}}getAction(){conste=this.toJSON().$db.find((e=>"action"===e.$method));returne&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}getisAggregate(){lete=this;for(;e;){constt=Pt(e),n=Pt(e.prevStage);if("aggregate"===t&&"collection"===n||"pipeline"===t)return!0;e=e.prevStage}return!1}getisCommand(){lete=this;for(;e;){if("command"===Pt(e))return!0;e=e.prevStage}return!1}getisAggregateCommand(){lete=this;for(;e;){constt=Pt(e),n=Pt(e.prevStage);if("aggregate"===t&&"command"===n)return!0;e=e.prevStage}return!1}getcount(){if(!this.isAggregate)returnfunction(){returnthis._send("count",Array.from(arguments))};conste=this;returnfunction(){returnIt({$method:"count",$param:St(Array.from(arguments))},e,this._database)}}getremove(){if(!this.isCommand)returnfunction(){returnthis._send("remove",Array.from(arguments))};conste=this;returnfunction(){returnIt({$method:"remove",$param:St(Array.from(arguments))},e,this._database)}}get(){returnthis._send("get",Array.from(arguments))}add(){returnthis._send("add",Array.from(arguments))}update(){returnthis._send("update",Array.from(arguments))}end(){returnthis._send("end",Array.from(arguments))}getset(){if(!this.isCommand)returnfunction(){thrownewError("JQL禁止使用set方法")};conste=this;returnfunction(){returnIt({$method:"set",$param:St(Array.from(arguments))},e,this._database)}}_send(e,t){constn=this.getAction(),s=this.getCommand();if(s.$db.push({$method:e,$param:St(t)}),d){conste=s.$db.find((e=>"collection"===e.$method)),t=e&&e.$param;t&&1===t.length&&"string"==typeofe.$param[0]&&e.$param[0].indexOf(",")>-1&&console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。")}returnthis._database._callCloudFunction({action:n,command:s})}}functionIt(e,t,n){returnwt(newAt(e,t,n),{get(e,t){lets="db";returne&&e.content&&(s=e.content.$method),Tt(s,t)?It({$method:t},e,n):function(){returnIt({$method:t,$param:St(Array.from(arguments))},e,n)}}})}functionbt({path:e,method:t}){returnclass{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}}}classOtextendsclass{constructor({uniClient:e={}}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e.isDefault&&(this._dbCallBacks=k("_globalUniCloudDatabaseCallback")),this.auth=kt(this._authCallBacks),Object.assign(this,kt(this._dbCallBacks)),this.env=wt({},{get:(e,t)=>({$env:t})}),this.Geo=wt({},{get:(e,t)=>bt({path:["Geo"],method:t})}),this.serverDate=bt({path:[],method:"serverDate"}),this.RegExp=bt({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeofe||!e.trim())thrownewError("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){constn=this._dbCallBacks;n[e]&&n[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){constn=this._authCallBacks;n[e]&&n[e].forEach((e=>{e(...t)}))}multiSend(){conste=Array.from(arguments),t=e.map((e=>{constt=e.getAction(),n=e.getCommand();if("getTemp"!==n.$db[n.$db.length-1].$method)thrownewError("multiSend只支持子命令内使用getTemp");return{action:t,command:n}}));returnthis._callCloudFunction({multiCommand:t,queryList:e})}}{_callCloudFunction({action:e,command:t,multiCommand:n,queryList:s}){functiono(e,t){if(n&&s)for(letn=0;n<s.length;n++){consto=s[n];o.udb&&"function"==typeofo.udb.setResult&&(t?o.udb.setResult(t):o.udb.setResult(e.result.dataList[n]))}}constr=this;functioni(e){returnr._callback("error",[e]),A(I("database","fail"),e).then((()=>A(I("database","complete"),e))).then((()=>(o(null,e),F(C,{type:U,content:e}),Promise.reject(e))))}consta=A(I("database","invoke")),u=this._uniClient;returna.then((()=>u.callFunction({name:"DCloud-clientDB",type:c,data:{action:e,command:t,multiCommand:n}}))).then((e=>{const{code:t,message:n,token:s,tokenExpired:r,systemInfo:a=[]}=e.result;if(a)for(lete=0;e<a.length;e++){const{level:t,message:n,detail:s}=a[e],o=console["app"===g&&"warn"===t?"error":t]||console.log;letr="[System Info]"+n;s&&(r=`${r}\n详细信息:${s}`),o(r)}if(t){returni(newB({code:t,message:n,requestId:e.requestId}))}e.result.errCode=e.result.code,e.result.errMsg=e.result.message,s&&r&&(it({token:s,tokenExpired:r}),this._callbackAuth("refreshToken",[{token:s,tokenExpired:r}]),this._callback("refreshToken",[{token:s,tokenExpired:r}]),F(R,{token:s,tokenExpired:r}));constc=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(lett=0;t<c.length;t++){const{prop:n,tips:s}=c[t];if(nine.result){constt=e.result[n];Object.defineProperty(e.result,n,{get:()=>(console.warn(s),t)})}}returnfunction(e){returnA(I("database","success"),e).then((()=>A(I("database","complete"),e))).then((()=>(o(e,null),F(C,{type:U,content:e}),Promise.resolve(e))))}(e)}),(e=>{/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");returni(newB({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId}))}))}}functionCt(e){e.database=function(t){if(t&&Object.keys(t).length>0)returne.init(t).database();if(this._database)returnthis._database;constn=function(e,t={}){returnwt(newe(t),{get:(e,t)=>Tt("db",t)?It({$method:t},null,e):function(){returnIt({$method:t,$param:St(Array.from(arguments))},null,e)}})}(Ot,{uniClient:e});returnthis._database=n,n}}constEt="token无效,跳转登录页面",Rt="token过期,跳转登录页面",Ut={TOKEN_INVALID_TOKEN_EXPIRED:Rt,TOKEN_INVALID_INVALID_CLIENTID:Et,TOKEN_INVALID:Et,TOKEN_INVALID_WRONG_TOKEN:Et,TOKEN_INVALID_ANONYMOUS_USER:Et},xt={"uni-id-token-expired":Rt,"uni-id-check-token-failed":Et,"uni-id-token-not-exist":Et,"uni-id-check-device-feature-failed":Et};functionLt(e,t){letn="";returnn=e?`${e}/${t}`:t,n.replace(/^\//,"")}functionDt(e=[],t=""){constn=[],s=[];returne.forEach((e=>{!0===e.needLogin?n.push(Lt(t,e.path)):!1===e.needLogin&&s.push(Lt(t,e.path))})),{needLoginPage:n,notNeedLoginPage:s}}functionNt(e){returne.split("?")[0].replace(/^\//,"")}functionqt(){returnfunction(e){lett=e&&e.$page&&e.$page.fullPath||"";returnt?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){conste=getCurrentPages();returne[e.length-1]}())}functionFt(){returnNt(qt())}functionMt(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;constn=t.list,s=Nt(e);returnn.some((e=>e.pagePath===s))}constjt=!!t.uniIdRouter;const{loginPage:$t,routerNeedLogin:Kt,resToLogin:Bt,needLoginPage:Ht,notNeedLoginPage:Wt,loginPageInTabBar:zt}=function({pages:e=[],subPackages:n=[],uniIdRouter:s={},tabBar:o={}}=t){const{loginPage:r,needLogin:i=[],resToLogin:a=!0}=s,{needLoginPage:c,notNeedLoginPage:u}=Dt(e),{needLoginPage:l,notNeedLoginPage:h}=function(e=[]){constt=[],n=[];returne.forEach((e=>{const{root:s,pages:o=[]}=e,{needLoginPage:r,notNeedLoginPage:i}=Dt(o,s);t.push(...r),n.push(...i)})),{needLoginPage:t,notNeedLoginPage:n}}(n);return{loginPage:r,routerNeedLogin:i,resToLogin:a,needLoginPage:[...c,...l],notNeedLoginPage:[...u,...h],loginPageInTabBar:Mt(r,o)}}();if(Ht.indexOf($t)>-1)thrownewError(`Login page [${$t}] should not be "needLogin", please check your pages.json`);functionJt(e){constt=Nt(function(e){constt=Ft(),n=e.charAt(0),s=e.split("?")[0];if("/"===n)returns;consto=s.replace(/^\//,"").split("/"),r=t.split("/");r.pop();for(lete=0;e<o.length;e++){constt=o[e];".."===t?r.pop():"."!==t&&r.push(t)}return""===r[0]&&r.shift(),r.join("/")}(e));return!(Wt.indexOf(t)>-1)&&(Ht.indexOf(t)>-1||Kt.some((t=>function(e,t){returnnewRegExp(t).test(e)}(e,t))))}functionVt({redirect:e}){constt=Nt(e),n=Nt($t);returnFt()!==n&&t!==n}functionYt({api:e,redirect:t}={}){if(!t||!Vt({redirect:t}))return;constn=function(e,t){return"/"!==e.charAt(0)&&(e="/"+e),t?e.indexOf("?")>-1?e+`&uniIdRedirectUrl=${encodeURIComponent(t)}`:e+`?uniIdRedirectUrl=${encodeURIComponent(t)}`:e}($t,t);zt?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo"),setTimeout((()=>{uni[e]({url:n})}))}functionXt({url:e}={}){constt={abortLoginPageJump:!1,autoToLoginPage:!1},n=function(){const{token:e,tokenExpired:t}=rt();letn;if(e){if(t<Date.now()){conste="uni-id-token-expired";n={errCode:e,errMsg:xt[e]}}}else{conste="uni-id-check-token-failed";n={errCode:e,errMsg:xt[e]}}returnn}();if(Jt(e)&&n){n.uniIdRedirectUrl=e;if(D(E).length>0)returnsetTimeout((()=>{F(E,n)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}returnt}functionGt(){!function(){conste=qt(),{abortLoginPageJump:t,autoToLoginPage:n}=Xt({url:e});t||n&&Yt({api:"redirectTo",redirect:e})}();conste=["navigateTo","redirectTo","reLaunch","switchTab"];for(lett=0;t<e.length;t++){constn=e[t];uni.addInterceptor(n,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:s}=Xt({url:e.url});returnt?e:s?(Yt({api:n,redirect:e.url}),!1):e}})}}functionQt(){this.onResponse((e=>{const{type:t,content:n}=e;lets=!1;switch(t){case"cloudobject":s=function(e){const{errCode:t}=e;returntinxt}(n);break;case"clientdb":s=function(e){const{errCode:t}=e;returntinUt}(n)}s&&function(e={}){constt=D(E);$().then((()=>{constn=qt();if(n&&Vt({redirect:n}))returnt.length>0?F(E,Object.assign({uniIdRedirectUrl:n},e)):void($t&&Yt({api:"navigateTo",redirect:n}))}))}(n)}))}functionZt(e){!function(e){e.onResponse=function(e){N(C,e)},e.offResponse=function(e){q(C,e)}}(e),function(e){e.onNeedLogin=function(e){N(E,e)},e.offNeedLogin=function(e){q(E,e)},jt&&(k("uni-cloud-status").needLoginInit||(k("uni-cloud-status").needLoginInit=!0,$().then((()=>{Gt.call(e)})),Bt&&Qt.call(e)))}(e),function(e){e.onRefreshToken=function(e){N(R,e)},e.offRefreshToken=function(e){q(R,e)}}(e)}leten;consttn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;functionsn(){conste=rt().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};letn;try{n=JSON.parse((s=t[1],decodeURIComponent(en(s).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(e){thrownewError("获取当前用户信息出错,详细错误信息为:"+e.message)}vars;returnn.tokenExpired=1e3*n.exp,deleten.exp,deleten.iat,n}en="function"!=typeofatob?function(e){if(e=String(e).replace(/[\t\n\f\r]+/g,""),!nn.test(e))thrownewError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");vart;e+="==".slice(2-(3&e.length));for(varn,s,o="",r=0;r<e.length;)t=tn.indexOf(e.charAt(r++))<<18|tn.indexOf(e.charAt(r++))<<12|(n=tn.indexOf(e.charAt(r++)))<<6|(s=tn.indexOf(e.charAt(r++))),o+=64===n?String.fromCharCode(t>>16&255):64===s?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);returno}:atob;varon=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});constn="chooseAndUploadFile:ok",s="chooseAndUploadFile:fail";functiono(e,t){returne.tempFiles.forEach(((e,n)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+n+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}functionr(e,t,{onChooseFile:s,onUploadProgress:o}){returnt.then((e=>{if(s){constt=s(e);if(void0!==t)returnPromise.resolve(t).then((t=>void0===t?e:t))}returne})).then((t=>!1===t?{errMsg:n,tempFilePaths:[],tempFiles:[]}:function(e,t,s=5,o){(t=Object.assign({},t)).errMsg=n;constr=t.tempFiles,i=r.length;leta=0;returnnewPromise((n=>{for(;a<s;)c();functionc(){consts=a++;if(s>=i)returnvoid(!r.find((e=>!e.url&&!e.errMsg))&&n(t));constu=r[s];e.uploadFile({filePath:u.path,cloudPath:u.cloudPath,fileType:u.fileType,onUploadProgress(e){e.index=s,e.tempFile=u,e.tempFilePath=u.path,o&&o(e)}}).then((e=>{u.url=e.fileID,s<i&&c()})).catch((e=>{u.errMsg=e.errMsg||e.message,s<i&&c()}))}}))}(e,t,5,o)))}t.initChooseAndUploadFile=function(e){returnfunction(t={type:"all"}){return"image"===t.type?r(e,function(e){const{count:t,sizeType:n,sourceType:r=["album","camera"],extension:i}=e;returnnewPromise(((e,a)=>{uni.chooseImage({count:t,sizeType:n,sourceType:r,extension:i,success(t){e(o(t,"image"))},fail(e){a({errMsg:e.errMsg.replace("chooseImage:fail",s)})}})}))}(t),t):"video"===t.type?r(e,function(e){const{camera:t,compressed:n,maxDuration:r,sourceType:i=["album","camera"],extension:a}=e;returnnewPromise(((e,c)=>{uni.chooseVideo({camera:t,compressed:n,maxDuration:r,sourceType:i,extension:a,success(t){const{tempFilePath:n,duration:s,size:r,height:i,width:a}=t;e(o({errMsg:"chooseVideo:ok",tempFilePaths:[n],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:n,size:r,type:t.tempFile&&t.tempFile.type||"",width:a,height:i,duration:s,fileType:"video",cloudPath:""}]},"video"))},fail(e){c({errMsg:e.errMsg.replace("chooseVideo:fail",s)})}})}))}(t),t):r(e,function(e){const{count:t,extension:n}=e;returnnewPromise(((e,r)=>{leti=uni.chooseFile;if("undefined"!=typeofwx&&"function"==typeofwx.chooseMessageFile&&(i=wx.chooseMessageFile),"function"!=typeofi)returnr({errMsg:s+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});i({type:"all",count:t,extension:n,success(t){e(o(t))},fail(e){r({errMsg:e.errMsg.replace("chooseFile:fail",s)})}})}))}(t),t)}}})),rn=n(on);constan="manual";functioncn(e){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{}}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((()=>{vare=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{if(this.loadtime===an)return;letn=!1;consts=[];for(leto=2;o<e.length;o++)e[o]!==t[o]&&(s.push(e[o]),n=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(n,s)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:n}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomGet().then((n=>{this.mixinDatacomLoading=!1;const{data:s,count:o}=n.result;this.getcount&&(this.mixinDatacomPage.count=o),this.mixinDatacomHasMore=s.length<this.pageSize;constr=e?s.length?s[0]:void0:s;this.mixinDatacomResData=r,t&&t(r)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,n&&n(e)})))},mixinDatacomGet(t={}){letn=e.database(this.spaceInfo);consts=t.action||this.action;s&&(n=n.action(s));consto=t.collection||this.collection;n=Array.isArray(o)?n.collection(...o):n.collection(o);constr=t.where||this.where;r&&Object.keys(r).length&&(n=n.where(r));consti=t.field||this.field;i&&(n=n.field(i));consta=t.foreignKey||this.foreignKey;a&&(n=n.foreignKey(a));constc=t.groupby||this.groupby;c&&(n=n.groupBy(c));constu=t.groupField||this.groupField;u&&(n=n.groupField(u));!0===(void0!==t.distinct?t.distinct:this.distinct)&&(n=n.distinct());constl=t.orderby||this.orderby;l&&(n=n.orderBy(l));consth=void0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,d=void0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,f=void0!==t.getcount?t.getcount:this.getcount,g=void0!==t.gettree?t.gettree:this.gettree,p=void0!==t.gettreepath?t.gettreepath:this.gettreepath,m={getCount:f},y={limitLevel:void0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void0!==t.startwith?t.startwith:this.startwith};returng&&(m.getTree=y),p&&(m.getTreePath=y),n=n.skip(d*(h-1)).limit(d).get(m),n}}}}functionun(e){returnfunction(t,n={}){n=function(e,t={}){returne.customUI=t.customUI||e.customUI,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeoft.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},n);const{customUI:s,loadingOptions:o,errorOptions:r}=n,i=!s;returnnewProxy({},{get:(s,c)=>function({fn:e,interceptorName:t,getCallbackArgs:n}={}){returnasyncfunction(...s){consto=n?n({params:s}):{};letr,i;try{returnawaitA(I(t,"invoke"),{...o}),r=awaite(...s),awaitA(I(t,"success"),{...o,result:r}),r}catch(e){throwi=e,awaitA(I(t,"fail"),{...o,error:i}),i}finally{awaitA(I(t,"complete"),i?{...o,error:i}:{...o,result:r})}}}({fn:asyncfunctions(...u){letl;i&&uni.showLoading({title:o.title,mask:o.mask});consth={name:t,type:a,data:{method:c,params:u}};"object"==typeofn.secretMethods&&function(e,t){constn=t.data.method,s=e.secretMethods[n];s&&(t.secret=s)}(n,h);try{l=awaite.callFunction(h)}catch(e){l={result:e}}const{errCode:d,errMsg:f,newToken:g}=l.result||{};if(i&&uni.hideLoading(),g&&g.token&&g.tokenExpired&&(it(g),F(R,{...g})),d){if(i)if("toast"===r.type)uni.showToast({title:f,icon:"none"});else{if("modal"!==r.type)thrownewError(`Invalid errorOptions.type: ${r.type}`);{const{confirm:e}=awaitasyncfunction({title:e,content:t,showCancel:n,cancelText:s,confirmText:o}={}){returnnewPromise(((r,i)=>{uni.showModal({title:e,content:t,showCancel:n,cancelText:s,confirmText:o,success(e){r(e)},fail(){r({confirm:!1,cancel:!0})}})}))}({title:"提示",content:f,showCancel:r.retry,cancelText:"取消",confirmText:r.retry?"重试":"确定"});if(r.retry&&e)returns(...u)}}conste=newB({code:d,message:f,requestId:l.requestId});throwe.detail=l.result,F(C,{type:L,content:e}),e}returnF(C,{type:L,content:l.result}),l.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:t,methodName:c,params:e}}})})}}asyncfunctionln(e,t){constn=`http://${e}:${t}/system/ping`;try{conste=await(s={url:n,timeout:500},newPromise(((e,t)=>{V.request({...s,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(e){return!1}vars}functionhn(e){if(e.initUniCloudStatus&&"rejected"!==e.initUniCloudStatus)return;lett=Promise.resolve();varn;n=1,t=newPromise(((e,t)=>{setTimeout((()=>{e()}),n)})),e.isReady=!1,e.isDefault=!1;consts=e.auth();e.initUniCloudStatus="pending",e.initUniCloud=t.then((()=>s.getLoginState())).then((e=>e?Promise.resolve():s.signInAnonymously())).then((()=>{if(!d)returnPromise.resolve();if("app"===g){const{osName:e,osVersion:t}=uni.getSystemInfoSync();"ios"===e&&function(e){if(!e||"string"!=typeofe)return0;constt=e.match(/^(\d+)./);returnt&&t[1]?parseInt(t[1]):0}(t)>=14&&console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)")}if(d&&e.__dev__.debugInfo){const{address:t,servePort:n}=e.__dev__.debugInfo;returnasyncfunction(e,t){letn;for(lets=0;s<e.length;s++){consto=e[s];if(awaitln(o,t)){n=o;break}}return{address:n,port:t}}(t,n)}})).then((({address:t,port:n}={})=>{if(!d)returnPromise.resolve();consts=console["app"===g?"error":"warn"];if(t)e.__dev__.localAddress=t,e.__dev__.localPort=n;elseif(e.__dev__.debugInfo){lett="";"remote"===e.__dev__.debugInfo.initialLaunchType?(e.__dev__.debugInfo.forceRemote=!0,t="当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs"):t="无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs","web"===g&&(t+="\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"),0===g.indexOf("mp-")&&(t+="\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"),s(t)}})).then((()=>{at(),e.isReady=!0,e.initUniCloudStatus="fulfilled"})).catch((t=>{console.error(t),e.initUniCloudStatus="rejected"}))}constdn={tcb:ot,tencent:ot,aliyun:Q,private:ut};letfn=newclass{init(e){lett={};constn=dn[e.provider];if(!n)thrownewError("未提供正确的provider参数");t=n.init(e),t.__dev__={},t.__dev__.debugLog=d&&("web"===g&&navigator.userAgent.indexOf("HBuilderX")>0||"app"===g);consts=p;d&&s&&!s.code&&(t.__dev__.debugInfo=s),hn(t),t.reInit=function(){hn(this)},yt(t),function(e){constt=e.uploadFile;e.uploadFile=function(e){returnt.call(this,e)}}(t),Ct(t),function(e){e.getCurrentUserInfo=sn,e.chooseAndUploadFile=rn.initChooseAndUploadFile(e),Object.assign(e,{getmixinDatacom(){returncn(e)}}),e.importObject=un(e)}(t);return["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;constn=t[e];t[e]=function(){returnt.reInit(),n.apply(t,Array.from(arguments))},t[e]=K(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{conste=m;lett={};if(e&&1===e.length)t=e[0],fn=fn.init(t),fn.isDefault=!0;else{constt=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];letn;n=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":y?"应用未关联服务空间,请在uniCloud目录右键关联服务空间":"uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间",t.forEach((e=>{fn[e]=function(){returnconsole.error(n),Promise.reject(newB({code:"SYS_ERR",message:n}))}}))}Object.assign(fn,{getmixinDatacom(){returncn(fn)}}),Zt(fn),fn.addInterceptor=S,fn.removeInterceptor=P,fn.interceptObject=b,d&&"web"===g&&(window.uniCloud=fn)})();vargn=fn;export{gnasdefault};
import{initVueI18nase}from"@dcloudio/uni-i18n";importtfrom"@/pages.json";"undefined"!=typeofglobalThis?globalThis:"undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself&&self;functionn(e){returne&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}functions(e,t,n){returne(n={path:t,exports:{},require:function(e,t){returnfunction(){thrownewError("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}varr=s((function(e,t){varn;e.exports=(n=n||function(e,t){varn=Object.create||function(){functione(){}returnfunction(t){varn;returne.prototype=t,n=newe,e.prototype=null,n}}(),s={},r=s.lib={},i=r.Base={extend:function(e){vart=n(this);returne&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){vare=this.extend();returne.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(vartine)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){returnthis.init.prototype.extend(this)}},o=r.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){vart=this.words,n=e.words,s=this.sigBytes,r=e.sigBytes;if(this.clamp(),s%4)for(vari=0;i<r;i++){varo=n[i>>>2]>>>24-i%4*8&255;t[s+i>>>2]|=o<<24-(s+i)%4*8}elsefor(i=0;i<r;i+=4)t[s+i>>>2]=n[i>>>2];returnthis.sigBytes+=r,this},clamp:function(){vart=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){vare=i.clone.call(this);returne.words=this.words.slice(0),e},random:function(t){for(varn,s=[],r=function(t){t=t;varn=987654321,s=4294967295;returnfunction(){varr=((n=36969*(65535&n)+(n>>16)&s)<<16)+(t=18e3*(65535&t)+(t>>16)&s)&s;returnr/=4294967296,(r+=.5)*(e.random()>.5?1:-1)}},i=0;i<t;i+=4){vara=r(4294967296*(n||e.random()));n=987654071*a(),s.push(4294967296*a()|0)}returnnewo.init(s,t)}}),a=s.enc={},c=a.Hex={stringify:function(e){for(vart=e.words,n=e.sigBytes,s=[],r=0;r<n;r++){vari=t[r>>>2]>>>24-r%4*8&255;s.push((i>>>4).toString(16)),s.push((15&i).toString(16))}returns.join("")},parse:function(e){for(vart=e.length,n=[],s=0;s<t;s+=2)n[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;returnnewo.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(vart=e.words,n=e.sigBytes,s=[],r=0;r<n;r++){vari=t[r>>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(i))}returns.join("")},parse:function(e){for(vart=e.length,n=[],s=0;s<t;s++)n[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;returnnewo.init(n,t)}},h=a.Utf8={stringify:function(e){try{returndecodeURIComponent(escape(u.stringify(e)))}catch(e){thrownewError("Malformed UTF-8 data")}},parse:function(e){returnu.parse(unescape(encodeURIComponent(e)))}},l=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=newo.init,this._nDataBytes=0},_append:function(e){"string"==typeofe&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){varn=this._data,s=n.words,r=n.sigBytes,i=this.blockSize,a=r/(4*i),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,u=e.min(4*c,r);if(c){for(varh=0;h<c;h+=i)this._doProcessBlock(s,h);varl=s.splice(0,c);n.sigBytes-=u}returnnewo.init(l,u)},clone:function(){vare=i.clone.call(this);returne._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=l.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){returnthis._append(e),this._process(),this},finalize:function(e){returne&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){returnfunction(t,n){returnnewe.init(n).finalize(t)}},_createHmacHelper:function(e){returnfunction(t,n){returnnewd.HMAC.init(e,n).finalize(t)}}});vard=s.algo={};returns}(Math),n)})),i=r,o=(s((function(e,t){varn;e.exports=(n=i,function(e){vart=n,s=t.lib,r=s.WordArray,i=s.Hasher,o=t.algo,a=[];!function(){for(vart=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();varc=o.MD5=i.extend({_doReset:function(){this._hash=newr.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(varn=0;n<16;n++){vars=t+n,r=e[s];e[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}vari=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],m=e[t+5],y=e[t+6],_=e[t+7],w=e[t+8],v=e[t+9],S=e[t+10],k=e[t+11],T=e[t+12],I=e[t+13],b=e[t+14],A=e[t+15],P=i[0],C=i[1],E=i[2],O=i[3];P=u(P,C,E,O,o,7,a[0]),O=u(O,P,C,E,c,12,a[1]),E=u(E,O,P,C,f,17,a[2]),C=u(C,E,O,P,p,22,a[3]),P=u(P,C,E,O,g,7,a[4]),O=u(O,P,C,E,m,12,a[5]),E=u(E,O,P,C,y,17,a[6]),C=u(C,E,O,P,_,22,a[7]),P=u(P,C,E,O,w,7,a[8]),O=u(O,P,C,E,v,12,a[9]),E=u(E,O,P,C,S,17,a[10]),C=u(C,E,O,P,k,22,a[11]),P=u(P,C,E,O,T,7,a[12]),O=u(O,P,C,E,I,12,a[13]),E=u(E,O,P,C,b,17,a[14]),P=h(P,C=u(C,E,O,P,A,22,a[15]),E,O,c,5,a[16]),O=h(O,P,C,E,y,9,a[17]),E=h(E,O,P,C,k,14,a[18]),C=h(C,E,O,P,o,20,a[19]),P=h(P,C,E,O,m,5,a[20]),O=h(O,P,C,E,S,9,a[21]),E=h(E,O,P,C,A,14,a[22]),C=h(C,E,O,P,g,20,a[23]),P=h(P,C,E,O,v,5,a[24]),O=h(O,P,C,E,b,9,a[25]),E=h(E,O,P,C,p,14,a[26]),C=h(C,E,O,P,w,20,a[27]),P=h(P,C,E,O,I,5,a[28]),O=h(O,P,C,E,f,9,a[29]),E=h(E,O,P,C,_,14,a[30]),P=l(P,C=h(C,E,O,P,T,20,a[31]),E,O,m,4,a[32]),O=l(O,P,C,E,w,11,a[33]),E=l(E,O,P,C,k,16,a[34]),C=l(C,E,O,P,b,23,a[35]),P=l(P,C,E,O,c,4,a[36]),O=l(O,P,C,E,g,11,a[37]),E=l(E,O,P,C,_,16,a[38]),C=l(C,E,O,P,S,23,a[39]),P=l(P,C,E,O,I,4,a[40]),O=l(O,P,C,E,o,11,a[41]),E=l(E,O,P,C,p,16,a[42]),C=l(C,E,O,P,y,23,a[43]),P=l(P,C,E,O,v,4,a[44]),O=l(O,P,C,E,T,11,a[45]),E=l(E,O,P,C,A,16,a[46]),P=d(P,C=l(C,E,O,P,f,23,a[47]),E,O,o,6,a[48]),O=d(O,P,C,E,_,10,a[49]),E=d(E,O,P,C,b,15,a[50]),C=d(C,E,O,P,m,21,a[51]),P=d(P,C,E,O,T,6,a[52]),O=d(O,P,C,E,p,10,a[53]),E=d(E,O,P,C,S,15,a[54]),C=d(C,E,O,P,c,21,a[55]),P=d(P,C,E,O,w,6,a[56]),O=d(O,P,C,E,A,10,a[57]),E=d(E,O,P,C,y,15,a[58]),C=d(C,E,O,P,I,21,a[59]),P=d(P,C,E,O,g,6,a[60]),O=d(O,P,C,E,k,10,a[61]),E=d(E,O,P,C,f,15,a[62]),C=d(C,E,O,P,v,21,a[63]),i[0]=i[0]+P|0,i[1]=i[1]+C|0,i[2]=i[2]+E|0,i[3]=i[3]+O|0},_doFinalize:function(){vart=this._data,n=t.words,s=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32;vari=e.floor(s/4294967296),o=s;n[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(n.length+1),this._process();for(vara=this._hash,c=a.words,u=0;u<4;u++){varh=c[u];c[u]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}returna},clone:function(){vare=i.clone.call(this);returne._hash=this._hash.clone(),e}});functionu(e,t,n,s,r,i,o){vara=e+(t&n|~t&s)+r+o;return(a<<i|a>>>32-i)+t}functionh(e,t,n,s,r,i,o){vara=e+(t&s|n&~s)+r+o;return(a<<i|a>>>32-i)+t}functionl(e,t,n,s,r,i,o){vara=e+(t^n^s)+r+o;return(a<<i|a>>>32-i)+t}functiond(e,t,n,s,r,i,o){vara=e+(n^(t|~s))+r+o;return(a<<i|a>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),n.MD5)})),s((function(e,t){varn;e.exports=(n=i,voidfunction(){vare=n,t=e.lib.Base,s=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=newe.init,"string"==typeoft&&(t=s.parse(t));varn=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(vari=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,c=o.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=o.sigBytes=r,this.reset()},reset:function(){vare=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){returnthis._hasher.update(e),this},finalize:function(e){vart=this._hasher,n=t.finalize(e);returnt.reset(),t.finalize(this._oKey.clone().concat(n))}})}())})),s((function(e,t){e.exports=i.HmacMD5})));consta="FUNCTION",c="OBJECT",u="CLIENT_DB";functionh(e){returnObject.prototype.toString.call(e).slice(8,-1).toLowerCase()}functionl(e){return"object"===h(e)}functiond(e){returne&&"string"==typeofe?JSON.parse(e):e}constf="development"===process.env.NODE_ENV,p=process.env.VUE_APP_PLATFORM,g="true"===process.env.UNI_SECURE_NETWORK||!0===process.env.UNI_SECURE_NETWORK;letm;m="h5"===p?"web":"app-plus"===p?"app":p;consty=d(process.env.UNICLOUD_DEBUG),_=d(process.env.UNI_CLOUD_PROVIDER)||[],w=process.env.RUN_BY_HBUILDERX;letv="";try{{conste=require("uni-stat-config").default||require("uni-stat-config");v=e.appid}}catch(e){}letS={};functionk(e,t={}){varn,s;returnn=S,s=e,Object.prototype.hasOwnProperty.call(n,s)||(S[e]=t),S[e]}"app"===m&&(S=uni._globalUniCloudObj?uni._globalUniCloudObj:uni._globalUniCloudObj={});constT=["invoke","success","fail","complete"],I=k("_globalUniCloudInterceptor");functionb(e,t){I[e]||(I[e]={}),l(t)&&Object.keys(t).forEach((n=>{T.indexOf(n)>-1&&function(e,t,n){lets=I[e][t];s||(s=I[e][t]=[]),-1===s.indexOf(n)&&"function"==typeofn&&s.push(n)}(e,n,t[n])}))}functionA(e,t){I[e]||(I[e]={}),l(t)?Object.keys(t).forEach((n=>{T.indexOf(n)>-1&&function(e,t,n){consts=I[e][t];if(!s)return;constr=s.indexOf(n);r>-1&&s.splice(r,1)}(e,n,t[n])})):deleteI[e]}functionP(e,t){returne&&0!==e.length?e.reduce(((e,n)=>e.then((()=>n(t)))),Promise.resolve()):Promise.resolve()}functionC(e,t){returnI[e]&&I[e][t]||[]}functionE(e){b("callObject",e)}constO=k("_globalUniCloudListener"),R="response",U="needLogin",x="refreshToken",L="clientdb",D="cloudfunction",N="cloudobject";functionq(e){returnO[e]||(O[e]=[]),O[e]}functionF(e,t){constn=q(e);n.includes(t)||n.push(t)}functionK(e,t){constn=q(e),s=n.indexOf(t);-1!==s&&n.splice(s,1)}functionM(e,t){constn=q(e);for(lete=0;e<n.length;e++){(0,n[e])(t)}}letj,$,B=!1;functionz(){returnj||(j=newPromise((e=>{B&&e(),functiont(){if("function"==typeofgetCurrentPages){constt=getCurrentPages();t&&t[0]&&(B=!0,e())}B||setTimeout((()=>{t()}),30)}()})),j)}functionW(e,t){returnt?function(n){lets=!1;if("callFunction"===t){conste=n&&n.type||a;s=e!==a}constr="callFunction"===t&&!s;leti;i=this.isReady?Promise.resolve():this.initUniCloud,n=n||{};consto=i.then((()=>s?Promise.resolve():P(C(t,"invoke"),n))).then((()=>e.call(this,n))).then((e=>s?Promise.resolve(e):P(C(t,"success"),e).then((()=>P(C(t,"complete"),e))).then((()=>(r&&M(R,{type:D,content:e}),Promise.resolve(e))))),(e=>s?Promise.reject(e):P(C(t,"fail"),e).then((()=>P(C(t,"complete"),e))).then((()=>(M(R,{type:D,content:e}),Promise.reject(e))))));if(!(n.success||n.fail||n.complete))returno;o.then((e=>{n.success&&n.success(e),n.complete&&n.complete(e),r&&M(R,{type:D,content:e})}),(e=>{n.fail&&n.fail(e),n.complete&&n.complete(e),r&&M(R,{type:D,content:e})}))}:function(t){if(!((t=t||{}).success||t.fail||t.complete))returne.call(this,t);e.call(this,t).then((e=>{t.success&&t.success(e),t.complete&&t.complete(e)}),(e=>{t.fail&&t.fail(e),t.complete&&t.complete(e)}))}}classHextendsError{constructor(e){constt=e.code||"SYSTEM_ERROR",n=e.message||"unknown system error";super(n),this.errMsg=n,this.errCode=this.code=t,this.requestId=e.requestId}}functionJ(){lete,t;try{if(uni.getLaunchOptionsSync){if(uni.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:n,channel:s}=uni.getLaunchOptionsSync();e=s,t=n}}catch(e){}return{channel:e,scene:t}}functionV(){conste=uni.getLocale&&uni.getLocale()||"en";if($)return{...$,locale:e,LOCALE:e};constt=uni.getSystemInfoSync(),{deviceId:n,osName:s,uniPlatform:r,appId:i}=t,o=["pixelRatio","brand","model","system","language","version","platform","host","SDKVersion","swanNativeVersion","app","AppPlatform","fontSizeSetting"];for(lete=0;e<o.length;e++){deletet[o[e]]}return$={PLATFORM:r,OS:s,APPID:i,DEVICEID:n,...J(),...t},{...$,locale:e,LOCALE:e}}varY={sign:function(e,t){letn="";returnObject.keys(e).sort().forEach((function(t){e[t]&&(n=n+"&"+t+"="+e[t])})),n=n.slice(1),o(n,t).toString()},wrappedRequest:function(e,t){returnnewPromise(((n,s)=>{t(Object.assign(e,{complete(e){e||(e={}),f&&"web"===m&&e.errMsg&&0===e.errMsg.indexOf("request:fail")&&console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");constt=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400)returns(newH({code:"SYS_ERR",message:e.errMsg||"request:fail",requestId:t}));constr=e.data;if(r.error)returns(newH({code:r.error.code,message:r.error.message,requestId:t}));r.result=r.data,r.requestId=t,deleter.data,n(r)}}))}))}};varQ={request:e=>uni.request(e),uploadFile:e=>uni.uploadFile(e),setStorageSync:(e,t)=>uni.setStorageSync(e,t),getStorageSync:e=>uni.getStorageSync(e),removeStorageSync:e=>uni.removeStorageSync(e),clearStorageSync:()=>uni.clearStorageSync()},X={"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"};const{t:G}=e({"zh-Hans":{"uniCloud.init.paramRequired":"缺少参数:{param}","uniCloud.uploadFile.fileError":"filePath应为File对象"},"zh-Hant":{"uniCloud.init.paramRequired":"缺少参数:{param}","uniCloud.uploadFile.fileError":"filePath应为File对象"},en:X,fr:{"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"},es:{"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"},ja:X},"zh-Hans");varZ=class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))thrownewError(G("uniCloud.init.paramRequired",{param:t}))})),this.config=Object.assign({},{endpoint:"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=Q,this._getAccessTokenPromise=null,this._getAccessTokenPromiseStatus=null}gethasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){returnY.wrappedRequest(e,this.adapter.request)}requestAuth(e){returnthis.requestWrapped(e)}request(e,t){returnPromise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>newPromise(((e,n)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?n(t):e()})).then((()=>this.getAccessToken())).then((()=>{constt=this.rebuildRequest(e);returnthis.request(t,!0)})))):this.getAccessToken().then((()=>{constt=this.rebuildRequest(e);returnthis.request(t,!0)}))))}rebuildRequest(e){constt=Object.assign({},e);returnt.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=Y.sign(t.data,this.config.clientSecret),t}setupRequest(e,t){constn=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),s={"Content-Type":"application/json"};return"auth"!==t&&(n.token=this.accessToken,s["x-basement-token"]=this.accessToken),s["x-serverless-sign"]=Y.sign(n,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:n,dataType:"json",header:s}}getAccessToken(){if("pending"===this._getAccessTokenPromiseStatus)returnthis._getAccessTokenPromise;this._getAccessTokenPromiseStatus="pending";returnthis._getAccessTokenPromise=this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>newPromise(((t,n)=>{e.result&&e.result.accessToken?(this.setAccessToken(e.result.accessToken),this._getAccessTokenPromiseStatus="fulfilled",t(this.accessToken)):(this._getAccessTokenPromiseStatus="rejected",n(newH({code:"AUTH_FAILED",message:"获取accessToken失败"})))}))),(e=>(this._getAccessTokenPromiseStatus="rejected",Promise.reject(e)))),this._getAccessTokenPromise}authorize(){this.getAccessToken()}callFunction(e){constt={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};returnthis.request(this.setupRequest(t))}getOSSUploadOptionsFromPath(e){constt={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};returnthis.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:n,filePath:s,fileType:r,onUploadProgress:i}){returnnewPromise(((o,a)=>{constc=this.adapter.uploadFile({url:e,formData:t,name:n,filePath:s,fileType:r,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?o(e):a(newH({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(newH({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeofi&&c&&"function"==typeofc.onProgressUpdate&&c.onProgressUpdate((e=>{i({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){constt={method:"serverless.file.resource.report",params:JSON.stringify(e)};returnthis.request(this.setupRequest(t))}uploadFile({filePath:e,cloudPath:t,fileType:n="image",onUploadProgress:s,config:r}){if("string"!==h(t))thrownewH({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))thrownewH({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});if(/:\/\//.test(t))thrownewH({code:"INVALID_PARAM",message:"cloudPath不合法"});consti=r&&r.envType||this.config.envType;leto,a;returnthis.getOSSUploadOptionsFromPath({env:i,filename:t}).then((t=>{constr=t.result;o=r.id,a="https://"+r.cdnDomain+"/"+r.ossPath;consti={url:"https://"+r.host,formData:{"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:r.accessKeyId,Signature:r.signature,host:r.host,id:o,key:r.ossPath,policy:r.policy,success_action_status:200},fileName:"file",name:"file",filePath:e,fileType:n};returnthis.uploadFileToOSS(Object.assign({},i,{onUploadProgress:s}))})).then((()=>this.reportOSSUpload({id:o}))).then((t=>newPromise(((n,s)=>{t.success?n({success:!0,filePath:e,fileID:a}):s(newH({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){constt={method:"serverless.file.resource.delete",params:JSON.stringify({id:e[0]})};returnthis.request(this.setupRequest(t))}getTempFileURL({fileList:e}={}){returnnewPromise(((t,n)=>{Array.isArray(e)&&0!==e.length||n(newH({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}};varee={init(e){constt=newZ(e),n={signInAnonymously:function(){returnt.authorize()},getLoginState:function(){returnPromise.resolve(!1)}};returnt.auth=function(){returnn},t.customAuth=t.auth,t}};constte="undefined"!=typeoflocation&&"http:"===location.protocol?"http:":"https:";varne;!function(e){e.local="local",e.none="none",e.session="session"}(ne||(ne={}));varse=function(){};constre=()=>{lete;if(!Promise){e=()=>{},e.promise={};constt=()=>{thrownewH({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};returnObject.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}constt=newPromise(((t,n)=>{e=(e,s)=>e?n(e):t(s)}));returne.promise=t,e};functionie(e){returnvoid0===e}functionoe(e){return"[object Null]"===Object.prototype.toString.call(e)}varae;functionce(e){constt=(n=e,"[object Array]"===Object.prototype.toString.call(n)?e:[e]);varn;for(consteoft){const{isMatch:t,genAdapter:n,runtime:s}=e;if(t())return{adapter:n(),runtime:s}}}!function(e){e.WEB="web",e.WX_MP="wx_mp"}(ae||(ae={}));constue={adapter:null,runtime:void0},he=["anonymousUuidKey"];classleextendsse{constructor(){super(),ue.adapter.root.tcbObject||(ue.adapter.root.tcbObject={})}setItem(e,t){ue.adapter.root.tcbObject[e]=t}getItem(e){returnue.adapter.root.tcbObject[e]}removeItem(e){deleteue.adapter.root.tcbObject[e]}clear(){deleteue.adapter.root.tcbObject}}functionde(e,t){switch(e){case"local":returnt.localStorage||newle;case"none":returnnewle;default:returnt.sessionStorage||newle}}classfe{constructor(e){if(!this._storage){this._persistence=ue.adapter.primaryStorage||e.persistence,this._storage=de(this._persistence,ue.adapter);constt=`access_token_${e.env}`,n=`access_token_expire_${e.env}`,s=`refresh_token_${e.env}`,r=`anonymous_uuid_${e.env}`,i=`login_type_${e.env}`,o=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s,anonymousUuidKey:r,loginTypeKey:i,userInfoKey:o}}}updatePersistence(e){if(e===this._persistence)return;constt="local"===this._persistence;this._persistence=e;constn=de(e,ue.adapter);for(consteinthis.keys){consts=this.keys[e];if(t&&he.includes(e))continue;constr=this._storage.getItem(s);ie(r)||oe(r)||(n.setItem(s,r),this._storage.removeItem(s))}this._storage=n}setStore(e,t,n){if(!this._storage)return;consts={version:n||"localCachev1",content:t},r=JSON.stringify(s);try{this._storage.setItem(e,r)}catch(e){throwe}}getStore(e,t){try{if(!this._storage)return}catch(e){return""}t=t||"localCachev1";constn=this._storage.getItem(e);if(!n)return"";if(n.indexOf(t)>=0){returnJSON.parse(n).content}return""}removeStore(e){this._storage.removeItem(e)}}constpe={},ge={};functionme(e){returnpe[e]}classye{constructor(e,t){this.data=t||null,this.name=e}}class_eextendsye{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}constwe=newclass{constructor(){this._listeners={}}on(e,t){returnfunction(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this._listeners),this}off(e,t){returnfunction(e,t,n){if(n&&n[e]){consts=n[e].indexOf(t);-1!==s&&n[e].splice(s,1)}}(e,t,this._listeners),this}fire(e,t){if(einstanceof_e)returnconsole.error(e.error),this;constn="string"==typeofe?newye(e,t||{}):e;consts=n.name;if(this._listens(s)){n.target=this;conste=this._listeners[s]?[...this._listeners[s]]:[];for(consttofe)t.call(this,n)}returnthis}_listens(e){returnthis._listeners[e]&&this._listeners[e].length>0}};functionve(e,t){we.on(e,t)}functionSe(e,t={}){we.fire(e,t)}functionke(e,t){we.off(e,t)}constTe="loginStateChanged",Ie="loginStateExpire",be="loginTypeChanged",Ae="anonymousConverted",Pe="refreshAccessToken";varCe;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}(Ce||(Ce={}));constEe=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Oe={"X-SDK-Version":"1.3.5"};functionRe(e,t,n){consts=e[t];e[t]=function(t){constr={},i={};n.forEach((n=>{const{data:s,headers:o}=n.call(e,t);Object.assign(r,s),Object.assign(i,o)}));consto=t.data;returno&&(()=>{vare;if(e=o,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...o,...r};elsefor(consteinr)o.append(e,r[e])})(),t.headers={...t.headers||{},...i},s.call(e,t)}}functionUe(){conste=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Oe,"x-seqid":e}}}classxe{constructor(e={}){vart;this.config=e,this._reqClass=newue.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=me(this.config.env),this._localCache=(t=this.config.env,ge[t]),Re(this._reqClass,"post",[Ue]),Re(this._reqClass,"upload",[Ue]),Re(this._reqClass,"download",[Ue])}asyncpost(e){returnawaitthis._reqClass.post(e)}asyncupload(e){returnawaitthis._reqClass.upload(e)}asyncdownload(e){returnawaitthis._reqClass.download(e)}asyncrefreshAccessToken(){lete,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=awaitthis._refreshAccessTokenPromise}catch(e){t=e}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throwt;returne}async_refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n,loginTypeKey:s,anonymousUuidKey:r}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);leti=this._cache.getStore(n);if(!i)thrownewH({message:"未登录CloudBase"});consto={refresh_token:i},a=awaitthis.request("auth.fetchAccessTokenWithRefreshToken",o);if(a.data.code){const{code:e}=a.data;if("SIGN_PARAM_INVALID"===e||"REFRESH_TOKEN_EXPIRED"===e||"INVALID_REFRESH_TOKEN"===e){if(this._cache.getStore(s)===Ce.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){conste=this._cache.getStore(r),t=this._cache.getStore(n),s=awaitthis.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});returnthis.setRefreshToken(s.refresh_token),this._refreshAccessToken()}Se(Ie),this._cache.removeStore(n)}thrownewH({code:a.data.code,message:`刷新access token失败:${a.data.code}`})}if(a.data.access_token)returnSe(Pe),this._cache.setStore(e,a.data.access_token),this._cache.setStore(t,a.data.access_token_expire+Date.now()),{accessToken:a.data.access_token,accessTokenExpire:a.data.access_token_expire};a.data.refresh_token&&(this._cache.removeStore(n),this._cache.setStore(n,a.data.refresh_token),this._refreshAccessToken())}asyncgetAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n}=this._cache.keys;if(!this._cache.getStore(n))thrownewH({message:"refresh token不存在,登录状态异常"});lets=this._cache.getStore(e),r=this._cache.getStore(t),i=!0;returnthis._shouldRefreshAccessTokenHook&&!awaitthis._shouldRefreshAccessTokenHook(s,r)&&(i=!1),(!s||!r||r<Date.now())&&i?this.refreshAccessToken():{accessToken:s,accessTokenExpire:r}}asyncrequest(e,t,n){consts=`x-tcb-trace_${this.config.env}`;letr="application/x-www-form-urlencoded";consti={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===Ee.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(i.access_token=(awaitthis.getAccessToken()).accessToken)}leto;if("storage.uploadFile"===e){o=newFormData;for(leteino)o.hasOwnProperty(e)&&void0!==o[e]&&o.append(e,i[e]);r="multipart/form-data"}else{r="application/json",o={};for(leteini)void0!==i[e]&&(o[e]=i[e])}leta={headers:{"content-type":r}};n&&n.onUploadProgress&&(a.onUploadProgress=n.onUploadProgress);constc=this._localCache.getStore(s);c&&(a.headers["X-TCB-Trace"]=c);const{parse:u,inQuery:h,search:l}=t;letd={env:this.config.env};u&&(d.parse=!0),h&&(d={...h,...d});letf=function(e,t,n={}){consts=/\?/.test(t);letr="";for(leteinn)""===r?!s&&(t+="?"):r+="&",r+=`${e}=${encodeURIComponent(n[e])}`;return/^http(s)?\:\/\//.test(t+=r)?t:`${e}${t}`}(te,"//tcb-api.tencentcloudapi.com/web",d);l&&(f+=l);constp=awaitthis.post({url:f,data:o,...a}),g=p.header&&p.header["x-tcb-trace"];if(g&&this._localCache.setStore(s,g),200!==Number(p.status)&&200!==Number(p.statusCode)||!p.data)thrownewH({code:"NETWORK_ERROR",message:"network request error"});returnp}asyncsend(e,t={}){constn=awaitthis.request(e,t,{onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===n.data.code&&-1===Ee.indexOf(e)){awaitthis.refreshAccessToken();constn=awaitthis.request(e,t,{onUploadProgress:t.onUploadProgress});if(n.data.code)thrownewH({code:n.data.code,message:n.data.message});returnn.data}if(n.data.code)thrownewH({code:n.data.code,message:n.data.message});returnn.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}}constLe={};functionDe(e){returnLe[e]}classNe{constructor(e){this.config=e,this._cache=me(e.env),this._request=De(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}setAccessToken(e,t){const{accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys;this._cache.setStore(n,e),this._cache.setStore(s,t)}asyncrefreshUserInfo(){const{data:e}=awaitthis._request.send("auth.getUserInfo",{});returnthis.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}classqe{constructor(e){if(!e)thrownewH({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=me(this._envId),this._request=De(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeofe)thrownewH({code:"PARAM_ERROR",message:"ticket must be string"});returnthis._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){returnthis._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){returnthis._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if("string"!=typeofe)thrownewH({code:"PARAM_ERROR",message:"username must be a string"});returnthis._request.send("auth.updateUsername",{username:e})}asyncgetLinkedUidList(){const{data:e}=awaitthis._request.send("auth.getLinkedUidList",{});lett=!1;const{users:n}=e;returnn.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:n,hasPrimaryUid:t}}setPrimaryUid(e){returnthis._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){returnthis._request.send("auth.unlink",{platform:e})}asyncupdate(e){const{nickName:t,gender:n,avatarUrl:s,province:r,country:i,city:o}=e,{data:a}=awaitthis._request.send("auth.updateUserInfo",{nickName:t,gender:n,avatarUrl:s,province:r,country:i,city:o});this.setLocalUserInfo(a)}asyncrefresh(){const{data:e}=awaitthis._request.send("auth.getUserInfo",{});returnthis.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach((e=>{this[e]=t[e]})),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}classFe{constructor(e){if(!e)thrownewH({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=me(e);const{refreshTokenKey:t,accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys,r=this._cache.getStore(t),i=this._cache.getStore(n),o=this._cache.getStore(s);this.credential={refreshToken:r,accessToken:i,accessTokenExpire:o},this.user=newqe(e)}getisAnonymousAuth(){returnthis.loginType===Ce.ANONYMOUS}getisCustomAuth(){returnthis.loginType===Ce.CUSTOM}getisWeixinAuth(){returnthis.loginType===Ce.WECHAT||this.loginType===Ce.WECHAT_OPEN||this.loginType===Ce.WECHAT_PUBLIC}getloginType(){returnthis._cache.getStore(this._cache.keys.loginTypeKey)}}classKeextendsNe{asyncsignIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,n=this._cache.getStore(e)||void0,s=this._cache.getStore(t)||void0,r=awaitthis._request.send("auth.signInAnonymously",{anonymous_uuid:n,refresh_token:s});if(r.uuid&&r.refresh_token){this._setAnonymousUUID(r.uuid),this.setRefreshToken(r.refresh_token),awaitthis._request.refreshAccessToken(),Se(Te),Se(be,{env:this.config.env,loginType:Ce.ANONYMOUS,persistence:"local"});conste=newFe(this.config.env);returnawaite.user.refresh(),e}thrownewH({message:"匿名登录失败"})}asynclinkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:n}=this._cache.keys,s=this._cache.getStore(t),r=this._cache.getStore(n),i=awaitthis._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:s,refresh_token:r,ticket:e});if(i.refresh_token)returnthis._clearAnonymousUUID(),this.setRefreshToken(i.refresh_token),awaitthis._request.refreshAccessToken(),Se(Ae,{env:this.config.env}),Se(be,{loginType:Ce.CUSTOM,persistence:"local"}),{credential:{refreshToken:i.refresh_token}};thrownewH({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(n,Ce.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}classMeextendsNe{asyncsignIn(e){if("string"!=typeofe)thrownewH({param:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,n=awaitthis._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(n.refresh_token)returnthis.setRefreshToken(n.refresh_token),awaitthis._request.refreshAccessToken(),Se(Te),Se(be,{env:this.config.env,loginType:Ce.CUSTOM,persistence:this.config.persistence}),awaitthis.refreshUserInfo(),newFe(this.config.env);thrownewH({message:"自定义登录失败"})}}classjeextendsNe{asyncsignIn(e,t){if("string"!=typeofe)thrownewH({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:n}=this._cache.keys,s=awaitthis._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:r,access_token:i,access_token_expire:o}=s;if(r)returnthis.setRefreshToken(r),i&&o?this.setAccessToken(i,o):awaitthis._request.refreshAccessToken(),awaitthis.refreshUserInfo(),Se(Te),Se(be,{env:this.config.env,loginType:Ce.EMAIL,persistence:this.config.persistence}),newFe(this.config.env);throws.code?newH({code:s.code,message:`邮箱登录失败: ${s.message}`}):newH({message:"邮箱登录失败"})}asyncactivate(e){returnthis._request.send("auth.activateEndUserMail",{token:e})}asyncresetPasswordWithToken(e,t){returnthis._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class$eextendsNe{asyncsignIn(e,t){if("string"!=typeofe)thrownewH({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeoft&&(t="",console.warn("password is empty"));const{refreshTokenKey:n}=this._cache.keys,s=awaitthis._request.send("auth.signIn",{loginType:Ce.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:r,access_token_expire:i,access_token:o}=s;if(r)returnthis.setRefreshToken(r),o&&i?this.setAccessToken(o,i):awaitthis._request.refreshAccessToken(),awaitthis.refreshUserInfo(),Se(Te),Se(be,{env:this.config.env,loginType:Ce.USERNAME,persistence:this.config.persistence}),newFe(this.config.env);throws.code?newH({code:s.code,message:`用户名密码登录失败: ${s.message}`}):newH({message:"用户名密码登录失败"})}}classBe{constructor(e){this.config=e,this._cache=me(e.env),this._request=De(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),ve(be,this._onLoginTypeChanged)}getcurrentUser(){conste=this.hasLoginState();returne&&e.user||null}getloginType(){returnthis._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){returnnewKe(this.config)}customAuthProvider(){returnnewMe(this.config)}emailAuthProvider(){returnnewje(this.config)}usernameAuthProvider(){returnnew$e(this.config)}asyncsignInAnonymously(){returnnewKe(this.config).signIn()}asyncsignInWithEmailAndPassword(e,t){returnnewje(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){returnnew$e(this.config).signIn(e,t)}asynclinkAndRetrieveDataWithTicket(e){this._anonymousAuthProvider||(this._anonymousAuthProvider=newKe(this.config)),ve(Ae,this._onAnonymousConverted);returnawaitthis._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}asyncsignOut(){if(this.loginType===Ce.ANONYMOUS)thrownewH({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:n}=this._cache.keys,s=this._cache.getStore(e);if(!s)return;constr=awaitthis._request.send("auth.logout",{refresh_token:s});returnthis._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(n),Se(Te),Se(be,{env:this.config.env,loginType:Ce.NULL,persistence:this.config.persistence}),r}asyncsignUpWithEmailAndPassword(e,t){returnthis._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}asyncsendPasswordResetEmail(e){returnthis._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){ve(Te,(()=>{constt=this.hasLoginState();e.call(this,t)}));constt=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){ve(Ie,e.bind(this))}onAccessTokenRefreshed(e){ve(Pe,e.bind(this))}onAnonymousConverted(e){ve(Ae,e.bind(this))}onLoginTypeChanged(e){ve(be,(()=>{constt=this.hasLoginState();e.call(this,t)}))}asyncgetAccessToken(){return{accessToken:(awaitthis._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{refreshTokenKey:e}=this._cache.keys;returnthis._cache.getStore(e)?newFe(this.config.env):null}asyncisUsernameRegistered(e){if("string"!=typeofe)thrownewH({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=awaitthis._request.send("auth.isUsernameRegistered",{username:e});returnt&&t.isRegistered}getLoginState(){returnPromise.resolve(this.hasLoginState())}asyncsignInWithTicket(e){returnnewMe(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){returnthis._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,n=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+n}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:n,env:s}=e.data;s===this.config.env&&(this._cache.updatePersistence(n),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}constze=function(e,t){t=t||re();constn=De(this.config.env),{cloudPath:s,filePath:r,onUploadProgress:i,fileType:o="image"}=e;returnn.send("storage.getUploadMetadata",{path:s}).then((e=>{const{data:{url:a,authorization:c,token:u,fileId:h,cosFileId:l},requestId:d}=e,f={key:s,signature:c,"x-cos-meta-fileid":l,success_action_status:"201","x-cos-security-token":u};n.upload({url:a,data:f,file:r,name:s,fileType:o,onUploadProgress:i}).then((e=>{201===e.statusCode?t(null,{fileID:h,requestId:d}):t(newH({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},We=function(e,t){t=t||re();constn=De(this.config.env),{cloudPath:s}=e;returnn.send("storage.getUploadMetadata",{path:s}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},He=function({fileList:e},t){if(t=t||re(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(lettofe)if(!t||"string"!=typeoft)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};constn={fileid_list:e};returnDe(this.config.env).send("storage.batchDeleteFile",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Je=function({fileList:e},t){t=t||re(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});letn=[];for(letsofe)"object"==typeofs?(s.hasOwnProperty("fileID")&&s.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),n.push({fileid:s.fileID,max_age:s.maxAge})):"string"==typeofs?n.push({fileid:s}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});consts={file_list:n};returnDe(this.config.env).send("storage.batchGetDownloadUrl",s).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Ve=asyncfunction({fileID:e},t){constn=(awaitJe.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==n.code)returnt?t(n):newPromise((e=>{e(n)}));consts=De(this.config.env);letr=n.download_url;if(r=encodeURI(r),!t)returns.download({url:r});t(awaits.download({url:r}))},Ye=function({name:e,data:t,query:n,parse:s,search:r},i){consto=i||re();leta;try{a=t?JSON.stringify(t):""}catch(e){returnPromise.reject(e)}if(!e)returnPromise.reject(newH({code:"PARAM_ERROR",message:"函数名不能为空"}));constc={inQuery:n,parse:s,search:r,function_name:e,request_data:a};returnDe(this.config.env).send("functions.invokeFunction",c).then((e=>{if(e.code)o(null,e);else{lett=e.data.response_data;if(s)o(null,{result:t,requestId:e.requestId});elsetry{t=JSON.parse(e.data.response_data),o(null,{result:t,requestId:e.requestId})}catch(e){o(newH({message:"response data must be json"}))}}returno.promise})).catch((e=>{o(e)})),o.promise},Qe={timeout:15e3,persistence:"session"},Xe={};classGe{constructor(e){this.config=e||this.config,this.authObj=void0}init(e){switch(ue.adapter||(this.requestClient=newue.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...Qe,...e},!0){casethis.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;casethis.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}returnnewGe(this.config)}auth({persistence:e}={}){if(this.authObj)returnthis.authObj;constt=e||ue.adapter.primaryStorage||Qe.persistence;varn;returnt!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;pe[t]=newfe(e),ge[t]=newfe({...e,persistence:"local"})}(this.config),n=this.config,Le[n.env]=newxe(n),this.authObj=newBe(this.config),this.authObj}on(e,t){returnve.apply(this,[e,t])}off(e,t){returnke.apply(this,[e,t])}callFunction(e,t){returnYe.apply(this,[e,t])}deleteFile(e,t){returnHe.apply(this,[e,t])}getTempFileURL(e,t){returnJe.apply(this,[e,t])}downloadFile(e,t){returnVe.apply(this,[e,t])}uploadFile(e,t){returnze.apply(this,[e,t])}getUploadMetadata(e,t){returnWe.apply(this,[e,t])}registerExtension(e){Xe[e.name]=e}asyncinvokeExtension(e,t){constn=Xe[e];if(!n)thrownewH({message:`扩展${e} 必须先注册`});returnawaitn.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:n}=ce(e)||{};t&&(ue.adapter=t),n&&(ue.runtime=n)}}varZe=newGe;functionet(e,t,n){void0===n&&(n={});vars=/\?/.test(t),r="";for(variinn)""===r?!s&&(t+="?"):r+="&",r+=i+"="+encodeURIComponent(n[i]);return/^http(s)?:\/\//.test(t+=r)?t:""+e+t}classtt{post(e){const{url:t,data:n,headers:s}=e;returnnewPromise(((e,r)=>{Q.request({url:et("https:",t),data:n,method:"POST",header:s,success(t){e(t)},fail(e){r(e)}})}))}upload(e){returnnewPromise(((t,n)=>{const{url:s,file:r,data:i,headers:o,fileType:a}=e,c=Q.uploadFile({url:et("https:",s),name:"file",formData:Object.assign({},i),filePath:r,fileType:a,header:o,success(e){constn={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&i.success_action_status&&(n.statusCode=parseInt(i.success_action_status,10)),t(n)},fail(e){n(newError(e.errMsg||"uploadFile:fail"))}});"function"==typeofe.onUploadProgress&&c&&"function"==typeofc.onProgressUpdate&&c.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}constnt={setItem(e,t){Q.setStorageSync(e,t)},getItem:e=>Q.getStorageSync(e),removeItem(e){Q.removeStorageSync(e)},clear(){Q.clearStorageSync()}};varst={genAdapter:function(){return{root:{},reqClass:tt,localStorage:nt,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};Ze.useAdapters(st);constrt=Ze,it=rt.init;rt.init=function(e){e.env=e.spaceId;constt=it.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;constn=t.auth;returnt.auth=function(e){constt=n.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{t[e]=W(t[e]).bind(t)})),t},t.customAuth=t.auth,t};varot=rt;functionat(){return{token:Q.getStorageSync("uni_id_token")||Q.getStorageSync("uniIdToken"),tokenExpired:Q.getStorageSync("uni_id_token_expired")}}functionct({token:e,tokenExpired:t}={}){e&&Q.setStorageSync("uni_id_token",e),t&&Q.setStorageSync("uni_id_token_expired",t)}functionut(){if(!f||"web"!==m)return;uni.getStorageSync("__LAST_DCLOUD_APPID")!==v&&(uni.setStorageSync("__LAST_DCLOUD_APPID",v),console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"),Q.removeStorageSync("uni_id_token"),Q.removeStorageSync("uniIdToken"),Q.removeStorageSync("uni_id_token_expired"))}varht=classextendsZ{getAccessToken(){returnnewPromise(((e,t)=>{constn="Anonymous_Access_token";this.setAccessToken(n),e(n)}))}setupRequest(e,t){constn=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),s={"Content-Type":"application/json"};"auth"!==t&&(n.token=this.accessToken,s["x-basement-token"]=this.accessToken),s["x-serverless-sign"]=Y.sign(n,this.config.clientSecret);constr=V();s["x-client-info"]=encodeURIComponent(JSON.stringify(r));const{token:i}=at();returns["x-client-token"]=i,{url:this.config.requestUrl,method:"POST",data:n,dataType:"json",header:JSON.parse(JSON.stringify(s))}}uploadFileToOSS({url:e,formData:t,name:n,filePath:s,fileType:r,onUploadProgress:i}){returnnewPromise(((o,a)=>{constc=this.adapter.uploadFile({url:e,formData:t,name:n,filePath:s,fileType:r,success(e){e&&e.statusCode<400?o(e):a(newH({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(newH({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeofi&&c&&"function"==typeofc.onProgressUpdate&&c.onProgressUpdate((e=>{i({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}uploadFile({filePath:e,cloudPath:t,fileType:n="image",onUploadProgress:s}){if(!t)thrownewH({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});letr;returnthis.getOSSUploadOptionsFromPath({cloudPath:t}).then((t=>{const{url:i,formData:o,name:a}=t.result;r=t.result.fileUrl;constc={url:i,formData:o,name:a,filePath:e,fileType:n};returnthis.uploadFileToOSS(Object.assign({},c,{onUploadProgress:s}))})).then((()=>this.reportOSSUpload({cloudPath:t}))).then((t=>newPromise(((n,s)=>{t.success?n({success:!0,filePath:e,fileID:r}):s(newH({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){constt={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};returnthis.request(this.setupRequest(t))}getTempFileURL({fileList:e}={}){constt={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e})};returnthis.request(this.setupRequest(t))}};varlt={init(e){constt=newht(e),n={signInAnonymously:function(){returnt.authorize()},getLoginState:function(){returnPromise.resolve(!1)}};returnt.auth=function(){returnn},t.customAuth=t.auth,t}};functiondt({data:e}){lett;t=V();constn=JSON.parse(JSON.stringify(e||{}));if(Object.assign(n,{clientInfo:t}),!n.uniIdToken){const{token:e}=at();e&&(n.uniIdToken=e)}returnn}functionft({name:e,data:t}={}){const{localAddress:n,localPort:s}=this.__dev__,r={aliyun:"aliyun",tencent:"tcb"}[this.config.provider],i=this.config.spaceId,o=`http://${n}:${s}/system/check-function`,a=`http://${n}:${s}/cloudfunctions/${e}`;returnnewPromise(((t,n)=>{Q.request({method:"POST",url:o,data:{name:e,platform:m,provider:r,spaceId:i},timeout:3e3,success(e){t(e)},fail(){t({data:{code:"NETWORK_ERROR",message:"连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"}})}})})).then((({data:e}={})=>{const{code:t,message:n}=e||{};return{code:0===t?0:t||"SYS_ERR",message:n||"SYS_ERR"}})).then((({code:n,message:s})=>{if(0!==n){switch(n){case"MODULE_ENCRYPTED":console.error(`此云函数(${e})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);break;case"FUNCTION_ENCRYPTED":console.error(`此云函数(${e})已加密不可本地调试,自动切换为云端已部署的云函数`);break;case"ACTION_ENCRYPTED":console.error(s||"需要访问加密的uni-clientDB-action,自动切换为云端环境");break;case"NETWORK_ERROR":{conste="连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";throwconsole.error(e),newError(e)}case"SWITCH_TO_CLOUD":break;default:{conste=`检测本地调试服务出现错误:${s},请检查网络环境或重启客户端再试`;throwconsole.error(e),newError(e)}}returnthis._callCloudFunction({name:e,data:t})}returnnewPromise(((e,n)=>{consts=dt.call(this,{data:t});Q.request({method:"POST",url:a,data:{provider:r,platform:m,param:s},success:({statusCode:t,data:s}={})=>!t||t>=400?n(newH({code:s.code||"SYS_ERR",message:s.message||"request:fail"})):e({result:s}),fail(e){n(newH({code:e.code||e.errCode||"SYS_ERR",message:e.message||e.errMsg||"request:fail"}))}})}))}))}constpt=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];vargt=/[\\^$.*+?()[\]{}|]/g,mt=RegExp(gt.source);functionyt(e,t,n){returne.replace(newRegExp((s=t)&&mt.test(s)?s.replace(gt,"\\$&"):s,"g"),n);vars}const_t="none",wt="request",vt="response",St="both";classkt{constructor({secretType:e,uniCloudIns:t}={}){this.secretType=e||_t,this.uniCloudIns=t;const{provider:n,spaceId:s}=this.uniCloudIns.config;this.provider=n,this.spaceId=s}getSystemInfo(){returnthis._systemInfo||(this._systemInfo=uni.getSystemInfoSync()),this._systemInfo}getappId(){returnthis.getSystemInfo().appId}getdeviceId(){returnthis.getSystemInfo().deviceId}asyncencryptData(e){returnthis.secretType===_t||this.secretType===_t?e:this.platformEncryptData(e)}asyncdecryptResult(e){if(this.secretType===_t)returne;const{content:t}=e;returnt?this.secretType===wt?t:this.platformDecryptResult(e):e}wrapCallFunction(e){constt=this;returnasyncfunction({name:n,data:s}={}){awaitt.prepare();constr=awaitt.encryptData(s),i=awaite({name:n,data:r});returni.result=awaitt.decryptResult(i.result),i}}}
/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */functionTt(e){returnparseInt(e)===e}functionIt(e){if(!Tt(e.length))return!1;for(vart=0;t<e.length;t++)if(!Tt(e[t])||e[t]<0||e[t]>255)return!1;return!0}functionbt(e,t){if(e.buffer&&"Uint8Array"===e.name)returnt&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!It(e))thrownewError("Array contains invalid value: "+e);returnnewUint8Array(e)}if(Tt(e.length)&&It(e))returnnewUint8Array(e);thrownewError("unsupported array-like object")}functionAt(e){returnnewUint8Array(e)}functionPt(e,t,n,s,r){null==s&&null==r||(e=e.slice?e.slice(s,r):Array.prototype.slice.call(e,s,r)),t.set(e,n)}varCt,Et={toBytes:function(e){vart=[],n=0;for(e=encodeURI(e);n<e.length;){vars=e.charCodeAt(n++);37===s?(t.push(parseInt(e.substr(n,2),16)),n+=2):t.push(s)}returnbt(t)},fromBytes:function(e){for(vart=[],n=0;n<e.length;){vars=e[n];s<128?(t.push(String.fromCharCode(s)),n++):s>191&&s<224?(t.push(String.fromCharCode((31&s)<<6|63&e[n+1])),n+=2):(t.push(String.fromCharCode((15&s)<<12|(63&e[n+1])<<6|63&e[n+2])),n+=3)}returnt.join("")}},Ot=(Ct="0123456789abcdef",{toBytes:function(e){for(vart=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));returnt},fromBytes:function(e){for(vart=[],n=0;n<e.length;n++){vars=e[n];t.push(Ct[(240&s)>>4]+Ct[15&s])}returnt.join("")}}),Rt={16:10,24:12,32:14},Ut=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],xt=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Lt=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Dt=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Nt=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],qt=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ft=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Kt=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Mt=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],jt=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],$t=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Bt=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],zt=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Wt=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Ht=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];functionJt(e){for(vart=[],n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);returnt}classVt{constructor(e){if(!(thisinstanceofVt))throwError("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:bt(e,!0)}),this._prepare()}_prepare(){vare=Rt[this.key.length];if(null==e)thrownewError("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(vart=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);varn,s=4*(e+1),r=this.key.length/4,i=Jt(this.key);for(t=0;t<r;t++)n=t>>2,this._Ke[n][t%4]=i[t],this._Kd[e-n][t%4]=i[t];for(varo,a=0,c=r;c<s;){if(o=i[r-1],i[0]^=xt[o>>16&255]<<24^xt[o>>8&255]<<16^xt[255&o]<<8^xt[o>>24&255]^Ut[a]<<24,a+=1,8!=r)for(t=1;t<r;t++)i[t]^=i[t-1];else{for(t=1;t<r/2;t++)i[t]^=i[t-1];o=i[r/2-1],i[r/2]^=xt[255&o]^xt[o>>8&255]<<8^xt[o>>16&255]<<16^xt[o>>24&255]<<24;for(t=r/2+1;t<r;t++)i[t]^=i[t-1]}for(t=0;t<r&&c<s;)u=c>>2,h=c%4,this._Ke[u][h]=i[t],this._Kd[e-u][h]=i[t++],c++}for(varu=1;u<e;u++)for(varh=0;h<4;h++)o=this._Kd[u][h],this._Kd[u][h]=Bt[o>>24&255]^zt[o>>16&255]^Wt[o>>8&255]^Ht[255&o]}encrypt(e){if(16!=e.length)thrownewError("invalid plaintext size (must be 16 bytes)");for(vart=this._Ke.length-1,n=[0,0,0,0],s=Jt(e),r=0;r<4;r++)s[r]^=this._Ke[0][r];for(vari=1;i<t;i++){for(r=0;r<4;r++)n[r]=Dt[s[r]>>24&255]^Nt[s[(r+1)%4]>>16&255]^qt[s[(r+2)%4]>>8&255]^Ft[255&s[(r+3)%4]]^this._Ke[i][r];s=n.slice()}varo,a=At(16);for(r=0;r<4;r++)o=this._Ke[t][r],a[4*r]=255&(xt[s[r]>>24&255]^o>>24),a[4*r+1]=255&(xt[s[(r+1)%4]>>16&255]^o>>16),a[4*r+2]=255&(xt[s[(r+2)%4]>>8&255]^o>>8),a[4*r+3]=255&(xt[255&s[(r+3)%4]]^o);returna}decrypt(e){if(16!=e.length)thrownewError("invalid ciphertext size (must be 16 bytes)");for(vart=this._Kd.length-1,n=[0,0,0,0],s=Jt(e),r=0;r<4;r++)s[r]^=this._Kd[0][r];for(vari=1;i<t;i++){for(r=0;r<4;r++)n[r]=Kt[s[r]>>24&255]^Mt[s[(r+3)%4]>>16&255]^jt[s[(r+2)%4]>>8&255]^$t[255&s[(r+1)%4]]^this._Kd[i][r];s=n.slice()}varo,a=At(16);for(r=0;r<4;r++)o=this._Kd[t][r],a[4*r]=255&(Lt[s[r]>>24&255]^o>>24),a[4*r+1]=255&(Lt[s[(r+3)%4]>>16&255]^o>>16),a[4*r+2]=255&(Lt[s[(r+2)%4]>>8&255]^o>>8),a[4*r+3]=255&(Lt[255&s[(r+1)%4]]^o);returna}}classYt{constructor(e){if(!(thisinstanceofYt))throwError("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=newVt(e)}encrypt(e){if((e=bt(e)).length%16!=0)thrownewError("invalid plaintext size (must be multiple of 16 bytes)");for(vart=At(e.length),n=At(16),s=0;s<e.length;s+=16)Pt(e,n,0,s,s+16),Pt(n=this._aes.encrypt(n),t,s);returnt}decrypt(e){if((e=bt(e)).length%16!=0)thrownewError("invalid ciphertext size (must be multiple of 16 bytes)");for(vart=At(e.length),n=At(16),s=0;s<e.length;s+=16)Pt(e,n,0,s,s+16),Pt(n=this._aes.decrypt(n),t,s);returnt}}classQt{constructor(e,t){if(!(thisinstanceofQt))throwError("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)thrownewError("invalid initialation vector size (must be 16 bytes)")}elset=At(16);this._lastCipherblock=bt(t,!0),this._aes=newVt(e)}encrypt(e){if((e=bt(e)).length%16!=0)thrownewError("invalid plaintext size (must be multiple of 16 bytes)");for(vart=At(e.length),n=At(16),s=0;s<e.length;s+=16){Pt(e,n,0,s,s+16);for(varr=0;r<16;r++)n[r]^=this._lastCipherblock[r];this._lastCipherblock=this._aes.encrypt(n),Pt(this._lastCipherblock,t,s)}returnt}decrypt(e){if((e=bt(e)).length%16!=0)thrownewError("invalid ciphertext size (must be multiple of 16 bytes)");for(vart=At(e.length),n=At(16),s=0;s<e.length;s+=16){Pt(e,n,0,s,s+16),n=this._aes.decrypt(n);for(varr=0;r<16;r++)t[s+r]=n[r]^this._lastCipherblock[r];Pt(e,this._lastCipherblock,0,s,s+16)}returnt}}classXt{constructor(e,t,n){if(!(thisinstanceofXt))throwError("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)thrownewError("invalid initialation vector size (must be 16 size)")}elset=At(16);n||(n=1),this.segmentSize=n,this._shiftRegister=bt(t,!0),this._aes=newVt(e)}encrypt(e){if(e.length%this.segmentSize!=0)thrownewError("invalid plaintext size (must be segmentSize bytes)");for(vart,n=bt(e,!0),s=0;s<n.length;s+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(varr=0;r<this.segmentSize;r++)n[s+r]^=t[r];Pt(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Pt(n,this._shiftRegister,16-this.segmentSize,s,s+this.segmentSize)}returnn}decrypt(e){if(e.length%this.segmentSize!=0)thrownewError("invalid ciphertext size (must be segmentSize bytes)");for(vart,n=bt(e,!0),s=0;s<n.length;s+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(varr=0;r<this.segmentSize;r++)n[s+r]^=t[r];Pt(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Pt(e,this._shiftRegister,16-this.segmentSize,s,s+this.segmentSize)}returnn}}classGt{constructor(e,t){if(!(thisinstanceofGt))throwError("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)thrownewError("invalid initialation vector size (must be 16 bytes)")}elset=At(16);this._lastPrecipher=bt(t,!0),this._lastPrecipherIndex=16,this._aes=newVt(e)}encrypt(e){for(vart=bt(e,!0),n=0;n<t.length;n++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[n]^=this._lastPrecipher[this._lastPrecipherIndex++];returnt}decrypt(e){returnthis.encrypt(e)}}classZt{constructor(e){if(!(thisinstanceofZt))throwError("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeofe?(this._counter=At(16),this.setValue(e)):this.setBytes(e)}setValue(e){if("number"!=typeofe||parseInt(e)!=e)thrownewError("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)thrownewError("integer value out of safe range");for(vart=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)}setBytes(e){if(16!=(e=bt(e,!0)).length)thrownewError("invalid counter bytes size (must be 16 bytes)");this._counter=e}increment(){for(vare=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}classen{constructor(e,t){if(!(thisinstanceofen))throwError("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",tinstanceofZt||(t=newZt(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=newVt(e)}encrypt(e){for(vart=bt(e,!0),n=0;n<t.length;n++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[n]^=this._remainingCounter[this._remainingCounterIndex++];returnt}decrypt(e){returnthis.encrypt(e)}}vartn={AES:Vt,Counter:Zt,ModeOfOperation:{ecb:Yt,cbc:Qt,cfb:Xt,ofb:Gt,ctr:en},utils:{hex:Ot,utf8:Et},padding:{pkcs7:{pad:function(e){vart=16-(e=bt(e,!0)).length%16,n=At(e.length+t);Pt(e,n);for(vars=e.length;s<n.length;s++)n[s]=t;returnn},strip:function(e){if((e=bt(e,!0)).length<16)thrownewError("PKCS#7 invalid length");vart=e[e.length-1];if(t>16)thrownewError("PKCS#7 padding byte out of range");for(varn=e.length-t,s=0;s<t;s++)if(e[n+s]!==t)thrownewError("PKCS#7 invalid padding byte");varr=At(n);returnPt(e,r,0,0,n),r}}},_arrayTest:{coerceArray:bt,createArray:At,copyArray:Pt}};functionnn(e,t,n){consts=newUint8Array(uni.base64ToArrayBuffer(t)),r=tn.utils.utf8.toBytes(n),i=tn.utils.utf8.toBytes(e),o=newtn.ModeOfOperation.cbc(s,r),a=tn.padding.pkcs7.pad(i),c=o.encrypt(a);returnuni.arrayBufferToBase64(c)}letsn,rn,on=null;classanextendskt{constructor(e){super(e),this.userEncryptKey=null}isLogin(){conste=this.uniCloudIns.getCurrentUserInfo();returne&&e.tokenExpired>Date.now()}asyncwxLogin(){returnnewPromise(((e,t)=>{uni.login({success:({code:t}={})=>{e(t)},fail:e=>{t(newH({code:e.errCode||"SYSTEM_ERROR",message:e.errMsg}))}})}))}asyncprepare(){returnnewPromise(((e,t)=>{if(!this.isLogin())returnt(newError("Login is required"));e()})).catch((()=>this.wxLogin().then((e=>this.uniCloudIns.importObject("uni-id-co").loginByWeixin({code:e})))))}asyncgetUserEncryptKey(){if(this.userEncryptKey)returnthis.userEncryptKey;if(on&&on.expireTime){conste=Date.now();if(on.expireTime-e>0)returnthis.userEncryptKey=on,this.userEncryptKey}returnnewPromise(((e,t)=>{uni.getUserCryptoManager().getLatestUserKey({success:t=>{on=t,this.userEncryptKey=t,e(this.userEncryptKey)},fail:e=>{t(newH({code:e.errCode||"SYSTEM_ERROR",message:e.errMsg}))}})}))}getWxAppId(){returnwx.getAccountInfoSync().miniProgram.appId}asyncplatformEncryptData(e){const{encryptKey:t,iv:n,version:s}=awaitthis.getUserEncryptKey(),r={secretType:this.secretType,encryptKeyId:s};returnthis.secretType===vt?{content:e,_uniCloudOptions:r}:{content:nn(JSON.stringify({data:JSON.stringify(e),appId:this.appId,deviceId:this.deviceId,wxAppId:this.getWxAppId(),timestamp:Date.now()}),t,n),_uniCloudOptions:r}}asyncplatformDecryptResult(e){const{content:t}=e,{encryptKey:n,iv:s}=awaitthis.getUserEncryptKey();returnJSON.parse(function(e,t,n){consts=newUint8Array(uni.base64ToArrayBuffer(e)),r=newUint8Array(uni.base64ToArrayBuffer(t)),i=tn.utils.utf8.toBytes(n),o=newtn.ModeOfOperation.cbc(r,i),a=tn.padding.pkcs7.strip(o.decrypt(s));returntn.utils.utf8.fromBytes(a)}(t,n,s))}}functioncn(e){constt=["hasClientKey","encryptGetClientKeyPayload","setClientKey","encrypt","decrypt"],n={};for(lets=0;s<t.length;s++){constr=t[s];n[r]=function(...t){returnf&&(console.log("-=-=-=-=-=-=-=-=-app-utils-start"),console.log("functionName: "+r),console.log("arguments: "+JSON.stringify(t)),console.log("-=-=-=-=-=-=-=-=-app-utils-end")),newPromise(((n,s)=>{"function"==typeofe[r]?e[r](...t,(function({type:e,data:t,message:r}={}){"success"===e?n(t):s(newH({code:"SYSTEM_ERROR",message:r||"[secureNetwork]failed"}))})):s(newError("[secureNetwork]请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"))}))}}returnn}classunextendskt{constructor(e){super(e),this.appUtils={...cn(uni.requireNativePlugin("plus"))},this.systemInfo=sn||(sn=uni.getSystemInfoSync())}asynchasClientKey(){returnvoid0===this._hasClientKey&&(this._hasClientKey=awaitthis.appUtils.hasClientKey({provider:this.provider,spaceId:this.spaceId})),this._hasClientKey}asyncgetAppClientKey(){const{data:e,key:t}=awaitthis.appUtils.encryptGetClientKeyPayload({data:JSON.stringify({})}),n=(awaitthis.uniCloudIns.callFunction({name:"DCloud-clientDB",data:{redirectTo:"encryption",action:"getAppClientKey",data:e,key:t}})).result||{};if(0!==n.errCode)thrownewH({code:n.errCode||n.code||"SYSTEM_ERROR",message:n.errMsg||n.message});const{clientKey:s,key:r}=n;awaitthis.appUtils.setClientKey({provider:this.provider,spaceId:this.spaceId,clientKey:s,key:r})}asyncensureClientKey(){!0!==awaitthis.hasClientKey()&&awaitthis.getAppClientKey()}asyncprepare(){awaitthis.ensureClientKey()}asyncplatformEncryptData(e){const{data:t,key:n}=awaitthis.appUtils.encrypt({provider:this.provider,spaceId:this.spaceId,data:JSON.stringify(e)}),s={secretType:this.secretType,encryptKeyId:n};returnthis.secretType===vt?{content:e,_uniCloudOptions:s}:{content:t,_uniCloudOptions:s}}asyncplatformDecryptResult(e){const{content:t,_uniCloudOptions:n={}}=e,s=n.encryptKeyId,r=awaitthis.appUtils.decrypt({provider:this.provider,spaceId:this.spaceId,data:t,key:s});returnJSON.parse(r.data)}}functionhn({secretType:e}={}){returne===wt||e===vt||e===St}functionln({functionName:e,result:t,logPvd:n}){if(this.__dev__.debugLog&&t&&t.requestId){consts=JSON.stringify({spaceId:this.config.spaceId,functionName:e,requestId:t.requestId});console.log(`[${n}-request]${s}[/${n}-request]`)}}functiondn(e){constt=e.callFunction,n=function(n){consts=n.name;n.data=dt.call(e,{data:n.data});constr={aliyun:"aliyun",tencent:"tcb",tcb:"tcb"}[this.config.provider],i=hn(n);returnt.call(this,n).then((e=>(e.errCode=0,!i&&ln.call(this,{functionName:s,result:e,logPvd:r}),Promise.resolve(e))),(e=>(!i&&ln.call(this,{functionName:s,result:e,logPvd:r}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:n=[]}={}){for(lets=0;s<n.length;s++){const{rule:r,content:i,mode:o}=n[s],a=e.match(r);if(!a)continue;letc=i;for(lete=1;e<a.length;e++)c=yt(c,`{$${e}}`,a[e]);for(consteint)c=yt(c,`{${e}}`,t[e]);return"replace"===o?c:e+c}returne}({message:`[${n.name}]: ${e.message}`,formatter:pt,extraInfo:{functionName:s}})),Promise.reject(e))))};e.callFunction=function(t){lets,r;if(f&&e.__dev__.debugInfo&&!e.__dev__.debugInfo.forceRemote&&_?(e._callCloudFunction||(e._callCloudFunction=n,e._callLocalFunction=ft),s=ft):s=n,s=s.bind(e),hn(t)){r=newrn({secretType:t.secretType,uniCloudIns:e}).wrapCallFunction(n.bind(e))(t)}elser=s(t);returnObject.defineProperty(r,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),r}}rn=g?"mp-weixin"===m?an:"app"===m?un:class{constructor(){thrownewError(`[SecureNetwork]: Platform ${m} is not supported`)}}:class{constructor(){thrownewError(`[SecureNetwork]: Platform ${m} is not enabled`)}};constfn=Symbol("CLIENT_DB_INTERNAL");functionpn(e,t){returne.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=fn,e.inspect=null,e.__ob__=void0,newProxy(e,{get(e,n,s){if("_uniClient"===n)returnnull;if("symbol"==typeofn)returne[n];if(nine||"string"!=typeofn){constt=e[n];return"function"==typeoft?t.bind(e):t}returnt.get(e,n,s)}})}functiongn(e){return{on:(t,n)=>{e[t]=e[t]||[],e[t].indexOf(n)>-1||e[t].push(n)},off:(t,n)=>{e[t]=e[t]||[];consts=e[t].indexOf(n);-1!==s&&e[t].splice(s,1)}}}constmn=["db.Geo","db.command","command.aggregate"];functionyn(e,t){returnmn.indexOf(`${e}.${t}`)>-1}function_n(e){switch(h(e)){case"array":returne.map((e=>_n(e)));case"object":returne._internalType===fn||Object.keys(e).forEach((t=>{e[t]=_n(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:returne}}functionwn(e){returne&&e.content&&e.content.$method}classvn{constructor(e,t,n){this.content=e,this.prevStage=t||null,this.udb=null,this._database=n}toJSON(){lete=this;constt=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:_n(e.$param)})))}}getAction(){conste=this.toJSON().$db.find((e=>"action"===e.$method));returne&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}getisAggregate(){lete=this;for(;e;){constt=wn(e),n=wn(e.prevStage);if("aggregate"===t&&"collection"===n||"pipeline"===t)return!0;e=e.prevStage}return!1}getisCommand(){lete=this;for(;e;){if("command"===wn(e))return!0;e=e.prevStage}return!1}getisAggregateCommand(){lete=this;for(;e;){constt=wn(e),n=wn(e.prevStage);if("aggregate"===t&&"command"===n)return!0;e=e.prevStage}return!1}getcount(){if(!this.isAggregate)returnfunction(){returnthis._send("count",Array.from(arguments))};conste=this;returnfunction(){returnSn({$method:"count",$param:_n(Array.from(arguments))},e,this._database)}}getremove(){if(!this.isCommand)returnfunction(){returnthis._send("remove",Array.from(arguments))};conste=this;returnfunction(){returnSn({$method:"remove",$param:_n(Array.from(arguments))},e,this._database)}}get(){returnthis._send("get",Array.from(arguments))}add(){returnthis._send("add",Array.from(arguments))}update(){returnthis._send("update",Array.from(arguments))}end(){returnthis._send("end",Array.from(arguments))}getset(){if(!this.isCommand)returnfunction(){thrownewError("JQL禁止使用set方法")};conste=this;returnfunction(){returnSn({$method:"set",$param:_n(Array.from(arguments))},e,this._database)}}_send(e,t){constn=this.getAction(),s=this.getCommand();if(s.$db.push({$method:e,$param:_n(t)}),f){conste=s.$db.find((e=>"collection"===e.$method)),t=e&&e.$param;t&&1===t.length&&"string"==typeofe.$param[0]&&e.$param[0].indexOf(",")>-1&&console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。")}returnthis._database._callCloudFunction({action:n,command:s})}}functionSn(e,t,n){returnpn(newvn(e,t,n),{get(e,t){lets="db";returne&&e.content&&(s=e.content.$method),yn(s,t)?Sn({$method:t},e,n):function(){returnSn({$method:t,$param:_n(Array.from(arguments))},e,n)}}})}functionkn({path:e,method:t}){returnclass{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}}}functionTn(e,t={}){returnpn(newe(t),{get:(e,t)=>yn("db",t)?Sn({$method:t},null,e):function(){returnSn({$method:t,$param:_n(Array.from(arguments))},null,e)}})}classInextendsclass{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e.isDefault&&(this._dbCallBacks=k("_globalUniCloudDatabaseCallback")),t||(this.auth=gn(this._authCallBacks)),this._isJQL=t,Object.assign(this,gn(this._dbCallBacks)),this.env=pn({},{get:(e,t)=>({$env:t})}),this.Geo=pn({},{get:(e,t)=>kn({path:["Geo"],method:t})}),this.serverDate=kn({path:[],method:"serverDate"}),this.RegExp=kn({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeofe||!e.trim())thrownewError("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){constn=this._dbCallBacks;n[e]&&n[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){constn=this._authCallBacks;n[e]&&n[e].forEach((e=>{e(...t)}))}multiSend(){conste=Array.from(arguments),t=e.map((e=>{constt=e.getAction(),n=e.getCommand();if("getTemp"!==n.$db[n.$db.length-1].$method)thrownewError("multiSend只支持子命令内使用getTemp");return{action:t,command:n}}));returnthis._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){returnthis._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:n,queryList:s}){functionr(e,t){if(n&&s)for(letn=0;n<s.length;n++){constr=s[n];r.udb&&"function"==typeofr.udb.setResult&&(t?r.udb.setResult(t):r.udb.setResult(e.result.dataList[n]))}}consti=this,o=this._isJQL?"databaseForJQL":"database";functiona(e){returni._callback("error",[e]),P(C(o,"fail"),e).then((()=>P(C(o,"complete"),e))).then((()=>(r(null,e),M(R,{type:L,content:e}),Promise.reject(e))))}constc=P(C(o,"invoke")),h=this._uniClient;returnc.then((()=>h.callFunction({name:"DCloud-clientDB",type:u,data:{action:e,command:t,multiCommand:n}}))).then((e=>{const{code:t,message:n,token:s,tokenExpired:c,systemInfo:u=[]}=e.result;if(u)for(lete=0;e<u.length;e++){const{level:t,message:n,detail:s}=u[e],r=console["app"===m&&"warn"===t?"error":t]||console.log;leti="[System Info]"+n;s&&(i=`${i}\n详细信息:${s}`),r(i)}if(t){returna(newH({code:t,message:n,requestId:e.requestId}))}e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,s&&c&&(ct({token:s,tokenExpired:c}),this._callbackAuth("refreshToken",[{token:s,tokenExpired:c}]),this._callback("refreshToken",[{token:s,tokenExpired:c}]),M(x,{token:s,tokenExpired:c}));consth=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(lett=0;t<h.length;t++){const{prop:n,tips:s}=h[t];if(nine.result){constt=e.result[n];Object.defineProperty(e.result,n,{get:()=>(console.warn(s),t)})}}returnfunction(e){returnP(C(o,"success"),e).then((()=>P(C(o,"complete"),e))).then((()=>{r(e,null);constt=i._parseResult(e);returnM(R,{type:L,content:t}),Promise.resolve(t)}))}(e)}),(e=>{/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");returna(newH({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId}))}))}}constbn="token无效,跳转登录页面",An="token过期,跳转登录页面",Pn={TOKEN_INVALID_TOKEN_EXPIRED:An,TOKEN_INVALID_INVALID_CLIENTID:bn,TOKEN_INVALID:bn,TOKEN_INVALID_WRONG_TOKEN:bn,TOKEN_INVALID_ANONYMOUS_USER:bn},Cn={"uni-id-token-expired":An,"uni-id-check-token-failed":bn,"uni-id-token-not-exist":bn,"uni-id-check-device-feature-failed":bn};functionEn(e,t){letn="";returnn=e?`${e}/${t}`:t,n.replace(/^\//,"")}functionOn(e=[],t=""){constn=[],s=[];returne.forEach((e=>{!0===e.needLogin?n.push(En(t,e.path)):!1===e.needLogin&&s.push(En(t,e.path))})),{needLoginPage:n,notNeedLoginPage:s}}functionRn(e){returne.split("?")[0].replace(/^\//,"")}functionUn(){returnfunction(e){lett=e&&e.$page&&e.$page.fullPath||"";returnt?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){conste=getCurrentPages();returne[e.length-1]}())}functionxn(){returnRn(Un())}functionLn(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;constn=t.list,s=Rn(e);returnn.some((e=>e.pagePath===s))}constDn=!!t.uniIdRouter;const{loginPage:Nn,routerNeedLogin:qn,resToLogin:Fn,needLoginPage:Kn,notNeedLoginPage:Mn,loginPageInTabBar:jn}=function({pages:e=[],subPackages:n=[],uniIdRouter:s={},tabBar:r={}}=t){const{loginPage:i,needLogin:o=[],resToLogin:a=!0}=s,{needLoginPage:c,notNeedLoginPage:u}=On(e),{needLoginPage:h,notNeedLoginPage:l}=function(e=[]){constt=[],n=[];returne.forEach((e=>{const{root:s,pages:r=[]}=e,{needLoginPage:i,notNeedLoginPage:o}=On(r,s);t.push(...i),n.push(...o)})),{needLoginPage:t,notNeedLoginPage:n}}(n);return{loginPage:i,routerNeedLogin:o,resToLogin:a,needLoginPage:[...c,...h],notNeedLoginPage:[...u,...l],loginPageInTabBar:Ln(i,r)}}();if(Kn.indexOf(Nn)>-1)thrownewError(`Login page [${Nn}] should not be "needLogin", please check your pages.json`);function$n(e){constt=Rn(function(e){constt=xn(),n=e.charAt(0),s=e.split("?")[0];if("/"===n)returns;constr=s.replace(/^\//,"").split("/"),i=t.split("/");i.pop();for(lete=0;e<r.length;e++){constt=r[e];".."===t?i.pop():"."!==t&&i.push(t)}return""===i[0]&&i.shift(),i.join("/")}(e));return!(Mn.indexOf(t)>-1)&&(Kn.indexOf(t)>-1||qn.some((t=>function(e,t){returnnewRegExp(t).test(e)}(e,t))))}functionBn({redirect:e}){constt=Rn(e),n=Rn(Nn);returnxn()!==n&&t!==n}functionzn({api:e,redirect:t}={}){if(!t||!Bn({redirect:t}))return;constn=function(e,t){return"/"!==e.charAt(0)&&(e="/"+e),t?e.indexOf("?")>-1?e+`&uniIdRedirectUrl=${encodeURIComponent(t)}`:e+`?uniIdRedirectUrl=${encodeURIComponent(t)}`:e}(Nn,t);jn?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo"),setTimeout((()=>{uni[e]({url:n})}))}functionWn({url:e}={}){constt={abortLoginPageJump:!1,autoToLoginPage:!1},n=function(){const{token:e,tokenExpired:t}=at();letn;if(e){if(t<Date.now()){conste="uni-id-token-expired";n={errCode:e,errMsg:Cn[e]}}}else{conste="uni-id-check-token-failed";n={errCode:e,errMsg:Cn[e]}}returnn}();if($n(e)&&n){n.uniIdRedirectUrl=e;if(q(U).length>0)returnsetTimeout((()=>{M(U,n)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}returnt}functionHn(){!function(){conste=Un(),{abortLoginPageJump:t,autoToLoginPage:n}=Wn({url:e});t||n&&zn({api:"redirectTo",redirect:e})}();conste=["navigateTo","redirectTo","reLaunch","switchTab"];for(lett=0;t<e.length;t++){constn=e[t];uni.addInterceptor(n,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:s}=Wn({url:e.url});returnt?e:s?(zn({api:n,redirect:e.url}),!1):e}})}}functionJn(){this.onResponse((e=>{const{type:t,content:n}=e;lets=!1;switch(t){case"cloudobject":s=function(e){const{errCode:t}=e;returntinCn}(n);break;case"clientdb":s=function(e){const{errCode:t}=e;returntinPn}(n)}s&&function(e={}){constt=q(U);z().then((()=>{constn=Un();if(n&&Bn({redirect:n}))returnt.length>0?M(U,Object.assign({uniIdRedirectUrl:n},e)):void(Nn&&zn({api:"navigateTo",redirect:n}))}))}(n)}))}functionVn(e){!function(e){e.onResponse=function(e){F(R,e)},e.offResponse=function(e){K(R,e)}}(e),function(e){e.onNeedLogin=function(e){F(U,e)},e.offNeedLogin=function(e){K(U,e)},Dn&&(k("uni-cloud-status").needLoginInit||(k("uni-cloud-status").needLoginInit=!0,z().then((()=>{Hn.call(e)})),Fn&&Jn.call(e)))}(e),function(e){e.onRefreshToken=function(e){F(x,e)},e.offRefreshToken=function(e){K(x,e)}}(e)}letYn;constQn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Xn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;functionGn(){conste=at().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};letn;try{n=JSON.parse((s=t[1],decodeURIComponent(Yn(s).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(e){thrownewError("获取当前用户信息出错,详细错误信息为:"+e.message)}vars;returnn.tokenExpired=1e3*n.exp,deleten.exp,deleten.iat,n}Yn="function"!=typeofatob?function(e){if(e=String(e).replace(/[\t\n\f\r]+/g,""),!Xn.test(e))thrownewError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");vart;e+="==".slice(2-(3&e.length));for(varn,s,r="",i=0;i<e.length;)t=Qn.indexOf(e.charAt(i++))<<18|Qn.indexOf(e.charAt(i++))<<12|(n=Qn.indexOf(e.charAt(i++)))<<6|(s=Qn.indexOf(e.charAt(i++))),r+=64===n?String.fromCharCode(t>>16&255):64===s?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);returnr}:atob;varZn=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});constn="chooseAndUploadFile:ok",s="chooseAndUploadFile:fail";functionr(e,t){returne.tempFiles.forEach(((e,n)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+n+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}functioni(e,t,{onChooseFile:s,onUploadProgress:r}){returnt.then((e=>{if(s){constt=s(e);if(void0!==t)returnPromise.resolve(t).then((t=>void0===t?e:t))}returne})).then((t=>!1===t?{errMsg:n,tempFilePaths:[],tempFiles:[]}:function(e,t,s=5,r){(t=Object.assign({},t)).errMsg=n;consti=t.tempFiles,o=i.length;leta=0;returnnewPromise((n=>{for(;a<s;)c();functionc(){consts=a++;if(s>=o)returnvoid(!i.find((e=>!e.url&&!e.errMsg))&&n(t));constu=i[s];e.uploadFile({filePath:u.path,cloudPath:u.cloudPath,fileType:u.fileType,onUploadProgress(e){e.index=s,e.tempFile=u,e.tempFilePath=u.path,r&&r(e)}}).then((e=>{u.url=e.fileID,s<o&&c()})).catch((e=>{u.errMsg=e.errMsg||e.message,s<o&&c()}))}}))}(e,t,5,r)))}t.initChooseAndUploadFile=function(e){returnfunction(t={type:"all"}){return"image"===t.type?i(e,function(e){const{count:t,sizeType:n,sourceType:i=["album","camera"],extension:o}=e;returnnewPromise(((e,a)=>{uni.chooseImage({count:t,sizeType:n,sourceType:i,extension:o,success(t){e(r(t,"image"))},fail(e){a({errMsg:e.errMsg.replace("chooseImage:fail",s)})}})}))}(t),t):"video"===t.type?i(e,function(e){const{camera:t,compressed:n,maxDuration:i,sourceType:o=["album","camera"],extension:a}=e;returnnewPromise(((e,c)=>{uni.chooseVideo({camera:t,compressed:n,maxDuration:i,sourceType:o,extension:a,success(t){const{tempFilePath:n,duration:s,size:i,height:o,width:a}=t;e(r({errMsg:"chooseVideo:ok",tempFilePaths:[n],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:n,size:i,type:t.tempFile&&t.tempFile.type||"",width:a,height:o,duration:s,fileType:"video",cloudPath:""}]},"video"))},fail(e){c({errMsg:e.errMsg.replace("chooseVideo:fail",s)})}})}))}(t),t):i(e,function(e){const{count:t,extension:n}=e;returnnewPromise(((e,i)=>{leto=uni.chooseFile;if("undefined"!=typeofwx&&"function"==typeofwx.chooseMessageFile&&(o=wx.chooseMessageFile),"function"!=typeofo)returni({errMsg:s+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});o({type:"all",count:t,extension:n,success(t){e(r(t))},fail(e){i({errMsg:e.errMsg.replace("chooseFile:fail",s)})}})}))}(t),t)}}})),es=n(Zn);constts="manual";functionns(e){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{}}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((()=>{vare=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{if(this.loadtime===ts)return;letn=!1;consts=[];for(letr=2;r<e.length;r++)e[r]!==t[r]&&(s.push(e[r]),n=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(n,s)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:n}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomGet().then((n=>{this.mixinDatacomLoading=!1;const{data:s,count:r}=n.result;this.getcount&&(this.mixinDatacomPage.count=r),this.mixinDatacomHasMore=s.length<this.pageSize;consti=e?s.length?s[0]:void0:s;this.mixinDatacomResData=i,t&&t(i)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,n&&n(e)})))},mixinDatacomGet(t={}){letn=e.database(this.spaceInfo);consts=t.action||this.action;s&&(n=n.action(s));constr=t.collection||this.collection;n=Array.isArray(r)?n.collection(...r):n.collection(r);consti=t.where||this.where;i&&Object.keys(i).length&&(n=n.where(i));consto=t.field||this.field;o&&(n=n.field(o));consta=t.foreignKey||this.foreignKey;a&&(n=n.foreignKey(a));constc=t.groupby||this.groupby;c&&(n=n.groupBy(c));constu=t.groupField||this.groupField;u&&(n=n.groupField(u));!0===(void0!==t.distinct?t.distinct:this.distinct)&&(n=n.distinct());consth=t.orderby||this.orderby;h&&(n=n.orderBy(h));constl=void0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,d=void0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,f=void0!==t.getcount?t.getcount:this.getcount,p=void0!==t.gettree?t.gettree:this.gettree,g=void0!==t.gettreepath?t.gettreepath:this.gettreepath,m={getCount:f},y={limitLevel:void0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void0!==t.startwith?t.startwith:this.startwith};returnp&&(m.getTree=y),g&&(m.getTreePath=y),n=n.skip(d*(l-1)).limit(d).get(m),n}}}}functionss(e){returnfunction(t,n={}){n=function(e,t={}){returne.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeoft.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},n);const{customUI:s,loadingOptions:r,errorOptions:i,parseSystemError:o}=n,a=!s;returnnewProxy({},{get:(s,u)=>function({fn:e,interceptorName:t,getCallbackArgs:n}={}){returnasyncfunction(...s){constr=n?n({params:s}):{};leti,o;try{returnawaitP(C(t,"invoke"),{...r}),i=awaite(...s),awaitP(C(t,"success"),{...r,result:i}),i}catch(e){throwo=e,awaitP(C(t,"fail"),{...r,error:o}),o}finally{awaitP(C(t,"complete"),o?{...r,error:o}:{...r,result:i})}}}({fn:asyncfunctions(...h){letl;a&&uni.showLoading({title:r.title,mask:r.mask});constd={name:t,type:c,data:{method:u,params:h}};"object"==typeofn.secretMethods&&function(e,t){constn=t.data.method,s=e.secretMethods||{},r=s[n]||s["*"];r&&(t.secret=r)}(n,d);try{l=awaite.callFunction(d)}catch(e){l={result:e}}const{errCode:f,errMsg:p,newToken:g}=l.result||{};if(a&&uni.hideLoading(),g&&g.token&&g.tokenExpired&&(ct(g),M(x,{...g})),f){conste=o?awaito({objectName:t,methodName:u,params:h,errCode:f,errMsg:p}):p;if(a)if("toast"===i.type)uni.showToast({title:e,icon:"none"});else{if("modal"!==i.type)thrownewError(`Invalid errorOptions.type: ${i.type}`);{const{confirm:t}=awaitasyncfunction({title:e,content:t,showCancel:n,cancelText:s,confirmText:r}={}){returnnewPromise(((i,o)=>{uni.showModal({title:e,content:t,showCancel:n,cancelText:s,confirmText:r,success(e){i(e)},fail(){i({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:i.retry,cancelText:"取消",confirmText:i.retry?"重试":"确定"});if(i.retry&&t)returns(...h)}}constn=newH({code:f,message:p,requestId:l.requestId});thrown.detail=l.result,M(R,{type:N,content:n}),n}returnM(R,{type:N,content:l.result}),l.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:t,methodName:u,params:e}}})})}}asyncfunctionrs(e,t){constn=`http://${e}:${t}/system/ping`;try{conste=await(s={url:n,timeout:500},newPromise(((e,t)=>{Q.request({...s,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(e){return!1}vars}functionis(e){if(e.initUniCloudStatus&&"rejected"!==e.initUniCloudStatus)return;lett=Promise.resolve();varn;n=1,t=newPromise(((e,t)=>{setTimeout((()=>{e()}),n)})),e.isReady=!1,e.isDefault=!1;consts=e.auth();e.initUniCloudStatus="pending",e.initUniCloud=t.then((()=>s.getLoginState())).then((e=>e?Promise.resolve():s.signInAnonymously())).then((()=>{if(!f)returnPromise.resolve();if("app"===m){const{osName:e,osVersion:t}=uni.getSystemInfoSync();"ios"===e&&function(e){if(!e||"string"!=typeofe)return0;constt=e.match(/^(\d+)./);returnt&&t[1]?parseInt(t[1]):0}(t)>=14&&console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)")}if(f&&e.__dev__.debugInfo){const{address:t,servePort:n}=e.__dev__.debugInfo;returnasyncfunction(e,t){letn;for(lets=0;s<e.length;s++){constr=e[s];if(awaitrs(r,t)){n=r;break}}return{address:n,port:t}}(t,n)}})).then((({address:t,port:n}={})=>{if(!f)returnPromise.resolve();consts=console["app"===m?"error":"warn"];if(t)e.__dev__.localAddress=t,e.__dev__.localPort=n;elseif(e.__dev__.debugInfo){lett="";"remote"===e.__dev__.debugInfo.initialLaunchType?(e.__dev__.debugInfo.forceRemote=!0,t="当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs"):t="无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs","web"===m&&(t+="\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"),0===m.indexOf("mp-")&&(t+="\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"),s(t)}})).then((()=>{ut(),e.isReady=!0,e.initUniCloudStatus="fulfilled"})).catch((t=>{console.error(t),e.initUniCloudStatus="rejected"}))}constos={tcb:ot,tencent:ot,aliyun:ee,private:lt};letas=newclass{init(e){lett={};constn=os[e.provider];if(!n)thrownewError("未提供正确的provider参数");t=n.init(e),t.__dev__={},t.__dev__.debugLog=f&&("web"===m&&navigator.userAgent.indexOf("HBuilderX")>0||"app"===m);consts=y;f&&s&&!s.code&&(t.__dev__.debugInfo=s),is(t),t.reInit=function(){is(this)},dn(t),function(e){constt=e.uploadFile;e.uploadFile=function(e){returnt.call(this,e)}}(t),function(e){e.database=function(t){if(t&&Object.keys(t).length>0)returne.init(t).database();if(this._database)returnthis._database;constn=Tn(In,{uniClient:e});returnthis._database=n,n},e.databaseForJQL=function(t){if(t&&Object.keys(t).length>0)returne.init(t).databaseForJQL();if(this._databaseForJQL)returnthis._databaseForJQL;constn=Tn(In,{uniClient:e,isJQL:!0});returnthis._databaseForJQL=n,n}}(t),function(e){e.getCurrentUserInfo=Gn,e.chooseAndUploadFile=es.initChooseAndUploadFile(e),Object.assign(e,{getmixinDatacom(){returnns(e)}}),e.importObject=ss(e)}(t);return["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;constn=t[e];t[e]=function(){returnt.reInit(),n.apply(t,Array.from(arguments))},t[e]=W(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{conste=_;lett={};if(e&&1===e.length)t=e[0],as=as.init(t),as.isDefault=!0;else{constt=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];letn;n=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":w?"应用未关联服务空间,请在uniCloud目录右键关联服务空间":"uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间",t.forEach((e=>{as[e]=function(){returnconsole.error(n),Promise.reject(newH({code:"SYS_ERR",message:n}))}}))}Object.assign(as,{getmixinDatacom(){returnns(as)}}),Vn(as),as.addInterceptor=b,as.removeInterceptor=A,as.interceptObject=E,f&&"web"===m&&(window.uniCloud=as)})();varcs=as;export{csasdefault};