@alwith/module-auth 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-01py4vpp.js +2 -0
  3. package/dist/chunk-1agdfzjz.js +2 -0
  4. package/dist/chunk-1mwjz4f1.js +2 -0
  5. package/dist/chunk-1sf9m7x2.js +2 -0
  6. package/dist/chunk-2j5re92x.js +2 -0
  7. package/dist/chunk-38vgcbpq.js +2 -0
  8. package/dist/chunk-3amxesw3.js +2 -0
  9. package/dist/chunk-3q1e1ksh.js +2 -0
  10. package/dist/chunk-3rpgxz1z.js +2 -0
  11. package/dist/chunk-3vpcfe38.js +2 -0
  12. package/dist/chunk-41jxjz9n.js +2 -0
  13. package/dist/chunk-4gegjx79.js +2 -0
  14. package/dist/chunk-4mwvph27.js +2 -0
  15. package/dist/chunk-5zpeb8cj.js +2 -0
  16. package/dist/chunk-6f02m6jw.js +2 -0
  17. package/dist/chunk-6t0bw1wy.js +2 -0
  18. package/dist/chunk-74hpp4me.js +2 -0
  19. package/dist/chunk-7pdpmxg2.js +2 -0
  20. package/dist/chunk-7y7stqn0.js +2 -0
  21. package/dist/chunk-8nzgysac.js +2 -0
  22. package/dist/chunk-8w0zccsf.js +0 -0
  23. package/dist/chunk-96emfz6b.js +2 -0
  24. package/dist/chunk-9h4j75af.js +2 -0
  25. package/dist/chunk-afy09ajr.js +2 -0
  26. package/dist/chunk-ax8zmvs0.js +2 -0
  27. package/dist/chunk-b5zfgr86.js +2 -0
  28. package/dist/chunk-b7v6g7a0.js +2 -0
  29. package/dist/chunk-bcyk6es8.js +2 -0
  30. package/dist/chunk-c9banqkx.js +2 -0
  31. package/dist/chunk-ctvwa8d3.js +2 -0
  32. package/dist/chunk-d13j3xks.js +2 -0
  33. package/dist/chunk-d4ezh3c4.js +6 -0
  34. package/dist/chunk-e20z911q.js +1 -0
  35. package/dist/chunk-enze3bpk.js +2 -0
  36. package/dist/chunk-ezj6gpm0.js +2 -0
  37. package/dist/chunk-f0awr1g7.js +2 -0
  38. package/dist/chunk-g8nah79y.js +2 -0
  39. package/dist/chunk-gq64get1.js +2 -0
  40. package/dist/chunk-gv5he3xg.js +2 -0
  41. package/dist/chunk-h994ssre.js +2 -0
  42. package/dist/chunk-hscsc9kx.js +2 -0
  43. package/dist/chunk-htw56xtp.js +2 -0
  44. package/dist/chunk-j03we9jz.js +2 -0
  45. package/dist/chunk-j2922k42.js +2 -0
  46. package/dist/chunk-jampyjt1.js +2 -0
  47. package/dist/chunk-jf77909y.js +2 -0
  48. package/dist/chunk-jppe84sk.js +2 -0
  49. package/dist/chunk-khnyadsg.js +0 -0
  50. package/dist/chunk-kqsxaxk8.js +2 -0
  51. package/dist/chunk-kwq26qhs.js +2 -0
  52. package/dist/chunk-m3e7wah7.js +2 -0
  53. package/dist/chunk-m96z2xh6.js +2 -0
  54. package/dist/chunk-mdqxdcxh.js +2 -0
  55. package/dist/chunk-mfrnyj0b.js +2 -0
  56. package/dist/chunk-mjsqb1wk.js +1 -0
  57. package/dist/chunk-nbfhs21c.js +2 -0
  58. package/dist/chunk-pbwt3qj9.js +0 -0
  59. package/dist/chunk-pe1mn10v.js +2 -0
  60. package/dist/chunk-pha0eyam.js +2 -0
  61. package/dist/chunk-pwsarey8.js +2 -0
  62. package/dist/chunk-qd5jhh2h.js +1 -0
  63. package/dist/chunk-qy364wgy.js +2 -0
  64. package/dist/chunk-rerywpwe.js +2 -0
  65. package/dist/chunk-rfxpf1eq.js +2 -0
  66. package/dist/chunk-rrhhytq1.js +2 -0
  67. package/dist/chunk-t6snsees.js +2 -0
  68. package/dist/chunk-t858h8ch.js +2 -0
  69. package/dist/chunk-tvmvzc41.js +2 -0
  70. package/dist/chunk-v5akzbxg.js +2 -0
  71. package/dist/chunk-v890qhc2.js +1 -0
  72. package/dist/chunk-v9czb1e6.js +2 -0
  73. package/dist/chunk-vt1sfk87.js +2 -0
  74. package/dist/chunk-w5yer870.js +2 -0
  75. package/dist/chunk-wa475kmq.js +2 -0
  76. package/dist/chunk-wfsdbf7j.js +2 -0
  77. package/dist/chunk-x61q358n.js +2 -0
  78. package/dist/chunk-xrw9s1th.js +2 -0
  79. package/dist/chunk-zar89jcs.js +3 -0
  80. package/dist/chunk-zkwggfj2.js +2 -0
  81. package/dist/client.d.ts +1 -1
  82. package/dist/client.js +1 -1
  83. package/dist/index.d.ts +6 -6
  84. package/dist/index.js +1 -1
  85. package/dist/oauth.js +1 -1
  86. package/dist/password.js +1 -1
  87. package/dist/pets/assets.d.ts +8 -8
  88. package/dist/pets/assets.js +1 -1
  89. package/dist/pets/client.d.ts +2 -2
  90. package/dist/pets/client.js +1 -1
  91. package/dist/pets/core/engine.d.ts +2 -2
  92. package/dist/pets/core/engine.js +1 -1
  93. package/dist/pets/core/host.d.ts +3 -3
  94. package/dist/pets/core/host.js +1 -1
  95. package/dist/pets/core/index.d.ts +11 -11
  96. package/dist/pets/core/index.js +1 -1
  97. package/dist/pets/core/lib/account-state.d.ts +1 -1
  98. package/dist/pets/core/lib/account-state.js +1 -1
  99. package/dist/pets/core/lib/bubble-outline.js +1 -1
  100. package/dist/pets/core/lib/draw-result.d.ts +1 -1
  101. package/dist/pets/core/lib/draw-result.js +1 -1
  102. package/dist/pets/core/lib/endpoints.d.ts +1 -1
  103. package/dist/pets/core/lib/endpoints.js +1 -1
  104. package/dist/pets/core/lib/gacha-pools.d.ts +1 -1
  105. package/dist/pets/core/lib/gacha-pools.js +1 -1
  106. package/dist/pets/core/lib/loading-progress.js +1 -1
  107. package/dist/pets/core/lib/pet-animation-sync.d.ts +2 -2
  108. package/dist/pets/core/lib/pet-animation-sync.js +1 -1
  109. package/dist/pets/core/lib/pet-bubble-state.d.ts +1 -1
  110. package/dist/pets/core/lib/pet-bubble-state.js +1 -1
  111. package/dist/pets/core/lib/pet-drag.d.ts +2 -2
  112. package/dist/pets/core/lib/pet-drag.js +1 -1
  113. package/dist/pets/core/lib/pet-presentation.d.ts +3 -3
  114. package/dist/pets/core/lib/pet-presentation.js +1 -1
  115. package/dist/pets/core/lib/pet-session-context.js +1 -1
  116. package/dist/pets/core/lib/preload-images.js +1 -1
  117. package/dist/pets/core/lib/presentation-readiness.js +1 -1
  118. package/dist/pets/core/lib/rarity.d.ts +1 -1
  119. package/dist/pets/core/lib/rarity.js +1 -1
  120. package/dist/pets/core/lib/recharge.js +1 -1
  121. package/dist/pets/core/lib/reply-submission.d.ts +1 -1
  122. package/dist/pets/core/lib/reply-submission.js +1 -1
  123. package/dist/pets/core/lib/resource-sync.js +1 -1
  124. package/dist/pets/core/lib/runtime-types.d.ts +1 -1
  125. package/dist/pets/core/lib/settings.js +1 -1
  126. package/dist/pets/core/lib/sprite-config.d.ts +2 -2
  127. package/dist/pets/core/lib/sprite-config.js +1 -1
  128. package/dist/pets/core/lib/vibemon-resources.d.ts +1 -1
  129. package/dist/pets/core/lib/vibemon-resources.js +1 -1
  130. package/dist/pets/core/lib/view-request.js +1 -1
  131. package/dist/pets/core/lib/window-frame.d.ts +1 -1
  132. package/dist/pets/core/lib/window-frame.js +1 -1
  133. package/dist/pets/core/lib/window-manager.d.ts +1 -1
  134. package/dist/pets/core/lib/window-manager.js +1 -1
  135. package/dist/pets/core/session-icon.js +1 -5
  136. package/dist/pets/core/types.js +1 -1
  137. package/dist/pets/host.js +1 -1
  138. package/dist/pets/index.d.ts +6 -6
  139. package/dist/pets/index.js +1 -1
  140. package/dist/pets/react/assets.js +1 -1
  141. package/dist/pets/react/components/album-view.d.ts +1 -1
  142. package/dist/pets/react/components/album-view.js +1 -1
  143. package/dist/pets/react/components/back-to-home.js +1 -1
  144. package/dist/pets/react/components/equip-view.d.ts +1 -1
  145. package/dist/pets/react/components/equip-view.js +1 -1
  146. package/dist/pets/react/components/gem-balance.js +1 -1
  147. package/dist/pets/react/components/home-view.js +1 -1
  148. package/dist/pets/react/components/insufficient-points-dialog.js +1 -1
  149. package/dist/pets/react/components/intro-overlay.js +1 -1
  150. package/dist/pets/react/components/loading-view.js +1 -1
  151. package/dist/pets/react/components/onboarding-guide.js +1 -1
  152. package/dist/pets/react/components/pet-bubble-background.js +1 -1
  153. package/dist/pets/react/components/pet-lounge.js +1 -1
  154. package/dist/pets/react/components/pet-mode-button.js +1 -1
  155. package/dist/pets/react/components/pet-window.js +1 -1
  156. package/dist/pets/react/components/pull-overlay.d.ts +1 -1
  157. package/dist/pets/react/components/pull-overlay.js +1 -1
  158. package/dist/pets/react/components/pull-video.js +1 -1
  159. package/dist/pets/react/components/pull-view.d.ts +1 -1
  160. package/dist/pets/react/components/pull-view.js +1 -1
  161. package/dist/pets/react/components/quick-reply.js +1 -2
  162. package/dist/pets/react/components/session-icon.d.ts +2 -2
  163. package/dist/pets/react/components/session-icon.js +1 -1
  164. package/dist/pets/react/components/single-pet-toast.js +1 -1
  165. package/dist/pets/react/components/sprite-renderer.d.ts +1 -1
  166. package/dist/pets/react/components/sprite-renderer.js +1 -1
  167. package/dist/pets/react/components/vibemon-empty-state.js +1 -1
  168. package/dist/pets/react/components/vibemon-header.js +1 -1
  169. package/dist/pets/react/components/vibemon-page.js +1 -1
  170. package/dist/pets/react/components/vibemon-scene.js +1 -1
  171. package/dist/pets/react/components/video-fader.js +1 -1
  172. package/dist/pets/react/components/wish-button.js +1 -1
  173. package/dist/pets/react/index.d.ts +5 -5
  174. package/dist/pets/react/index.js +1 -1
  175. package/dist/pets/react/lib/account-state.d.ts +1 -1
  176. package/dist/pets/react/lib/account-state.js +1 -1
  177. package/dist/pets/react/lib/card-image.js +1 -1
  178. package/dist/pets/react/lib/resource-sync.d.ts +2 -2
  179. package/dist/pets/react/lib/resource-sync.js +1 -1
  180. package/dist/pets/react/lib/season.js +1 -1
  181. package/dist/pets/react/lib/use-season.d.ts +1 -1
  182. package/dist/pets/react/lib/use-season.js +1 -1
  183. package/dist/pets/react/lib/utils.js +1 -1
  184. package/dist/pets/react/ui/button.d.ts +2 -2
  185. package/dist/pets/react/ui/button.js +1 -1
  186. package/dist/pets/react/ui/card.js +1 -1
  187. package/dist/pets/react/ui/input-group.d.ts +3 -3
  188. package/dist/pets/react/ui/input-group.js +1 -1
  189. package/dist/pets/react/ui/textarea.js +1 -1
  190. package/dist/pets/resource-package.d.ts +2 -2
  191. package/dist/pets/resource-package.js +1 -1
  192. package/dist/pets/resources.d.ts +5 -5
  193. package/dist/pets/resources.js +1 -1
  194. package/dist/pets/selection.d.ts +1 -1
  195. package/dist/pets/selection.js +1 -1
  196. package/dist/pets/sheet-layout.js +1 -1
  197. package/dist/pets/types.js +1 -0
  198. package/dist/state.d.ts +2 -2
  199. package/dist/state.js +1 -1
  200. package/dist/token-storage.d.ts +1 -1
  201. package/dist/token-storage.js +1 -1
  202. package/dist/types.js +1 -0
  203. package/package.json +13 -12
package/README.md CHANGED
@@ -74,6 +74,6 @@ are generated by `createSpriteConfig` in the core entry. `spriteConfig` preserve
74
74
  legacy `config.json` timing, crop, facing and behavior overrides without rewriting
75
75
  existing caches. Storage keys and account cache paths remain unchanged.
76
76
 
77
- Run `bun test src` and `bun run typecheck` from this package before building.
77
+ Run `bun test src` and `bun check --no-script` from this package before building.
78
78
  `bun run build` emits minified JavaScript and declarations; `bun pm pack` includes
