var e=Object.defineProperty,t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,o=(e,o)=>{for(var a in o||(o={}))n.call(o,a)&&i(e,a,o[a]);if(t)for(var a of t(o))r.call(o,a)&&i(e,a,o[a]);return e},a=(e,t,n)=>new Promise((r,i)=>{var o=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())});function s(e,t){for(var n=0;nr[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const l="modulepreload",u=function(e){return"https://op-sourcecode.cdn.bcebos.com/source_code/projects/conv-8cwkiy2bg83l_1771904978272/"+e},c={},d=function(e,t,n){if(!t||0===t.length)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(e=>{if(e=u(e),e in c)return;c[e]=!0;const t=e.endsWith(".css"),i=t?'[rel="stylesheet"]':"",o=!!n;if(o)for(let n=r.length-1;n>=0;n--){const i=r[n];if(i.href===e&&(!t||"stylesheet"===i.rel))return}else if(document.querySelector(`link[href="${e}"]${i}`))return;const a=document.createElement("link");return a.rel=t?"stylesheet":l,t||(a.as="script",a.crossOrigin=""),a.href=e,document.head.appendChild(a),t?new Promise((t,n)=>{a.addEventListener("load",t),a.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${e}`)))}):void 0})).then(()=>e()).catch(e=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e})},h="[]",f="",p="!0",g="!1",m={bindTouchStart:f,bindTouchMove:f,bindTouchEnd:f,bindTouchCancel:f,bindLongTap:f},v={animation:f,bindAnimationStart:f,bindAnimationIteration:f,bindAnimationEnd:f,bindTransitionEnd:f};function y(e){return`'${e}'`}var b;Object.assign(Object.assign({"hover-class":y("none"),"hover-stop-propagation":g,"hover-start-time":"50","hover-stay-time":"400"},m),v),Object.assign({longitude:f,latitude:f,scale:"16",markers:h,covers:f,polyline:h,circles:h,controls:h,"include-points":h,"show-location":f,"layer-style":"1",bindMarkerTap:f,bindControlTap:f,bindCalloutTap:f,bindUpdated:f},m),Object.assign({selectable:g,space:f,decode:g},m),Object.assign({size:y("default"),type:f,plain:g,disabled:f,loading:g,"form-type":f,"open-type":f,"hover-class":y("button-hover"),"hover-stop-propagation":g,"hover-start-time":"20","hover-stay-time":"70",name:f,bindagreeprivacyauthorization:f},m),Object.assign({for:f,name:f},m),Object.assign({"scroll-top":g},m),Object.assign(Object.assign({direction:"none",inertia:g,"out-of-bounds":g,x:f,y:f,damping:"20",friction:"2",disabled:f,scale:g,"scale-min":"0.5","scale-max":"10","scale-value":"1",bindChange:f,bindScale:f,bindHTouchMove:f,bindVTouchMove:f,width:y("10px"),height:y("10px")},m),v),Object.assign(Object.assign({"scroll-x":g,"scroll-y":g,"upper-threshold":"50","lower-threshold":"50","scroll-top":f,"scroll-left":f,"scroll-into-view":f,"scroll-with-animation":g,"enable-back-to-top":g,bindScrollToUpper:f,bindScrollToLower:f,bindScroll:f},m),v),Object.assign({"indicator-dots":g,"indicator-color":y("rgba(0, 0, 0, .3)"),"indicator-active-color":y("#000000"),autoplay:g,current:"0",interval:"5000",duration:"500",circular:g,vertical:g,"previous-margin":y("0px"),"next-margin":y("0px"),"display-multiple-items":"1",bindChange:f,bindTransition:f,bindAnimationFinish:f},m),Object.assign({src:f,mode:y("scaleToFill"),"lazy-load":g,bindError:f,bindLoad:f},m),Object.assign({src:f,autoplay:g,muted:g,orientation:y("vertical"),"object-fit":y("contain"),"background-mute":g,"min-cache":"1","max-cache":"3",bindStateChange:f,bindFullScreenChange:f,bindNetStatus:f},v),Object.assign({src:f,duration:f,controls:p,"danmu-list":f,"danmu-btn":f,"enable-danmu":f,autoplay:g,loop:g,muted:g,"initial-time":"0","page-gesture":g,direction:f,"show-progress":p,"show-fullscreen-btn":p,"show-play-btn":p,"show-center-play-btn":p,"enable-progress-gesture":p,"object-fit":y("contain"),poster:f,"show-mute-btn":g,bindPlay:f,bindPause:f,bindEnded:f,bindTimeUpdate:f,bindFullScreenChange:f,bindWaiting:f,bindError:f},v),Object.assign({"canvas-id":f,"disable-scroll":g,bindError:f},m),function(e){e["MINI"]="mini",e["ASCF"]="ascf",e["WEB"]="web",e["RN"]="rn",e["HARMONY"]="harmony",e["QUICK"]="quickapp"}(b||(b={})),b.WEB,b.HARMONY,b.ASCF,b.MINI,b.RN,b.QUICK;let w=class e{constructor(e){var t;this.callbacks=null!==(t=null===e||void 0===e?void 0:e.callbacks)&&void 0!==t?t:{}}on(t,n,r){let i,o,a;if(!n)return this;a="symbol"===typeof t?[t]:t.split(e.eventSplitter),this.callbacks||(this.callbacks={});const s=this.callbacks;while(i=a.shift()){const e=s[i],t=e?e.tail:{};t.next=o={},t.context=r,t.callback=n,s[i]={tail:o,next:e?e.next:t}}return this}once(e,t,n){const r=(...i)=>{t.apply(this,i),this.off(e,r,n)};return this.on(e,r,n),this}off(t,n,r){let i,o,a;if(!(o=this.callbacks))return this;if(!(t||n||r))return delete this.callbacks,this;a="symbol"===typeof t?[t]:t?t.split(e.eventSplitter):Object.keys(o);while(i=a.shift()){let e=o[i];if(delete o[i],!e||!n&&!r)continue;const t=e.tail;while((e=e.next)!==t){const t=e.callback,o=e.context;(n&&t!==n||r&&o!==r)&&this.on(i,t,o)}}return this}trigger(t,...n){let r,i,o,a;if(!(o=this.callbacks))return this;a="symbol"===typeof t?[t]:t.split(e.eventSplitter);while(r=a.shift())if(i=o[r]){const e=i.tail;while((i=i.next)!==e)i.callback.apply(i.context||this,n)}return this}};w.eventSplitter=",";class A extends w{constructor(){super(...arguments),this.exeList=[]}on(e,t){return super.on(e,t,this),this.exeList=this.exeList.reduce((t,n)=>(n.eventName===e?super.trigger(n.eventName,n.data):t.push(n),t),[]),this}emit(e,t){S.trigger(e,t)}}const _=new A;class k extends w{emit(e,t){_.off(e),_.exeList.push({eventName:e,data:t})}addEvents(e){e&&"object"===typeof e&&Object.keys(e).forEach(t=>{this.off(t),this.on(t,e[t],this)})}}const S=new k,E={pageChannel:_,routeChannel:S};function x(e){return"undefined"===typeof e}function T(e){return null!==e&&"object"===typeof e}function C(e){return"function"===typeof e}const P=Array.isArray;var O;(function(e){e[e["SINGLE"]=0]="SINGLE",e[e["MULTI"]=1]="MULTI",e[e["WATERFALL"]=2]="WATERFALL"})(O||(O={}));const $={app:["onLaunch","onShow","onHide"],page:["onLoad","onUnload","onReady","onShow","onHide",["onPullDownRefresh","onReachBottom","onPageScroll","onResize","defer:onTabItemTap","onTitleClick","onOptionMenuClick","onPopMenuClick","onPullIntercept","onAddToFavorites"],["onShareAppMessage","onShareTimeline"]],component:["attached","detached"]};function I(e,t){return{type:e,initial:t||null}}class j extends w{constructor(e,t){super(t),this.hooks=e;for(const n in e){const{initial:t}=e[n];C(t)&&this.on(n,t)}}tapOneOrMany(e,t){const n=C(t)?[t]:t;n.forEach(t=>this.on(e,t))}tap(e,t){const n=this.hooks,{type:r,initial:i}=n[e];r===O.SINGLE?(this.off(e),this.on(e,C(t)?t:t[t.length-1])):(i&&this.off(e,i),this.tapOneOrMany(e,t))}call(e,...t){var n;const r=this.hooks[e];if(!r)return;const{type:i}=r,o=this.callbacks;if(!o)return;const a=o[e];if(a){const e=a.tail;let r,o=a.next,s=t;while(o!==e){if(r=null===(n=o.callback)||void 0===n?void 0:n.apply(o.context||this,s),i===O.WATERFALL){const e=[r];s=e}o=o.next}return r}}isExist(e){var t;return Boolean(null===(t=this.callbacks)||void 0===t?void 0:t[e])}}const N=new j({getMiniLifecycle:I(O.SINGLE,e=>e),getMiniLifecycleImpl:I(O.SINGLE,function(){return this.call("getMiniLifecycle",$)}),getLifecycle:I(O.SINGLE,(e,t)=>e[t]),modifyRecursiveComponentConfig:I(O.SINGLE,e=>e),getPathIndex:I(O.SINGLE,e=>`[${e}]`),getEventCenter:I(O.SINGLE,e=>new e),isBubbleEvents:I(O.SINGLE,e=>{const t=new Set(["touchstart","touchmove","touchcancel","touchend","touchforcechange","tap","longpress","longtap","transitionend","animationstart","animationiteration","animationend"]);return t.has(e)}),getSpecialNodes:I(O.SINGLE,()=>["view","text","image"]),onRemoveAttribute:I(O.SINGLE),batchedEventUpdates:I(O.SINGLE),mergePageInstance:I(O.SINGLE),modifyPageObject:I(O.SINGLE),createPullDownComponent:I(O.SINGLE),getDOMNode:I(O.SINGLE),modifyHydrateData:I(O.SINGLE),transferHydrateData:I(O.SINGLE),modifySetAttrPayload:I(O.SINGLE),modifyRmAttrPayload:I(O.SINGLE),onAddEvent:I(O.SINGLE),proxyToRaw:I(O.SINGLE,function(e){return e}),modifyMpEvent:I(O.MULTI),modifyMpEventImpl:I(O.SINGLE,function(e){try{this.call("modifyMpEvent",e)}catch(t){console.warn("[Taro modifyMpEvent hook Error]: "+(null===t||void 0===t?void 0:t.message))}}),injectNewStyleProperties:I(O.SINGLE),modifyTaroEvent:I(O.MULTI),dispatchTaroEvent:I(O.SINGLE,(e,t)=>{t.dispatchEvent(e)}),dispatchTaroEventFinish:I(O.MULTI),modifyTaroEventReturn:I(O.SINGLE,()=>{}),modifyDispatchEvent:I(O.MULTI),initNativeApi:I(O.MULTI),patchElement:I(O.MULTI),modifyAddEventListener:I(O.SINGLE),modifyRemoveEventListener:I(O.SINGLE),getMemoryLevel:I(O.SINGLE)}),L={};function R(e,t){if(!e)throw new Error(t)}var D;(new Date).getTime().toString(),function(e){e["Container"]="container",e["Childnodes"]="cn",e["Text"]="v",e["NodeType"]="nt",e["NodeName"]="nn",e["Sid"]="sid",e["Style"]="st",e["Class"]="cl",e["Src"]="src"}(D||(D={}));const M="\u9875\u9762\u521d\u59cb\u5316",B="root",U="container",z="input",F="target",H="currentTarget",W="type",V="confirm",q="timeStamp",Q="keyCode",G="touchmove",Y="onLoad",K="onReady",J="onShow",Z="onHide",X="e_result";var ee;(function(e){e["INIT"]="0",e["RESTORE"]="1",e["RECOVER"]="2",e["DESTORY"]="3"})(ee||(ee={}));const te=N.call("getEventCenter",w),ne={window:window,document:document};function re(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);iae;(function(){"undefined"!==typeof performance&&null!==performance&&performance.now||Date.now||(new Date).getTime()})();const le=requestAnimationFrame,ue=ne.window,ce=ue.location,de=()=>{const e=[];for(let r=65;r<=90;r++)e.push(r);for(let r=97;r<=122;r++)e.push(r);const t=e.length-1,n=[0,0];return()=>{const r=n.map(t=>e[t]),i=String.fromCharCode(...r);let o=n.length-1;n[o]++;while(n[o]>t){if(n[o]=0,o-=1,o<0){n.push(0);break}n[o]++}return i}};function he(e,t){var n;while(e=(null===e||void 0===e?void 0:e.parentElement)||null){if(!e||e.nodeName===B||"root-portal"===e.nodeName)return!1;if(null===(n=e.__handlers[t])||void 0===n?void 0:n.length)return!0}return!1}const fe={prerender:!0,debug:!1};class pe{constructor(e,t,n){this._stop=!1,this._end=!1,this.defaultPrevented=!1,this.button=0,this.timeStamp=Date.now(),this.type=e.toLowerCase(),this.mpEvent=n,this.bubbles=Boolean(t&&t.bubbles),this.cancelable=Boolean(t&&t.cancelable)}stopPropagation(){this._stop=!0}stopImmediatePropagation(){this._end=this._stop=!0}preventDefault(){this.defaultPrevented=!0}get target(){var e,t,n,r,i;const o=this.cacheTarget;if(o)return o;{const o=Object.create((null===(e=this.mpEvent)||void 0===e?void 0:e.target)||null),a=ne.document.getElementById((null===(t=o.dataset)||void 0===t?void 0:t.sid)||o.id||null),s=ne.document.getElementById((null===(n=o.targetDataset)||void 0===n?void 0:n.sid)||(null===(r=o.dataset)||void 0===r?void 0:r.sid)||o.id||null);o.dataset=Object.assign(Object.assign({},null!==a?a.dataset:L),null!==s?s.dataset:L);for(const e in null===(i=this.mpEvent)||void 0===i?void 0:i.detail)o[e]=this.mpEvent.detail[e];return this.cacheTarget=o,o}}get currentTarget(){var e,t,n,r,i,o,a,s;const l=this.cacheCurrentTarget;if(l)return l;{const l=ne.document,u=Object.create((null===(e=this.mpEvent)||void 0===e?void 0:e.currentTarget)||null),c=l.getElementById((null===(t=u.dataset)||void 0===t?void 0:t.sid)||u.id||null),d=l.getElementById((null===(i=null===(r=null===(n=this.mpEvent)||void 0===n?void 0:n.target)||void 0===r?void 0:r.dataset)||void 0===i?void 0:i.sid)||(null===(a=null===(o=this.mpEvent)||void 0===o?void 0:o.target)||void 0===a?void 0:a.id)||null);if(null===c||c&&c===d)return this.cacheCurrentTarget=this.target,this.target;u.dataset=c.dataset;for(const e in null===(s=this.mpEvent)||void 0===s?void 0:s.detail)u[e]=this.mpEvent.detail[e];return this.cacheCurrentTarget=u,u}}}function ge(e,t){if("string"===typeof e)return new pe(e,{bubbles:!0,cancelable:!0});const n=new pe(e.type,{bubbles:!0,cancelable:!0},e);for(const r in e)r!==H&&r!==F&&r!==W&&r!==q&&(n[r]=e[r]);return n.type===V&&(null===t||void 0===t?void 0:t.nodeName)===z&&(n[Q]=13),n}const me={};function ve(e){const t=e[X];return x(t)||delete e[X],t}function ye(e){var t,n;void 0===e.type&&Object.defineProperty(e,"type",{value:e._type}),void 0===e.detail&&Object.defineProperty(e,"detail",{value:e._detail||Object.assign({},e)}),e.currentTarget=e.currentTarget||e.target||Object.assign({},e),N.call("modifyMpEventImpl",e);const r=e.currentTarget,i=(null===(t=r.dataset)||void 0===t?void 0:t.sid)||r.id||(null===(n=e.detail)||void 0===n?void 0:n.id)||"",o=ne.document.getElementById(i);if(o){const t=()=>{const t=ge(e,o);N.call("modifyTaroEvent",t,o),N.call("dispatchTaroEvent",t,o),N.call("dispatchTaroEventFinish",t,o)};if(!N.isExist("batchedEventUpdates"))return t(),ve(e);{const n=e.type;if(!N.call("isBubbleEvents",n)||!he(o,n)||n===G&&o.props.catchMove)return N.call("batchedEventUpdates",()=>{me[n]&&(me[n].forEach(e=>e()),delete me[n]),t()}),ve(e);(me[n]||(me[n]=[])).push(t)}}}function be(e,t=250,n){let r;return function(...i){const o=n||this;clearTimeout(r),r=setTimeout(function(){e.apply(o,i)},t)}}var we,Ae;class _e{constructor(){we.add(this),this.recorder=new Map}start(e){fe.debug&&this.recorder.set(e,Date.now())}stop(e,t=Date.now()){if(!fe.debug)return;const n=this.recorder.get(e);if(!(n>=0))return;this.recorder.delete(e);const r=t-n;console.log(`${e} \u65f6\u957f\uff1a ${r}ms \u5f00\u59cb\u65f6\u95f4\uff1a${oe(this,we,"m",Ae).call(this,n)} \u7ed3\u675f\u65f6\u95f4\uff1a${oe(this,we,"m",Ae).call(this,t)}`)}delayStop(e,t=500){if(fe.debug)return be((t=Date.now(),n)=>{this.stop(e,t),null===n||void 0===n||n()},t)}}we=new WeakSet,Ae=function(e){const t=new Date(e);return`${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}.${`${t.getMilliseconds()}`.padStart(3,"0")}`};const ke=new _e,Se=ne.document,Ee=(e="")=>"/"===e.charAt(0)?e:"/"+e,xe=(e="",t="")=>new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)||e===t,Te=(e="",t="")=>xe(e,t)?e.substring(t.length):e,Ce=(e="")=>e.replace(/[?#][\s\S]*$/,""),Pe=(e="",t="",n={},r="")=>{var i;const o=Ee(Te(e,t)),a=(null===(i=Object.entries(n).find(([e])=>e===o))||void 0===i?void 0:i[1])||o;return r||("string"===typeof a?a:a[0])||t},Oe=(e="hash",t="/")=>{const n="hash"===e?ce.hash.slice(1).split("?")[0]:ce.pathname;return Ee(Te(n,t))},$e=new Map,Ie=de();function je(e,t){N.call("mergePageInstance",$e.get(t),e),$e.set(t,e)}function Ne(e){return $e.get(e)}function Le(e,t,...n){const r=$e.get(e);if(null==r)return;const i=N.call("getLifecycle",r,t);if(P(i)){const e=i.map(e=>e.apply(r,n));return e[0]}return C(i)?i.apply(r,n):void 0}function Re(e){if(null==e)return"";const t=Object.keys(e).map(t=>t+"="+e[t]).join("&");return""===t?t:"?"+t}function De(e,t){const n=e.indexOf("?");return`${n>-1?e.substring(0,n):e}${Re((null===t||void 0===t?void 0:t.stamp)?{stamp:t.stamp}:{})}`}function Me(e){return e+"."+K}function Be(e){return e+"."+J}function Ue(e){return e+"."+Z}function ze(e,t,n,r){const i=null!==t&&void 0!==t?t:`taro_page_${Ie()}`,[o,a,s,l,u,c,d]=N.call("getMiniLifecycleImpl").page;let h,f,p=null,g=!1,m=[];function v(e){const t=e.$taroPath;ae.router={params:e.$taroParams,path:Ee(t),$taroPath:e.$taroPath,onReady:Me(i),onShow:Be(i),onHide:Ue(i)},x(e.exitState)||(ae.router.exitState=e.exitState)}const y={[o](t={},n){f=new Promise(e=>{h=e}),ke.start(M),ae.page=this,this.config=r||{};const o=Object.assign({},t,{$taroTimestamp:Date.now()}),a=this.$taroPath=De(i,o);y.path=a,null==this.$taroParams&&(this.$taroParams=o),v(this);const s=()=>{ae.app.mount(e,a,()=>{p=ne.document.getElementById(a),R(null!==p,"\u6ca1\u6709\u627e\u5230\u9875\u9762\u5b9e\u4f8b\u3002"),Le(a,Y,this.$taroParams),h(),C(n)&&n()})};g?m.push(s):s()},[a](){const e=this.$taroPath;Le(e,a),g=!0,ae.app.unmount(e,()=>{g=!1,$e.delete(e),p&&(p.ctx=null,p=null),m.length&&(m.forEach(e=>e()),m=[])})},[s](){f.then(()=>{Le(this.$taroPath,K),le(()=>te.trigger(Me(i))),this.onReady.called=!0})},[l](e={}){f.then(()=>{ae.page=this,v(this),Le(this.$taroPath,J,e),le(()=>te.trigger(Be(i)))})},[u](){ae.page===this&&(ae.page=null,ae.router=null),Le(this.$taroPath,Z),te.trigger(Ue(i))},getOpenerEventChannel:()=>E.pageChannel};return c.forEach(e=>{let t=!1;e=e.replace(/^defer:/,()=>(t=!0,"")),y[e]=function(){const n=()=>Le(this.$taroPath,e,...arguments);if(!t)return n();f.then(n)}}),d.forEach(t=>{var n;(e[t]||(null===(n=e.prototype)||void 0===n?void 0:n[t])||e[t.replace(/^on/,"enable")]||(null===r||void 0===r?void 0:r[t.replace(/^on/,"enable")]))&&(y[t]=function(...e){var n;const r=null===(n=e[0])||void 0===n?void 0:n.target;if(null===r||void 0===r?void 0:r.id){const e=r.id,t=ne.document.getElementById(e);t&&(r.dataset=t.dataset)}return Le(this.$taroPath,t,...e)})}),y.eh=ye,x(n)||(y.data=n),N.call("modifyPageObject",y),y}const Fe=100,He=(e,t)=>{const n=Date.now(),r=ae.router,i=()=>{setTimeout(function(){t?e.call(t):e()},1)};if(null===r)return i();const o=r.$taroPath;function a(){var e,t,r;const s=ne.document.getElementById(o);(null===s||void 0===s?void 0:s.pendingUpdate)?null!==(r=null===(t=null===(e=s.firstChild)||void 0===e?void 0:e["componentOnReady"])||void 0===t?void 0:t.call(e).then(()=>{i()}))&&void 0!==r||i():Date.now()-n>Fe?i():setTimeout(()=>a(),20)}a()},We={PageContext:L,R:L},Ve="taro-app";function qe(e,t){var n;const r=t.prototype;return!(null===(n=t.displayName)||void 0===n?void 0:n.includes("Connect"))&&(C(t.render)||!!(null===r||void 0===r?void 0:r.isReactComponent)||r instanceof e.Component)}function Qe(e){return P(e)?e:e?[e]:[]}function Ge(e){return e.writable=!0,e.enumerable=!0,e}function Ye(e){ae.router=Object.assign({params:null===e||void 0===e?void 0:e.query},e)}const Ke=e=>t=>{const{R:n,PageContext:r}=We,i=n.useContext(r)||Ve,o=n.useRef(),a=n.useRef(t);a.current!==t&&(a.current=t),n.useLayoutEffect(()=>{let t=o.current=Ne(i),n=!1;t||(n=!0,o.current=Object.create(null),t=o.current);const r=(...e)=>a.current(...e);return C(t[e])?t[e]=[t[e],r]:t[e]=[...t[e]||[],r],n&&je(t,i),()=>{const t=o.current;if(!t)return;const n=t[e];n===r?t[e]=void 0:P(n)&&(t[e]=n.filter(e=>e!==r)),o.current=void 0}},[])},Je=Ke("componentDidHide"),Ze=Ke("componentDidShow"),Xe=Ke("onError"),et=Ke("onUnhandledRejection"),tt=Ke("onLaunch"),nt=Ke("onPageNotFound"),rt=Ke("onLoad"),it=Ke("onPageScroll"),ot=Ke("onPullDownRefresh"),at=Ke("onPullIntercept"),st=Ke("onReachBottom"),lt=Ke("onResize"),ut=Ke("onUnload"),ct=Ke("onAddToFavorites"),dt=Ke("onOptionMenuClick"),ht=Ke("onSaveExitState"),ft=Ke("onShareAppMessage"),pt=Ke("onShareTimeline"),gt=Ke("onTitleClick"),mt=Ke("onReady"),vt=(e=!1)=>{const t=We.R;return e?ae.router:t.useMemo(()=>ae.router,[])},yt=Ke("onTabItemTap"),bt=()=>{};var wt=Object.freeze({__proto__:null,useAddToFavorites:ct,useDidHide:Je,useDidShow:Ze,useError:Xe,useLaunch:tt,useLoad:rt,useOptionMenuClick:dt,usePageNotFound:nt,usePageScroll:it,usePullDownRefresh:ot,usePullIntercept:at,useReachBottom:st,useReady:mt,useResize:lt,useRouter:vt,useSaveExitState:ht,useScope:bt,useShareAppMessage:ft,useShareTimeline:pt,useTabItemTap:yt,useTitleClick:gt,useUnhandledRejection:et,useUnload:ut});let At,_t,kt;const St=de();function Et(e){N.tap("getLifecycle",function(e,t){return t=t.replace(/^on(Show|Hide)$/,"componentDid$1"),e[t]}),N.tap("modifyMpEvent",function(e){Object.defineProperty(e,"type",{value:e.type.replace(/-/g,"")})}),N.tap("batchedEventUpdates",function(t){null===e||void 0===e||e.unstable_batchedUpdates(t)}),N.tap("mergePageInstance",function(e,t){e&&t&&("constructor"in e||Object.keys(e).forEach(n=>{const r=e[n],i=Qe(t[n]);t[n]=i.concat(r)}))}),N.tap("createPullDownComponent",(e,t,n,r)=>{const i=qe(n,e);return n.forwardRef((t,n)=>{const o=Object.assign({},t),a=i?{ref:n}:{forwardedRef:n,reactReduxForwardedRef:n};return At(r||"taro-pull-to-refresh-core",null,At(e,Object.assign(Object.assign({},o),a)))})}),N.tap("getDOMNode",e=>{if(!e)return Se;if(e instanceof HTMLElement)return e;if(e.$taroPath){const t=Se.getElementById(e.$taroPath);return null!==t&&void 0!==t?t:Se}})}function xt(e,t){return n=>{const r=qe(e,n),i=e=>e&&je(e,t),o=r?{ref:i}:{forwardedRef:i,reactReduxForwardedRef:i};return We.PageContext===L&&(We.PageContext=e.createContext("")),class extends e.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){var t,n;return null===(n=null===(t=ae.app)||void 0===t?void 0:t.onError)||void 0===n||n.call(t,e.message+e.stack),{hasError:!0}}componentDidCatch(e,t){}render(){const e=this.state.hasError?[]:At(We.PageContext.Provider,{value:t},At(n,Object.assign(Object.assign({},this.props),o)));return At("div",{id:t,className:"taro_page"},e)}}}}function Tt(e,t,n,r){We.R=t,At=t.createElement,_t=n,kt=t.Fragment;const i=t.createRef(),o=qe(t,e);let a,s;const l=new Promise(e=>s=e);function u(){return i.current}function c(e){l.then(()=>e())}function d(){var e,n;const i=(null===r||void 0===r?void 0:r.appId)||"app";let o=Se.getElementById(i);if(null==o){const e=Se.getElementById(U);o=Se.createElement(i),o.id=i,null===e||void 0===e||e.appendChild(o)}if((t.version||"").startsWith("18")){const t=_t.createRoot(o);null===(e=t.render)||void 0===e||e.call(t,At(h))}else null===(n=_t.render)||void 0===n||n.call(_t,At(h),o)}Et(_t);class h extends t.Component{constructor(e){super(e),this.pages=[],this.elements=[],a=this,s(this)}mount(e,n,r){const i=xt(t,n)(e),o=n+St(),a=()=>At(i,{key:o,tid:n});this.pages.push(a),this.forceUpdate((...e)=>(ke.stop(M),r(...e)))}unmount(e,t){const n=this.elements,r=n.findIndex(t=>t.props.tid===e);n.splice(r,1),this.forceUpdate(t)}render(){const{pages:t,elements:n}=this;while(t.length>0){const e=t.pop();n.push(e())}let r=null;return o&&(r={ref:i}),At(e,r,At(null!==kt&&void 0!==kt?kt:"div",null,n.slice()))}}const[f,p,g]=N.call("getMiniLifecycleImpl").app,m=Object.create({render(e){a.forceUpdate(e)},mount(e,t,n){a?a.mount(e,t,n):l.then(r=>r.mount(e,t,n))},unmount(e,t){a?a.unmount(e,t):l.then(n=>n.unmount(e,t))}},{config:Ge({configurable:!0,value:r}),[f]:Ge({value(e){Ye(e),d();const t=()=>{var t;const n=u();if(this.$app=n,n){if(n.taroGlobalData){const e=n.taroGlobalData,t=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);t.forEach(t=>{Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get(){return e[t]},set(n){e[t]=n}})}),Object.defineProperties(this,r)}null===(t=n.onLaunch)||void 0===t||t.call(n,e)}v("onLaunch",e)};c(t)}}),[p]:Ge({value(e){Ye(e);const t=()=>{var t;const n=u();null===(t=null===n||void 0===n?void 0:n.componentDidShow)||void 0===t||t.call(n,e),v("onShow",e)};c(t)}}),[g]:Ge({value(){const e=()=>{var e;const t=u();null===(e=null===t||void 0===t?void 0:t.componentDidHide)||void 0===e||e.call(t),v("onHide")};c(e)}}),onError:Ge({value(e){const t=()=>{var t;const n=u();null===(t=null===n||void 0===n?void 0:n.onError)||void 0===t||t.call(n,e),v("onError",e)};c(t)}}),onUnhandledRejection:Ge({value(e){const t=()=>{var t;const n=u();null===(t=null===n||void 0===n?void 0:n.onUnhandledRejection)||void 0===t||t.call(n,e),v("onUnhandledRejection",e)};c(t)}}),onPageNotFound:Ge({value(e){const t=()=>{var t;const n=u();null===(t=null===n||void 0===n?void 0:n.onPageNotFound)||void 0===t||t.call(n,e),v("onPageNotFound",e)};c(t)}})});function v(e,...t){const n=Ne(Ve);if(n){const r=u(),i=N.call("getLifecycle",n,e);Array.isArray(i)&&i.forEach(e=>e.apply(r,t))}}return ae.app=m,m}de(),N.tap("initNativeApi",function(e){for(const t in wt)e[t]=wt[t]});var Ct="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function Ot(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}const $t={ASCF:"ASCF",WEAPP:"WEAPP",SWAN:"SWAN",ALIPAY:"ALIPAY",TT:"TT",QQ:"QQ",JD:"JD",WEB:"WEB",RN:"RN",HARMONY:"HARMONY",QUICKAPP:"QUICKAPP",HARMONYHYBRID:"HARMONYHYBRID"};function It(){return $t.WEB}class jt{constructor(e,t,n){this.index=n||0,this.requestParams=e||{},this.interceptors=t||[]}proceed(e={}){if(this.requestParams=e,this.index>=this.interceptors.length)throw new Error("chain \u53c2\u6570\u9519\u8bef, \u8bf7\u52ff\u76f4\u63a5\u4fee\u6539 request.chain");const t=this._getNextInterceptor(),n=this._getNextChain(),r=t(n),i=r.catch(e=>Promise.reject(e));return Object.keys(r).forEach(e=>C(r[e])&&(i[e]=r[e])),i}_getNextInterceptor(){return this.interceptors[this.index]}_getNextChain(){return new jt(this.requestParams,this.interceptors,this.index+1)}}let Nt=class{constructor(e){this.taroInterceptor=e,this.chain=new jt}request(e){const t=this.chain,n=this.taroInterceptor;return t.interceptors=t.interceptors.filter(e=>e!==n).concat(n),t.proceed(Object.assign({},e))}addInterceptor(e){this.chain.interceptors.push(e)}cleanInterceptors(){this.chain=new jt}};function Lt(e){return new Nt(function(t){return e(t.requestParams)})}function Rt(e){const t=e.requestParams;let n;const r=new Promise((r,i)=>{const o=setTimeout(()=>{clearTimeout(o),i(new Error("\u7f51\u7edc\u94fe\u63a5\u8d85\u65f6,\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01"))},t&&t.timeout||6e4);n=e.proceed(t),n.then(e=>{o&&(clearTimeout(o),r(e))}).catch(e=>{o&&clearTimeout(o),i(e)})});return!x(n)&&C(n.abort)&&(r.abort=n.abort),r}function Dt(e){const t=e.requestParams,{method:n,data:r,url:i}=t;console.log(`http ${n||"GET"} --\x3e ${i} data: `,r);const o=e.proceed(t),a=o.then(e=>(console.log(`http <-- ${i} result:`,e),e));return C(o.abort)&&(a.abort=o.abort),a}const Mt=Object.freeze(Object.defineProperty({__proto__:null,logInterceptor:Dt,timeoutInterceptor:Rt},Symbol.toStringTag,{value:"Module"}));function Bt(e){return e}function Ut(e){return function(t,n){e.preloadData=T(t)?t:{[t]:n}}}const zt=750,Ft={640:1.17,750:1,828:.905},Ht=20,Wt=5,Vt="rpx";function qt(e){return function(t){const{designWidth:n=zt,deviceRatio:r=Ft,baseFontSize:i=Ht,targetUnit:o=Vt,unitPrecision:a=Wt}=t;e.config=e.config||{},e.config.designWidth=n,e.config.deviceRatio=r,e.config.baseFontSize=i,e.config.targetUnit=o,e.config.unitPrecision=a}}function Qt(e){return function(t){const n=e.config||{},r=n.baseFontSize,i=n.deviceRatio||Ft,o=((e=0)=>C(n.designWidth)?n.designWidth(e):n.designWidth||zt)(t);if(!(o in i))throw new Error(`deviceRatio \u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728 ${o} \u7684\u8bbe\u7f6e\uff01`);const a=n.targetUnit||Vt,s=n.unitPrecision||Wt,l=~~t;let u=1/i[o];switch(a){case"rem":u*=2*r;break;case"px":u*=2;break}let c=l/u;return s>=0&&s<=100&&(c=Number(c.toFixed(s))),c+a}}const Gt={Behavior:Bt,getEnv:It,ENV_TYPE:$t,Link:Nt,interceptors:Mt,Current:ae,getCurrentInstance:se,options:fe,nextTick:He,eventCenter:te,Events:w,getInitPxTransform:qt,interceptorify:Lt};function Yt(e=300){const t=`\nbody {\n /* \u9632\u6b62 iOS \u9875\u9762\u6eda\u52a8 */\n overflow: hidden;\n}\n.taro_router > .taro_page {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: #fff;\n transform: translate(100%, 0);\n transition: transform ${e}ms;\n z-index: 0;\n}\n\n.taro_router > .taro_page.taro_tabbar_page,\n.taro_router > .taro_page.taro_page_show.taro_page_stationed {\n transform: none;\n transition: none;\n}\n\n.taro_router > .taro_page.taro_page_show {\n transform: translate(0, 0);\n}\n`;Zt(t)}function Kt(e,t,n){const r=`\n .taro_router {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .taro_page {\n width: 100%;\n height: 100%;\n${t?"":"\n overflow-x: hidden;\n overflow-y: scroll;\n max-height: 100vh;\n"}\n }\n${e?"\n .taro-tabbar__container {\n height:100%;\n }\n .taro-tabbar__panel {\n height: 100%;\n }\n .taro-tabbar__container > .taro-tabbar__panel {\n overflow: hidden;\n }\n\n .taro-tabbar__container > .taro-tabbar__panel > .taro_page.taro_tabbar_page {\n max-height: calc(100vh - var(--taro-tabbar-height) - constant(safe-area-inset-bottom));\n max-height: calc(100vh - var(--taro-tabbar-height) - env(safe-area-inset-bottom));\n }\n\n":""}\n${n?".taro_page_shade:has(+.taro_page_stationed),\n .taro_page_shade.taro_tabbar_page,\n .taro_router > .taro_page.taro_page_show.taro_page_stationed:not(.taro_page_shade):not(.taro_tabbar_page):not(:last-child):has(+.taro_page_stationed) {\n display: none;\n }":" .taro_page_shade,\n .taro_router > .taro_page.taro_page_show.taro_page_stationed:not(.taro_page_shade):not(.taro_tabbar_page):not(:last-child) {\n display: none;\n }"}\n`;Zt(r)}function Jt(){const e="\n .taro-navigation-bar-show {\n display: flex;\n background: white;\n position: sticky;\n z-index: 500;\n top: 0;\n padding-bottom: 8px;\n padding-top: calc(env(safe-area-inset-top) + 8px);\n justify-content: center;\n align-items: center;\n }\n\n .taro-navigation-bar-hide {\n display: none;\n }\n\n .taro-navigation-bar-title-wrap {\n display: flex;\n height: 24px;\n }\n\n .taro-navigation-bar-title-wrap > .taro-navigation-bar-loading {\n display: none;\n animation: loading 2s linear infinite;\n }\n\n .taro-navigation-bar-title-wrap .taro-navigation-bar-loading.taro-navigation-bar-loading-show {\n display: flex;\n }\n\n .taro-navigation-bar-title-wrap > .taro-navigation-bar-title {\n font-size: 24px;\n height: 24px;\n line-height: 24px;\n max-width: 100px;\n white-space: nowrap;\n overflow: hidden;\n line-height: 24px;\n text-overflow: ellipsis;\n }\n\n @keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n @keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n\n .taro-navigation-bar-no-icon > .taro-navigation-bar-home {\n display: none;\n }\n\n .taro-navigation-bar-no-icon > .taro-navigation-bar-back {\n display: none;\n }\n\n .taro-navigation-bar-home-icon > .taro-navigation-bar-home {\n display: flex;\n left: 8px;\n position: absolute;\n width: 24px;\n height: 24px;\n }\n\n .taro-navigation-bar-back-icon > .taro-navigation-bar-back {\n display: flex;\n left: 8px;\n position: absolute;\n width: 24px;\n height: 24px;\n }\n";Zt(e)}function Zt(e){if(!e)return;const t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}Gt.initPxTransform=qt(Gt),Gt.preload=Ut(ae),Gt.pxTransform=Qt(Gt);const Xt='\n\n \n\n',en='\n\n \n\n',tn='\n\n';function nn(e,t){if("multi"===e.router.mode)return;const n=document.createElement("div");n.classList.add("taro-navigation-bar-no-icon");const r=document.createElement("div");r.classList.add("taro-navigation-bar-back");const i=document.createElement("div");i.classList.add("taro-navigation-bar-home"),r.innerHTML=en,i.innerHTML=Xt;const o=document.createElement("div");o.classList.add("taro-navigation-bar-title-wrap");const a=document.createElement("div");a.classList.add("taro-navigation-bar-loading"),a.innerHTML=tn;const s=document.createElement("div");s.classList.add("taro-navigation-bar-title"),o.appendChild(a),o.appendChild(s),n.appendChild(i),n.appendChild(r),n.appendChild(o),n.id="taro-navigation-bar",t.insertBefore(n,t.firstChild),Jt()}const rn={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,safari10:!1,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,cssVarShim:!1,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,dynamicImportShim:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0};let on,an,sn,ln=!1,un=!1,cn=!1,dn=!1,hn=null,fn=!1;const pn=(e,t="")=>()=>{},gn="http://www.w3.org/1999/xlink",mn={},vn="http://www.w3.org/2000/svg",yn="http://www.w3.org/1999/xhtml",bn=e=>null!=e,wn=e=>(e=typeof e,"object"===e||"function"===e);function An(e){var t,n,r;return null!==(r=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==r?r:void 0}const _n=(e,t,...n)=>{let r=null,i=null,o=null,a=!1,s=!1;const l=[],u=t=>{for(let n=0;ne[t]).join(" "))}}if("function"===typeof e)return e(null===t?{}:t,l,xn);const c=kn(e,null);return c.$attrs$=t,l.length>0&&(c.$children$=l),c.$key$=i,c.$name$=o,c},kn=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return n},Sn={},En=e=>e&&e.$tag$===Sn,xn={forEach:(e,t)=>e.map(Tn).forEach(t),map:(e,t)=>e.map(Tn).map(t).map(Cn)},Tn=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),Cn=e=>{if("function"===typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),_n(e.vtag,t,...e.vchildren||[])}const t=kn(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},Pn=e=>$r.map(t=>t(e)).find(e=>!!e),On=(e,t)=>null==e||wn(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?String(e):e,$n=e=>e,In=(e,t,n)=>{const r=$n(e);return{emit:e=>jn(r,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},jn=(e,t,n)=>{const r=Lr.ce(t,n);return e.dispatchEvent(r),r},Nn=new WeakMap,Ln=(e,t,n)=>{let r=Or.get(e);Mr&&n?(r=r||new CSSStyleSheet,"string"===typeof r?r=t:r.replaceSync(t)):r=t,Or.set(e,r)},Rn=(e,t,n,r)=>{var i;let o=Mn(t,n);const a=Or.get(o);if(e=11===e.nodeType?e:jr,a)if("string"===typeof a){e=e.head||e;let t,n=Nn.get(e);if(n||Nn.set(e,n=new Set),!n.has(o)){{t=jr.createElement("style"),t.innerHTML=a;const n=null!==(i=Lr.$nonce$)&&void 0!==i?i:An(jr);null!=n&&t.setAttribute("nonce",n),e.insertBefore(t,e.querySelector("link"))}n&&n.add(o)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]);return o},Dn=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,i=pn("attachStyles",t.$tagName$),o=Rn(n.shadowRoot?n.shadowRoot:n.getRootNode(),t,e.$modeName$);10&r&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&r&&n.classList.add(o+"-s")),i()},Mn=(e,t)=>"sc-"+(t&&32&e.$flags$?e.$tagName$+"-"+t:e.$tagName$),Bn=(e,t,n,r,i,o)=>{if(n!==r){let s=Cr(e,t),l=t.toLowerCase();if("class"===t){const t=e.classList,i=zn(n),o=zn(r);t.remove(...i.filter(e=>e&&!o.includes(e))),t.add(...o.filter(e=>e&&!i.includes(e)))}else if("style"===t){for(const t in n)r&&null!=r[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in r)n&&r[t]===n[t]||(t.includes("-")?e.style.setProperty(t,r[t]):e.style[t]=r[t])}else if("key"===t);else if("ref"===t)r&&r(e);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){const u=wn(r);if((s||u&&null!==r)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{const i=null==r?"":r;"list"===t?s=!1:null!=n&&e[t]==i||(e[t]=i)}}catch(a){}let c=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(t=l,c=!0),null==r||!1===r?!1===r&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(gn,t):e.removeAttribute(t)):(!s||4&o||i)&&!u&&(r=!0===r?"":r,c?e.setAttributeNS(gn,t,r):e.setAttribute(t,r))}else t="-"===t[2]?t.slice(3):Cr(Ir,l)?l.slice(2):l[2]+t.slice(3),n&&Lr.rel(e,t,n,!1),r&&Lr.ael(e,t,r,!1)}},Un=/\s/,zn=e=>e?e.split(Un):[],Fn=(e,t,n,r)=>{const i=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,o=e&&e.$attrs$||mn,a=t.$attrs$||mn;for(r in o)r in a||Bn(i,r,o[r],void 0,n,t.$flags$);for(r in a)Bn(i,r,o[r],a[r],n,t.$flags$)},Hn=(e,t,n,r)=>{const i=t.$children$[n];let o,a,s,l=0;if(ln||(cn=!0,"slot"===i.$tag$&&(on&&r.classList.add(on+"-s"),i.$flags$|=i.$children$?2:1)),null!==i.$text$)o=i.$elm$=jr.createTextNode(i.$text$);else if(1&i.$flags$)o=i.$elm$=jr.createTextNode("");else{if(dn||(dn="svg"===i.$tag$),o=i.$elm$=jr.createElementNS(dn?vn:yn,2&i.$flags$?"slot-fb":i.$tag$),dn&&"foreignObject"===i.$tag$&&(dn=!1),Fn(null,i,dn),bn(on)&&o["s-si"]!==on&&o.classList.add(o["s-si"]=on),i.$children$)for(l=0;l{Lr.$flags$|=1;const n=e.childNodes;for(let r=n.length-1;r>=0;r--){const e=n[r];e["s-hn"]!==sn&&e["s-ol"]&&(Kn(e).insertBefore(e,Yn(e)),e["s-ol"].remove(),e["s-ol"]=void 0,cn=!0),t&&Wn(e,t)}Lr.$flags$&=-2},Vn=(e,t,n,r,i,o)=>{let a,s=e["s-cr"]&&e["s-cr"].parentNode||e;for(s.shadowRoot&&s.tagName===sn&&(s=s.shadowRoot);i<=o;++i)r[i]&&(a=Hn(null,n,i,e),a&&(r[i].$elm$=a,s.insertBefore(a,Yn(t))))},qn=(e,t,n,r,i)=>{for(;t<=n;++t)(r=e[t])&&(i=r.$elm$,nr(r),un=!0,i["s-ol"]?i["s-ol"].remove():Wn(i,!0),i.remove())},Qn=(e,t,n,r)=>{let i,o,a=0,s=0,l=0,u=0,c=t.length-1,d=t[0],h=t[c],f=r.length-1,p=r[0],g=r[f];while(a<=c&&s<=f)if(null==d)d=t[++a];else if(null==h)h=t[--c];else if(null==p)p=r[++s];else if(null==g)g=r[--f];else if(Gn(d,p))Jn(d,p),d=t[++a],p=r[++s];else if(Gn(h,g))Jn(h,g),h=t[--c],g=r[--f];else if(Gn(d,g))"slot"!==d.$tag$&&"slot"!==g.$tag$||Wn(d.$elm$.parentNode,!1),Jn(d,g),e.insertBefore(d.$elm$,h.$elm$.nextSibling),d=t[++a],g=r[--f];else if(Gn(h,p))"slot"!==d.$tag$&&"slot"!==g.$tag$||Wn(h.$elm$.parentNode,!1),Jn(h,p),e.insertBefore(h.$elm$,d.$elm$),h=t[--c],p=r[++s];else{for(l=-1,u=a;u<=c;++u)if(t[u]&&null!==t[u].$key$&&t[u].$key$===p.$key$){l=u;break}l>=0?(o=t[l],o.$tag$!==p.$tag$?i=Hn(t&&t[s],n,l,e):(Jn(o,p),t[l]=void 0,i=o.$elm$),p=r[++s]):(i=Hn(t&&t[s],n,s,e),p=r[++s]),i&&Kn(d.$elm$).insertBefore(i,Yn(d.$elm$))}a>c?Vn(e,null==r[f+1]?null:r[f+1].$elm$,n,r,s,f):s>f&&qn(t,a,c)},Gn=(e,t)=>e.$tag$===t.$tag$&&("slot"===e.$tag$?e.$name$===t.$name$:e.$key$===t.$key$),Yn=e=>e&&e["s-ol"]||e,Kn=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,Jn=(e,t)=>{const n=t.$elm$=e.$elm$,r=e.$children$,i=t.$children$,o=t.$tag$,a=t.$text$;let s;null===a?(dn="svg"===o||"foreignObject"!==o&&dn,"slot"===o||Fn(e,t,dn),null!==r&&null!==i?Qn(n,r,t,i):null!==i?(null!==e.$text$&&(n.textContent=""),Vn(n,null,t,i,0,i.length-1)):null!==r&&qn(r,0,r.length-1),dn&&"svg"===o&&(dn=!1)):(s=n["s-cr"])?s.parentNode.textContent=a:e.$text$!==a&&(n.data=a)},Zn=e=>{const t=e.childNodes;let n,r,i,o,a,s;for(r=0,i=t.length;r{let t,n,r,i,o,a,s=0;const l=e.childNodes,u=l.length;for(;s=0;a--)n=r[a],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(tr(n,i)?(o=Xn.find(e=>e.$nodeToRelocate$===n),un=!0,n["s-sn"]=n["s-sn"]||i,o?o.$slotRefNode$=t:Xn.push({$slotRefNode$:t,$nodeToRelocate$:n}),n["s-sr"]&&Xn.map(e=>{tr(e.$nodeToRelocate$,n["s-sn"])&&(o=Xn.find(e=>e.$nodeToRelocate$===n),o&&!e.$slotRefNode$&&(e.$slotRefNode$=o.$slotRefNode$))})):Xn.some(e=>e.$nodeToRelocate$===n)||Xn.push({$nodeToRelocate$:n}));1===t.nodeType&&er(t)}},tr=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,nr=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(nr)},rr=(e,t)=>{const n=e.$hostElement$,r=e.$cmpMeta$,i=e.$vnode$||kn(null,null),o=En(t)?t:_n(null,null,t);if(sn=n.tagName,r.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},r.$attrsToReflect$.map(([e,t])=>o.$attrs$[t]=n[e])),o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=i.$elm$=n.shadowRoot||n,on=n["s-sc"],an=n["s-cr"],ln=0!==(1&r.$flags$),un=!1,Jn(i,o),Lr.$flags$|=1,cn){let e,t,n,r,i,a;er(o.$elm$);let s=0;for(;s{},or=(e,t)=>{e.$flags$|=16,ir(e,e.$ancestorComponent$);const n=()=>ar(e,t);return Vr(n)},ar=(e,t)=>{const n=e.$hostElement$,r=pn("scheduleUpdate",e.$cmpMeta$.$tagName$),i=n;let o;return o=cr(i,t?"componentWillLoad":"componentWillUpdate"),o=dr(o,()=>cr(i,"componentWillRender")),r(),dr(o,()=>sr(e,i,t))},sr=(e,t,n)=>a(void 0,null,function*(){const r=e.$hostElement$,i=pn("update",e.$cmpMeta$.$tagName$);r["s-rc"],n&&Dn(e);const o=pn("render",e.$cmpMeta$.$tagName$);lr(e,t,r),o(),i(),ur(e)}),lr=(e,t,n)=>{const r=!1,i=!1,o=!0,a=!0;try{hn=t,t=(r||t.render)&&t.render(),a&&o&&(e.$flags$&=-17),(a||i)&&(e.$flags$|=2),(rn.hasRenderFn||rn.reflect)&&(rn.vdomRender||rn.reflect)&&(rn.hydrateServerSide||rr(e,t))}catch(s){Pr(s,e.$hostElement$)}return hn=null,null},ur=e=>{const t=e.$cmpMeta$.$tagName$,n=e.$hostElement$,r=pn("postUpdate",t),i=n;e.$ancestorComponent$,cr(i,"componentDidRender"),64&e.$flags$?(cr(i,"componentDidUpdate"),r()):(e.$flags$|=64,cr(i,"componentDidLoad"),r())},cr=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(r){Pr(r)}},dr=(e,t)=>e&&e.then?e.then(t):t(),hr=(e,t)=>xr(e).$instanceValues$.get(t),fr=(e,t,n,r)=>{const i=xr(e),o=e,a=i.$instanceValues$.get(t),s=i.$flags$,l=o;n=On(n,r.$members$[t][0]);const u=Number.isNaN(a)&&Number.isNaN(n),c=n!==a&&!u;if(c){if(i.$instanceValues$.set(t,n),r.$watchers$&&128&s){const e=r.$watchers$[t];e&&e.map(e=>{try{l[e](n,a,t)}catch(r){Pr(r,o)}})}if(2===(18&s)){if(l.componentShouldUpdate&&!1===l.componentShouldUpdate(n,a,t))return;or(i,!1)}}},pr=(e,t,n)=>{if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const n=Object.entries(t.$members$),r=e.prototype;n.map(([e,[n]])=>{(31&n||32&n)&&Object.defineProperty(r,e,{get(){return hr(this,e)},set(n){fr(this,e,n,t)},configurable:!0,enumerable:!0})});{const i=new Map;r.attributeChangedCallback=function(e,t,n){Lr.jmp(()=>{const t=i.get(e);if(this.hasOwnProperty(t))n=this[t],delete this[t];else if(r.hasOwnProperty(t)&&"number"===typeof this[t]&&this[t]==n)return;this[t]=(null!==n||"boolean"!==typeof this[t])&&n})},e.observedAttributes=n.filter(([e,t])=>15&t[0]).map(([e,n])=>{const r=n[1]||e;return i.set(r,e),512&n[0]&&t.$attrsToReflect$.push([e,r]),r})}}return e},gr=(e,t,n,r,i)=>a(void 0,null,function*(){if(0===(32&t.$flags$)&&(i=e.constructor,t.$flags$|=32,customElements.whenDefined(n.$tagName$).then(()=>t.$flags$|=128),i.style)){let r=i.style;"string"!==typeof r&&(r=r[t.$modeName$=Pn(e)]);const o=Mn(n,t.$modeName$);if(!Or.has(o)){const e=pn("registerStyles",n.$tagName$);Ln(o,r,!!(1&n.$flags$)),e()}}t.$ancestorComponent$;const r=()=>or(t,!0);r()}),mr=e=>{},vr=e=>{if(0===(1&Lr.$flags$)){const t=xr(e),n=t.$cmpMeta$,r=pn("connectedCallback",n.$tagName$);1&t.$flags$?(Ar(e,t,n.$listeners$),mr(t.$lazyInstance$)):(t.$flags$|=1,12&n.$flags$&&yr(e),n.$members$&&Object.entries(n.$members$).map(([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}}),gr(e,t,n)),r()}},yr=e=>{const t=e["s-cr"]=jr.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},br=e=>{if(0===(1&Lr.$flags$)){const t=xr(e);t.$rmListeners$&&(t.$rmListeners$.map(e=>e()),t.$rmListeners$=void 0)}},wr=(e,t)=>{const n={$flags$:t[0],$tagName$:t[1]};n.$members$=t[2],n.$listeners$=t[3],n.$watchers$=e.$watchers$,n.$attrsToReflect$=[];const r=e.prototype.connectedCallback,i=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){Tr(this,n)},connectedCallback(){vr(this),r&&r.call(this)},disconnectedCallback(){br(this),i&&i.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(16&n.$flags$)})}}),e.is=n.$tagName$,pr(e,n)},Ar=(e,t,n,r)=>{n&&n.map(([n,r,i])=>{const o=kr(e,n),a=_r(t,i),s=Sr(n);Lr.ael(o,r,a,s),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>Lr.rel(o,r,a,s))})},_r=(e,t)=>n=>{try{rn.lazyLoad||e.$hostElement$[t](n)}catch(r){Pr(r)}},kr=(e,t)=>4&t?jr:8&t?Ir:16&t?jr.body:e,Sr=e=>Rr?{passive:0!==(1&e),capture:0!==(2&e)}:0!==(2&e),Er=new WeakMap,xr=e=>Er.get(e),Tr=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return Ar(e,n,t.$listeners$),Er.set(e,n)},Cr=(e,t)=>t in e,Pr=(e,t)=>(0,console.error)(e,t),Or=new Map,$r=[],Ir="undefined"!==typeof window?window:{},jr=Ir.document||{head:{}},Nr=Ir.HTMLElement||class{},Lr={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},Rr=(()=>{let e=!1;try{jr.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(t){}return e})(),Dr=e=>Promise.resolve(e),Mr=(()=>{try{return new CSSStyleSheet,"function"===typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Br=[],Ur=[],zr=(e,t)=>n=>{e.push(n),fn||(fn=!0,t&&4&Lr.$flags$?Wr(Hr):Lr.raf(Hr))},Fr=e=>{for(let n=0;n{Fr(Br),Fr(Ur),(fn=Br.length>0)&&Lr.raf(Hr)},Wr=e=>Dr().then(e),Vr=zr(Ur,!0);function qr(e){var t;null===(t=null===e||void 0===e?void 0:e.childNodes)||void 0===t||t.forEach(e=>{e.nodeType===document.COMMENT_NODE&&e["s-cn"]&&(e["s-cn"]=!1),e.nodeType!==document.COMMENT_NODE&&e["s-sr"]&&(e["s-sr"]=!1)})}function Qr(e,t,n){return n={path:t,exports:{},require:function(e,t){return Gr()}},e(n,n.exports),n.exports}function Gr(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Yr=Qr(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t{this.touch&&(this.hover=!0)},this.hoverStartTime))}onTouchEnd(){this.disabled||(this.touch=!1,this.hoverClass&&!this.disabled&&setTimeout(()=>{this.touch||(this.hover=!1)},this.hoverStayTime),"submit"===this.formType?this.onSubmit.emit():"reset"===this.formType&&this.onReset.emit())}render(){const{disabled:e,hoverClass:t,type:n,size:r,plain:i,loading:o,hover:a}=this,s=Yr({[`${t}`]:a&&!e});return _n(Sn,{class:s,type:n,plain:i,loading:o,size:r,disabled:e},o&&_n("i",{class:"weui-loading"}),_n("slot",null))}get el(){return this}static get style(){return Kr}},[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[513,"form-type"],hover:[32],touch:[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]);function Zr(){if("undefined"===typeof customElements)return;const e=["taro-button-core"];e.forEach(e=>{switch(e){case"taro-button-core":customElements.get(e)||customElements.define(e,Jr);break}})}const Xr=Zr,ei='img[src=""]{opacity:0}taro-image-core{width:320px;height:240px;font-size:0;display:inline-block;position:relative;overflow:hidden}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-scaletofill{width:100%;height:100%}.taro-img__mode-aspectfit{max-width:100%;max-height:100%;position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-aspectfill{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.taro-img__mode-aspectfill--width{min-width:100%;height:100%}.taro-img__mode-aspectfill--height{width:100%;min-height:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-heightfix{height:100%}.taro-img__mode-top{position:absolute;left:50%;transform:translate(-50%)}.taro-img__mode-bottom{position:absolute;bottom:0;left:50%;transform:translate(-50%)}.taro-img__mode-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.taro-img__mode-left{position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-right{position:absolute;top:50%;right:0;transform:translateY(-50%)}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{position:absolute;bottom:0}.taro-img__mode-bottomright{position:absolute;bottom:0;right:0}',ti=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onLoad=In(this,"load",7),this.onError=In(this,"error",7),this.src=void 0,this.mode="scaleToFill",this.lazyLoad=!1,this.nativeProps={},this.aspectFillMode="width",this.didLoad=!1}componentDidLoad(){if(!this.lazyLoad)return;const e=new IntersectionObserver(t=>{t[t.length-1].isIntersecting&&(e.unobserve(this.imgRef),this.didLoad=!0)},{rootMargin:"300px 0px"});e.observe(this.imgRef)}imageOnLoad(){const{width:e,height:t,naturalWidth:n,naturalHeight:r}=this.imgRef;this.onLoad.emit({width:e,height:t}),this.aspectFillMode=n>r?"width":"height"}imageOnError(e){this.onError.emit(e)}render(){const{src:e,lazyLoad:t=!1,aspectFillMode:n="width",imageOnLoad:r,imageOnError:i,nativeProps:o,didLoad:a}=this,s=this.mode||"scaleToFill",l=Yr({"taro-img__widthfix":"widthFix"===s}),u=Yr(`taro-img__mode-${s.toLowerCase().replace(/\s/g,"")}`,{[`taro-img__mode-aspectfill--${n}`]:"aspectFill"===s});return _n(Sn,{class:l},e?_n("img",Object.assign({ref:e=>this.imgRef=e,class:u,src:t&&!a?void 0:e,onLoad:r.bind(this),onError:i.bind(this)},o)):"")}static get style(){return ei}},[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32],didLoad:[32]}]);function ni(){if("undefined"===typeof customElements)return;const e=["taro-image-core"];e.forEach(e=>{switch(e){case"taro-image-core":customElements.get(e)||customElements.define(e,ti);break}})}const ri=ni,ii=".weui-input{-webkit-appearance:none;width:100%;font-size:inherit;color:inherit;background-color:transparent;border:0;outline:0;height:1.47059em;line-height:1.47059}.weui-input::-webkit-outer-spin-button,.weui-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}taro-input-core{display:block}";function oi(e,t,n){if("search"===t&&(e="search"),n&&(e="password"),"undefined"===typeof e)return"text";if(!e)throw new Error("unexpected type");return"digit"===e&&(e="number"),e}function ai(e){return null!==e&&void 0!==e?e:""}const si=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onInput=In(this,"input",7),this.onPaste=In(this,"paste",7),this.onFocus=In(this,"focus",7),this.onBlur=In(this,"blur",7),this.onConfirm=In(this,"confirm",7),this.onChange=In(this,"change",7),this.onKeyDown=In(this,"keydown",7),this.isOnComposition=!1,this.isOnPaste=!1,this.onInputExcuted=!1,this.handleInput=e=>{e.stopPropagation();const{type:t,maxlength:n,confirmType:r,password:i}=this;if(!this.isOnComposition&&!this.onInputExcuted){let o=e.target.value;const a=oi(t,r,i);this.onInputExcuted=!0,"number"===a&&o&&n>-1&&n<=o.length&&(o=o.substring(0,n),e.target.value=o),this.value=o,this.onInput.emit({value:o,cursor:o.length}),this.onInputExcuted=!1}},this.handlePaste=e=>{e.stopPropagation(),this.isOnPaste=!0,this.onPaste.emit({value:e.target.value})},this.handleFocus=e=>{e.stopPropagation(),this.onInputExcuted=!1,this.onFocus.emit({value:e.target.value})},this.handleBlur=e=>{e.stopPropagation(),this.onBlur.emit({value:e.target.value})},this.handleChange=e=>{e.stopPropagation(),this.onChange.emit({value:e.target.value}),this.isOnPaste&&(this.isOnPaste=!1,this.value=e.target.value,this.onInput.emit({value:e.target.value,cursor:e.target.value.length}))},this.handleKeyDown=e=>{e.stopPropagation();const{value:t}=e.target,n=e.keyCode||e.code;this.onInputExcuted=!1,this.onKeyDown.emit({value:t,cursor:t.length,keyCode:n}),13===n&&this.onConfirm.emit({value:t})},this.handleComposition=e=>{e.stopPropagation(),e.target instanceof HTMLInputElement&&("compositionend"===e.type?(this.isOnComposition=!1,this.value=e.target.value,this.onInput.emit({value:e.target.value,cursor:e.target.value.length})):this.isOnComposition=!0)},this.handleBeforeInput=e=>{if(!e.data)return;const t=e.data&&/[0-9]/.test(e.data);"number"!==this.type||t||e.preventDefault(),"digit"!==this.type||t||("."!==e.data||"."===e.data&&e.target.value.indexOf(".")>-1)&&e.preventDefault()},this.value="",this.type=void 0,this.password=!1,this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.confirmType="done",this.name=void 0,this.readonly=!1,this.nativeProps={}}focus(){return a(this,null,function*(){this.inputRef.focus()})}watchAutoFocus(e,t){var n;!t&&e&&(null===(n=this.inputRef)||void 0===n||n.focus())}watchValue(e){const t=ai(e);this.inputRef.value!==t&&(this.inputRef.value=t)}componentDidLoad(){var e,t,n,r,i;"file"===this.type?(this.fileListener=()=>{this.onInput.emit()},null===(e=this.inputRef)||void 0===e||e.addEventListener("change",this.fileListener)):(null===(t=this.inputRef)||void 0===t||t.addEventListener("compositionstart",this.handleComposition),null===(n=this.inputRef)||void 0===n||n.addEventListener("compositionend",this.handleComposition),null===(r=this.inputRef)||void 0===r||r.addEventListener("beforeinput",this.handleBeforeInput),null===(i=this.inputRef)||void 0===i||i.addEventListener("textInput",this.handleBeforeInput))}disconnectedCallback(){var e,t,n,r,i;"file"===this.type?null===(e=this.inputRef)||void 0===e||e.removeEventListener("change",this.fileListener):(null===(t=this.inputRef)||void 0===t||t.removeEventListener("compositionstart",this.handleComposition),null===(n=this.inputRef)||void 0===n||n.removeEventListener("compositionend",this.handleComposition),null===(r=this.inputRef)||void 0===r||r.removeEventListener("beforeinput",this.handleBeforeInput),null===(i=this.inputRef)||void 0===i||i.removeEventListener("textInput",this.handleBeforeInput))}render(){const{value:e,type:t,password:n,placeholder:r,autoFocus:i,disabled:o,maxlength:a,confirmType:s,name:l,readonly:u,nativeProps:c}=this;return _n("input",Object.assign({ref:e=>{this.inputRef=e,i&&e&&e.focus()},class:"weui-input",type:oi(t,s,n),placeholder:r,autoFocus:i,disabled:o,maxlength:a,name:l,readonly:u?"readonly":void 0,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,onCompositionStart:this.handleComposition,onCompositionEnd:this.handleComposition},c,{value:ai(e)}))}get el(){return this}static get watchers(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}}static get style(){return ii}},[0,"taro-input-core",{value:[1025],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"focus"],confirmType:[1,"confirm-type"],name:[1],readonly:[4],nativeProps:[16],focus:[64]}]);function li(){if("undefined"===typeof customElements)return;const e=["taro-input-core"];e.forEach(e=>{switch(e){case"taro-input-core":customElements.get(e)||customElements.define(e,si);break}})}const ui=li;function ci(e,t=250,n){let r;return function(...i){const o=n||this;clearTimeout(r),r=setTimeout(function(){e.apply(o,i)},t)}}const di=102,hi=34,fi=7*hi,pi=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onColumnChange=In(this,"columnChange",7),this.mode=void 0,this.range=[],this.rangeKey=void 0,this.height=void 0,this.columnId=void 0,this.updateHeight=void 0,this.updateDay=void 0,this.startY=void 0,this.preY=void 0,this.hadMove=void 0,this.touchEnd=void 0,this.isMove=void 0}getPosition(){const e=this.touchEnd?.3:0,t=`translate3d(0, ${this.height}px, 0)`,n=`transform ${e}s`;return{transform:t,"-webkit-transform":t,transition:n,"-webkit-transition":n}}formulaUnlimitedScroll(e,t,n){const{height:r,updateHeight:i,columnId:o}=this,a="up"===n?1:-1;this.touchEnd=!1,i(-e*a*hi+r,o),requestAnimationFrame(()=>{this.touchEnd=!0;const n=Math.round(t/-hi)+e*a,r=di-hi*n;i(r,o,!0)})}handleMoveStart(e){return a(this,null,function*(){this.startY=e,this.preY=e,this.hadMove=!1})}handleMoving(e){return a(this,null,function*(){const t=e,n=t-this.preY;this.preY=t,this.touchEnd=!1,Math.abs(t-this.startY)>10&&(this.hadMove=!0);let r=this.height+n;"time"===this.mode&&("0"===this.columnId?(r>di-3*hi&&(r=di-27*hi+n),rdi-3*hi&&(r=di-63*hi+n),r2.5*-hi)return this.formulaUnlimitedScroll(24,u,"up");if(u<28.5*-hi)return this.formulaUnlimitedScroll(24,u,"down")}else if("1"===o){if(u>2.5*-hi)return this.formulaUnlimitedScroll(60,u,"up");if(u<64.5*-hi)return this.formulaUnlimitedScroll(60,u,"down")}}u>a&&(u=0),u{const n=t?e[t]:e;return _n("div",{class:"weui-picker__item"},n)});return _n(Sn,{class:"weui-picker__group"},_n("div",{class:"weui-picker__mask"}),_n("div",{class:"weui-picker__indicator"}),_n("div",{class:"weui-picker__content",style:this.getPosition()},n))}},[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32],handleMoveStart:[64],handleMoving:[64],handleMoveEnd:[64]},[[1,"mousedown","onMouseDown"],[3,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[3,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]);function gi(){if("undefined"===typeof customElements)return;const e=["taro-picker-group"];e.forEach(e=>{switch(e){case"taro-picker-group":customElements.get(e)||customElements.define(e,pi);break}})}function mi(e,t){const n=[];for(let r=e;r<=t;r++)n.push(`${r<10?"0":""}${r}`);return n}const vi=["20","21","22","23",...mi(0,23),"00","01","02","03"],yi=["56","57","58","59",...mi(0,59),"00","01","02","03"];function bi(e,t){return!isNaN(+e)&&e>=0&&e+e);return!(t[0]<0||t[0]>23)&&!(t[1]<0||t[1]>59)}function Ai(e,t){const n=e.split(":").map(e=>+e),r=t.split(":").map(e=>+e);return n[0]String(e)):e,t}function Ei(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function xi(e,t){return Ei(e,t)}function Ti(e,t,n){let r=1,i=12;return e.getFullYear()===n&&(r=e.getMonth()+1),t.getFullYear()===n&&(i=t.getMonth()+1),Ei(r,i)}function Ci(e,t,n,r){let i=1,o=ki(n,r);return e.getFullYear()===n&&e.getMonth()+1===r&&(i=e.getDate()),t.getFullYear()===n&&t.getMonth()+1===r&&(o=t.getDate()),Ei(i,o)}const Pi='.weui-mask{z-index:1000;background:rgba(0,0,0,.6);position:fixed;inset:0}.weui-mask_transparent{z-index:1000;position:fixed;inset:0}@keyframes weuiSlideUp{0%{transform:translateY(100%)}to{transform:translate(0,0)}}.weui-animate-slide-up{animation:.3s forwards weuiSlideUp}@keyframes weuiSlideDown{0%{transform:translate(0,0)}to{transform:translateY(100%)}}.weui-animate-slide-down{animation:.3s forwards weuiSlideDown}@keyframes weuiFadeIn{0%{opacity:0}to{opacity:1}}.weui-animate-fade-in{animation:.3s forwards weuiFadeIn}@keyframes weuiFadeOut{0%{opacity:1}to{opacity:0}}.weui-animate-fade-out{animation:.3s forwards weuiFadeOut}.weui-picker{box-sizing:border-box;z-index:5000;background-color:var(--weui-BG-2);width:100%;padding-left:0;padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left);padding-right:0;padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right);backface-visibility:hidden;transition:transform .3s;position:fixed;bottom:0;left:0;transform:translateY(100%)}.weui-picker__hd{text-align:center;background-color:#fff;padding:9px 15px;font-size:17px;display:flex;position:relative}.weui-picker__hd:after{content:" ";color:#e5e5e5;transform-origin:0 100%;border-bottom:1px solid #e5e5e5;height:1px;position:absolute;bottom:0;left:0;right:0;transform:scaleY(.5)}.weui-picker__action{color:#1aad19;flex:1;display:block}.weui-picker__action:first-child{text-align:left;color:#888}.weui-picker__action:last-child{text-align:right}.weui-picker__bd{background-color:#fff;height:238px;display:flex;position:relative;overflow:hidden}.weui-picker__group{flex:1;height:100%;position:relative}.weui-picker__mask{z-index:3;background-color:transparent;background-image:linear-gradient(rgba(255,255,255,.95),rgba(255,255,255,.6)),linear-gradient(rgba(255,255,255,.6),rgba(255,255,255,.95));background-position:top,bottom;background-repeat:no-repeat;background-size:100% 102px;background-attachment:scroll,scroll;background-origin:padding-box,padding-box;background-clip:border-box,border-box;width:100%;height:100%;margin:0 auto;position:absolute;top:0;left:0;transform:translateZ(0)}.weui-picker__indicator{z-index:3;width:100%;height:34px;position:absolute;top:102px;left:0}.weui-picker__indicator:before{content:" ";color:#e5e5e5;transform-origin:0 0;border-top:1px solid #e5e5e5;height:1px;position:absolute;top:0;left:0;right:0;transform:scaleY(.5)}.weui-picker__indicator:after{content:" ";color:#e5e5e5;transform-origin:0 100%;border-bottom:1px solid #e5e5e5;height:1px;position:absolute;bottom:0;left:0;right:0;transform:scaleY(.5)}.weui-picker__content{width:100%;position:absolute;top:0;left:0}.weui-picker__item{text-align:center;color:#000;text-overflow:ellipsis;white-space:nowrap;height:34px;padding:0;line-height:34px;overflow:hidden}.weui-picker__item_disabled{color:#999}.weui-picker,.weui-picker__hd{font-size:12px}',Oi=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onChange=In(this,"change",7),this.onColumnChange=In(this,"columnchange",7),this.onCancel=In(this,"cancel",7),this.index=[],this.showPicker=()=>{this.disabled||(this.height=this.getHeightByIndex(),this.hidden=!1)},this.getHeightByIndex=()=>{const e=this.index.map(e=>{let t=0;return"time"===this.mode&&(t=4*hi),di-hi*e-t});return e},this.hidePicker=()=>{this.fadeOut=!0,setTimeout(()=>{this.hidden=!0,this.fadeOut=!1},350)},this.handleChange=()=>{this.hidePicker(),this.index=this.height.map(e=>(di-e)/hi);let e=this.index.length&&"selector"!==this.mode?this.index:this.index[0];if("time"===this.mode){const t=[vi.slice(),yi.slice()],n=this.index.map((e,n)=>t[n][e]);this.index=n.map(e=>parseInt(e)),e=n.join(":")}if("date"===this.mode){const{_start:t,_end:n,_updateValue:r}=this.pickerDate,i=r[0],o=r[1],a=xi(t.getFullYear(),n.getFullYear()),s=Ti(t,n,i),l=Ci(t,n,i,o),u=a[this.index[0]],c=s[this.index[1]],d=l[this.index[2]];e="year"===this.fields?[u]:"month"===this.fields?[u,c]:[u,c,d],e=e.map(e=>e<10?`0${e}`:e).join("-")}this.value=e,this.pickerValue=this.value,this.onChange.emit({value:e})},this.handleColumnChange=e=>{const{columnId:t,height:n}=e.detail;this.onColumnChange.emit({column:Number(t),value:(di-n)/hi})},this.handleCancel=()=>{this.hidePicker(),this.onCancel.emit()},this.updateHeight=(e,t,n=!1)=>{const r=[...this.height];if(r[t]=e,this.height=r,n){let{start:e,end:t}=this;if(wi(e)||(e="00:00"),wi(t)||(t="23:59"),!Ai(e,t))return;const n=[vi.slice(),yi.slice()],r=this.height.map(e=>(di-e)/hi),i=r.map((e,t)=>n[t][e]).join(":");if(Ai(e,i)){if(!Ai(i,t)){const e=t.split(":").map(e=>di-hi*(+e+4));requestAnimationFrame(()=>this.height=e)}}else{const t=e.split(":").map(e=>di-hi*(+e+4));requestAnimationFrame(()=>this.height=t)}}},this.updateDay=(e,t)=>{const{_start:n,_end:r,_updateValue:i}=this.pickerDate;i[t]=e;const o=i[0],a=i[1],s=i[2];if(0===t){const e=Ti(n,r,o),t=e[e.length-1],s=e[0];a>t&&(i[1]=t),at&&(i[2]=t),s_n("taro-picker-group",{range:this.range,rangeKey:this.rangeKey,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),this.getMultiSelector=()=>this.range.map((e,t)=>_n("taro-picker-group",{range:e,rangeKey:this.rangeKey,height:this.height[t],updateHeight:this.updateHeight,onColumnChange:this.handleColumnChange,columnId:String(t)})),this.getTimeSelector=()=>{const e=vi.slice(),t=yi.slice();return[_n("taro-picker-group",{mode:"time",range:e,height:this.height[0],updateHeight:this.updateHeight,columnId:"0"}),_n("taro-picker-group",{mode:"time",range:t,height:this.height[1],updateHeight:this.updateHeight,columnId:"1"})]},this.getDateSelector=()=>{const{fields:e,height:t}=this,{_start:n,_end:r,_updateValue:i}=this.pickerDate,o=i[0],a=i[1],s=xi(n.getFullYear(),r.getFullYear()).map(e=>`${e}\u5e74`),l=Ti(n,r,o).map(e=>`${e<10?`0${e}`:e}\u6708`),u=Ci(n,r,o,a).map(e=>`${e<10?`0${e}`:e}\u65e5`),c=[_n("taro-picker-group",{mode:"date",range:s,height:t[0],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"0"})];return"month"!==e&&"day"!==e||c.push(_n("taro-picker-group",{mode:"date",range:l,height:t[1],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"1"})),"day"===e&&c.push(_n("taro-picker-group",{mode:"date",range:u,height:t[2],updateDay:this.updateDay,updateHeight:this.updateHeight,columnId:"2"})),c},this.mode="selector",this.disabled=!1,this.range=[],this.rangeKey=void 0,this.value=void 0,this.start="",this.end="",this.fields="day",this.name="",this.textProps={},this.pickerValue=[],this.height=[],this.hidden=!0,this.fadeOut=!1,this.isWillLoadCalled=!1}componentWillLoad(){this.isWillLoadCalled=!0,this.handleProps()}componentDidLoad(){this.overlay&&document.body.appendChild(this.overlay)}disconnectedCallback(){var e;this.overlay&&(null===(e=this.overlay.parentNode)||void 0===e||e.removeChild(this.overlay))}onPropsChange(){this.isWillLoadCalled&&this.handleProps()}handleProps(){const{mode:e,start:t,end:n}=this;if("selector"===e){const e=this.value;this.index=[bi(e,this.range)?Math.floor(e):0]}else if("multiSelector"===e){const e=this.value;this.index=[],this.range.forEach((t,n)=>{const r=null===e||void 0===e?void 0:e[n],i=bi(r,t)?Math.floor(r):0;this.index.push(i)})}else if("time"===e){let e=this.value;wi(e)||(console.warn("time picker value illegal"),e="0:0");const t=e.split(":").map(e=>+e);this.index=t}else{if("date"!==e)throw new Error(`Picker not support "${e}" mode.`);{const e=this.value;let r=_i(e)||new Date((new Date).setHours(0,0,0,0));const i=_i(t)||new Date("1970/01/01"),o=_i(n)||new Date("2999/01/01");if(!(i<=o))throw new Error("Picker start time must be less than end time.");r>=i&&r<=o||(r=i);const a=r.getFullYear(),s=r.getMonth()+1,l=r.getDate(),u=xi(i.getFullYear(),o.getFullYear()),c=Ti(i,o,a),d=Ci(i,o,a,s);this.index=[u.indexOf(a),c.indexOf(s),d.indexOf(l)],this.pickerDate&&this.pickerDate._value.getTime()===r.getTime()&&this.pickerDate._start.getTime()===i.getTime()&&this.pickerDate._end.getTime()===o.getTime()||(this.pickerDate={_value:r,_start:i,_end:o,_updateValue:[a,s,l]})}}if(this.height=this.getHeightByIndex(),this.pickerValue=this.value,"date"===e){const e=this.pickerValue;"month"===this.fields?this.pickerValue=e.split("-").slice(0,2).join("-"):"year"===this.fields&&(this.pickerValue=e.split("-")[0])}}render(){var e,t;const{name:n,mode:r,fadeOut:i,hidden:o}=this;let a;switch(r){case"multiSelector":a=this.getMultiSelector();break;case"time":a=this.getTimeSelector();break;case"date":a=this.getDateSelector();break;default:a=this.getSelector()}const s=Yr("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":i}),l=Yr("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":i}),u=o?{display:"none"}:{};return _n(Sn,null,_n("div",{onClick:this.showPicker},_n("slot",null),_n("input",{type:"hidden",name:n,value:Si(this.pickerValue)})),_n("div",{class:"weui-picker__overlay",style:u,ref:e=>{this.overlay=e}},_n("div",{class:s,onClick:this.handleCancel}),_n("div",{class:l},_n("div",{class:"weui-picker__hd"},_n("div",{class:"weui-picker__action",onClick:this.handleCancel},null!==(e=this.textProps.cancelText)&&void 0!==e?e:"\u53d6\u6d88"),_n("div",{class:"weui-picker__action",onClick:this.handleChange},null!==(t=this.textProps.okText)&&void 0!==t?t:"\u786e\u5b9a")),_n("div",{class:"weui-picker__bd"},a),_n("input",{type:"hidden",name:n,value:Si(this.pickerValue)}))))}get el(){return this}static get watchers(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}}static get style(){return Pi}},[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[1032],start:[1],end:[1],fields:[1],name:[1],textProps:[16],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}]);function $i(){if("undefined"===typeof customElements)return;const e=["taro-picker-core","taro-picker-group"];e.forEach(e=>{switch(e){case"taro-picker-core":customElements.get(e)||customElements.define(e,Oi);break;case"taro-picker-group":customElements.get(e)||gi();break}})}const Ii=$i,ji=".rmc-pull-to-refresh-content{transform-origin:0 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{text-align:center;height:30px;line-height:10px}.rmc-pull-to-refresh-indicator>div{background-color:gray;border-radius:100%;width:6px;height:6px;margin:3px;animation:.5s linear infinite both rmc-pull-to-refresh-indicator;display:inline-block}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";function Ni(e,t){e.transform=t,e.webkitTransform=t,e.MozTransform=t}const Li="undefined"!==typeof navigator&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),Ri={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};let Di=!1;try{const e=Object.defineProperty({},"passive",{get(){Di=!0}});window.addEventListener("cancel",()=>({}),e)}catch(wT){}const Mi=!!Di&&{passive:!1},Bi=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onRefresh=In(this,"refresh",7),this._ScreenY=0,this._startScreenY=0,this._lastScreenY=0,this._isMounted=!1,this.triggerPullDownRefresh=e=>{!this.dragOnEdge&&this._isMounted&&(e?(this._lastScreenY=this.distanceToRefresh+1,this.currSt="release",this.setContentStyle(this._lastScreenY)):(this.currSt="finish",this.reset()))},this.init=()=>{const e=this.scrollContainer,t=this.el.querySelector(".rmc-pull-to-refresh-content");this.el.appendChild=null===t||void 0===t?void 0:t.appendChild.bind(t),this.el.insertBefore=null===t||void 0===t?void 0:t.insertBefore.bind(t),this.el.replaceChild=null===t||void 0===t?void 0:t.replaceChild.bind(t),this.el.removeChild=null===t||void 0===t?void 0:t.removeChild.bind(t),this._to={touchstart:this.onTouchStart.bind(this,e),touchmove:this.onTouchMove.bind(this,e),touchend:this.onTouchEnd.bind(this,e),touchcancel:this.onTouchEnd.bind(this,e)},Object.keys(this._to).forEach(t=>{e.addEventListener(t,this._to[t],Mi)})},this.destroy=()=>{if(!this._to)return;const e=this.scrollContainer;Object.keys(this._to).forEach(t=>{e.removeEventListener(t,this._to[t])})},this.onTouchStart=(e,t)=>{this._ScreenY=this._startScreenY=t.touches[0].screenY,this._lastScreenY=this._lastScreenY||0},this.isEdge=e=>{const t=this.scrollContainer;if(t&&t===document.body){const e=document.scrollingElement?document.scrollingElement:document.body;return e.scrollTop<=0}return e.scrollTop<=0},this.damp=e=>{if(Math.abs(this._lastScreenY)>this.damping)return 0;const t=Math.abs(this._ScreenY-this._startScreenY)/window.screen.height;return e*=.6*(1-t),e},this.onTouchMove=(e,t)=>{const n=t.touches[0].screenY;if(!(this._startScreenY>n)&&this.isEdge(e)){this.dragOnEdge||(this._ScreenY=this._startScreenY=t.touches[0].screenY,this.dragOnEdge=!0),t.cancelable&&t.preventDefault();const e=Math.round(n-this._ScreenY);this._ScreenY=n,this._lastScreenY+=this.damp(e),this.setContentStyle(this._lastScreenY),Math.abs(this._lastScreenY){this.dragOnEdge&&(this.dragOnEdge=!1),"activate"===this.currSt?(this.currSt="release",this.onRefresh.emit(this),this._lastScreenY=this.distanceToRefresh+1,this.setContentStyle(this._lastScreenY)):"release"===this.currSt?(this._lastScreenY=this.distanceToRefresh+1,this.setContentStyle(this._lastScreenY)):this.reset()},this.reset=()=>{this._lastScreenY=0,this.setContentStyle(0)},this.setContentStyle=e=>{this.contentRef&&Ni(this.contentRef.style,e?`translate3d(0px,${e}px,0)`:"")},this.prefixCls="rmc-pull-to-refresh",this.distanceToRefresh=50,this.damping=100,this.indicator=Ri,this.currSt="deactivate",this.dragOnEdge=!1}get scrollContainer(){return this.el.parentElement||this.el.closest(".taro_page_stationed")||document.querySelector(".taro_page_stationed")||document.querySelector(".taro_page")||document.querySelector(".taro_router")||document.querySelector(".taro-tabbar__panel")||document.body}statusChange(){var e,t,n,r;const i=this.scrollContainer;switch(this.currSt){case"release":null===(t=null===(e=null===i||void 0===i?void 0:i.__page)||void 0===e?void 0:e.onPullDownRefresh)||void 0===t||t.call(e);break;case"deactivate":null===(r=null===(n=null===i||void 0===i?void 0:i.__page)||void 0===n?void 0:n.onPullIntercept)||void 0===r||r.call(n)}}disconnectedCallback(){this.destroy()}componentDidLoad(){this.init(),this._isMounted=!0,Jl.eventCenter.on("__taroStartPullDownRefresh",({successHandler:e,errorHandler:t})=>{try{this.triggerPullDownRefresh(!0),e({errMsg:"startPullDownRefresh: ok"})}catch(wT){t({errMsg:"startPullDownRefresh: fail"})}}),Jl.eventCenter.on("__taroStopPullDownRefresh",({successHandler:e,errorHandler:t})=>{setTimeout(()=>{try{this.triggerPullDownRefresh(!1),e({errMsg:"stopPullDownRefresh: ok"})}catch(wT){t({errMsg:"stopPullDownRefresh: fail"})}},0)})}render(){const e=e=>{const{currSt:t,dragOnEdge:n,prefixCls:r}=this,i=Yr(e,!n&&`${r}-transition`),o="activate"===t||"release"===t;return _n("div",{class:`${r}-content-wrapper`},_n("div",{class:i,ref:e=>{this.contentRef=e}},o&&_n("div",{class:`${r}-indicator`},_n("div",null),_n("div",null),_n("div",null)),_n("slot",null)))};return this.scrollContainer?e(`${this.prefixCls}-content ${this.prefixCls}-down`):_n(Sn,{class:Yr(this.prefixCls,`${this.prefixCls}-down`)},e(`${this.prefixCls}-content`))}get el(){return this}static get watchers(){return{currSt:["statusChange"]}}static get style(){return ji}},[4,"taro-pull-to-refresh-core",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]);function Ui(){if("undefined"===typeof customElements)return;const e=["taro-pull-to-refresh-core"];e.forEach(e=>{switch(e){case"taro-pull-to-refresh-core":customElements.get(e)||customElements.define(e,Bi);break}})}const zi=Ui,Fi="taro-scroll-view-core{-webkit-overflow-scrolling:touch;width:100%;display:block}.taro-scroll-view__scroll-x{overflow:scroll hidden}.taro-scroll-view__scroll-y{overflow:hidden scroll}.taro-scroll--hidebar::-webkit-scrollbar{display:none}";function Hi(e,t,n=500,r){if(e===t||"number"!==typeof e)return;const i=t-e,o=Date.now(),a=t>=e;function s(e,t,n,r){return n*e/r+t}function l(){e=s(Date.now()-o,e,i,n),a&&e>=t||!a&&t>=e?r(t):(r(e),requestAnimationFrame(l))}l()}const Wi=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onScroll=In(this,"scroll",3),this.onScrollToUpper=In(this,"scrolltoupper",3),this.onScrollToLower=In(this,"scrolltolower",3),this._scrollLeft=0,this._scrollTop=0,this.upperAndLower=ci(()=>{const{offsetWidth:e,offsetHeight:t,scrollLeft:n,scrollTop:r,scrollHeight:i,scrollWidth:o}=this.el,a=Number(this.lowerThreshold),s=Number(this.upperThreshold);!isNaN(a)&&(this.scrollY&&t+r+a>=i||this.scrollX&&e+n+a>=o)&&this.onScrollToLower.emit({direction:this.scrollX?"right":this.scrollY?"bottom":""}),!isNaN(s)&&(this.scrollY&&r<=s||this.scrollX&&n<=s)&&this.onScrollToUpper.emit({direction:this.scrollX?"left":this.scrollY?"top":""})},200),this.scrollX=!1,this.scrollY=!1,this.upperThreshold=50,this.lowerThreshold=50,this.mpScrollTop=void 0,this.mpScrollLeft=void 0,this.mpScrollIntoView=void 0,this.mpScrollIntoViewAlignment=void 0,this.animated=!1,this.enhanced=!1,this.showScrollbar=!0}watchScrollLeft(e){const t=Number(e),{animated:n}=this;this.mpScrollToMethod({left:t,animated:n})}watchScrollTop(e){const t=Number(e),{animated:n}=this;this.mpScrollToMethod({top:t,animated:n})}watchScrollIntoView(e){this.mpScrollIntoViewMethod(e)}handleScroll(e){var t;if(e instanceof CustomEvent)return;e.stopPropagation(),null===(t=e.stopImmediatePropagation)||void 0===t||t.call(e);const{scrollLeft:n,scrollTop:r,scrollHeight:i,scrollWidth:o}=this.el;this._scrollLeft=n,this._scrollTop=r,this.upperAndLower(),this.onScroll.emit({scrollLeft:n,scrollTop:r,scrollHeight:i,scrollWidth:o})}handleTouchMove(e){e instanceof CustomEvent||e.stopPropagation()}mpScrollToMethod(e){return a(this,null,function*(){let{top:t,left:n,duration:r,animated:i=!1}=e;this.scrollY&&"number"===typeof t&&!isNaN(t)&&t!==this._scrollTop&&(i?Hi(this._scrollTop,t,r,e=>this.el.scrollTop=e):this.el.scrollTop=t,this._scrollTop=t),this.scrollX&&"number"===typeof n&&!isNaN(n)&&n!==this._scrollLeft&&(i?Hi(this._scrollLeft,n,r,e=>this.el.scrollLeft=e):this.el.scrollLeft=n,this._scrollLeft=n)})}mpScrollIntoViewMethod(e){return a(this,null,function*(){var t;"string"===typeof e&&e&&(null===(t=document.querySelector(`#${e}`))||void 0===t||t.scrollIntoView({behavior:this.animated?"smooth":"auto",block:this.scrollY&&this.mpScrollIntoViewAlignment||"center",inline:this.scrollX&&this.mpScrollIntoViewAlignment||"start"}))})}componentDidLoad(){const e=Number(this.mpScrollTop),t=Number(this.mpScrollLeft),{animated:n}=this;this.mpScrollToMethod({top:e,left:t,animated:n})}componentDidRender(){qr(this.el)}render(){const{scrollX:e,scrollY:t,enhanced:n,showScrollbar:r}=this,i=Yr({"taro-scroll-view__scroll-x":e,"taro-scroll-view__scroll-y":t,"taro-scroll--hidebar":!0===n&&!1===r,"taro-scroll--enhanced":!0===n});return _n(Sn,{class:i},_n("slot",null))}get el(){return this}static get watchers(){return{mpScrollLeft:["watchScrollLeft"],mpScrollTop:["watchScrollTop"],mpScrollIntoView:["watchScrollIntoView"]}}static get style(){return Fi}},[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[520,"scroll-top"],mpScrollLeft:[520,"scroll-left"],mpScrollIntoView:[513,"scroll-into-view"],mpScrollIntoViewAlignment:[1,"scroll-into-view-alignment"],animated:[4,"scroll-with-animation"],enhanced:[4],showScrollbar:[4,"show-scrollbar"],mpScrollToMethod:[64],mpScrollIntoViewMethod:[64]},[[1,"scroll","handleScroll"],[1,"touchmove","handleTouchMove"]]]);function Vi(){if("undefined"===typeof customElements)return;const e=["taro-scroll-view-core"];e.forEach(e=>{switch(e){case"taro-scroll-view-core":customElements.get(e)||customElements.define(e,Wi);break}})}const qi=Vi,Qi="taro-text-core{user-select:none;display:inline}taro-text-core[selectable=true],taro-text-core[user-select=true]{user-select:text;display:inline-block}taro-text-core[space]{white-space:pre-wrap}taro-text-core[space=ensp]{word-spacing:.5em}taro-text-core[space=nbsp]{word-spacing:1em}taro-text-core[number-of-lines]{--line-clamp:2;word-wrap:break-word;text-overflow:ellipsis;-webkit-line-clamp:var(--line-clamp);-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}",Gi=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.selectable=!1,this.userSelect=!1,this.space=void 0,this.numberOfLines=void 0}render(){const e={};return"number"===typeof this.numberOfLines&&(e["--line-clamp"]=this.numberOfLines),_n(Sn,{style:e},_n("slot",null))}static get style(){return Qi}},[4,"taro-text-core",{selectable:[1028],userSelect:[1028,"user-select"],space:[1025],numberOfLines:[2,"number-of-lines"]}]);function Yi(){if("undefined"===typeof customElements)return;const e=["taro-text-core"];e.forEach(e=>{switch(e){case"taro-text-core":customElements.get(e)||customElements.define(e,Gi);break}})}const Ki=Yi,Ji="taro-textarea-core{width:300px;display:block}taro-textarea-core .auto-height{height:auto}.taro-textarea{width:100%;height:inherit;appearance:none;cursor:auto;border:0;line-height:1.5;display:block;position:relative}.taro-textarea:focus{outline:none}";function Zi(e){return null!==e&&void 0!==e?e:""}const Xi=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onInput=In(this,"input",7),this.onFocus=In(this,"focus",7),this.onBlur=In(this,"blur",7),this.onConfirm=In(this,"confirm",7),this.onChange=In(this,"change",7),this.onLineChange=In(this,"linechange",7),this.onKeyDown=In(this,"keydown",7),this.handleInput=e=>{e.stopPropagation(),this.handleLineChange();const t=e.target.value||"";this.value=t,this.onInput.emit({value:t,cursor:t.length})},this.handleFocus=e=>{e.stopPropagation(),this.onFocus.emit({value:e.target.value})},this.handleBlur=e=>{e.stopPropagation(),this.onBlur.emit({value:e.target.value})},this.handleChange=e=>{e.stopPropagation(),this.onChange.emit({value:e.target.value})},this.handleLineChange=()=>{const e=this.getNumberOfLines();e!==this.line&&(this.line=e,this.onLineChange.emit({height:this.textareaRef.clientHeight,lineCount:this.line}))},this.handleKeyDown=e=>{e.stopPropagation();const{value:t}=e.target,n=e.keyCode||e.code;this.onKeyDown.emit({value:t,cursor:t.length,keyCode:n}),13===n&&this.onConfirm.emit({value:t})},this.calculateContentHeight=(e,t)=>{let n=e.style.height,r=e.offsetHeight,i=e.scrollHeight,o=e.style.overflow,a=e.style.minHeight||null;if(!(r>=i))return i;if(e.style.minHeight=0,e.style.height=r+t+"px",e.style.overflow="hidden",i=e.scrollHeight)e.style.height=(r-=t)+"px";while(e.offsetHeight{const e=this.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),r=this.calculateContentHeight(e,n),i=Math.floor(r/n);return i},this.value="",this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.autoHeight=!1,this.name=void 0,this.nativeProps={},this.line=1}watchAutoFocus(e,t){var n;!t&&e&&(null===(n=this.textareaRef)||void 0===n||n.focus())}watchValue(e){const t=Zi(e);this.textareaRef.value!==t&&(this.textareaRef.value=t)}focus(){return a(this,null,function*(){this.textareaRef.focus()})}render(){const{value:e,placeholder:t,disabled:n,maxlength:r,autoFocus:i,autoHeight:o,name:a,nativeProps:s,handleInput:l,handleFocus:u,handleBlur:c,handleChange:d}=this,h={};return o&&(h.rows=this.line),_n("textarea",Object.assign({ref:e=>{e&&(this.textareaRef=e,i&&e&&e.focus())},class:"taro-textarea "+(o?"auto-height":""),value:Zi(e),placeholder:t,name:a,disabled:n,maxlength:r,autofocus:i,onInput:l,onFocus:u,onBlur:c,onChange:d,onKeyDown:this.handleKeyDown},s,h))}get el(){return this}static get watchers(){return{autoFocus:["watchAutoFocus"],value:["watchValue"]}}static get style(){return Ji}},[0,"taro-textarea-core",{value:[1025],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32],focus:[64]}]);function eo(){if("undefined"===typeof customElements)return;const e=["taro-textarea-core"];e.forEach(e=>{switch(e){case"taro-textarea-core":customElements.get(e)||customElements.define(e,Xi);break}})}const to=eo,no="taro-view-core{display:block}",ro=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onLongPress=In(this,"longpress",7),this.startTime=0,this.animation=void 0,this.hoverClass=void 0,this.hoverStartTime=50,this.hoverStayTime=400,this.hover=!1,this.touch=!1}onTouchStart(){this.hoverClass&&(this.touch=!0,setTimeout(()=>{this.touch&&(this.hover=!0)},this.hoverStartTime)),this.timeoutEvent=setTimeout(()=>{this.onLongPress.emit()},350),this.startTime=Date.now()}onTouchMove(){clearTimeout(this.timeoutEvent)}onTouchEnd(){const e=Date.now()-this.startTime;e<350&&clearTimeout(this.timeoutEvent),this.hoverClass&&(this.touch=!1,setTimeout(()=>{this.touch||(this.hover=!1)},this.hoverStayTime))}componentDidRender(){qr(this.el)}render(){const e=Yr({[`${this.hoverClass}`]:this.hover});let t={};return this.animation&&(t["animation"]=this.animation,t["data-animation"]=this.animation),_n(Sn,Object.assign({class:e},t),_n("slot",null))}get el(){return this}static get style(){return no}},[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]);function io(){if("undefined"===typeof customElements)return;const e=["taro-view-core"];e.forEach(e=>{switch(e){case"taro-view-core":customElements.get(e)||customElements.define(e,ro);break}})}const oo=io,ao="iframe{border:none}.taro-webview{z-index:999;width:100%;height:100%;position:fixed;top:0;bottom:0}",so=wr(class extends Nr{constructor(){super(),this.__registerHost(),this.onLoad=In(this,"load",7),this.onError=In(this,"error",7),this.src=void 0}render(){const{src:e,onLoad:t,onError:n}=this;return _n("iframe",{class:"taro-webview",onLoad:n=>{n.stopPropagation(),t.emit({src:e})},onError:t=>{t.stopPropagation(),n.emit({src:e})},src:e})}static get style(){return ao}},[0,"taro-web-view-core",{src:[1]}]);function lo(){if("undefined"===typeof customElements)return;const e=["taro-web-view-core"];e.forEach(e=>{switch(e){case"taro-web-view-core":customElements.get(e)||customElements.define(e,so);break}})}const uo=lo;function co(){return co=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}class ko{static set config(e){this.__config=e}static get config(){return this.__config}static get pages(){return this.config.pages||[]}static get router(){return this.config.router||{}}static get mode(){return this.router.mode||"hash"}static get customRoutes(){return this.router.customRoutes||{}}static isPage(e=""){return-1!==this.pages.findIndex(t=>Ee(t)===e)}}let So,Eo="/";function xo(e,t="/"){So=e,Eo=t}function To(e=""){return Eo.replace(/\/$/,"")+"/"+e.replace(/^\//,"")}class Co{constructor(){this.stacks=[],this.backDelta=0,this.tabs={},this.methodName=""}set delta(e){e>0?this.backDelta=e:this.backDelta>0?--this.backDelta:this.backDelta=0}get delta(){return this.backDelta}set method(e){this.methodName=e}get method(){return this.methodName}get length(){return this.stacks.length}get last(){return this.stacks[this.length-1]}get(){return this.stacks}getItem(e){return this.stacks[e]}getLastIndex(e,t=1){const n=[...this.stacks].reverse();return n.findIndex((n,r)=>{var i;return r>=t&&(null===(i=n.path)||void 0===i?void 0:i.replace(/\?.*/g,""))===e})}getDelta(e){if(this.backDelta>=1)return this.backDelta;const t=this.getLastIndex(e);return t>0?t:1}getPrevIndex(e,t=1){const n=this.getLastIndex(e,t);return n<0?-1:this.length-1-n}pop(){return this.stacks.pop()}push(e){return this.stacks.push(e)}getTabs(){return this.tabs}pushTab(e){this.tabs[e]=this.last,this.pop()}popTab(e){this.push(this.tabs[e]),delete this.tabs[e]}removeTab(e){delete this.tabs[e]}}const Po=new Co;class Oo{constructor(){this.conf=[],this.getConfig=(e="")=>{const t=this.conf.filter(t=>t.includes(e));return t[0]},this.getOrigin=(e="")=>{var t;return(null===(t=this.getConfig(e))||void 0===t?void 0:t[0])||e},this.getAlias=(e="")=>{var t;return(null===(t=this.getConfig(e))||void 0===t?void 0:t[1])||e},this.getAll=(e="")=>this.conf.filter(t=>t.includes(e)).reduceRight((e,t)=>(e.unshift(t[1]),e),[])}set(e={}){for(let t in e){const n=e[t];t=Ee(t),"string"===typeof n?this.conf.push([t,Ee(n)]):(null===n||void 0===n?void 0:n.length)>0&&this.conf.push(...n.map(e=>[t,Ee(e)]))}}}const $o=new Oo,Io=E.routeChannel;function jo(e){var t;const n=_o(e.url);if(null===(t=n.pathname)||void 0===t?void 0:t.includes("./")){const e=$o.getOrigin(So.location.pathname).split("/");e.pop(),n.pathname.split("/").forEach(t=>{"."!==t&&(".."===t?e.pop():e.push(t))}),n.pathname=e.join("/")}return n.pathname=Ee(n.pathname),n.pathname=$o.getAlias(Ee(n.pathname)),n.pathname=To(n.pathname),n.search||(n.search=""),n}function No(e,t){return ie(this,void 0,void 0,function*(){return new Promise((n,r)=>{Po.method=t;const{success:i,complete:o,fail:a}=e,s=So.listen(()=>{const r={errMsg:`${t}:ok`};"navigateTo"===t&&(r.eventChannel=Io,Io.addEvents(e.events)),null===i||void 0===i||i(r),null===o||void 0===o||o(r),n(r),s()});try{if("url"in e){const n=jo(e),r={timestamp:Date.now()};"navigateTo"===t?So.push(n,r):"redirectTo"===t||"switchTab"===t?So.replace(n,r):"reLaunch"===t&&(Po.delta=Po.length,So.replace(n,r))}else"navigateBack"===t&&(Po.delta=e.delta,Po.length>e.delta?So.go(-e.delta):So.go(1-Po.length))}catch(l){const e={errMsg:`${t}:fail ${l.message||l}`};return null===a||void 0===a||a(e),null===o||void 0===o||o(e),a||o?n(e):r(e)}})})}function Lo(e){return No(e,"navigateTo")}function Ro(e){return No(e,"redirectTo")}function Do(e={delta:1}){return(!e.delta||e.delta<1)&&(e.delta=1),No(e,"navigateBack")}function Mo(e){return No(e,"switchTab")}function Bo(e){return No(e,"reLaunch")}function Uo(){const e=Po.get();return e.map(e=>{var t;return Object.assign(Object.assign({},e),{route:(null===(t=e.path)||void 0===t?void 0:t.replace(/\?.*/g,""))||""})})}const zo="%[a-f0-9]{2}",Fo=new RegExp("("+zo+")|([^%]+?)","gi"),Ho=new RegExp("("+zo+")+","gi");function Wo(e,t){try{return[decodeURIComponent(e.join(""))]}catch(wT){}if(1===e.length)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Wo(n),Wo(r))}function Vo(e){try{return decodeURIComponent(e)}catch(wT){let n=e.match(Fo)||[];for(let r=1;rnull===e||void 0===e,Jo=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Zo=Symbol("encodeFragmentIdentifier");function Xo(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[na(t,e),"[",i,"]"].join("")]:[...n,[na(t,e),"[",na(i,e),"]=",na(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[na(t,e),"[]"].join("")]:[...n,[na(t,e),"[]=",na(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[na(t,e),":list="].join("")]:[...n,[na(t,e),":list=",na(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[na(n,e),t,na(i,e)].join("")]:[[r,na(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,na(t,e)]:[...n,[na(t,e),"=",na(r,e)].join("")]}}function ea(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==r[e]?r[e]=[...r[e],n]:r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[...r[e],n]:r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"===typeof n&&n.includes(e.arrayFormatSeparator),o="string"===typeof n&&!i&&ra(n,e).includes(e.arrayFormatSeparator);n=o?ra(n,e):n;const a=i||o?n.split(e.arrayFormatSeparator).map(t=>ra(t,e)):null===n?n:ra(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const i=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!i)return void(r[t]=n?ra(n,e):n);const o=null===n?[]:ra(n,e).split(e.arrayFormatSeparator);void 0!==r[t]?r[t]=[...r[t],...o]:r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[...[n[e]].flat(),t]:n[e]=t}}}function ta(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function na(e,t){return t.encode?t.strict?Jo(e):encodeURIComponent(e):e}function ra(e,t){return t.decode?Qo(e):e}function ia(e){return Array.isArray(e)?e.sort():"object"===typeof e?ia(Object.keys(e)).sort((e,t)=>Number(e)-Number(t)).map(t=>e[t]):e}function oa(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function aa(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}function sa(e,t,n){return"string"===n&&"string"===typeof e?e:"function"===typeof n&&"string"===typeof e?n(e):"boolean"===n&&null===e||("boolean"!==n||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()?"boolean"!==n||null===e||"1"!==e.toLowerCase()&&"0"!==e.toLowerCase()?"string[]"===n&&"none"!==t.arrayFormat&&"string"===typeof e?[e]:"number[]"!==n||"none"===t.arrayFormat||Number.isNaN(Number(e))||"string"!==typeof e||""===e.trim()?"number"!==n||Number.isNaN(Number(e))||"string"!==typeof e||""===e.trim()?!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()?t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?Number(e):e:"true"===e.toLowerCase():Number(e):[Number(e)]:"1"===e.toLowerCase():"true"===e.toLowerCase())}function la(e){e=oa(e);const t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function ua(e,t){t=o({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null)},t),ta(t.arrayFormatSeparator);const n=ea(t),r=Object.create(null);if("string"!==typeof e)return r;if(e=e.trim().replace(/^[?#&]/,""),!e)return r;for(const i of e.split("&")){if(""===i)continue;const e=t.decode?i.replaceAll("+"," "):i;let[o,a]=Yo(e,"=");void 0===o&&(o=e),a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:ra(a,t),n(ra(o,t),a,r)}for(const[i,o]of Object.entries(r))if("object"===typeof o&&null!==o&&"string"!==t.types[i])for(const[e,n]of Object.entries(o)){const r=t.types[i]?t.types[i].replace("[]",""):void 0;o[e]=sa(n,t,r)}else"object"===typeof o&&null!==o&&"string"===t.types[i]?r[i]=Object.values(o).join(t.arrayFormatSeparator):r[i]=sa(o,t,t.types[i]);return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{const n=r[t];return e[t]=Boolean(n)&&"object"===typeof n&&!Array.isArray(n)?ia(n):n,e},Object.create(null))}function ca(e,t){if(!e)return"";t=o({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t),ta(t.arrayFormatSeparator);const n=n=>t.skipNull&&Ko(e[n])||t.skipEmptyString&&""===e[n],r=Xo(t),i={};for(const[o,s]of Object.entries(e))n(o)||(i[o]=s);const a=Object.keys(i);return!1!==t.sort&&a.sort(t.sort),a.map(n=>{const i=e[n];return void 0===i?"":null===i?na(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?na(n,t)+"[]":i.reduce(r(n),[]).join("&"):na(n,t)+"="+na(i,t)}).filter(e=>e.length>0).join("&")}function da(e,t){var n,r;t=o({decode:!0},t);let[i,a]=Yo(e,"#");return void 0===i&&(i=e),o({url:null!=(r=null==(n=null==i?void 0:i.split("?"))?void 0:n[0])?r:"",query:ua(la(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:ra(a,t)}:{})}function ha(e,t){t=o({encode:!0,strict:!0,[Zo]:!0},t);const n=oa(e.url).split("?")[0]||"",r=la(e.url),i=o(o({},ua(r,o({sort:!1},t))),e.query);let a=ca(i,t);a&&(a=`?${a}`);let s=aa(e.url);if("string"===typeof e.fragmentIdentifier){const r=new URL(n);r.hash=e.fragmentIdentifier,s=t[Zo]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${a}${s}`}function fa(e,t,n){n=o({parseFragmentIdentifier:!0,[Zo]:!1},n);const{url:r,query:i,fragmentIdentifier:a}=da(e,n);return ha({url:r,query:Go(i,t),fragmentIdentifier:a},n)}function pa(e,t,n){const r=Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n);return fa(e,r,n)}const ga=Object.freeze(Object.defineProperty({__proto__:null,exclude:pa,extract:la,parse:ua,parseUrl:da,pick:fa,stringify:ca,stringifyUrl:ha},Symbol.toStringTag,{value:"Module"}));let ma;function va(e){ma&&window.removeEventListener("resize",ma),ma=function(){if(e.onResize){const t=window.matchMedia("(orientation: portrait)");e.onResize({deviceOrientation:t.matches?"portrait":"landscape",size:{windowHeight:window.innerHeight,windowWidth:window.innerWidth,screenHeight:window.screen.height,screenWidth:window.screen.width}})}},window.addEventListener("resize",ma,!1)}const ya={};let ba=window;function wa(e,t,n=50){var r;const i=e?null===e||void 0===e?void 0:e.path:null===(r=ae.router)||void 0===r?void 0:r.path;ya[i]&&t.removeEventListener("scroll",ya[i]),ba=t;let o=!1;ya[i]=function(){var t;null===(t=e.onPageScroll)||void 0===t||t.call(e,{scrollTop:ba instanceof Window?window.scrollY:ba.scrollTop}),o&&Aa()>n&&(o=!1),e.onReachBottom&&!o&&Aa()=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;a+=e[s++]}if(!a)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:a}),n=s}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}function Sa(e,t){void 0===t&&(t={});var n=ka(e),r=t.prefixes,i=void 0===r?"./":r,o=t.delimiter,a=void 0===o?"/#?":o,s=[],l=0,u=0,c="",d=function(e){if(u-1)return!0}return!1},g=function(e){var t=s[s.length-1],n=e||(t&&"string"===typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||p(n)?"[^".concat(Ta(a),"]+?"):"(?:(?!".concat(Ta(n),")[^").concat(Ta(a),"])+?")};while(u)?(?!\?)/g,r=0,i=n.exec(e.source);while(i)t.push({name:i[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(e.source);return e}function Oa(e,t,n){var r=e.map(function(e){return ja(e,t,n).source});return new RegExp("(?:".concat(r.join("|"),")"),Ca(n))}function $a(e,t,n){return Ia(Sa(e,n),t,n)}function Ia(e,t,n){void 0===n&&(n={});for(var r=n.strict,i=void 0!==r&&r,o=n.start,a=void 0===o||o,s=n.end,l=void 0===s||s,u=n.encode,c=void 0===u?function(e){return e}:u,d=n.delimiter,h=void 0===d?"/#?":d,f=n.endsWith,p=void 0===f?"":f,g="[".concat(Ta(p),"]|$"),m="[".concat(Ta(h),"]"),v=a?"^":"",y=0,b=e;y-1:void 0===S;i||(v+="(?:".concat(m,"(?=").concat(g,"))?")),E||(v+="(?=".concat(m,"|").concat(g,")"))}return new RegExp(v,Ca(n))}function ja(e,t,n){return e instanceof RegExp?Pa(e,t):Array.isArray(e)?Oa(e,t,n):$a(e,t,n)}function Na(e){try{return decodeURIComponent(e)}catch(t){return e}}function La(e,t,n,r,i){var o,a,s=0;return{next:function(l){if(e===l)return{done:!0,value:!1};if(!o){var u=e,c=!u.children;if(u.match||(u.match=Ea(u.path||"",Object.assign({end:c},n))),o=u.match(r),o){var d=o,h=d.path;return o.path=c||"/"!==h.charAt(h.length-1)?h:h.substr(1),o.params=Object.assign({},i,o.params),{done:!1,value:{route:e,baseUrl:t,path:o.path,params:o.params}}}}if(o&&e.children)while(s{this.setTitle(e)}),te.on("__taroH5setNavigationBarLoading",e=>{this.setNavigationLoading(e)}),te.on("__taroH5setNavigationBarColor",({backgroundColor:e,frontColor:t})=>{"string"===typeof e&&this.setNavigationBarBackground(e),"string"===typeof t&&this.setNavigationBarTextStyle(t)})}toHomeFn(){Bo({url:this.pageContext.originHomePage})}backFn(){Do()}get homeBtnElement(){var e;return this.navigationBarElement?null===(e=this.navigationBarElement.getElementsByClassName("taro-navigation-bar-home"))||void 0===e?void 0:e[0]:null}get backBtnElement(){var e;return this.navigationBarElement?null===(e=this.navigationBarElement.getElementsByClassName("taro-navigation-bar-back"))||void 0===e?void 0:e[0]:null}get titleElement(){var e;return this.navigationBarElement?null===(e=this.navigationBarElement.getElementsByClassName("taro-navigation-bar-title"))||void 0===e?void 0:e[0]:null}get loadingElement(){return this.navigationBarElement?this.navigationBarElement.getElementsByClassName("taro-navigation-bar-loading")[0]:null}init(){var e,t;this.setNavigationBarElement(),this.navigationBarElement&&(null===(e=this.homeBtnElement)||void 0===e||e.addEventListener("click",this.toHomeFn.bind(this)),null===(t=this.backBtnElement)||void 0===t||t.addEventListener("click",this.backFn.bind(this)))}setNavigationBarElement(){this.navigationBarElement=document.getElementById("taro-navigation-bar")}load(){this.setCacheValue(),this.setTitle(),this.setNavigationBarVisible(),this.setFnBtnState(),this.setNavigationBarBackground(),this.setNavigationBarTextStyle(),this.setNavigationLoading()}setCacheValue(){const e=this.pageContext.originPathname;"object"!==typeof this.cache[e]&&(this.cache[e]={})}setFnBtnState(){const e=this.pageContext.currentPage;this.pageContext.isTabBar(e)||this.pageContext.homePage===e?this.fnBtnToggleToNone():Po.length>1?this.fnBtnToggleToBack():this.fnBtnToggleToHome()}shiftLoadingState(e){this.loadingElement&&(e?this.loadingElement.classList.add("taro-navigation-bar-loading-show"):this.loadingElement.classList.remove("taro-navigation-bar-loading-show"))}setNavigationLoading(e){var t;if(!this.navigationBarElement)return;const n=this.pageContext.originPathname;let r;if("boolean"===typeof e)r=e,this.cache[n]&&(this.cache[n].loading=r);else{const e=null===(t=this.cache[n])||void 0===t?void 0:t.loading;"boolean"===typeof e?r=e:(r=!1,this.cache[n]&&(this.cache[n].loading=r))}this.shiftLoadingState(r)}setNavigationBarBackground(e){var t,n,r;if(!this.navigationBarElement)return;const i=this.pageContext.originPathname;let o;if("string"===typeof e)o=e,this.cache[i]&&(this.cache[i].backgroundColor=o);else{const e=null===(t=this.cache[i])||void 0===t?void 0:t.backgroundColor;"string"===typeof e?o=e:(o=(null===(r=null===(n=this.pageContext.config)||void 0===n?void 0:n.window)||void 0===r?void 0:r.navigationBarBackgroundColor)||"#000000",this.cache[i]&&(this.cache[i].backgroundColor=o))}this.navigationBarElement.style.background=o}setNavigationBarTextStyle(e){var t,n,r;if(!this.navigationBarElement)return;const i=this.pageContext.originPathname;let o;if("string"===typeof e)o=e,this.cache[i]&&(this.cache[i].fontColor=o);else{const e=null===(t=this.cache[i])||void 0===t?void 0:t.fontColor;"string"===typeof e?o=e:(o=(null===(r=null===(n=this.pageContext.config)||void 0===n?void 0:n.window)||void 0===r?void 0:r.navigationBarTextStyle)||"white",this.cache[i]&&(this.cache[i].fontColor=o))}this.navigationBarElement.style.color=o}setTitle(e){var t,n,r;const i=this.pageContext.originPathname;let o;if("string"===typeof e)o=e,this.cache[i]&&(this.cache[i].title=o);else{const e=null===(t=this.cache[i])||void 0===t?void 0:t.title;"string"===typeof e?o=e:(o=null!==(r=null===(n=this.pageContext.pageConfig)||void 0===n?void 0:n.navigationBarTitleText)&&void 0!==r?r:document.title,this.cache[i]&&(this.cache[i].title=o))}document.title=o,this.titleElement&&(this.titleElement.innerHTML=o)}fnBtnToggleToHome(){this.navigationBarElement&&(this.navigationBarElement.classList.add("taro-navigation-bar-home-icon"),this.navigationBarElement.classList.remove("taro-navigation-bar-back-icon"))}fnBtnToggleToBack(){this.navigationBarElement&&(this.navigationBarElement.classList.remove("taro-navigation-bar-home-icon"),this.navigationBarElement.classList.add("taro-navigation-bar-back-icon"))}fnBtnToggleToNone(){this.navigationBarElement&&(this.navigationBarElement.classList.remove("taro-navigation-bar-home-icon"),this.navigationBarElement.classList.remove("taro-navigation-bar-back-icon"))}setNavigationBarVisible(e){var t,n;if(!this.navigationBarElement)return;let r;"boolean"===typeof e?r=e:(r=null===(t=this.pageContext.config.window)||void 0===t?void 0:t.navigationStyle,"string"===typeof(null===(n=this.pageContext.pageConfig)||void 0===n?void 0:n.navigationStyle)&&(r=this.pageContext.pageConfig.navigationStyle)),"default"===r?(this.navigationBarElement.classList.add("taro-navigation-bar-show"),this.navigationBarElement.classList.remove("taro-navigation-bar-hide")):(this.navigationBarElement.classList.add("taro-navigation-bar-hide"),this.navigationBarElement.classList.remove("taro-navigation-bar-show"))}}class Ua{constructor(e,t){this.history=t,this.defaultAnimation={duration:300,delay:50},this.config=e,this.homePage=Pe(this.routes[0].path,this.basename,this.customRoutes,this.config.entryPagePath),this.originHomePage=this.config.entryPagePath||this.routes[0].path||this.basename,this.mount(),this.navigationBarHandler=new Ba(this)}get currentPage(){const e=Oe(this.routerMode,this.basename);return"/"===e?this.homePage:e}get appId(){return this.config.appId||"app"}get router(){return this.config.router||{}}get routerMode(){return this.router.mode||"hash"}get customRoutes(){return this.router.customRoutes||{}}get routes(){return this.config.routes||[]}get tabBarList(){var e;return(null===(e=this.config.tabBar)||void 0===e?void 0:e.list)||[]}get PullDownRefresh(){return this.config.PullDownRefresh}get animation(){var e,t;return null!==(t=null===(e=this.config)||void 0===e?void 0:e.animation)&&void 0!==t?t:this.defaultAnimation}get animationDelay(){var e;return("object"===typeof this.animation?this.animation.delay:this.animation?null===(e=this.defaultAnimation)||void 0===e?void 0:e.delay:0)||0}get animationDuration(){var e;return("object"===typeof this.animation?this.animation.duration:this.animation?null===(e=this.defaultAnimation)||void 0===e?void 0:e.duration:0)||0}set pathname(e){this.router.pathname=e}get pathname(){return this.router.pathname}get originPathname(){return $o.getOrigin(Ee(Te(this.pathname,this.basename)))}get basename(){return this.router.basename||""}get pageConfig(){const e=Ee(this.homePage);return this.routes.find(t=>{const n=Ee(t.path);return[n,e].includes(this.originPathname)})}isTabBar(e){var t;const n=Ee(Te(e,this.basename)).split("?")[0],r=(null===(t=Object.entries(this.customRoutes).find(([,e])=>"string"===typeof e?e===n:(null===e||void 0===e?void 0:e.length)>0&&e.includes(n)))||void 0===t?void 0:t[0])||n;return!!r&&this.tabBarList.some(e=>Ce(e.pagePath)===r)}isDefaultNavigationStyle(){var e,t;let n=null===(e=this.config.window)||void 0===e?void 0:e.navigationStyle;return"string"===typeof(null===(t=this.pageConfig)||void 0===t?void 0:t.navigationStyle)&&(n=this.pageConfig.navigationStyle),"custom"!==n}isSamePage(e){const t=Te(this.pathname,this.basename),n=Te(null===e||void 0===e?void 0:e.path,this.basename);return n.startsWith(t+"?")}get search(){let e="?";if("hash"===this.routerMode){const t=location.hash.indexOf("?");t>-1&&(e=location.hash.slice(t))}else e=location.search;return e.substring(1)}get usingWindowScroll(){var e;let t=!1;"boolean"===typeof(null===(e=this.pageConfig)||void 0===e?void 0:e.usingWindowScroll)&&(t=this.pageConfig.usingWindowScroll);const n=window;return n.__taroAppConfig||(n.__taroAppConfig={}),n.__taroAppConfig.usingWindowScroll=t,t}getQuery(e="",t="",n={}){t=t?`${t}&${this.search}`:this.search;const r=t?ga.parse(t,{decode:!1}):{};return r.stamp=e,Object.assign(Object.assign({},r),n)}mount(){xo(this.history,this.basename),this.pathname=So.location.pathname,this.animation&&Yt(this.animationDuration),Kt(this.tabBarList.length>1,this.usingWindowScroll,this.router.enhanceAnimation)}onReady(e,t=!0){var n;const r=this.getPageContainer(e);if(r&&!(null===r||void 0===r?void 0:r["__isReady"])){const i=r.firstElementChild,o=null===i||void 0===i?void 0:i["componentOnReady"];o?null===o||void 0===o||o().then(()=>{le(()=>{var t;null===(t=e.onReady)||void 0===t||t.call(e),r["__isReady"]=!0})}):(null===(n=e.onReady)||void 0===n||n.call(e),r["__isReady"]=!0),t&&(r["__page"]=e)}}load(e,t={},n,r=0){var i,o;if(!e)return;Po.push(e);const a=this.getQuery(n,"",e.options);let s=this.getPageContainer(e);s?(s.classList.remove("taro_page_shade"),this.isTabBar(this.pathname)&&s.classList.add("taro_tabbar_page"),this.isDefaultNavigationStyle()&&s.classList.add("taro_navigation_page"),this.addAnimation(s,0===r),null===(i=e.onShow)||void 0===i||i.call(e),this.navigationBarHandler.load(),this.bindPageEvents(e,t),this.triggerRouterChange()):null===(o=e.onLoad)||void 0===o||o.call(e,a,()=>{var n;s=this.getPageContainer(e),this.isTabBar(this.pathname)&&(null===s||void 0===s||s.classList.add("taro_tabbar_page")),this.isDefaultNavigationStyle()&&(null===s||void 0===s||s.classList.add("taro_navigation_page")),this.addAnimation(s,0===r),null===(n=e.onShow)||void 0===n||n.call(e),this.navigationBarHandler.load(),this.onReady(e,!0),this.bindPageEvents(e,t),this.triggerRouterChange()})}unload(e,t=1,n=!1){var r,i,o;if(e){if(Po.delta=--t,Po.pop(),this.animation&&n){this.unloadTimer&&(clearTimeout(this.unloadTimer),null===(i=null===(r=this.lastUnloadPage)||void 0===r?void 0:r.onUnload)||void 0===i||i.call(r),this.unloadTimer=null),this.lastUnloadPage=e;const t=this.getPageContainer(e);null===t||void 0===t||t.classList.remove("taro_page_stationed"),null===t||void 0===t||t.classList.remove("taro_page_show"),t&&(t.style.zIndex="1"),this.unloadTimer=setTimeout(()=>{var e,t;this.unloadTimer=null,null===(t=null===(e=this.lastUnloadPage)||void 0===e?void 0:e.onUnload)||void 0===t||t.call(e),te.trigger("__taroPageOnShowAfterDestroyed")},this.animationDuration)}else{const t=this.getPageContainer(e);null===t||void 0===t||t.classList.remove("taro_page_stationed"),null===t||void 0===t||t.classList.remove("taro_page_show"),null===(o=null===e||void 0===e?void 0:e.onUnload)||void 0===o||o.call(e),setTimeout(()=>{te.trigger("__taroPageOnShowAfterDestroyed")},0)}t>=1&&this.unload(Po.last,t)}}show(e,t={},n=0){var r,i;if(!e)return;const o=this.getQuery(e["$taroParams"]["stamp"],"",e.options);let a=this.getPageContainer(e);a?(a.classList.remove("taro_page_shade"),this.addAnimation(a,0===n),null===(r=e.onShow)||void 0===r||r.call(e),this.navigationBarHandler.load(),this.bindPageEvents(e,t),this.triggerRouterChange()):null===(i=e.onLoad)||void 0===i||i.call(e,o,()=>{var r;a=this.getPageContainer(e),this.addAnimation(a,0===n),null===(r=e.onShow)||void 0===r||r.call(e),this.navigationBarHandler.load(),this.onReady(e,!1),this.bindPageEvents(e,t),this.triggerRouterChange()})}hide(e,t=!1){var n,r,i,o,a,s,l,u;if(!e)return;const c=this.getPageContainer(e);c?t?(this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null,null===(i=null===(r=null===(n=this.lastHidePage)||void 0===n?void 0:n.classList)||void 0===r?void 0:r.add)||void 0===i||i.call(r,"taro_page_shade")),this.lastHidePage=c,this.hideTimer=setTimeout(()=>{this.hideTimer=null,c.classList.add("taro_page_shade")},this.animationDuration+this.animationDelay),null===(o=e.onHide)||void 0===o||o.call(e)):(this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null,null===(l=null===(s=null===(a=this.lastHidePage)||void 0===a?void 0:a.classList)||void 0===s?void 0:s.add)||void 0===l||l.call(s,"taro_page_shade")),null===(u=e.onHide)||void 0===u||u.call(e),c.classList.add("taro_page_shade"),this.lastHidePage=c):setTimeout(()=>this.hide(e),0)}addAnimation(e,t=!1){e&&(this.animation&&!t?setTimeout(()=>{e.classList.add("taro_page_show"),setTimeout(()=>{e.classList.add("taro_page_stationed")},this.animationDuration)},this.animationDelay):(e.classList.add("taro_page_show"),e.classList.add("taro_page_stationed")))}getPageContainer(e){var t;const n=e?null===e||void 0===e?void 0:e.path:null===(t=ae.page)||void 0===t?void 0:t.path,r=null===n||void 0===n?void 0:n.replace(/([^a-z0-9\u00a0-\uffff_-])/gi,"\\$1");if(e)return document.querySelector(`.taro_page#${r}`);const i=r?document.querySelector(`.taro_page#${r}`):document.querySelector(".taro_page")||document.querySelector(".taro_router");return i}getScrollingElement(e){return this.usingWindowScroll?window:this.getPageContainer(e)||window}bindPageEvents(e,t={}){var n;const r=this.getScrollingElement(e),i=t.onReachBottomDistance||(null===(n=this.config.window)||void 0===n?void 0:n.onReachBottomDistance)||50;wa(e,r,i),va(e)}triggerRouterChange(){setTimeout(()=>{te.trigger("__afterTaroRouterChange",{toLocation:{path:this.pathname}})},0)}}const za=de();let Fa=za();function Ha(e,t,n,r){var i,o;"function"===typeof t.onUnhandledRejection&&window.addEventListener("unhandledrejection",t.onUnhandledRejection),ko.config=n;const a=new Ua(n,e),s={};$o.set(a.router.customRoutes);const l=a.router.basename,u=a.routes.map(e=>{const t=Ee(e.path),n=$o.getAll(t);return{path:n.length<1?t:n,action:e.load}}),c=new Ma(u,{baseUrl:l||""}),d={path:a.currentPage,query:a.getQuery(Fa),scene:0,shareTicket:"",referrerInfo:{}};te.trigger("__taroRouterLaunch",d),null===(i=t.onLaunch)||void 0===i||i.call(t,d),t.onError&&window.addEventListener("error",e=>{var n;return null===(n=t.onError)||void 0===n?void 0:n.call(t,e.message)});const h=e=>ie(this,[e],void 0,function*({location:e,action:i}){var o,l,u,d,h,f,p,g;const m=decodeURI(e.pathname);let v,y,b;(null===(o=window.__taroAppConfig)||void 0===o?void 0:o.usingWindowScroll)&&window.scrollTo(0,0),te.trigger("__taroRouterChange",{toLocation:{path:m}});const w=a.router.forcePath||m;s[w]="number"===typeof s[w]?s[w]+1:1;const A=s[w];let _;try{const e=yield c.resolve(w);[v,y,b]=yield Promise.all(e),_=s[w]}catch(j){if(404===j.status){const e={isEntryPage:0===Po.length,path:m,query:a.getQuery(za())};null===(l=t.onPageNotFound)||void 0===l||l.call(t,e),te.trigger("__taroRouterNotFound",e)}else{if(!/Loading hot update .* failed./.test(j.message))throw j;window.location.reload()}}if(!v||A!==_)return;a.pathname=y.pathname;const{pathname:k,pageConfig:S}=a;let E=(null===(u=null===n||void 0===n?void 0:n.window)||void 0===u?void 0:u.enablePullDownRefresh)||!1,x=(null===(d=null===n||void 0===n?void 0:n.window)||void 0===d?void 0:d.navigationStyle)||"default",T=(null===(h=null===n||void 0===n?void 0:n.window)||void 0===h?void 0:h.navigationBarTextStyle)||"white",C=(null===(f=null===n||void 0===n?void 0:n.window)||void 0===f?void 0:f.navigationBarBackgroundColor)||"#000000";S&&("boolean"===typeof S.enablePullDownRefresh&&(E=S.enablePullDownRefresh),"string"===typeof S.navigationStyle&&(x=S.navigationStyle),"string"===typeof S.navigationBarTextStyle&&(T=S.navigationBarTextStyle),"string"===typeof S.navigationBarBackgroundColor&&(C=S.navigationBarBackgroundColor)),te.trigger("__taroSetNavigationStyle",x,T,C);const P=ae.page,O=null!==(p=Po.method)&&void 0!==p?p:"",$=Po.getTabs();let I=!1;if(Po.method="","reLaunch"===O){a.unload(P,Po.length);for(const e in $)$[e]&&(a.unload($[e]),Po.removeTab(e));I=!0}else if(P&&a.isTabBar(k)){if(a.isSamePage(P))return;if(a.isTabBar(P.path))a.hide(P),Po.pushTab(P.path.split("?")[0]);else if(Po.length>0){const e=Po.getItem(0);a.isTabBar(e.path)?(a.unload(P,Po.length-1,!0),Po.pushTab(e.path.split("?")[0])):a.unload(P,Po.length,!0)}if($[k])return Po.popTab(k),a.show(Po.getItem(0),S,0);I=!0}else if("POP"===i){const e=Po.getPrevIndex(k),t=Po.getDelta(k);P!==Po.getItem(e)&&(a.unload(P,t,e>-1),e>-1?te.once("__taroPageOnShowAfterDestroyed",()=>{a.show(Po.getItem(e),S,e)}):I=!0)}else if("REPLACE"===i){const e=Po.getDelta(k);a.unload(P,e),I=!0}else"PUSH"===i&&(a.hide(P,!0),I=!0);if(I||Po.length<1){const e=null!==(g=v.default)&&void 0!==g?g:v,t=Object.assign({},S),n=Po.length;delete t["path"],delete t["load"];let i="";Fa?(i=Fa,Fa=""):i=za();const o=ze(E?N.call("createPullDownComponent",e,k,r,a.PullDownRefresh,i):e,k+Re(a.getQuery(i)),{},t);b&&(o.options=b),a.load(o,S,i,n)}}),f=Ee(Te(e.location.pathname,a.basename));return"/"===f&&e.replace(To(a.homePage+e.location.search)),h({location:e.location,action:ho.Push}),null===(o=t.onShow)||void 0===o||o.call(t,d),window.addEventListener("visibilitychange",()=>{var e,n,r,i,o,a,s;const l=(null===(e=ae.page)||void 0===e?void 0:e.path)||"",u=l.substring(0,l.indexOf("?")),c={};Object.assign(c,d,{path:u}),"visible"===document.visibilityState?(null===(n=t.onShow)||void 0===n||n.call(t,c),null===(i=null===(r=ae.page)||void 0===r?void 0:r.onShow)||void 0===i||i.call(r)):((null===(o=ae.page)||void 0===o?void 0:o.path)&&Le(null===(a=ae.page)||void 0===a?void 0:a.path,"onHide"),null===(s=t.onHide)||void 0===s||s.call(t,c))}),e.listen(h)}function Wa(e,t,n=e.appId||"app"){let r=document.getElementById(n),i=!0;r||(r=document.createElement("div"),r.id=n,i=!1);const o=(null===r||void 0===r?void 0:r.parentNode)||(null===r||void 0===r?void 0:r.parentElement)||document.body;r.classList.add("taro_router"),i||o.appendChild(r),nn(e,o)}class Va{constructor({name:e,success:t,fail:n,complete:r}){this.isHandlerError=!1,this.methodName=e,this.__success=t,this.__fail=n,this.__complete=r,this.isHandlerError=C(this.__complete)||C(this.__fail)}success(e={},t={}){e.errMsg||(e.errMsg=`${this.methodName}:ok`),C(this.__success)&&this.__success(e),C(this.__complete)&&this.__complete(e);const{resolve:n=Promise.resolve.bind(Promise)}=t;return n(e)}fail(e={},t={}){e.errMsg?e.errMsg=`${this.methodName}:fail ${e.errMsg}`:e.errMsg=`${this.methodName}:fail`,C(this.__fail)&&this.__fail(e),C(this.__complete)&&this.__complete(e);const{resolve:n=Promise.resolve.bind(Promise),reject:r=Promise.reject.bind(Promise)}=t;return this.isHandlerError?n(e):r(e)}}function qa({name:e="",para:t,correct:n,wrong:r,level:i="error"}){const o=t?`parameter.${t}`:"parameter",a=Qa(null===r?"Null":typeof r);return`${e?`${e}:fail `:""}parameter ${i}: ${o} should be ${n} instead of ${a}`}function Qa(e){return"string"!==typeof e||(e=e.replace(/^./,e=>e.toUpperCase())),e}function Ga(e){let t="";for(const n in e)t+=`${n}: ${e[n]};`;return t.indexOf("display: flex;")>=0&&(t+="display: -webkit-box;display: -webkit-flex;"),t=t.replace(/transform:(.+?);/g,(e,t)=>`${e}-webkit-transform:${t};`),t=t.replace(/flex-direction:(.+?);/g,(e,t)=>`${e}-webkit-flex-direction:${t};`),t}function Ya(e,t){e.style.webkitTransform=t,e.style.transform=t}function Ka(e){return e?Object.keys(e).map(t=>`${encodeURIComponent(t)}=${"object"===typeof e[t]?encodeURIComponent(JSON.stringify(e[t])):encodeURIComponent(e[t])}`).join("&"):""}function Ja(e=""){return(t={},...n)=>{const{success:r,fail:i,complete:o}=t,a=new Va({name:e,success:r,fail:i,complete:o}),s="\u6682\u65f6\u4e0d\u652f\u6301 API";return Gt.eventCenter.trigger("__taroNotSupport",{name:e,args:[t,...n],type:"method",category:"temporarily"}),console.warn(s),a.success({errMsg:s})}}function Za(e=""){return(t={},...n)=>{const{success:r,fail:i,complete:o}=t,a=new Va({name:e,success:r,fail:i,complete:o}),s="\u4e0d\u652f\u6301 API";return Gt.eventCenter.trigger("__taroNotSupport",{name:e,args:[t,...n],type:"method",category:"permanently"}),console.warn(s),a.success({errMsg:s})}}function Xa(){var e,t,n,r,i,o;const a=window.__taroAppConfig||{},s=Oe(null===(e=a.router)||void 0===e?void 0:e.mode,null===(t=a.router)||void 0===t?void 0:t.basename),l=Pe(null===(r=null===(n=a.routes)||void 0===n?void 0:n[0])||void 0===r?void 0:r.path,null===(i=a.router)||void 0===i?void 0:i.basename,null===(o=a.router)||void 0===o?void 0:o.customRoutes,a.entryPagePath);return`${"/"===s?l:s}?stamp=1`}function es(e){let t;try{t=JSON.parse(localStorage.getItem(e)||"")}catch(wT){}return t&&"object"===typeof t&&t.hasOwnProperty("data")?{result:!0,data:t.data}:{result:!1}}const ts=e=>{"string"===typeof e?localStorage.removeItem(e):console.error(qa({name:"removeStorage",correct:"String",wrong:e}))},ns=e=>{if("string"!==typeof e)return void console.error(qa({name:"getStorageSync",correct:"String",wrong:e}));const t=es(e);return t.result?t.data:""},rs=function(){};class is{constructor(){this.options={alertText:"",itemList:[],itemColor:"#000000",success:rs,fail:rs,complete:rs},this.style={maskStyle:{position:"fixed","z-index":"1000",top:"0",right:"0",left:"0",bottom:"0",background:"rgba(0,0,0,0.6)"},actionSheetStyle:{"z-index":"4999",position:"fixed",left:"0",bottom:"0","-webkit-transform":"translate(0, 100%)",transform:"translate(0, 100%)",width:"100%","line-height":"1.6",background:"#EFEFF4","-webkit-transition":"-webkit-transform .3s",transition:"transform .3s","border-radius":"15px 15px 0 0"},menuStyle:{"background-color":"#FCFCFD","border-radius":"15px 15px 0 0"},cellStyle:{position:"relative",padding:"10px 0","text-align":"center","font-size":"18px"},titleStyle:{position:"relative",padding:"10px 0","text-align":"center","font-size":"16px",color:"rgba(0,0,0,0.8)",display:"none"},cancelStyle:{"margin-top":"6px",padding:"10px 0","text-align":"center","font-size":"18px",color:"#000000","background-color":"#FCFCFD"}},this.lastConfig={}}create(e={}){return new Promise(t=>{const{maskStyle:n,actionSheetStyle:r,menuStyle:i,cellStyle:o,titleStyle:a,cancelStyle:s}=this.style,l=Object.assign(Object.assign({},this.options),e);this.lastConfig=l,this.el=document.createElement("div"),this.el.className="taro__actionSheet",this.el.style.opacity="0",this.el.style.transition="opacity 0.2s linear",this.mask=document.createElement("div"),this.mask.setAttribute("style",Ga(n)),this.actionSheet=document.createElement("div"),this.actionSheet.setAttribute("style",Ga(r)),this.menu=document.createElement("div"),this.menu.setAttribute("style",Ga(Object.assign(Object.assign({},i),{color:l.itemColor}))),this.cells=l.itemList.map((e,n)=>{const r=document.createElement("div");return r.className="taro-actionsheet__cell",r.setAttribute("style",Ga(o)),r.textContent=e,r.dataset.tapIndex=`${n}`,r.onclick=e=>{this.hide();const n=e.currentTarget,r=Number(null===n||void 0===n?void 0:n.dataset.tapIndex)||0;t(r)},r}),this.title=document.createElement("div"),this.title.setAttribute("style",Ga(a)),this.title.className="taro-actionsheet__cell",this.title.textContent=l.alertText,this.title.style.display=l.alertText?"block":"none",this.cancel=document.createElement("div"),this.cancel.setAttribute("style",Ga(s)),this.cancel.textContent="\u53d6\u6d88",this.menu.appendChild(this.title),this.cells.forEach(e=>this.menu.appendChild(e)),this.actionSheet.appendChild(this.menu),this.actionSheet.appendChild(this.cancel),this.el.appendChild(this.mask),this.el.appendChild(this.actionSheet);const u=()=>{this.hide(),t("cancel")};this.mask.onclick=u,this.cancel.onclick=u,document.body.appendChild(this.el),setTimeout(()=>{this.el.style.opacity="1",Ya(this.actionSheet,"translate(0, 0)")},0)})}show(e={}){return new Promise(t=>{const n=Object.assign(Object.assign({},this.options),e);this.lastConfig=n,this.hideOpacityTimer&&clearTimeout(this.hideOpacityTimer),this.hideDisplayTimer&&clearTimeout(this.hideDisplayTimer),n.itemColor&&(this.menu.style.color=n.itemColor);const{cellStyle:r}=this.style;n.itemList.forEach((e,n)=>{let i;this.cells[n]?i=this.cells[n]:(i=document.createElement("div"),i.className="taro-actionsheet__cell",i.setAttribute("style",Ga(r)),i.dataset.tapIndex=`${n}`,this.cells.push(i),this.menu.appendChild(i)),i.textContent=e,i.onclick=e=>{this.hide();const n=e.currentTarget,r=Number(null===n||void 0===n?void 0:n.dataset.tapIndex)||0;t(r)}});const i=this.cells.length,o=n.itemList.length;if(i>o){for(let e=o;e{this.hide(),t("cancel")};this.mask.onclick=a,this.cancel.onclick=a,this.el.style.display="block",setTimeout(()=>{this.el.style.opacity="1",Ya(this.actionSheet,"translate(0, 0)")},0)})}hide(){this.hideOpacityTimer&&clearTimeout(this.hideOpacityTimer),this.hideDisplayTimer&&clearTimeout(this.hideDisplayTimer),this.hideOpacityTimer=setTimeout(()=>{this.el.style.opacity="0",Ya(this.actionSheet,"translate(0, 100%)"),this.hideDisplayTimer=setTimeout(()=>{this.el.style.display="none"},200)},0)}}class os{constructor(){this.options={title:"",content:"",showCancel:!0,cancelText:"\u53d6\u6d88",cancelColor:"#000000",confirmText:"\u786e\u5b9a",confirmColor:"#3CC51F"},this.style={maskStyle:{position:"fixed","z-index":"1000",top:"0",right:"0",left:"0",bottom:"0",background:"rgba(0,0,0,0.6)"},modalStyle:{"z-index":"4999",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"80%","max-width":"300px","border-radius":"3px","text-align":"center","line-height":"1.6",overflow:"hidden",background:"#FFFFFF"},titleStyle:{padding:"20px 24px 9px","font-size":"18px"},textStyle:{padding:"0 24px 12px","min-height":"40px","font-size":"15px","line-height":"1.3",color:"#808080","word-wrap":"break-word","word-break":"break-all"},footStyle:{position:"relative","line-height":"48px","font-size":"18px",display:"flex"},btnStyle:{position:"relative","-webkit-box-flex":"1","-webkit-flex":"1",flex:"1"}}}create(e={}){return new Promise(t=>{var n,r;const{maskStyle:i,modalStyle:o,titleStyle:a,textStyle:s,footStyle:l,btnStyle:u}=this.style,c=Object.assign(Object.assign({},this.options),e);this.el=document.createElement("div"),this.el.className="taro__modal",this.el.style.opacity="0",this.el.style.transition="opacity 0.2s linear";const d=e=>{e.stopPropagation(),e.preventDefault()},h=document.createElement("div");h.className="taro-modal__mask",h.setAttribute("style",Ga(i)),h.ontouchmove=d;const f=document.createElement("div");f.className="taro-modal__content",f.setAttribute("style",Ga(o)),f.ontouchmove=d;const p=c.title?a:Object.assign(Object.assign({},a),{display:"none"});this.title=document.createElement("div"),this.title.className="taro-modal__title",this.title.setAttribute("style",Ga(p)),this.title.textContent=c.title;const g=c.title?s:Object.assign(Object.assign({},s),{padding:"40px 20px 26px",color:"#353535"});this.text=document.createElement("div"),this.text.className="taro-modal__text",this.text.setAttribute("style",Ga(g)),this.text.textContent=c.content;const m=document.createElement("div");m.className="taro-modal__foot",m.setAttribute("style",Ga(l));const v=Object.assign(Object.assign({},u),{color:c.cancelColor,display:c.showCancel?"block":"none"});this.cancel=document.createElement("div"),this.cancel.className="taro-model__btn taro-model__cancel",this.cancel.setAttribute("style",Ga(v)),this.cancel.textContent=c.cancelText,this.cancel.onclick=()=>{this.hide(),t("cancel")},this.confirm=document.createElement("div"),this.confirm.className="taro-model__btn taro-model__confirm",this.confirm.setAttribute("style",Ga(u)),this.confirm.style.color=c.confirmColor,this.confirm.textContent=c.confirmText,this.confirm.onclick=()=>{this.hide(),t("confirm")},m.appendChild(this.cancel),m.appendChild(this.confirm),f.appendChild(this.title),f.appendChild(this.text),f.appendChild(m),this.el.appendChild(h),this.el.appendChild(f),document.body.appendChild(this.el),setTimeout(()=>{this.el.style.opacity="1"},0),this.currentPath=null!==(r=null===(n=ae.page)||void 0===n?void 0:n.path)&&void 0!==r?r:Xa()})}show(e={}){return new Promise(t=>{var n,r;const i=Object.assign(Object.assign({},this.options),e);this.hideOpacityTimer&&clearTimeout(this.hideOpacityTimer),this.hideDisplayTimer&&clearTimeout(this.hideDisplayTimer);const{textStyle:o}=this.style;if(i.title)this.title.textContent=i.title,this.title.style.display="block",this.text.setAttribute("style",Ga(o));else{this.title.textContent="",this.title.style.display="none";const e=Object.assign(Object.assign({},o),{padding:"40px 20px 26px",color:"#353535"});this.text.setAttribute("style",Ga(e))}this.text.textContent=i.content||"",this.cancel.style.display=i.showCancel?"block":"none",this.cancel.textContent=i.cancelText||"",this.cancel.style.color=i.cancelColor||"",this.confirm.textContent=i.confirmText||"",this.confirm.style.color=i.confirmColor||"",this.cancel.onclick=()=>{this.hide(),t("cancel")},this.confirm.onclick=()=>{this.hide(),t("confirm")},this.el.style.display="block",setTimeout(()=>{this.el.style.opacity="1"},0),this.currentPath=null!==(r=null===(n=ae.page)||void 0===n?void 0:n.path)&&void 0!==r?r:Xa()})}hide(){this.hideOpacityTimer&&clearTimeout(this.hideOpacityTimer),this.hideDisplayTimer&&clearTimeout(this.hideDisplayTimer),this.currentPath=null,this.hideOpacityTimer=setTimeout(()=>{this.el.style.opacity="0",this.hideDisplayTimer=setTimeout(()=>{this.el.style.display="none"},200)},0)}}class as{constructor(){this.options={title:"",icon:"none",image:"",duration:1500,mask:!1},this.style={maskStyle:{position:"fixed","z-index":"1000",top:"0",right:"0",left:"0",bottom:"0"},toastStyle:{"z-index":"5000","box-sizing":"border-box",display:"flex","flex-direction":"column","justify-content":"center","-webkit-justify-content":"center",position:"fixed",top:"50%",left:"50%","min-width":"120px","max-width":"200px","min-height":"120px",padding:"15px",transform:"translate(-50%, -50%)","border-radius":"5px","text-align":"center","line-height":"1.6",color:"#FFFFFF",background:"rgba(17, 17, 17, 0.7)"},successStyle:{margin:"6px auto",width:"38px",height:"38px",background:"transparent url(data:image/svg+xml;base64,PHN2ZyB0PSIxNjM5NTQ4OTYzMjA0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQzNDgiIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48cGF0aCBkPSJNMjE5Ljk1MiA1MTIuNTc2bDIxMC40MzIgMjEwLjQzMi00NS4yNDggNDUuMjU2LTIxMC40MzItMjEwLjQzMnoiIHAtaWQ9IjQzNDkiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48cGF0aCBkPSJNNzk5LjY3MiAyNjIuMjY0bDQ1LjI1NiA0NS4yNTYtNDYwLjQ2NCA0NjAuNDY0LTQ1LjI1Ni00NS4yNTZ6IiBwLWlkPSI0MzUwIiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9zdmc+) no-repeat","background-size":"100%"},errrorStyle:{margin:"6px auto",width:"38px",height:"38px",background:"transparent url(data:image/svg+xml;base64,PHN2ZyB0PSIxNjM5NTUxMDU1MTgzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE0MDc2IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTUxMiA2NEMyNjQuNTggNjQgNjQgMjY0LjU4IDY0IDUxMnMyMDAuNTggNDQ4IDQ0OCA0NDggNDQ4LTIwMC41OCA0NDgtNDQ4Uzc1OS40MiA2NCA1MTIgNjR6IG0wIDc1MmEzNiAzNiAwIDEgMSAzNi0zNiAzNiAzNiAwIDAgMS0zNiAzNnogbTUxLjgzLTU1MS45NUw1NDggNjM2YTM2IDM2IDAgMCAxLTcyIDBsLTE1LjgzLTM3MS45NWMtMC4xLTEuMzMtMC4xNy0yLjY4LTAuMTctNC4wNWE1MiA1MiAwIDAgMSAxMDQgMGMwIDEuMzctMC4wNyAyLjcyLTAuMTcgNC4wNXoiIHAtaWQ9IjE0MDc3IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9zdmc+) no-repeat","background-size":"100%"},loadingStyle:{margin:"6px auto",width:"38px",height:"38px","-webkit-animation":"taroLoading 1s steps(12, end) infinite",animation:"taroLoading 1s steps(12, end) infinite",background:"transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat","background-size":"100%"},imageStyle:{margin:"6px auto",width:"40px",height:"40px",background:"transparent no-repeat","background-size":"100%"},textStyle:{margin:"0","font-size":"16px"}}}create(e={},t="toast"){var n,r;const{maskStyle:i,toastStyle:o,successStyle:a,errrorStyle:s,loadingStyle:l,imageStyle:u,textStyle:c}=this.style,d=Object.assign(Object.assign(Object.assign({},this.options),e),{_type:t});if(this.el=document.createElement("div"),this.el.className="taro__toast",this.el.style.opacity="0",this.el.style.transition="opacity 0.1s linear",this.el.ontouchmove=e=>{e.stopPropagation(),e.preventDefault()},this.mask=document.createElement("div"),this.mask.setAttribute("style",Ga(i)),this.mask.style.display=d.mask?"block":"none",this.icon=document.createElement("p"),d.image)this.icon.setAttribute("style",Ga(Object.assign(Object.assign({},u),{"background-image":`url(${d.image})`})));else{const e="loading"===d.icon?l:"error"===d.icon?s:a;this.icon.setAttribute("style",Ga(Object.assign(Object.assign({},e),"none"===d.icon?{display:"none"}:{})))}return this.toast=document.createElement("div"),this.toast.setAttribute("style",Ga(Object.assign(Object.assign({},o),"none"===d.icon?{"min-height":"0",padding:"10px 15px"}:{}))),this.title=document.createElement("p"),this.title.setAttribute("style",Ga(c)),this.title.textContent=d.title,this.toast.appendChild(this.icon),this.toast.appendChild(this.title),this.el.appendChild(this.mask),this.el.appendChild(this.toast),document.body.appendChild(this.el),setTimeout(()=>{this.el.style.opacity="1"},0),this.type=d._type,d.duration>=0&&this.hide(d.duration,this.type),this.currentPath=null!==(r=null===(n=ae.page)||void 0===n?void 0:n.path)&&void 0!==r?r:Xa(),""}show(e={},t="toast"){var n,r;const i=Object.assign(Object.assign(Object.assign({},this.options),e),{_type:t});this.hideOpacityTimer&&clearTimeout(this.hideOpacityTimer),this.hideDisplayTimer&&clearTimeout(this.hideDisplayTimer),this.title.textContent=i.title||"",this.mask.style.display=i.mask?"block":"none";const{toastStyle:o,successStyle:a,errrorStyle:s,loadingStyle:l,imageStyle:u}=this.style;if(i.image)this.icon.setAttribute("style",Ga(Object.assign(Object.assign({},u),{"background-image":`url(${i.image})`})));else if(!i.image&&i.icon){const e="loading"===i.icon?l:"error"===i.icon?s:a;this.icon.setAttribute("style",Ga(Object.assign(Object.assign({},e),"none"===i.icon?{display:"none"}:{})))}return this.toast.setAttribute("style",Ga(Object.assign(Object.assign({},o),"none"===i.icon?{"min-height":"0",padding:"10px 15px"}:{}))),this.el.style.display="block",setTimeout(()=>{this.el.style.opacity="1"},0),this.type=i._type,i.duration>=0&&this.hide(i.duration,this.type),this.currentPath=null!==(r=null===(n=ae.page)||void 0===n?void 0:n.path)&&void 0!==r?r:Xa(),""}hide(e=0,t=""){t&&t!==this.type||(this.hideOpacityTimer&&clearTimeout(this.hideOpacityTimer),this.hideDisplayTimer&&clearTimeout(this.hideDisplayTimer),this.currentPath=null,this.hideOpacityTimer=setTimeout(()=>{this.el.style.opacity="0",this.hideDisplayTimer=setTimeout(()=>{this.el.style.display="none"},100)},e))}}let ss="default";function ls(e){if("ready"===ss)return;const t=e.createElement("style");t.textContent='@font-face{font-weight:normal;font-style:normal;font-family:"taro";src:url("data:application/x-font-ttf;charset=utf-8;base64, AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJWs0t/AAABfAAAAFZjbWFwqVgGvgAAAeAAAAGGZ2x5Zph7qG0AAANwAAAAdGhlYWQRFoGhAAAA4AAAADZoaGVhCCsD7AAAALwAAAAkaG10eAg0AAAAAAHUAAAADGxvY2EADAA6AAADaAAAAAhtYXhwAQ4AJAAAARgAAAAgbmFtZYrphEEAAAPkAAACVXBvc3S3shtSAAAGPAAAADUAAQAAA+gAAABaA+gAAAAAA+gAAQAAAAAAAAAAAAAAAAAAAAMAAQAAAAEAAADih+FfDzz1AAsD6AAAAADXB57LAAAAANcHnssAAP/sA+gDOgAAAAgAAgAAAAAAAAABAAAAAwAYAAEAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQK8AZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABAAHjqCAPoAAAAWgPoABQAAAABAAAAAAAAA+gAAABkAAAD6AAAAAAABQAAAAMAAAAsAAAABAAAAV4AAQAAAAAAWAADAAEAAAAsAAMACgAAAV4ABAAsAAAABgAEAAEAAgB46gj//wAAAHjqCP//AAAAAAABAAYABgAAAAEAAgAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAKAAAAAAAAAACAAAAeAAAAHgAAAABAADqCAAA6ggAAAACAAAAAAAAAAwAOgABAAD/7AAyABQAAgAANzMVFB4UKAAAAAABAAAAAAO7AzoAFwAAEy4BPwE+AR8BFjY3ATYWFycWFAcBBiInPQoGBwUHGgzLDCELAh0LHwsNCgr9uQoeCgGzCyEOCw0HCZMJAQoBvgkCCg0LHQv9sQsKAAAAAAAAEgDeAAEAAAAAAAAAHQAAAAEAAAAAAAEABAAdAAEAAAAAAAIABwAhAAEAAAAAAAMABAAoAAEAAAAAAAQABAAsAAEAAAAAAAUACwAwAAEAAAAAAAYABAA7AAEAAAAAAAoAKwA/AAEAAAAAAAsAEwBqAAMAAQQJAAAAOgB9AAMAAQQJAAEACAC3AAMAAQQJAAIADgC/AAMAAQQJAAMACADNAAMAAQQJAAQACADVAAMAAQQJAAUAFgDdAAMAAQQJAAYACADzAAMAAQQJAAoAVgD7AAMAAQQJAAsAJgFRCiAgQ3JlYXRlZCBieSBmb250LWNhcnJpZXIKICB3ZXVpUmVndWxhcndldWl3ZXVpVmVyc2lvbiAxLjB3ZXVpR2VuZXJhdGVkIGJ5IHN2ZzJ0dGYgZnJvbSBGb250ZWxsbyBwcm9qZWN0Lmh0dHA6Ly9mb250ZWxsby5jb20ACgAgACAAQwByAGUAYQB0AGUAZAAgAGIAeQAgAGYAbwBuAHQALQBjAGEAcgByAGkAZQByAAoAIAAgAHcAZQB1AGkAUgBlAGcAdQBsAGEAcgB3AGUAdQBpAHcAZQB1AGkAVgBlAHIAcwBpAG8AbgAgADEALgAwAHcAZQB1AGkARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwECAQMBBAABeAd1bmlFQTA4AAAAAAA=") format("truetype");}@-webkit-keyframes taroLoading{0%{-webkit-transform:rotate3d(0, 0, 1, 0deg);}100%{-webkit-transform:rotate3d(0, 0, 1, 360deg);transform:rotate3d(0, 0, 1, 360deg);}}@keyframes taroLoading{0%{-webkit-transform:rotate3d(0, 0, 1, 0deg);}100%{-webkit-transform:rotate3d(0, 0, 1, 360deg);transform:rotate3d(0, 0, 1, 360deg);}}.taro-modal__foot:after {content: "";position: absolute;left: 0;top: 0;right: 0;height: 1px;border-top: 1px solid #D5D5D6;color: #D5D5D6;-webkit-transform-origin: 0 0;transform-origin: 0 0;-webkit-transform: scaleY(0.5);transform: scaleY(0.5);} .taro-model__btn:active {background-color: #EEEEEE}.taro-model__btn:not(:first-child):after {content: "";position: absolute;left: 0;top: 0;width: 1px;bottom: 0;border-left: 1px solid #D5D5D6;color: #D5D5D6;-webkit-transform-origin: 0 0;transform-origin: 0 0;-webkit-transform: scaleX(0.5);transform: scaleX(0.5);}.taro-actionsheet__cell:not(:last-child):after {content: "";position: absolute;left: 0;bottom: 0;right: 0;height: 1px;border-top: 1px solid #e5e5e5;color: #e5e5e5;-webkit-transform-origin: 0 0;transform-origin: 0 0;-webkit-transform: scaleY(0.5);transform: scaleY(0.5);}',e.querySelector("head").appendChild(t),ss="ready"}const us=new as,cs=new os,ds=new is,hs=(e={title:""})=>{ls(document),e=Object.assign({title:"",icon:"success",image:"",duration:1500,mask:!1},e);const{success:t,fail:n,complete:r}=e,i=new Va({name:"showToast",success:t,fail:n,complete:r});if("string"!==typeof e.title)return i.fail({errMsg:qa({para:"title",correct:"String",wrong:e.title})});if("number"!==typeof e.duration)return i.fail({errMsg:qa({para:"duration",correct:"Number",wrong:e.duration})});e.image&&"string"!==typeof e.image&&(e.image=""),e.mask=!!e.mask;let o="";return o=us.el?us.show(e,"toast"):us.create(e,"toast"),i.success({errMsg:o})},fs=({noConflict:e=!1,success:t,fail:n,complete:r}={})=>{const i=new Va({name:"hideToast",success:t,fail:n,complete:r});return us.el?(us.hide(0,e?"toast":""),i.success()):i.success()},ps=(e={title:""})=>{ls(document),e=Object.assign({title:"",mask:!1},e);const{success:t,fail:n,complete:r}=e,i=new Va({name:"showLoading",success:t,fail:n,complete:r}),o={icon:"loading",image:"",duration:-1};if(e=Object.assign({},e,o),"string"!==typeof e.title)return i.fail({errMsg:qa({para:"title",correct:"String",wrong:e.title})});e.mask=!!e.mask;let a="";return a=us.el?us.show(e,"loading"):us.create(e,"loading"),i.success({errMsg:a})},gs=({noConflict:e=!1,success:t,fail:n,complete:r}={})=>{const i=new Va({name:"hideLoading",success:t,fail:n,complete:r});return us.el?(us.hide(0,e?"loading":""),i.success()):i.success()},ms=(...e)=>ie(void 0,[...e],void 0,function*(e={}){ls(document),e=Object.assign({title:"",content:"",showCancel:!0,cancelText:"\u53d6\u6d88",cancelColor:"#000000",confirmText:"\u786e\u5b9a",confirmColor:"#3CC51F"},e);const{success:t,fail:n,complete:r}=e,i=new Va({name:"showModal",success:t,fail:n,complete:r});if("string"!==typeof e.title)return i.fail({errMsg:qa({para:"title",correct:"String",wrong:e.title})});if("string"!==typeof e.content)return i.fail({errMsg:qa({para:"content",correct:"String",wrong:e.content})});if("string"!==typeof e.cancelText)return i.fail({errMsg:qa({para:"cancelText",correct:"String",wrong:e.cancelText})});if(e.cancelText.replace(/[\u0391-\uFFE5]/g,"aa").length>8)return i.fail({errMsg:"cancelText length should not larger then 4 Chinese characters"});if("string"!==typeof e.confirmText)return i.fail({errMsg:qa({para:"confirmText",correct:"String",wrong:e.confirmText})});if(e.confirmText.replace(/[\u0391-\uFFE5]/g,"aa").length>8)return i.fail({errMsg:"confirmText length should not larger then 4 Chinese characters"});if("string"!==typeof e.cancelColor)return i.fail({errMsg:qa({para:"cancelColor",correct:"String",wrong:e.cancelColor})});if("string"!==typeof e.confirmColor)return i.fail({errMsg:qa({para:"confirmColor",correct:"String",wrong:e.confirmColor})});e.showCancel=!!e.showCancel;let o="";o=cs.el?yield cs.show(e):yield cs.create(e);const a={cancel:!1,confirm:!1};return a[o]=!0,i.success(a)});function vs(){cs.el&&cs.hide()}const ys=(...e)=>ie(void 0,[...e],void 0,function*(e={itemList:[]},t="showActionSheet"){ls(document),e=Object.assign({itemColor:"#000000",itemList:[]},e);const{success:n,fail:r,complete:i}=e,o=new Va({name:t,success:n,fail:r,complete:i});if(!Array.isArray(e.itemList))return o.fail({errMsg:qa({para:"itemList",correct:"Array",wrong:e.itemList})});if(e.itemList.length<1)return o.fail({errMsg:"parameter error: parameter.itemList should have at least 1 item"});if(e.itemList.length>6)return o.fail({errMsg:"parameter error: parameter.itemList should not be large than 6"});for(let s=0;s{var e,t;us.currentPath&&us.currentPath!==(null===(e=ae.page)||void 0===e?void 0:e.path)&&(fs(),gs()),cs.currentPath&&cs.currentPath!==(null===(t=ae.page)||void 0===t?void 0:t.path)&&vs()});const bs=function(){return Gt.getCurrentInstance().app},ws=Gt.getCurrentInstance,As=(e,t)=>(t.forEach(t=>{Object.defineProperty(e,t,{get:()=>Ja(t)})}),e),_s=["bounce","ease","elastic","linear","quad","cubic","poly","bezier","circle","sin","exp","in","out","inOut"],ks=["cancelAnimation","derived","shared","decay","spring","timing","delay","repeat","sequence","runOnJS","runOnUI"],Ss=As({},ks);Ss.Easing=As({},_s),Ss.scrollViewContext=As({},["scrollTo"]);const Es=Gt.nextTick;var xs="undefined"!==typeof globalThis&&globalThis||"undefined"!==typeof self&&self||"undefined"!==typeof global&&global||{},Ts={searchParams:"URLSearchParams"in xs,iterable:"Symbol"in xs&&"iterator"in Symbol,blob:"FileReader"in xs&&"Blob"in xs&&function(){try{return new Blob,!0}catch(wT){return!1}}(),formData:"FormData"in xs,arrayBuffer:"ArrayBuffer"in xs};function Cs(e){return e&&DataView.prototype.isPrototypeOf(e)}if(Ts.arrayBuffer)var Ps=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Os=ArrayBuffer.isView||function(e){return e&&Ps.indexOf(Object.prototype.toString.call(e))>-1};function $s(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Is(e){return"string"!==typeof e&&(e=String(e)),e}function js(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Ts.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Ns(e){this.map={},e instanceof Ns?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function Ls(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function Rs(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function Ds(e){var t=new FileReader,n=Rs(t);return t.readAsArrayBuffer(e),n}function Ms(e){var t=new FileReader,n=Rs(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}function Bs(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}function Ws(e,t){if(!(this instanceof Ws))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof Ws){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Ns(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Ns(t.headers)),this.method=Hs(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in xs){var e=new AbortController;return e.signal}}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),("GET"===this.method||"HEAD"===this.method)&&("no-store"===t.cache||"no-cache"===t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Vs(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function qs(e){var t=new Ns,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(o){console.warn("Response "+o.message)}}}),t}function Qs(e,t){if(!(this instanceof Qs))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Ns(t.headers),this.url=t.url||"",this._initBody(e)}Ws.prototype.clone=function(){return new Ws(this,{body:this._bodyInit})},zs.call(Ws.prototype),zs.call(Qs.prototype),Qs.prototype.clone=function(){return new Qs(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Ns(this.headers),url:this.url})},Qs.error=function(){var e=new Qs(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var Gs=[301,302,303,307,308];Qs.redirect=function(e,t){if(-1===Gs.indexOf(t))throw new RangeError("Invalid status code");return new Qs(null,{status:t,headers:{location:e}})};var Ys=xs.DOMException;try{new Ys}catch(AT){Ys=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Ys.prototype=Object.create(Error.prototype),Ys.prototype.constructor=Ys}function Ks(e,t){return new Promise(function(n,r){var i=new Ws(e,t);if(i.signal&&i.signal.aborted)return r(new Ys("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}function s(e){try{return""===e&&xs.location.href?xs.location.href:e}catch(wT){return e}}if(o.onload=function(){var e={statusText:o.statusText,headers:qs(o.getAllResponseHeaders()||"")};0===i.url.indexOf("file://")&&(o.status<200||o.status>599)?e.status=200:e.status=o.status,e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var t="response"in o?o.response:o.responseText;setTimeout(function(){n(new Qs(t,e))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new Ys("Aborted","AbortError"))},0)},o.open(i.method,s(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Ts.blob?o.responseType="blob":Ts.arrayBuffer&&(o.responseType="arraybuffer")),t&&"object"===typeof t.headers&&!(t.headers instanceof Ns||xs.Headers&&t.headers instanceof xs.Headers)){var l=[];Object.getOwnPropertyNames(t.headers).forEach(function(e){l.push($s(e)),o.setRequestHeader(e,Is(t.headers[e]))}),i.headers.forEach(function(e,t){-1===l.indexOf(t)&&o.setRequestHeader(t,e)})}else i.headers.forEach(function(e,t){o.setRequestHeader(t,e)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send("undefined"===typeof i._bodyInit?null:i._bodyInit)})}Ks.polyfill=!0,xs.fetch||(xs.fetch=Ks,xs.Headers=Ns,xs.Request=Ws,xs.Response=Qs);const Js=6e4;(function(e){e()})(function(){function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function s(){return s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=f(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},s.apply(null,arguments)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!e})()}function d(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return t(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function f(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}function p(e,t,n,r){var i=s(l(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function g(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=g(e,"string");return"symbol"==typeof t?t:t+""}function v(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function y(e){var t;try{t=new Event("abort")}catch(wT){"undefined"!==typeof document?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function b(e){if(void 0===e)if("undefined"===typeof document)e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch(AT){e=new Error("This operation was aborted"),e.name="AbortError"}return e}(function(e){e.AbortSignal,e.AbortController})("undefined"!==typeof self?self:Ct);var w=function(){function e(){r(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(e,[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,i=n.length;r0?(t.retryTimes--,xl(r,t,n)):!1===$l(r,t,n)?n(new Error("Timeout and no data return")):void 0},c)}function Tl(e,t,n){return!!(e&&t&&n)&&(e[t]&&e[t]===n)}function Cl(e){var t=e.useStore,n=e.storeKey,r=e.storeCheck,i=e.storeCheckKey,o=e.storeSign,a=e.dataCheck;if(t=!!t&&hl.enabled,t){var s=hl.get(n);if(r=r||Tl,r(s,i,o)&&(!a||s&&a&&!1!==a(s)))return s}return null}function Pl(e){var t=e.useStore,n=e.storeKey,r=e.dataCheck;if(t=!!t&&hl.enabled,t){var i=hl.get(n);if(!r||i&&r&&!1!==r(i))return i}return null}function Ol(e){var t=e.useStore,n=e.storeKey,r=e.data;t=!!t&&hl.enabled,t&&hl.set(n,r)}function $l(e,t,n){var r=t.backup,i=void 0;if(r){if("string"===typeof r)return delete t.backup,i=El(r,t.params),xl(i,t,n,{backup:r});if(Array.isArray(r)&&r.length){var o=r.shift();return i=El(o,t.params),xl(i,t,n,{backup:o})}}var a=Pl({useStore:t.useStore,storeKey:e,dataCheck:t.dataCheck});return!!a&&(n(null,a),!0)}function Il(e){var t=e.url,n=e.charset;if(bl){var r=bl.createElement("script");return r.type="text/javascript",n&&(r.charset=n),r.src=t,wl.appendChild(r),r}}const{Link:jl}=Gt;function Nl(e="",t){return t="string"===typeof t?t:Ka(t),t&&(e+=(~e.indexOf("?")?"&":"?")+t),e=e.replace("?&","?"),e}function Ll(e={}){const{success:t,complete:n,fail:r}=e,i={},o={};let{cache:a="default",credentials:s,data:l,dataType:u,header:c={},jsonp:d,method:h="GET",mode:f,responseType:p,signal:g,timeout:m,url:v=""}=e,y=re(e,["cache","credentials","data","dataType","header","jsonp","method","mode","responseType","signal","timeout","url"]);if("number"!==typeof m&&(m=Js),Object.assign(i,y),d)return i.params=l,i.cache=y.jsonpCache,i.timeout=m,"string"===typeof d&&(i.name=d),Sl(v,i).then(e=>(o.statusCode=200,o.data=e,C(t)&&t(o),C(n)&&n(o),o)).catch(e=>(C(r)&&r(e),C(n)&&n(o),Promise.reject(e)));i.method=h;const b=i.method.toUpperCase();if(i.cache=a,"GET"===b||"HEAD"===b)v=Nl(v,l);else if(["[object Array]","[object Object]"].indexOf(Object.prototype.toString.call(l))>=0){const e=Object.keys(c).find(e=>"content-type"===e.toLowerCase());e||(c["Content-Type"]="application/json");const t=c[e||"Content-Type"];t.indexOf("application/json")>=0?i.body=JSON.stringify(l):t.indexOf("application/x-www-form-urlencoded")>=0?i.body=Ka(l):i.body=l}else i.body=l;c&&(i.headers=c),f&&(i.mode=f);let w=null,A=null;g?i.signal=g:(A=new window.AbortController,i.signal=A.signal,w=setTimeout(function(){A&&A.abort()},m)),i.credentials=s;const _=fetch(v,i).then(e=>{if(w&&(clearTimeout(w),w=null),A&&(A=null),!e){const e={ok:!1};throw e}o.statusCode=e.status,o.header={};for(const t of e.headers.keys())o.header[t]=e.headers.get(t);return"arraybuffer"===p?e.arrayBuffer():204===o.statusCode||"json"!==u&&"undefined"!==typeof u?"text"===p||"text"===u?e.text():Promise.resolve(null):e.json().catch(()=>null)}).then(e=>(o.data=e,C(t)&&t(o),C(n)&&n(o),o)).catch(e=>(w&&(clearTimeout(w),w=null),A&&(A=null),C(r)&&r(e),C(n)&&n(o),e.statusCode=o.statusCode,e.errMsg=e.message,Promise.reject(e)));return!_.abort&&A&&(_.abort=e=>{A&&(e&&e(),A.abort(),w&&(clearTimeout(w),w=null))}),_}function Rl(e){return Ll(e.requestParams)}const Dl=new jl(Rl),Ml=(...e)=>{const[t="",n={}]=e;return"string"===typeof t?n.url=t:Object.assign(n,t),Dl.request(n)};Dl.addInterceptor.bind(Dl),Dl.cleanInterceptors.bind(Dl);const Bl={addRouteBuilder:Ja("addRouteBuilder"),getRouteContext:Ja("getRouteContext"),removeRouteBuilder:Ja("removeRouteBuilder")},{Behavior:Ul,getEnv:zl,ENV_TYPE:Fl,Link:Hl,interceptors:Wl,interceptorify:Vl,Current:ql,options:Ql,eventCenter:Gl,Events:Yl,preload:Kl}=Gt,Jl={Behavior:Ul,getEnv:zl,ENV_TYPE:Fl,Link:Hl,interceptors:Wl,interceptorify:Vl,Current:ql,getCurrentInstance:ws,options:Ql,nextTick:Es,eventCenter:Gl,Events:Yl,preload:Kl,history:So,navigateBack:Do,navigateTo:Lo,reLaunch:Bo,redirectTo:Ro,getCurrentPages:Uo,switchTab:Mo,router:Bl,worklet:Ss},Zl=Za("requirePlugin");function Xl(){var e;return(null===this||void 0===this?void 0:this.pxTransformConfig)?this.pxTransformConfig:(e=Jl).config||(e.config={})}const eu=750,tu={640:1.17,750:1,828:.905},nu=20,ru=5,iu="rem",ou=function({designWidth:e=eu,deviceRatio:t=tu,baseFontSize:n=nu,unitPrecision:r=ru,targetUnit:i=iu}){const o=Xl.call(this);o.designWidth=e,o.deviceRatio=t,o.baseFontSize=n,o.targetUnit=i,o.unitPrecision=r},au=function(e=0){const t=Xl.call(this),n=t.baseFontSize||nu,r=t.deviceRatio||tu,i=((e=0)=>C(t.designWidth)?t.designWidth(e):t.designWidth)(e);if(!(i in t.deviceRatio))throw new Error(`deviceRatio \u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728 ${i} \u7684\u8bbe\u7f6e\uff01`);const o=t.targetUnit||iu,a=t.unitPrecision||ru,s=~~e;let l=1/r[i];switch(o){case"vw":l=i/100;break;case"px":l*=2;break;default:l*=2*n}let u=s/l;return a>=0&&a<=100&&(u=Number(u.toFixed(a))),u+o},su=function(){const e=document.createElement("canvas");return 0===e.toDataURL("image/webp").indexOf("data:image/webp")},lu=function(){const e=Xl.call(this);return{platform:"web",taroVersion:"4.1.5",designWidth:e.designWidth}};Jl.requirePlugin=Zl,Jl.getApp=bs,Jl.pxTransform=au,Jl.initPxTransform=ou,Jl.canIUseWebp=su,Jl.getAppInfo=lu;const uu=Jl;uu.useAddToFavorites=ct,uu.useDidHide=Je,uu.useDidShow=Ze,uu.useError=Xe,uu.useLaunch=tt,uu.useLoad=rt,uu.useOptionMenuClick=dt,uu.usePageNotFound=nt,uu.usePageScroll=it,uu.usePullDownRefresh=ot,uu.usePullIntercept=at,uu.useReachBottom=st,uu.useReady=mt,uu.useResize=lt,uu.useRouter=vt,uu.useSaveExitState=ht,uu.useShareAppMessage=ft,uu.useShareTimeline=pt,uu.useTabItemTap=yt,uu.useTitleClick=gt,uu.useScope=bt,uu.useUnhandledRejection=et,uu.useUnload=ut;var cu={exports:{}},du={},hu={exports:{}},fu={},pu=Symbol.for("react.element"),gu=Symbol.for("react.portal"),mu=Symbol.for("react.fragment"),vu=Symbol.for("react.strict_mode"),yu=Symbol.for("react.profiler"),bu=Symbol.for("react.provider"),wu=Symbol.for("react.context"),Au=Symbol.for("react.forward_ref"),_u=Symbol.for("react.suspense"),ku=Symbol.for("react.memo"),Su=Symbol.for("react.lazy"),Eu=Symbol.iterator;function xu(e){return null===e||"object"!==typeof e?null:(e=Eu&&e[Eu]||e["@@iterator"],"function"===typeof e?e:null)}var Tu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cu=Object.assign,Pu={};function Ou(e,t,n){this.props=e,this.context=t,this.refs=Pu,this.updater=n||Tu}function $u(){}function Iu(e,t,n){this.props=e,this.context=t,this.refs=Pu,this.updater=n||Tu}Ou.prototype.isReactComponent={},Ou.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Ou.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},$u.prototype=Ou.prototype;var ju=Iu.prototype=new $u;ju.constructor=Iu,Cu(ju,Ou.prototype),ju.isPureReactComponent=!0;var Nu=Array.isArray,Lu=Object.prototype.hasOwnProperty,Ru={current:null},Du={key:!0,ref:!0,__self:!0,__source:!0};function Mu(e,t,n){var r,i={},o=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)Lu.call(t,r)&&!Du.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1{const{dangerouslySetInnerHTML:n,style:r}=e;return"string"!==typeof r&&(t.style=r),Object.assign(Object.assign({},t),{dangerouslySetInnerHTML:n})};function uc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i>>1,o=e[r];if(!(0>>1;ri(l,n))ui(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(ui(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,h=3,f=!1,p=!1,g=!1,m="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var i=n(u);null!==i;){if(null===i.callback)r(u);else{if(!(i.startTime<=e))break;r(u),i.sortIndex=i.expirationTime,t(l,i)}i=n(u)}}function w(e){if(g=!1,b(e),!p)if(null!==n(l))p=!0,I(A);else{var t=n(u);null!==t&&j(w,t.startTime-e)}}function A(t,i){p=!1,g&&(g=!1,v(E),E=-1),f=!0;var o=h;try{for(b(i),d=n(l);null!==d&&(!(d.expirationTime>i)||t&&!C());){var a=d.callback;if("function"===typeof a){d.callback=null,h=d.priorityLevel;var s=a(d.expirationTime<=i);i=e.unstable_now(),"function"===typeof s?d.callback=s:d===n(l)&&r(l),b(i)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var m=n(u);null!==m&&j(w,m.startTime-i),c=!1}return c}finally{d=null,h=o,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var _,k=!1,S=null,E=-1,x=5,T=-1;function C(){return!(e.unstable_now()-Te||125a?(r.sortIndex=o,t(u,r),null===n(l)&&r===n(u)&&(g?(v(E),E=-1):g=!0,j(w,o-a))):(r.sortIndex=s,t(l,r),p||f||(p=!0,I(A))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}})(fc),hc.exports=fc;var pc=hc.exports,gc=Ju,mc=pc;function vc(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function Oc(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var $c={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$c[e]=new Oc(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$c[t]=new Oc(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){$c[e]=new Oc(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$c[e]=new Oc(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$c[e]=new Oc(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){$c[e]=new Oc(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){$c[e]=new Oc(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){$c[e]=new Oc(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){$c[e]=new Oc(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ic=/[\-:]([a-z])/g;function jc(e){return e[1].toUpperCase()}function Nc(e,t,n,r){var i=$c.hasOwnProperty(t)?$c[t]:null;(null!==i?0!==i.type:r||!(2s||i[a]!==o[s]){var l="\n"+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{ed=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xc(e):""}function nd(e){switch(e.tag){case 5:return Xc(e.type);case 16:return Xc("Lazy");case 13:return Xc("Suspense");case 19:return Xc("SuspenseList");case 0:case 2:case 15:return e=td(e.type,!1),e;case 11:return e=td(e.type.render,!1),e;case 1:return e=td(e.type,!0),e;default:return""}}function rd(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case Mc:return"Fragment";case Dc:return"Portal";case Uc:return"Profiler";case Bc:return"StrictMode";case Wc:return"Suspense";case Vc:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case Fc:return(e.displayName||"Context")+".Consumer";case zc:return(e._context.displayName||"Context")+".Provider";case Hc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=""!==e?"ForwardRef("+e+")":"ForwardRef"),e;case qc:return t=e.displayName||null,null!==t?t:rd(e.type)||"Memo";case Qc:t=e._payload,e=e._init;try{return rd(e(t))}catch(n){}}return null}function id(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rd(t);case 8:return t===Bc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function od(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ad(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function sd(e){var t=ad(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ld(e){e._valueTracker||(e._valueTracker=sd(e))}function ud(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ad(e)?e.checked?"true":"false":e.value),e=r,e!==n&&(t.setValue(e),!0)}function cd(e){if(e=e||("undefined"!==typeof document?document:void 0),"undefined"===typeof e)return null;try{return e.activeElement||e.body}catch(t){return e.body}}function dd(e,t){var n=t.checked;return Zc({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function hd(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=od(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function fd(e,t){t=t.checked,null!=t&&Nc(e,"checked",t,!1)}function pd(e,t){fd(e,t);var n=od(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?md(e,t.type,n):t.hasOwnProperty("defaultValue")&&md(e,t.type,od(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function gd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,""!==n&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function md(e,t,n){"number"===t&&cd(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vd=Array.isArray;function yd(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ed.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Td(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Cd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Pd=["Webkit","ms","Moz","O"];function Od(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||Cd.hasOwnProperty(e)&&Cd[e]?(""+t).trim():t+"px"}function $d(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=Od(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(Cd).forEach(function(e){Pd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cd[t]=Cd[e]})});var Id=Zc({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function jd(e,t){if(t){if(Id[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(vc(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(vc(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(vc(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(vc(62))}}function Nd(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ld=null;function Rd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Dd=null,Md=null,Bd=null;function Ud(e){if(e=Xg(e)){if("function"!==typeof Dd)throw Error(vc(280));var t=e.stateNode;t&&(t=tm(t),Dd(e.stateNode,e.type,t))}}function zd(e){Md?Bd?Bd.push(e):Bd=[e]:Md=e}function Fd(){if(Md){var e=Md,t=Bd;if(Bd=Md=null,Ud(e),t)for(e=0;e>>=0,0===e?32:31-(Eh(e)/xh|0)|0}var Ch=64,Ph=4194304;function Oh(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function $h(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~i;0!==s?r=Oh(s):(o&=a,0!==o&&(r=Oh(o)))}else a=n&~i,0!==a?r=Oh(a):0!==o&&(r=Oh(o));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&(i=r&-r,o=t&-t,i>=o||16===i&&0!==(4194240&o)))return t;if(0!==(4&r)&&(r|=16&n),t=e.entangledLanes,0!==t)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Dh(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sh(t),e[t]=n}function Mh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=cp),fp=String.fromCharCode(32),pp=!1;function gp(e,t){switch(e){case"keyup":return-1!==lp.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mp(e){return e=e.detail,"object"===typeof e&&"data"in e?e.data:null}var vp=!1;function yp(e,t){switch(e){case"compositionend":return mp(t);case"keypress":return 32!==t.which?null:(pp=!0,fp);case"textInput":return e=t.data,e===fp&&pp?null:e;default:return null}}function bp(e,t){if(vp)return"compositionend"===e||!up&&gp(e,t)?(e=kf(),_f=Af=wf=null,vp=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=zp(r)}}function Hp(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Hp(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Wp(){for(var e=window,t=cd();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;e=t.contentWindow,t=cd(e.document)}return t}function Vp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function qp(e){var t=Wp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Hp(n.ownerDocument.documentElement,n)){if(null!==r&&Vp(n))if(t=r.start,e=r.end,void 0===e&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Fp(n,o);var a=Fp(n,r);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n=document.documentMode,Gp=null,Yp=null,Kp=null,Jp=!1;function Zp(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Jp||null==Gp||Gp!==cd(r)||(r=Gp,"selectionStart"in r&&Vp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kp&&Up(Kp,r)||(Kp=r,r=xg(Yp,"onSelect"),0rm||(e.current=nm[rm],nm[rm]=null,rm--)}function am(e,t){rm++,nm[rm]=e.current,e.current=t}var sm={},lm=im(sm),um=im(!1),cm=sm;function dm(e,t){var n=e.type.contextTypes;if(!n)return sm;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function hm(e){return e=e.childContextTypes,null!==e&&void 0!==e}function fm(){om(um),om(lm)}function pm(e,t,n){if(lm.current!==sm)throw Error(vc(168));am(lm,t),am(um,n)}function gm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext(),r)if(!(i in t))throw Error(vc(108,id(e)||"Unknown",i));return Zc({},n,r)}function mm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sm,cm=lm.current,am(lm,e),am(um,um.current),!0}function vm(e,t,n){var r=e.stateNode;if(!r)throw Error(vc(169));n?(e=gm(e,t,cm),r.__reactInternalMemoizedMergedChildContext=e,om(um),om(lm),am(lm,e)):om(um),am(um,n)}var ym=null,bm=!1,wm=!1;function Am(e){null===ym?ym=[e]:ym.push(e)}function _m(e){bm=!0,Am(e)}function km(){if(!wm&&null!==ym){wm=!0;var e=0,t=Uh;try{var n=ym;for(Uh=1;e>=a,i-=a,$m=1<<32-Sh(t)+i|n<g?(m=p,p=null):m=p.sibling;var v=h(i,p,s[g],l);if(null===v){null===p&&(p=m);break}e&&p&&null===v.alternate&&t(i,p),a=o(v,a,g),null===c?u=v:c.sibling=v,c=v,p=m}if(g===s.length)return n(i,p),Bm&&jm(i,g),u;if(null===p){for(;gg?(m=p,p=null):m=p.sibling;var y=h(i,p,v.value,l);if(null===y){null===p&&(p=m);break}e&&p&&null===y.alternate&&t(i,p),a=o(y,a,g),null===c?u=y:c.sibling=y,c=y,p=m}if(v.done)return n(i,p),Bm&&jm(i,g),u;if(null===p){for(;!v.done;g++,v=s.next())v=d(i,v.value,l),null!==v&&(a=o(v,a,g),null===c?u=v:c.sibling=v,c=v);return Bm&&jm(i,g),u}for(p=r(i,p);!v.done;g++,v=s.next())v=f(p,i,g,v.value,l),null!==v&&(e&&null!==v.alternate&&p.delete(null===v.key?g:v.key),a=o(v,a,g),null===c?u=v:c.sibling=v,c=v);return e&&p.forEach(function(e){return t(i,e)}),Bm&&jm(i,g),u}function m(e,r,o,s){if("object"===typeof o&&null!==o&&o.type===Mc&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case Rc:e:{for(var l=o.key,u=r;null!==u;){if(u.key===l){if(l=o.type,l===Mc){if(7===u.tag){n(e,u.sibling),r=i(u,o.props.children),r.return=e,e=r;break e}}else if(u.elementType===l||"object"===typeof l&&null!==l&&l.$$typeof===Qc&&Xm(l)===u.type){n(e,u.sibling),r=i(u,o.props),r.ref=Jm(e,u,o),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}o.type===Mc?(r=AA(o.props.children,e.mode,s,o.key),r.return=e,e=r):(s=wA(o.type,o.key,o.props,null,e.mode,s),s.ref=Jm(e,r,o),s.return=e,e=s)}return a(e);case Dc:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),r=i(r,o.children||[]),r.return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}r=SA(o,e.mode,s),r.return=e,e=r}return a(e);case Qc:return u=o._init,m(e,r,u(o._payload),s)}if(vd(o))return p(e,r,o,s);if(Kc(o))return g(e,r,o,s);Zm(e,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),r=i(r,o),r.return=e,e=r):(n(e,r),r=kA(o,e.mode,s),r.return=e,e=r),a(e)):n(e,r)}return m}var tv=ev(!0),nv=ev(!1),rv=im(null),iv=null,ov=null,av=null;function sv(){av=ov=iv=null}function lv(e){var t=rv.current;om(rv),e._currentValue=t}function uv(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function cv(e,t){iv=e,av=ov=null,e=e.dependencies,null!==e&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Xy=!0),e.firstContext=null)}function dv(e){var t=e._currentValue;if(av!==e)if(e={context:e,memoizedValue:t,next:null},null===ov){if(null===iv)throw Error(vc(308));ov=e,iv.dependencies={lanes:0,firstContext:e}}else ov=ov.next=e;return t}var hv=null;function fv(e){null===hv?hv=[e]:hv.push(e)}function pv(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,fv(t)):(n.next=i.next,i.next=n),t.interleaved=n,gv(e,r)}function gv(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,n=e.alternate,null!==n&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var mv=!1;function vv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bv(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wv(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&dw)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,gv(e,n)}return i=r.interleaved,null===i?(t.next=t,fv(r)):(t.next=i.next,i.next=t),r.interleaved=t,gv(e,n)}function Av(e,t,n){if(t=t.updateQueue,null!==t&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bh(e,n)}}function _v(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,null!==n){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}e=n.lastBaseUpdate,null===e?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function kv(e,t,n,r){var i=e.updateQueue;mv=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?o=u:a.next=u,a=l;var c=e.alternate;null!==c&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(null!==o){var d=i.baseState;a=0,c=u=l=null,s=o;do{var h=s.lane,f=s.eventTime;if((r&h)===h){null!==c&&(c=c.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,g=s;switch(h=t,f=n,g.tag){case 1:if(p=g.payload,"function"===typeof p){d=p.call(f,d,h);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(p=g.payload,h="function"===typeof p?p.call(f,d,h):p,null===h||void 0===h)break e;d=Zc({},d,h);break e;case 2:mv=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,h=i.effects,null===h?i.effects=[s]:h.push(s))}else f={eventTime:f,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=f,l=d):c=c.next=f,a|=h;if(s=s.next,null===s){if(s=i.shared.pending,null===s)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(1);if(null===c&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,null!==t){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);bw|=a,e.lanes=a,e.memoizedState=d}}function Sv(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;tn?n:4,e(!0);var r=Bv.transition;Bv.transition={};try{e(!1),t()}finally{Uh=n,Bv.transition=r}}function xy(){return Xv().memoizedState}function Ty(e,t,n){var r=Mw(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Py(e))Oy(t,n);else if(n=pv(e,t,n,r),null!==n){var i=Dw();Bw(n,e,r,i),$y(n,t,r)}}function Cy(e,t,n){var r=Mw(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Py(e))Oy(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&(o=t.lastRenderedReducer,null!==o))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Bp(s,a)){var l=t.interleaved;return null===l?(i.next=i,fv(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(u){}n=pv(e,t,i,r),null!==n&&(i=Dw(),Bw(n,e,r,i),$y(n,t,r))}}function Py(e){var t=e.alternate;return e===zv||null!==t&&t===zv}function Oy(e,t){Vv=Wv=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $y(e,t,n){if(0!==(4194240&n)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bh(e,n)}}var Iy={readContext:dv,useCallback:Gv,useContext:Gv,useEffect:Gv,useImperativeHandle:Gv,useInsertionEffect:Gv,useLayoutEffect:Gv,useMemo:Gv,useReducer:Gv,useRef:Gv,useState:Gv,useDebugValue:Gv,useDeferredValue:Gv,useTransition:Gv,useMutableSource:Gv,useSyncExternalStore:Gv,useId:Gv,unstable_isNewReconciler:!1},jy={readContext:dv,useCallback:function(e,t){return Zv().memoizedState=[e,void 0===t?null:t],e},useContext:dv,useEffect:gy,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,fy(4194308,4,by.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fy(4194308,4,e,t)},useInsertionEffect:function(e,t){return fy(4,2,e,t)},useMemo:function(e,t){var n=Zv();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zv();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ty.bind(null,zv,e),[r.memoizedState,e]},useRef:function(e){var t=Zv();return e={current:e},t.memoizedState=e},useState:cy,useDebugValue:Ay,useDeferredValue:function(e){return Zv().memoizedState=e},useTransition:function(){var e=cy(!1),t=e[0];return e=Ey.bind(null,e[1]),Zv().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=zv,i=Zv();if(Bm){if(void 0===n)throw Error(vc(407));n=n()}else{if(n=t(),null===hw)throw Error(vc(349));0!==(30&Uv)||oy(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,gy(sy.bind(null,r,o,e),[e]),r.flags|=2048,dy(9,ay.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Zv(),t=hw.identifierPrefix;if(Bm){var n=Im,r=$m;n=(r&~(1<<32-Sh(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qv++,0<\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),"select"===n&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[qg]=t,e[Qg]=r,db(e,t,!1,!1),t.stateNode=e;e:{switch(a=Nd(n,r),n){case"dialog":bg("cancel",e),bg("close",e),i=r;break;case"iframe":case"object":case"embed":bg("load",e),i=r;break;case"video":case"audio":for(i=0;iEw&&(t.flags|=128,r=!0,Tb(o,!1),t.lanes=4194304)}else{if(!r)if(e=Lv(a),null!==e){if(t.flags|=128,r=!0,n=e.updateQueue,null!==n&&(t.updateQueue=n,t.flags|=4),Tb(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!Bm)return Cb(t),null}else 2*ph()-o.renderingStartTime>Ew&&1073741824!==n&&(t.flags|=128,r=!0,Tb(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,null!==n?n.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ph(),t.sibling=null,n=Nv.current,am(Nv,r?1&n|2:1&n),t):(Cb(t),null);case 22:case 23:return Yw(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&gw)&&(Cb(t),6&t.subtreeFlags&&(t.flags|=8192)):Cb(t),null;case 24:return null;case 25:return null}throw Error(vc(156,t.tag))}function Ob(e,t){switch(Rm(t),t.tag){case 1:return hm(t.type)&&fm(),e=t.flags,65536&e?(t.flags=-65537&e|128,t):null;case 3:return $v(),om(um),om(lm),Dv(),e=t.flags,0!==(65536&e)&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return jv(t),null;case 13:if(om(Nv),e=t.memoizedState,null!==e&&null!==e.dehydrated){if(null===t.alternate)throw Error(vc(340));Gm()}return e=t.flags,65536&e?(t.flags=-65537&e|128,t):null;case 19:return om(Nv),null;case 4:return $v(),null;case 10:return lv(t.type._context),null;case 22:case 23:return Yw(),null;case 24:return null;default:return null}}db=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},hb=function(){},fb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Pv(xv.current);var o,a=null;switch(n){case"input":i=dd(e,i),r=dd(e,r),a=[];break;case"select":i=Zc({},i,{value:void 0}),r=Zc({},r,{value:void 0}),a=[];break;case"textarea":i=bd(e,i),r=bd(e,r),a=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=jg)}for(u in jd(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(bc.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var l=r[u];if(s=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(null!=l||null!=s))if("style"===u)if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(a||(a=[]),a.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(a=a||[]).push(u,l)):"children"===u?"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(bc.hasOwnProperty(u)?(null!=l&&"onScroll"===u&&bg("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},pb=function(e,t,n,r){n!==r&&(t.flags|=4)};var $b=!1,Ib=!1,jb="function"===typeof WeakSet?WeakSet:Set,Nb=null;function Lb(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){uA(e,t,r)}else n.current=null}function Rb(e,t,n){try{n()}catch(r){uA(e,t,r)}}var Db=!1;function Mb(e,t){if(Ng=ff,e=Wp(),Vp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(w){n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,h=null;t:for(;;){for(var f;;){if(d!==n||0!==i&&3!==d.nodeType||(s=a+i),d!==o||0!==r&&3!==d.nodeType||(l=a+r),3===d.nodeType&&(a+=d.nodeValue.length),null===(f=d.firstChild))break;h=d,d=f}for(;;){if(d===e)break t;if(h===n&&++u===i&&(s=a),h===o&&++c===r&&(l=a),null!==(f=d.nextSibling))break;d=h,h=d.parentNode}d=f}n=-1===s||-1===l?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lg={focusedElem:e,selectionRange:n},ff=!1,Nb=t;null!==Nb;)if(t=Nb,e=t.child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Nb=e;else for(;null!==Nb;){t=Nb;try{var p=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:break;case 1:if(null!==p){var g=p.memoizedProps,m=p.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ry(t.type,g),m);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(vc(163))}}catch(w){uA(t,t.return,w)}if(e=t.sibling,null!==e){e.return=t.return,Nb=e;break}Nb=t.return}return p=Db,Db=!1,p}function Bb(e,t,n){var r=t.updateQueue;if(r=null!==r?r.lastEffect:null,null!==r){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&Rb(t,n,o)}i=i.next}while(i!==r)}}function Ub(e,t){if(t=t.updateQueue,t=null!==t?t.lastEffect:null,null!==t){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zb(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}"function"===typeof t?t(e):t.current=e}}function Fb(e){var t=e.alternate;null!==t&&(e.alternate=null,Fb(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(t=e.stateNode,null!==t&&(delete t[qg],delete t[Qg],delete t[Yg],delete t[Kg],delete t[Jg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Hb(e){return 5===e.tag||3===e.tag||4===e.tag}function Wb(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Hb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Vb(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,null!==n&&void 0!==n||null!==t.onclick||(t.onclick=jg));else if(4!==r&&(e=e.child,null!==e))for(Vb(e,t,n),e=e.sibling;null!==e;)Vb(e,t,n),e=e.sibling}function qb(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(e=e.child,null!==e))for(qb(e,t,n),e=e.sibling;null!==e;)qb(e,t,n),e=e.sibling}var Qb=null,Gb=!1;function Yb(e,t,n){for(n=n.child;null!==n;)Kb(e,t,n),n=n.sibling}function Kb(e,t,n){if(_h&&"function"===typeof _h.onCommitFiberUnmount)try{_h.onCommitFiberUnmount(Ah,n)}catch(s){}switch(n.tag){case 5:Ib||Lb(n,t);case 6:var r=Qb,i=Gb;Qb=null,Yb(e,t,n),Qb=r,Gb=i,null!==Qb&&(Gb?(e=Qb,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Qb.removeChild(n.stateNode));break;case 18:null!==Qb&&(Gb?(e=Qb,n=n.stateNode,8===e.nodeType?Fg(e.parentNode,n):1===e.nodeType&&Fg(e,n),df(e)):Fg(Qb,n.stateNode));break;case 4:r=Qb,i=Gb,Qb=n.stateNode.containerInfo,Gb=!0,Yb(e,t,n),Qb=r,Gb=i;break;case 0:case 11:case 14:case 15:if(!Ib&&(r=n.updateQueue,null!==r&&(r=r.lastEffect,null!==r))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(0!==(2&o)||0!==(4&o))&&Rb(n,t,a),i=i.next}while(i!==r)}Yb(e,t,n);break;case 1:if(!Ib&&(Lb(n,t),r=n.stateNode,"function"===typeof r.componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){uA(n,t,s)}Yb(e,t,n);break;case 21:Yb(e,t,n);break;case 22:1&n.mode?(Ib=(r=Ib)||null!==n.memoizedState,Yb(e,t,n),Ib=r):Yb(e,t,n);break;default:Yb(e,t,n)}}function Jb(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new jb),t.forEach(function(t){var r=fA.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Zb(e,t){var n=t.deletions;if(null!==n)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=ph()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sw(r/1960))-r,10e?16:e,null===$w)var r=!1;else{if(e=$w,$w=null,Iw=0,0!==(6&dw))throw Error(vc(331));var i=dw;for(dw|=4,Nb=e.current;null!==Nb;){var o=Nb,a=o.child;if(0!==(16&Nb.flags)){var s=o.deletions;if(null!==s){for(var l=0;lph()-Sw?Kw(e,0):Aw|=n),Uw(e,t)}function dA(e,t){0===t&&(0===(1&e.mode)?t=1:(t=Ph,Ph<<=1,0===(130023424&Ph)&&(Ph=4194304)));var n=Dw();e=gv(e,t),null!==e&&(Dh(e,t,n),Uw(e,n))}function hA(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),dA(e,n)}function fA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(vc(314))}null!==r&&r.delete(t),dA(e,n)}function pA(e,t){return ch(e,t)}function gA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mA(e,t,n,r){return new gA(e,t,n,r)}function vA(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yA(e){if("function"===typeof e)return vA(e)?1:0;if(void 0!==e&&null!==e){if(e=e.$$typeof,e===Hc)return 11;if(e===qc)return 14}return 2}function bA(e,t){var n=e.alternate;return null===n?(n=mA(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wA(e,t,n,r,i,o){var a=2;if(r=e,"function"===typeof e)vA(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case Mc:return AA(n.children,i,o,t);case Bc:a=8,i|=8;break;case Uc:return e=mA(12,n,t,2|i),e.elementType=Uc,e.lanes=o,e;case Wc:return e=mA(13,n,t,i),e.elementType=Wc,e.lanes=o,e;case Vc:return e=mA(19,n,t,i),e.elementType=Vc,e.lanes=o,e;case Gc:return _A(n,i,o,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case zc:a=10;break e;case Fc:a=9;break e;case Hc:a=11;break e;case qc:a=14;break e;case Qc:a=16,r=null;break e}throw Error(vc(130,null==e?e:typeof e,""))}return t=mA(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function AA(e,t,n,r){return e=mA(7,e,r,t),e.lanes=n,e}function _A(e,t,n,r){return e=mA(22,e,r,t),e.elementType=Gc,e.lanes=n,e.stateNode={isHidden:!1},e}function kA(e,t,n){return e=mA(6,e,null,t),e.lanes=n,e}function SA(e,t,n){return t=mA(4,null!==e.children?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function EA(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rh(0),this.expirationTimes=Rh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function xA(e,t,n,r,i,o,a,s,l){return e=new EA(e,t,n,s,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=mA(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vv(o),e}function TA(e,t,n){var r=3e.toLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(""),KA=e=>e.replace(/([A-Z])/g,e=>`-${e[0].toLowerCase()}`),JA=e=>{const t=new Map;return e.forEach(e=>t.set(e,e)),t},ZA=(e,t,n)=>{const r=t.className||t.class,i=n.className||n.class,o=JA(e),a=JA(r?r.split(" "):[]),s=JA(i?i.split(" "):[]),l=[];return o.forEach(e=>{a.has(e)?(l.push(e),a.delete(e)):s.has(e)||l.push(e)}),a.forEach(e=>l.push(e)),l.join(" ")},XA=e=>!1;function e_(e){return e.tagName.replace(/^TARO-/,"").replace(/-CORE$/,"")}function t_(e){const t=e_(e);return["INPUT","TEXTAREA","SLIDER","PICKER"].includes(t)?"value":"SWITCH"===t?"checked":null}function n_(e){const t=Object.keys(e).find(e=>e.includes("__reactProps"));return t?e[t]:null}function r_(e){const t=t_(e);if(!t)return;GA.flushSync(()=>{});const n=n_(e);(null===n||void 0===n?void 0:n.hasOwnProperty(t))&&n[t]!==e[t]&&(e[t]=n[t],e.setAttribute(t,n[t]))}const i_=(e,t,n)=>{const r=e.__events||(e.__events={}),i=r[t];if(n){if(i){if(i.fn===n)return;e.removeEventListener(t,i)}const o=r[t]=function(t){GA.unstable_batchedUpdates(()=>n.call(this,t)),r_(e)};o.fn=n,e.addEventListener(t,o)}else i&&e.removeEventListener(t,i)},o_=(e,t,n={})=>{if(e instanceof Element){Object.keys(n).forEach(n=>{if(!["style","children","ref","class","className","forwardedRef"].includes(n)&&!t.hasOwnProperty(n))if(/^on([A-Z].*)/.test(n)){const t=n.substring(2),r=t.toLowerCase();i_(e,r)}else e[n]=null,e.removeAttribute(KA(n))}),e.className=ZA(e.classList,t,n),Object.keys(t).forEach(n=>{if(!("style"===n&&"string"!==typeof t[n]||["children","ref","class","className","forwardedRef"].includes(n)))if(/^on([A-Z].*)/.test(n)){const r=n.substring(2),i=r.toLowerCase();i_(e,i,t[n])}else{e[n]=t[n];const r=typeof t[n];"string"===r&&e.setAttribute(KA(n),t[n])}});const r=t_(e);if(r&&t.hasOwnProperty(r)){const t=["INPUT","TEXTAREA"].includes(e_(e))?"input":"change";e.__events||(e.__events={}),e.__events.hasOwnProperty(t)||i_(e,t,function(){})}}};function a_(e,t){const n=t_(e);if(!n)return;const r="default"+n.charAt(0).toUpperCase()+n.slice(1);!t.hasOwnProperty(n)&&t.hasOwnProperty(r)&&(e[n]=t[r],e.setAttribute(n,t[r]))}const s_=(e,t)=>{"function"===typeof e?e(t):null!=e&&(e.current=t)},l_=(...e)=>t=>{e.forEach(e=>{s_(e,t)})},u_=(e,t)=>{const n=(t,n)=>Zu.createElement(e,Object.assign({},t,{forwardedRef:n}));return n.displayName=t,Zu.forwardRef(n)},c_=(e,t,n,r)=>{void 0!==r&&r();const i=YA(e),o=class extends Zu.Component{constructor(e){super(e),this.setComponentElRef=e=>{this.componentEl=e}}componentDidMount(){a_(this.componentEl,this.props),this.componentDidUpdate(this.props)}componentDidUpdate(e){o_(this.componentEl,this.props,e)}render(){const t=this.props,{children:r,forwardedRef:i,className:o,ref:a,style:s}=t,l=uc(t,["children","forwardedRef","className","ref","style"]);let u=Object.keys(l).reduce((e,t)=>{const n=l[t];if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase())t.substring(2).toLowerCase(),"undefined"!==typeof document&&XA()&&(e[t]=n);else{const r=typeof n;["string","boolean","number"].includes(r)&&(e[KA(t)]=n)}return e},{});n&&(u=n(this.props,u));const c=Object.assign(Object.assign({},u),{ref:l_(i,this.setComponentElRef)});return Ju.createElement(e,c,r)}static get displayName(){return i}};return t&&(o.contextType=t),u_(o,i)},d_=c_("taro-button-core",void 0,lc,Xr),h_=c_("taro-image-core",void 0,lc,ri),f_=c_("taro-input-core",void 0,lc,ui),p_=c_("taro-picker-core",void 0,lc,Ii),g_=c_("taro-scroll-view-core",void 0,lc,qi),m_=c_("taro-text-core",void 0,lc,Ki),v_=c_("taro-textarea-core",void 0,lc,to),y_=c_("taro-view-core",void 0,lc,oo),b_=c_("taro-web-view-core",void 0,lc,uo);var w_=function(){return w_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]3?(i=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&fr||r>p)&&(o[4]=n,o[5]=r,h.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,c,p){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,p),s=c,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(h.n=-1),f(s,l)):h.n=l:h.v=l);try{if(u=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o["return"])&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(g){o=e,s=1,l=g}finally{u=1}}return{value:t,done:d}}}(n,i,o),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(O_(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,O_(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,O_(d,"constructor",u),O_(u,"constructor",l),l.displayName="GeneratorFunction",O_(u,i,"GeneratorFunction"),O_(d),O_(d,i,"Generator"),O_(d,r,function(){return this}),O_(d,"toString",function(){return"[object Generator]"}),($_=function(){return{w:o,m:h}})()}function I_(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,i)}function j_(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){I_(o,r,i,a,s,"next",e)}function s(e){I_(o,r,i,a,s,"throw",e)}a(void 0)})}}const N_=e=>{let t;return t=e||("undefined"===typeof fetch?(...e)=>d(()=>Promise.resolve().then(()=>tk),void 0).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)};class L_ extends Error{constructor(e,t="FunctionsError",n){super(e),this.name=t,this.context=n}}class R_ extends L_{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class D_ extends L_{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class M_ extends L_{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var B_;(function(e){e["Any"]="any",e["ApNortheast1"]="ap-northeast-1",e["ApNortheast2"]="ap-northeast-2",e["ApSouth1"]="ap-south-1",e["ApSoutheast1"]="ap-southeast-1",e["ApSoutheast2"]="ap-southeast-2",e["CaCentral1"]="ca-central-1",e["EuCentral1"]="eu-central-1",e["EuWest1"]="eu-west-1",e["EuWest2"]="eu-west-2",e["EuWest3"]="eu-west-3",e["SaEast1"]="sa-east-1",e["UsEast1"]="us-east-1",e["UsWest1"]="us-west-1",e["UsWest2"]="us-west-2"})(B_||(B_={}));var U_=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};class z_{constructor(e,{headers:t={},customFetch:n,region:r=B_.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=N_(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var n;return U_(this,void 0,void 0,function*(){try{const{headers:r,method:i,body:o}=t;let a={},{region:s}=t;s||(s=this.region);const l=new URL(`${this.url}/${e}`);let u;s&&"any"!==s&&(a["x-region"]=s,l.searchParams.set("forceFunctionRegion",s)),o&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&("undefined"!==typeof Blob&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",u=o):"string"===typeof o?(a["Content-Type"]="text/plain",u=o):"undefined"!==typeof FormData&&o instanceof FormData?u=o:(a["Content-Type"]="application/json",u=JSON.stringify(o)));const c=yield this.fetch(l.toString(),{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),r),body:u}).catch(e=>{throw new R_(e)}),d=c.headers.get("x-relay-error");if(d&&"true"===d)throw new D_(c);if(!c.ok)throw new M_(c);let h,f=(null!==(n=c.headers.get("Content-Type"))&&void 0!==n?n:"text/plain").split(";")[0].trim();return h="application/json"===f?yield c.json():"application/octet-stream"===f?yield c.blob():"text/event-stream"===f?c:"multipart/form-data"===f?yield c.formData():yield c.text(),{data:h,error:null,response:c}}catch(r){return{data:null,error:r,response:r instanceof M_||r instanceof D_?r.context:void 0}}})}}var F_={},H_={},W_={},V_={},q_={},Q_={},G_=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof global)return global;throw new Error("unable to locate global object")},Y_=G_();const K_=Y_.fetch,J_=Y_.fetch.bind(Y_),Z_=Y_.Headers,X_=Y_.Request,ek=Y_.Response,tk=Object.freeze(Object.defineProperty({__proto__:null,Headers:Z_,Request:X_,Response:ek,default:J_,fetch:K_},Symbol.toStringTag,{value:"Module"})),nk=Ot(tk);var rk={};Object.defineProperty(rk,"__esModule",{value:!0});let ik=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};rk.default=ik;var ok=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q_,"__esModule",{value:!0});const ak=ok(nk),sk=ok(rk);let lk=class{constructor(e){var t,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!==(t=e.shouldThrowOnError)&&void 0!==t&&t,this.signal=e.signal,this.isMaybeSingle=null!==(n=e.isMaybeSingle)&&void 0!==n&&n,e.fetch?this.fetch=e.fetch:"undefined"===typeof fetch?this.fetch=ak.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json");const n=this.fetch;let r=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(e=>a(this,null,function*(){var t,n,r,i;let o=null,a=null,s=null,l=e.status,u=e.statusText;if(e.ok){if("HEAD"!==this.method){const n=yield e.text();""===n||(a="text/csv"===this.headers.get("Accept")||this.headers.get("Accept")&&(null===(t=this.headers.get("Accept"))||void 0===t?void 0:t.includes("application/vnd.pgrst.plan+text"))?n:JSON.parse(n))}const i=null===(n=this.headers.get("Prefer"))||void 0===n?void 0:n.match(/count=(exact|planned|estimated)/),c=null===(r=e.headers.get("content-range"))||void 0===r?void 0:r.split("/");i&&c&&c.length>1&&(s=parseInt(c[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(a)&&(a.length>1?(o={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,s=null,l=406,u="Not Acceptable"):a=1===a.length?a[0]:null)}else{const t=yield e.text();try{o=JSON.parse(t),Array.isArray(o)&&404===e.status&&(a=[],o=null,l=200,u="OK")}catch(d){404===e.status&&""===t?(l=204,u="No Content"):o={message:t}}if(o&&this.isMaybeSingle&&(null===(i=null===o||void 0===o?void 0:o.details)||void 0===i?void 0:i.includes("0 rows"))&&(o=null,l=200,u="OK"),o&&this.shouldThrowOnError)throw new sk.default(o)}const c={error:o,data:a,count:s,status:l,statusText:u};return c}));return this.shouldThrowOnError||(r=r.catch(e=>{var t,n,r;return{error:{message:`${null!==(t=null===e||void 0===e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null===e||void 0===e?void 0:e.message}`,details:`${null!==(n=null===e||void 0===e?void 0:e.stack)&&void 0!==n?n:""}`,hint:"",code:`${null!==(r=null===e||void 0===e?void 0:e.code)&&void 0!==r?r:""}`},data:null,count:null,status:0,statusText:""}})),r.then(e,t)}returns(){return this}overrideTypes(){return this}};Q_.default=lk;var uk=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q_,"__esModule",{value:!0});const ck=uk(Q_);let dk=class extends ck.default{select(e){let t=!1;const n=(null!==e&&void 0!==e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const o=i?`${i}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${void 0===n?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r="undefined"===typeof n?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const i="undefined"===typeof r?"offset":`${r}.offset`,o="undefined"===typeof r?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(o,""+(t-e+1)),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return"GET"===this.method?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:o="text"}={}){var a;const s=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=null!==(a=this.headers.get("Accept"))&&void 0!==a?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${l}"; options=${s};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};q_.default=dk;var hk=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V_,"__esModule",{value:!0});const fk=hk(q_);let pk=class extends fk.default{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(e=>"string"===typeof e&&new RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,t){return"string"===typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"===typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"===typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let i="";"plain"===r?i="pl":"phrase"===r?i="ph":"websearch"===r&&(i="w");const o=void 0===n?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}};V_.default=pk;var gk=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(W_,"__esModule",{value:!0});const mk=gk(V_);let vk=class{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r}select(e,{head:t=!1,count:n}={}){const r=t?"HEAD":"GET";let i=!1;const o=(null!==e&&void 0!==e?e:"*").split("").map(e=>/\s/.test(e)&&!i?"":('"'===e&&(i=!i),e)).join("");return this.url.searchParams.set("select",o),n&&this.headers.append("Prefer",`count=${n}`),new mk.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const i="POST";if(t&&this.headers.append("Prefer",`count=${t}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new mk.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:null!==(r=this.fetch)&&void 0!==r?r:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var o;const a="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),void 0!==t&&this.url.searchParams.set("on_conflict",t),r&&this.headers.append("Prefer",`count=${r}`),i||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new mk.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:null!==(o=this.fetch)&&void 0!==o?o:fetch})}update(e,{count:t}={}){var n;const r="PATCH";return t&&this.headers.append("Prefer",`count=${t}`),new mk.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:null!==(n=this.fetch)&&void 0!==n?n:fetch})}delete({count:e}={}){var t;const n="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new mk.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:null!==(t=this.fetch)&&void 0!==t?t:fetch})}};W_.default=vk;var yk=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(H_,"__esModule",{value:!0});const bk=yk(W_),wk=yk(V_);let Ak=class e{constructor(e,{headers:t={},schema:n,fetch:r}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.fetch=r}from(e){const t=new URL(`${this.url}/${e}`);return new bk.default(t,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){var o;let a;const s=new URL(`${this.url}/rpc/${e}`);let l;n||r?(a=n?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{s.searchParams.append(e,t)})):(a="POST",l=t);const u=new Headers(this.headers);return i&&u.set("Prefer",`count=${i}`),new wk.default({method:a,url:s,headers:u,schema:this.schemaName,body:l,fetch:null!==(o=this.fetch)&&void 0!==o?o:fetch})}};H_.default=Ak;var _k=Ct&&Ct.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(F_,"__esModule",{value:!0}),F_.PostgrestError=F_.PostgrestBuilder=F_.PostgrestTransformBuilder=F_.PostgrestFilterBuilder=F_.PostgrestQueryBuilder=F_.PostgrestClient=void 0;const kk=_k(H_);F_.PostgrestClient=kk.default;const Sk=_k(W_);F_.PostgrestQueryBuilder=Sk.default;const Ek=_k(V_);F_.PostgrestFilterBuilder=Ek.default;const xk=_k(q_);F_.PostgrestTransformBuilder=xk.default;const Tk=_k(Q_);F_.PostgrestBuilder=Tk.default;const Ck=_k(rk);F_.PostgrestError=Ck.default;var Pk=F_.default={PostgrestClient:kk.default,PostgrestQueryBuilder:Sk.default,PostgrestFilterBuilder:Ek.default,PostgrestTransformBuilder:xk.default,PostgrestBuilder:Tk.default,PostgrestError:Ck.default};const{PostgrestClient:Ok,PostgrestQueryBuilder:$k,PostgrestFilterBuilder:Ik,PostgrestTransformBuilder:jk,PostgrestBuilder:Nk,PostgrestError:Lk}=Pk;class Rk{static detectEnvironment(){var e;if("undefined"!==typeof WebSocket)return{type:"native",constructor:WebSocket};if("undefined"!==typeof globalThis&&"undefined"!==typeof globalThis.WebSocket)return{type:"native",constructor:globalThis.WebSocket};if("undefined"!==typeof global&&"undefined"!==typeof global.WebSocket)return{type:"native",constructor:global.WebSocket};if("undefined"!==typeof globalThis&&"undefined"!==typeof globalThis.WebSocketPair&&"undefined"===typeof globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("undefined"!==typeof globalThis&&globalThis.EdgeRuntime||"undefined"!==typeof navigator&&(null===(e=navigator.userAgent)||void 0===e?void 0:e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if("undefined"!==typeof process){const e=process["versions"];if(e&&e["node"]){const t=e["node"],n=parseInt(t.replace(/^v/,"").split(".")[0]);return n>=22?"undefined"!==typeof globalThis.WebSocket?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),new Error(t)}static createWebSocket(e,t){const n=this.getWebSocketConstructor();return new n(e,t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}}const Dk="2.15.5",Mk=`realtime-js/${Dk}`,Bk="1.0.0",Uk=1e4,zk=1e3,Fk=100;var Hk,Wk,Vk,qk,Qk,Gk;(function(e){e[e["connecting"]=0]="connecting",e[e["open"]=1]="open",e[e["closing"]=2]="closing",e[e["closed"]=3]="closed"})(Hk||(Hk={})),function(e){e["closed"]="closed",e["errored"]="errored",e["joined"]="joined",e["joining"]="joining",e["leaving"]="leaving"}(Wk||(Wk={})),function(e){e["close"]="phx_close",e["error"]="phx_error",e["join"]="phx_join",e["reply"]="phx_reply",e["leave"]="phx_leave",e["access_token"]="access_token"}(Vk||(Vk={})),function(e){e["websocket"]="websocket"}(qk||(qk={})),function(e){e["Connecting"]="connecting",e["Open"]="open",e["Closing"]="closing",e["Closed"]="closed"}(Qk||(Qk={}));class Yk{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t("string"===typeof e?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,t,n)}_decodeBroadcast(e,t,n){const r=t.getUint8(1),i=t.getUint8(2);let o=this.HEADER_LENGTH+2;const a=n.decode(e.slice(o,o+r));o+=r;const s=n.decode(e.slice(o,o+i));o+=i;const l=JSON.parse(n.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:s,payload:l}}}class Kk{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}(function(e){e["abstime"]="abstime",e["bool"]="bool",e["date"]="date",e["daterange"]="daterange",e["float4"]="float4",e["float8"]="float8",e["int2"]="int2",e["int4"]="int4",e["int4range"]="int4range",e["int8"]="int8",e["int8range"]="int8range",e["json"]="json",e["jsonb"]="jsonb",e["money"]="money",e["numeric"]="numeric",e["oid"]="oid",e["reltime"]="reltime",e["text"]="text",e["time"]="time",e["timestamp"]="timestamp",e["timestamptz"]="timestamptz",e["timetz"]="timetz",e["tsrange"]="tsrange",e["tstzrange"]="tstzrange"})(Gk||(Gk={}));const Jk=(e,t,n={})=>{var r;const i=null!==(r=n.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce((n,r)=>(n[r]=Zk(r,e,t,i),n),{})},Zk=(e,t,n,r)=>{const i=t.find(t=>t.name===e),o=null===i||void 0===i?void 0:i.type,a=n[e];return o&&!r.includes(o)?Xk(o,a):eS(a)},Xk=(e,t)=>{if("_"===e.charAt(0)){const n=e.slice(1,e.length);return iS(t,n)}switch(e){case Gk.bool:return tS(t);case Gk.float4:case Gk.float8:case Gk.int2:case Gk.int4:case Gk.int8:case Gk.numeric:case Gk.oid:return nS(t);case Gk.json:case Gk.jsonb:return rS(t);case Gk.timestamp:return oS(t);case Gk.abstime:case Gk.date:case Gk.daterange:case Gk.int4range:case Gk.int8range:case Gk.money:case Gk.reltime:case Gk.text:case Gk.time:case Gk.timestamptz:case Gk.timetz:case Gk.tsrange:case Gk.tstzrange:return eS(t);default:return eS(t)}},eS=e=>e,tS=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},nS=e=>{if("string"===typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},rS=e=>{if("string"===typeof e)try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},iS=(e,t)=>{if("string"!==typeof e)return e;const n=e.length-1,r=e[n],i=e[0];if("{"===i&&"}"===r){let r;const i=e.slice(1,n);try{r=JSON.parse("["+i+"]")}catch(o){r=i?i.split(","):[]}return r.map(e=>Xk(t,e))}return e},oS=e=>"string"===typeof e?e.replace(" ","T"):e,aS=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")+"/api/broadcast"};class sS{constructor(e,t,n={},r=Uk){this.channel=e,this.event=t,this.payload=n,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var n;return this._hasReceived(e)&&t(null===(n=this.receivedResp)||void 0===n?void 0:n.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var lS,uS,cS,dS;(function(e){e["SYNC"]="sync",e["JOIN"]="join",e["LEAVE"]="leave"})(lS||(lS={}));class hS{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(null===t||void 0===t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},e=>{const{onJoin:t,onLeave:n,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=hS.syncState(this.state,e,t,n),this.pendingDiffs.forEach(e=>{this.state=hS.syncDiff(this.state,e,t,n)}),this.pendingDiffs=[],r()}),this.channel._on(n.diff,{},e=>{const{onJoin:t,onLeave:n,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=hS.syncDiff(this.state,e,t,n),r())}),this.onJoin((e,t,n)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:n})}),this.onLeave((e,t,n)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:n})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,n,r){const i=this.cloneDeep(e),o=this.transformState(t),a={},s={};return this.map(i,(e,t)=>{o[e]||(s[e]=t)}),this.map(o,(e,t)=>{const n=i[e];if(n){const r=t.map(e=>e.presence_ref),i=n.map(e=>e.presence_ref),o=t.filter(e=>i.indexOf(e.presence_ref)<0),l=n.filter(e=>r.indexOf(e.presence_ref)<0);o.length>0&&(a[e]=o),l.length>0&&(s[e]=l)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:s},n,r)}static syncDiff(e,t,n,r){const{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return n||(n=()=>{}),r||(r=()=>{}),this.map(i,(t,r)=>{var i;const o=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(r),o.length>0){const n=e[t].map(e=>e.presence_ref),r=o.filter(e=>n.indexOf(e.presence_ref)<0);e[t].unshift(...r)}n(t,o,r)}),this.map(o,(t,n)=>{let i=e[t];if(!i)return;const o=n.map(e=>e.presence_ref);i=i.filter(e=>o.indexOf(e.presence_ref)<0),e[t]=i,r(t,i,n),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return t[n]="metas"in r?r.metas.map(e=>(e["presence_ref"]=e["phx_ref"],delete e["phx_ref"],delete e["phx_ref_prev"],e)):r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}(function(e){e["ALL"]="*",e["INSERT"]="INSERT",e["UPDATE"]="UPDATE",e["DELETE"]="DELETE"})(uS||(uS={})),function(e){e["BROADCAST"]="broadcast",e["PRESENCE"]="presence",e["POSTGRES_CHANGES"]="postgres_changes",e["SYSTEM"]="system"}(cS||(cS={})),function(e){e["SUBSCRIBED"]="SUBSCRIBED",e["TIMED_OUT"]="TIMED_OUT",e["CLOSED"]="CLOSED",e["CHANNEL_ERROR"]="CHANNEL_ERROR"}(dS||(dS={}));class fS{constructor(e,t={config:{}},n){this.topic=e,this.params=t,this.socket=n,this.bindings={},this.state=Wk.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new sS(this,Vk.join,this.params,this.timeout),this.rejoinTimer=new Kk(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Wk.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Wk.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=Wk.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Wk.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=Wk.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Vk.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new hS(this),this.broadcastEndpointURL=aS(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var n,r,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Wk.closed){const{config:{broadcast:o,presence:s,private:l}}=this.params,u=null!==(r=null===(n=this.bindings.postgres_changes)||void 0===n?void 0:n.map(e=>e.filter))&&void 0!==r?r:[],c=!!this.bindings[cS.PRESENCE]&&this.bindings[cS.PRESENCE].length>0||!0===(null===(i=this.params.config.presence)||void 0===i?void 0:i.enabled),d={},h={broadcast:o,presence:Object.assign(Object.assign({},s),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(t=>null===e||void 0===e?void 0:e(dS.CHANNEL_ERROR,t)),this._onClose(()=>null===e||void 0===e?void 0:e(dS.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",t=>a(this,[t],function*({postgres_changes:t}){var n;if(this.socket.setAuth(),void 0!==t){const r=this.bindings.postgres_changes,i=null!==(n=null===r||void 0===r?void 0:r.length)&&void 0!==n?n:0,o=[];for(let n=0;n{this.state=Wk.errored,null===e||void 0===e||e(dS.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{null===e||void 0===e||e(dS.TIMED_OUT)})}return this}presenceState(){return this.presence.state}track(e){return a(this,arguments,function*(e,t={}){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(){return a(this,arguments,function*(e={}){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,n){return this.state===Wk.joined&&e===cS.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,t,n)}send(e){return a(this,arguments,function*(e,t={}){var n,r;if(this._canPush()||"broadcast"!==e.type)return new Promise(n=>{var r,i,o;const a=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(o=null===(i=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===i?void 0:i.broadcast)||void 0===o?void 0:o.ack)||n("ok"),a.receive("ok",()=>n("ok")),a.receive("error",()=>n("error")),a.receive("timeout",()=>n("timed out"))});{const{event:o,payload:a}=e,s=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",l={method:"POST",headers:{Authorization:s,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const e=yield this._fetchWithTimeout(this.broadcastEndpointURL,l,null!==(n=t.timeout)&&void 0!==n?n:this.timeout);return yield null===(r=e.body)||void 0===r?void 0:r.cancel(),e.ok?"ok":"error"}catch(i){return"AbortError"===i.name?"timed out":"error"}}})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Wk.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Vk.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(r=>{n=new sS(this,Vk.leave,{},e),n.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{null===n||void 0===n||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Wk.closed,this.bindings={}}_fetchWithTimeout(e,t,n){return a(this,null,function*(){const r=new AbortController,i=setTimeout(()=>r.abort(),n),o=yield this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),o})}_push(e,t,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new sS(this,e,t,n);return this._canPush()?r.send():this._addToPushBuffer(r),r}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>Fk){const e=this.pushBuffer.shift();e&&(e.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload))}}_onMessage(e,t,n){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,n){var r,i;const o=e.toLocaleLowerCase(),{close:a,error:s,leave:l,join:u}=Vk,c=[a,s,l,u];if(n&&c.indexOf(o)>=0&&n!==this._joinRef())return;let d=this._onMessage(o,t,n);if(t&&!d)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter(e=>{var t,n,r;return"*"===(null===(t=e.filter)||void 0===t?void 0:t.event)||(null===(r=null===(n=e.filter)||void 0===n?void 0:n.event)||void 0===r?void 0:r.toLocaleLowerCase())===o}).map(e=>e.callback(d,n)):null===(i=this.bindings[o])||void 0===i||i.filter(e=>{var n,r,i,a,s,l;if(["broadcast","presence","postgres_changes"].includes(o)){if("id"in e){const o=e.id,a=null===(n=e.filter)||void 0===n?void 0:n.event;return o&&(null===(r=t.ids)||void 0===r?void 0:r.includes(o))&&("*"===a||(null===a||void 0===a?void 0:a.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{const n=null===(s=null===(a=null===e||void 0===e?void 0:e.filter)||void 0===a?void 0:a.event)||void 0===s?void 0:s.toLocaleLowerCase();return"*"===n||n===(null===(l=null===t||void 0===t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}return e.type.toLocaleLowerCase()===o}).map(e=>{if("object"===typeof d&&"ids"in d){const e=d.data,{schema:t,table:n,commit_timestamp:r,type:i,errors:o}=e,a={schema:t,table:n,commit_timestamp:r,eventType:i,new:{},old:{},errors:o};d=Object.assign(Object.assign({},a),this._getPayloadRecords(e))}e.callback(d,n)})}_isClosed(){return this.state===Wk.closed}_isJoined(){return this.state===Wk.joined}_isJoining(){return this.state===Wk.joining}_isLeaving(){return this.state===Wk.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,n){const r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this}_off(e,t){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===n&&fS.isEqual(e.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Vk.close,{},e)}_onError(e){this._on(Vk.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Wk.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=Jk(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=Jk(e.columns,e.old_record)),t}}const pS=()=>{},gS={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},mS=[1e3,2e3,5e3,1e4],vS=1e4,yS='\n addEventListener("message", (e) => {\n if (e.data.event === "start") {\n setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);\n }\n });';class bS{constructor(e,t){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Uk,this.transport=null,this.heartbeatIntervalMs=gS.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=pS,this.ref=0,this.reconnectTimer=null,this.logger=pS,this.conn=null,this.sendBuffer=[],this.serializer=new Yk,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=e=>{let t;return t=e||("undefined"===typeof fetch?(...e)=>d(()=>Promise.resolve().then(()=>tk),void 0).then(({default:t})=>t(...e)).catch(e=>{throw new Error(`Failed to load @supabase/node-fetch: ${e.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):fetch),(...e)=>t(...e)},!(null===(n=null===t||void 0===t?void 0:t.params)||void 0===n?void 0:n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${qk.websocket}`,this.httpEndpoint=aS(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(null===t||void 0===t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||null!==this.conn&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Rk.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const t=e.message;if(t.includes("Node.js"))throw new Error(`${t}\n\nTo use Realtime in Node.js, you need to provide a WebSocket implementation:\n\nOption 1: Use Node.js 22+ which has native WebSocket support\nOption 2: Install and provide the "ws" package:\n\n npm install ws\n\n import ws from "ws"\n const client = new RealtimeClient(url, {\n ...options,\n transport: ws\n })`);throw new Error(`WebSocket not available: ${t}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Bk}))}disconnect(e,t){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},e?this.conn.close(e,null!==t&&void 0!==t?t:""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}removeChannel(e){return a(this,null,function*(){const t=yield e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t})}removeAllChannels(){return a(this,null,function*(){const e=yield Promise.all(this.channels.map(e=>e.unsubscribe()));return this.channels=[],this.disconnect(),e})}log(e,t,n){this.logger(e,t,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Hk.connecting:return Qk.Connecting;case Hk.open:return Qk.Open;case Hk.closing:return Qk.Closing;default:return Qk.Closed}}isConnected(){return this.connectionState()===Qk.Open}isConnecting(){return"connecting"===this._connectionState}isDisconnecting(){return"disconnecting"===this._connectionState}channel(e,t={config:{}}){const n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{const n=new fS(`realtime:${e}`,t,this);return this.channels.push(n),n}}push(e){const{topic:t,event:n,payload:r,ref:i}=e,o=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};this.log("push",`${t} ${n} (${i})`,r),this.isConnected()?o():this.sendBuffer.push(o)}setAuth(e=null){return a(this,null,function*(){this._authPromise=this._performAuth(e);try{yield this._authPromise}finally{this._authPromise=null}})}sendHeartbeat(){return a(this,null,function*(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(wT){this.log("error","error in heartbeat callback",wT)}return this._wasManualDisconnect=!1,null===(e=this.conn)||void 0===e||e.close(zk,"heartbeat timeout"),void setTimeout(()=>{var e;this.isConnected()||null===(e=this.reconnectTimer)||void 0===e||e.scheduleTimeout()},gS.HEARTBEAT_TIMEOUT_FALLBACK)}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(wT){this.log("error","error in heartbeat callback",wT)}this._setAuthSafely("heartbeat")}else try{this.heartbeatCallback("disconnected")}catch(wT){this.log("error","error in heartbeat callback",wT)}})}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,e=>{if("phoenix"===e.topic&&"phx_reply"===e.event)try{this.heartbeatCallback("ok"===e.payload.status?"ok":"error")}catch(wT){this.log("error","error in heartbeat callback",wT)}e.ref&&e.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:t,event:n,payload:r,ref:i}=e,o=i?`(${i})`:"",a=r.status||"";this.log("receive",`${a} ${t} ${n} ${o}`.trim(),r),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(n,r,i)),this._triggerStateCallbacks("message",e)})}_clearTimer(e){var t;"heartbeat"===e&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):"reconnect"===e&&(null===(t=this.reconnectTimer)||void 0===t||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this.workerRef.terminate()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||null===(t=this.reconnectTimer)||void 0===t||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Vk.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;const n=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${n}${r}`}_workerObjectUrl(e){let t;if(e)t=e;else{const e=new Blob([yS],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_setConnectionState(e,t=!1){this._connectionState=e,"connecting"===e?this._wasManualDisconnect=!1:"disconnecting"===e&&(this._wasManualDisconnect=t)}_performAuth(e=null){return a(this,null,function*(){let t;t=e||(this.accessToken?yield this.accessToken():this.accessTokenValue),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{const n={access_token:t,version:Mk};t&&e.updateJoinPayload(n),e.joinedOnce&&e._isJoined()&&e._push(Vk.access_token,{access_token:t})}))})}_waitForAuthIfNeeded(){return a(this,null,function*(){this._authPromise&&(yield this._authPromise)})}_setAuthSafely(e="general"){this.setAuth().catch(t=>{this.log("error",`error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(t)}catch(wT){this.log("error",`error in ${e} callback`,wT)}})}catch(wT){this.log("error",`error triggering ${e} callbacks`,wT)}}_setupReconnectionTimer(){this.reconnectTimer=new Kk(()=>a(this,null,function*(){setTimeout(()=>a(this,null,function*(){yield this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}),gS.RECONNECT_DELAY)}),this.reconnectAfterMs)}_initializeOptions(e){var t,n,r,i,o,a,s,l,u;if(this.transport=null!==(t=null===e||void 0===e?void 0:e.transport)&&void 0!==t?t:null,this.timeout=null!==(n=null===e||void 0===e?void 0:e.timeout)&&void 0!==n?n:Uk,this.heartbeatIntervalMs=null!==(r=null===e||void 0===e?void 0:e.heartbeatIntervalMs)&&void 0!==r?r:gS.HEARTBEAT_INTERVAL,this.worker=null!==(i=null===e||void 0===e?void 0:e.worker)&&void 0!==i&&i,this.accessToken=null!==(o=null===e||void 0===e?void 0:e.accessToken)&&void 0!==o?o:null,this.heartbeatCallback=null!==(a=null===e||void 0===e?void 0:e.heartbeatCallback)&&void 0!==a?a:pS,(null===e||void 0===e?void 0:e.params)&&(this.params=e.params),(null===e||void 0===e?void 0:e.logger)&&(this.logger=e.logger),((null===e||void 0===e?void 0:e.logLevel)||(null===e||void 0===e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=null!==(s=null===e||void 0===e?void 0:e.reconnectAfterMs)&&void 0!==s?s:e=>mS[e-1]||vS,this.encode=null!==(l=null===e||void 0===e?void 0:e.encode)&&void 0!==l?l:(e,t)=>t(JSON.stringify(e)),this.decode=null!==(u=null===e||void 0===e?void 0:e.decode)&&void 0!==u?u:this.serializer.decode.bind(this.serializer),this.worker){if("undefined"!==typeof window&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=null===e||void 0===e?void 0:e.workerUrl}}}class wS extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function AS(e){return"object"===typeof e&&null!==e&&"__isStorageError"in e}class _S extends wS{constructor(e,t,n){super(e),this.name="StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class kS extends wS{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var SS=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};const ES=e=>{let t;return t=e||("undefined"===typeof fetch?(...e)=>d(()=>Promise.resolve().then(()=>tk),void 0).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},xS=()=>SS(void 0,void 0,void 0,function*(){return"undefined"===typeof Response?(yield d(()=>Promise.resolve().then(()=>tk),void 0)).Response:Response}),TS=e=>{if(Array.isArray(e))return e.map(e=>TS(e));if("function"===typeof e||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([e,n])=>{const r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""));t[r]=TS(n)}),t},CS=e=>{if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var PS=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};const OS=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),$S=(e,t,n)=>PS(void 0,void 0,void 0,function*(){const r=yield xS();e instanceof r&&!(null===n||void 0===n?void 0:n.noResolveJson)?e.json().then(n=>{const r=e.status||500,i=(null===n||void 0===n?void 0:n.statusCode)||r+"";t(new _S(OS(n),r,i))}).catch(e=>{t(new kS(OS(e),e))}):t(new kS(OS(e),e))}),IS=(e,t,n,r)=>{const i={method:e,headers:(null===t||void 0===t?void 0:t.headers)||{}};return"GET"!==e&&r?(CS(r)?(i.headers=Object.assign({"Content-Type":"application/json"},null===t||void 0===t?void 0:t.headers),i.body=JSON.stringify(r)):i.body=r,(null===t||void 0===t?void 0:t.duplex)&&(i.duplex=t.duplex),Object.assign(Object.assign({},i),n)):i};function jS(e,t,n,r,i,o){return PS(this,void 0,void 0,function*(){return new Promise((a,s)=>{e(n,IS(t,r,i,o)).then(e=>{if(!e.ok)throw e;return(null===r||void 0===r?void 0:r.noResolveJson)?e:e.json()}).then(e=>a(e)).catch(e=>$S(e,s,r))})})}function NS(e,t,n,r){return PS(this,void 0,void 0,function*(){return jS(e,"GET",t,n,r)})}function LS(e,t,n,r,i){return PS(this,void 0,void 0,function*(){return jS(e,"POST",t,r,i,n)})}function RS(e,t,n,r,i){return PS(this,void 0,void 0,function*(){return jS(e,"PUT",t,r,i,n)})}function DS(e,t,n,r){return PS(this,void 0,void 0,function*(){return jS(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function MS(e,t,n,r,i){return PS(this,void 0,void 0,function*(){return jS(e,"DELETE",t,r,i,n)})}var BS=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};const US={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},zS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class FS{constructor(e,t={},n,r){this.url=e,this.headers=t,this.bucketId=n,this.fetch=ES(r)}uploadOrUpdate(e,t,n,r){return BS(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},zS),r);let a=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(o.upsert)});const s=o.metadata;"undefined"!==typeof Blob&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),s&&i.append("metadata",this.encodeMetadata(s)),i.append("",n)):"undefined"!==typeof FormData&&n instanceof FormData?(i=n,i.append("cacheControl",o.cacheControl),s&&i.append("metadata",this.encodeMetadata(s))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,s&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(s)))),(null===r||void 0===r?void 0:r.headers)&&(a=Object.assign(Object.assign({},a),r.headers));const l=this._removeEmptyFolders(t),u=this._getFinalPath(l),c=yield("PUT"==e?RS:LS)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:a},(null===o||void 0===o?void 0:o.duplex)?{duplex:o.duplex}:{}));return{data:{path:l,id:c.Id,fullPath:c.Key},error:null}}catch(i){if(AS(i))return{data:null,error:i};throw i}})}upload(e,t,n){return BS(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,n)})}uploadToSignedUrl(e,t,n,r){return BS(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let e;const t=Object.assign({upsert:zS.upsert},r),o=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!==typeof Blob&&n instanceof Blob?(e=new FormData,e.append("cacheControl",t.cacheControl),e.append("",n)):"undefined"!==typeof FormData&&n instanceof FormData?(e=n,e.append("cacheControl",t.cacheControl)):(e=n,o["cache-control"]=`max-age=${t.cacheControl}`,o["content-type"]=t.contentType);const s=yield RS(this.fetch,a.toString(),e,{headers:o});return{data:{path:i,fullPath:s.Key},error:null}}catch(s){if(AS(s))return{data:null,error:s};throw s}})}createSignedUploadUrl(e,t){return BS(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const r=Object.assign({},this.headers);(null===t||void 0===t?void 0:t.upsert)&&(r["x-upsert"]="true");const i=yield LS(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:r}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new wS("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(n){if(AS(n))return{data:null,error:n};throw n}})}update(e,t,n){return BS(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,n)})}move(e,t,n){return BS(this,void 0,void 0,function*(){try{const r=yield LS(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null===n||void 0===n?void 0:n.destinationBucket},{headers:this.headers});return{data:r,error:null}}catch(r){if(AS(r))return{data:null,error:r};throw r}})}copy(e,t,n){return BS(this,void 0,void 0,function*(){try{const r=yield LS(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null===n||void 0===n?void 0:n.destinationBucket},{headers:this.headers});return{data:{path:r.Key},error:null}}catch(r){if(AS(r))return{data:null,error:r};throw r}})}createSignedUrl(e,t,n){return BS(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),i=yield LS(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},(null===n||void 0===n?void 0:n.transform)?{transform:n.transform}:{}),{headers:this.headers});const o=(null===n||void 0===n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"",a=encodeURI(`${this.url}${i.signedURL}${o}`);return i={signedUrl:a},{data:i,error:null}}catch(r){if(AS(r))return{data:null,error:r};throw r}})}createSignedUrls(e,t,n){return BS(this,void 0,void 0,function*(){try{const r=yield LS(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null===n||void 0===n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"";return{data:r.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(r){if(AS(r))return{data:null,error:r};throw r}})}download(e,t){return BS(this,void 0,void 0,function*(){const n="undefined"!==typeof(null===t||void 0===t?void 0:t.transform),r=n?"render/image/authenticated":"object",i=this.transformOptsToQueryString((null===t||void 0===t?void 0:t.transform)||{}),o=i?`?${i}`:"";try{const t=this._getFinalPath(e),n=yield NS(this.fetch,`${this.url}/${r}/${t}${o}`,{headers:this.headers,noResolveJson:!0}),i=yield n.blob();return{data:i,error:null}}catch(a){if(AS(a))return{data:null,error:a};throw a}})}info(e){return BS(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const e=yield NS(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:TS(e),error:null}}catch(n){if(AS(n))return{data:null,error:n};throw n}})}exists(e){return BS(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield DS(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(AS(n)&&n instanceof kS){const e=n.originalError;if([400,404].includes(null===e||void 0===e?void 0:e.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],i=(null===t||void 0===t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&r.push(i);const o="undefined"!==typeof(null===t||void 0===t?void 0:t.transform),a=o?"render/image":"object",s=this.transformOptsToQueryString((null===t||void 0===t?void 0:t.transform)||{});""!==s&&r.push(s);let l=r.join("&");return""!==l&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}remove(e){return BS(this,void 0,void 0,function*(){try{const t=yield MS(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers});return{data:t,error:null}}catch(t){if(AS(t))return{data:null,error:t};throw t}})}list(e,t,n){return BS(this,void 0,void 0,function*(){try{const r=Object.assign(Object.assign(Object.assign({},US),t),{prefix:e||""}),i=yield LS(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},n);return{data:i,error:null}}catch(r){if(AS(r))return{data:null,error:r};throw r}})}listV2(e,t){return BS(this,void 0,void 0,function*(){try{const n=Object.assign({},e),r=yield LS(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},t);return{data:r,error:null}}catch(n){if(AS(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return"undefined"!==typeof Buffer?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const HS="2.11.1",WS={"X-Client-Info":`storage-js/${HS}`};var VS=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};class qS{constructor(e,t={},n,r){const i=new URL(e);if(null===r||void 0===r?void 0:r.useNewHostname){const e=/supabase\.(co|in|red)$/.test(i.hostname);e&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."))}this.url=i.href,this.headers=Object.assign(Object.assign({},WS),t),this.fetch=ES(n)}listBuckets(){return VS(this,void 0,void 0,function*(){try{const e=yield NS(this.fetch,`${this.url}/bucket`,{headers:this.headers});return{data:e,error:null}}catch(e){if(AS(e))return{data:null,error:e};throw e}})}getBucket(e){return VS(this,void 0,void 0,function*(){try{const t=yield NS(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers});return{data:t,error:null}}catch(t){if(AS(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return VS(this,void 0,void 0,function*(){try{const n=yield LS(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers});return{data:n,error:null}}catch(n){if(AS(n))return{data:null,error:n};throw n}})}updateBucket(e,t){return VS(this,void 0,void 0,function*(){try{const n=yield RS(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers});return{data:n,error:null}}catch(n){if(AS(n))return{data:null,error:n};throw n}})}emptyBucket(e){return VS(this,void 0,void 0,function*(){try{const t=yield LS(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers});return{data:t,error:null}}catch(t){if(AS(t))return{data:null,error:t};throw t}})}deleteBucket(e){return VS(this,void 0,void 0,function*(){try{const t=yield MS(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers});return{data:t,error:null}}catch(t){if(AS(t))return{data:null,error:t};throw t}})}}class QS extends qS{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new FS(this.url,this.headers,e,this.fetch)}}const GS="2.57.2";let YS="";YS="undefined"!==typeof Deno?"deno":"undefined"!==typeof document?"web":"undefined"!==typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";const KS={"X-Client-Info":`supabase-js-${YS}/${GS}`},JS={headers:KS},ZS={schema:"public"},XS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},eE={};var tE=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};const nE=e=>{let t;return t=e||("undefined"===typeof fetch?J_:fetch),(...e)=>t(...e)},rE=()=>"undefined"===typeof Headers?Z_:Headers,iE=(e,t,n)=>{const r=nE(n),i=rE();return(n,o)=>tE(void 0,void 0,void 0,function*(){var a;const s=null!==(a=yield t())&&void 0!==a?a:e;let l=new i(null===o||void 0===o?void 0:o.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${s}`),r(n,Object.assign(Object.assign({},o),{headers:l}))})};var oE=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};function aE(e){return e.endsWith("/")?e:e+"/"}function sE(e,t){var n,r;const{db:i,auth:o,realtime:a,global:s}=e,{db:l,auth:u,realtime:c,global:d}=t,h={db:Object.assign(Object.assign({},l),i),auth:Object.assign(Object.assign({},u),o),realtime:Object.assign(Object.assign({},c),a),storage:{},global:Object.assign(Object.assign(Object.assign({},d),s),{headers:Object.assign(Object.assign({},null!==(n=null===d||void 0===d?void 0:d.headers)&&void 0!==n?n:{}),null!==(r=null===s||void 0===s?void 0:s.headers)&&void 0!==r?r:{})}),accessToken:()=>oE(this,void 0,void 0,function*(){return""})};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}const lE="2.71.1",uE=3e4,cE=3,dE=cE*uE,hE="http://localhost:9999",fE="supabase.auth.token",pE={"X-Client-Info":`gotrue-js/${lE}`},gE="X-Supabase-Api-Version",mE={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},vE=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,yE=6e5;class bE extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=n}}function wE(e){return"object"===typeof e&&null!==e&&"__isAuthError"in e}class AE extends bE{constructor(e,t,n){super(e,t,n),this.name="AuthApiError",this.status=t,this.code=n}}function _E(e){return wE(e)&&"AuthApiError"===e.name}class kE extends bE{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class SE extends bE{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}}class EE extends SE{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function xE(e){return wE(e)&&"AuthSessionMissingError"===e.name}class TE extends SE{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class CE extends SE{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class PE extends SE{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function OE(e){return wE(e)&&"AuthImplicitGrantRedirectError"===e.name}class $E extends SE{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class IE extends SE{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function jE(e){return wE(e)&&"AuthRetryableFetchError"===e.name}class NE extends SE{constructor(e,t,n){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=n}}class LE extends SE{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const RE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),DE=" \t\n\r=".split(""),ME=(()=>{const e=new Array(128);for(let t=0;t=6){const e=t.queue>>t.queuedBits-6&63;n(RE[e]),t.queuedBits-=6}}else if(t.queuedBits>0){t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;while(t.queuedBits>=6){const e=t.queue>>t.queuedBits-6&63;n(RE[e]),t.queuedBits-=6}}}function UE(e,t,n){const r=ME[e];if(!(r>-1)){if(-2===r)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}t.queue=t.queue<<6|r,t.queuedBits+=6;while(t.queuedBits>=8)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8}function zE(e){const t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},o=e=>{WE(e,r,n)};for(let a=0;a>6),void t(128|63&e);if(e<=65535)return t(224|e>>12),t(128|e>>6&63),void t(128|63&e);if(e<=1114111)return t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),void t(128|63&e);throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}t(e)}function HE(e,t){for(let n=0;n55295&&r<=56319){const t=1024*(r-55296)&65535,i=e.charCodeAt(n+1)-56320&65535;r=65536+(i|t),n+=1}FE(r,t)}}function WE(e,t,n){if(0===t.utf8seq){if(e<=127)return void n(e);for(let n=1;n<6;n+=1)if(0===(e>>7-n&1)){t.utf8seq=n;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else{if(4!==t.utf8seq)throw new Error("Invalid UTF-8 sequence");t.codepoint=7&e}t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&n(t.codepoint)}}function VE(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let i=0;it.push(e)),new Uint8Array(t)}function QE(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>BE(e,n,r)),BE(null,n,r),t.join("")}function GE(e){const t=Math.round(Date.now()/1e3);return t+e}function YE(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0,n="x"==e?t:3&t|8;return n.toString(16)})}const KE=()=>"undefined"!==typeof window&&"undefined"!==typeof document,JE={tested:!1,writable:!1},ZE=()=>{if(!KE())return!1;try{if("object"!==typeof globalThis.localStorage)return!1}catch(wT){return!1}if(JE.tested)return JE.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),JE.tested=!0,JE.writable=!0}catch(wT){JE.tested=!0,JE.writable=!1}return JE.writable};function XE(e){const t={},n=new URL(e);if(n.hash&&"#"===n.hash[0])try{const e=new URLSearchParams(n.hash.substring(1));e.forEach((e,n)=>{t[n]=e})}catch(wT){}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}const ex=e=>{let t;return t=e||("undefined"===typeof fetch?(...e)=>d(()=>Promise.resolve().then(()=>tk),void 0).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},tx=e=>"object"===typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"===typeof e.json,nx=(e,t,n)=>a(void 0,null,function*(){yield e.setItem(t,JSON.stringify(n))}),rx=(e,t)=>a(void 0,null,function*(){const n=yield e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(r){return n}}),ix=(e,t)=>a(void 0,null,function*(){yield e.removeItem(t)});class ox{constructor(){this.promise=new ox.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function ax(e){const t=e.split(".");if(3!==t.length)throw new LE("Invalid JWT structure");for(let r=0;r{setTimeout(()=>t(null),e)})})}function lx(e,t){const n=new Promise((n,r)=>{(()=>{a(this,null,function*(){for(let i=0;i<1/0;i++)try{const r=yield e(i);if(!t(i,null,r))return void n(r)}catch(wT){if(!t(i,wT))return void r(wT)}})})()});return n}function ux(e){return("0"+e.toString(16)).substr(-2)}function cx(){const e=56,t=new Uint32Array(e);if("undefined"===typeof crypto){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=t.length;let r="";for(let i=0;iString.fromCharCode(e)).join("")})}function hx(e){return a(this,null,function*(){const t="undefined"!==typeof crypto&&"undefined"!==typeof crypto.subtle&&"undefined"!==typeof TextEncoder;if(!t)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=yield dx(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")})}function fx(e,t,n=!1){return a(this,null,function*(){const r=cx();let i=r;n&&(i+="/PASSWORD_RECOVERY"),yield nx(e,`${t}-code-verifier`,i);const o=yield hx(r),a=r===o?"plain":"s256";return[o,a]})}ox.promiseConstructor=Promise;const px=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function gx(e){const t=e.headers.get(gE);if(!t)return null;if(!t.match(px))return null;try{const e=new Date(`${t}T00:00:00.0Z`);return e}catch(wT){return null}}function mx(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function vx(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const yx=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function bx(e){if(!yx.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function wx(){const e={};return new Proxy(e,{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"===typeof t){const e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Ax(e){return JSON.parse(JSON.stringify(e))}var _x=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.msg||e.message||e.error_description||e.error||JSON.stringify(e),Sx=[502,503,504];function Ex(e){return a(this,null,function*(){var t;if(!tx(e))throw new IE(kx(e),0);if(Sx.includes(e.status))throw new IE(kx(e),e.status);let n,r;try{n=yield e.json()}catch(wT){throw new kE(kx(wT),wT)}const i=gx(e);if(i&&i.getTime()>=mE["2024-01-01"].timestamp&&"object"===typeof n&&n&&"string"===typeof n.code?r=n.code:"object"===typeof n&&n&&"string"===typeof n.error_code&&(r=n.error_code),r){if("weak_password"===r)throw new NE(kx(n),e.status,(null===(t=n.weak_password)||void 0===t?void 0:t.reasons)||[]);if("session_not_found"===r)throw new EE}else if("object"===typeof n&&n&&"object"===typeof n.weak_password&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((e,t)=>e&&"string"===typeof t,!0))throw new NE(kx(n),e.status,n.weak_password.reasons);throw new AE(kx(n),e.status||500,r)})}const xx=(e,t,n,r)=>{const i={method:e,headers:(null===t||void 0===t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null===t||void 0===t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};function Tx(e,t,n,r){return a(this,null,function*(){var i;const o=Object.assign({},null===r||void 0===r?void 0:r.headers);o[gE]||(o[gE]=mE["2024-01-01"].name),(null===r||void 0===r?void 0:r.jwt)&&(o["Authorization"]=`Bearer ${r.jwt}`);const a=null!==(i=null===r||void 0===r?void 0:r.query)&&void 0!==i?i:{};(null===r||void 0===r?void 0:r.redirectTo)&&(a["redirect_to"]=r.redirectTo);const s=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=yield Cx(e,t,n+s,{headers:o,noResolveJson:null===r||void 0===r?void 0:r.noResolveJson},{},null===r||void 0===r?void 0:r.body);return(null===r||void 0===r?void 0:r.xform)?null===r||void 0===r?void 0:r.xform(l):{data:Object.assign({},l),error:null}})}function Cx(e,t,n,r,i,o){return a(this,null,function*(){const a=xx(t,r,i,o);let s;try{s=yield e(n,Object.assign({},a))}catch(wT){throw console.error(wT),new IE(kx(wT),0)}if(s.ok||(yield Ex(s)),null===r||void 0===r?void 0:r.noResolveJson)return s;try{return yield s.json()}catch(wT){yield Ex(wT)}})}function Px(e){var t;let n=null;Lx(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=GE(e.expires_in)));const r=null!==(t=e.user)&&void 0!==t?t:e;return{data:{session:n,user:r},error:null}}function Ox(e){const t=Px(e);return!t.error&&e.weak_password&&"object"===typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"===typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"===typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function $x(e){var t;const n=null!==(t=e.user)&&void 0!==t?t:e;return{data:{user:n},error:null}}function Ix(e){return{data:e,error:null}}function jx(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:o}=e,a=_x(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),s={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:o},l=Object.assign({},a);return{data:{properties:s,user:l},error:null}}function Nx(e){return e}function Lx(e){return e.access_token&&e.refresh_token&&e.expires_in}const Rx=["global","local","others"];var Dx=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&(h.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);l[`${n}Page`]=t}),l.total=parseInt(d)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(l){if(wE(l))return{data:{users:[]},error:l};throw l}})}getUserById(e){return a(this,null,function*(){bx(e);try{return yield Tx(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:$x})}catch(t){if(wE(t))return{data:{user:null},error:t};throw t}})}updateUserById(e,t){return a(this,null,function*(){bx(e);try{return yield Tx(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:$x})}catch(n){if(wE(n))return{data:{user:null},error:n};throw n}})}deleteUser(e,t=!1){return a(this,null,function*(){bx(e);try{return yield Tx(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:$x})}catch(n){if(wE(n))return{data:{user:null},error:n};throw n}})}_listFactors(e){return a(this,null,function*(){bx(e.userId);try{const{data:t,error:n}=yield Tx(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(t){if(wE(t))return{data:null,error:t};throw t}})}_deleteFactor(e){return a(this,null,function*(){bx(e.userId),bx(e.id);try{const t=yield Tx(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers});return{data:t,error:null}}catch(t){if(wE(t))return{data:null,error:t};throw t}})}}function Bx(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function Ux(){if("object"!==typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(wT){"undefined"!==typeof self&&(self.globalThis=self)}}const zx={debug:!!(globalThis&&ZE()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"))};class Fx extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Hx extends Fx{}function Wx(e,t,n){return a(this,null,function*(){zx.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),zx.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),yield Promise.resolve().then(()=>globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},r=>a(this,null,function*(){if(!r){if(0===t)throw zx.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Hx(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(zx.debug)try{const e=yield globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(wT){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",wT)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),yield n()}zx.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return yield n()}finally{zx.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}})))})}Ux();const Vx={url:hE,storageKey:fE,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:pE,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};function qx(e,t,n){return a(this,null,function*(){return yield n()})}const Qx={};class Gx{constructor(e){var t,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Gx.nextInstanceID,Gx.nextInstanceID+=1,this.instanceID>0&&KE()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const r=Object.assign(Object.assign({},Vx),e);if(this.logDebugMessages=!!r.debug,"function"===typeof r.debug&&(this.logger=r.debug),this.persistSession=r.persistSession,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.admin=new Mx({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=ex(r.fetch),this.lock=r.lock||qx,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,r.lock?this.lock=r.lock:KE()&&(null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===t?void 0:t.locks)?this.lock=Wx:this.lock=qx,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:ZE()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Bx(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Bx(this.memoryStorage)),KE()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(wT){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",wT)}null===(n=this.broadcastChannel)||void 0===n||n.addEventListener("message",e=>a(this,null,function*(){this._debug("received broadcast notification from other tab or client",e),yield this._notifyAllSubscribers(e.data.event,e.data.session,!1)}))}this.initialize()}get jwks(){var e,t;return null!==(t=null===(e=Qx[this.storageKey])||void 0===e?void 0:e.jwks)&&void 0!==t?t:{keys:[]}}set jwks(e){Qx[this.storageKey]=Object.assign(Object.assign({},Qx[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!==(t=null===(e=Qx[this.storageKey])||void 0===e?void 0:e.cachedAt)&&void 0!==t?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Qx[this.storageKey]=Object.assign(Object.assign({},Qx[this.storageKey]),{cachedAt:e})}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${lE}) ${(new Date).toISOString()}`,...e),this}initialize(){return a(this,null,function*(){return this.initializePromise||(this.initializePromise=(()=>a(this,null,function*(){return yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._initialize()}))}))()),yield this.initializePromise})}_initialize(){return a(this,null,function*(){var e;try{const t=XE(window.location.href);let n="none";if(this._isImplicitGrantCallback(t)?n="implicit":(yield this._isPKCECallback(t))&&(n="pkce"),KE()&&this.detectSessionInUrl&&"none"!==n){const{data:r,error:i}=yield this._getSessionFromURL(t,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),OE(i)){const t=null===(e=i.details)||void 0===e?void 0:e.code;if("identity_already_exists"===t||"identity_not_found"===t||"single_identity_not_deletable"===t)return{error:i}}return yield this._removeSession(),{error:i}}const{session:o,redirectType:s}=r;return this._debug("#_initialize()","detected session in URL",o,"redirect type",s),yield this._saveSession(o),setTimeout(()=>a(this,null,function*(){"recovery"===s?yield this._notifyAllSubscribers("PASSWORD_RECOVERY",o):yield this._notifyAllSubscribers("SIGNED_IN",o)}),0),{error:null}}return yield this._recoverAndRefresh(),{error:null}}catch(t){return wE(t)?{error:t}:{error:new kE("Unexpected error during initialization",t)}}finally{yield this._handleVisibilityChange(),this._debug("#_initialize()","end")}})}signInAnonymously(e){return a(this,null,function*(){var t,n,r;try{const i=yield Tx(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!==(n=null===(t=null===e||void 0===e?void 0:e.options)||void 0===t?void 0:t.data)&&void 0!==n?n:{},gotrue_meta_security:{captcha_token:null===(r=null===e||void 0===e?void 0:e.options)||void 0===r?void 0:r.captchaToken}},xform:Px}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const s=o.session,l=o.user;return o.session&&(yield this._saveSession(o.session),yield this._notifyAllSubscribers("SIGNED_IN",s)),{data:{user:l,session:s},error:null}}catch(i){if(wE(i))return{data:{user:null,session:null},error:i};throw i}})}signUp(e){return a(this,null,function*(){var t,n,r;try{let i;if("email"in e){const{email:n,password:r,options:o}=e;let a=null,s=null;"pkce"===this.flowType&&([a,s]=yield fx(this.storage,this.storageKey)),i=yield Tx(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null===o||void 0===o?void 0:o.emailRedirectTo,body:{email:n,password:r,data:null!==(t=null===o||void 0===o?void 0:o.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null===o||void 0===o?void 0:o.captchaToken},code_challenge:a,code_challenge_method:s},xform:Px})}else{if(!("phone"in e))throw new CE("You must provide either an email or phone number and a password");{const{phone:t,password:o,options:a}=e;i=yield Tx(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:o,data:null!==(n=null===a||void 0===a?void 0:a.data)&&void 0!==n?n:{},channel:null!==(r=null===a||void 0===a?void 0:a.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null===a||void 0===a?void 0:a.captchaToken}},xform:Px})}}const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const s=o.session,l=o.user;return o.session&&(yield this._saveSession(o.session),yield this._notifyAllSubscribers("SIGNED_IN",s)),{data:{user:l,session:s},error:null}}catch(i){if(wE(i))return{data:{user:null,session:null},error:i};throw i}})}signInWithPassword(e){return a(this,null,function*(){try{let t;if("email"in e){const{email:n,password:r,options:i}=e;t=yield Tx(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:null===i||void 0===i?void 0:i.captchaToken}},xform:Ox})}else{if(!("phone"in e))throw new CE("You must provide either an email or phone number and a password");{const{phone:n,password:r,options:i}=e;t=yield Tx(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:null===i||void 0===i?void 0:i.captchaToken}},xform:Ox})}}const{data:n,error:r}=t;return r?{data:{user:null,session:null},error:r}:n&&n.session&&n.user?(n.session&&(yield this._saveSession(n.session),yield this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r}):{data:{user:null,session:null},error:new TE}}catch(t){if(wE(t))return{data:{user:null,session:null},error:t};throw t}})}signInWithOAuth(e){return a(this,null,function*(){var t,n,r,i;return yield this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})})}exchangeCodeForSession(e){return a(this,null,function*(){return yield this.initializePromise,this._acquireLock(-1,()=>a(this,null,function*(){return this._exchangeCodeForSession(e)}))})}signInWithWeb3(e){return a(this,null,function*(){const{chain:t}=e;if("solana"===t)return yield this.signInWithSolana(e);throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)})}signInWithSolana(e){return a(this,null,function*(){var t,n,r,i,o,a,s,l,u,c,d,h;let f,p;if("message"in e)f=e.message,p=e.signature;else{const{chain:d,wallet:h,statement:g,options:m}=e;let v;if(KE())if("object"===typeof h)v=h;else{const e=window;if(!("solana"in e)||"object"!==typeof e.solana||!("signIn"in e.solana&&"function"===typeof e.solana.signIn||"signMessage"in e.solana&&"function"===typeof e.solana.signMessage))throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.");v=e.solana}else{if("object"!==typeof h||!(null===m||void 0===m?void 0:m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=h}const y=new URL(null!==(t=null===m||void 0===m?void 0:m.url)&&void 0!==t?t:window.location.href);if("signIn"in v&&v.signIn){const e=yield v.signIn(Object.assign(Object.assign(Object.assign({issuedAt:(new Date).toISOString()},null===m||void 0===m?void 0:m.signInWithSolana),{version:"1",domain:y.host,uri:y.href}),g?{statement:g}:null));let t;if(Array.isArray(e)&&e[0]&&"object"===typeof e[0])t=e[0];else{if(!(e&&"object"===typeof e&&"signedMessage"in e&&"signature"in e))throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");t=e}if(!("signedMessage"in t&&"signature"in t&&("string"===typeof t.signedMessage||t.signedMessage instanceof Uint8Array)&&t.signature instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields");f="string"===typeof t.signedMessage?t.signedMessage:(new TextDecoder).decode(t.signedMessage),p=t.signature}else{if(!("signMessage"in v)||"function"!==typeof v.signMessage||!("publicKey"in v)||"object"!==typeof v||!v.publicKey||!("toBase58"in v.publicKey)||"function"!==typeof v.publicKey.toBase58)throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");f=[`${y.host} wants you to sign in with your Solana account:`,v.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${y.href}`,`Issued At: ${null!==(r=null===(n=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===n?void 0:n.issuedAt)&&void 0!==r?r:(new Date).toISOString()}`,...(null===(i=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===i?void 0:i.notBefore)?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...(null===(o=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===o?void 0:o.expirationTime)?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...(null===(a=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===a?void 0:a.chainId)?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...(null===(s=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===s?void 0:s.nonce)?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...(null===(l=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===l?void 0:l.requestId)?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...(null===(c=null===(u=null===m||void 0===m?void 0:m.signInWithSolana)||void 0===u?void 0:u.resources)||void 0===c?void 0:c.length)?["Resources",...m.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");const e=yield v.signMessage((new TextEncoder).encode(f),"utf8");if(!e||!(e instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=e}}try{const{data:t,error:n}=yield Tx(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:f,signature:QE(p)},(null===(d=e.options)||void 0===d?void 0:d.captchaToken)?{gotrue_meta_security:{captcha_token:null===(h=e.options)||void 0===h?void 0:h.captchaToken}}:null),xform:Px});if(n)throw n;return t&&t.session&&t.user?(t.session&&(yield this._saveSession(t.session),yield this._notifyAllSubscribers("SIGNED_IN",t.session)),{data:Object.assign({},t),error:n}):{data:{user:null,session:null},error:new TE}}catch(g){if(wE(g))return{data:{user:null,session:null},error:g};throw g}})}_exchangeCodeForSession(e){return a(this,null,function*(){const t=yield rx(this.storage,`${this.storageKey}-code-verifier`),[n,r]=(null!==t&&void 0!==t?t:"").split("/");try{const{data:t,error:i}=yield Tx(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Px});if(yield ix(this.storage,`${this.storageKey}-code-verifier`),i)throw i;return t&&t.session&&t.user?(t.session&&(yield this._saveSession(t.session),yield this._notifyAllSubscribers("SIGNED_IN",t.session)),{data:Object.assign(Object.assign({},t),{redirectType:null!==r&&void 0!==r?r:null}),error:i}):{data:{user:null,session:null,redirectType:null},error:new TE}}catch(i){if(wE(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}})}signInWithIdToken(e){return a(this,null,function*(){try{const{options:t,provider:n,token:r,access_token:i,nonce:o}=e,a=yield Tx(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:null===t||void 0===t?void 0:t.captchaToken}},xform:Px}),{data:s,error:l}=a;return l?{data:{user:null,session:null},error:l}:s&&s.session&&s.user?(s.session&&(yield this._saveSession(s.session),yield this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:s,error:l}):{data:{user:null,session:null},error:new TE}}catch(t){if(wE(t))return{data:{user:null,session:null},error:t};throw t}})}signInWithOtp(e){return a(this,null,function*(){var t,n,r,i,o;try{if("email"in e){const{email:r,options:i}=e;let o=null,a=null;"pkce"===this.flowType&&([o,a]=yield fx(this.storage,this.storageKey));const{error:s}=yield Tx(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null===i||void 0===i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(n=null===i||void 0===i?void 0:i.shouldCreateUser)||void 0===n||n,gotrue_meta_security:{captcha_token:null===i||void 0===i?void 0:i.captchaToken},code_challenge:o,code_challenge_method:a},redirectTo:null===i||void 0===i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:s}}if("phone"in e){const{phone:t,options:n}=e,{data:a,error:s}=yield Tx(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null===n||void 0===n?void 0:n.data)&&void 0!==r?r:{},create_user:null===(i=null===n||void 0===n?void 0:n.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null===n||void 0===n?void 0:n.captchaToken},channel:null!==(o=null===n||void 0===n?void 0:n.channel)&&void 0!==o?o:"sms"}});return{data:{user:null,session:null,messageId:null===a||void 0===a?void 0:a.message_id},error:s}}throw new CE("You must provide either an email or phone number.")}catch(a){if(wE(a))return{data:{user:null,session:null},error:a};throw a}})}verifyOtp(e){return a(this,null,function*(){var t,n;try{let r,i;"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(n=e.options)||void 0===n?void 0:n.captchaToken);const{data:o,error:a}=yield Tx(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:Px});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const s=o.session,l=o.user;return(null===s||void 0===s?void 0:s.access_token)&&(yield this._saveSession(s),yield this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",s)),{data:{user:l,session:s},error:null}}catch(r){if(wE(r))return{data:{user:null,session:null},error:r};throw r}})}signInWithSSO(e){return a(this,null,function*(){var t,n,r;try{let i=null,o=null;return"pkce"===this.flowType&&([i,o]=yield fx(this.storage,this.storageKey)),yield Tx(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==n?n:void 0}),(null===(r=null===e||void 0===e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:Ix})}catch(i){if(wE(i))return{data:null,error:i};throw i}})}reauthenticate(){return a(this,null,function*(){return yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._reauthenticate()}))})}_reauthenticate(){return a(this,null,function*(){try{return yield this._useSession(e=>a(this,null,function*(){const{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new EE;const{error:r}=yield Tx(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}}))}catch(e){if(wE(e))return{data:{user:null,session:null},error:e};throw e}})}resend(e){return a(this,null,function*(){try{const t=`${this.url}/resend`;if("email"in e){const{email:n,type:r,options:i}=e,{error:o}=yield Tx(this.fetch,"POST",t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:null===i||void 0===i?void 0:i.captchaToken}},redirectTo:null===i||void 0===i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}if("phone"in e){const{phone:n,type:r,options:i}=e,{data:o,error:a}=yield Tx(this.fetch,"POST",t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:null===i||void 0===i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null===o||void 0===o?void 0:o.message_id},error:a}}throw new CE("You must provide either an email or phone number and a type")}catch(t){if(wE(t))return{data:{user:null,session:null},error:t};throw t}})}getSession(){return a(this,null,function*(){yield this.initializePromise;const e=yield this._acquireLock(-1,()=>a(this,null,function*(){return this._useSession(e=>a(this,null,function*(){return e}))}));return e})}_acquireLock(e,t){return a(this,null,function*(){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(()=>a(this,null,function*(){return yield e,yield t()}))();return this.pendingInLock.push((()=>a(this,null,function*(){try{yield n}catch(wT){}}))()),n}return yield this.lock(`lock:${this.storageKey}`,e,()=>a(this,null,function*(){this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const e=t();this.pendingInLock.push((()=>a(this,null,function*(){try{yield e}catch(wT){}}))()),yield e;while(this.pendingInLock.length){const e=[...this.pendingInLock];yield Promise.all(e),this.pendingInLock.splice(0,e.length)}return yield e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}}))}finally{this._debug("#_acquireLock","end")}})}_useSession(e){return a(this,null,function*(){this._debug("#_useSession","begin");try{const t=yield this.__loadSession();return yield e(t)}finally{this._debug("#_useSession","end")}})}__loadSession(){return a(this,null,function*(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",(new Error).stack);try{let e=null;const t=yield rx(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),yield this._removeSession())),!e)return{data:{session:null},error:null};const n=!!e.expires_at&&1e3*e.expires_at-Date.now()(t||"user"!==n||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t=!0,this.suppressGetSessionWarning=!0),Reflect.get(e,n,r))});e=n}return{data:{session:e},error:null}}const{session:r,error:i}=yield this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}})}getUser(e){return a(this,null,function*(){if(e)return yield this._getUser(e);yield this.initializePromise;const t=yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._getUser()}));return t})}_getUser(e){return a(this,null,function*(){try{return e?yield Tx(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:$x}):yield this._useSession(e=>a(this,null,function*(){var t,n,r;const{data:i,error:o}=e;if(o)throw o;return(null===(t=i.session)||void 0===t?void 0:t.access_token)||this.hasCustomAuthorizationHeader?yield Tx(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(r=null===(n=i.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0,xform:$x}):{data:{user:null},error:new EE}}))}catch(t){if(wE(t))return xE(t)&&(yield this._removeSession(),yield ix(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}})}updateUser(e){return a(this,arguments,function*(e,t={}){return yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._updateUser(e,t)}))})}_updateUser(e){return a(this,arguments,function*(e,t={}){try{return yield this._useSession(n=>a(this,null,function*(){const{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new EE;const o=r.session;let a=null,s=null;"pkce"===this.flowType&&null!=e.email&&([a,s]=yield fx(this.storage,this.storageKey));const{data:l,error:u}=yield Tx(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null===t||void 0===t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:s}),jwt:o.access_token,xform:$x});if(u)throw u;return o.user=l.user,yield this._saveSession(o),yield this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}}))}catch(n){if(wE(n))return{data:{user:null},error:n};throw n}})}setSession(e){return a(this,null,function*(){return yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._setSession(e)}))})}_setSession(e){return a(this,null,function*(){try{if(!e.access_token||!e.refresh_token)throw new EE;const t=Date.now()/1e3;let n=t,r=!0,i=null;const{payload:o}=ax(e.access_token);if(o.exp&&(n=o.exp,r=n<=t),r){const{session:t,error:n}=yield this._callRefreshToken(e.refresh_token);if(n)return{data:{user:null,session:null},error:n};if(!t)return{data:{user:null,session:null},error:null};i=t}else{const{data:r,error:o}=yield this._getUser(e.access_token);if(o)throw o;i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:n-t,expires_at:n},yield this._saveSession(i),yield this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(t){if(wE(t))return{data:{session:null,user:null},error:t};throw t}})}refreshSession(e){return a(this,null,function*(){return yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._refreshSession(e)}))})}_refreshSession(e){return a(this,null,function*(){try{return yield this._useSession(t=>a(this,null,function*(){var n;if(!e){const{data:r,error:i}=t;if(i)throw i;e=null!==(n=r.session)&&void 0!==n?n:void 0}if(!(null===e||void 0===e?void 0:e.refresh_token))throw new EE;const{session:r,error:i}=yield this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}}))}catch(t){if(wE(t))return{data:{user:null,session:null},error:t};throw t}})}_getSessionFromURL(e,t){return a(this,null,function*(){try{if(!KE())throw new PE("No browser detected.");if(e.error||e.error_description||e.error_code)throw new PE(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new $E("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new PE("Not a valid implicit grant flow url.");break;default:}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new $E("No code detected.");const{data:t,error:n}=yield this._exchangeCodeForSession(e.code);if(n)throw n;const r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:t.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:o,expires_in:a,expires_at:s,token_type:l}=e;if(!i||!a||!o||!l)throw new PE("No session defined in URL");const u=Math.round(Date.now()/1e3),c=parseInt(a);let d=u+c;s&&(d=parseInt(s));const h=d-u;1e3*h<=uE&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${c}s`);const f=d-c;u-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,d,u):u-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",f,d,u);const{data:p,error:g}=yield this._getUser(i);if(g)throw g;const m={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:c,expires_at:d,refresh_token:o,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:m,redirectType:e.type},error:null}}catch(n){if(wE(n))return{data:{session:null,redirectType:null},error:n};throw n}})}_isImplicitGrantCallback(e){return Boolean(e.access_token||e.error_description)}_isPKCECallback(e){return a(this,null,function*(){const t=yield rx(this.storage,`${this.storageKey}-code-verifier`);return!(!e.code||!t)})}signOut(){return a(this,arguments,function*(e={scope:"global"}){return yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){return yield this._signOut(e)}))})}_signOut(){return a(this,arguments,function*({scope:e}={scope:"global"}){return yield this._useSession(t=>a(this,null,function*(){var n;const{data:r,error:i}=t;if(i)return{error:i};const o=null===(n=r.session)||void 0===n?void 0:n.access_token;if(o){const{error:t}=yield this.admin.signOut(o,e);if(t&&(!_E(t)||404!==t.status&&401!==t.status&&403!==t.status))return{error:t}}return"others"!==e&&(yield this._removeSession(),yield ix(this.storage,`${this.storageKey}-code-verifier`)),{error:null}}))})}onAuthStateChange(e){const t=YE(),n={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,n),(()=>{a(this,null,function*(){yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){this._emitInitialSession(t)}))})})(),{data:{subscription:n}}}_emitInitialSession(e){return a(this,null,function*(){return yield this._useSession(t=>a(this,null,function*(){var n,r;try{const{data:{session:r},error:i}=t;if(i)throw i;yield null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",r),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(AT){yield null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null),this._debug("INITIAL_SESSION","callback id",e,"error",AT),console.error(AT)}}))})}resetPasswordForEmail(e){return a(this,arguments,function*(e,t={}){let n=null,r=null;"pkce"===this.flowType&&([n,r]=yield fx(this.storage,this.storageKey,!0));try{return yield Tx(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(i){if(wE(i))return{data:null,error:i};throw i}})}getUserIdentities(){return a(this,null,function*(){var e;try{const{data:t,error:n}=yield this.getUser();if(n)throw n;return{data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null}}catch(t){if(wE(t))return{data:null,error:t};throw t}})}linkIdentity(e){return a(this,null,function*(){var t;try{const{data:n,error:r}=yield this._useSession(t=>a(this,null,function*(){var n,r,i,o,a;const{data:s,error:l}=t;if(l)throw l;const u=yield this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(n=e.options)||void 0===n?void 0:n.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(i=e.options)||void 0===i?void 0:i.queryParams,skipBrowserRedirect:!0});return yield Tx(this.fetch,"GET",u,{headers:this.headers,jwt:null!==(a=null===(o=s.session)||void 0===o?void 0:o.access_token)&&void 0!==a?a:void 0})}));if(r)throw r;return KE()&&!(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)&&window.location.assign(null===n||void 0===n?void 0:n.url),{data:{provider:e.provider,url:null===n||void 0===n?void 0:n.url},error:null}}catch(n){if(wE(n))return{data:{provider:e.provider,url:null},error:n};throw n}})}unlinkIdentity(e){return a(this,null,function*(){try{return yield this._useSession(t=>a(this,null,function*(){var n,r;const{data:i,error:o}=t;if(o)throw o;return yield Tx(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(r=null===(n=i.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0})}))}catch(t){if(wE(t))return{data:null,error:t};throw t}})}_refreshAccessToken(e){return a(this,null,function*(){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const n=Date.now();return yield lx(n=>a(this,null,function*(){return n>0&&(yield sx(200*Math.pow(2,n-1))),this._debug(t,"refreshing attempt",n),yield Tx(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Px})}),(e,t)=>{const r=200*Math.pow(2,e);return t&&jE(t)&&Date.now()+r-na(this,null,function*(){try{yield n.callback(e,t)}catch(wT){r.push(wT)}}));if(yield Promise.all(i),r.length>0){for(let e=0;ethis._autoRefreshTokenTick(),uE);this.autoRefreshTicker=e,e&&"object"===typeof e&&"function"===typeof e.unref?e.unref():"undefined"!==typeof Deno&&"function"===typeof Deno.unrefTimer&&Deno.unrefTimer(e),setTimeout(()=>a(this,null,function*(){yield this.initializePromise,yield this._autoRefreshTokenTick()}),0)})}_stopAutoRefresh(){return a(this,null,function*(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)})}startAutoRefresh(){return a(this,null,function*(){this._removeVisibilityChangedCallback(),yield this._startAutoRefresh()})}stopAutoRefresh(){return a(this,null,function*(){this._removeVisibilityChangedCallback(),yield this._stopAutoRefresh()})}_autoRefreshTokenTick(){return a(this,null,function*(){this._debug("#_autoRefreshTokenTick()","begin");try{yield this._acquireLock(0,()=>a(this,null,function*(){try{const e=Date.now();try{return yield this._useSession(t=>a(this,null,function*(){const{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");const r=Math.floor((1e3*n.expires_at-e)/uE);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${uE}ms, refresh threshold is ${cE} ticks`),r<=cE&&(yield this._callRefreshToken(n.refresh_token))}))}catch(wT){console.error("Auto refresh tick failed with error. This is likely a transient error.",wT)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}))}catch(wT){if(!(wT.isAcquireTimeout||wT instanceof Fx))throw wT;this._debug("auto refresh token tick lock not available")}})}_handleVisibilityChange(){return a(this,null,function*(){if(this._debug("#_handleVisibilityChange()"),!KE()||!(null===window||void 0===window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=()=>a(this,null,function*(){return yield this._onVisibilityChanged(!1)}),null===window||void 0===window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),yield this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}})}_onVisibilityChanged(e){return a(this,null,function*(){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(yield this.initializePromise,yield this._acquireLock(-1,()=>a(this,null,function*(){"visible"===document.visibilityState?yield this._recoverAndRefresh():this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting")})))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()})}_getUrlForProvider(e,t,n){return a(this,null,function*(){const r=[`provider=${encodeURIComponent(t)}`];if((null===n||void 0===n?void 0:n.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),(null===n||void 0===n?void 0:n.scopes)&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),"pkce"===this.flowType){const[e,t]=yield fx(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(null===n||void 0===n?void 0:n.queryParams){const e=new URLSearchParams(n.queryParams);r.push(e.toString())}return(null===n||void 0===n?void 0:n.skipBrowserRedirect)&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join("&")}`})}_unenroll(e){return a(this,null,function*(){try{return yield this._useSession(t=>a(this,null,function*(){var n;const{data:r,error:i}=t;return i?{data:null,error:i}:yield Tx(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(n=null===r||void 0===r?void 0:r.session)||void 0===n?void 0:n.access_token})}))}catch(t){if(wE(t))return{data:null,error:t};throw t}})}_enroll(e){return a(this,null,function*(){try{return yield this._useSession(t=>a(this,null,function*(){var n,r;const{data:i,error:o}=t;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:{issuer:e.issuer}),{data:s,error:l}=yield Tx(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:null===(n=null===i||void 0===i?void 0:i.session)||void 0===n?void 0:n.access_token});return l?{data:null,error:l}:("totp"===e.factorType&&(null===(r=null===s||void 0===s?void 0:s.totp)||void 0===r?void 0:r.qr_code)&&(s.totp.qr_code=`data:image/svg+xml;utf-8,${s.totp.qr_code}`),{data:s,error:null})}))}catch(t){if(wE(t))return{data:null,error:t};throw t}})}_verify(e){return a(this,null,function*(){return this._acquireLock(-1,()=>a(this,null,function*(){try{return yield this._useSession(t=>a(this,null,function*(){var n;const{data:r,error:i}=t;if(i)return{data:null,error:i};const{data:o,error:a}=yield Tx(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(n=null===r||void 0===r?void 0:r.session)||void 0===n?void 0:n.access_token});return a?{data:null,error:a}:(yield this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),yield this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})}))}catch(t){if(wE(t))return{data:null,error:t};throw t}}))})}_challenge(e){return a(this,null,function*(){return this._acquireLock(-1,()=>a(this,null,function*(){try{return yield this._useSession(t=>a(this,null,function*(){var n;const{data:r,error:i}=t;return i?{data:null,error:i}:yield Tx(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:null===(n=null===r||void 0===r?void 0:r.session)||void 0===n?void 0:n.access_token})}))}catch(t){if(wE(t))return{data:null,error:t};throw t}}))})}_challengeAndVerify(e){return a(this,null,function*(){const{data:t,error:n}=yield this._challenge({factorId:e.factorId});return n?{data:null,error:n}:yield this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})})}_listFactors(){return a(this,null,function*(){const{data:{user:e},error:t}=yield this.getUser();if(t)return{data:null,error:t};const n=(null===e||void 0===e?void 0:e.factors)||[],r=n.filter(e=>"totp"===e.factor_type&&"verified"===e.status),i=n.filter(e=>"phone"===e.factor_type&&"verified"===e.status);return{data:{all:n,totp:r,phone:i},error:null}})}_getAuthenticatorAssuranceLevel(){return a(this,null,function*(){return this._acquireLock(-1,()=>a(this,null,function*(){return yield this._useSession(e=>a(this,null,function*(){var t,n;const{data:{session:r},error:i}=e;if(i)return{data:null,error:i};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=ax(r.access_token);let a=null;o.aal&&(a=o.aal);let s=a;const l=null!==(n=null===(t=r.user.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==n?n:[];l.length>0&&(s="aal2");const u=o.amr||[];return{data:{currentLevel:a,nextLevel:s,currentAuthenticationMethods:u},error:null}}))}))})}fetchJwk(e){return a(this,arguments,function*(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;const r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+yE>r)return n;const{data:i,error:o}=yield Tx(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return i.keys&&0!==i.keys.length?(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),n||null):null})}getClaims(e){return a(this,arguments,function*(e,t={}){try{let n=e;if(!n){const{data:e,error:t}=yield this.getSession();if(t||!e.session)return{data:null,error:t};n=e.session.access_token}const{header:r,payload:i,signature:o,raw:{header:a,payload:s}}=ax(n);(null===t||void 0===t?void 0:t.allowExpired)||mx(i.exp);const l=r.alg&&!r.alg.startsWith("HS")&&r.kid&&"crypto"in globalThis&&"subtle"in globalThis.crypto?yield this.fetchJwk(r.kid,(null===t||void 0===t?void 0:t.keys)?{keys:t.keys}:null===t||void 0===t?void 0:t.jwks):null;if(!l){const{error:e}=yield this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:o},error:null}}const u=vx(r.alg),c=yield crypto.subtle.importKey("jwk",l,u,!0,["verify"]),d=yield crypto.subtle.verify(u,c,o,qE(`${a}.${s}`));if(!d)throw new LE("Invalid JWT signature");return{data:{claims:i,header:r,signature:o},error:null}}catch(n){if(wE(n))return{data:null,error:n};throw n}})}}Gx.nextInstanceID=0;const Yx=Gx;class Kx extends Yx{constructor(e){super(e)}}var Jx=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(wT){o(wT)}}function s(e){try{l(r["throw"](e))}catch(wT){o(wT)}}function l(e){e.done?n(e.value):i(e.value).then(a,s)}l((r=r.apply(e,t||[])).next())})};class Zx{constructor(e,t,n){var r,i,o;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const a=aE(e),s=new URL(a);this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const l=`sb-${s.hostname.split(".")[0]}-auth-token`,u={db:ZS,realtime:eE,auth:Object.assign(Object.assign({},XS),{storageKey:l}),global:JS},c=sE(null!==n&&void 0!==n?n:{},u);this.storageKey=null!==(r=c.auth.storageKey)&&void 0!==r?r:"",this.headers=null!==(i=c.global.headers)&&void 0!==i?i:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!==(o=c.auth)&&void 0!==o?o:{},this.headers,c.global.fetch),this.fetch=iE(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new Ok(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new QS(this.storageUrl.href,this.headers,this.fetch,null===n||void 0===n?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new z_(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return Jx(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:n}=yield this.auth.getSession();return null!==(t=null===(e=n.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:o,flowType:a,lock:s,debug:l},u,c){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Kx({url:this.authUrl.href,headers:Object.assign(Object.assign({},d),u),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:s,debug:l,fetch:c,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new bS(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null===e||void 0===e?void 0:e.params)}))}_listenForAuthEvents(){let e=this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null===t||void 0===t?void 0:t.access_token)});return e}_handleTokenChanged(e,t,n){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===n?"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0):this.changedAccessToken=n}}const Xx=(e,t,n)=>new Zx(e,t,n);function eT(){if("undefined"!==typeof window)return!1;if("undefined"===typeof process)return!1;const e=process["version"];if(void 0===e||null===e)return!1;const t=e.match(/^v(\d+)\./);if(!t)return!1;const n=parseInt(t[1],10);return n<=18}eT()&&console.warn("\u26a0\ufe0f Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var tT={},nT=GA;function rT(e){if(Array.isArray(e))return e}function iT(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(u)throw i}}return s}}function oT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function cT(e){"@babel/helpers - typeof";return cT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cT(e)}function dT(e,t){if("object"!=cT(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=cT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function hT(e){var t=dT(e,"string");return"symbol"==cT(t)?t:t+""}function fT(e,t,n){return(t=hT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gT(e){for(var t=1;t