| 1 |
- import{q as e,M as t,N as s,O as n,P as o,Q as i,g as r,h as a,s as c,R as l,S as u,T as h,U as d,V as f,W as p,X as g,Y as m,Z as y,D as _,m as w,_ as v,$ as k,p as b,a0 as I,a1 as A,a2 as S,a3 as T,k as x,o as P,c as C,b as E,F as D,t as R,v as O,e as L,n as U,f as N,a4 as M,B as F,H as j,a5 as B,j as q,x as J,a6 as V,a7 as K,i as W,a8 as z,a9 as H,aa as G,ab as Y,ac as Q,d as Z,r as $,E as X,a as ee,G as te,l as se}from"./index-72b896ac.js";import{d as ne,_ as oe,b as ie,a as re,c as ae}from"./logo.1cbcaa3f.js";import{_ as ce,r as le,o as ue}from"./uni-app.es.e89653c9.js";import{a as he,r as de,p as fe}from"./h5.1f9437c2.js";const pe={pages:[{path:"pages/index/index",style:{navigationBarTitleText:"德立信志愿",navigationStyle:"custom"}},{path:"pages/result/result",style:{navigationBarTitleText:"德立信志愿",navigationStyle:"custom",enablePullDownRefresh:!1}},{path:"pages/register/register",style:{navigationBarTitleText:"德立信志愿",navigationStyle:"custom",enablePullDownRefresh:!1}},{path:"pages/password/password",style:{navigationBarTitleText:"德立信志愿",navigationStyle:"custom",enablePullDownRefresh:!1}}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"德立信",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},uniIdRouter:{}};function ge(e,t,s){return e(s={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&s.path)}},s.exports),s.exports}var me=ge((function(e,t){var s;e.exports=(s=s||function(e,t){var s=Object.create||function(){function e(){}return function(t){var s;return e.prototype=t,s=new e,e.prototype=null,s}}(),n={},o=n.lib={},i=o.Base={extend:function(e){var t=s(this);return e&&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(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},r=o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,s=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var r=s[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=r<<24-(n+i)%4*8}else for(i=0;i<o;i+=4)t[n+i>>>2]=s[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,s=this.sigBytes;t[s>>>2]&=4294967295<<32-s%4*8,t.length=e.ceil(s/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var s,n=[],o=function(t){var s=987654321,n=4294967295;return function(){var o=((s=36969*(65535&s)+(s>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},i=0;i<t;i+=4){var a=o(4294967296*(s||e.random()));s=987654071*a(),n.push(4294967296*a()|0)}return new r.init(n,t)}}),a=n.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,s=e.sigBytes,n=[],o=0;o<s;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,s=[],n=0;n<t;n+=2)s[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new r.init(s,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,s=e.sigBytes,n=[],o=0;o<s;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,s=[],n=0;n<t;n++)s[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new r.init(s,t)}},u=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},h=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var s=this._data,n=s.words,o=s.sigBytes,i=this.blockSize,a=o/(4*i),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,l=e.min(4*c,o);if(c){for(var u=0;u<c;u+=i)this._doProcessBlock(n,u);var h=n.splice(0,c);s.sigBytes-=l}return new r.init(h,l)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=h.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,s){return new e.init(s).finalize(t)}},_createHmacHelper:function(e){return function(t,s){return new d.HMAC.init(e,s).finalize(t)}}});var d=n.algo={};return n}(Math),s)})),ye=me,_e=(ge((function(e,t){var s;e.exports=(s=ye,function(e){var t=s,n=t.lib,o=n.WordArray,i=n.Hasher,r=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=r.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;s<16;s++){var n=t+s,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,r=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],k=e[t+10],b=e[t+11],I=e[t+12],A=e[t+13],S=e[t+14],T=e[t+15],x=i[0],P=i[1],C=i[2],E=i[3];x=l(x,P,C,E,r,7,a[0]),E=l(E,x,P,C,c,12,a[1]),C=l(C,E,x,P,f,17,a[2]),P=l(P,C,E,x,p,22,a[3]),x=l(x,P,C,E,g,7,a[4]),E=l(E,x,P,C,m,12,a[5]),C=l(C,E,x,P,y,17,a[6]),P=l(P,C,E,x,_,22,a[7]),x=l(x,P,C,E,w,7,a[8]),E=l(E,x,P,C,v,12,a[9]),C=l(C,E,x,P,k,17,a[10]),P=l(P,C,E,x,b,22,a[11]),x=l(x,P,C,E,I,7,a[12]),E=l(E,x,P,C,A,12,a[13]),C=l(C,E,x,P,S,17,a[14]),x=u(x,P=l(P,C,E,x,T,22,a[15]),C,E,c,5,a[16]),E=u(E,x,P,C,y,9,a[17]),C=u(C,E,x,P,b,14,a[18]),P=u(P,C,E,x,r,20,a[19]),x=u(x,P,C,E,m,5,a[20]),E=u(E,x,P,C,k,9,a[21]),C=u(C,E,x,P,T,14,a[22]),P=u(P,C,E,x,g,20,a[23]),x=u(x,P,C,E,v,5,a[24]),E=u(E,x,P,C,S,9,a[25]),C=u(C,E,x,P,p,14,a[26]),P=u(P,C,E,x,w,20,a[27]),x=u(x,P,C,E,A,5,a[28]),E=u(E,x,P,C,f,9,a[29]),C=u(C,E,x,P,_,14,a[30]),x=h(x,P=u(P,C,E,x,I,20,a[31]),C,E,m,4,a[32]),E=h(E,x,P,C,w,11,a[33]),C=h(C,E,x,P,b,16,a[34]),P=h(P,C,E,x,S,23,a[35]),x=h(x,P,C,E,c,4,a[36]),E=h(E,x,P,C,g,11,a[37]),C=h(C,E,x,P,_,16,a[38]),P=h(P,C,E,x,k,23,a[39]),x=h(x,P,C,E,A,4,a[40]),E=h(E,x,P,C,r,11,a[41]),C=h(C,E,x,P,p,16,a[42]),P=h(P,C,E,x,y,23,a[43]),x=h(x,P,C,E,v,4,a[44]),E=h(E,x,P,C,I,11,a[45]),C=h(C,E,x,P,T,16,a[46]),x=d(x,P=h(P,C,E,x,f,23,a[47]),C,E,r,6,a[48]),E=d(E,x,P,C,_,10,a[49]),C=d(C,E,x,P,S,15,a[50]),P=d(P,C,E,x,m,21,a[51]),x=d(x,P,C,E,I,6,a[52]),E=d(E,x,P,C,p,10,a[53]),C=d(C,E,x,P,k,15,a[54]),P=d(P,C,E,x,c,21,a[55]),x=d(x,P,C,E,w,6,a[56]),E=d(E,x,P,C,T,10,a[57]),C=d(C,E,x,P,y,15,a[58]),P=d(P,C,E,x,A,21,a[59]),x=d(x,P,C,E,g,6,a[60]),E=d(E,x,P,C,b,10,a[61]),C=d(C,E,x,P,f,15,a[62]),P=d(P,C,E,x,v,21,a[63]),i[0]=i[0]+x|0,i[1]=i[1]+P|0,i[2]=i[2]+C|0,i[3]=i[3]+E|0},_doFinalize:function(){var t=this._data,s=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;s[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),r=n;s[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),s[14+(o+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(s.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,s,n,o,i,r){var a=e+(t&s|~t&n)+o+r;return(a<<i|a>>>32-i)+t}function u(e,t,s,n,o,i,r){var a=e+(t&n|s&~n)+o+r;return(a<<i|a>>>32-i)+t}function h(e,t,s,n,o,i,r){var a=e+(t^s^n)+o+r;return(a<<i|a>>>32-i)+t}function d(e,t,s,n,o,i,r){var a=e+(s^(t|~n))+o+r;return(a<<i|a>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),s.MD5)})),ge((function(e,t){var s,n,o;e.exports=(n=(s=ye).lib.Base,o=s.enc.Utf8,void(s.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var s=e.blockSize,n=4*s;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),r=this._iKey=t.clone(),a=i.words,c=r.words,l=0;l<s;l++)a[l]^=1549556828,c[l]^=909522486;i.sigBytes=r.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,s=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(s))}})))})),ge((function(e,t){e.exports=ye.HmacMD5}))),we=ge((function(e,t){e.exports=ye.enc.Utf8})),ve=ge((function(e,t){var s,n,o;e.exports=(o=(n=s=ye).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,s=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<s;i+=3)for(var r=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<s;a++)o.push(n.charAt(r>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,s=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i<s.length;i++)n[s.charCodeAt(i)]=i}var r=s.charAt(64);if(r){var a=e.indexOf(r);-1!==a&&(t=a)}return function(e,t,s){for(var n=[],i=0,r=0;r<t;r++)if(r%4){var a=s[e.charCodeAt(r-1)]<<r%4*2,c=s[e.charCodeAt(r)]>>>6-r%4*2;n[i>>>2]|=(a|c)<<24-i%4*8,i++}return o.create(n,i)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},s.enc.Base64)}));const ke="FUNCTION",be="pending",Ie="rejected";function Ae(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function Se(e){return"object"===Ae(e)}function Te(e){return"function"==typeof e}function xe(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const Pe="REJECTED",Ce="NOT_PENDING";class Ee{constructor({createPromise:e,retryRule:t=Pe}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case Pe:return this.status===Ie;case Ce:return this.status!==be}}exec(){return this.needRetry?(this.status=be,this.promise=this.createPromise().then((e=>(this.status="fullfilled",Promise.resolve(e))),(e=>(this.status=Ie,Promise.reject(e)))),this.promise):this.promise}}function De(e){return e&&"string"==typeof e?JSON.parse(e):e}const Re=De([]);De("");const Oe=De("[]")||[];let Le="";try{Le="__UNI__5D58372"}catch(At){}let Ue={};function Ne(e,t={}){var s,n;return s=Ue,n=e,Object.prototype.hasOwnProperty.call(s,n)||(Ue[e]=t),Ue[e]}const Me=["invoke","success","fail","complete"],Fe=Ne("_globalUniCloudInterceptor");function je(e,t){Fe[e]||(Fe[e]={}),Se(t)&&Object.keys(t).forEach((s=>{Me.indexOf(s)>-1&&function(e,t,s){let n=Fe[e][t];n||(n=Fe[e][t]=[]),-1===n.indexOf(s)&&Te(s)&&n.push(s)}(e,s,t[s])}))}function Be(e,t){Fe[e]||(Fe[e]={}),Se(t)?Object.keys(t).forEach((s=>{Me.indexOf(s)>-1&&function(e,t,s){const n=Fe[e][t];if(!n)return;const o=n.indexOf(s);o>-1&&n.splice(o,1)}(e,s,t[s])})):delete Fe[e]}function qe(e,t){return e&&0!==e.length?e.reduce(((e,s)=>e.then((()=>s(t)))),Promise.resolve()):Promise.resolve()}function Je(e,t){return Fe[e]&&Fe[e][t]||[]}function Ve(e){je("callObject",e)}const Ke=Ne("_globalUniCloudListener"),We="response",ze="needLogin",He="refreshToken",Ge="clientdb",Ye="cloudfunction",Qe="cloudobject";function Ze(e){return Ke[e]||(Ke[e]=[]),Ke[e]}function $e(e,t){const s=Ze(e);s.includes(t)||s.push(t)}function Xe(e,t){const s=Ze(e),n=s.indexOf(t);-1!==n&&s.splice(n,1)}function et(e,t){const s=Ze(e);for(let n=0;n<s.length;n++)(0,s[n])(t)}let tt,st=!1;function nt(){return tt||(tt=new Promise((e=>{st&&e(),function t(){if("function"==typeof n){const t=n();t&&t[0]&&(st=!0,e())}st||setTimeout((()=>{t()}),30)}()})),tt)}function ot(e){const t={};for(const s in e){const n=e[s];Te(n)&&(t[s]=xe(n))}return t}class it extends Error{constructor(e){super(e.message),this.errMsg=e.message||e.errMsg||"unknown system error",this.code=this.errCode=e.code||e.errCode||"SYSTEM_ERROR",this.errSubject=this.subject=e.subject||e.errSubject,this.cause=e.cause,this.requestId=e.requestId}toJson(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJson?this.cause.toJson(e):this.cause}}}var rt={request:e=>d(e),uploadFile:e=>f(e),setStorageSync:(e,t)=>p(e,t),getStorageSync:e=>g(e),removeStorageSync:e=>m(e),clearStorageSync:()=>y()};function at(e){return e&&at(e.__v_raw)||e}function ct(){return{token:rt.getStorageSync("uni_id_token")||rt.getStorageSync("uniIdToken"),tokenExpired:rt.getStorageSync("uni_id_token_expired")}}function lt({token:e,tokenExpired:t}={}){e&&rt.setStorageSync("uni_id_token",e),t&&rt.setStorageSync("uni_id_token_expired",t)}let ut,ht;function dt(){return ut||(ut=_()),ut}function ft(){let e,t;try{if(T){if(T.toString().indexOf("not yet implemented")>-1)return;const{scene:s,channel:n}=T();e=n,t=s}}catch(s){}return{channel:e,scene:t}}function pt(){const e=S&&S()||"en";if(ht)return{...ht,locale:e,LOCALE:e};const t=dt(),{deviceId:s,osName:n,uniPlatform:o,appId:i}=t,r=["pixelRatio","brand","model","system","language","version","platform","host","SDKVersion","swanNativeVersion","app","AppPlatform","fontSizeSetting"];for(let a=0;a<r.length;a++)delete t[r[a]];return ht={PLATFORM:o,OS:n,APPID:i,DEVICEID:s,...ft(),...t},{...ht,locale:e,LOCALE:e}}var gt=function(e,t){let s="";return Object.keys(e).sort().forEach((function(t){e[t]&&(s=s+"&"+t+"="+e[t])})),s=s.slice(1),_e(s,t).toString()},mt=function(e,t){return new Promise(((s,n)=>{t(Object.assign(e,{complete(e){e||(e={});const t=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400)return n(new it({code:"SYS_ERR",message:e.errMsg||"request:fail",requestId:t}));const o=e.data;if(o.error)return n(new it({code:o.error.code,message:o.error.message,requestId:t}));o.result=o.data,o.requestId=t,delete o.data,s(o)}}))}))},yt=function(e){return ve.stringify(we.parse(e))},_t={"uniCloud.init.paramRequired":"{param} required","uniCloud.uploadFile.fileError":"filePath should be instance of File"};const{t:wt}=e({"zh-Hans":{"uniCloud.init.paramRequired":"缺少参数:{param}","uniCloud.uploadFile.fileError":"filePath应为File对象"},"zh-Hant":{"uniCloud.init.paramRequired":"缺少参数:{param}","uniCloud.uploadFile.fileError":"filePath应为File对象"},en:_t,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:_t},"zh-Hans");var vt=class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(wt("uniCloud.init.paramRequired",{param:t}))})),this.config=Object.assign({},{endpoint:0===e.spaceId.indexOf("mp-")?"https://api.next.bspapp.com":"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=rt,this._getAccessTokenPromiseHub=new Ee({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new it({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:Ce})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return mt(e,this.adapter.request)}requestAuth(e){return this.requestWrapped(e)}request(e,t){return Promise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>new Promise(((e,s)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?s(t):e()})).then((()=>this.getAccessToken())).then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)})))):this.getAccessToken().then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)}))))}rebuildRequest(e){const t=Object.assign({},e);return t.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=gt(t.data,this.config.clientSecret),t}setupRequest(e,t){const s=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};return"auth"!==t&&(s.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=gt(s,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:s,dataType:"json",header:n}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request(this.setupRequest(t))}getOSSUploadOptionsFromPath(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:s,filePath:n,fileType:o,onUploadProgress:i}){return new Promise(((r,a)=>{const c=this.adapter.uploadFile({url:e,formData:t,name:s,filePath:n,fileType:o,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?r(e):a(new it({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(new it({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof i&&c&&"function"==typeof c.onProgressUpdate&&c.onProgressUpdate((e=>{i({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}async uploadFile({filePath:e,cloudPath:t,fileType:s="image",cloudPathAsRealPath:n=!1,onUploadProgress:o,config:i}){if("string"!==Ae(t))throw new it({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new it({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new it({code:"INVALID_PARAM",message:"cloudPath不合法"});const r=i&&i.envType||this.config.envType;if(n&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new it({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const a=(await this.getOSSUploadOptionsFromPath({env:r,filename:n?t.split("/").pop():t,fileId:n?t:void 0})).result,c="https://"+a.cdnDomain+"/"+a.ossPath,{securityToken:l,accessKeyId:u,signature:h,host:d,ossPath:f,id:p,policy:g,ossCallbackUrl:m}=a,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:h,host:d,id:p,key:f,policy:g,success_action_status:200};if(l&&(y["x-oss-security-token"]=l),m){const e=JSON.stringify({callbackUrl:m,callbackBody:JSON.stringify({fileId:p,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=yt(e)}const _={url:"https://"+a.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:s};if(await this.uploadFileToOSS(Object.assign({},_,{onUploadProgress:o})),m)return{success:!0,filePath:e,fileID:c};if((await this.reportOSSUpload({id:p})).success)return{success:!0,filePath:e,fileID:c};throw new it({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,s)=>{Array.isArray(e)&&0!==e.length||s(new it({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}async getFileInfo({fileList:e}={}){if(!Array.isArray(e)||0===e.length)throw new it({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.info",params:JSON.stringify({id:e.map((e=>e.split("?")[0])).join(",")})};return{fileList:(await this.request(this.setupRequest(t))).result}}},kt={init(e){const t=new vt(e),s={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return s},t.customAuth=t.auth,t}};const bt="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var It,At;(At=It||(It={})).local="local",At.none="none",At.session="session";var St=function(){};const Tt=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new it({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}const t=new Promise(((t,s)=>{e=(e,n)=>e?s(e):t(n)}));return e.promise=t,e};function xt(e){return void 0===e}function Pt(e){return"[object Null]"===Object.prototype.toString.call(e)}var Ct;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(Ct||(Ct={}));const Et={adapter:null,runtime:void 0},Dt=["anonymousUuidKey"];class Rt extends St{constructor(){super(),Et.adapter.root.tcbObject||(Et.adapter.root.tcbObject={})}setItem(e,t){Et.adapter.root.tcbObject[e]=t}getItem(e){return Et.adapter.root.tcbObject[e]}removeItem(e){delete Et.adapter.root.tcbObject[e]}clear(){delete Et.adapter.root.tcbObject}}function Ot(e,t){switch(e){case"local":return t.localStorage||new Rt;case"none":return new Rt;default:return t.sessionStorage||new Rt}}class Lt{constructor(e){if(!this._storage){this._persistence=Et.adapter.primaryStorage||e.persistence,this._storage=Ot(this._persistence,Et.adapter);const t=`access_token_${e.env}`,s=`access_token_expire_${e.env}`,n=`refresh_token_${e.env}`,o=`anonymous_uuid_${e.env}`,i=`login_type_${e.env}`,r=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:s,refreshTokenKey:n,anonymousUuidKey:o,loginTypeKey:i,userInfoKey:r}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const s=Ot(e,Et.adapter);for(const n in this.keys){const e=this.keys[n];if(t&&Dt.includes(n))continue;const o=this._storage.getItem(e);xt(o)||Pt(o)||(s.setItem(e,o),this._storage.removeItem(e))}this._storage=s}setStore(e,t,s){if(!this._storage)return;const n={version:s||"localCachev1",content:t},o=JSON.stringify(n);try{this._storage.setItem(e,o)}catch(i){throw i}}getStore(e,t){try{if(!this._storage)return}catch(n){return""}t=t||"localCachev1";const s=this._storage.getItem(e);return s&&s.indexOf(t)>=0?JSON.parse(s).content:""}removeStore(e){this._storage.removeItem(e)}}const Ut={},Nt={};function Mt(e){return Ut[e]}class Ft{constructor(e,t){this.data=t||null,this.name=e}}class jt extends Ft{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Bt=new class{constructor(){this._listeners={}}on(e,t){return s=e,n=t,(o=this._listeners)[s]=o[s]||[],o[s].push(n),this;var s,n,o}off(e,t){return function(e,t,s){if(s&&s[e]){const n=s[e].indexOf(t);-1!==n&&s[e].splice(n,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof jt)return console.error(e.error),this;const s="string"==typeof e?new Ft(e,t||{}):e,n=s.name;if(this._listens(n)){s.target=this;const e=this._listeners[n]?[...this._listeners[n]]:[];for(const t of e)t.call(this,s)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function qt(e,t){Bt.on(e,t)}function Jt(e,t={}){Bt.fire(e,t)}function Vt(e,t){Bt.off(e,t)}const Kt="loginStateChanged",Wt="loginStateExpire",zt="loginTypeChanged",Ht="anonymousConverted",Gt="refreshAccessToken";var Yt;!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"}(Yt||(Yt={}));const Qt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Zt={"X-SDK-Version":"1.3.5"};function $t(e,t,s){const n=e[t];e[t]=function(t){const o={},i={};s.forEach((s=>{const{data:n,headers:r}=s.call(e,t);Object.assign(o,n),Object.assign(i,r)}));const r=t.data;return r&&(()=>{var e;if(e=r,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...r,...o};else for(const t in o)r.append(t,o[t])})(),t.headers={...t.headers||{},...i},n.call(e,t)}}function Xt(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Zt,"x-seqid":e}}}class es{constructor(e={}){var t;this.config=e,this._reqClass=new Et.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=Mt(this.config.env),this._localCache=(t=this.config.env,Nt[t]),$t(this._reqClass,"post",[Xt]),$t(this._reqClass,"upload",[Xt]),$t(this._reqClass,"download",[Xt])}async post(e){return await this._reqClass.post(e)}async upload(e){return await this._reqClass.upload(e)}async download(e){return await this._reqClass.download(e)}async refreshAccessToken(){let e,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=await this._refreshAccessTokenPromise}catch(s){t=s}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:s,loginTypeKey:n,anonymousUuidKey:o}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let i=this._cache.getStore(s);if(!i)throw new it({message:"未登录CloudBase"});const r={refresh_token:i},a=await this.request("auth.fetchAccessTokenWithRefreshToken",r);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(n)===Yt.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(o),t=this._cache.getStore(s),n=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(n.refresh_token),this._refreshAccessToken()}Jt(Wt),this._cache.removeStore(s)}throw new it({code:a.data.code,message:`刷新access token失败:${a.data.code}`})}if(a.data.access_token)return Jt(Gt),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(s),this._cache.setStore(s,a.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:s}=this._cache.keys;if(!this._cache.getStore(s))throw new it({message:"refresh token不存在,登录状态异常"});let n=this._cache.getStore(e),o=this._cache.getStore(t),i=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(n,o))&&(i=!1),(!n||!o||o<Date.now())&&i?this.refreshAccessToken():{accessToken:n,accessTokenExpire:o}}async request(e,t,s){const n=`x-tcb-trace_${this.config.env}`;let o="application/x-www-form-urlencoded";const i={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===Qt.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(i.access_token=(await this.getAccessToken()).accessToken)}let r;if("storage.uploadFile"===e){r=new FormData;for(let e in r)r.hasOwnProperty(e)&&void 0!==r[e]&&r.append(e,i[e]);o="multipart/form-data"}else{o="application/json",r={};for(let e in i)void 0!==i[e]&&(r[e]=i[e])}let a={headers:{"content-type":o}};s&&s.onUploadProgress&&(a.onUploadProgress=s.onUploadProgress);const c=this._localCache.getStore(n);c&&(a.headers["X-TCB-Trace"]=c);const{parse:l,inQuery:u,search:h}=t;let d={env:this.config.env};l&&(d.parse=!0),u&&(d={...u,...d});let f=function(e,t,s={}){const n=/\?/.test(t);let o="";for(let i in s)""===o?!n&&(t+="?"):o+="&",o+=`${i}=${encodeURIComponent(s[i])}`;return/^http(s)?\:\/\//.test(t+=o)?t:`${e}${t}`}(bt,"//tcb-api.tencentcloudapi.com/web",d);h&&(f+=h);const p=await this.post({url:f,data:r,...a}),g=p.header&&p.header["x-tcb-trace"];if(g&&this._localCache.setStore(n,g),200!==Number(p.status)&&200!==Number(p.statusCode)||!p.data)throw new it({code:"NETWORK_ERROR",message:"network request error"});return p}async send(e,t={}){const s=await this.request(e,t,{onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===s.data.code&&-1===Qt.indexOf(e)){await this.refreshAccessToken();const s=await this.request(e,t,{onUploadProgress:t.onUploadProgress});if(s.data.code)throw new it({code:s.data.code,message:s.data.message});return s.data}if(s.data.code)throw new it({code:s.data.code,message:s.data.message});return s.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:s,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(s),this._cache.setStore(n,e)}}const ts={};function ss(e){return ts[e]}class ns{constructor(e){this.config=e,this._cache=Mt(e.env),this._request=ss(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:s,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(s),this._cache.setStore(n,e)}setAccessToken(e,t){const{accessTokenKey:s,accessTokenExpireKey:n}=this._cache.keys;this._cache.setStore(s,e),this._cache.setStore(n,t)}async refreshUserInfo(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}class os{constructor(e){if(!e)throw new it({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Mt(this._envId),this._request=ss(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new it({code:"PARAM_ERROR",message:"ticket must be string"});return this._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){return this._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if("string"!=typeof e)throw new it({code:"PARAM_ERROR",message:"username must be a string"});return this._request.send("auth.updateUsername",{username:e})}async getLinkedUidList(){const{data:e}=await this._request.send("auth.getLinkedUidList",{});let t=!1;const{users:s}=e;return s.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:s,hasPrimaryUid:t}}setPrimaryUid(e){return this._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){return this._request.send("auth.unlink",{platform:e})}async update(e){const{nickName:t,gender:s,avatarUrl:n,province:o,country:i,city:r}=e,{data:a}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:s,avatarUrl:n,province:o,country:i,city:r});this.setLocalUserInfo(a)}async refresh(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.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()}}class is{constructor(e){if(!e)throw new it({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Mt(e);const{refreshTokenKey:t,accessTokenKey:s,accessTokenExpireKey:n}=this._cache.keys,o=this._cache.getStore(t),i=this._cache.getStore(s),r=this._cache.getStore(n);this.credential={refreshToken:o,accessToken:i,accessTokenExpire:r},this.user=new os(e)}get isAnonymousAuth(){return this.loginType===Yt.ANONYMOUS}get isCustomAuth(){return this.loginType===Yt.CUSTOM}get isWeixinAuth(){return this.loginType===Yt.WECHAT||this.loginType===Yt.WECHAT_OPEN||this.loginType===Yt.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class rs extends ns{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,s=this._cache.getStore(e)||void 0,n=this._cache.getStore(t)||void 0,o=await this._request.send("auth.signInAnonymously",{anonymous_uuid:s,refresh_token:n});if(o.uuid&&o.refresh_token){this._setAnonymousUUID(o.uuid),this.setRefreshToken(o.refresh_token),await this._request.refreshAccessToken(),Jt(Kt),Jt(zt,{env:this.config.env,loginType:Yt.ANONYMOUS,persistence:"local"});const e=new is(this.config.env);return await e.user.refresh(),e}throw new it({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:s}=this._cache.keys,n=this._cache.getStore(t),o=this._cache.getStore(s),i=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:n,refresh_token:o,ticket:e});if(i.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(i.refresh_token),await this._request.refreshAccessToken(),Jt(Ht,{env:this.config.env}),Jt(zt,{loginType:Yt.CUSTOM,persistence:"local"}),{credential:{refreshToken:i.refresh_token}};throw new it({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(s,Yt.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class as extends ns{async signIn(e){if("string"!=typeof e)throw new it({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,s=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(s.refresh_token)return this.setRefreshToken(s.refresh_token),await this._request.refreshAccessToken(),Jt(Kt),Jt(zt,{env:this.config.env,loginType:Yt.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new is(this.config.env);throw new it({message:"自定义登录失败"})}}class cs extends ns{async signIn(e,t){if("string"!=typeof e)throw new it({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:s}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(s)||""}),{refresh_token:o,access_token:i,access_token_expire:r}=n;if(o)return this.setRefreshToken(o),i&&r?this.setAccessToken(i,r):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Jt(Kt),Jt(zt,{env:this.config.env,loginType:Yt.EMAIL,persistence:this.config.persistence}),new is(this.config.env);throw n.code?new it({code:n.code,message:`邮箱登录失败: ${n.message}`}):new it({message:"邮箱登录失败"})}async activate(e){return this._request.send("auth.activateEndUserMail",{token:e})}async resetPasswordWithToken(e,t){return this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class ls extends ns{async signIn(e,t){if("string"!=typeof e)throw new it({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:s}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:Yt.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(s)||""}),{refresh_token:o,access_token_expire:i,access_token:r}=n;if(o)return this.setRefreshToken(o),r&&i?this.setAccessToken(r,i):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Jt(Kt),Jt(zt,{env:this.config.env,loginType:Yt.USERNAME,persistence:this.config.persistence}),new is(this.config.env);throw n.code?new it({code:n.code,message:`用户名密码登录失败: ${n.message}`}):new it({message:"用户名密码登录失败"})}}class us{constructor(e){this.config=e,this._cache=Mt(e.env),this._request=ss(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),qt(zt,this._onLoginTypeChanged)}get currentUser(){const e=this.hasLoginState();return e&&e.user||null}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){return new rs(this.config)}customAuthProvider(){return new as(this.config)}emailAuthProvider(){return new cs(this.config)}usernameAuthProvider(){return new ls(this.config)}async signInAnonymously(){return new rs(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new cs(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new ls(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new rs(this.config)),qt(Ht,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Yt.ANONYMOUS)throw new it({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:s}=this._cache.keys,n=this._cache.getStore(e);if(!n)return;const o=await this._request.send("auth.logout",{refresh_token:n});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(s),Jt(Kt),Jt(zt,{env:this.config.env,loginType:Yt.NULL,persistence:this.config.persistence}),o}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){qt(Kt,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){qt(Wt,e.bind(this))}onAccessTokenRefreshed(e){qt(Gt,e.bind(this))}onAnonymousConverted(e){qt(Ht,e.bind(this))}onLoginTypeChanged(e){qt(zt,(()=>{const t=this.hasLoginState();e.call(this,t)}))}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{refreshTokenKey:e}=this._cache.keys;return this._cache.getStore(e)?new is(this.config.env):null}async isUsernameRegistered(e){if("string"!=typeof e)throw new it({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=await this._request.send("auth.isUsernameRegistered",{username:e});return t&&t.isRegistered}getLoginState(){return Promise.resolve(this.hasLoginState())}async signInWithTicket(e){return new as(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){return this._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,s=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+s}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:s,env:n}=e.data;n===this.config.env&&(this._cache.updatePersistence(s),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const hs=function(e,t){t=t||Tt();const s=ss(this.config.env),{cloudPath:n,filePath:o,onUploadProgress:i,fileType:r="image"}=e;return s.send("storage.getUploadMetadata",{path:n}).then((e=>{const{data:{url:a,authorization:c,token:l,fileId:u,cosFileId:h},requestId:d}=e,f={key:n,signature:c,"x-cos-meta-fileid":h,success_action_status:"201","x-cos-security-token":l};s.upload({url:a,data:f,file:o,name:n,fileType:r,onUploadProgress:i}).then((e=>{201===e.statusCode?t(null,{fileID:u,requestId:d}):t(new it({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},ds=function(e,t){t=t||Tt();const s=ss(this.config.env),{cloudPath:n}=e;return s.send("storage.getUploadMetadata",{path:n}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},fs=function({fileList:e},t){if(t=t||Tt(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let n of e)if(!n||"string"!=typeof n)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const s={fileid_list:e};return ss(this.config.env).send("storage.batchDeleteFile",s).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},ps=function({fileList:e},t){t=t||Tt(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let s=[];for(let o of e)"object"==typeof o?(o.hasOwnProperty("fileID")&&o.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),s.push({fileid:o.fileID,max_age:o.maxAge})):"string"==typeof o?s.push({fileid:o}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const n={file_list:s};return ss(this.config.env).send("storage.batchGetDownloadUrl",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},gs=async function({fileID:e},t){const s=(await ps.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==s.code)return t?t(s):new Promise((e=>{e(s)}));const n=ss(this.config.env);let o=s.download_url;if(o=encodeURI(o),!t)return n.download({url:o});t(await n.download({url:o}))},ms=function({name:e,data:t,query:s,parse:n,search:o},i){const r=i||Tt();let a;try{a=t?JSON.stringify(t):""}catch(l){return Promise.reject(l)}if(!e)return Promise.reject(new it({code:"PARAM_ERROR",message:"函数名不能为空"}));const c={inQuery:s,parse:n,search:o,function_name:e,request_data:a};return ss(this.config.env).send("functions.invokeFunction",c).then((e=>{if(e.code)r(null,e);else{let s=e.data.response_data;if(n)r(null,{result:s,requestId:e.requestId});else try{s=JSON.parse(e.data.response_data),r(null,{result:s,requestId:e.requestId})}catch(t){r(new it({message:"response data must be json"}))}}return r.promise})).catch((e=>{r(e)})),r.promise},ys={timeout:15e3,persistence:"session"},_s={};class ws{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(Et.adapter||(this.requestClient=new Et.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...ys,...e},!0){case this.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new ws(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||Et.adapter.primaryStorage||ys.persistence;var s;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;Ut[t]=new Lt(e),Nt[t]=new Lt({...e,persistence:"local"})}(this.config),s=this.config,ts[s.env]=new es(s),this.authObj=new us(this.config),this.authObj}on(e,t){return qt.apply(this,[e,t])}off(e,t){return Vt.apply(this,[e,t])}callFunction(e,t){return ms.apply(this,[e,t])}deleteFile(e,t){return fs.apply(this,[e,t])}getTempFileURL(e,t){return ps.apply(this,[e,t])}downloadFile(e,t){return gs.apply(this,[e,t])}uploadFile(e,t){return hs.apply(this,[e,t])}getUploadMetadata(e,t){return ds.apply(this,[e,t])}registerExtension(e){_s[e.name]=e}async invokeExtension(e,t){const s=_s[e];if(!s)throw new it({message:`扩展${e} 必须先注册`});return await s.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:s}=function(e){const t=(s=e,"[object Array]"===Object.prototype.toString.call(s)?e:[e]);var s;for(const n of t){const{isMatch:e,genAdapter:t,runtime:s}=n;if(e())return{adapter:t(),runtime:s}}}(e)||{};t&&(Et.adapter=t),s&&(Et.runtime=s)}}var vs=new ws;function ks(e,t,s){void 0===s&&(s={});var n=/\?/.test(t),o="";for(var i in s)""===o?!n&&(t+="?"):o+="&",o+=i+"="+encodeURIComponent(s[i]);return/^http(s)?:\/\//.test(t+=o)?t:""+e+t}class bs{post(e){const{url:t,data:s,headers:n}=e;return new Promise(((e,o)=>{rt.request({url:ks("https:",t),data:s,method:"POST",header:n,success(t){e(t)},fail(e){o(e)}})}))}upload(e){return new Promise(((t,s)=>{const{url:n,file:o,data:i,headers:r,fileType:a}=e,c=rt.uploadFile({url:ks("https:",n),name:"file",formData:Object.assign({},i),filePath:o,fileType:a,header:r,success(e){const s={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&i.success_action_status&&(s.statusCode=parseInt(i.success_action_status,10)),t(s)},fail(e){s(new Error(e.errMsg||"uploadFile:fail"))}});"function"==typeof e.onUploadProgress&&c&&"function"==typeof c.onProgressUpdate&&c.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}const Is={setItem(e,t){rt.setStorageSync(e,t)},getItem:e=>rt.getStorageSync(e),removeItem(e){rt.removeStorageSync(e)},clear(){rt.clearStorageSync()}};var As={genAdapter:function(){return{root:{},reqClass:bs,localStorage:Is,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};vs.useAdapters(As);const Ss=vs,Ts=Ss.init;Ss.init=function(e){e.env=e.spaceId;const t=Ts.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const s=t.auth;return t.auth=function(e){const t=s.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var s;t[e]=(s=t[e],function(e){e=e||{};const{success:t,fail:n,complete:o}=ot(e);if(!(t||n||o))return s.call(this,e);s.call(this,e).then((e=>{t&&t(e),o&&o(e)}),(e=>{n&&n(e),o&&o(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var xs=Ss,Ps=class extends vt{getAccessToken(){return new Promise(((e,t)=>{const s="Anonymous_Access_token";this.setAccessToken(s),e(s)}))}setupRequest(e,t){const s=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};"auth"!==t&&(s.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=gt(s,this.config.clientSecret);const o=pt();n["x-client-info"]=encodeURIComponent(JSON.stringify(o));const{token:i}=ct();return n["x-client-token"]=i,{url:this.config.requestUrl,method:"POST",data:s,dataType:"json",header:JSON.parse(JSON.stringify(n))}}uploadFileToOSS({url:e,formData:t,name:s,filePath:n,fileType:o,onUploadProgress:i}){return new Promise(((r,a)=>{const c=this.adapter.uploadFile({url:e,formData:t,name:s,filePath:n,fileType:o,success(e){e&&e.statusCode<400?r(e):a(new it({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(new it({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof i&&c&&"function"==typeof c.onProgressUpdate&&c.onProgressUpdate((e=>{i({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}uploadFile({filePath:e,cloudPath:t,fileType:s="image",onUploadProgress:n}){if(!t)throw new it({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let o;return this.getOSSUploadOptionsFromPath({cloudPath:t}).then((t=>{const{url:i,formData:r,name:a}=t.result;o=t.result.fileUrl;const c={url:i,formData:r,name:a,filePath:e,fileType:s};return this.uploadFileToOSS(Object.assign({},c,{onUploadProgress:n}))})).then((()=>this.reportOSSUpload({cloudPath:t}))).then((t=>new Promise(((s,n)=>{t.success?s({success:!0,filePath:e,fileID:o}):n(new it({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(this.setupRequest(t)).then((e=>{if(e.success)return e.result;throw new it({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e}={}){if(!Array.isArray(e)||0===e.length)throw new it({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e})};return this.request(this.setupRequest(t)).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new it({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}},Cs={init(e){const t=new Ps(e),s={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return s},t.customAuth=t.auth,t}};function Es({data:e}){let t;t=pt();const s=JSON.parse(JSON.stringify(e||{}));if(Object.assign(s,{clientInfo:t}),!s.uniIdToken){const{token:e}=ct();e&&(s.uniIdToken=e)}return s}const Ds=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Rs=/[\\^$.*+?()[\]{}|]/g,Os=RegExp(Rs.source);function Ls(e,t,s){return e.replace(new RegExp((n=t)&&Os.test(n)?n.replace(Rs,"\\$&"):n,"g"),s);var n}const Us=2e4,Ns={code:20101,message:"Invalid client"};function Ms(e){const{errSubject:t,subject:s,errCode:n,errMsg:o,code:i,message:r,cause:a}=e||{};return new it({subject:t||s||"uni-secure-network",code:n||i||Us,message:o||r,cause:a})}let Fs;function js({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function Bs({functionName:e,result:t,logPvd:s}){}function qs(e){const t=e.callFunction,s=function(s){const n=s.name;s.data=Es.call(e,{data:s.data});const o={aliyun:"aliyun",tencent:"tcb",tcb:"tcb"}[this.config.provider],i=js(s)||false;return t.call(this,s).then((e=>(e.errCode=0,!i&&Bs.call(this,{functionName:n,result:e,logPvd:o}),Promise.resolve(e))),(e=>(!i&&Bs.call(this,{functionName:n,result:e,logPvd:o}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:s=[]}={}){for(let n=0;n<s.length;n++){const{rule:o,content:i,mode:r}=s[n],a=e.match(o);if(!a)continue;let c=i;for(let e=1;e<a.length;e++)c=Ls(c,`{$${e}}`,a[e]);for(const e in t)c=Ls(c,`{${e}}`,t[e]);return"replace"===r?c:e+c}return e}({message:`[${s.name}]: ${e.message}`,formatter:Ds,extraInfo:{functionName:n}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:n,spaceId:o}=e.config,i=t.name;let r,a;return t.data=t.data||{},r=s,r=r.bind(e),a=js(t)?new Fs({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(s.bind(e))(t):function({provider:e,spaceId:t,functionName:s}={}){const{appId:n,uniPlatform:o,osName:i}=dt();let r=o;"app"===o&&(r=i);const a=function({provider:e,spaceId:t}={}){if(!Re)return{};var s;e="tencent"===(s=e)?"tcb":s;const n=Re.find((s=>s.provider===e&&s.spaceId===t));return n&&n.config}({provider:e,spaceId:t});if(!a||!a.accessControl||!a.accessControl.enable)return!1;const c=a.accessControl.function||{},l=Object.keys(c);if(0===l.length)return!0;const u=function(e,t){let s,n,o;for(let i=0;i<e.length;i++){const r=e[i];r!==t?"*"!==r?r.split(",").map((e=>e.trim())).indexOf(t)>-1&&(n=r):o=r:s=r}return s||n||o}(l,s);if(!u)return!1;if((c[u]||[]).find(((e={})=>e.appId===n&&(e.platform||"").toLowerCase()===r.toLowerCase())))return!0;throw console.error(`此应用[appId: ${n}, platform: ${r}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),Ms(Ns)}({provider:n,spaceId:o,functionName:i})?new Fs({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(s.bind(e))(t):r(t),Object.defineProperty(a,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),a}}Fs=class{constructor(){throw Ms({message:"Platform web is not supported by secure network"})}};const Js=Symbol("CLIENT_DB_INTERNAL");function Vs(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=Js,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,s,n){if("_uniClient"===s)return null;if("symbol"==typeof s)return e[s];if(s in e||"string"!=typeof s){const t=e[s];return"function"==typeof t?t.bind(e):t}return t.get(e,s,n)}})}function Ks(e){return{on:(t,s)=>{e[t]=e[t]||[],e[t].indexOf(s)>-1||e[t].push(s)},off:(t,s)=>{e[t]=e[t]||[];const n=e[t].indexOf(s);-1!==n&&e[t].splice(n,1)}}}const Ws=["db.Geo","db.command","command.aggregate"];function zs(e,t){return Ws.indexOf(`${e}.${t}`)>-1}function Hs(e){switch(Ae(e=at(e))){case"array":return e.map((e=>Hs(e)));case"object":return e._internalType===Js||Object.keys(e).forEach((t=>{e[t]=Hs(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function Gs(e){return e&&e.content&&e.content.$method}class Ys{constructor(e,t,s){this.content=e,this.prevStage=t||null,this.udb=null,this._database=s}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:Hs(e.$param)})))}}toString(){return JSON.stringify(this.toJSON())}getAction(){const e=this.toJSON().$db.find((e=>"action"===e.$method));return e&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}get isAggregate(){let e=this;for(;e;){const t=Gs(e),s=Gs(e.prevStage);if("aggregate"===t&&"collection"===s||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===Gs(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=Gs(e),s=Gs(e.prevStage);if("aggregate"===t&&"command"===s)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return Qs({$method:e,$param:Hs(Array.from(arguments))},t,t._database)}}get count(){return this.isAggregate?this.getNextStageFn("count"):function(){return this._send("count",Array.from(arguments))}}get remove(){return this.isCommand?this.getNextStageFn("remove"):function(){return this._send("remove",Array.from(arguments))}}get(){return this._send("get",Array.from(arguments))}get add(){return this.isCommand?this.getNextStageFn("add"):function(){return this._send("add",Array.from(arguments))}}update(){return this._send("update",Array.from(arguments))}end(){return this._send("end",Array.from(arguments))}get set(){return this.isCommand?this.getNextStageFn("set"):function(){throw new Error("JQL禁止使用set方法")}}_send(e,t){const s=this.getAction(),n=this.getCommand();return n.$db.push({$method:e,$param:Hs(t)}),this._database._callCloudFunction({action:s,command:n})}}function Qs(e,t,s){return Vs(new Ys(e,t,s),{get(e,t){let n="db";return e&&e.content&&(n=e.content.$method),zs(n,t)?Qs({$method:t},e,s):function(){return Qs({$method:t,$param:Hs(Array.from(arguments))},e,s)}}})}function Zs({path:e,method:t}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}function $s(e,t={}){return Vs(new e(t),{get:(e,t)=>zs("db",t)?Qs({$method:t},null,e):function(){return Qs({$method:t,$param:Hs(Array.from(arguments))},null,e)}})}class Xs extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=Ne("_globalUniCloudDatabaseCallback")),t||(this.auth=Ks(this._authCallBacks)),this._isJQL=t,Object.assign(this,Ks(this._dbCallBacks)),this.env=Vs({},{get:(e,t)=>({$env:t})}),this.Geo=Vs({},{get:(e,t)=>Zs({path:["Geo"],method:t})}),this.serverDate=Zs({path:[],method:"serverDate"}),this.RegExp=Zs({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const s=this._dbCallBacks;s[e]&&s[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const s=this._authCallBacks;s[e]&&s[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),s=e.getCommand();if("getTemp"!==s.$db[s.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:s}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:s,queryList:n}){function o(e,t){if(s&&n)for(let s=0;s<n.length;s++){const o=n[s];o.udb&&"function"==typeof o.udb.setResult&&(t?o.udb.setResult(t):o.udb.setResult(e.result.dataList[s]))}}const i=this,r=this._isJQL?"databaseForJQL":"database";function a(e){return i._callback("error",[e]),qe(Je(r,"fail"),e).then((()=>qe(Je(r,"complete"),e))).then((()=>(o(null,e),et(We,{type:Ge,content:e}),Promise.reject(e))))}const c=qe(Je(r,"invoke")),l=this._uniClient;return c.then((()=>l.callFunction({name:"DCloud-clientDB",type:"CLIENT_DB",data:{action:e,command:t,multiCommand:s}}))).then((e=>{const{code:t,message:s,token:n,tokenExpired:c,systemInfo:l=[]}=e.result;if(l)for(let o=0;o<l.length;o++){const{level:e,message:t,detail:s}=l[o],n=console[e]||console.log;let i="[System Info]"+t;s&&(i=`${i}\n详细信息:${s}`),n(i)}if(t)return a(new it({code:t,message:s,requestId:e.requestId}));e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,n&&c&&(lt({token:n,tokenExpired:c}),this._callbackAuth("refreshToken",[{token:n,tokenExpired:c}]),this._callback("refreshToken",[{token:n,tokenExpired:c}]),et(He,{token:n,tokenExpired:c}));const u=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(let o=0;o<u.length;o++){const{prop:t,tips:s}=u[o];if(t in e.result){const n=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(s),n)})}}return h=e,qe(Je(r,"success"),h).then((()=>qe(Je(r,"complete"),h))).then((()=>{o(h,null);const e=i._parseResult(h);return et(We,{type:Ge,content:e}),Promise.resolve(e)}));var h}),(e=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"),a(new it({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const en="token无效,跳转登录页面",tn="token过期,跳转登录页面",sn={TOKEN_INVALID_TOKEN_EXPIRED:tn,TOKEN_INVALID_INVALID_CLIENTID:en,TOKEN_INVALID:en,TOKEN_INVALID_WRONG_TOKEN:en,TOKEN_INVALID_ANONYMOUS_USER:en},nn={"uni-id-token-expired":tn,"uni-id-check-token-failed":en,"uni-id-token-not-exist":en,"uni-id-check-device-feature-failed":en};function on(e,t){let s="";return s=e?`${e}/${t}`:t,s.replace(/^\//,"")}function rn(e=[],t=""){const s=[],n=[];return e.forEach((e=>{!0===e.needLogin?s.push(on(t,e.path)):!1===e.needLogin&&n.push(on(t,e.path))})),{needLoginPage:s,notNeedLoginPage:n}}function an(e){return e.split("?")[0].replace(/^\//,"")}function cn(){return function(e){let t=e&&e.$page&&e.$page.fullPath||"";return t?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){const e=n();return e[e.length-1]}())}function ln(){return an(cn())}function un(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const s=t.list,n=an(e);return s.some((e=>e.pagePath===n))}const hn=!!pe.uniIdRouter,{loginPage:dn,routerNeedLogin:fn,resToLogin:pn,needLoginPage:gn,notNeedLoginPage:mn,loginPageInTabBar:yn}=function({pages:e=[],subPackages:t=[],uniIdRouter:s={},tabBar:n={}}=pe){const{loginPage:o,needLogin:i=[],resToLogin:r=!0}=s,{needLoginPage:a,notNeedLoginPage:c}=rn(e),{needLoginPage:l,notNeedLoginPage:u}=function(e=[]){const t=[],s=[];return e.forEach((e=>{const{root:n,pages:o=[]}=e,{needLoginPage:i,notNeedLoginPage:r}=rn(o,n);t.push(...i),s.push(...r)})),{needLoginPage:t,notNeedLoginPage:s}}(t);return{loginPage:o,routerNeedLogin:i,resToLogin:r,needLoginPage:[...a,...l],notNeedLoginPage:[...c,...u],loginPageInTabBar:un(o,n)}}();if(gn.indexOf(dn)>-1)throw new Error(`Login page [${dn}] should not be "needLogin", please check your pages.json`);function _n(e){const t=ln();if("/"===e.charAt(0))return e;const[s,n]=e.split("?"),o=s.replace(/^\//,"").split("/"),i=t.split("/");i.pop();for(let r=0;r<o.length;r++){const e=o[r];".."===e?i.pop():"."!==e&&i.push(e)}return""===i[0]&&i.shift(),"/"+i.join("/")+(n?"?"+n:"")}function wn({redirect:e}){const t=an(e),s=an(dn);return ln()!==s&&t!==s}function vn({api:e,redirect:t}={}){if(!t||!wn({redirect:t}))return;const s=(o=t,"/"!==(n=dn).charAt(0)&&(n="/"+n),o?n.indexOf("?")>-1?n+`&uniIdRedirectUrl=${encodeURIComponent(o)}`:n+`?uniIdRedirectUrl=${encodeURIComponent(o)}`:n);var n,o;yn?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const i={navigateTo:w,redirectTo:v,switchTab:k,reLaunch:b};setTimeout((()=>{i[e]({url:s})}))}function kn({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},s=function(){const{token:e,tokenExpired:t}=ct();let s;if(e){if(t<Date.now()){const e="uni-id-token-expired";s={errCode:e,errMsg:nn[e]}}}else{const e="uni-id-check-token-failed";s={errCode:e,errMsg:nn[e]}}return s}();if(function(e){const t=an(_n(e));return!(mn.indexOf(t)>-1)&&(gn.indexOf(t)>-1||fn.some((t=>{return s=e,new RegExp(t).test(s);var s})))}(e)&&s){if(s.uniIdRedirectUrl=e,Ze(ze).length>0)return setTimeout((()=>{et(ze,s)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function bn(){!function(){const e=cn(),{abortLoginPageJump:t,autoToLoginPage:s}=kn({url:e});t||s&&vn({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t<e.length;t++){const s=e[t];o(s,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:n}=kn({url:e.url});return t?e:n?(vn({api:s,redirect:_n(e.url)}),!1):e}})}}function In(){this.onResponse((e=>{const{type:t,content:s}=e;let n=!1;switch(t){case"cloudobject":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in nn}(s);break;case"clientdb":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in sn}(s)}n&&function(e={}){const t=Ze(ze);nt().then((()=>{const s=cn();if(s&&wn({redirect:s}))return t.length>0?et(ze,Object.assign({uniIdRedirectUrl:s},e)):void(dn&&vn({api:"navigateTo",redirect:s}))}))}(s)}))}function An(e){var t;(t=e).onResponse=function(e){$e(We,e)},t.offResponse=function(e){Xe(We,e)},function(e){e.onNeedLogin=function(e){$e(ze,e)},e.offNeedLogin=function(e){Xe(ze,e)},hn&&(Ne("_globalUniCloudStatus").needLoginInit||(Ne("_globalUniCloudStatus").needLoginInit=!0,nt().then((()=>{bn.call(e)})),pn&&In.call(e)))}(e),function(e){e.onRefreshToken=function(e){$e(He,e)},e.offRefreshToken=function(e){Xe(He,e)}}(e)}let Sn;const Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",xn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Pn(){const e=ct().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let s;try{s=JSON.parse((n=t[1],decodeURIComponent(Sn(n).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(o){throw new Error("获取当前用户信息出错,详细错误信息为:"+o.message)}var n;return s.tokenExpired=1e3*s.exp,delete s.exp,delete s.iat,s}Sn="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!xn.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var s,n,o="",i=0;i<e.length;)t=Tn.indexOf(e.charAt(i++))<<18|Tn.indexOf(e.charAt(i++))<<12|(s=Tn.indexOf(e.charAt(i++)))<<6|(n=Tn.indexOf(e.charAt(i++))),o+=64===s?String.fromCharCode(t>>16&255):64===n?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}:atob;var Cn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(ge((function(e,n){Object.defineProperty(n,"__esModule",{value:!0});const o="chooseAndUploadFile:ok",r="chooseAndUploadFile:fail";function a(e,t){return e.tempFiles.forEach(((e,s)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+s+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function c(e,t,{onChooseFile:s,onUploadProgress:n}){return t.then((e=>{if(s){const t=s(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:o,tempFilePaths:[],tempFiles:[]}:function(e,t,s=5,n){(t=Object.assign({},t)).errMsg=o;const i=t.tempFiles,r=i.length;let a=0;return new Promise((o=>{for(;a<s;)c();function c(){const s=a++;if(s>=r)return void(!i.find((e=>!e.url&&!e.errMsg))&&o(t));const l=i[s];e.uploadFile({filePath:l.path,cloudPath:l.cloudPath,fileType:l.fileType,onUploadProgress(e){e.index=s,e.tempFile=l,e.tempFilePath=l.path,n&&n(e)}}).then((e=>{l.url=e.fileID,s<r&&c()})).catch((e=>{l.errMsg=e.errMsg||e.message,s<r&&c()}))}}))}(e,t,5,n)))}n.initChooseAndUploadFile=function(e){return function(n={type:"all"}){return"image"===n.type?c(e,function(e){const{count:s,sizeType:n,sourceType:o=["album","camera"],extension:i}=e;return new Promise(((e,c)=>{t({count:s,sizeType:n,sourceType:o,extension:i,success(t){e(a(t,"image"))},fail(e){c({errMsg:e.errMsg.replace("chooseImage:fail",r)})}})}))}(n),n):"video"===n.type?c(e,function(e){const{camera:t,compressed:n,maxDuration:o,sourceType:i=["album","camera"],extension:c}=e;return new Promise(((e,l)=>{s({camera:t,compressed:n,maxDuration:o,sourceType:i,extension:c,success(t){const{tempFilePath:s,duration:n,size:o,height:i,width:r}=t;e(a({errMsg:"chooseVideo:ok",tempFilePaths:[s],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:s,size:o,type:t.tempFile&&t.tempFile.type||"",width:r,height:i,duration:n,fileType:"video",cloudPath:""}]},"video"))},fail(e){l({errMsg:e.errMsg.replace("chooseVideo:fail",r)})}})}))}(n),n):c(e,function(e){const{count:t,extension:s}=e;return new Promise(((e,n)=>{let o=i;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(o=wx.chooseMessageFile),"function"!=typeof o)return n({errMsg:r+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});o({type:"all",count:t,extension:s,success(t){e(a(t))},fail(e){n({errMsg:e.errMsg.replace("chooseFile:fail",r)})}})}))}(n),n)}}})));function En(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((()=>{var e=[];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("manual"===this.loadtime)return;let s=!1;const n=[];for(let o=2;o<e.length;o++)e[o]!==t[o]&&(n.push(e[o]),s=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(s,n)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:s}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomGet().then((s=>{this.mixinDatacomLoading=!1;const{data:n,count:o}=s.result;this.getcount&&(this.mixinDatacomPage.count=o),this.mixinDatacomHasMore=n.length<this.pageSize;const i=e?n.length?n[0]:void 0:n;this.mixinDatacomResData=i,t&&t(i)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,s&&s(e)})))},mixinDatacomGet(t={}){let s=e.database(this.spaceInfo);const n=t.action||this.action;n&&(s=s.action(n));const o=t.collection||this.collection;s=Array.isArray(o)?s.collection(...o):s.collection(o);const i=t.where||this.where;i&&Object.keys(i).length&&(s=s.where(i));const r=t.field||this.field;r&&(s=s.field(r));const a=t.foreignKey||this.foreignKey;a&&(s=s.foreignKey(a));const c=t.groupby||this.groupby;c&&(s=s.groupBy(c));const l=t.groupField||this.groupField;l&&(s=s.groupField(l)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(s=s.distinct());const u=t.orderby||this.orderby;u&&(s=s.orderBy(u));const h=void 0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,d=void 0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,f=void 0!==t.getcount?t.getcount:this.getcount,p=void 0!==t.gettree?t.gettree:this.gettree,g=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,m={getCount:f},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return p&&(m.getTree=y),g&&(m.getTreePath=y),s=s.skip(d*(h-1)).limit(d).get(m),s}}}}function Dn(e){return Ne("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function Rn({openid:e,callLoginByWeixin:t=!1}={}){throw Dn(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `web`")}async function On(e){const t=Dn(this);return t.initPromise||(t.initPromise=Rn.call(this,e)),t.initPromise}function Ln(e){const t={getSystemInfo:I,getPushClientId:A};return function(s){return new Promise(((n,o)=>{t[e]({...s,success(e){n(e)},fail(e){o(e)}})}))}}class Un extends class{constructor(){this._callback={}}addListener(e,t){this._callback[e]||(this._callback[e]=[]),this._callback[e].push(t)}on(e,t){return this.addListener(e,t)}removeListener(e,t){if(!t)throw new Error('The "listener" argument must be of type function. Received undefined');const s=this._callback[e];if(!s)return;const n=function(e,t){for(let s=e.length-1;s>=0;s--)if(e[s]===t)return s;return-1}(s,t);s.splice(n,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const s=this._callback[e];if(s)for(let n=0;n<s.length;n++)s[n](...t)}}{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([Ln("getSystemInfo")(),Ln("getPushClientId")()]).then((([{appId:e}={},{cid:t}={}]=[])=>{if(!e)throw new Error("Invalid appId, please check the manifest.json file");if(!t)throw new Error("Invalid push client id");this._appId=e,this._pushClientId=t,this._seqId=Date.now()+"-"+Math.floor(9e5*Math.random()+1e5),this.emit("open"),this._initMessageListener()}),(e=>{throw this.emit("error",e),this.close(),e}))}async open(){return this.init()}_isUniCloudSSE(e){if("receive"!==e.type)return!1;const t=e&&e.data&&e.data.payload;return!(!t||"UNI_CLOUD_SSE"!==t.channel||t.seqId!==this._seqId)}_receivePushMessage(e){if(!this._isUniCloudSSE(e))return;const t=e&&e.data&&e.data.payload,{action:s,messageId:n,message:o}=t;this._payloadQueue.push({action:s,messageId:n,message:o}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find((e=>e.messageId===this._currentMessageId+1));if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:s,message:n}=e;"end"===t?this._end({messageId:s,message:n}):"message"===t&&this._appendMessage({messageId:s,message:n})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){u(this._uniPushMessageCallback)}_destroy(){h(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}const Nn={tcb:xs,tencent:xs,aliyun:kt,private:Cs};let Mn=new class{init(e){let t={};const s=Nn[e.provider];if(!s)throw new Error("未提供正确的provider参数");var n;return t=s.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new Ee({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const s=e.auth();return t.then((()=>s.getLoginState())).then((e=>e?Promise.resolve():s.signInAnonymously()))}}))}(t),qs(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(n=t).database=function(e){if(e&&Object.keys(e).length>0)return n.init(e).database();if(this._database)return this._database;const t=$s(Xs,{uniClient:n});return this._database=t,t},n.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return n.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=$s(Xs,{uniClient:n,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=Pn,e.chooseAndUploadFile=Cn.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return En(e)}}),e.SSEChannel=Un,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:s=!1}={}){return On.call(e,{openid:t,callLoginByWeixin:s})}}(e),e.importObject=function(t){return function(s,n={}){n=function(e,t={}){return e.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeof t.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},n);const{customUI:o,loadingOptions:i,errorOptions:u,parseSystemError:h}=n,d=!o;return new Proxy({},{get:(o,f)=>function({fn:e,interceptorName:t,getCallbackArgs:s}={}){return async function(...n){const o=s?s({params:n}):{};let i,r;try{return await qe(Je(t,"invoke"),{...o}),i=await e(...n),await qe(Je(t,"success"),{...o,result:i}),i}catch(a){throw r=a,await qe(Je(t,"fail"),{...o,error:r}),r}finally{await qe(Je(t,"complete"),r?{...o,error:r}:{...o,result:i})}}}({fn:async function o(...p){let g;d&&r({title:i.title,mask:i.mask});const m={name:s,type:"OBJECT",data:{method:f,params:p}};"object"==typeof n.secretMethods&&function(e,t){const s=t.data.method,n=e.secretMethods||{},o=n[s]||n["*"];o&&(t.secretType=o)}(n,m);let y=!1;try{g=await t.callFunction(m)}catch(e){y=!0,g={result:new it(e)}}const{errSubject:_,errCode:w,errMsg:v,newToken:k}=g.result||{};if(d&&a(),k&&k.token&&k.tokenExpired&&(lt(k),et(He,{...k})),w){let e=v;if(y&&h&&(e=(await h({objectName:s,methodName:f,params:p,errSubject:_,errCode:w,errMsg:v})).errMsg||v),d)if("toast"===u.type)c({title:e,icon:"none"});else{if("modal"!==u.type)throw new Error(`Invalid errorOptions.type: ${u.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:s,cancelText:n,confirmText:o}={}){return new Promise(((i,r)=>{l({title:e,content:t,showCancel:s,cancelText:n,confirmText:o,success(e){i(e)},fail(){i({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:u.retry,cancelText:"取消",confirmText:u.retry?"重试":"确定"});if(u.retry&&t)return o(...p)}}const t=new it({subject:_,code:w,message:v,requestId:g.requestId});throw t.detail=g.result,et(We,{type:Qe,content:t}),t}return et(We,{type:Qe,content:g.result}),g.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:s,methodName:f,params:e}}})})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const s=t[e];var n,o;t[e]=function(){return s.apply(t,Array.from(arguments))},t[e]=(n=t[e],o=e,function(e){let t=!1;if("callFunction"===o){const s=e&&e.type||ke;t=s!==ke}const s="callFunction"===o&&!t,i=this._initPromiseHub.exec();e=e||{};const{success:r,fail:a,complete:c}=ot(e),l=i.then((()=>t?Promise.resolve():qe(Je(o,"invoke"),e))).then((()=>n.call(this,e))).then((e=>t?Promise.resolve(e):qe(Je(o,"success"),e).then((()=>qe(Je(o,"complete"),e))).then((()=>(s&&et(We,{type:Ye,content:e}),Promise.resolve(e))))),(e=>t?Promise.reject(e):qe(Je(o,"fail"),e).then((()=>qe(Je(o,"complete"),e))).then((()=>(et(We,{type:Ye,content:e}),Promise.reject(e))))));if(!(r||a||c))return l;l.then((e=>{r&&r(e),c&&c(e),s&&et(We,{type:Ye,content:e})}),(e=>{a&&a(e),c&&c(e),s&&et(We,{type:Ye,content:e})}))}).bind(t)})),t.init=this.init,t}};(()=>{const e=Oe;let t={};if(e&&1===e.length)t=e[0],Mn=Mn.init(t),Mn._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let s;s=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",t.forEach((e=>{Mn[e]=function(){return console.error(s),Promise.reject(new it({code:"SYS_ERR",message:s}))}}))}Object.assign(Mn,{get mixinDatacom(){return En(Mn)}}),An(Mn),Mn.addInterceptor=je,Mn.removeInterceptor=Be,Mn.interceptObject=Ve})();var Fn=Mn;const jn=ce({name:"uni-data-select",mixins:[Fn.mixinDatacom||{}],props:{localdata:{type:Array,default:()=>[]},value:{type:[String,Number],default:""},modelValue:{type:[String,Number],default:""},label:{type:String,default:""},placeholder:{type:String,default:"请选择"},emptyTips:{type:String,default:"无选项"},clear:{type:Boolean,default:!0},defItem:{type:Number,default:0},disabled:{type:Boolean,default:!1},format:{type:String,default:""},placement:{type:String,default:"bottom"}},data:()=>({showSelector:!1,current:"",mixinDatacomResData:[],apps:[],channels:[],cacheKey:"uni-data-select-lastSelectedValue"}),created(){this.debounceGet=this.debounce((()=>{this.query()}),300),this.collection&&!this.localdata.length&&this.debounceGet()},computed:{typePlaceholder(){const e=this.placeholder,t={"opendb-stat-app-versions":"版本","opendb-app-channels":"渠道","opendb-app-list":"应用"}[this.collection];return t?e+t:e},valueCom(){return this.modelValue},textShow(){let e=this.current;return e.length>10?e.slice(0,25)+"...":e},getOffsetByPlacement(){switch(this.placement){case"top":return"bottom:calc(100% + 12px);";case"bottom":return"top:calc(100% + 12px);"}}},watch:{localdata:{immediate:!0,handler(e,t){Array.isArray(e)&&t!==e&&(this.mixinDatacomResData=e)}},valueCom(e,t){this.initDefVal()},mixinDatacomResData:{immediate:!0,handler(e){e.length&&this.initDefVal()}}},methods:{debounce(e,t=100){let s=null;return function(...n){s&&clearTimeout(s),s=setTimeout((()=>{e.apply(this,n)}),t)}},query(){this.mixinDatacomEasyGet()},onMixinDatacomPropsChange(){this.collection&&this.debounceGet()},initDefVal(){let e="";if(!this.valueCom&&0!==this.valueCom||this.isDisabled(this.valueCom)){let t;if(this.collection&&(t=this.getCache()),t||0===t)e=t;else{let t="";this.defItem>0&&this.defItem<=this.mixinDatacomResData.length&&(t=this.mixinDatacomResData[this.defItem-1].value),e=t}(e||0===e)&&this.emit(e)}else e=this.valueCom;const t=this.mixinDatacomResData.find((t=>t.value===e));this.current=t?this.formatItemName(t):""},isDisabled(e){let t=!1;return this.mixinDatacomResData.forEach((s=>{s.value===e&&(t=s.disable)})),t},clearVal(){this.emit(""),this.collection&&this.removeCache()},change(e){e.disable||(this.showSelector=!1,this.current=this.formatItemName(e),this.emit(e.value))},emit(e){this.$emit("input",e),this.$emit("update:modelValue",e),this.$emit("change",e),this.collection&&this.setCache(e)},toggleSelector(){this.disabled||(this.showSelector=!this.showSelector)},formatItemName(e){let{text:t,value:s,channel_code:n}=e;if(n=n?`(${n})`:"",this.format){let t="";t=this.format;for(let s in e)t=t.replace(new RegExp(`{${s}}`,"g"),e[s]);return t}return this.collection.indexOf("app-list")>0?`${t}(${s})`:t||`未命名${n}`},getLoadData(){return this.mixinDatacomResData},getCurrentCacheKey(){return this.collection},getCache(e=this.getCurrentCacheKey()){return(g(this.cacheKey)||{})[e]},setCache(e,t=this.getCurrentCacheKey()){let s=g(this.cacheKey)||{};s[t]=e,p(this.cacheKey,s)},removeCache(e=this.getCurrentCacheKey()){let t=g(this.cacheKey)||{};delete t[e],p(this.cacheKey,t)}}},[["render",function(e,t,s,n,o,i){const r=q,a=le(x("uni-icons"),ne),c=J,l=V;return P(),C(r,{class:"uni-stat__select"},{default:E((()=>[s.label?(P(),D("span",{key:0,class:"uni-label-text hide-on-phone"},R(s.label+":"),1)):O("",!0),L(r,{class:U(["uni-stat-box",{"uni-stat__actived":o.current}])},{default:E((()=>[L(r,{class:U(["uni-select",{"uni-select--disabled":s.disabled}])},{default:E((()=>[L(r,{class:"uni-select__input-box",onClick:i.toggleSelector},{default:E((()=>[o.current?(P(),C(r,{key:0,class:"uni-select__input-text"},{default:E((()=>[N(R(i.textShow),1)])),_:1})):(P(),C(r,{key:1,class:"uni-select__input-text uni-select__input-placeholder"},{default:E((()=>[N(R(i.typePlaceholder),1)])),_:1})),o.current&&s.clear&&!s.disabled?(P(),C(r,{key:2,onClick:M(i.clearVal,["stop"])},{default:E((()=>[L(a,{type:"clear",color:"#c0c4cc",size:"24"})])),_:1},8,["onClick"])):(P(),C(r,{key:3},{default:E((()=>[L(a,{type:o.showSelector?"top":"bottom",size:"14",color:"#999"},null,8,["type"])])),_:1}))])),_:1},8,["onClick"]),o.showSelector?(P(),C(r,{key:0,class:"uni-select--mask",onClick:i.toggleSelector},null,8,["onClick"])):O("",!0),o.showSelector?(P(),C(r,{key:1,class:"uni-select__selector",style:F(i.getOffsetByPlacement)},{default:E((()=>[L(r,{class:U("bottom"==s.placement?"uni-popper__arrow_bottom":"uni-popper__arrow_top")},null,8,["class"]),L(l,{"scroll-y":"true",class:"uni-select__selector-scroll"},{default:E((()=>[0===o.mixinDatacomResData.length?(P(),C(r,{key:0,class:"uni-select__selector-empty"},{default:E((()=>[L(c,null,{default:E((()=>[N(R(s.emptyTips),1)])),_:1})])),_:1})):(P(!0),D(j,{key:1},B(o.mixinDatacomResData,((e,t)=>(P(),C(r,{class:"uni-select__selector-item",key:t,onClick:t=>i.change(e)},{default:E((()=>[L(c,{class:U({"uni-select__selector__disabled":e.disable})},{default:E((()=>[N(R(i.formatItemName(e)),1)])),_:2},1032,["class"])])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1},8,["style"])):O("",!0)])),_:1},8,["class"])])),_:1},8,["class"])])),_:1})}],["__scopeId","data-v-fe4b6be6"]]),Bn={en:{"uni-load-more.contentdown":"Pull up to show more","uni-load-more.contentrefresh":"loading...","uni-load-more.contentnomore":"No more data"},"zh-Hans":{"uni-load-more.contentdown":"上拉显示更多","uni-load-more.contentrefresh":"正在加载...","uni-load-more.contentnomore":"没有更多数据了"},"zh-Hant":{"uni-load-more.contentdown":"上拉顯示更多","uni-load-more.contentrefresh":"正在加載...","uni-load-more.contentnomore":"沒有更多數據了"}};let qn;setTimeout((()=>{qn=_().platform}),16);const{t:Jn}=e(Bn);const Vn=ce({name:"UniLoadMore",emits:["clickLoadMore"],props:{status:{type:String,default:"more"},showIcon:{type:Boolean,default:!0},iconType:{type:String,default:"auto"},iconSize:{type:Number,default:24},color:{type:String,default:"#777777"},contentText:{type:Object,default:()=>({contentdown:"",contentrefresh:"",contentnomore:""})},showText:{type:Boolean,default:!0}},data:()=>({webviewHide:!1,platform:qn,imgBase64:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZV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"}),computed:{iconSnowWidth(){return 2*(Math.floor(this.iconSize/24)||1)},contentdownText(){return this.contentText.contentdown||Jn("uni-load-more.contentdown")},contentrefreshText(){return this.contentText.contentrefresh||Jn("uni-load-more.contentrefresh")},contentnomoreText(){return this.contentText.contentnomore||Jn("uni-load-more.contentnomore")}},mounted(){},methods:{onClick(){this.$emit("clickLoadMore",{detail:{status:this.status}})}}},[["render",function(e,t,s,n,o,i){const r=W,a=q,c=J;return P(),C(a,{class:"uni-load-more",onClick:i.onClick},{default:E((()=>[!o.webviewHide&&("circle"===s.iconType||"auto"===s.iconType&&"android"===o.platform)&&"loading"===s.status&&s.showIcon?(P(),D("svg",{key:0,width:"24",height:"24",viewBox:"25 25 50 50",style:F({width:s.iconSize+"px",height:s.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--android-H5"},[K("circle",{cx:"50",cy:"50",r:"20",fill:"none",style:F({color:s.color}),"stroke-width":3},null,4)],4)):!o.webviewHide&&"loading"===s.status&&s.showIcon?(P(),C(a,{key:1,style:F({width:s.iconSize+"px",height:s.iconSize+"px"}),class:"uni-load-more__img uni-load-more__img--ios-H5"},{default:E((()=>[L(r,{src:o.imgBase64,mode:"widthFix"},null,8,["src"])])),_:1},8,["style"])):O("",!0),s.showText?(P(),C(c,{key:2,class:"uni-load-more__text",style:F({color:s.color})},{default:E((()=>[N(R("more"===s.status?i.contentdownText:"loading"===s.status?i.contentrefreshText:i.contentnomoreText),1)])),_:1},8,["style"])):O("",!0)])),_:1},8,["onClick"])}],["__scopeId","data-v-d82f3750"]]),Kn={name:"uniDataChecklist",mixins:[Fn.mixinDatacom||{}],emits:["input","update:modelValue","change"],props:{mode:{type:String,default:"default"},multiple:{type:Boolean,default:!1},value:{type:[Array,String,Number],default:()=>""},modelValue:{type:[Array,String,Number],default:()=>""},localdata:{type:Array,default:()=>[]},min:{type:[Number,String],default:""},max:{type:[Number,String],default:""},wrap:{type:Boolean,default:!1},icon:{type:String,default:"left"},selectedColor:{type:String,default:""},selectedTextColor:{type:String,default:""},emptyText:{type:String,default:"暂无数据"},disabled:{type:Boolean,default:!1},map:{type:Object,default:()=>({text:"text",value:"value"})}},watch:{localdata:{handler(e){this.range=e,this.dataList=this.getDataList(this.getSelectedValue(e))},deep:!0},mixinDatacomResData(e){this.range=e,this.dataList=this.getDataList(this.getSelectedValue(e))},value(e){this.dataList=this.getDataList(e)},modelValue(e){this.dataList=this.getDataList(e)}},data:()=>({dataList:[],range:[],contentText:{contentdown:"查看更多",contentrefresh:"加载中",contentnomore:"没有更多"},isLocal:!0,styles:{selectedColor:"#2979ff",selectedTextColor:"#666"},isTop:0}),computed:{dataValue(){return""===this.value?this.modelValue:(this.modelValue,this.value)}},created(){this.localdata&&0!==this.localdata.length?(this.isLocal=!0,this.range=this.localdata,this.dataList=this.getDataList(this.getSelectedValue(this.range))):this.collection&&(this.isLocal=!1,this.loadData())},methods:{loadData(){this.mixinDatacomGet().then((e=>{this.mixinDatacomResData=e.result.data,0===this.mixinDatacomResData.length?(this.isLocal=!1,this.mixinDatacomErrorMessage=this.emptyText):this.isLocal=!0})).catch((e=>{this.mixinDatacomErrorMessage=e.message}))},getForm(e="uniForms"){let t=this.$parent,s=t.$options.name;for(;s!==e;){if(t=t.$parent,!t)return!1;s=t.$options.name}return t},change(e){const t=e.detail.value;let s={value:[],data:[]};if(this.multiple)this.range.forEach((e=>{t.includes(e[this.map.value]+"")&&(s.value.push(e[this.map.value]),s.data.push(e))}));else{const e=this.range.find((e=>e[this.map.value]+""===t));e&&(s={value:e[this.map.value],data:e})}this.$emit("input",s.value),this.$emit("update:modelValue",s.value),this.$emit("change",{detail:s}),this.multiple?this.dataList=this.getDataList(s.value,!0):this.dataList=this.getDataList(s.value)},getDataList(e){let t=JSON.parse(JSON.stringify(this.range)),s=[];return this.multiple&&(Array.isArray(e)||(e=[])),t.forEach(((t,n)=>{if(t.disabled=t.disable||t.disabled||!1,this.multiple)if(e.length>0){let s=e.find((e=>e===t[this.map.value]));t.selected=void 0!==s}else t.selected=!1;else t.selected=e===t[this.map.value];s.push(t)})),this.setRange(s)},setRange(e){let t=e.filter((e=>e.selected)),s=Number(this.min)||0,n=Number(this.max)||"";return e.forEach(((o,i)=>{if(this.multiple){if(t.length<=s){void 0!==t.find((e=>e[this.map.value]===o[this.map.value]))&&(o.disabled=!0)}if(t.length>=n&&""!==n){void 0===t.find((e=>e[this.map.value]===o[this.map.value]))&&(o.disabled=!0)}}this.setStyles(o,i),e[i]=o})),e},setStyles(e,t){e.styleBackgroud=this.setStyleBackgroud(e),e.styleIcon=this.setStyleIcon(e),e.styleIconText=this.setStyleIconText(e),e.styleRightIcon=this.setStyleRightIcon(e)},getSelectedValue(e){if(!this.multiple)return this.dataValue;let t=[];return e.forEach((e=>{e.selected&&t.push(e[this.map.value])})),this.dataValue.length>0?this.dataValue:t},setStyleBackgroud(e){let t={},s=this.selectedColor?this.selectedColor:"#2979ff";this.selectedColor&&("list"!==this.mode&&(t["border-color"]=e.selected?s:"#DCDFE6"),"tag"===this.mode&&(t["background-color"]=e.selected?s:"#f5f5f5"));let n="";for(let o in t)n+=`${o}:${t[o]};`;return n},setStyleIcon(e){let t={},s="";if(this.selectedColor){let s=this.selectedColor?this.selectedColor:"#2979ff";t["background-color"]=e.selected?s:"#fff",t["border-color"]=e.selected?s:"#DCDFE6",!e.selected&&e.disabled&&(t["background-color"]="#F2F6FC",t["border-color"]=e.selected?s:"#DCDFE6")}for(let n in t)s+=`${n}:${t[n]};`;return s},setStyleIconText(e){let t={},s="";if(this.selectedColor){let s=this.selectedColor?this.selectedColor:"#2979ff";"tag"===this.mode?t.color=e.selected?this.selectedTextColor?this.selectedTextColor:"#fff":"#666":t.color=e.selected?this.selectedTextColor?this.selectedTextColor:s:"#666",!e.selected&&e.disabled&&(t.color="#999")}for(let n in t)s+=`${n}:${t[n]};`;return s},setStyleRightIcon(e){let t={},s="";"list"===this.mode&&(t["border-color"]=e.selected?this.styles.selectedColor:"#DCDFE6");for(let n in t)s+=`${n}:${t[n]};`;return s}}};const Wn=ce(Kn,[["render",function(e,t,s,n,o,i){const r=le(x("uni-load-more"),Vn),a=J,c=q,l=z,u=H,h=G,d=Y,f=Q;return P(),C(c,{class:"uni-data-checklist",style:F({"margin-top":o.isTop+"px"})},{default:E((()=>[o.isLocal?(P(),D(j,{key:1},[s.multiple?(P(),C(h,{key:0,class:U(["checklist-group",{"is-list":"list"===s.mode||s.wrap}]),onChange:i.change},{default:E((()=>[(P(!0),D(j,null,B(o.dataList,((e,t)=>(P(),C(u,{class:U(["checklist-box",["is--"+s.mode,e.selected?"is-checked":"",s.disabled||e.disabled?"is-disable":"",0!==t&&"list"===s.mode?"is-list-border":""]]),style:F(e.styleBackgroud),key:t},{default:E((()=>[L(l,{class:"hidden",hidden:"",disabled:s.disabled||!!e.disabled,value:e[s.map.value]+"",checked:e.selected},null,8,["disabled","value","checked"]),"tag"!==s.mode&&"list"!==s.mode||"list"===s.mode&&"left"===s.icon?(P(),C(c,{key:0,class:"checkbox__inner",style:F(e.styleIcon)},{default:E((()=>[L(c,{class:"checkbox__inner-icon"})])),_:2},1032,["style"])):O("",!0),L(c,{class:U(["checklist-content",{"list-content":"list"===s.mode&&"left"===s.icon}])},{default:E((()=>[L(a,{class:"checklist-text",style:F(e.styleIconText)},{default:E((()=>[N(R(e[s.map.text]),1)])),_:2},1032,["style"]),"list"===s.mode&&"right"===s.icon?(P(),C(c,{key:0,class:"checkobx__list",style:F(e.styleBackgroud)},null,8,["style"])):O("",!0)])),_:2},1032,["class"])])),_:2},1032,["class","style"])))),128))])),_:1},8,["class","onChange"])):(P(),C(f,{key:1,class:U(["checklist-group",{"is-list":"list"===s.mode,"is-wrap":s.wrap}]),onChange:i.change},{default:E((()=>[(P(!0),D(j,null,B(o.dataList,((e,t)=>(P(),C(u,{class:U(["checklist-box",["is--"+s.mode,e.selected?"is-checked":"",s.disabled||e.disabled?"is-disable":"",0!==t&&"list"===s.mode?"is-list-border":""]]),style:F(e.styleBackgroud),key:t},{default:E((()=>[L(d,{class:"hidden",hidden:"",disabled:s.disabled||e.disabled,value:e[s.map.value]+"",checked:e.selected},null,8,["disabled","value","checked"]),"tag"!==s.mode&&"list"!==s.mode||"list"===s.mode&&"left"===s.icon?(P(),C(c,{key:0,class:"radio__inner",style:F(e.styleBackgroud)},{default:E((()=>[L(c,{class:"radio__inner-icon",style:F(e.styleIcon)},null,8,["style"])])),_:2},1032,["style"])):O("",!0),L(c,{class:U(["checklist-content",{"list-content":"list"===s.mode&&"left"===s.icon}])},{default:E((()=>[L(a,{class:"checklist-text",style:F(e.styleIconText)},{default:E((()=>[N(R(e[s.map.text]),1)])),_:2},1032,["style"]),"list"===s.mode&&"right"===s.icon?(P(),C(c,{key:0,style:F(e.styleRightIcon),class:"checkobx__list"},null,8,["style"])):O("",!0)])),_:2},1032,["class"])])),_:2},1032,["class","style"])))),128))])),_:1},8,["class","onChange"]))],64)):(P(),C(c,{key:0,class:"uni-data-loading"},{default:E((()=>[e.mixinDatacomErrorMessage?(P(),C(a,{key:1},{default:E((()=>[N(R(e.mixinDatacomErrorMessage),1)])),_:1})):(P(),C(r,{key:0,status:"loading",iconType:"snow",iconSize:18,"content-text":o.contentText},null,8,["content-text"]))])),_:1}))])),_:1},8,["style"])}],["__scopeId","data-v-4b96d17a"]]);function zn(e){let t=[],s=(new Date).getFullYear();t.push(s);for(let n=1;n<e;n++)t.push(s+n);return t}const Hn=ce(Z({__name:"register",setup(e){const t=$(""),s=X((()=>n.enrollYear&&n.gender&&n.name&&n.provinceCode)),n=ee({enrollYear:"",mobilePhone:"",gender:"",name:"",password:"",provinceCode:""}),o=ee({enrollYear:{rules:[{required:!0,errorMessage:"请选择您的高考年份"}]},gender:{rules:[{required:!0,errorMessage:"请选择性别"}]},name:{rules:[{required:!0,errorMessage:"请输入姓名"}]},provinceCode:{rules:[{required:!0,errorMessage:"请选择您所在的省市"}]}}),i=$([{value:"男",text:"男"},{value:"女",text:"女"}]),r=$([]),a=$([]),c=$(),l=()=>{s.value&&c.value.validate().then((async e=>{200===(await de(n)).code&&(async()=>{200===(await fe({mobilePhone:n.mobilePhone,prefUnitCode:t.value})).code&&setTimeout((()=>{b({url:`/pages/result/result?provinceCode=${n.provinceCode}`})}),800)})()}))};return ue((e=>{var s;const o=JSON.parse(decodeURIComponent(e.parameter));t.value=o.unitCode,n.mobilePhone=o.mobilePhone,n.password=o.password,r.value=null==(s=zn(3))?void 0:s.map((e=>({value:e,text:e}))),(async()=>{var e,t;const s=await he({});200===s.code&&(a.value=null==(t=null==(e=Object.keys(s.data))?void 0:e.map(((e,t)=>({value:e,text:s.data[e]}))))?void 0:t.filter((e=>"65"!=e.value)))})()})),(e,t)=>{const u=W,h=q,d=le(x("uni-data-select"),jn),f=le(x("uni-forms-item"),ie),p=le(x("uni-easyinput"),re),g=le(x("uni-data-checkbox"),Wn),m=le(x("uni-forms"),ae),y=se;return P(),C(h,null,{default:E((()=>[L(h,{class:"logo"},{default:E((()=>[L(u,{src:oe,mode:"aspectFit"})])),_:1}),L(h,{class:"form"},{default:E((()=>[L(m,{ref_key:"form",ref:c,modelValue:n,rules:o,"label-width":90,"label-align":"right"},{default:E((()=>[L(f,{label:"所在地",name:"provinceCode"},{default:E((()=>[L(h,{class:"form-item"},{default:E((()=>[L(d,{clear:!1,modelValue:n.provinceCode,"onUpdate:modelValue":t[0]||(t[0]=e=>n.provinceCode=e),placeholder:"请选择您所在的省市",localdata:a.value},null,8,["modelValue","localdata"]),L(h,{class:"des-text"},{default:E((()=>[N("省/市")])),_:1})])),_:1})])),_:1}),L(f,{label:"高考年份",name:"enrollYear"},{default:E((()=>[L(h,{class:"form-item"},{default:E((()=>[L(d,{clear:!1,modelValue:n.enrollYear,"onUpdate:modelValue":t[1]||(t[1]=e=>n.enrollYear=e),placeholder:"请选择您的高考年份",localdata:r.value},null,8,["modelValue","localdata"]),L(h,{class:"des-text"})])),_:1})])),_:1}),L(f,{label:"姓名",name:"name"},{default:E((()=>[L(h,{class:"form-item"},{default:E((()=>[L(p,{type:"text",clearable:!1,modelValue:n.name,"onUpdate:modelValue":t[2]||(t[2]=e=>n.name=e),placeholder:"请输入姓名"},null,8,["modelValue"]),L(h,{class:"des-text"})])),_:1})])),_:1}),L(f,{label:"性别",name:"gender"},{default:E((()=>[L(h,{class:"form-item"},{default:E((()=>[L(g,{modelValue:n.gender,"onUpdate:modelValue":t[3]||(t[3]=e=>n.gender=e),localdata:i.value},null,8,["modelValue","localdata"]),L(h,{class:"des-text"})])),_:1})])),_:1})])),_:1},8,["modelValue","rules"]),L(y,{class:U(["submit",{"submit-disabled":!te(s)}]),onClick:l},{default:E((()=>[N("提交")])),_:1},8,["class"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-f3e3b1c9"]]);export{Hn as default};
|