79
79
  those outputs, visual assets and redistribution notices.
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";var n={"vibemon.accounts":{},"vibemon.introSeen":{},"vibemon.albumHasUnseen":{},"vibemon.onboardingStep":{}},s=new Set,r=0;async function w(){let t=++r,o=e(),a=await Promise.all(Object.keys(n).map(async(i)=>[i,await o.storage.get(i)??{}]));if(r!==t)return;n=Object.fromEntries(a);for(let i of s)i()}async function Kt(){let t=e().subscribeStorage(()=>{w().catch(e().onError)});return await w(),()=>{r++,t()}}var Nt=(t)=>(s.add(t),()=>{s.delete(t)}),u=(t)=>n[t],be=(t)=>Promise.resolve(n[t]);function Mt(t,o){r++,n={...n,[t]:o};for(let a of s)a()}async function R(t,o){await e().storage.set(t,o),await w()}
2
+ export{w,Kt,Nt,u,be,Mt,R};
@@ -0,0 +1,2 @@
1
+ import{ee}from"./chunk-ctvwa8d3.js";import{useStore as o}from"zustand";var Ue=(e)=>o(ee,e);
2
+ export{Ue};
@@ -0,0 +1,2 @@
1
+ import{t}from"./chunk-mjsqb1wk.js";import{LoaderCircleIcon as a,Minimize2Icon as i}from"lucide-react";import{useTranslation as s}from"react-i18next";import{jsxDEV as o}from"react/jsx-dev-runtime";function $t({busy:e,onClick:r}){let{t:n}=s("common");return o(t,{variant:"ghost",size:"icon-xs",title:n("petMode.enter"),"aria-label":n("petMode.enter"),disabled:e,onClick:r,className:"group text-muted-foreground hover:text-muted-foreground shrink-0 hover:bg-transparent dark:hover:bg-transparent",children:e?o(a,{className:"size-4 animate-spin"},void 0,!1,void 0,this):o(i,{className:"size-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
2
+ export{$t};
@@ -0,0 +1,2 @@
1
+ var ce=200,Sn=320;
2
+ export{ce,Sn};
@@ -0,0 +1,2 @@
1
+ import{SolarTime as s}from"tyme4ts";var u={立春:"spring",雨水:"spring",惊蛰:"spring",春分:"spring",清明:"spring",谷雨:"spring",立夏:"summer",小满:"summer",芒种:"summer",夏至:"summer",小暑:"summer",大暑:"summer",立秋:"autumn",处暑:"autumn",白露:"autumn",秋分:"autumn",寒露:"autumn",霜降:"autumn",立冬:"winter",小雪:"winter",大雪:"winter",冬至:"winter",小寒:"winter",大寒:"winter"},o={spring:"autumn",summer:"winter",autumn:"spring",winter:"summer"};function ke(n=new Date,m="north"){let e=new Date(n.getTime()+28800000),t=s.fromYmdHms(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()).getTerm().getName(),r=u[t];if(!r)throw Error(`Unknown solar term: ${t}`);return m==="south"?o[r]:r}
2
+ export{ke};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";import{Bt,Ut,Dt}from"./chunk-f0awr1g7.js";import{useEffect as k,useEffectEvent as q,useState as x}from"react";import{jsxDEV as O}from"react/jsx-dev-runtime";var F=Promise.resolve();function d(c){let u=F,r;F=new Promise((n)=>{r=n}),(async()=>{await u;try{await c()}finally{r()}})()}function He({cardRef:c,opacity:u=0.65,radius:r=20,enabled:n=!0}){let t=e(),[B,R]=x([]),N=q(()=>{d(async()=>{await t.windows.call("bubble-blur",{enabled:!1,radius:1,path:null}).catch(t.onError)})});return k(()=>()=>N(),[]),k(()=>{let o=c.current;if(o===null)throw Error("Pet bubble background requires its card");let z={scaleFactor:()=>t.windows.call("scale")},b=!1,l=null,m=null,p=async()=>{if(b)return;let a=await z.scaleFactor();if(b)return;let i=o.getBoundingClientRect();if(i.width<=1||i.height<=1)return;let S=getComputedStyle(o),h=Number.parseFloat(S.borderTopLeftRadius);if(!Number.isFinite(h))throw Error("Pet bubble corner radius must resolve to pixels");let v=o.parentElement;if(v===null)throw Error("Pet bubble card requires its container");let g=Number.parseFloat(getComputedStyle(v).paddingBottom);if(!Number.isFinite(g))throw Error("Pet bubble tail spacing must resolve to pixels");let y=Bt(i.left+0.5,i.top+0.5,i.width-1,i.height-1,h-0.5,g);R(y);let E=n?Dt(y,window.devicePixelRatio/a):null,P=JSON.stringify([n,r,E]);if(P===m)return;await t.windows.call("bubble-blur",{enabled:n,radius:r,path:E}),m=P},s=()=>{if(b||l!==null)return;l=requestAnimationFrame(()=>{l=null,d(()=>p().catch(t.onError))})};d(()=>p().catch(t.onError));let f=new ResizeObserver(s);f.observe(o);let w=new MutationObserver(s);for(let a of[document.documentElement,document.body,o])w.observe(a,{attributes:!0,attributeFilter:["class","style"]});window.addEventListener("resize",s);let C=t.windows.geometry(s);return()=>{if(b=!0,l!==null)cancelAnimationFrame(l);f.disconnect(),w.disconnect(),window.removeEventListener("resize",s),C.then((a)=>a()).catch(t.onError)}},[c,n,r,t]),O("svg",{"aria-hidden":!0,"data-pet-bubble-background":!0,className:"pointer-events-none fixed inset-0 size-full overflow-visible",children:O("path",{d:Ut(B),fill:"var(--popover)",fillOpacity:u,stroke:"var(--border)",strokeOpacity:u,strokeWidth:1},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
2
+ export{He};
@@ -0,0 +1,2 @@
1
+ import{n}from"./chunk-rerywpwe.js";import{m}from"./chunk-4gegjx79.js";import{y,ie,se,Pe,k,_e,qt}from"./chunk-nbfhs21c.js";var O=new TextEncoder,N=new TextDecoder;function re(r,d){let w=d.resource_package_format??0;return(r.format??0)===w&&r.version===(d.resource_version??null)&&(r.sourceUrl===void 0?w===0:r.sourceUrl===(w===1?d.resource_url:d.sheet_url))}function xe(r){let d=!1,w=new Map,S=new Map,M=new Map,R=new Map,E=new Set,A=Promise.resolve();function U(e){if(d)throw Error("Vibemon resources disposed");let s=r.account();if(s===null)throw Error("Sign in to load Vibemon resources");if(!/^[a-zA-Z0-9_-]+$/.test(e)||!/^[a-zA-Z0-9.-]+$/.test(s.apiHost))throw Error("Invalid resource identity");return`vibemon/catalog/${s.apiHost}/${e}`}function I(e){let s=r.account();if(s===null)return Promise.reject(Error("Sign in to load Vibemon resources"));let t=`${U(e)}/${s.userId}/${s.revision}`,i=S.get(t);if(i)return i;let o=H(e).finally(()=>{if(S.get(t)===o)S.delete(t)});return S.set(t,o),o}async function H(e){let s=r.account();if(s===null)throw Error("Sign in to load Vibemon resources");let t=U(e),i=await r.resources.read(`${t}/resource.json`);if(i===null){for(let l of[t,`vibemon/${s.apiHost}/${s.userId}/${e}`]){let f=await r.resources.read(`${l}/config.json`);if(f===null)continue;let a=JSON.parse(N.decode(f));if(!/^sprite-sheet\.(webp|png)$/.test(a.spritesheet))throw Error("Invalid legacy sprite filename");let v=m(JSON.stringify({frameWidth:a.frameSize,frameHeight:a.frameSize,states:a.states}));if(await r.resources.exists(`${l}/${a.spritesheet}`)){let b=await r.storage.get("vibemon.resourceVersion");return n(r,s),{directory:l,sheetName:a.spritesheet,layout:v,version:b?.[s.apiHost]?.[e]??0,config:a}}}return null}let o;try{o=JSON.parse(N.decode(i))}catch{return null}if(!o||o.format!==void 0&&o.format!==0&&o.format!==1)return null;if(o.format===1)try{let l=await r.resources.read(`${t}/manifest.json`),f=await r.resources.read(`${t}/resource.zip`);if(!l||!f||await se(f)!==o.archiveSha256)return null;let a=Pe(l),v=await _e(a,(b)=>r.resources.read(`${t}/${b}`));return n(r,s),{...o,directory:t,manifest:a,layout:v,sheetName:a.assets.sheet?.path??null}}catch{return n(r,s),null}let c=JSON.parse(N.decode(i));if(m(JSON.stringify(c.layout)),!/^sprite-sheet\.(webp|png)$/.test(c.sheet))throw Error("Invalid sprite filename");let u=await r.resources.exists(`${t}/${c.sheet}`);n(r,s);let h=await r.resources.read(`${t}/config.json`);return n(r,s),!u?null:{directory:t,sheetName:c.sheet,name:c.name,layout:c.layout,version:c.version,format:0,sourceUrl:o.sourceUrl,config:h===null?void 0:JSON.parse(N.decode(h))}}async function L(e){let s=r.account();if(s===null)throw Error("Sign in to load Vibemon resources");let t=await I(e);if(t===null)return null;if(t.sheetName===null)return{...t,sheet:null};let i=await r.resources.read(`${t.directory}/${t.sheetName}`);return n(r,s),i===null?null:{...t,sheet:i}}function J(e){let s=r.account();if(s===null)return Promise.reject(Error("Sign in to download Vibemon resources"));if(e.resource_package_format!=null&&(!Number.isInteger(e.resource_package_format)||e.resource_package_format<0))return Promise.reject(Error("Invalid Vibemon resource format"));if(e.resource_version!=null&&(!Number.isInteger(e.resource_version)||e.resource_version<0))return Promise.reject(Error("Invalid Vibemon resource version"));let t=U(e.uuid),i=JSON.stringify([s.revision,e.resource_package_format??0,e.resource_version??null,e.resource_url,e.sheet_url,e.layout]),o=w.get(t);if(o?.key===i)return o.work;let c=(M.get(t)??0)+1;M.set(t,c);let u=()=>{if(n(r,s),d||M.get(t)!==c)throw Error("Vibemon resource request superseded")},l=(async()=>{await o?.work.catch(()=>{}),u();let f=await L(e.uuid);if(n(r,s),f!==null&&re(f,e))return{...f,name:e.name};let a=e.resource_package_format??0;if(a!==0&&a!==1)throw Error(`Unsupported Vibemon resource format: ${a}`);if(a===1&&!e.resource_url)throw Error("Vibemon package URL is missing");if(a===0&&(!e.sheet_url||!e.layout))throw Error("Vibemon animation is unavailable");let v=a===0?m(e.layout):null,b=new URL(a===1?e.resource_url:e.sheet_url);if(b.protocol!=="https:")throw Error("Vibemon sprites require HTTPS");let C=b.pathname.toLowerCase().endsWith(".png")?"sprite-sheet.png":"sprite-sheet.webp",_=new AbortController;E.add(_);let g=`${t}.${crypto.randomUUID()}.tmp`;try{let P=await r.download(b.href,_.signal);if(u(),a===1){let p=await qt(P,r.validateImage);u();for(let[D,T]of p.files)await r.resources.write(`${g}/${D}`,T);await r.resources.write(`${g}/resource.zip`,P);let V={directory:t,format:1,sourceUrl:e.resource_url,version:e.resource_version??null,name:e.name,manifest:p.manifest,layout:p.layout,sheetName:p.manifest.assets.sheet?.path??null,archiveSha256:await se(P)};return await r.resources.write(`${g}/resource.json`,O.encode(JSON.stringify(V))),u(),_.signal.throwIfAborted(),await r.resources.replace(g,t),{...V,sheet:V.sheetName?p.files.get(V.sheetName):null}}if(P.byteLength===0)throw Error("Empty Vibemon spritesheet");await r.resources.write(`${g}/${C}`,P),await r.resources.write(`${g}/resource.json`,O.encode(JSON.stringify({layout:v,version:e.resource_version??null,sheet:C,name:e.name,sourceUrl:e.sheet_url}))),n(r,s),_.signal.throwIfAborted(),u(),await r.resources.replace(g,t),n(r,s);let x=A.catch(()=>{}).then(async()=>{n(r,s);let p=await r.storage.get("vibemon.resourceVersion")??{};n(r,s),await r.storage.set("vibemon.resourceVersion",{...p,[s.apiHost]:{...p[s.apiHost],[e.uuid]:e.resource_version??0}})});return A=x,await x,n(r,s),{directory:t,sheetName:C,sheet:P,name:e.name,layout:v,version:e.resource_version??null,format:0,sourceUrl:e.sheet_url}}finally{E.delete(_),await r.resources.remove(g)}})().finally(()=>{if(w.get(t)?.work===l)w.delete(t)});return w.set(t,{key:i,generation:c,work:l}),l}async function z(e){if(e.format!==1||!e.manifest)return{};let s=e.manifest,t={};return await Promise.all(y.map(async(i)=>{let o=s.assets[i];if(!o){t[i]=null;return}if(!ie(o.path))throw Error("Invalid cached Vibemon path");if(r.resources.url)t[i]=`${await r.resources.url(`${e.directory}/${o.path}`)}?v=${o.sha256}`;else{let c=`${e.directory}/${o.sha256}`,u=R.get(c);if(!u){let h=await r.resources.read(`${e.directory}/${o.path}`);if(h===null)throw Error("Cached Vibemon image is missing");u=URL.createObjectURL(new Blob([new Uint8Array(h).buffer],{type:k(h).mime})),R.set(c,u)}t[i]=u}})),t}function j(){for(let e of E)e.abort();E.clear()}return{inspect:I,visuals:z,async preview(e){let s=e.manifest?.assets.cover??e.manifest?.assets.icon;return s?r.resources.read(`${e.directory}/${s.path}`):null},cached:L,ensure:J,cancel:j,dispose(){d=!0,j();for(let e of R.values())URL.revokeObjectURL(e);R.clear()}}}
2
+ export{re,xe};
@@ -0,0 +1,2 @@
1
+ import{_}from"./chunk-d4ezh3c4.js";import{jsxDEV as e}from"react/jsx-dev-runtime";function le({name:n,icons:s}){return e("span",{"aria-hidden":!0,className:"inline-flex size-[18px] items-center justify-center",dangerouslySetInnerHTML:{__html:_(n,s)}},void 0,!1,void 0,this)}
2
+ export{le};
@@ -0,0 +1,2 @@
1
+ import{s,U}from"./chunk-tvmvzc41.js";import{t}from"./chunk-mjsqb1wk.js";import{A,Ce}from"./chunk-pwsarey8.js";import{useLayoutEffect as f,useRef as p,useState as u}from"react";import{jsxDEV as n}from"react/jsx-dev-runtime";var d=1.778723404255319,g="#120E18",h={x1:0.3,x2:0.8,y1:0.56,y2:1},v=h.x2-h.x1,w=h.y2-h.y1,y=(h.x1+h.x2)/2,x=0.8;function S(e,a){let c=Math.max(e,a*d),l=Math.min(e/v,a/w*d),o=Math.max(Math.min(c,l),x*c),i=o/d,r=o<=e?(e-o)/2:Math.min(0,Math.max(e-o,e/2-y*o)),b=i<=a?(a-i)/2:a-i;return{width:o,height:i,left:r,top:b}}function E(e){let[a,c]=u({width:0,height:0,left:0,top:0});return f(()=>{let l=e.current;if(!l)return;let o=new ResizeObserver(([i])=>{let{width:r,height:b}=i.contentRect;c(S(r,b))});return o.observe(l),()=>o.disconnect()},[e]),a}var R={vibemon:{box:{left:"15.75%",top:"68.40%",width:"16.60%"},label:{left:"30.80%",top:"88.00%",width:"9.2%"}},wish:{box:{left:"50.40%",top:"58.40%",width:"14.50%"},label:{left:"54.00%",top:"84.50%",width:"6.8%"}},album:{box:{left:"75.80%",top:"64.65%",width:"20.20%"},label:{left:"74.60%",top:"73.20%",width:"7.2%"}}};function m({assetKey:e,onClick:a,highlighted:c,disabled:l}){let[o,i]=u(!1),r=R[e];return n("div",{className:`pointer-events-none absolute inset-0 ${c?"z-30":""}`,children:[n(t,{variant:"ghost",className:"pointer-events-auto absolute h-auto p-0 hover:bg-transparent dark:hover:bg-transparent",style:r.box,"aria-label":e==="vibemon"?"Vibémon":e==="wish"?"Wish":"Album",disabled:l,onClick:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[n("img",{src:s[e].icon,alt:"",className:"block w-full select-none",style:{opacity:o?0:1}},void 0,!1,void 0,this),n("img",{src:s[e].hover,alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full select-none",style:{opacity:o?1:0}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n("img",{src:s[e].text,alt:"","aria-hidden":!0,className:"pointer-events-none absolute transition-opacity duration-200 select-none",style:{...r.label}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Ie({onDraw:e,onBackpack:a,onEquip:c,guideActive:l}){let o=p(null),i=E(o);return n("div",{ref:o,className:"relative h-full w-full overflow-hidden",children:[n("div",{className:"absolute inset-0",style:{background:g}},void 0,!1,void 0,this),n("div",{"data-testid":"vibemon-home-stage",className:"[container-type:size] absolute",style:{width:i.width,height:i.height,left:i.left,top:i.top},children:[n("img",{src:U,alt:"",className:"block h-full w-full select-none"},void 0,!1,void 0,this),n("div",{className:"pointer-events-none absolute inset-0",children:[n(m,{assetKey:"vibemon",onClick:c,highlighted:!1,disabled:l},void 0,!1,void 0,this),n(m,{assetKey:"wish",onClick:e,highlighted:l,disabled:!1},void 0,!1,void 0,this),n(m,{assetKey:"album",onClick:a,highlighted:!1,disabled:l},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l&&n(A,{},void 0,!1,void 0,this),l&&n(Ce,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{Ie};
@@ -0,0 +1,2 @@
1
+ class ge{apply;requested=!1;interacting=!1;visible=null;state=null;prompt=null;sessionId=null;revision=-1;ownerLabel="";observed=!1;constructor(e){this.apply=e}bind(e,t){if(this.sessionId===e&&this.revision===t)return;let i=this.requested&&e!==null;this.sessionId=e,this.revision=t,this.ownerLabel="",this.reset(),this.requested=i}owner(e){if(this.ownerLabel!==""&&this.ownerLabel!==e)this.reset();this.ownerLabel=e}reset(){this.requested=!1,this.interacting=!1,this.visible=null,this.state=null,this.prompt=null,this.observed=!1,this.publish()}update(e,t,i){if(e!==null&&i!==null){let s=this.observed&&(e!==this.state||t!==this.prompt);if(this.state=e,this.prompt=t,this.observed=!0,s&&(e==="running"||e==="requires_action"||t!==null))this.requested=!0}if(this.visible=i,i&&!this.interacting)this.requested=!1;this.publish()}open(){if(this.sessionId===null)return;this.requested=!0,this.interacting=!0,this.publish()}interact(){if(!this.requested)return;this.interacting=!0,this.publish()}close(){this.requested=!1,this.interacting=!1,this.publish()}publish(){this.apply(this.requested&&(this.interacting||this.visible===!1))}}
2
+ export{ge};
@@ -0,0 +1,2 @@
1
+ import{k}from"./chunk-nbfhs21c.js";import{e}from"./chunk-htw56xtp.js";import{ne,oe}from"./chunk-v9czb1e6.js";async function Ot(r){return await e().assets.resources.inspect(r)!==null}async function v(r){let s=e().assets,t=await s.resources.cached(r)??await s.ensureResource(r);if(t.sheet===null){let i=await s.resources.preview(t),n=i?URL.createObjectURL(new Blob([new Uint8Array(i).buffer],{type:k(i).mime})):"";return{config:ne(t.name??r,"",{frameWidth:256,frameHeight:256,states:[{id:"static",row:0,frames:1}]}),spriteUrl:n,staticImage:!0,dispose:()=>{if(n)URL.revokeObjectURL(n)}}}let o=t.sheet,a=o[0]===137&&o[1]===80,c=URL.createObjectURL(new Blob([new Uint8Array(o).buffer],{type:a?"image/png":"image/webp"}));return{config:oe(r,t),spriteUrl:c,dispose:()=>URL.revokeObjectURL(c)}}
2
+ export{Ot,v};
@@ -0,0 +1,2 @@
1
+ function m(t){let e=JSON.parse(t);if(!e||!Number.isInteger(e.frameWidth)||e.frameWidth<1||e.frameWidth>4096||!Number.isInteger(e.frameHeight)||e.frameHeight<1||e.frameHeight>4096||!Array.isArray(e.states)||e.states.length<1||e.states.length>32||e.states.some((r)=>!r||typeof r.id!=="string"||!r.id||!Number.isInteger(r.row)||r.row<0||!Number.isInteger(r.frames)||r.frames<1||r.frames>128)||new Set(e.states.map((r)=>r.id)).size!==e.states.length||e.states.reduce((r,s)=>r+s.frames,0)>512)throw Error("Invalid Vibemon sprite layout");return e}
2
+ export{m};
@@ -0,0 +1,2 @@
1
+ import{Q}from"./chunk-jppe84sk.js";import{Ot}from"./chunk-41jxjz9n.js";import{ht}from"./chunk-j03we9jz.js";import{tt,c,l}from"./chunk-tvmvzc41.js";import{Z,h}from"./chunk-6f02m6jw.js";import{d}from"./chunk-rfxpf1eq.js";import{i}from"./chunk-h994ssre.js";import{Ue}from"./chunk-1agdfzjz.js";import{t}from"./chunk-mjsqb1wk.js";import{Ge}from"./chunk-zkwggfj2.js";import{B}from"./chunk-t6snsees.js";import{T}from"./chunk-t858h8ch.js";import{p}from"./chunk-w5yer870.js";import{Loader2 as N}from"lucide-react";import{useCallback as D,useEffect as M,useState as k}from"react";import{useTranslation as j}from"react-i18next";import{toast as x}from"sonner";import{jsxDEV as e,Fragment as O}from"react/jsx-dev-runtime";async function L(o,a){let{pet:u}=await Z();if(!u){if(o.length!==1)return;let n=o.find((r)=>a[r.vibemon_uuid]);if(n)await h({pet:n.vibemon_uuid});return}if(a[u])return;let m=o.find((n)=>a[n.vibemon_uuid]);if(m)await h({pet:m.vibemon_uuid})}function z(o){if(o.icon_url===null)return l;return o.icon_url}function U(o){if(o.background_url===null)return l;return o.background_url}function W({item:o,isCurrent:a,isDownloaded:u,onSelectedClick:m,onEquip:n}){return e("div",{"data-testid":"equip-list-item",className:"relative h-[10.673cqw] w-full shrink-0",children:[e("div",{className:"absolute top-[10.302%] left-[4.878%] h-[78.079%] w-[94.309%]",children:[e("img",{src:U(o),alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full max-w-none rounded-[1.667cqw] object-cover select-none"},void 0,!1,void 0,this),e("div",{className:"absolute top-[29.638%] left-[9.914%] w-[65.259%]",children:[e("div",{className:"truncate text-[1.875cqw] leading-[1.278] text-white",style:{fontFamily:"Outfit, system-ui, sans-serif",fontWeight:900},children:o.name},void 0,!1,void 0,this),e("div",{className:"mt-[0.104cqw] truncate text-[1.042cqw] leading-[1.25] font-medium text-white",style:{fontFamily:"Outfit, system-ui, sans-serif"},children:o.description??o.rarity_name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e(t,{"aria-label":a?"selected":"select",disabled:!u,onClick:a?m:n,style:{backgroundColor:"#5536CC"},className:"absolute top-[31.756%] left-[70.690%] h-[41.25%] w-[17.241%] overflow-hidden rounded-full border-0 p-0 shadow-none drop-shadow-[0_0.25cqh_0_rgba(0,0,0,0.5)] transition-none hover:brightness-105 active:translate-y-0 disabled:opacity-100",children:[e("img",{src:c,alt:"",className:"pointer-events-none absolute inset-0 size-full max-w-none rounded-[inherit] object-bottom opacity-5 mix-blend-difference select-none"},void 0,!1,void 0,this),a&&e("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-[#5D508B]"},void 0,!1,void 0,this),e("span",{"aria-hidden":!0,className:"absolute inset-0 shadow-[inset_0_0.2cqh_0.07cqh_0_white]"},void 0,!1,void 0,this),e("span",{className:"relative text-[1.458cqw] leading-normal font-normal text-white",style:{fontFamily:'"Grow Year", system-ui, sans-serif'},children:a?"selected":"select"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e("div",{className:"absolute top-0 left-0 size-[7.917cqw] overflow-hidden rounded-full",children:e("img",{src:i(z(o)),alt:`${o.name} portrait`,className:"h-full w-full object-cover select-none"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Xt({items:o,currentId:a,downloaded:u,onSelectedClick:m,onEquip:n}){return e("div",{className:"flex flex-col gap-[0.833cqw]",children:Q(o).map((r)=>e(W,{item:r,isCurrent:r.vibemon_uuid===a,isDownloaded:u[r.vibemon_uuid],onSelectedClick:m,onEquip:()=>n(r.vibemon_uuid)},r.vibemon_uuid,!1,void 0,this))},void 0,!1,void 0,this)}function Be({onBack:o,onWish:a,onAlbum:u,albumHasUnseen:m,ownedCards:n,ownedLoaded:r,availablePoints:V,pointsLoaded:S}){let{i18n:I}=j("common"),f=I.getFixedT("en","common"),{pet:E}=d(),v=Ue((s)=>s.status==="checking"||s.status==="updating"),[w,C]=k({}),[R,g]=k(0),y=D(()=>g(0),[]);M(()=>{let s=!1;return(async()=>{let b=await Promise.all(n.map(async(_)=>[_.vibemon_uuid,await Ot(_.vibemon_uuid)]));if(s)return;let q=Object.fromEntries(b);if(C(q),!v)await L(n,q)})(),()=>{s=!0}},[n,v]);let F=async(s)=>{y();try{if(await h({pet:s}),await ht({trusted:!0})==="unavailable")x.error(f("vibemon.actionFailed"))}catch(b){console.warn("[vibemon] equip failed",b),x.error(f("vibemon.actionFailed"))}},P=n.some((s)=>w[s.vibemon_uuid]);return e(p,{backdrop:e(O,{children:[e("img",{src:tt,alt:"","aria-hidden":!0,className:"pointer-events-none absolute inset-0 h-full w-full object-cover opacity-10 select-none"},void 0,!1,void 0,this),e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(102,102,102,0) 100%)"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[e(T,{onBack:o,onWish:a,sectionAction:{kind:"album",onClick:u,hasUnseen:m},availablePoints:V,pointsLoaded:S},void 0,!1,void 0,this),!r?e("div",{"data-testid":"vibemon-owned-loading",className:"absolute inset-0 flex items-center justify-center text-[#DCC9FF]",children:e(N,{className:"size-8 animate-spin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):n.length===0?e(B,{onWish:a},void 0,!1,void 0,this):v&&!P?e("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 text-[#DCC9FF]",children:[e(N,{className:"size-8 animate-spin"},void 0,!1,void 0,this),e("div",{className:"text-sm",children:f("vibemon.syncPreparing")},void 0,!1,void 0,this)]},void 0,!0,void 0,this):e("div",{className:"absolute top-[17.167%] left-[17.969%] h-[77.833%] w-[64.063%] [scrollbar-width:none] overflow-y-auto overscroll-y-contain [&::-webkit-scrollbar]:hidden",children:e(Xt,{items:n,currentId:E,downloaded:w,onSelectedClick:()=>g((s)=>s+1),onEquip:(s)=>void F(s)},void 0,!1,void 0,this)},void 0,!1,void 0,this),e(Ge,{requestId:R,onClose:y},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{Xt,Be};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";import{v}from"./chunk-41jxjz9n.js";import{a}from"./chunk-6f02m6jw.js";import{d}from"./chunk-rfxpf1eq.js";import{Ee}from"./chunk-gq64get1.js";import{t}from"./chunk-mjsqb1wk.js";import{I}from"./chunk-8nzgysac.js";import{PlusIcon as K}from"lucide-react";import{useEffect as Q,useRef as C,useState as y}from"react";import{createPortal as k}from"react-dom";import{useTranslation as Z}from"react-i18next";import j from"@alwith/module-auth/assets/pets/lounge/autumn.png?url";import ee from"@alwith/module-auth/assets/pets/lounge/spring.png?url";import te from"@alwith/module-auth/assets/pets/lounge/summer.png?url";import re from"@alwith/module-auth/assets/pets/lounge/winter.png?url";import"@alwith/module-auth/pets/lounge-burst.css";import{jsxDEV as i,Fragment as oe}from"react/jsx-dev-runtime";var ne={spring:ee,summer:te,autumn:j,winter:re};function Ht({active:U,nest:c,onOpenCenter:H,onSend:O,dropTarget:q=!1}){let N=e(),s=d(),z=a(),{t:A}=Z("common"),F=Ee(),[P,B]=y(null),[T,x]=y(null),[G,W]=y(0),[M,V]=y(!1),[f,g]=y(null),[S,X]=y(null),b=C(null),R=C(!1),w=C(!1),m=P?.pet===s.pet&&P.scope===z?P.resource:null;Q(()=>{let r=!1,n=null;if(x(null),B(null),g(null),z!==null&&s.pet)(async()=>{if(!(await N.assets.getMyVibemons()).some((l)=>l.vibemon_uuid===s.pet))throw Error("This account does not own the selected Vibemon");if(r)return;if(n=await v(s.pet),r)n.dispose();else B({pet:s.pet,scope:z,resource:n})})().catch((o)=>{if(!r)x(o instanceof Error?o.message:String(o))});return()=>{r=!0,n?.dispose()}},[N,z,s.pet,G]);let D=async(r)=>{if(R.current)return;if(R.current=!0,V(!0),x(null),r)g({center:r,scale:2}),X(r);try{await O(s.pet,r)}catch(n){x(n instanceof Error?n.message:String(n))}finally{R.current=!1,V(!1),g(null)}},L=(r)=>m&&i(I,{config:m.config,spriteUrl:m.spriteUrl,staticImage:m.staticImage,stateId:m.config.behaviorMap.sleep,flipped:!1,active:U||r,onMouseDown:()=>{},onClick:()=>{},onRenderError:(n)=>x(n.message)},void 0,!1,void 0,this),E={insetInlineEnd:c.inlineEnd,bottom:c.bottom,width:c.size,height:c.size};return i(oe,{children:[i("img",{src:ne[F],alt:"",draggable:!1,className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 w-full"},void 0,!1,void 0,this),(q||f!==null&&!M)&&i("div",{"data-testid":"pet-lounge-drop",className:"border-primary bg-primary/10 pointer-events-none absolute z-30 rounded-xl border-4 border-dashed",style:E},void 0,!1,void 0,this),!s.enabled&&!s.pet&&i(t,{"aria-label":"Vibémon",onClick:H,className:"border-primary bg-primary/10 text-primary absolute z-20 rounded-xl border-4 border-dashed p-0",style:E,children:i(K,{className:"size-16"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!s.enabled&&m&&i("button",{type:"button","aria-label":"Vibémon",disabled:M,className:"vibemon-lounge-pet absolute z-20 cursor-grab touch-none border-0 bg-transparent p-0 disabled:cursor-wait",style:{...E,opacity:f?0:1},onPointerDown:(r)=>{if(r.button!==0||M)return;let n=r.currentTarget.getBoundingClientRect(),o=r.currentTarget.parentElement;if(!o)throw Error("Lounge requires its station");let l=getComputedStyle(o).direction==="rtl",p=o.getBoundingClientRect();w.current=!1,b.current={start:{x:r.clientX,y:r.clientY},origin:{x:n.left+n.width/2,y:n.top+n.height/2},rect:n,edge:l?p.right:p.left,rtl:l,pointer:r.pointerId},r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:(r)=>{let n=b.current;if(!n)return;let o=r.clientX-n.start.x,l=r.clientY-n.start.y,p=Math.hypot(o,l);if(p<=4&&!w.current)return;w.current=!0;let u={x:n.origin.x+o,y:n.origin.y+l},Y=1+Math.min(p/200,1);g({center:u,scale:Y});let h=c.size*Y/2,_=Math.max(0,Math.min(u.x+h,innerWidth)-Math.max(u.x-h,0)),J=Math.max(0,Math.min(u.y+h,innerHeight)-Math.max(u.y-h,0));if(_*J<h*h*2)b.current=null,r.currentTarget.releasePointerCapture(r.pointerId),D(u)},onPointerUp:(r)=>{let n=b.current;if(b.current=null,!n||!w.current)return;let o=r.clientX-n.start.x,l=r.clientY-n.start.y,p=r.clientX>=n.rect.left&&r.clientX<=n.rect.right&&r.clientY>=n.rect.top&&r.clientY<=n.rect.bottom,u=n.rtl?r.clientX>n.edge:r.clientX<n.edge;if(!p&&u&&Math.hypot(o,l)>=200)D({x:n.origin.x+o,y:n.origin.y+l});else g(null)},onPointerCancel:()=>{b.current=null,g(null),w.current=!0},children:L(!1)},void 0,!1,void 0,this),f&&m&&k(i("div",{className:"pointer-events-none fixed z-[9999]",style:{left:f.center.x-c.size/2,top:f.center.y-c.size/2,width:c.size,height:c.size,transform:`scale(${f.scale})`},children:L(!0)},void 0,!1,void 0,this),document.body),S&&k(i("div",{className:"alwith-vibemon-burst pointer-events-none fixed z-[10000]",style:{left:S.x,top:S.y,width:280,height:280,transform:"translate(-50%, -50%) scale(0.7142857)"},onAnimationEnd:()=>X(null)},void 0,!1,void 0,this),document.body),T&&i("div",{role:"alert",className:"bg-popover text-popover-foreground absolute inset-x-2 bottom-36 z-30 rounded-lg p-2 text-xs",children:[T,i(t,{size:"sm",variant:"outline",onClick:()=>W((r)=>r+1),children:A("vibemon.updateResources")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{Ht};
@@ -0,0 +1,2 @@
1
+ import{r,n}from"./chunk-rerywpwe.js";import{e}from"./chunk-htw56xtp.js";import{w,u,Mt,R}from"./chunk-01py4vpp.js";var s={pet:"",enabled:!1,position:null};function a(){let t=e().account();return t===null?null:r(t)}function X(){let t=a();return t===null?s:u("vibemon.accounts")[t]??s}var Z=()=>Promise.try(()=>X());async function h(t){let o=e(),l=o.account(),c=a();if(l===null||c===null)throw Error("Sign in to use Vibemon");if(t.pet!==void 0){let i=u("vibemon.accounts");Mt("vibemon.accounts",{...i,[c]:{...i[c]??s,pet:t.pet}});try{await o.assets.selection.select(t.pet||null)}finally{await w()}}n(o,l);let{enabled:p,position:f}=t;if(p!==void 0||f!==void 0){let i=u("vibemon.accounts");await R("vibemon.accounts",{...i,[c]:{...i[c]??s,...p!==void 0?{enabled:p}:{},...f!==void 0?{position:f}:{}}})}n(o,l)}async function de(t,o){if(o||X().pet==="")await h({pet:t})}
2
+ export{a,X,Z,h,de};
@@ -0,0 +1,2 @@
1
+ var n=null,i=new Set;function Wt(e){n=e;for(let o of i)o(e)}function ft(){let e=n;return n=null,e}function gt(e){return i.add(e),()=>{i.delete(e)}}
2
+ export{Wt,ft,gt};
@@ -0,0 +1,2 @@
1
+ class bt{surfaces={main:{sessionId:null,visible:!1},chat:{sessionId:null,visible:!1}};selectedWindow=null;target(){if(this.selectedWindow!==null){let e=this.surfaces[this.selectedWindow].sessionId;if(e!==null)return e;this.selectedWindow=null}return this.surfaces.chat.sessionId??this.surfaces.main.sessionId}surface(e,s){this.surfaces[e]=s,this.target()}select(e){if(this.surfaces.chat.sessionId===e)this.selectedWindow="chat";else if(this.surfaces.main.sessionId===e)this.selectedWindow="main";else throw Error("The conversation is no longer current")}collapse(e){this.surfaces.chat={...this.surfaces.chat,sessionId:e},this.selectedWindow=null}reset(){this.selectedWindow=null}}
2
+ export{bt};
@@ -0,0 +1,2 @@
1
+ import{me,Pt,_t}from"./chunk-pe1mn10v.js";import{E}from"./chunk-wa475kmq.js";import{c,W,j,f,g,Y,l}from"./chunk-tvmvzc41.js";import{o}from"./chunk-xrw9s1th.js";import{t}from"./chunk-mjsqb1wk.js";import{M}from"./chunk-wfsdbf7j.js";import{N}from"./chunk-j2922k42.js";import{Fe}from"./chunk-g8nah79y.js";import{A,Te}from"./chunk-pwsarey8.js";import{motion as H}from"motion/react";import{useEffect as R,useMemo as K,useState as y}from"react";import{jsxDEV as e}from"react/jsx-dev-runtime";var X="linear-gradient(180deg, #0C0C77 1.7234%, #171B6A 25.125%, #A67FFB 97.583%, #957FFB 116.28%)",J=250,Q={1:{default:"bg-[#82D6EB]",hover:"bg-[#A3E1F0]",press:"bg-[#5AC8E3]"},10:{default:"bg-[#FFD932]",hover:"bg-[#FFE46B]",press:"bg-[#FACE0B]"}};function V({drawCount:a,price:n,onClick:m,disabled:d,label:p}){let h=a===1,[P,b]=y(!1),[w,s]=y(!1),i=w?"press":P?"hover":"default",v=h?`X ${n}`:`X ${n}`;return e(t,{className:"relative h-[8.5cqh] w-full overflow-visible rounded-none border-0 bg-transparent p-0 shadow-none transition-none hover:bg-transparent active:translate-y-0 disabled:opacity-45","aria-label":p,disabled:d,"data-visual-state":i,onPointerEnter:()=>b(!0),onPointerLeave:()=>{b(!1),s(!1)},onPointerDown:()=>s(!0),onPointerUp:()=>s(!1),onPointerCancel:()=>s(!1),onKeyDown:(x)=>{if(x.key===" "||x.key==="Enter")s(!0)},onKeyUp:(x)=>{if(x.key===" "||x.key==="Enter")s(!1)},onBlur:()=>{b(!1),s(!1)},onClick:m,children:[e("span",{className:"absolute top-[2.092cqh] left-0 h-[6.408cqh] w-full overflow-hidden rounded-[6.25cqw] drop-shadow-[0_0.417cqh_0_rgba(0,0,0,0.51)]",children:[e("span",{"data-slot":"pull-button-surface",className:o("absolute inset-0",Q[a][i])},void 0,!1,void 0,this),e("img",{src:c,alt:"",className:o("pointer-events-none absolute top-[-560.71%] left-[-20.34%] h-[741.76%] w-[160.31%] max-w-none select-none",h?"opacity-68 mix-blend-soft-light":"opacity-18 mix-blend-color-burn")},void 0,!1,void 0,this),e("span",{className:"absolute inset-0 shadow-[inset_0_0.2cqh_0.07cqh_0_white]"},void 0,!1,void 0,this),e("span",{"data-slot":"pull-button-label",className:"absolute inset-0 flex items-center justify-center text-[1.458cqw] leading-normal font-normal text-[#403C80]",style:{fontFamily:'"Grow Year", system-ui, sans-serif',WebkitTextStroke:"0.25cqw white",paintOrder:"stroke fill"},children:["PULL X",a]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e("span",{className:"absolute top-0 left-1/2 flex h-[4.422cqh] -translate-x-1/2 items-center whitespace-nowrap",children:[e("span",{className:"me-[-0.375cqw] flex size-[2.763cqw] shrink-0 items-center justify-center",children:e("img",{"data-testid":"pull-button-gem",src:W,alt:"",className:"size-[1.682cqw] max-w-none -scale-y-100 rotate-[21.86deg] select-none"},void 0,!1,void 0,this)},void 0,!1,void 0,this),e("span",{"data-slot":"pull-button-price","data-text":v,className:"relative scale-y-98 -skew-x-10 text-[1cqw] leading-normal font-semibold tracking-[0.1cqw] text-transparent before:absolute before:inset-0 before:text-white before:content-[attr(data-text)] before:[-webkit-text-stroke:0.25cqw_#FFFFFF] after:absolute after:inset-0 after:bg-gradient-to-b after:from-[#9645CF] after:to-[#878FFF] after:bg-clip-text after:text-transparent after:content-[attr(data-text)]",style:{fontFamily:'"PingFang SC", sans-serif'},children:v},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=["unselected","hover","selected"],ee=(a,n)=>n==="selected"?a.sidebarSelectedImageUrl:n==="hover"?a.sidebarHoverImageUrl:a.sidebarUnselectedImageUrl;function te({pool:a,selected:n,disabled:m,onSelect:d}){let[p,h]=y(!1),[P,b]=y(!1),w=n?"selected":p||P?"hover":"unselected";return e(t,{id:`pool-tab-${a.poolUuid}`,role:"tab","aria-selected":n,"aria-controls":"gacha-pool-banner","aria-label":a.name,disabled:m,onClick:d,onPointerEnter:()=>h(!0),onPointerLeave:()=>h(!1),onFocus:()=>b(!0),onBlur:()=>b(!1),"data-visual-state":w,className:o("relative h-[14.167cqh] w-full shrink-0 justify-start overflow-visible rounded-none border-0 bg-transparent p-0 shadow-none transition-none hover:bg-transparent active:translate-y-0 disabled:opacity-100",n?"z-20":"z-0"),children:Z.map((s)=>e("img",{src:ee(a,s)||l,alt:"","aria-hidden":!0,className:o("pointer-events-none absolute bottom-0 left-0 h-auto w-full max-w-none select-none",w===s?"opacity-100":"opacity-0")},s,!1,void 0,this))},void 0,!1,void 0,this)}function ae(a,n){if(n==="UPCOMING"){if(a.startsAt===null)throw Error(`Upcoming gacha pool ${a.poolUuid} is missing startsAt`);return{label:"Starts in",at:a.startsAt}}if(n==="ACTIVE"&&a.endsAt!==null)return{label:"Time remaining",at:a.endsAt};return null}function oe({pool:a,status:n,nowMs:m}){let d=ae(a,n);if(d===null)return null;let p=Math.floor((Date.parse(d.at)-m)/1000),h=Math.floor(p/86400),P=Math.floor(p%86400/3600),b=Math.floor(p%3600/60),w=p%60,s=[{value:h,unit:"d"},{value:P,unit:"h"},{value:b,unit:"m"},{value:w,unit:"s"}];return e("div",{role:"timer","aria-label":d.label,className:"absolute bottom-[6.8%] left-[4.4%] flex min-w-[28%] items-center gap-[1.5%] rounded-lg bg-black/24 px-[1.2%] py-[0.8%] text-white backdrop-blur-sm",children:s.map(({value:i,unit:v})=>e("span",{className:"flex items-center gap-[0.35em]",children:[e("span",{className:"min-w-[2.1em] rounded-md bg-black/28 px-[0.35em] py-[0.25em] text-center text-[clamp(9px,0.82cqw,16px)] leading-none font-bold tabular-nums",children:String(i).padStart(2,"0")},void 0,!1,void 0,this),e("span",{className:"text-[clamp(8px,0.58cqw,12px)] font-medium text-white/75",children:v},void 0,!1,void 0,this)]},v,!0,void 0,this))},void 0,!1,void 0,this)}function le(a,n){let m=a.find((d)=>d.poolUuid===n);if(m!==void 0)return m;return _(a)}function _(a){let n=a[0];if(n===void 0)throw Error("Gacha pool catalog has no visible pools");return n}function Ve({onBack:a,onAlbum:n,onEquip:m,isFirstDraw:d,onSingleDraw:p,onMultiDraw:h,drawDisabled:P,albumHasUnseen:b,availablePoints:w,pointsLoaded:s,guideActive:i,poolCatalog:v}){let[x,k]=y(!1),[D,z]=y(_(v.pools).poolUuid),[U,I]=y(Date.now);R(()=>{let u=window.setInterval(()=>I(Date.now()),1000);return()=>window.clearInterval(u)},[]);let C=K(()=>_t(v.pools,U),[v.pools,U]),S=Pt(C),r=i?S:le(C,D),F=me(r,U),B=d&&r.poolUuid===S.poolUuid,G=r.singlePrice,T=P||!r.canDraw||F!=="ACTIVE",O=()=>{if(!B&&s&&w<G){k(!0);return}p(r.poolUuid)},L=()=>{if(s&&w<r.multiPrice){k(!0);return}h(r.poolUuid)};return e("div",{className:"[container-type:size] relative h-full w-full overflow-hidden",style:{background:X},children:[e("div",{className:"absolute inset-0 flex items-center justify-center",children:e("div",{"data-testid":"vibemon-pull-stage",className:"[container-type:size] relative",style:{width:"min(100cqw, 160cqh)",aspectRatio:"8 / 5"},children:[e("div",{"aria-hidden":!0,className:"pointer-events-none absolute top-[-51.213%] left-[48.958%] h-[172.145%] w-[143.454%] -translate-x-1/2",children:[e("img",{"data-testid":"vibemon-pool-page-background",src:j,alt:"",className:"absolute inset-0 h-full w-full max-w-none object-cover opacity-60 mix-blend-color-burn select-none"},void 0,!1,void 0,this),e("div",{className:"absolute inset-0 bg-black/40"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e(M,{onClick:a,disabled:i,label:"Back",iconSrc:f,className:"absolute top-[5%] left-[6.25%] z-10 gap-[0.729cqw] text-[#BCACE0] hover:text-[#BCACE0] [&_img]:size-[3.021cqw] [&_span]:text-[1.667cqw]"},void 0,!1,void 0,this),e("div",{className:"absolute top-[5%] right-[6.25%] z-10 flex h-[5.5cqh] items-center gap-[2.292cqw]",children:[e(t,{"aria-label":"Vibémon",disabled:i,onClick:m,className:"size-[3.333cqw] bg-transparent p-0 hover:bg-transparent",children:e("img",{src:g,alt:"",className:"size-full object-contain"},void 0,!1,void 0,this)},void 0,!1,void 0,this),e(t,{"aria-label":"Album",disabled:i,onClick:n,className:"relative size-[3.333cqw] bg-transparent p-0 hover:bg-transparent",children:[e("img",{src:Y,alt:"",className:"size-full object-contain"},void 0,!1,void 0,this),b&&e("span",{className:"absolute top-0 right-0 size-2 rounded-full bg-[#F74640]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e(N,{amount:w,onAdd:E,loaded:s,disabled:i,className:"h-[5.5cqh] min-w-0 rounded-[7.813cqw] py-0 pr-[0.417cqw] pl-[0.729cqw] [&_[data-slot=gem-balance-add-icon]]:size-[2.5cqw] [&>[data-slot=gem-balance-add]]:ms-[1.094cqw] [&>[data-slot=gem-balance-add]]:size-[2.5cqw] [&>[data-slot=gem-balance-amount]]:text-[1.563cqw] [&>[data-slot=gem-balance-icon]]:me-[0.156cqw] [&>[data-slot=gem-balance-icon]]:size-[2.5cqw]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e("div",{role:"tablist","aria-label":"Card pools",className:"absolute top-[19.816%] left-[6.25%] flex w-[12.5%] flex-col",children:C.map((u)=>e(te,{pool:u,selected:u.poolUuid===r.poolUuid,disabled:i||P,onSelect:()=>z(u.poolUuid)},u.poolUuid,!1,void 0,this))},void 0,!1,void 0,this),e("div",{id:"gacha-pool-banner",role:"tabpanel","aria-labelledby":`pool-tab-${r.poolUuid}`,className:"absolute top-[16.667%] left-[14.583%] z-10 h-[66.667%] w-[79.167%] overflow-hidden rounded-[1.042cqw]",children:[C.map((u)=>{let q=u.poolUuid===r.poolUuid;return e(H.img,{src:u.poolCardImageUrl||l,alt:q?`${u.name} pool`:"","aria-hidden":!q,className:"absolute inset-0 h-full w-full object-cover select-none",style:{zIndex:q?1:0},initial:!1,animate:{opacity:q?1:0},transition:{duration:J/1000,ease:q?"easeOut":"easeIn"}},u.poolUuid,!1,void 0,this)}),e(oe,{pool:r,status:F,nowMs:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e("div",{className:"absolute top-[86.098%] left-[54.427%] flex gap-[2.24cqw]",children:[e("div",{className:o("w-[18.542cqw]",i&&"relative z-30"),children:e(V,{drawCount:1,price:G,label:"Pull once",disabled:T,onClick:O},void 0,!1,void 0,this)},void 0,!1,void 0,this),e("div",{className:"w-[18.542cqw]",children:e(V,{drawCount:10,price:r.multiPrice,label:"Pull ten times",disabled:i||B||T,onClick:L},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i&&e(A,{},void 0,!1,void 0,this),i&&e(Te,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),x&&e(Fe,{onClose:()=>k(!1),onProceed:()=>{E(),k(!1)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{Ve};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";var fe=()=>e().windows.call("monitors"),b=()=>({outerPosition:()=>e().windows.call("position"),outerSize:()=>e().windows.call("size"),scaleFactor:()=>e().windows.call("scale")}),J=(o,n)=>e().windows.call("move",{x:o,y:n});
2
+ export{fe,b,J};
@@ -0,0 +1,2 @@
1
+ import{useCallback as G,useEffect as V,useRef as o,useState as Y}from"react";import{jsxDEV as q}from"react/jsx-dev-runtime";function I({config:e,spriteUrl:w,stateId:L,flipped:P,active:p,staticImage:a,animTick:z,onFirstFrame:C,onDrawFrame:E,onRenderError:g,onMouseDown:W,onClick:X}){let R=o(null),u=o(0),n=o(null),y=o(null),s=o(!1),[D,F]=Y(!1),c=e.states.find((r)=>r.id===L),S=c?.row??0,h=c?.frames??1,H=c?.fps??3,v=c?.loop??!0,M=o(C);M.current=C;let x=o(E);x.current=E;let k=o(g);k.current=g;let b=G((r,t)=>{let T=R.current,i=y.current;if(!T||!i)return;let l=T.getContext("2d");if(!l)return;l.imageSmoothingEnabled=!1,l.clearRect(0,0,e.renderSize,e.renderSize);let d=a?i.naturalWidth:e.cropW,f=a?i.naturalHeight:e.cropH,m=e.renderSize/Math.max(d,f);l.drawImage(i,a?0:r*e.frameSize+e.cropX,a?0:t*(e.frameHeight??e.frameSize)+e.cropY,d,f,(e.renderSize-d*m)/2,(e.renderSize-f*m)/2,d*m,f*m),x.current?.()},[e,a]);return V(()=>{let r=!1;s.current=!1,F(!1);let t=new Image;return t.onload=()=>{if(r)return;y.current=t,F(!0)},t.onerror=()=>{if(!r)k.current?.(Error("Vibemon spritesheet could not be decoded"))},t.src=w,()=>{r=!0,t.onload=null,t.onerror=null}},[w]),V(()=>{if(!D||!p&&s.current)return;let r=R.current;if(!r)return;if(r.dataset.animationGeneration=String(z??0),n.current)clearInterval(n.current);if(u.current=0,b(0,S),!s.current)s.current=!0,M.current?.();if(!p)return;return n.current=setInterval(()=>{if(u.current++,u.current>=h){if(u.current=v?0:h-1,!v&&n.current)clearInterval(n.current),n.current=null}b(u.current,S)},1000/H),()=>{if(n.current)clearInterval(n.current)}},[S,h,H,v,z,D,p,b]),q("canvas",{ref:R,width:e.renderSize,height:e.renderSize,onMouseDown:(r)=>{if(r.button!==0)return;r.preventDefault(),W()},onClick:(r)=>{if(r.button!==0)return;X()},style:{width:"100%",height:"100%",imageRendering:"pixelated",transform:P?"scaleX(-1)":void 0,cursor:"pointer",pointerEvents:"auto"}},void 0,!1,void 0,this)}
2
+ export{I};
File without changes
@@ -0,0 +1,2 @@
1
+ async function wt(e,i,n){let t=await e.wait(n,Date.now()+15000);await t.presentAt(async()=>(t.resume(),e.requireFreshFrame(n),await e.wait(n,Date.now()+15000),e.assertReady(n,t),await i.call("present"),i.call("position")))}
2
+ export{wt};
@@ -0,0 +1,2 @@
1
+ var n=new Map;function s(e){let t=n.get(e);if(t)return n.delete(e),n.set(e,t),t;let o=new Image;o.src=e;let i=o.decode().then(()=>o).catch((a)=>{if(n.get(e)===i)n.delete(e);throw Error(`[vibemon] preload failed: ${e}`,{cause:a})});if(n.set(e,i),n.size>64)n.delete(n.keys().next().value);return i}async function ve(e,t){let o=0;await Promise.all(e.map(async(i)=>{await s(i),t(++o)}))}
2
+ export{ve};
@@ -0,0 +1,2 @@
1
+ import{n}from"./chunk-rerywpwe.js";function ye(s){async function e(t,a,c){let o=s.account();if(o===null)throw Error("Sign in to use Vibemon");let i=await s.request(t,a,c);return n(s,o),i}let r=!1;return{getVibemonDetail:(t)=>e(`/api/v1/vibemons/${encodeURIComponent(t)}`,"GET"),getVibemonCatalog:()=>e("/api/v1/vibemons/catalog","GET"),getMyVibemons:(t={})=>{let a=new URLSearchParams;for(let[o,i]of Object.entries(t))if(i!==void 0)a.set(o,String(i));let c=a.size>0?`?${a}`:"";return e(`/api/v1/vibemons/mine${c}`,"GET")},markVibemonFirstVisit:()=>e("/api/v1/vibemons/first-visit","POST"),getGachaFirstDraw:()=>e("/api/v1/gacha/first-draw","GET"),getActiveGachaPools:()=>e("/api/v1/gacha/pools","GET"),getGachaPoolDetail:(t)=>e(`/api/v1/gacha/pools/${encodeURIComponent(t)}`,"GET"),getPointAccount:()=>e("/api/v1/points/account","GET"),async drawGachaPool(t,a){if(r)throw Error("A draw is already pending");r=!0;try{return await e("/api/v1/gacha/draw","POST",{pool_uuid:t,draw_type:a})}finally{r=!1}}}}
2
+ export{ye};
@@ -0,0 +1,2 @@
1
+ import{r,n}from"./chunk-rerywpwe.js";function Re(t,u){let s=Promise.resolve();return{get:async()=>{let e=t.account();if(e===null)return null;let o=await t.storage.get("vibemon.accounts");return n(t,e),o?.[r(e)]?.pet||null},async select(e){let o=t.account();if(o===null)throw Error("Sign in to select a Vibemon");if(e!==null&&!(await u(e)).some((c)=>c.vibemon_uuid===e))throw Error("This account does not own the selected Vibemon");n(t,o);let i=s.catch(()=>{}).then(async()=>{n(t,o);let c=await t.storage.get("vibemon.accounts")??{};n(t,o);let a=r(o);await t.storage.set("vibemon.accounts",{...c,[a]:{...c[a],pet:e??""}}),n(t,o)});s=i,await i}}}
2
+ export{Re};
@@ -0,0 +1,2 @@
1
+ function yt(t,a,e){let n=Math.min(1,Math.max(0,a)),r=Math.min(n,t+Math.max(0,n-t)*12*e);return n===1&&r>=0.999?1:r}
2
+ export{yt};
@@ -0,0 +1,2 @@
1
+ import{Xe,Ze}from"./chunk-tvmvzc41.js";var Me=[{src:Xe,type:"video/mp4"},{src:Ze,type:"video/webm"}];
2
+ export{Me};
@@ -0,0 +1,2 @@
1
+ import{yt}from"./chunk-b5zfgr86.js";import{ot,rt}from"./chunk-tvmvzc41.js";import{p}from"./chunk-w5yer870.js";import{useEffect as w,useRef as u,useState as b}from"react";import{jsxDEV as e}from"react/jsx-dev-runtime";var v=98.902;function ze({progress:o,onFinished:r}){let[i,f]=b(0),s=u(o);s.current=o;let l=u(r);l.current=r,w(()=>{let n=0,c=performance.now(),t=0,m=(d)=>{let g=Math.min((d-c)/1000,0.1);if(c=d,t=yt(t,s.current,g),f(t),t>=1){l.current();return}n=requestAnimationFrame(m)};return n=requestAnimationFrame(m),()=>cancelAnimationFrame(n)},[]);let a=Math.round(i*100);return e(p,{backdrop:e("img",{src:ot,alt:"","aria-hidden":!0,className:"pointer-events-none absolute inset-0 h-full w-full object-cover select-none"},void 0,!1,void 0,this),children:[e("img",{src:rt,alt:"Vibémon",className:"pointer-events-none absolute top-[17.140%] left-[22.049%] h-[56.559%] w-[55.903%] max-w-none select-none"},void 0,!1,void 0,this),e("div",{"data-testid":"vibemon-loading-progress",role:"progressbar","aria-label":`Loading ${a}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,className:"absolute top-[83.050%] left-1/2 flex w-[52.083%] -translate-x-1/2 flex-col gap-[0.625cqw]",children:[e("p",{className:"text-right text-[1.458cqw] leading-normal tracking-[0.08em] text-white",style:{fontFamily:'"Grow Year", system-ui, sans-serif'},children:"LOADING..."},void 0,!1,void 0,this),e("div",{className:"flex flex-col items-center gap-[0.625cqw]",children:[e("div",{className:"relative h-[2.292cqw] w-full rounded-full bg-[#3B138F] shadow-[inset_0_0.052cqw_0.365cqw_0_rgba(0,0,0,0.25)]",children:e("div",{"data-testid":"vibemon-loading-progress-fill",className:"absolute top-[9.091%] left-[0.549%] h-[81.818%] min-w-[3.6%] rounded-full bg-[linear-gradient(180deg,#FFE16C_0%,#FFB638_100%)] shadow-[inset_0_0.208cqw_0.156cqw_0_rgba(255,255,255,0.87)]",style:{width:`${i*v}%`}},void 0,!1,void 0,this)},void 0,!1,void 0,this),e("p",{className:"text-center text-[1.458cqw] leading-normal text-white",style:{fontFamily:'"Grow Year", system-ui, sans-serif'},children:[a,"%"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{ze};
@@ -0,0 +1,2 @@
1
+ function i(n){let e="";for(let r of n)e+=String.fromCharCode(r);return btoa(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function rn(){let n=new Uint8Array(32);return crypto.getRandomValues(n),i(n)}async function sn(n){let e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(n));return i(new Uint8Array(e))}var t=null;function an(n){t=n}function ln(){let n=t;return t=null,n}function un(){t=null}var o=[["OAUTH_SESSION_EXPIRED","signIn.oauthSessionExpired"],["OAUTH_VERIFICATION_FAILED","signIn.oauthVerificationFailed"],["OAUTH_EMAIL_REQUIRED","signIn.oauthEmailRequired"],["OAUTH_IDENTITY_CONFLICT","signIn.oauthIdentityConflict"],["OAUTH_RATE_LIMITED","signIn.tooManyRequests"],["OAUTH_PROVIDER_UNAVAILABLE","signIn.oauthProviderUnavailable"],["OAUTH_CONFIG_UNAVAILABLE","signIn.oauthConfigUnavailable"],["ACCOUNT_DISABLED","signIn.accountDisabled"]];function dn(n){for(let[e,r]of o)if(n.includes(e))return r;return"signIn.signInFailed"}
2
+ export{rn,sn,an,ln,un,dn};
@@ -0,0 +1,2 @@
1
+ import{r}from"./chunk-rerywpwe.js";import{re}from"./chunk-3amxesw3.js";import{e}from"./chunk-htw56xtp.js";import{createStore as h}from"zustand/vanilla";var ee=h(()=>({status:"idle"})),jt=()=>ee.getState().status,Tt=(t)=>ee.setState({status:t}),Yt=(t)=>ee.subscribe((a)=>t(a.status)),i=null;async function te(){let t=e();if(t.synchronizeResources!==void 0)return t.synchronizeResources();let a=t.account();if(a===null)return;let p=`${r(a)}/${a.revision}`,n=()=>{let o=t.account();return o!==null&&`${r(o)}/${o.revision}`===p};if(i?.scope===p)return i.operation;let u=(o)=>{if(n())Tt(o)},y=(o,c)=>{if(!n())return;if(t.onResourceSyncError)t.onResourceSyncError(o,c);else console.warn("[vibemon] resource sync failed",c,o)},d=(async()=>{u("checking");try{let o=await t.assets.getVibemonCatalog();if(!n())return;let c=new Set,S=0,f=!1;if(await Promise.all(Array.from({length:Math.min(6,o.length)},async()=>{while(n()&&S<o.length){let s=o[S++];try{let l=await t.assets.resources.inspect(s.uuid);if(l&&re(l,s))continue;u("updating"),await t.assets.resources.ensure(s),c.add(s.uuid)}catch(l){f=!0,y(l,{phase:"resource",petId:s.uuid})}}})),n())try{await t.resourcesSynchronized?.(c)}catch(s){if(n())t.onError(s)}u(f?"error":c.size===0?"idle":"done")}catch(o){u("error"),y(o,{phase:"catalog"})}})();i={scope:p,operation:d};try{await d}finally{if(i?.operation===d)i=null}}
2
+ export{ee,jt,Tt,Yt,te};
@@ -0,0 +1,2 @@
1
+ function nn(e){let{tokenStorage:d,loadUser:c,saveUser:l,clearAllAuth:f}=e.storage,r=0;return(a,u)=>({user:null,isAuthenticated:!1,isLoading:!0,_initialized:!1,init:()=>{if(u()._initialized)return;a({_initialized:!0}),e.onInit();let t=r;(async()=>{try{let i=await d.getAccess(),n=await d.getRefresh();if(t!==r)return;if(!i||!n){await e.handleUnauthenticated(),a({isLoading:!1});return}let A=e.validateProfile(),s=await c();if(t!==r)return;if(!A){if(s)a({user:s,isAuthenticated:!0}),e.loadProviders();return}if(s)a({user:s,isAuthenticated:!0,isLoading:!1}),e.onSignedIn(s,"restore");e.loadProviders();try{let o=await e.getProfile();if(t!==r)return;let v={user_uuid:o.uuid,nickname:o.nickname,login_email:o.login_email,avatar:o.avatar};a({user:v,isAuthenticated:!0}),await l(v),e.onProfileRestored()}catch{let o=await c();if(t!==r)return;if(o)a({user:o,isAuthenticated:!0});else await f(),e.clearProviders(),a({user:null,isAuthenticated:!1})}if(!s)a({isLoading:!1})}catch(i){console.error("[auth] session restore failed unexpectedly",i)}finally{if(u().isLoading)a({isLoading:!1})}})(),e.subscribeExpired(()=>{r++,e.clearAccountConversation(u().user).then(e.handleUnauthenticated).then((i)=>{if(i)return;a({user:null,isAuthenticated:!1})})}),e.subscribeState((i)=>{if(i.action==="logout")r++,e.clearAccountConversation(u().user).then(e.handleUnauthenticated).then((n)=>{if(n)return;e.clearProviders(),a({user:null,isAuthenticated:!1})});else if(i.action==="login"&&i.user)r++,a({user:i.user,isAuthenticated:!0}),e.loadProviders();else if(i.action==="update"&&i.user)a({user:i.user})})},login:async(t)=>{r++,await d.save(t.access_token,t.refresh_token);let i={user_uuid:t.user_uuid,nickname:t.nickname,login_email:t.login_email};await l(i),a({user:i,isAuthenticated:!0}),e.loadProviders(),await e.broadcast({action:"login",user:i}),e.onSignedIn(i,"login")},logout:async()=>{if(r++,e.clearProviders(),await e.logoutApi(),await e.clearAccountConversation(u().user),await f(),await e.broadcast({action:"logout"}),await e.handleUnauthenticated())return;a({user:null,isAuthenticated:!1})},refreshUser:async()=>{try{let t=await e.getProfile(),i={user_uuid:t.uuid,nickname:t.nickname,login_email:t.login_email,avatar:t.avatar};a({user:i}),await l(i)}catch(t){console.warn("[auth] refreshUser failed",t)}},updateUser:(t)=>{let i=u().user;if(!i)return;let n={...i,...t};a({user:n}),l(n),e.broadcast({action:"update",user:n})}})}
2
+ export{nn};
@@ -0,0 +1,6 @@
1
+ var t={"app-window":`
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 256 256"><path d="M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z" opacity="0.2"/><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H40V56H216V200ZM80,84A12,12,0,1,1,68,72,12,12,0,0,1,80,84Zm40,0a12,12,0,1,1-12-12A12,12,0,0,1,120,84Z"/></svg>
3
+ `,"number-square-one":`
4
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 256 256"><path d="M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z" opacity="0.2"/><path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208ZM140,80v96a8,8,0,0,1-16,0V95l-11.56,7.71a8,8,0,1,1-8.88-13.32l24-16A8,8,0,0,1,140,80Z"/></svg>
5
+ `};function _(n,a){return a?a[n]:t[n==="main"?"number-square-one":"app-window"]}
6
+ export{_};
@@ -0,0 +1 @@
1
+ import{t}from"./chunk-mjsqb1wk.js";import{qe}from"./chunk-v890qhc2.js";import{cva as s}from"class-variance-authority";import{cn as o}from"cn";import{jsxDEV as i}from"react/jsx-dev-runtime";function De({className:r,...a}){return i("div",{"data-slot":"input-group",role:"group",className:o("group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-9 w-full min-w-0 items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",r),...a},void 0,!1,void 0,this)}var p=s("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function Le({className:r,align:a="inline-start",...e}){return i("div",{role:"group","data-slot":"input-group-addon","data-align":a,className:o(p({align:a}),r),onClick:(n)=>{if(n.target.closest("button"))return;n.currentTarget.parentElement?.querySelector("input")?.focus()},...e},void 0,!1,void 0,this)}var l=s("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function V({className:r,type:a="button",variant:e="ghost",size:n="xs",...u}){return i(t,{type:a,"data-size":n,variant:e,className:o(l({size:n}),r),...u},void 0,!1,void 0,this)}function Oe({className:r,...a}){return i(qe,{"data-slot":"input-group-control",className:o("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",r),...a},void 0,!1,void 0,this)}export{De,Le,V,Oe};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";import{Ct}from"./chunk-jampyjt1.js";import{Rt,pe,Et,kt,Vt}from"./chunk-vt1sfk87.js";import{xt,St}from"./chunk-pe1mn10v.js";import{ve}from"./chunk-9h4j75af.js";import{u,be,R}from"./chunk-01py4vpp.js";import{ft,gt}from"./chunk-6t0bw1wy.js";import{s,U,D,L,O,x,q,S,H,G,z,F,c,W,j,f,g,Y}from"./chunk-tvmvzc41.js";import{a,de}from"./chunk-6f02m6jw.js";import{i}from"./chunk-h994ssre.js";import{te}from"./chunk-ctvwa8d3.js";import{$e}from"./chunk-rrhhytq1.js";import{Be}from"./chunk-4mwvph27.js";import{Ie}from"./chunk-3rpgxz1z.js";import{ae,Ae}from"./chunk-hscsc9kx.js";import{ze}from"./chunk-bcyk6es8.js";import{Ne}from"./chunk-m3e7wah7.js";import{Ve}from"./chunk-7pdpmxg2.js";import{Loader2 as to}from"lucide-react";import{useCallback as C,useEffect as I,useRef as N,useState as t}from"react";import{useTranslation as ro}from"react-i18next";import{toast as io}from"sonner";import{jsxDEV as r}from"react/jsx-dev-runtime";var ao=30000,ue=[U,s.vibemon.icon,s.vibemon.hover,s.vibemon.text,s.wish.icon,s.wish.hover,s.wish.text,s.album.icon,s.album.hover,s.album.text,D,L,x],Te=[j,f,g,Y,c,W,z,F,O,q,S,H,x,G],ce=(l)=>{let m=a();return!!(m&&l[m])},me=(l,m)=>{let w=a();if(!w)return;R(l,{...u(l),[w]:m})},fe=(l)=>{let m=a();if(!m)return null;return l[m]??null},lo=(l)=>{let m=a();if(!m)return;R("vibemon.onboardingStep",{...u("vibemon.onboardingStep"),[m]:l})};function zt(){return r("div",{className:"contents",onContextMenu:(l)=>l.preventDefault(),children:r(so,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function so(){let{t:l}=ro("vibemon"),[m,w]=t(()=>{let o=fe(u("vibemon.onboardingStep"));return o==="free-draw"||o==="view-album"?"pull":"home"}),[M,v]=t("idle"),[h,We]=t(()=>fe(u("vibemon.onboardingStep"))),[y,we]=t(!1),[K,J]=t(!1),[A,je]=t([]),[Ke,ge]=t(null),[k,Je]=t(!1),[Q,he]=t(0),[X,Se]=t(!1),[Qe,Xe]=t([]),[Ye,ye]=t(!1),[Z,Ze]=t(null),[Pe,Ee]=t(null),[Re,De]=t({done:0,total:Te.length}),[Le,eo]=t(!1),[P,_]=t(()=>ce(u("vibemon.introSeen"))?"loading":"resolving-intro"),[_e,oo]=t({done:0,total:ue.length}),[Ce,no]=t(null),He=N(!1),T=C((o)=>{We(o),lo(o)},[]),b=C(()=>w("pull"),[]);I(()=>{if(P!=="loading"||He.current)return;He.current=!0,ve(ue,(o)=>{oo({done:o,total:ue.length})}).catch((o)=>{let n=o instanceof Error?o:Error(String(o));no(n)})},[P]);let Oe=N(0),xe=N(!1),ee=N(!1),V=C(async()=>{let o=++Oe.current;try{let n=await Rt();if(o===Oe.current)je(n),Je(!0),ge(null)}catch(n){ge(n instanceof Error?n:Error(String(n))),console.warn("[vibemon] getMyVibemons failed",n)}},[]),Me=N(!1),ke=N(!1),oe=C(async()=>{try{let o=await St();Ee(null);let n=[...new Set([...Te,...xt(o)])],p=!Me.current;if(p)De({done:0,total:n.length});if(await ve(n,(B)=>{if(p)De({done:B,total:n.length})}),Ze(o),p)Me.current=!0,eo(!0)}catch(o){let n=o instanceof Error?o:Error(String(o));console.error("[vibemon] loadGachaPoolCatalog failed",n),Ee(n)}},[]);I(()=>{if(P!=="loading"||ke.current)return;ke.current=!0,oe()},[P,oe]),I(()=>{let o=()=>{pe().then((p)=>{he(p.available_points),Se(!0)}).catch((p)=>console.warn("[vibemon] getPointAccount failed",p))};o();let n=setInterval(o,ao);return window.addEventListener("focus",o),()=>{clearInterval(n),window.removeEventListener("focus",o)}},[]),I(()=>{for(let o of A)new Image().src=i(o.gacha_url??o.cover_url)},[A]);let ne=()=>{if(K)me("vibemon.albumHasUnseen",!1),J(!1);V(),w("album")},E=C(()=>{V(),w("equip")},[V]);I(()=>{if(xe.current)return;xe.current=!0,V(),Promise.all([Et().catch((o)=>(console.warn("[vibemon] getGachaFirstDraw failed",o),{first_draw:!1})),be("vibemon.albumHasUnseen")]).then(([o,n])=>{if(we(o.first_draw),J(ce(n)),!o.first_draw)return;if(fe(u("vibemon.onboardingStep"))==="free-draw"){b();return}T("home-wish"),w("home")}),be("vibemon.introSeen").then((o)=>{if(ce(o)){_("loading");return}return kt().then(({first_visit:n})=>{if(me("vibemon.introSeen",!0),n)w("home"),v("intro"),_("intro");else _("loading")})}).catch((o)=>{console.warn("[vibemon] first-visit check failed",o),_("loading")})},[b,V,T]);let[Ue,qe]=t(!1),re=C((o)=>{if(y&&h==="home-wish")return;if(y&&h==="free-draw"){b();return}if(o==="pull")b();else if(o==="equip")E();else qe(!0)},[y,h,E,b]);if(I(()=>{let o=ft();if(o)re(o);return gt(re)},[re]),I(()=>{if(!Ue||!k)return;if(qe(!1),A.length===0)b();else E()},[Ue,k,A.length,E,b]),Ke!==null)return r("div",{role:"alert",className:"bg-background text-foreground flex h-full flex-col items-center justify-center gap-3 p-6",children:[r("p",{children:l("offline.title")},void 0,!1,void 0,this),r("p",{className:"text-muted-foreground text-sm",children:l("offline.description")},void 0,!1,void 0,this),r("button",{type:"button",className:"rounded-md border px-4 py-2",onClick:()=>void V(),children:l("offline.retry")},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(P==="resolving-intro")return r("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden bg-[#120E18]",children:[r("video",{src:ae,preload:"auto",muted:!0,playsInline:!0,"aria-hidden":!0,className:"pointer-events-none absolute top-0 left-0 h-px w-px opacity-0"},void 0,!1,void 0,this),r(to,{className:"size-10 animate-spin text-white"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(P==="intro")return r("div",{className:"relative h-full w-full overflow-hidden bg-[#120E18]",children:r(Ae,{onVideoStart:()=>v("intro"),onDone:()=>{v("idle"),_("loading")}},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Ce!==null)throw Ce;if(Pe!==null)throw Pe;if(P==="loading"){let o=_e.done+Re.done+(Z===null?0:1)+(Le?1:0),n=_e.total+Re.total+2;return r("div",{className:"relative h-full w-full overflow-hidden",children:r(ze,{progress:o/n,onFinished:()=>_("ready")},void 0,!1,void 0,this)},void 0,!1,void 0,this)}if(m==="home")return r(Ie,{onDraw:()=>{if(h==="home-wish")T("free-draw");b()},onBackpack:ne,onEquip:E,guideActive:y&&h==="home-wish"},void 0,!1,void 0,this);if(m==="equip")return r(Be,{onBack:()=>w("home"),onWish:b,onAlbum:ne,albumHasUnseen:K,ownedCards:A,ownedLoaded:k,availablePoints:Q,pointsLoaded:X},void 0,!1,void 0,this);if(m==="album")return r($e,{onBack:()=>w("home"),onWish:b,onEquip:E,ownedCards:A,ownedLoaded:k,availablePoints:Q,pointsLoaded:X},void 0,!1,void 0,this);if(Z===null||!Le)throw Error("[vibemon] app entered ready state before gacha resources were loaded");let Ge=async(o,n)=>{if(ee.current||M!=="idle")return;ee.current=!0,ye(!0);try{let p;try{p=await Vt(o,n)}catch(d){console.warn("[vibemon] drawGachaPool failed",d),io.error(l("draw.failedNetwork"));return}let B=n==="SINGLE"?1:10;if(p.results.length!==B)throw Error(`[vibemon] ${n} draw response must contain ${B} results, received ${p.results.length}`);await Promise.all(p.results.map(async(d)=>{if(d.reward_type==="WHITE_CARD"||!d.vibemon_uuid)return;Object.assign(d,await e().assets.resolveImages(d.vibemon_uuid))}));let Fe=p.results.map(Ct),ie=[];for(let[d,le]of p.results.entries()){if(le.reward_type==="WHITE_CARD")continue;ie.push(le);let se=Fe[d];if(se?.kind!=="card")throw Error(`[vibemon] draw result ${le.draw_index} was not mapped to a Vibemon card`);new Image().src=i(n==="SINGLE"?se.singleImageUrl:se.multiImageUrl)}if(Xe(Fe),we(!1),h==="free-draw")T("view-album");if(v("video-waiting"),ie.length>0){let d=ie[0];if(d===void 0)throw Error("[vibemon] draw result lost its first Vibemon item");te(),de(d.vibemon_uuid,y),V()}oe(),pe().then((d)=>{he(d.available_points),Se(!0)}).catch((d)=>console.warn("[vibemon] getPointAccount failed",d))}finally{ee.current=!1,ye(!1)}};return r("div",{className:"relative h-full w-full",children:[r(Ve,{onBack:()=>w("home"),onAlbum:ne,onEquip:E,isFirstDraw:y,availablePoints:Q,pointsLoaded:X,onSingleDraw:(o)=>void Ge(o,"SINGLE"),onMultiDraw:(o)=>void Ge(o,"MULTI"),drawDisabled:Ye||M!=="idle",albumHasUnseen:K,guideActive:y&&h==="free-draw",poolCatalog:Z},void 0,!1,void 0,this),M!=="intro"&&r(Ne,{phase:M,drawnRewards:Qe,onVideoStarted:()=>v("video-playing"),onPullDone:()=>v("result"),onPullFailed:()=>v("result"),onResultConfirmed:(o)=>{if(o)me("vibemon.albumHasUnseen",!0),J(!0);v("idle")}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{zt};
@@ -0,0 +1,2 @@
1
+ function mn({publicPost:i,apiPost:g,platform:r,arch:a,getDeviceId:u,onLogoutError:d,logInfo:h}){async function l(e,n="LOGIN"){await i("/api/v1/auth/send-code",{login_type:"EMAIL",email:e,purpose:n})}async function m(e,n){let[t,s,o]=await Promise.all([r(),a(),u()]);return i("/api/v1/auth/login",{email:e,code:n,login_type:"EMAIL",client_type:"DESKTOP",client_name:`Tauri-${t}-${s}`,device_id:o})}async function O(e,n){let[t,s,o]=await Promise.all([r(),a(),u()]);return i("/api/v1/auth/login",{email:e,password:n,login_type:"PASSWORD",client_type:"DESKTOP",client_name:`Tauri-${t}-${s}`,device_id:o})}async function P(e){return i("/api/v1/auth/email-exists",{email:e})}async function v(e,n,t){let[s,o,c]=await Promise.all([r(),a(),u()]);return i("/api/v1/auth/register",{email:e,code:n,password:t,client_type:"DESKTOP",client_name:`Tauri-${s}-${o}`,device_id:c})}async function y(){try{await g("/api/v1/auth/logout")}catch(e){d(e)}}function S(e){switch(e){case"macos":return"MACOS";case"windows":return"WINDOWS";case"linux":return"LINUX";default:throw Error(`unsupported desktop platform for OAuth: ${e}`)}}async function _(e,n,t){let[s,o,c]=await Promise.all([r(),a(),u()]),p={provider:e,client_type:"DESKTOP",platform:S(s),return_target:"APP_LOGIN",client_name:`Tauri-${s}-${o}`,device_id:c,client_code_challenge:n,...t!==void 0?{loopback_port:t}:{}};return h(`[oauth] POST /api/v1/auth/oauth/sessions request: ${JSON.stringify(p)}`),i("/api/v1/auth/oauth/sessions",p)}async function f(e,n){return i("/api/v1/auth/oauth/tickets/exchange",{ticket:e,client_code_verifier:n})}async function A(){return g("/api/v1/sso/otp")}async function R(e){return i("/api/v1/sso/exchange",{otp:e,client_type:"DESKTOP"})}return{sendVerificationCode:l,loginWithCode:m,loginWithPassword:O,emailExists:P,register:v,logoutApi:y,createOAuthSession:_,exchangeOAuthTicket:f,getSsoOtp:A,exchangeSsoCode:R}}
2
+ export{mn};
@@ -0,0 +1,2 @@
1
+ function Bt(n,o,x,u,r,k){let e=n+x,c=o+u,l=n+x/2;r=Math.min(r,x/2,u/2);let t=r*0.5522847498307936;return[{kind:"move",x:n+r,y:o},{kind:"line",x:e-r,y:o},{kind:"curve",control1X:e-r+t,control1Y:o,control2X:e,control2Y:o+r-t,x:e,y:o+r},{kind:"line",x:e,y:c-r},{kind:"curve",control1X:e,control1Y:c-r+t,control2X:e-r+t,control2Y:c,x:e-r,y:c},{kind:"line",x:l+k,y:c},{kind:"line",x:l+1,y:c+k-1},{kind:"curve",control1X:l+0.5,control1Y:c+k-0.5,control2X:l-0.5,control2Y:c+k-0.5,x:l-1,y:c+k-1},{kind:"line",x:l-k,y:c},{kind:"line",x:n+r,y:c},{kind:"curve",control1X:n+r-t,control1Y:c,control2X:n,control2Y:c-r+t,x:n,y:c-r},{kind:"line",x:n,y:o+r},{kind:"curve",control1X:n,control1Y:o+r-t,control2X:n+r-t,control2Y:o,x:n+r,y:o},{kind:"close"}]}function Ut(n){return n.map(y).join(" ")}function y(n){switch(n.kind){case"move":return`M${n.x},${n.y}`;case"line":return`L${n.x},${n.y}`;case"curve":return`C${n.control1X},${n.control1Y} ${n.control2X},${n.control2Y} ${n.x},${n.y}`;case"close":return"Z"}}function Dt(n,o){return n.map((x)=>b(x,o))}function b(n,o){switch(n.kind){case"move":case"line":return{kind:n.kind,x:n.x*o,y:n.y*o};case"curve":return{kind:"curve",control1X:n.control1X*o,control1Y:n.control1Y*o,control2X:n.control2X*o,control2Y:n.control2Y*o,x:n.x*o,y:n.y*o};case"close":return n}}
2
+ export{Bt,Ut,Dt};
@@ -0,0 +1,2 @@
1
+ import{Ye,ct,ut}from"./chunk-tvmvzc41.js";import{t}from"./chunk-mjsqb1wk.js";import{useState as a}from"react";import{jsxDEV as o}from"react/jsx-dev-runtime";function Fe({onClose:n,onProceed:s}){return o("div",{className:"absolute inset-0 z-50 flex cursor-default items-center justify-center bg-black/80 p-0",onClick:(e)=>{if(e.target===e.currentTarget)n()},onKeyDown:(e)=>{if(e.key==="Escape")n()},children:o("div",{className:"relative",children:[o("img",{src:ct,alt:"",className:"pointer-events-none max-w-none select-none",style:{width:326.24,height:201.03}},void 0,!1,void 0,this),o(t,{variant:"ghost",className:"absolute h-auto p-0 hover:bg-transparent",style:{top:-7.07,right:-11.3},onClick:n,children:o("img",{src:ut,alt:"",className:"max-w-none select-none",style:{width:26,height:26}},void 0,!1,void 0,this)},void 0,!1,void 0,this),o(i,{onClick:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function i({onClick:n}){let[s,e]=a("default");return o(t,{variant:"ghost",className:"absolute h-auto -translate-x-1/2 p-0 hover:bg-transparent",style:{bottom:30,left:"50%"},title:"",onClick:n,onMouseEnter:()=>e("hover"),onMouseLeave:()=>e("default"),onMouseDown:()=>e("active"),onMouseUp:()=>e("hover"),children:o("img",{src:Ye[s],alt:"",className:"max-w-none select-none",style:{width:144,height:36}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
2
+ export{Fe};
@@ -0,0 +1,2 @@
1
+ import{ke}from"./chunk-2j5re92x.js";var i=new Set(["Antarctica","Australia","Pacific/Auckland","Pacific/Chatham","Pacific/Fiji","Pacific/Noumea","Pacific/Port_Moresby","Pacific/Guadalcanal","Pacific/Tongatapu","Pacific/Apia","Pacific/Tahiti","America/Sao_Paulo","America/Argentina","America/Santiago","America/Montevideo","America/Asuncion","America/La_Paz","America/Lima","America/Recife","America/Bahia","America/Cuiaba","America/Campo_Grande","Africa/Johannesburg","Africa/Maputo","Africa/Windhoek","Africa/Harare","Africa/Lusaka","Africa/Gaborone","Africa/Luanda","Africa/Dar_es_Salaam","Indian/Antananarivo","Indian/Mauritius","Indian/Reunion"]);function r(){let a=Intl.DateTimeFormat().resolvedOptions().timeZone;if(!a)return"north";let e=a.split("/")[0];if(i.has(a)||i.has(e))return"south";let n=a.split("/").slice(0,2).join("/");return i.has(n)?"south":"north"}function Ee(){return ke(new Date,r())}
2
+ export{Ee};
@@ -0,0 +1,2 @@
1
+ import{fe,b,J}from"./chunk-7y7stqn0.js";var o=60000,h=24,a=90;class K{currentBehavior="idle";flipped=!1;position={x:200,y:200};targetPosition=null;screenBounds={x:0,y:0,width:1920,height:1080};behaviorTimer=null;sleepTimer=null;moveTimerId=null;isDragging=!1;isPresenting=!1;isHatching=!1;destroyed=!1;suspended=!1;behaviorBeforeDrag="idle";working=!1;sessionAnimation=null;onStateChange;onNotification;config;constructor(i,e,t){this.config=i,this.onStateChange=e,this.onNotification=t}stateOf(i){return this.config.behaviorMap[i]??this.config.behaviorMap.idle}async start(i){if(await this.updateScreenBounds(),i===void 0){let e=await b().outerPosition();this.position={x:e.x,y:e.y}}else if(i){let e=await b().outerSize();if((await fe()).some((n)=>i.x+e.width>n.position.x&&i.x<n.position.x+n.size.width&&i.y+e.height>n.position.y&&i.y<n.position.y+n.size.height))this.position={x:i.x,y:i.y};else{let n=this.screenBounds.x+this.screenBounds.width-e.width,r=this.screenBounds.y+this.screenBounds.height-e.height;this.position={x:Math.min(Math.max(i.x,this.screenBounds.x),n),y:Math.min(Math.max(i.y,this.screenBounds.y),r)}}await J(this.position.x,this.position.y)}else{let e=await b().outerSize(),t=await b().scaleFactor(),s=Math.round(h*t),n=Math.round(a*t);this.position={x:this.screenBounds.x+this.screenBounds.width-e.width-s,y:this.screenBounds.y+this.screenBounds.height-e.height-n},await J(this.position.x,this.position.y)}if(this.setBehavior("idle"),this.sessionAnimation!==null)this.applySessionAnimation();this.resetSleepTimer()}destroy(){if(this.destroyed=!0,this.behaviorTimer)clearTimeout(this.behaviorTimer);if(this.sleepTimer)clearTimeout(this.sleepTimer);if(this.moveTimerId)clearInterval(this.moveTimerId)}suspend(){if(this.suspended=!0,this.cancelMovement(),this.targetPosition=null,this.sleepTimer)clearTimeout(this.sleepTimer);this.sleepTimer=null}resume(){if(this.destroyed)throw Error("Cannot resume a destroyed Vibemon engine");if(this.suspended=!1,this.sessionAnimation!==null)this.applySessionAnimation();else this.setBehavior(this.restBehavior());this.resetSleepTimer()}async presentAt(i){if(this.isDragging||this.isPresenting||this.destroyed)throw Error("Vibemon cannot be presented right now");this.isPresenting=!0,this.cancelMovement(),this.targetPosition=null;try{if(this.position=await i(),this.destroyed)throw Error("Vibemon engine changed during presentation")}finally{if(this.isPresenting=!1,!this.destroyed&&!this.suspended){if(this.sessionAnimation!==null)this.applySessionAnimation();else if(this.currentBehavior!=="wait"&&this.currentBehavior!=="error")this.setBehavior(this.restBehavior());this.resetSleepTimer()}}}restBehavior(){return this.working?"sit":"idle"}setWorking(i){if(this.working===i)return;if(this.working=i,this.destroyed||this.suspended||this.isDragging)return;let e=this.currentBehavior==="idle"||this.currentBehavior==="sit"||this.currentBehavior==="sleep",t=this.restBehavior();if(e&&t!==this.currentBehavior)this.setBehavior(t),this.resetSleepTimer()}setSessionState(i,e,t){let s=this.sessionAnimation;if(s!==null&&s.sessionId===i&&s.state===e&&s.failed===t)return;if(this.sessionAnimation={sessionId:i,state:e,failed:t},this.setWorking(e==="running"&&!t),s!==null&&s.sessionId===i&&s.state==="done"&&e==="idle"&&!t&&this.currentBehavior==="jump"&&this.behaviorTimer!==null)return;if(!this.destroyed&&!this.suspended&&!this.isDragging&&!this.isPresenting)this.applySessionAnimation()}applySessionAnimation(){let i=this.sessionAnimation;if(i===null)throw Error("Session animation requires a Runtime snapshot");let e=i.failed?"task-error":i.state==="running"?"running":i.state==="requires_action"?"info":i.state==="done"?"task-complete":"idle";this.handleNotification({type:e,message:"",sourceWindow:""})}handleNotification(i){if(this.suspended)return;if(this.isHatching)return;if(this.onNotification(i),this.resetSleepTimer(),this.behaviorTimer)clearTimeout(this.behaviorTimer);if(this.currentBehavior==="sleep"){this.setBehavior("scared"),this.behaviorTimer=setTimeout(()=>{if(!this.destroyed&&!this.isDragging&&!this.isPresenting)if(this.sessionAnimation!==null)this.applySessionAnimation();else this.handleNotification(i)},500);return}if(this.cancelMovement(),i.type==="info"){this.setBehavior("wait");return}if(i.type==="task-error"){this.setBehavior(this.config.behaviorMap.error?"error":"wait");return}if(i.type==="running"){this.setBehavior("sit");return}if(i.type==="task-complete"){this.setBehavior("jump");let e=this.config.states.find((s)=>s.id===this.stateOf("jump")),t=e?e.frames/e.fps*1000:800;this.behaviorTimer=setTimeout(()=>{if(!this.destroyed&&!this.isDragging)this.setBehavior(this.restBehavior())},t);return}this.setBehavior(this.restBehavior())}handleClick(){if(this.isHatching)return;this.resetSleepTimer()}dismissError(){if(this.currentBehavior!=="error")return;this.cancelMovement(),this.setBehavior(this.restBehavior()),this.resetSleepTimer()}flipForDirection(i){return this.config.facing==="left"?!i:i}handleDragStart(i){if(this.isPresenting)throw Error("Vibemon presentation is in progress");if(this.isHatching)return;if(this.behaviorBeforeDrag=this.currentBehavior,this.isDragging=!0,this.cancelMovement(),this.resetSleepTimer(),i!==void 0)this.flipped=this.flipForDirection(i);this.setBehavior("scared")}setFacing(i){let e=this.flipForDirection(i);if(this.flipped===e)return;this.flipped=e,this.onStateChange(this.stateOf(this.currentBehavior),this.flipped,!1)}handleDragEnd(){if(this.destroyed)return;if(this.isDragging=!1,this.cancelMovement(),this.flipped=!1,this.sessionAnimation!==null)this.applySessionAnimation();else if(this.behaviorBeforeDrag==="wait"||this.behaviorBeforeDrag==="error")this.setBehavior(this.behaviorBeforeDrag);else this.setBehavior(this.restBehavior());this.syncPositionFromWindow()}debugSpeed=8;setDebugSpeed(i){this.debugSpeed=i}stop(){this.cancelMovement(),this.setBehavior("idle")}debugSetBehavior(i){if(this.cancelMovement(),i in this.config.behaviorMap)this.setBehavior(i);else this.currentBehavior="idle",this.onStateChange(i,this.flipped,!0)}getDebugSpeed(){return this.debugSpeed}async debugRun(){this.cancelMovement(),await this.syncPositionFromWindow();let i=await b().outerSize(),e=[{x:this.screenBounds.x,y:this.screenBounds.y},{x:this.screenBounds.x+this.screenBounds.width-i.width,y:this.screenBounds.y},{x:this.screenBounds.x+this.screenBounds.width-i.width,y:this.screenBounds.y+this.screenBounds.height-i.height},{x:this.screenBounds.x,y:this.screenBounds.y+this.screenBounds.height-i.height}],t=0,s=()=>{if(this.destroyed)return;let n=e[t%e.length];t++;let r=n.x-this.position.x;if(Math.abs(r)>1)this.flipped=r<0;this.setBehavior("run"),this.startMovement(n,this.debugSpeed,s)};s()}setBehavior(i){this.currentBehavior=i,this.onStateChange(this.stateOf(i),this.flipped,!0)}async syncPositionFromWindow(){if(this.destroyed)return;let i;try{i=await b().outerPosition()}catch(e){if(this.destroyed)return;throw e}if(this.destroyed)return;this.position={x:i.x,y:i.y}}async updateScreenBounds(){let i=await fe();if(i.length>0){let e=i[0];this.screenBounds={x:e.position.x,y:e.position.y,width:e.size.width,height:e.size.height}}}startMovement(i,e,t){if(this.isPresenting||this.suspended)return;this.cancelMovement(),this.targetPosition=i,this.moveTimerId=setInterval(()=>{if(this.destroyed||this.isDragging||!this.targetPosition||this.currentBehavior!=="run"){if(this.moveTimerId)clearInterval(this.moveTimerId);this.moveTimerId=null;return}let s=this.targetPosition.x-this.position.x,n=this.targetPosition.y-this.position.y,r=Math.hypot(s,n);if(r<e){if(this.position={...this.targetPosition},this.targetPosition=null,this.moveTimerId)clearInterval(this.moveTimerId),this.moveTimerId=null;if(J(this.position.x,this.position.y),t)t();else this.setBehavior("idle");return}this.position.x+=s/r*e,this.position.y+=n/r*e,J(this.position.x,this.position.y)},16)}cancelMovement(){if(this.moveTimerId)clearInterval(this.moveTimerId),this.moveTimerId=null;if(this.behaviorTimer)clearTimeout(this.behaviorTimer),this.behaviorTimer=null}resetSleepTimer(){if(this.sleepTimer)clearTimeout(this.sleepTimer);if(this.suspended)return;this.sleepTimer=setTimeout(()=>{if(!this.destroyed&&!this.isDragging&&this.currentBehavior==="idle")this.cancelMovement(),this.setBehavior("sleep")},o)}}
2
+ export{K};
@@ -0,0 +1,2 @@
1
+ import{l}from"./chunk-tvmvzc41.js";var e=["https://static.alwith.ai/","https://static-alwith-ai-dev.tos-ap-southeast-1.bytepluses.com/"],o="x-tos-process=image/format,webp",n=l;function i(t){if(!t)return n;if(!e.some((s)=>t.startsWith(s)))return t;if(t.includes("x-tos-process="))return t;return`${t}${t.includes("?")?"&":"?"}${o}`}
2
+ export{i};
@@ -0,0 +1,2 @@
1
+ import{Ke}from"./chunk-tvmvzc41.js";import{C}from"./chunk-x61q358n.js";import{jsxDEV as r}from"react/jsx-dev-runtime";var ae=Ke;function Ae({onVideoStart:e,onDone:o}){return r("div",{className:"absolute inset-0 z-50 overflow-hidden",children:r(C,{src:ae,onFirstFrame:e,onComplete:o,onError:o},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
2
+ export{ae,Ae};
@@ -0,0 +1,2 @@
1
+ var i=null;function tn(n){if(i!==null)throw Error("Vibemon already initialized in this window");return i=n,()=>{if(i===n)i=null}}function e(){if(i===null)throw Error("Vibemon has not initialized");return i}function we(n,o){return n.connectionEpoch===o.connectionEpoch&&n.agentId===o.agentId&&n.sessionId===o.sessionId&&n.incarnation===o.incarnation&&n.bindingRevision===o.bindingRevision}
2
+ export{tn,e,we};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";var ht=(o={})=>e().windows.openPet(o);
2
+ export{ht};
@@ -0,0 +1,2 @@
1
+ import{z,F}from"./chunk-tvmvzc41.js";import{o}from"./chunk-xrw9s1th.js";import{t}from"./chunk-mjsqb1wk.js";import{je}from"./chunk-qd5jhh2h.js";import{Loader2 as r}from"lucide-react";import{jsxDEV as a}from"react/jsx-dev-runtime";function N({amount:e,onAdd:s,loaded:l=!0,disabled:n=!1,className:m}){return a(je,{className:o("flex h-11 w-fit min-w-[137px] flex-row items-center gap-0 rounded-full border-0 bg-[#F4EFFF] px-1.5 py-0 ring-0",m),children:[a("img",{"data-slot":"gem-balance-icon",src:z,alt:"",className:"me-0.5 size-8 shrink-0"},void 0,!1,void 0,this),a("span",{"data-slot":"gem-balance-amount",className:"flex-1 text-start text-xl leading-none font-bold text-[#2A3472] tabular-nums",children:l?e:a(r,{className:"size-4 animate-spin text-[#2A3472]/50"},void 0,!1,void 0,this)},void 0,!1,void 0,this),a(t,{"data-slot":"gem-balance-add",variant:"ghost",className:"ms-[14px] size-8 shrink-0 rounded-full p-0 hover:bg-transparent","aria-label":"Add gems",disabled:n,onClick:s,children:a("img",{"data-slot":"gem-balance-add-icon",src:F,alt:"",className:"size-8"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{N};
@@ -0,0 +1,2 @@
1
+ var n=(r)=>{if(r==="R"||r==="SR"||r==="SSR")return r;throw Error(`[vibemon] unsupported draw rarity: ${r}`)},e=(r,a,i)=>{if(r===null)throw Error(`[vibemon] drawn white card at index ${a.draw_index} is missing ${i}`);return r},t=(r)=>({kind:"card",drawIndex:r.draw_index,vibemonUuid:r.vibemon_uuid,vibemonName:r.vibemon_name,singleImageUrl:r.gacha_url??"",multiImageUrl:r.multi_draw_url??"",rarity:n(r.rarity_code),isNew:!r.is_duplicate}),d=(r)=>{if(r==="UC"||r==="C")return r;throw Error(`[vibemon] unsupported white-card rarity: ${r}`)},Ct=(r)=>{if(r.reward_type!=="WHITE_CARD"){if(!r.vibemon_uuid)throw Error("Vibemon draw result is missing its ID");return t(r)}return{kind:"white-card",drawIndex:r.draw_index,rarity:d(r.rarity_code),exchangePoints:r.exchange_points,singleImageUrl:e(r.gacha_url,r,"gacha_url"),multiImageUrl:e(r.multi_draw_url,r,"multi_draw_url")}};
2
+ export{Ct};
@@ -0,0 +1,2 @@
1
+ var n=/^(?=.*[A-Za-z])(?=.*\d)[\x21-\x7E]{8,26}$/;function on(t){return n.test(t)}
2
+ export{on};
@@ -0,0 +1,2 @@
1
+ var r=["SSR","SR","R","UC","C"],n=(e)=>{let t=r.indexOf(e);return t===-1?r.length:t};function Q(e){return[...e].toSorted((t,o)=>n(t.rarity_code)-n(o.rarity_code))}
2
+ export{Q};
File without changes
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";import{K}from"./chunk-gv5he3xg.js";import{he}from"./chunk-mdqxdcxh.js";import{ge}from"./chunk-3vpcfe38.js";import{Lt}from"./chunk-v5akzbxg.js";import{wt}from"./chunk-96emfz6b.js";import{ue}from"./chunk-kwq26qhs.js";import{v}from"./chunk-41jxjz9n.js";import{ce}from"./chunk-1sf9m7x2.js";import{l}from"./chunk-tvmvzc41.js";import{d}from"./chunk-rfxpf1eq.js";import{I}from"./chunk-8nzgysac.js";import{useEffect as x,useEffectEvent as W,useRef as y,useState as u}from"react";import"@alwith/module-auth/pets/lounge-burst.css";import{jsxDEV as E}from"react/jsx-dev-runtime";function Gt(){let i=e(),w=d(),[p,D]=u(null),b=p?.resource??null,[R,T]=u({state:"idle",flipped:!1,tick:0}),[C,S]=u(!0),[V,z]=u(!1),[M,A]=u(0),c=y(null),P=y(0),[o]=u(()=>new ue),[a]=u(()=>new he),[r]=u(()=>new ge((n)=>{i.windows.call("bubble",{visible:n}).catch(i.onError)})),N=W(()=>w.position);x(()=>{if(!w.pet)return;let n=w.pet,t=++P.current;o.begin(n,t),D(null);let f=!1,m=null;return(async()=>{if(m=await v(n),f){m.dispose();return}if(await i.windows.call("resize",{size:m.config.windowSize??ce}),f)return;let s=new K(m.config,(U,X,_)=>{if(f)return;T((O)=>({state:U,flipped:X,tick:O.tick+(_?1:0)}))},()=>{});if(c.current=s,a.attach(s),await s.start(N()),f){s.destroy();return}if(o.positioned(n,t,s),D({resource:m,petId:n,generation:t}),await o.wait(n,Date.now()+15000),!f)await i.windows.call("ready",{petId:n})})().catch((s)=>{if(f||P.current!==t)return;o.fail(n,t,s instanceof Error?s:Error(String(s))),i.onError(s)}),()=>{f=!0,o.invalidate(),a.attach(null),c.current?.destroy(),c.current=null,m?.dispose()}},[w.pet,i,o,a,M]),x(()=>{let n=(t)=>{if(t===null){a.bind(null,!1),r.bind(null,-1);return}a.bind(t.binding.sessionId,t.error!==null,t.binding.bindingRevision),a.update([{sessionId:t.binding.sessionId,state:t.state}],t.source),a.prompt(t.binding.sessionId,t.binding.bindingRevision,t.prompt!==null),r.bind(t.binding.sessionId,t.binding.bindingRevision),r.owner(t.owner),r.update(t.state,t.prompt?.token??null,t.surfaceVisible)};return n(i.sessions.snapshot()),i.sessions.subscribe(n)},[i,a,r]),x(()=>i.windows.commands(async(n)=>{if(n.type==="reload"){if(n.petId!==w.pet)throw Error("The selected pet changed");P.current++,o.reset(),A((t)=>t+1);return}if(n.type==="bubble-open"){r.open();return}if(n.type==="bubble-interact"){r.interact();return}if(n.type==="close"){c.current?.suspend(),S(!1),r.close(),z(!0);try{await i.windows.call("sound"),await new Promise((t)=>setTimeout(t,470)),await i.windows.call("hide")}finally{z(!1)}return}if(n.type==="bubble-close"){r.close();return}if(n.type==="suspend"){c.current?.suspend(),S(!1),r.close(),await i.windows.call("hide");return}S(!0),await wt(o,i.windows,n.petId)}),[i,r,o,w.pet]);let g=y(0),h=y(null);if(b===null)return null;let k=b.config.windowSize??ce;return E("div",{className:"relative flex h-full w-full items-end justify-center select-none",onPointerDown:(n)=>{if(n.button!==0)return;h.current={x:n.screenX,y:n.screenY}},onPointerMove:(n)=>{let t=h.current;if(t===null||Math.hypot(n.screenX-t.x,n.screenY-t.y)<4)return;if(h.current=null,c.current===null)throw Error("The pet engine is unavailable");Lt(i.windows,c.current,n.screenX<t.x).catch(i.onError)},onPointerUp:()=>{h.current=null},onContextMenu:(n)=>{n.preventDefault(),i.windows.call("menu").catch(i.onError)},children:[E("div",{style:{width:k,height:k,visibility:V?"hidden":"visible"},children:E(I,{config:b.config,spriteUrl:b.spriteUrl||l,staticImage:b.staticImage,stateId:R.state,flipped:R.flipped,animTick:R.tick,active:C&&!b.staticImage,onDrawFrame:()=>{if(p!==null)o.drawn(p.petId,p.generation)},onRenderError:(n)=>{if(p!==null)o.fail(p.petId,p.generation,n);i.onError(n)},onMouseDown:()=>{},onClick:()=>{c.current?.handleClick();let n=Date.now();if(n-g.current<350&&n-g.current>50)r.close(),i.sessions.activate().catch(i.onError),g.current=0;else g.current=n}},void 0,!1,void 0,this)},void 0,!1,void 0,this),V&&E("div",{className:"alwith-vibemon-burst pointer-events-none",style:{position:"fixed",left:"50%",bottom:0,width:280,height:280,transform:`translateX(-50%) scale(${k/280})`,transformOrigin:"center bottom",zIndex:20}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{Gt};
@@ -0,0 +1,2 @@
1
+ class ue{current=null;listeners=new Set;begin(r,n){this.current={petId:r,generation:n,value:null,drawn:!1,error:null},this.notify()}positioned(r,n,e){let i=this.current;if(i?.petId!==r||i.generation!==n)return;i.value=e,this.notify()}drawn(r,n){let e=this.current;if(e?.petId!==r||e.generation!==n||e.drawn)return;e.drawn=!0,this.notify()}requireFreshFrame(r){if(this.current?.petId!==r)throw Error("Vibemon resource changed");this.current.drawn=!1,this.notify()}fail(r,n,e){let i=this.current;if(i?.petId!==r||i.generation!==n)return;i.error=e,this.notify()}invalidate(){if(this.current===null)return;this.current.error=Error("Vibemon resource was unloaded"),this.notify()}reset(){this.invalidate(),this.current=null,this.notify()}assertReady(r,n){let e=this.current;if(e?.petId!==r||e.value!==n||!e.drawn||e.error!==null)throw Error("Vibemon resource changed during presentation")}notify(){for(let r of this.listeners)r()}waitingStage(){let r=this.current;if(r===null)return"resource-loading";if(r.value===null)return"initial-position";if(!r.drawn)return"canvas-frame";return"ready"}wait(r,n){let e=this.current?.generation;return new Promise((i,u)=>{let a=()=>{clearTimeout(l),this.listeners.delete(s)},o=(t)=>{a(),u(t)},s=()=>{if(Date.now()>=n){o(Error(`Vibemon presentation timed out [stage=${this.waitingStage()}]`));return}let t=this.current;if(!t)return;if(e??=t.generation,t.petId!==r||e!==void 0&&e!==t.generation)o(Error("Vibemon resource changed during presentation"));else if(t.error)o(t.error);else if(t.drawn&&t.value!==null)a(),i(t.value)},l=setTimeout(()=>o(Error(`Vibemon presentation timed out [stage=${this.waitingStage()}]`)),Math.max(0,n-Date.now()));this.listeners.add(s),s()})}}
2
+ export{ue};
@@ -0,0 +1,2 @@
1
+ import{it,st,P,c,pt}from"./chunk-tvmvzc41.js";import{i}from"./chunk-h994ssre.js";import{o}from"./chunk-xrw9s1th.js";import{t}from"./chunk-mjsqb1wk.js";import{Me}from"./chunk-b7v6g7a0.js";import{C}from"./chunk-x61q358n.js";import{motion as v,useInView as Q}from"motion/react";import{useEffect as U,useRef as I,useState as R}from"react";import{jsxDEV as n,Fragment as z}from"react/jsx-dev-runtime";var f=300,m=500,k=400,X=1920,O=10,F=1474,V=[0.6,0.7,0.8,0.9,1,1,0.9,0.8,0.7,0.6],Z=1.1269,M=[12,14,16,18,20,18,16,14,12].map((e)=>e*Z),q=(F-M.reduce((e,a)=>e+a,0))/V.reduce((e,a)=>e+a,0),j=(()=>{let e=0;return V.map((a,l)=>{let d=q*a,r=e+d/2-F/2;if(e+=d,l<M.length)e+=M[l];return{scale:a,x:r}})})(),A={R:null,SR:it,SSR:st},T=(e)=>`${e/X*100}cqw`,B={R:"r",SR:"sr",SSR:"ssr"},G={"white-card":{scrim:"linear-gradient(0deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.20) 100%), linear-gradient(180.83deg, rgba(1,24,30,0.90) 58.198%, rgba(86,209,251,0.90) 153.35%)",button:"#82D6EB",textureOpacity:"opacity-68"},r:{scrim:"linear-gradient(0deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.20) 100%), linear-gradient(180.83deg, rgba(1,24,30,0.90) 58.198%, rgba(86,209,251,0.90) 153.35%)",button:"#82D6EB",textureOpacity:"opacity-68"},sr:{scrim:"linear-gradient(0deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.20) 100%), linear-gradient(180.83deg, rgba(22,1,30,0.90) 59.16%, rgba(192,106,255,0.90) 153.35%)",button:"#C16AFF",textureOpacity:"opacity-68"},ssr:{scrim:"linear-gradient(0deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.20) 100%), linear-gradient(180.83deg, rgba(33,15,0,0.90) 65.36%, rgba(255,172,47,0.90) 153.35%)",button:"#FFAF32",textureOpacity:"opacity-100"}},ee={r:"linear-gradient(0deg, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.20) 100%), linear-gradient(181deg, rgba(0, 17, 35, 0.90) 65.37%, rgba(21, 166, 226, 0.90) 153.35%)",sr:"linear-gradient(0deg, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.20) 100%), linear-gradient(181deg, rgba(24, 7, 45, 0.90) 65.37%, rgba(156, 63, 224, 0.90) 153.35%)",ssr:"linear-gradient(0deg, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.20) 100%), linear-gradient(181deg, rgba(33, 15, 0, 0.90) 65.37%, rgba(255, 172, 47, 0.90) 153.35%)"},W=(e)=>{if(e.some((a)=>a.kind==="card"&&a.rarity==="SSR"))return"ssr";if(e.some((a)=>a.kind==="card"&&a.rarity==="SR"))return"sr";return"r"};function Ne({phase:e,drawnRewards:a,onVideoStarted:l,onPullDone:d,onPullFailed:r,onResultConfirmed:u}){let s=I(null),w=Q(s),[_,x]=R(document.visibilityState==="visible");U(()=>{let p=()=>x(document.visibilityState==="visible");return document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p)},[]);let[b,D]=R(!1),[N,S]=R("flat"),h=I(!1);U(()=>{if(e!=="idle")return;h.current=!1,D(!1),S("flat")},[e]);let y=a.length>1,g=y?null:a[0],E=y?W(a):null,K=y&&a.some((p)=>p.kind==="card"),L=g?g.kind==="white-card"?"white-card":B[g.rarity]:null,Y=()=>{if(!y||N!=="flat"||h.current)return;if(h.current=!0,!K){S("fly"),setTimeout(()=>u(!1),f);return}S("gather"),setTimeout(()=>S("fly"),k),setTimeout(()=>u(!0),k+m)},H=()=>{if(!g||b||h.current)return;h.current=!0,D(!0);let p=g.kind==="card"?m:f;setTimeout(()=>u(g.kind==="card"),p)},J=y?N!=="fly":!b;return n("div",{ref:s,"data-presentation-state":e,className:"[container-type:size] absolute inset-0 z-50 overflow-hidden bg-transparent transition-colors duration-300",style:{pointerEvents:e==="idle"?"none":"auto"},children:[n("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 transition-opacity duration-300",style:{background:e!=="result"?"rgba(1,10,21,1)":E?ee[E]:L?G[L].scrim:"rgba(1,10,21,0.82)",opacity:e==="result"&&J?1:0}},void 0,!1,void 0,this),e==="result"&&(y?n(le,{rewards:a,stage:N,onConfirm:Y},void 0,!1,void 0,this):g?n(oe,{reward:g,onConfirm:H,closing:b},void 0,!1,void 0,this):null),n(C,{sources:Me,playing:e==="video-waiting"||e==="video-playing",active:w&&_,background:"rgba(1,10,21,1)",onFirstFrame:l,onComplete:d,onError:r},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var te={default:"#FFAF32",hover:"#FFC15F",press:"#ECA029"};function ne({onConfirm:e}){let[a,l]=R(!1),[d,r]=R(!1),u=d?"press":a?"hover":"default";return n(t,{"aria-label":"Confirm",onClick:e,"data-visual-state":u,onPointerEnter:()=>l(!0),onPointerLeave:()=>{l(!1),r(!1)},onPointerDown:()=>r(!0),onPointerUp:()=>r(!1),onPointerCancel:()=>r(!1),onKeyDown:(s)=>{if(s.key===" "||s.key==="Enter")r(!0)},onKeyUp:(s)=>{if(s.key===" "||s.key==="Enter")r(!1)},onBlur:()=>{l(!1),r(!1)},style:{backgroundColor:te[u]},className:"relative h-full w-full overflow-hidden rounded-full border-0 p-0 shadow-none drop-shadow-[0_0.417cqh_0_rgba(0,0,0,0.51)] transition-none active:translate-y-0",children:[n("img",{src:c,alt:"",className:"pointer-events-none absolute top-[-560.71%] left-[-20.34%] h-[741.76%] w-[160.31%] max-w-none mix-blend-soft-light select-none"},void 0,!1,void 0,this),n("span",{"aria-hidden":!0,className:"absolute inset-0 shadow-[inset_0_0.2cqh_0.07cqh_0_white]"},void 0,!1,void 0,this),n("span",{className:"relative text-[1.458cqw] leading-normal font-normal text-[#403C80]",style:{fontFamily:'"Grow Year", system-ui, sans-serif',WebkitTextStroke:"0.25cqw white",paintOrder:"stroke fill"},children:"Confirm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ae({tone:e,onConfirm:a}){let l=G[e];return n(t,{"aria-label":"Confirm",onClick:a,style:{backgroundColor:l.button},className:"relative h-full w-full overflow-hidden rounded-full border-0 p-0 shadow-none drop-shadow-[0_0.417cqh_0_rgba(0,0,0,0.51)] transition-none hover:brightness-105 active:translate-y-0",children:[n("img",{src:c,alt:"",className:o("pointer-events-none absolute top-[-560.71%] left-[-20.34%] h-[741.76%] w-[160.31%] max-w-none mix-blend-soft-light select-none",l.textureOpacity)},void 0,!1,void 0,this),n("span",{"aria-hidden":!0,className:"absolute inset-0 shadow-[inset_0_0.2cqh_0.07cqh_0_white]"},void 0,!1,void 0,this),n("span",{className:"relative text-[1.458cqw] leading-normal font-normal text-[#403C80]",style:{fontFamily:'"Grow Year", system-ui, sans-serif',WebkitTextStroke:"0.25cqw white",paintOrder:"stroke fill"},children:"Confirm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ie({reward:e}){return n("img",{src:i(e.singleImageUrl),alt:`Gacha Gem ×${e.exchangePoints}`,className:"block h-auto w-full max-w-none select-none"},void 0,!1,void 0,this)}function oe({reward:e,onConfirm:a,closing:l}){let d=e.kind==="white-card"?"white-card":B[e.rarity];return n("div",{"data-testid":"single-draw-result","data-result-tone":d,className:"absolute inset-0 z-10",children:n("div",{className:"[container-type:size] absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",style:{width:"min(100cqw, 160cqh)",aspectRatio:"8 / 5"},children:[n(v.div,{"aria-hidden":!0,className:"pointer-events-none absolute top-[43.810%] left-[52.655%] aspect-square w-[31.656%] -translate-x-1/2 -translate-y-1/2",animate:{opacity:l?0:0.62},transition:{duration:f/1000},children:n("img",{src:pt,alt:"",className:"h-full w-full max-w-none [animation:spin_2s_linear_infinite] select-none"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n("div",{className:`absolute -translate-x-1/2 ${e.kind==="card"?"top-[20.396%] left-[52.551%]":"top-[43.810%] left-[52.656%] -translate-y-1/2"}`,children:n(v.div,{className:"relative",style:{width:e.kind==="card"?"20.833cqw":"13.75cqw"},initial:!1,animate:l?e.kind==="card"?{x:["0cqw","14cqw","29cqw"],y:["0cqh","-34cqh","-37cqh"],scale:[1,0.14],opacity:[1,1,0]}:{x:0,y:0,scale:0.94,opacity:0}:{x:0,y:0,scale:1,opacity:1},transition:l&&e.kind==="card"?{x:{duration:m/1000,ease:"linear",times:[0,0.5,1]},y:{duration:m/1000,ease:"linear",times:[0,0.5,1]},scale:{duration:m/1000,ease:"linear"},opacity:{duration:m/1000,ease:"linear",times:[0,0.7,1]}}:{duration:l?f/1000:0},children:e.kind==="card"?n(z,{children:[n("img",{src:i(e.singleImageUrl),alt:`${e.vibemonName} ${e.rarity} card`,className:"h-auto w-full max-w-none select-none"},void 0,!1,void 0,this),e.isNew&&n("img",{src:P,alt:"New",className:"pointer-events-none absolute top-[0.202%] right-[2.504%] z-10 h-auto w-[22.5%] max-w-none select-none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):n(ie,{reward:e},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),n(v.div,{className:"absolute top-[71.667%] left-[52.656%] h-[6.5%] w-[18.542%] -translate-x-1/2",animate:{opacity:l?0:1},transition:{duration:f/1000},style:{pointerEvents:l?"none":"auto"},children:n(ae,{tone:d,onConfirm:a},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function re({reward:e}){return n("img",{src:i(e.multiImageUrl),alt:`Gacha Gem ×${e.exchangePoints}`,className:"pointer-events-none block h-auto w-full max-w-none select-none"},void 0,!1,void 0,this)}function le({rewards:e,stage:a,onConfirm:l}){if(e.length!==O)throw Error(`[vibemon] ten-draw result must contain ${O} rewards, received ${e.length}`);let d=W(e);return n("div",{"data-testid":"multi-draw-result","data-result-tone":d,className:"absolute inset-0 z-10 overflow-hidden",children:n("div",{"data-testid":"multi-result-stage",className:"[container-type:size] absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",style:{width:"min(100cqw, 160cqh)",aspectRatio:"8 / 5"},children:[n("div",{"data-testid":"multi-result-group",className:"absolute top-[17.833%] left-[11.615%] h-[55%] w-[76.77%]",children:e.map((r,u)=>{let s=j[u],w={x:T(s.x),y:"0cqh",scale:s.scale,opacity:1},_=r.kind==="card"?`${r.drawIndex}-${r.vibemonUuid}`:`${r.drawIndex}-white-card`,x=r.kind==="card"?{x:"0cqw",y:"0cqh",scale:1,opacity:1}:{...w,opacity:0},b=r.kind==="card"?{x:["0cqw","17cqw","34cqw"],y:["0cqh","-40cqh","-38cqh"],scale:[1,0.08],opacity:[1,1,0]}:{...w,opacity:0};return n("div",{className:"absolute inset-y-0 left-1/2 flex items-center",style:{width:T(q),marginLeft:T(-q/2),zIndex:a==="flat"?10-Math.abs(u-4.5):e.length-u},children:n(v.div,{"data-result-index":u,"data-result-scale":s.scale,className:"relative w-full",initial:!1,animate:a==="flat"?w:a==="gather"?x:b,transition:a==="gather"?{duration:r.kind==="card"?k/1000:f/1000,ease:"easeIn"}:a==="fly"?r.kind==="card"?{x:{duration:m/1000,ease:"linear",times:[0,0.5,1]},y:{duration:m/1000,ease:"linear",times:[0,0.5,1]},scale:{duration:m/1000,ease:"linear"},opacity:{duration:m/1000,ease:"linear",times:[0,0.7,1]}}:{duration:f/1000}:{duration:0},children:r.kind==="card"?n(z,{children:[A[r.rarity]!==null&&n("img",{src:A[r.rarity]??void 0,alt:"","aria-hidden":!0,"data-testid":`multi-card-band-${r.rarity}`,className:"pointer-events-none absolute top-1/2 left-0 h-auto w-full max-w-none -translate-y-1/2 select-none"},void 0,!1,void 0,this),n("img",{src:i(r.multiImageUrl),alt:`${r.vibemonName} ${r.rarity} card`,className:"pointer-events-none relative block h-auto w-full max-w-none select-none"},void 0,!1,void 0,this),r.isNew&&n("img",{src:P,alt:"New",className:"pointer-events-none absolute top-0 right-[-5.85%] z-10 h-auto w-[44.21%] max-w-none -translate-y-1/2 select-none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):n(re,{reward:r},void 0,!1,void 0,this)},void 0,!1,void 0,this)},_,!1,void 0,this)})},void 0,!1,void 0,this),n(v.div,{className:"absolute top-[78%] left-[40.729%] h-[6.5%] w-[18.542%]",style:{pointerEvents:a==="flat"?"auto":"none"},animate:{opacity:a==="flat"?1:0},transition:{duration:f/1000},children:n(ne,{onConfirm:l},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}
2
+ export{Ne};
@@ -0,0 +1,2 @@
1
+ function pn(e){return`auth.${new URL(e).host}`}function fn(e){let t={ACCESS:"access_token",REFRESH:"refresh_token",DEVICE_ID:"device_id",USER:"user"},a={save:async(n,o)=>{await e.set(t.ACCESS,n),await e.set(t.REFRESH,o)},getAccess:async()=>await e.get(t.ACCESS)??"",getRefresh:async()=>await e.get(t.REFRESH)??"",updateAccess:async(n)=>{await e.set(t.ACCESS,n)},clear:async()=>{await e.delete(t.ACCESS),await e.delete(t.REFRESH)},getDeviceId:async()=>{let n=await e.get(t.DEVICE_ID);if(!n)n=crypto.randomUUID(),await e.set(t.DEVICE_ID,n);return n}};async function r(n){await e.set(t.USER,n)}async function s(){return await e.get(t.USER)??null}async function i(){await e.delete(t.USER)}async function c(){await a.clear(),await i()}return{tokenStorage:a,saveUser:r,loadUser:s,clearUser:i,clearAllAuth:c}}
2
+ export{pn,fn};
@@ -0,0 +1,2 @@
1
+ class he{engine=null;states=[];sessionId=null;failed=!1;bindingRevision=-1;historicalDone=!1;pendingPrompt=!1;attach(t){this.engine=t,this.historicalDone=this.state()==="done",this.apply()}bind(t,i,s=0){let e=this.sessionId!==t||this.bindingRevision!==s;if(this.sessionId=t,this.failed=i,this.bindingRevision=s,e)this.pendingPrompt=!1,this.engine?.setSessionState(null,null,!1),this.historicalDone=this.state()==="done";this.apply()}prompt(t,i,s){if(t!==this.sessionId||i!==this.bindingRevision)return;this.pendingPrompt=s,this.apply()}update(t,i="event"){let s=this.state();if(this.states=t,this.state()!==s)this.historicalDone=i==="snapshot"&&this.state()==="done";this.apply()}state(){return this.states.find((t)=>t.sessionId===this.sessionId)?.state??null}apply(){let t=this.state();this.engine?.setSessionState(this.sessionId,this.pendingPrompt?"requires_action":t==="done"&&this.historicalDone?"idle":t,this.pendingPrompt?!1:this.failed)}}
2
+ export{he};
@@ -0,0 +1,2 @@
1
+ import{at,lt,P}from"./chunk-tvmvzc41.js";import{o}from"./chunk-xrw9s1th.js";import{t}from"./chunk-mjsqb1wk.js";import{useState as i}from"react";import{jsxDEV as e}from"react/jsx-dev-runtime";function We({onClick:s,className:a}){let[r,n]=i(!1);return e(t,{"aria-label":"Wish",variant:"ghost",className:o("relative size-[64px] p-0 hover:bg-transparent",a),onClick:s,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[e("img",{src:r?at:lt,alt:"",className:"absolute top-[5.439%] left-[4.863%] h-[89.122%] w-[90.27%] max-w-none object-contain select-none"},void 0,!1,void 0,this),e("img",{src:P,alt:"",className:"pointer-events-none absolute top-[4.422%] left-[50.578%] h-[26.03%] w-[49.428%] max-w-none select-none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{We};
@@ -0,0 +1 @@
1
+ import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";import{jsxDEV as s}from"react/jsx-dev-runtime";var Qt=d("group/button focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 shadow-xs",secondary:"bg-secondary text-secondary-foreground aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function t({className:e,variant:r="default",size:i="default",...a}){return s(n,{"data-slot":"button",className:o(Qt({variant:r,size:i,className:e})),...a},void 0,!1,void 0,this)}export{Qt,t};
@@ -0,0 +1,2 @@
1
+ import{m}from"./chunk-4gegjx79.js";import{Unzip as S,UnzipInflate as v}from"fflate";var y=["cover","gacha","multi_draw","icon","background","pool_card","sidebar_selected","sidebar_hover","sidebar_unselected"],Se=209715200,w=65536,A=new TextDecoder("utf-8",{fatal:!0});function ie(e){return e.length>0&&!/[\\\u0000-\u001f:]/.test(e)&&e.split("/").every((n)=>n!==""&&n!=="."&&n!=="..")}async function se(e){let n=await crypto.subtle.digest("SHA-256",new Uint8Array(e).buffer);return Array.from(new Uint8Array(n),(a)=>a.toString(16).padStart(2,"0")).join("")}function Pe(e){if(e.length>w)throw Error("Vibemon manifest exceeds 64 KiB");let n=JSON.parse(A.decode(e));if(n?.format_version!==1||!n.assets||typeof n.assets!=="object"||Array.isArray(n.assets))throw Error("Invalid Vibemon package manifest");let a=Object.entries(n.assets);if(a.length>11)throw Error("Too many Vibemon assets");let i=new Set;for(let[,t]of a){if(!t||typeof t.path!=="string"||!ie(t.path)||t.path==="manifest.json"||typeof t.sha256!=="string"||!/^[a-f0-9]{64}$/.test(t.sha256)||i.has(t.path))throw Error("Invalid Vibemon asset reference");i.add(t.path)}if(Boolean(n.assets.sheet)!==Boolean(n.assets.layout))throw Error("Vibemon animation requires both sheet and layout");return n}function k(e){let n=new DataView(e.buffer,e.byteOffset,e.byteLength),a=(r,f)=>String.fromCharCode(...e.subarray(r,r+f)),i="",t=0,s=0;if(e.length>=24&&e[0]===137&&a(1,3)==="PNG")i="image/png",t=n.getUint32(16),s=n.getUint32(20);else if(e.length>=10&&/GIF8[79]a/.test(a(0,6)))i="image/gif",t=n.getUint16(6,!0),s=n.getUint16(8,!0);else if(e.length>=30&&a(0,4)==="RIFF"&&a(8,4)==="WEBP"){i="image/webp";let r=a(12,4);if(r==="VP8X")t=1+(n.getUint32(24,!0)&16777215),s=1+(e[27]|e[28]<<8|e[29]<<16);else if(r==="VP8L"&&e[20]===47){let f=n.getUint32(21,!0);t=1+(f&16383),s=1+(f>>>14&16383)}else if(r==="VP8 "&&e[23]===157&&e[24]===1&&e[25]===42)t=n.getUint16(26,!0)&16383,s=n.getUint16(28,!0)&16383}else if(e.length>4&&e[0]===255&&e[1]===216){i="image/jpeg";for(let r=2;r+8<e.length;){if(e[r++]!==255)break;while(e[r]===255)r++;let f=e[r++];if(f===217||f===218)break;if(f===1||f>=208&&f<=215)continue;let c=n.getUint16(r);if(c<2||r+c>e.length)break;if([192,193,194,195,197,198,199,201,202,203,205,206,207].includes(f)){s=n.getUint16(r+3),t=n.getUint16(r+5);break}r+=c}}if(!t||!s||t>16384||s>16384)throw Error("Invalid or unsupported Vibemon image dimensions");return{mime:i,width:t,height:s}}async function _e(e,n,a){let i=0,t=null,s=null;for(let[r,f]of Object.entries(e.assets)){let c=await n(f.path);if(c===null||await se(c)!==f.sha256)throw Error(`Vibemon asset checksum mismatch: ${r}`);if(i+=c.length,i>Se)throw Error("Vibemon resource expansion limit exceeded");if(r==="layout"){if(c.length>w)throw Error("Vibemon layout exceeds 64 KiB");t=m(A.decode(c))}else if(r==="sheet"||y.includes(r)){let h=k(c);if(await a?.(c,h.mime),r==="sheet")s=h}}if(t&&s&&t.states.some((r)=>r.frames*t.frameWidth>s.width||(r.row+1)*t.frameHeight>s.height))throw Error("Vibemon animation exceeds the spritesheet");return t}async function qt(e,n){if(e.length>Se)throw Error("Vibemon ZIP exceeds 200 MiB");let a=new DataView(e.buffer,e.byteOffset,e.byteLength),i=e.length-22;while(i>=Math.max(0,e.length-65557)&&a.getUint32(i,!0)!==101010256)i--;if(i<0||e.length<22||a.getUint32(i,!0)!==101010256||i+22+a.getUint16(i+20,!0)!==e.length||a.getUint16(i+4,!0)!==0||a.getUint16(i+6,!0)!==0||a.getUint32(i+16,!0)+a.getUint32(i+12,!0)!==i)throw Error("Incomplete or unsupported Vibemon ZIP");let t=new Map,s=new Set,r=0,f=0,c=new S((o)=>{let l=o.name.endsWith("/"),u=l?o.name.slice(0,-1):o.name;if(!ie(u)||s.has(u)||s.size>=44)throw Error("Invalid or duplicate Vibemon ZIP path");if((o.originalSize??0)>Se)throw Error("Vibemon ZIP expansion limit exceeded");s.add(u);let p=[],g=0;o.ondata=(x,d,b)=>{if(x)throw x;if(r+=d.length,g+=d.length,r>Se||(o.name==="manifest.json"||o.name.endsWith(".json"))&&g>w)throw Error("Vibemon ZIP expansion limit exceeded");if(p.push(d),b){let P=new Uint8Array(g),U=0;for(let I of p)P.set(I,U),U+=I.length;if(l){if(g!==0)throw Error("Invalid Vibemon ZIP directory")}else{if(t.size>=12)throw Error("Too many Vibemon ZIP files");t.set(o.name,P)}f++}},o.start()});c.register(v);for(let o=0;o<e.length;o+=65536)if(c.push(e.subarray(o,o+65536),o+65536>=e.length),o>0&&o%1048576===0)await new Promise((l)=>setTimeout(l,0));if(f!==s.size||s.size!==a.getUint16(i+10,!0)||!t.has("manifest.json"))throw Error("Incomplete Vibemon ZIP");let h=Pe(t.get("manifest.json")),E=new Set(["manifest.json",...Object.values(h.assets).map((o)=>o.path)]);if([...t.keys()].some((o)=>!E.has(o)))throw Error("Unexpected Vibemon ZIP file");let V=await _e(h,(o)=>Promise.resolve(t.get(o)??null),n);return{files:t,manifest:h,layout:V}}
2
+ export{y,Se,ie,se,Pe,k,_e,qt};
File without changes
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";import{It,At}from"./chunk-vt1sfk87.js";var s={SSR:5,SR:4,R:3,UC:2,C:1};function c(o){let t=o.items.filter((r)=>(r.reward_type==="VIBEMON"||r.reward_type==null)&&Boolean(r.vibemon_uuid)&&r.status===1),a=t[0];if(a===void 0)throw Error(`[vibemon] gacha pool ${o.uuid} has no active Vibemon item`);return t.slice(1).reduce((r,i)=>{if(s[i.rarity_code]-s[r.rarity_code]>0)return i;return r},a)}function m(o,t){if(t.uuid!==o.uuid)throw Error(`[vibemon] gacha pool detail UUID ${t.uuid} does not match catalog UUID ${o.uuid}`);if(t.multi_count!==10)throw Error(`[vibemon] gacha pool ${t.uuid} multi_count must be 10, received ${t.multi_count}`);let a=c(t);return{poolUuid:t.uuid,name:t.name,sidebarSelectedImageUrl:a.vibemon_sidebar_selected_url??"",sidebarHoverImageUrl:a.vibemon_sidebar_hover_url??"",sidebarUnselectedImageUrl:a.vibemon_sidebar_unselected_url??"",pageBackgroundImageUrl:a.vibemon_background_url??"",poolCardImageUrl:a.vibemon_pool_card_url??"",status:t.status===1?"ACTIVE":"UNAVAILABLE",startsAt:o.start_time,endsAt:o.end_time,singlePrice:t.next_single_actual_cost??o.single_cost,multiPrice:t.next_multi_actual_cost??o.multi_cost,currencyType:o.currency_type,canDraw:t.status===1,isDefault:o.is_default===1}}function en(o,t){if(o.length===0)throw Error("[vibemon] active gacha pool catalog is empty");let a=new Map(t.map((i)=>[i.uuid,i]));return{pools:[...o].toSorted((i,n)=>i.sort_order-n.sort_order).map((i)=>{let n=a.get(i.uuid);if(n===void 0)throw Error(`[vibemon] gacha pool ${i.uuid} is missing its detail response`);return m(i,n)})}}function xt(o){let t=o.pools.flatMap((a)=>[a.sidebarSelectedImageUrl,a.sidebarHoverImageUrl,a.sidebarUnselectedImageUrl,a.poolCardImageUrl,a.pageBackgroundImageUrl]);return[...new Set(t.filter(Boolean))]}async function St(){let t=[...await It()].toSorted((r,i)=>r.sort_order-i.sort_order),a=await Promise.all(t.map((r)=>At(r.uuid)));return await Promise.all(a.map(async(r)=>{let i=c(r),n=await e().assets.resolveImages(i.vibemon_uuid,i.vibemon_resource_url);for(let[u,d]of Object.entries(n))Object.assign(i,{[`vibemon_${u}`]:d})})),en(t,a)}function l(o,t,a){let r=Date.parse(t);if(Number.isNaN(r))throw Error(`[vibemon] gacha pool ${o.poolUuid} has invalid ${a}: ${t}`);return r}function me(o,t){if(o.status==="UNAVAILABLE")return o.status;if(o.startsAt!==null&&t<l(o,o.startsAt,"startsAt"))return"UPCOMING";if(o.endsAt!==null&&t>=l(o,o.endsAt,"endsAt"))return"ENDED";return o.status}function Pt(o){let t=o.find((r)=>r.isDefault);if(t!==void 0)return t;let a=o[0];if(a===void 0)throw Error("[vibemon] gacha pool catalog has no visible pools");return a}function _t(o,t){return o.filter((a)=>me(a,t)!=="ENDED")}
2
+ export{en,xt,St,me,Pt,_t};
@@ -0,0 +1,2 @@
1
+ function vt(e,t,n){if(n<e.startedAt)return e;if(t==="running")return{...e,sawRunning:!0,completed:!1};if(t==="requires_action")return{...e,completed:!1};if(t==="done"||t==="idle"&&e.sawRunning)return{...e,completed:!0};return e}
2
+ export{vt};
@@ -0,0 +1,2 @@
1
+ import{D,L,O,x,q,S,H,G}from"./chunk-tvmvzc41.js";import{o}from"./chunk-xrw9s1th.js";import{motion as h,useReducedMotion as b}from"motion/react";import{jsxDEV as e}from"react/jsx-dev-runtime";var p=2128.456,f=1920,d=(t)=>`${t/p*100}cqw`,a=(t)=>`${t/f*100}cqw`;function A(){return e("div",{"data-testid":"vibemon-onboarding-scrim","aria-hidden":!0,className:"absolute inset-0 z-20 bg-black/50",style:{boxShadow:"0 0 0 100vmax rgba(0,0,0,0.5)"}},void 0,!1,void 0,this)}var w=8,N=32,u=160,y={width:687,height:94,textLeft:184.457,mascotLeft:20.273,mascotTop:-70.384,texture:L,length:d},v={width:712,height:94,textLeft:185.29,mascotLeft:20.96,mascotTop:-70.46,texture:O,length:a};function g({design:t,className:n,children:i}){let s=t.length;return e("div",{className:o("absolute -translate-x-1/2 -translate-y-1/2",n),style:{width:s(t.width),height:s(t.height)},children:[e("div",{className:"absolute inset-0 rounded-full border-white bg-[#8546DD] bg-[length:100%_100%] [background-origin:border-box]",style:{borderWidth:s(w),backgroundImage:`url("${t.texture}")`}},void 0,!1,void 0,this),e("p",{className:"absolute top-1/2 -translate-y-1/2 leading-normal whitespace-nowrap text-white",style:{left:s(t.textLeft),fontFamily:'"Lilita One", system-ui, sans-serif',fontSize:s(N)},children:i},void 0,!1,void 0,this),e("img",{src:x,alt:"",className:"absolute max-w-none select-none",style:{left:s(t.mascotLeft),top:s(t.mascotTop),width:s(u),height:s(u)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var c=42;function B(){let t=b(),n="absolute top-[56.381%] left-[57.735%] -translate-x-1/2 -translate-y-1/2",i={width:d(c),height:d(c)},s=e("span",{className:"absolute inset-0 rotate-180",children:e("span",{className:"absolute inset-[6.35%_-0.84%_-3.12%_-0.84%]",children:e("img",{src:D,alt:"",className:"block h-full w-full max-w-none select-none"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(t)return e("div",{"data-node-id":"1566:3898","data-testid":"vibemon-home-guide-arrow",className:"absolute top-[56.381%] left-[57.735%] -translate-x-1/2 -translate-y-1/2",style:i,children:s},void 0,!1,void 0,this);return e(h.div,{"data-node-id":"1566:3898","data-testid":"vibemon-home-guide-arrow",className:"absolute top-[56.381%] left-[57.735%] -translate-x-1/2 -translate-y-1/2",style:i,initial:{y:0},animate:{y:["0%","21.1%"]},transition:{y:{duration:0.401,times:[0,1],ease:"easeInOut",repeat:1/0}},children:s},void 0,!1,void 0,this)}function Ce(){return e("div",{"data-testid":"vibemon-home-wish-guide",className:"pointer-events-none absolute inset-0 z-40",children:[e(g,{design:y,className:"top-[18.400%] left-[54.614%]",children:"Your first card is waiting inside!"},void 0,!1,void 0,this),e(B,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var m=109.551,l={left:20.179,top:18.317,width:69.1953,height:70.918},r={left:25.672,top:2.065,size:43.219};function _(){let t=b(),n={left:a(r.left),top:a(r.top),width:a(r.size),height:a(r.size)},i=e("span",{className:"absolute inset-[-578.45%]",children:e("img",{src:G,alt:"",className:"block h-full w-full max-w-none select-none"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return e("div",{className:"relative",style:{width:a(m),height:a(m)},children:[t?e("span",{"data-node-id":"1550:4234","data-testid":"vibemon-pool-guide-ring",className:"absolute",style:n,children:i},void 0,!1,void 0,this):e(h.span,{"data-node-id":"1550:4234","data-testid":"vibemon-pool-guide-ring",className:"absolute",style:n,initial:{scaleX:1.6,scaleY:1.6},animate:{scaleX:[1.6,1.014,1],scaleY:[1.6,1.014,1]},transition:{scaleX:{duration:0.61,times:[0,0.82,1],ease:"linear",repeat:1/0},scaleY:{duration:0.61,times:[0,0.82,1],ease:"linear",repeat:1/0}},children:i},void 0,!1,void 0,this),e("span",{"data-node-id":"1550:4236",className:"absolute",style:{left:a(l.left),top:a(l.top),width:a(l.width),height:a(l.height)},children:[e("img",{src:q,alt:"",className:"absolute inset-0 block h-full w-full max-w-none select-none"},void 0,!1,void 0,this),e("span",{className:"absolute inset-0",style:{backgroundImage:`url("${H}")`,backgroundSize:"100% 100%",WebkitMaskImage:`url("${S}")`,WebkitMaskSize:"100% 100%",maskImage:`url("${S}")`,maskSize:"100% 100%"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Te(){let t=(n)=>({width:a(n),height:a(n)});return e("div",{"data-testid":"vibemon-free-draw-guide",className:"pointer-events-none absolute inset-0 z-40",children:[e(g,{design:v,className:"top-[79.004%] left-[57.240%] z-2",children:"Draw a card, find your companion!"},void 0,!1,void 0,this),e("span",{className:"absolute top-[82.184%] left-[68.358%] z-1 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white",style:t(34.461)},void 0,!1,void 0,this),e("span",{className:"absolute top-[85.459%] left-[67.288%] z-1 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white",style:t(15.354)},void 0,!1,void 0,this),e("div",{className:"absolute top-[95.437%] left-[64.490%] -translate-x-1/2 -translate-y-1/2",children:e(_,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{A,Ce,Te};
@@ -0,0 +1 @@
1
+ import{cn as r}from"cn";import{jsxDEV as d}from"react/jsx-dev-runtime";function je({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o},void 0,!1,void 0,this)}function hn({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t},void 0,!1,void 0,this)}function bn({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t},void 0,!1,void 0,this)}function wn({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-muted-foreground text-sm",a),...t},void 0,!1,void 0,this)}function vn({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t},void 0,!1,void 0,this)}function yn({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t},void 0,!1,void 0,this)}function xn({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t},void 0,!1,void 0,this)}export{je,hn,bn,wn,vn,yn,xn};
@@ -0,0 +1,2 @@
1
+ import{r,n}from"./chunk-rerywpwe.js";import{ye}from"./chunk-afy09ajr.js";import{y}from"./chunk-nbfhs21c.js";import{xe}from"./chunk-3amxesw3.js";import{Re}from"./chunk-ax8zmvs0.js";function gn(s){let f=ye(s),l=xe(s),V=new Map,g=new Map,a=null,w=!1,b=0,d=null,v="",P=!1,S=0,p=new Set;function m(){S++;for(let e of p)e()}function u(){if(P)throw Error("Vibemon asset service disposed");let e=s.account(),t=e===null?"":`${r(e)}/${e.revision}`;if(v!==t)v=t,a=null,w=!1,b++,d=null,l.cancel();return e}async function E(e){let t=u(),i=e===void 0?++b:b,o=await f.getMyVibemons(e);if(t===null)throw Error("Sign in to use Vibemon");if(n(s,t),u(),e===void 0&&i===b)a=o,w=!0,await s.storage.set(`vibemon.owned.${r(t)}`,o),n(s,t),m();return Promise.all(o.map(async(c)=>({...c,...await M({...c,uuid:c.vibemon_uuid})})))}async function A(){let e=u();if(e===null)return null;if(w)return a;let t=await s.storage.get(`vibemon.owned.${r(e)}`);return n(s,e),a=t??null,m(),a}async function D(){let e=u(),t=await f.getVibemonCatalog();if(e===null)throw Error("Sign in to use Vibemon");return n(s,e),u(),d=t,m(),t}async function R(e){let t=(V.get(e)??0)+1;V.set(e,t);let i=await f.getVibemonDetail(e);if(V.get(e)!==t)throw Error("Vibemon detail request superseded");if(i.uuid!==e)throw Error("Vibemon detail ID mismatch");return i}async function I(e){let t=u();if(t===null)throw Error("Sign in to use Vibemon");try{return await l.ensure(e)}catch(i){n(s,t),s.onResourceError?.(i,e.uuid);let o=await l.cached(e.uuid);if(o!==null)return o;throw i}}async function M(e){if((e.resource_package_format??0)===0)return{};let t=u();if(t===null)throw Error("Sign in to use Vibemon");try{let i=await I(e),o=await l.visuals(i);return n(s,t),Object.fromEntries(y.filter((c)=>(c in o)).map((c)=>[`${c}_url`,o[c]??null]))}catch{return n(s,t),Object.fromEntries(y.map((i)=>[`${i}_url`,null]))}}async function h(e){let t=u();if(t===null)throw Error("Sign in to use Vibemon");try{let i=await R(e);return await M(i)}catch(i){n(s,t),s.onResourceError?.(i,e);let o=await l.inspect(e);if(o===null)return{};let c=await l.visuals(o);return Object.fromEntries(Object.entries(c).map(([q,C])=>[`${q}_url`,C]))}}function O(e,t){u();let i=JSON.stringify([v,e,t??null]),o=g.get(i);if(o)return o;let c=h(e).finally(()=>{if(g.get(i)===c)g.delete(i)});return g.set(i,c),c}let _=Re(s,async(e)=>{if(u(),w&&a?.some((t)=>t.vibemon_uuid===e))return a;return E()});return{...f,getMyVibemons:E,getVibemonCatalog:D,getVibemonDetail:R,resolveImages:O,resources:l,restoreOwned:A,get revision(){return S},snapshot:()=>({account:u(),owned:a,catalog:d}),invalidate(){u(),m()},subscribe(e){return p.add(e),()=>{p.delete(e)}},selection:{get:_.get,async select(e){u(),await _.select(e),m()}},async ensureResource(e){let t=u();if(t===null)throw Error("Sign in to use Vibemon");if(!(a??await E()).some((o)=>o.vibemon_uuid===e))throw Error("This account does not own this Vibemon");try{let o=await R(e);return n(s,t),await I(o)}catch(o){n(s,t);let c=await l.cached(e);if(c!==null)return s.onResourceError?.(o,e),c;throw o}},dispose(){P=!0,a=null,d=null,l.dispose(),m(),p.clear()}}}
2
+ export{gn};
@@ -0,0 +1,2 @@
1
+ function r(e){return`${e.apiHost}/${e.userId}`}function n(e,o){let t=e.account();if(t===null||r(t)!==r(o)||t.revision!==o.revision)throw Error("Vibemon account changed")}
2
+ export{r,n};
@@ -0,0 +1,2 @@
1
+ import{Nt}from"./chunk-01py4vpp.js";import{X}from"./chunk-6f02m6jw.js";import{useSyncExternalStore as t}from"react";var d=()=>t(Nt,X);
2
+ export{d};