@alwith/module-auth 0.1.8 → 0.1.9

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 (205) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-0gf7vwzk.js +2 -0
  3. package/dist/chunk-0x7ssxpn.js +2 -0
  4. package/dist/chunk-0ze5xzg5.js +2 -0
  5. package/dist/chunk-14dfwbk0.js +2 -0
  6. package/dist/chunk-1hxexf7n.js +6 -0
  7. package/dist/chunk-1mq984ah.js +2 -0
  8. package/dist/chunk-21abksd2.js +2 -0
  9. package/dist/chunk-2aq8zkwb.js +2 -0
  10. package/dist/chunk-2k8my1h9.js +2 -0
  11. package/dist/chunk-2skzpxsk.js +2 -0
  12. package/dist/chunk-2x5tzfgv.js +2 -0
  13. package/dist/chunk-37ctfsy1.js +1 -0
  14. package/dist/chunk-38y9615y.js +2 -0
  15. package/dist/chunk-3vpcfe38.js +2 -0
  16. package/dist/chunk-44at74bw.js +2 -0
  17. package/dist/chunk-4gegjx79.js +2 -0
  18. package/dist/chunk-4h2756zy.js +2 -0
  19. package/dist/chunk-4xk0z8t0.js +2 -0
  20. package/dist/chunk-5jz8vnk5.js +1 -0
  21. package/dist/chunk-5v4zm9s3.js +2 -0
  22. package/dist/chunk-5w675j2g.js +2 -0
  23. package/dist/chunk-70nb6x0r.js +2 -0
  24. package/dist/chunk-74hpp4me.js +2 -0
  25. package/dist/chunk-7xtvv8a7.js +2 -0
  26. package/dist/chunk-8kcmwm3k.js +2 -0
  27. package/dist/chunk-8w0zccsf.js +0 -0
  28. package/dist/chunk-8xd6kn1b.js +2 -0
  29. package/dist/chunk-96emfz6b.js +2 -0
  30. package/dist/chunk-9h4j75af.js +2 -0
  31. package/dist/chunk-9tramdds.js +2 -0
  32. package/dist/chunk-9wqfns8y.js +2 -0
  33. package/dist/chunk-9zhxpvxw.js +2 -0
  34. package/dist/chunk-afy09ajr.js +2 -0
  35. package/dist/chunk-b5zfgr86.js +2 -0
  36. package/dist/chunk-bgc7s9q5.js +2 -0
  37. package/dist/chunk-c9banqkx.js +2 -0
  38. package/dist/chunk-d13j3xks.js +2 -0
  39. package/dist/chunk-ezj6gpm0.js +2 -0
  40. package/dist/chunk-fkj53yw2.js +2 -0
  41. package/dist/chunk-g47n16v3.js +2 -0
  42. package/dist/chunk-hj17ea3j.js +2 -0
  43. package/dist/chunk-hk9j0kvg.js +2 -0
  44. package/dist/chunk-htw56xtp.js +2 -0
  45. package/dist/chunk-j03we9jz.js +2 -0
  46. package/dist/chunk-j3ez3fz2.js +2 -0
  47. package/dist/chunk-jf6z5rh7.js +1 -0
  48. package/dist/chunk-jf77909y.js +2 -0
  49. package/dist/chunk-jjb1befc.js +2 -0
  50. package/dist/chunk-khnyadsg.js +0 -0
  51. package/dist/chunk-kwq26qhs.js +2 -0
  52. package/dist/chunk-m18rjmg2.js +2 -0
  53. package/dist/chunk-m96z2xh6.js +2 -0
  54. package/dist/chunk-mandqn4e.js +2 -0
  55. package/dist/chunk-mdqxdcxh.js +2 -0
  56. package/dist/chunk-mmj02855.js +2 -0
  57. package/dist/chunk-mnrtrr2j.js +2 -0
  58. package/dist/chunk-ms8jh9xz.js +2 -0
  59. package/dist/chunk-my19acdk.js +2 -0
  60. package/dist/chunk-nbzm95mz.js +2 -0
  61. package/dist/chunk-npcgz51c.js +2 -0
  62. package/dist/chunk-p1ywvmqa.js +2 -0
  63. package/dist/chunk-pbwt3qj9.js +0 -0
  64. package/dist/chunk-pha0eyam.js +2 -0
  65. package/dist/chunk-q8ebj5e6.js +2 -0
  66. package/dist/chunk-rerywpwe.js +2 -0
  67. package/dist/chunk-sp65sdp3.js +1 -0
  68. package/dist/chunk-v9czb1e6.js +2 -0
  69. package/dist/chunk-vnnyvrrd.js +3 -0
  70. package/dist/chunk-vr4ye1z4.js +2 -0
  71. package/dist/chunk-vsxgxkg5.js +0 -0
  72. package/dist/chunk-vz0m347h.js +2 -0
  73. package/dist/chunk-w1z1g5c5.js +2 -0
  74. package/dist/chunk-w5yer870.js +2 -0
  75. package/dist/chunk-wbvah1ty.js +2 -0
  76. package/dist/chunk-wcenmfkf.js +2 -0
  77. package/dist/chunk-xrw9s1th.js +2 -0
  78. package/dist/chunk-xs0abxzp.js +2 -0
  79. package/dist/chunk-yjdj2mf9.js +2 -0
  80. package/dist/chunk-z5nmdjb9.js +2 -0
  81. package/dist/chunk-zhbj6cm5.js +2 -0
  82. package/dist/client.d.ts +1 -1
  83. package/dist/client.js +1 -1
  84. package/dist/index.d.ts +6 -6
  85. package/dist/index.js +1 -1
  86. package/dist/oauth.js +1 -1
  87. package/dist/password.js +1 -1
  88. package/dist/pets/assets.d.ts +8 -8
  89. package/dist/pets/assets.js +1 -1
  90. package/dist/pets/client.d.ts +2 -2
  91. package/dist/pets/client.js +1 -1
  92. package/dist/pets/core/engine.d.ts +2 -2
  93. package/dist/pets/core/engine.js +1 -1
  94. package/dist/pets/core/host.d.ts +3 -3
  95. package/dist/pets/core/host.js +1 -1
  96. package/dist/pets/core/index.d.ts +11 -11
  97. package/dist/pets/core/index.js +1 -1
  98. package/dist/pets/core/lib/account-state.d.ts +1 -1
  99. package/dist/pets/core/lib/account-state.js +1 -1
  100. package/dist/pets/core/lib/bubble-outline.js +1 -1
  101. package/dist/pets/core/lib/draw-result.d.ts +1 -1
  102. package/dist/pets/core/lib/draw-result.js +1 -1
  103. package/dist/pets/core/lib/endpoints.d.ts +1 -1
  104. package/dist/pets/core/lib/endpoints.js +1 -1
  105. package/dist/pets/core/lib/gacha-pools.d.ts +1 -1
  106. package/dist/pets/core/lib/gacha-pools.js +1 -1
  107. package/dist/pets/core/lib/loading-progress.js +1 -1
  108. package/dist/pets/core/lib/pet-animation-sync.d.ts +2 -2
  109. package/dist/pets/core/lib/pet-animation-sync.js +1 -1
  110. package/dist/pets/core/lib/pet-bubble-state.d.ts +1 -1
  111. package/dist/pets/core/lib/pet-bubble-state.js +1 -1
  112. package/dist/pets/core/lib/pet-drag.d.ts +2 -2
  113. package/dist/pets/core/lib/pet-drag.js +1 -1
  114. package/dist/pets/core/lib/pet-presentation.d.ts +3 -3
  115. package/dist/pets/core/lib/pet-presentation.js +1 -1
  116. package/dist/pets/core/lib/pet-session-context.js +1 -1
  117. package/dist/pets/core/lib/preload-images.js +1 -1
  118. package/dist/pets/core/lib/presentation-readiness.js +1 -1
  119. package/dist/pets/core/lib/rarity.d.ts +1 -1
  120. package/dist/pets/core/lib/rarity.js +1 -1
  121. package/dist/pets/core/lib/recharge.js +1 -1
  122. package/dist/pets/core/lib/reply-submission.d.ts +1 -1
  123. package/dist/pets/core/lib/reply-submission.js +1 -1
  124. package/dist/pets/core/lib/resource-sync.js +1 -1
  125. package/dist/pets/core/lib/runtime-types.d.ts +1 -1
  126. package/dist/pets/core/lib/settings.js +1 -1
  127. package/dist/pets/core/lib/sprite-config.d.ts +2 -2
  128. package/dist/pets/core/lib/sprite-config.js +1 -1
  129. package/dist/pets/core/lib/vibemon-resources.d.ts +1 -1
  130. package/dist/pets/core/lib/vibemon-resources.js +1 -1
  131. package/dist/pets/core/lib/view-request.js +1 -1
  132. package/dist/pets/core/lib/window-frame.d.ts +1 -1
  133. package/dist/pets/core/lib/window-frame.js +1 -1
  134. package/dist/pets/core/lib/window-manager.d.ts +1 -1
  135. package/dist/pets/core/lib/window-manager.js +1 -1
  136. package/dist/pets/core/session-icon.js +1 -5
  137. package/dist/pets/core/types.js +1 -1
  138. package/dist/pets/host.js +1 -1
  139. package/dist/pets/index.d.ts +6 -6
  140. package/dist/pets/index.js +1 -1
  141. package/dist/pets/react/assets.js +1 -1
  142. package/dist/pets/react/components/album-view.d.ts +1 -1
  143. package/dist/pets/react/components/album-view.js +1 -1
  144. package/dist/pets/react/components/back-to-home.js +1 -1
  145. package/dist/pets/react/components/equip-view.d.ts +1 -1
  146. package/dist/pets/react/components/equip-view.js +1 -1
  147. package/dist/pets/react/components/gem-balance.js +1 -1
  148. package/dist/pets/react/components/home-view.js +1 -1
  149. package/dist/pets/react/components/insufficient-points-dialog.js +1 -1
  150. package/dist/pets/react/components/intro-overlay.js +1 -1
  151. package/dist/pets/react/components/loading-view.js +1 -1
  152. package/dist/pets/react/components/onboarding-guide.js +1 -1
  153. package/dist/pets/react/components/pet-bubble-background.js +1 -1
  154. package/dist/pets/react/components/pet-lounge.css +1 -0
  155. package/dist/pets/react/components/pet-lounge.js +1 -1
  156. package/dist/pets/react/components/pet-mode-button.js +1 -1
  157. package/dist/pets/react/components/pet-window.js +1 -1
  158. package/dist/pets/react/components/pull-overlay.d.ts +1 -1
  159. package/dist/pets/react/components/pull-overlay.js +1 -1
  160. package/dist/pets/react/components/pull-video.js +1 -1
  161. package/dist/pets/react/components/pull-view.d.ts +1 -1
  162. package/dist/pets/react/components/pull-view.js +1 -1
  163. package/dist/pets/react/components/quick-reply.js +1 -2
  164. package/dist/pets/react/components/session-icon.d.ts +2 -2
  165. package/dist/pets/react/components/session-icon.js +1 -1
  166. package/dist/pets/react/components/single-pet-toast.js +1 -1
  167. package/dist/pets/react/components/sprite-renderer.d.ts +1 -1
  168. package/dist/pets/react/components/sprite-renderer.js +1 -1
  169. package/dist/pets/react/components/vibemon-empty-state.js +1 -1
  170. package/dist/pets/react/components/vibemon-header.js +1 -1
  171. package/dist/pets/react/components/vibemon-page.js +1 -1
  172. package/dist/pets/react/components/vibemon-scene.js +1 -1
  173. package/dist/pets/react/components/video-fader.js +1 -1
  174. package/dist/pets/react/components/wish-button.js +1 -1
  175. package/dist/pets/react/index.d.ts +5 -5
  176. package/dist/pets/react/index.js +1 -1
  177. package/dist/pets/react/lib/account-state.d.ts +1 -1
  178. package/dist/pets/react/lib/account-state.js +1 -1
  179. package/dist/pets/react/lib/card-image.js +1 -1
  180. package/dist/pets/react/lib/resource-sync.d.ts +2 -2
  181. package/dist/pets/react/lib/resource-sync.js +1 -1
  182. package/dist/pets/react/lib/season.js +1 -1
  183. package/dist/pets/react/lib/use-season.d.ts +1 -1
  184. package/dist/pets/react/lib/use-season.js +1 -1
  185. package/dist/pets/react/lib/utils.js +1 -1
  186. package/dist/pets/react/ui/button.d.ts +2 -2
  187. package/dist/pets/react/ui/button.js +1 -1
  188. package/dist/pets/react/ui/card.js +1 -1
  189. package/dist/pets/react/ui/input-group.d.ts +3 -3
  190. package/dist/pets/react/ui/input-group.js +1 -1
  191. package/dist/pets/react/ui/textarea.js +1 -1
  192. package/dist/pets/resource-package.d.ts +2 -2
  193. package/dist/pets/resource-package.js +1 -1
  194. package/dist/pets/resources.d.ts +5 -5
  195. package/dist/pets/resources.js +1 -1
  196. package/dist/pets/selection.d.ts +1 -1
  197. package/dist/pets/selection.js +1 -1
  198. package/dist/pets/sheet-layout.js +1 -1
  199. package/dist/pets/types.js +1 -0
  200. package/dist/state.d.ts +2 -2
  201. package/dist/state.js +1 -1
  202. package/dist/token-storage.d.ts +1 -1
  203. package/dist/token-storage.js +1 -1
  204. package/dist/types.js +1 -0
  205. package/package.json +12 -12
@@ -1,2 +1 @@
1
- import{jsx as o,jsxs as v}from"react/jsx-runtime";import{cn as ee}from"cn";import{ArrowUpIcon as Pe,CheckIcon as Ue,PanelsTopLeftIcon as He,PencilLineIcon as Oe,XIcon as De}from"lucide-react";import{useCallback as ve,useEffect as ne,useEffectEvent as Ve,useLayoutEffect as ye,useRef as b,useState as p}from"react";import{useTranslation as Ge}from"react-i18next";import{sameBinding as We,vibemonHost as qe}from"../../core/host.js";import{advancePetSubmission as Ke}from"../../core/lib/reply-submission.js";import{getVibemonScopeSync as Qe,useVibemonState as Xe}from"../lib/account-state.js";import{Button as te}from"../ui/button.js";import{InputGroup as Ye,InputGroupAddon as Ze,InputGroupButton as P,InputGroupTextarea as Je}from"../ui/input-group.js";import{PetBubbleBackground as $e}from"./pet-bubble-background.js";import{SessionIcon as ke}from"./session-icon.js";var oe=18,se=oe/2,en={color:"var(--popover-foreground)",borderRadius:16,border:"1px solid var(--border)"},nn=(h)=>h.split(/[\\/]/).findLast(Boolean)??"",tn=(h,t)=>[nn(h.cwd),h.title||t].filter(Boolean).join(" / ");function hn({maxHeight:h}){let t=qe(),U=Xe(),Ee=Qe(),[Ie,re]=p(320);ne(()=>{let e=!1;if(re(320),h===void 0&&U.pet!=="")t.assets.resources.inspect(U.pet).then((s)=>{if(e)return;let n=s?.config?.bubbleAreaHeight;if(n!==void 0&&(typeof n!=="number"||!Number.isFinite(n)))throw Error("Pet bubble height must be a finite number");re(Math.max(typeof n==="number"?n:0,320))}).catch(t.onError);return()=>{e=!0}},[t,Ee,U.pet,h]);let{t:r}=Ge("common"),[i,Ne]=p(()=>t.sessions.snapshot()),[y,H]=p(""),[O,R]=p(!1),[m,k]=p(null),[le,D]=p(!1),[V,ie]=p(!1),[Ce,G]=p(""),[N,W]=p(!1),[Me,ae]=p(null),ce=b(null),A=b(!1),C=b(!1),u=b(null),q=b(null),g=b(null),ue=b(i),de=b(null),pe=b(null),K=ve((e)=>G(e instanceof Error?e.message:String(e)),[]),l=i?.binding??null,a=i,E=i,M=l?.connectionEpoch??null,S=l?.sessionId??null,Se=l?.bindingRevision??-1,Te=i?.owner??"",Q=i?.access!=="writable"||i.executionId!==null,Be=i!==null,_=ve(()=>{if(g.current?.abort(),g.current=null,W(!1),ae(null),H(""),R(!1),k(null),D(!1),q.current=null,G(""),A.current=!1,C.current=!1,u.current!==null)cancelAnimationFrame(u.current);u.current=null},[]);ne(()=>{let e=(n)=>{let x=ue.current;if(x===null||n===null||!We(x.binding,n.binding))_();if(ue.current=n,n!==null){if(n.state==="running")D(!0);k((I)=>I===null?I:Ke(I,n.state,n.since))}Ne(n)},s=t.sessions.subscribe(e);return e(t.sessions.snapshot()),document.addEventListener("vibemon:dismiss",_),()=>{if(s(),document.removeEventListener("vibemon:dismiss",_),g.current?.abort(),u.current!==null)cancelAnimationFrame(u.current)}},[t,_]);let T=()=>{if(l!==null)t.windows.call("bubble-interact",{binding:l}).catch(t.onError)},B=async(e)=>{if(g.current!==null)return;let s=new AbortController;g.current=s,T(),W(!0),G("");try{await e(s.signal)}catch(n){if(!s.signal.aborted)K(n)}finally{if(g.current===s)g.current=null,W(!1)}},Le=()=>t.windows.call("focus"),ze=(e)=>{if(l===null||i===null)throw Error("Pet conversation unavailable");return T(),t.windows.call("session-menu",{binding:l,candidates:i.candidates,position:e,onSelect:(s)=>B(()=>t.sessions.select(l,s))})},c=i?.state==="running",w=i?.state==="requires_action"||i?.prompt!=null,f=i?.prompt??null,Re=async(e,s,n)=>{if(l===null)throw Error(r("petMode.openToReply"));if(await t.sessions.answer(l,crypto.randomUUID(),e.token,s),!n.aborted)ae(e.token)},me=!N&&!Q&&!c&&!w&&y.trim()!==""&&Be,fe=async(e)=>{if(l===null||E===null)throw Error(r("petMode.openToReply"));let s=y.trim();q.current=E.reply?.messageId??null,k({sessionId:l.sessionId,text:s,startedAt:Date.now(),accepted:!1,sawRunning:!1,completed:!1});try{if(await t.sessions.send(l,crypto.randomUUID(),s),e.aborted)return;k((n)=>n===null?null:{...n,accepted:!0}),H("")}catch(n){if(!e.aborted)k(null);throw n}},X=()=>{if(l!==null)B(async(e)=>{await t.sessions.openChat(l),e.throwIfAborted()})},L=Ce||i?.error,Y=m?.completed||le&&(a?.state==="idle"||a?.state==="done"),F=E!==null&&!c&&!w&&!L&&Y&&E.reply?.messageId!==q.current?E.reply:null,Z=L?null:w?r("runState.requires_action"):c?r("petMode.thinking"):m?.completed?null:m?.accepted?r("petMode.sent"):null,be=m!==null,z=be||le,J=E?.userMessage??null,he=Y&&!c?null:(c||z)&&J!==null&&(m===null||J.timestamp>=m.startedAt)?J.text:be?m.text:null,j=!z&&!c&&!w,d=z&&Y&&!c&&!w&&!L,Ae=F?.messageId,_e=F?.text,we=l!==null,Fe=Ve(()=>{if(l!==null)t.windows.call("dismiss-result",{binding:l}).catch(t.onError)});ne(()=>{if(!d||V||!we)return;let e=setTimeout(Fe,1e4);return()=>clearTimeout(e)},[d,V,we,M,S,Se,Ae,_e,t]);let ge=w?320:d?260:c?240:320;ye(()=>{let e=de.current;if(e===null)return;let s=!1,n=()=>{let I=Math.ceil(e.getBoundingClientRect().height)+6;if(!s&&I>=32)t.windows.call("bubble-size",{width:ge+se*2,height:I}).catch(t.onError)},x=new ResizeObserver(n);return x.observe(e),n(),()=>{s=!0,x.disconnect()}},[t,ge,S]);let xe=a?r(a.windowLabel==="main"?"petMode.openMain":"petMode.openChat"):r("petMode.openFull");ye(()=>{if(y===""){R(!1);return}if(O||z||c)return;if(y.includes(`
2
- `)){R(!0);return}let e=ce.current;if(e===null)return;let s=()=>{let x=Math.ceil(Number.parseFloat(getComputedStyle(e).minHeight));if(e.scrollHeight>x)R(!0)};s();let n=new ResizeObserver(s);return n.observe(e),()=>n.disconnect()},[y,O,z,c]);let je=j?Ye:"div";return v("div",{ref:de,"data-pet-bubble":!0,className:"relative pb-1.5",style:{paddingTop:se,paddingInline:se},onPointerEnter:()=>ie(!0),onPointerLeave:()=>ie(!1),children:[S!==null&&o($e,{cardRef:pe}),S!==null&&v("div",{ref:pe,"data-pet-bubble-card":!0,role:"presentation",onClick:(e)=>{if(d&&e.target.closest("button")===null)X()},style:{...en,position:"relative",background:"transparent",borderColor:"transparent",boxShadow:"none",animation:"none",maxHeight:(h??Ie)-6},className:ee("overflow-y-auto p-2",d?"grid cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 px-3":c?"flex flex-col gap-1 py-1.5":"flex flex-col gap-2"),children:[he&&o("p",{className:"line-clamp-2 text-sm break-words whitespace-pre-wrap",children:he}),F!==null&&o("p",{className:"line-clamp-2 text-sm break-words whitespace-pre-wrap",children:F.text}),L&&o("p",{role:"alert",className:"text-muted-foreground text-xs",children:L}),f!==null&&v("section",{"aria-label":r(f.kind==="permission"?"petMode.permission":"petMode.question"),className:"flex min-w-0 flex-col gap-2",children:[o("p",{className:"text-sm break-words whitespace-pre-wrap",children:f.title}),f.detail!==""&&o("pre",{className:"text-muted-foreground max-h-24 overflow-auto text-xs break-words whitespace-pre-wrap",children:f.detail}),f.options.length>0&&!Q?o("div",{className:"flex flex-wrap gap-1",children:f.options.map((e)=>o(te,{size:"xs",className:"h-auto min-h-6 max-w-full whitespace-normal",disabled:N||Me===f.token,onClick:()=>void B((s)=>Re(f,e.id,s)),children:e.label},e.id))}):o(te,{size:"xs",onClick:X,children:r("petMode.openToAnswer")})]}),v(je,{className:d?"col-start-1 row-start-2":void 0,children:[j&&o(Je,{ref:ce,rows:1,className:"field-sizing-fixed max-h-[calc(3lh+1rem)] min-h-[calc(1lh+1rem)] min-w-0 overflow-y-auto",style:{height:O?"calc(3lh + 1rem)":"calc(1lh + 1rem)"},value:y,placeholder:r("petMode.placeholder"),"aria-label":r("petMode.placeholder"),disabled:N||Q||!Te||M===null,onChange:(e)=>{T(),H(e.target.value)},onFocus:()=>{T(),Le().catch(K)},onCompositionStart:()=>{if(u.current!==null)cancelAnimationFrame(u.current);u.current=null,C.current=!1,A.current=!0},onCompositionEnd:()=>{if(A.current=!1,C.current=!0,u.current!==null)cancelAnimationFrame(u.current);u.current=requestAnimationFrame(()=>{C.current=!1,u.current=null})},onKeyDown:(e)=>{if(e.key!=="Enter"||e.shiftKey||A.current||e.nativeEvent.isComposing||C.current||e.nativeEvent.keyCode===229)return;if(e.preventDefault(),me)B(fe)}}),v(Ze,{align:"block-end",className:ee("shrink-0",(d||c)&&"gap-1 p-0"),children:[v("div",{className:ee("flex min-w-0 items-center gap-2",!d&&"flex-1"),children:[Z&&o("p",{role:"status",className:"text-muted-foreground text-xs",children:c&&!w?o("span",{className:"shimmer",children:Z}):Z}),j?v(P,{className:"min-w-0 flex-1 justify-start",title:r("petMode.chooseSession"),"aria-label":r("petMode.chooseSession"),"aria-haspopup":"menu",disabled:N||M===null,onClick:(e)=>{let s=e.currentTarget.getBoundingClientRect();ze({x:s.left,y:s.bottom}).catch(K)},children:[a&&o("span",{role:"img","aria-label":r(a.windowLabel==="main"?"navigation.mainWindow":"navigation.chatWindow"),"data-icon":"inline-start",className:"inline-flex shrink-0",children:o(ke,{name:a.windowLabel,icons:t.sessionIcons})}),o("span",{className:"min-w-0 flex-1 truncate text-start",title:a?[a.cwd,a.title||r("collection.defaultChatTitle")].filter(Boolean).join(" / "):"",children:a?tn(a,r("collection.defaultChatTitle")):""})]}):!c&&o(P,{size:"icon-xs",className:d?"size-5":void 0,title:r("petMode.continue"),"aria-label":r("petMode.continue"),disabled:N||w||m!==null&&!m.accepted,onClick:()=>{T(),k(null),D(!1)},children:o(Oe,{})})]}),j&&o(P,{size:"icon-xs",variant:"default",className:"size-5 shrink-0",title:r("petMode.send"),"aria-label":r("petMode.send"),disabled:!me,onClick:()=>void B(fe),children:o(Pe,{className:"size-3"})}),o(P,{size:"icon-xs",className:"size-5 shrink-0",title:xe,"aria-label":xe,disabled:M===null||!a,onClick:X,children:a&&t.sessionIcons?o(ke,{name:a.windowLabel,icons:t.sessionIcons}):o(He,{className:"size-4"})})]})]}),d&&o("span",{role:"img","aria-label":r("petMode.completed"),title:r("petMode.completed"),className:"col-start-2 row-span-2 row-start-1 inline-flex size-7 items-center justify-center rounded-full bg-[var(--vibemon-completed-background)] text-[var(--vibemon-completed-foreground)]",children:o(Ue,{className:"size-4"})})]}),V&&M!==null&&S!==null&&o(te,{variant:"outline",size:"icon-xs",className:"text-muted-foreground absolute top-1 left-1 cursor-pointer rounded-full",style:{width:oe,height:oe},title:r("close"),"aria-label":r("close"),onClick:()=>void t.windows.call("bubble-close").catch(t.onError),children:o(De,{className:"size-2.5"})})]})}export{hn as PetQuickReply};
1
+ import{Ft}from"../../../chunk-vnnyvrrd.js";import"../../../chunk-sp65sdp3.js";import"../../../chunk-jf6z5rh7.js";import"../../../chunk-npcgz51c.js";import"../../../chunk-mnrtrr2j.js";import"../../../chunk-vz0m347h.js";import"../../../chunk-5jz8vnk5.js";import"../../../chunk-pha0eyam.js";import"../../../chunk-1hxexf7n.js";import"../../../chunk-yjdj2mf9.js";import"../../../chunk-w1z1g5c5.js";import"../../../chunk-38y9615y.js";import"../../../chunk-khnyadsg.js";import"../../../chunk-pbwt3qj9.js";import"../../../chunk-htw56xtp.js";import"../../../chunk-xs0abxzp.js";import"../../../chunk-afy09ajr.js";import"../../../chunk-21abksd2.js";import"../../../chunk-mmj02855.js";import"../../../chunk-9tramdds.js";import"../../../chunk-rerywpwe.js";import"../../../chunk-4gegjx79.js";export{Ft as PetQuickReply};
@@ -1,5 +1,5 @@
1
- import { type SessionIcons } from "../../core/session-icon.js";
2
- export { sessionIconSvg, type SessionIcons } from "../../core/session-icon.js";
1
+ import { type SessionIcons } from "../../core/session-icon";
2
+ export { sessionIconSvg, type SessionIcons } from "../../core/session-icon";
3
3
  export declare function SessionIcon({ name, icons }: {
4
4
  name: "main" | "chat";
5
5
  icons?: SessionIcons;
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{sessionIconSvg as o}from"../../core/session-icon.js";import{sessionIconSvg as c}from"../../core/session-icon.js";function t({name:e,icons:n}){return s("span",{"aria-hidden":!0,className:"inline-flex size-[18px] items-center justify-center",dangerouslySetInnerHTML:{__html:o(e,n)}})}export{t as SessionIcon,c as sessionIconSvg};
1
+ import{le}from"../../../chunk-vz0m347h.js";import{S}from"../../../chunk-1hxexf7n.js";export{le as SessionIcon,S as sessionIconSvg};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{AnimatePresence as r,motion as l,useReducedMotion as c}from"motion/react";import{useEffect as u}from"react";import{singlePetToast as d}from"../assets.js";import{Button as p}from"../ui/button.js";var m="This is your only pet. It’s equipped by default and can’t be unequipped ~",f=3000;function x({requestId:t,onClose:i}){let o=c(),n=t>0;return u(()=>{if(t===0)return;let s=window.setTimeout(i,f);return()=>window.clearTimeout(s)},[t,i]),e("div",{className:"pointer-events-none absolute bottom-[7.067%] left-1/2 z-30 h-[4.583cqw] w-[52.604cqw] -translate-x-1/2",children:e(r,{initial:!1,children:n&&a(l.div,{"data-testid":"single-pet-toast",className:"pointer-events-auto relative size-full",initial:{opacity:0,y:o?0:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:o?0:"100%"},transition:o?{duration:0}:{duration:0.3,ease:[0.16,1,0.3,1]},children:[e("img",{src:d,alt:"","aria-hidden":!0,className:"absolute inset-0 size-full max-w-none select-none"}),e("span",{role:"status",className:"sr-only",children:m}),e(p,{"aria-label":"Close",onClick:i,className:"absolute top-1/4 right-[5.743%] aspect-square h-1/2 rounded-full border-0 bg-transparent p-0 shadow-none transition-none hover:bg-white/10 focus-visible:border-white focus-visible:ring-white/70 active:translate-y-0",children:e("span",{className:"sr-only",children:"Close"})})]})})})}export{f as SINGLE_PET_TOAST_DURATION_MS,m as SINGLE_PET_TOAST_MESSAGE,x as SinglePetToast};
1
+ import{Xt,Kt,He}from"../../../chunk-vr4ye1z4.js";import"../../../chunk-5jz8vnk5.js";import"../../../chunk-2k8my1h9.js";export{Kt as SINGLE_PET_TOAST_DURATION_MS,Xt as SINGLE_PET_TOAST_MESSAGE,He as SinglePetToast};
@@ -1,4 +1,4 @@
1
- import type { VibemonSpriteConfig } from "../../core/types.js";
1
+ import type { VibemonSpriteConfig } from "../../core/types";
2
2
  interface SpriteRendererProps {
3
3
  config: VibemonSpriteConfig;
4
4
  spriteUrl: string;
@@ -1 +1 @@
1
- import{jsx as _}from"react/jsx-runtime";import{useCallback as g,useEffect as X,useRef as u,useState as q}from"react";function J({config:e,spriteUrl:v,stateId:k,flipped:G,active:p,staticImage:a,animTick:x,onFirstFrame:b,onDrawFrame:C,onRenderError:E,onMouseDown:V,onClick:Y}){let h=u(null),s=u(0),t=u(null),y=u(null),c=u(!1),[D,H]=q(!1),o=e.states.find((r)=>r.id===k),R=o?.row??0,S=o?.frames??1,I=o?.fps??3,w=o?.loop??!0,j=u(b);j.current=b;let F=u(C);F.current=C;let M=u(E);M.current=E;let z=g((r,n)=>{let W=h.current,l=y.current;if(!W||!l)return;let i=W.getContext("2d");if(!i)return;i.imageSmoothingEnabled=!1,i.clearRect(0,0,e.renderSize,e.renderSize);let f=a?l.naturalWidth:e.cropW,d=a?l.naturalHeight:e.cropH,m=e.renderSize/Math.max(f,d);i.drawImage(l,a?0:r*e.frameSize+e.cropX,a?0:n*(e.frameHeight??e.frameSize)+e.cropY,f,d,(e.renderSize-f*m)/2,(e.renderSize-d*m)/2,f*m,d*m),F.current?.()},[e,a]);return X(()=>{let r=!1;c.current=!1,H(!1);let n=new Image;return n.onload=()=>{if(r)return;y.current=n,H(!0)},n.onerror=()=>{if(!r)M.current?.(Error("Vibemon spritesheet could not be decoded"))},n.src=v,()=>{r=!0,n.onload=null,n.onerror=null}},[v]),X(()=>{if(!D||!p&&c.current)return;let r=h.current;if(!r)return;if(r.dataset.animationGeneration=String(x??0),t.current)clearInterval(t.current);if(s.current=0,z(0,R),!c.current)c.current=!0,j.current?.();if(!p)return;return t.current=setInterval(()=>{if(s.current++,s.current>=S){if(s.current=w?0:S-1,!w&&t.current)clearInterval(t.current),t.current=null}z(s.current,R)},1000/I),()=>{if(t.current)clearInterval(t.current)}},[R,S,I,w,x,D,p,z]),_("canvas",{ref:h,width:e.renderSize,height:e.renderSize,onMouseDown:(r)=>{if(r.button!==0)return;r.preventDefault(),V()},onClick:(r)=>{if(r.button!==0)return;Y()},style:{width:"100%",height:"100%",imageRendering:"pixelated",transform:G?"scaleX(-1)":void 0,cursor:"pointer",pointerEvents:"auto"}})}export{J as SpriteRenderer};
1
+ import{R}from"../../../chunk-j3ez3fz2.js";export{R as SpriteRenderer};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{emptyPet as o}from"../assets.js";import{Button as s}from"../ui/button.js";function c({onWish:r}){return t("div",{className:"absolute inset-x-0 top-[18%] bottom-[8%] flex flex-col items-center justify-center",children:[e("img",{src:o,alt:"",className:"w-[10.938cqw] shrink-0 drop-shadow-[0_18px_28px_rgba(31,15,92,0.35)] select-none"}),t("p",{className:"mt-[1.5cqh] max-w-[19.792cqw] px-[1.25cqw] text-center text-[0.938cqw] leading-relaxed text-white/60",children:["No Vibémon to keep your lobby company~",e("br",{}),"draw one home!"]}),e(s,{onClick:r,className:"mt-[4cqh] h-[5.5cqh] min-w-[10.417cqw] rounded-full border border-white/75 bg-[linear-gradient(180deg,#C579F2_0%,#8A4FDB_100%)] px-[1.875cqw] text-[1.25cqw] font-black text-white shadow-[0_8px_18px_rgba(50,20,126,0.35),inset_0_2px_2px_rgba(255,255,255,0.5)] hover:bg-[linear-gradient(180deg,#CF87F6_0%,#9458E2_100%)]",style:{fontFamily:"Outfit, system-ui, sans-serif"},children:"Go Pull"})]})}export{c as VibemonEmptyState};
1
+ import{B}from"../../../chunk-0x7ssxpn.js";import"../../../chunk-5jz8vnk5.js";import"../../../chunk-2k8my1h9.js";export{B as VibemonEmptyState};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import{useState as r}from"react";import{openAccountUrl as m}from"../../core/lib/recharge.js";import{albumIcon as i,pullBack as d,pullVibemonIcon as u}from"../assets.js";import{Button as p}from"../ui/button.js";import{BackToHome as b}from"./back-to-home.js";import{GemBalance as f}from"./gem-balance.js";import{WishButton as g}from"./wish-button.js";function q({action:a}){let[n,o]=r(!1),t=a.kind==="album";return s(p,{"aria-label":t?"Album":"Vibémon",onClick:a.onClick,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:"relative size-[3.333cqw] bg-transparent p-0 shadow-none hover:bg-transparent",children:[e("img",{src:t?i:u,alt:"",className:"size-full object-contain transition-transform duration-150 select-none",style:{transform:n?"translateY(-2px) scale(1.05)":"none"}}),t&&a.hasUnseen&&e("span",{className:"absolute top-0 right-0 size-2 rounded-full bg-[#F74640]"})]})}function N({onBack:a,onWish:n,sectionAction:o,availablePoints:t,pointsLoaded:c}){return s(l,{children:[e(b,{onClick:a,label:"Back",iconSrc:d,className:"absolute top-[5.333%] left-[6.25%] z-30 gap-[0.729cqw] text-[#BCACE0] hover:text-[#BCACE0] [&_img]:size-[3.021cqw] [&_span]:text-[1.667cqw]"}),s("div",{className:"absolute top-[5%] right-[6.25%] z-30 flex h-[5.5cqh] items-center gap-[2.292cqw]",children:[e(q,{action:o}),e(g,{onClick:n,className:"size-[3.333cqw]"}),e(f,{amount:t,onAdd:m,loaded:c,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]"})]})]})}export{N as VibemonHeader};
1
+ import{N}from"../../../chunk-zhbj6cm5.js";import"../../../chunk-p1ywvmqa.js";import"../../../chunk-mandqn4e.js";import"../../../chunk-37ctfsy1.js";import"../../../chunk-0gf7vwzk.js";import"../../../chunk-xrw9s1th.js";import"../../../chunk-5jz8vnk5.js";import"../../../chunk-2k8my1h9.js";import"../../../chunk-14dfwbk0.js";import"../../../chunk-htw56xtp.js";export{N as VibemonHeader};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as F}from"react/jsx-runtime";import{Loader2 as De}from"lucide-react";import{useCallback as P,useEffect as h,useRef as S,useState as n}from"react";import{useTranslation as He}from"react-i18next";import{toast as Ce}from"sonner";import{vibemonHost as Ne}from"../../core/host.js";import{createDrawReward as ke}from"../../core/lib/draw-result.js";import{drawGachaPool as Oe,getGachaFirstDraw as Ue,getMyVibemons as Ge,getPointAccount as fe,markVibemonFirstVisit as qe}from"../../core/lib/endpoints.js";import{gachaPoolImageUrls as Fe,loadGachaPoolCatalog as Me}from"../../core/lib/gacha-pools.js";import{preloadImages as pe}from"../../core/lib/preload-images.js";import{getSetting as we,getSettingSync as E,setSetting as be}from"../../core/lib/settings.js";import{consumePendingVibemonView as Te,onVibemonViewRequest as je}from"../../core/lib/view-request.js";import{gem as Be,gemPlus as We,guideArrow as $e,guideHand as ze,guideHandShape as Je,guideHandSheen as Ke,guideHomeTexture as Qe,guideMascot as ve,guidePullTexture as Xe,guideRing as Ye,homeBackground as Ze,homeHotspotAssets as c,pullAlbumIcon as eo,pullBack as oo,pullGem as no,pullPageBackground as to,pullTexture as ro,pullVibemonIcon as io}from"../assets.js";import{equipVibemonAfterDraw as ao,getVibemonScopeSync as _}from"../lib/account-state.js";import{cardThumb as ge}from"../lib/card-image.js";import{syncVibemonResources as so}from"../lib/resource-sync.js";import{AlbumView as lo}from"./album-view.js";import{EquipView as co}from"./equip-view.js";import{HomeView as uo}from"./home-view.js";import{INTRO_VIDEO_URL as mo,IntroOverlay as fo}from"./intro-overlay.js";import{VibemonLoadingView as po}from"./loading-view.js";import{PullOverlay as wo}from"./pull-overlay.js";import{PullView as go}from"./pull-view.js";var ho=30000,M=[Ze,c.vibemon.icon,c.vibemon.hover,c.vibemon.text,c.wish.icon,c.wish.hover,c.wish.text,c.album.icon,c.album.hover,c.album.text,$e,Qe,ve],he=[to,oo,io,eo,ro,no,Be,We,Xe,ze,Je,Ke,ve,Ye],T=(r)=>{let a=_();return!!(a&&r[a])},j=(r,a)=>{let l=_();if(!l)return;be(r,{...E(r),[l]:a})},B=(r)=>{let a=_();if(!a)return null;return r[a]??null},bo=(r)=>{let a=_();if(!a)return;be("vibemon.onboardingStep",{...E("vibemon.onboardingStep"),[a]:r})};function jo(){return t("div",{className:"contents",onContextMenu:(r)=>r.preventDefault(),children:t(vo,{})})}function vo(){let{t:r}=He("vibemon"),[a,l]=n(()=>{let e=B(E("vibemon.onboardingStep"));return e==="free-draw"||e==="view-album"?"pull":"home"}),[I,u]=n("idle"),[m,Pe]=n(()=>B(E("vibemon.onboardingStep"))),[f,W]=n(!1),[L,x]=n(!1),[b,Se]=n([]),[Ee,z]=n(null),[y,Ie]=n(!1),[A,J]=n(0),[D,K]=n(!1),[ye,Re]=n([]),[Ve,Q]=n(!1),[H,_e]=n(null),[X,Y]=n(null),[Z,ee]=n({done:0,total:he.length}),[oe,Le]=n(!1),[p,v]=n(()=>T(E("vibemon.introSeen"))?"loading":"resolving-intro"),[ne,xe]=n({done:0,total:M.length}),[te,Ae]=n(null),re=S(!1),R=P((e)=>{Pe(e),bo(e)},[]),d=P(()=>l("pull"),[]);h(()=>{if(p!=="loading"||re.current)return;re.current=!0,pe(M,(e)=>{xe({done:e,total:M.length})}).catch((e)=>{let o=e instanceof Error?e:Error(String(e));Ae(o)})},[p]);let ie=S(0),ae=S(!1),C=S(!1),w=P(async()=>{let e=++ie.current;try{let o=await Ge();if(e===ie.current)Se(o),Ie(!0),z(null)}catch(o){z(o instanceof Error?o:Error(String(o))),console.warn("[vibemon] getMyVibemons failed",o)}},[]),se=S(!1),le=S(!1),N=P(async()=>{try{let e=await Me();Y(null);let o=[...new Set([...he,...Fe(e)])],s=!se.current;if(s)ee({done:0,total:o.length});if(await pe(o,(V)=>{if(s)ee({done:V,total:o.length})}),_e(e),s)se.current=!0,Le(!0)}catch(e){let o=e instanceof Error?e:Error(String(e));console.error("[vibemon] loadGachaPoolCatalog failed",o),Y(o)}},[]);h(()=>{if(p!=="loading"||le.current)return;le.current=!0,N()},[p,N]),h(()=>{let e=()=>{fe().then((s)=>{J(s.available_points),K(!0)}).catch((s)=>console.warn("[vibemon] getPointAccount failed",s))};e();let o=setInterval(e,ho);return window.addEventListener("focus",e),()=>{clearInterval(o),window.removeEventListener("focus",e)}},[]),h(()=>{for(let e of b)new Image().src=ge(e.gacha_url??e.cover_url)},[b]);let k=()=>{if(L)j("vibemon.albumHasUnseen",!1),x(!1);w(),l("album")},g=P(()=>{w(),l("equip")},[w]);h(()=>{if(ae.current)return;ae.current=!0,w(),Promise.all([Ue().catch((e)=>(console.warn("[vibemon] getGachaFirstDraw failed",e),{first_draw:!1})),we("vibemon.albumHasUnseen")]).then(([e,o])=>{if(W(e.first_draw),x(T(o)),!e.first_draw)return;if(B(E("vibemon.onboardingStep"))==="free-draw"){d();return}R("home-wish"),l("home")}),we("vibemon.introSeen").then((e)=>{if(T(e)){v("loading");return}return qe().then(({first_visit:o})=>{if(j("vibemon.introSeen",!0),o)l("home"),u("intro"),v("intro");else v("loading")})}).catch((e)=>{console.warn("[vibemon] first-visit check failed",e),v("loading")})},[d,w,R]);let[de,ce]=n(!1),O=P((e)=>{if(f&&m==="home-wish")return;if(f&&m==="free-draw"){d();return}if(e==="pull")d();else if(e==="equip")g();else ce(!0)},[f,m,g,d]);if(h(()=>{let e=Te();if(e)O(e);return je(O)},[O]),h(()=>{if(!de||!y)return;if(ce(!1),b.length===0)d();else g()},[de,y,b.length,g,d]),Ee!==null)return F("div",{role:"alert",className:"bg-background text-foreground flex h-full flex-col items-center justify-center gap-3 p-6",children:[t("p",{children:r("offline.title")}),t("p",{className:"text-muted-foreground text-sm",children:r("offline.description")}),t("button",{type:"button",className:"rounded-md border px-4 py-2",onClick:()=>void w(),children:r("offline.retry")})]});if(p==="resolving-intro")return F("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden bg-[#120E18]",children:[t("video",{src:mo,preload:"auto",muted:!0,playsInline:!0,"aria-hidden":!0,className:"pointer-events-none absolute top-0 left-0 h-px w-px opacity-0"}),t(De,{className:"size-10 animate-spin text-white"})]});if(p==="intro")return t("div",{className:"relative h-full w-full overflow-hidden bg-[#120E18]",children:t(fo,{onVideoStart:()=>u("intro"),onDone:()=>{u("idle"),v("loading")}})});if(te!==null)throw te;if(X!==null)throw X;if(p==="loading"){let e=ne.done+Z.done+(H===null?0:1)+(oe?1:0),o=ne.total+Z.total+2;return t("div",{className:"relative h-full w-full overflow-hidden",children:t(po,{progress:e/o,onFinished:()=>v("ready")})})}if(a==="home")return t(uo,{onDraw:()=>{if(m==="home-wish")R("free-draw");d()},onBackpack:k,onEquip:g,guideActive:f&&m==="home-wish"});if(a==="equip")return t(co,{onBack:()=>l("home"),onWish:d,onAlbum:k,albumHasUnseen:L,ownedCards:b,ownedLoaded:y,availablePoints:A,pointsLoaded:D});if(a==="album")return t(lo,{onBack:()=>l("home"),onWish:d,onEquip:g,ownedCards:b,ownedLoaded:y,availablePoints:A,pointsLoaded:D});if(H===null||!oe)throw Error("[vibemon] app entered ready state before gacha resources were loaded");let ue=async(e,o)=>{if(C.current||I!=="idle")return;C.current=!0,Q(!0);try{let s;try{s=await Oe(e,o)}catch(i){console.warn("[vibemon] drawGachaPool failed",i),Ce.error(r("draw.failedNetwork"));return}let V=o==="SINGLE"?1:10;if(s.results.length!==V)throw Error(`[vibemon] ${o} draw response must contain ${V} results, received ${s.results.length}`);await Promise.all(s.results.map(async(i)=>{if(i.reward_type==="WHITE_CARD"||!i.vibemon_uuid)return;Object.assign(i,await Ne().assets.resolveImages(i.vibemon_uuid))}));let me=s.results.map(ke),U=[];for(let[i,G]of s.results.entries()){if(G.reward_type==="WHITE_CARD")continue;U.push(G);let q=me[i];if(q?.kind!=="card")throw Error(`[vibemon] draw result ${G.draw_index} was not mapped to a Vibemon card`);new Image().src=ge(o==="SINGLE"?q.singleImageUrl:q.multiImageUrl)}if(Re(me),W(!1),m==="free-draw")R("view-album");if(u("video-waiting"),U.length>0){let i=U[0];if(i===void 0)throw Error("[vibemon] draw result lost its first Vibemon item");so(),ao(i.vibemon_uuid,f),w()}N(),fe().then((i)=>{J(i.available_points),K(!0)}).catch((i)=>console.warn("[vibemon] getPointAccount failed",i))}finally{C.current=!1,Q(!1)}};return F("div",{className:"relative h-full w-full",children:[t(go,{onBack:()=>l("home"),onAlbum:k,onEquip:g,isFirstDraw:f,availablePoints:A,pointsLoaded:D,onSingleDraw:(e)=>void ue(e,"SINGLE"),onMultiDraw:(e)=>void ue(e,"MULTI"),drawDisabled:Ve||I!=="idle",albumHasUnseen:L,guideActive:f&&m==="free-draw",poolCatalog:H}),I!=="intro"&&t(wo,{phase:I,drawnRewards:ye,onVideoStarted:()=>u("video-playing"),onPullDone:()=>u("result"),onPullFailed:()=>u("result"),onResultConfirmed:(e)=>{if(e)j("vibemon.albumHasUnseen",!0),x(!0);u("idle")}})]})}export{jo as VibemonPage};
1
+ import{Gt}from"../../../chunk-5v4zm9s3.js";import"../../../chunk-2aq8zkwb.js";import"../../../chunk-hj17ea3j.js";import"../../../chunk-wcenmfkf.js";import"../../../chunk-m18rjmg2.js";import"../../../chunk-0ze5xzg5.js";import"../../../chunk-8kcmwm3k.js";import"../../../chunk-my19acdk.js";import"../../../chunk-fkj53yw2.js";import"../../../chunk-mnrtrr2j.js";import"../../../chunk-vr4ye1z4.js";import"../../../chunk-q8ebj5e6.js";import"../../../chunk-8xd6kn1b.js";import"../../../chunk-z5nmdjb9.js";import"../../../chunk-wbvah1ty.js";import"../../../chunk-2skzpxsk.js";import"../../../chunk-zhbj6cm5.js";import"../../../chunk-p1ywvmqa.js";import"../../../chunk-mandqn4e.js";import"../../../chunk-37ctfsy1.js";import"../../../chunk-0gf7vwzk.js";import"../../../chunk-xrw9s1th.js";import"../../../chunk-0x7ssxpn.js";import"../../../chunk-w5yer870.js";import"../../../chunk-5jz8vnk5.js";import"../../../chunk-2k8my1h9.js";import"../../../chunk-70nb6x0r.js";import"../../../chunk-j03we9jz.js";import"../../../chunk-b5zfgr86.js";import"../../../chunk-yjdj2mf9.js";import"../../../chunk-1mq984ah.js";import"../../../chunk-9wqfns8y.js";import"../../../chunk-2x5tzfgv.js";import"../../../chunk-g47n16v3.js";import"../../../chunk-4h2756zy.js";import"../../../chunk-w1z1g5c5.js";import"../../../chunk-14dfwbk0.js";import"../../../chunk-khnyadsg.js";import"../../../chunk-pbwt3qj9.js";import"../../../chunk-44at74bw.js";import"../../../chunk-htw56xtp.js";import"../../../chunk-9h4j75af.js";import"../../../chunk-v9czb1e6.js";import"../../../chunk-xs0abxzp.js";import"../../../chunk-afy09ajr.js";import"../../../chunk-21abksd2.js";import"../../../chunk-mmj02855.js";import"../../../chunk-9tramdds.js";import"../../../chunk-rerywpwe.js";import"../../../chunk-4gegjx79.js";export{Gt as VibemonPage};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";function n({backdrop:i,children:s}){return t("div",{className:"[container-type:size] relative h-full w-full overflow-hidden bg-[#0E0750]",children:[i,e("div",{className:"absolute inset-0 flex items-center justify-center",children:e("div",{"data-testid":"vibemon-stage",className:"[container-type:size] relative",style:{width:"min(100cqw, 160cqh)",aspectRatio:"8 / 5"},children:s})})]})}export{n as VibemonScene};
1
+ import{p}from"../../../chunk-w5yer870.js";export{p as VibemonScene};
@@ -1 +1 @@
1
- import{jsx as h,jsxs as q}from"react/jsx-runtime";import{useLayoutEffect as D,useRef as t,useState as M}from"react";var z=1,G=100,H=1000;function P({src:u,sources:l,playing:R=!0,active:a=!0,background:k,onFirstFrame:A,onComplete:L,onError:F}){let m=t(null),_=t(null),c=t(0),p=t(!1),I=t(u===void 0?{sources:l}:{src:u});I.current=u===void 0?{sources:l}:{src:u};let[C,y]=M(0),[O,v]=M(!1),n=u??l.map((e)=>`${e.type}:${e.src}`).join("|"),w=t(n),N=t(L),S=t(A),j=t(F);return N.current=L,S.current=A,j.current=F,D(()=>{let e=m.current;if(e===null)throw Error("Video player is not mounted");if(!a)return;if(p.current=!1,w.current!==n)c.current=0;w.current=n;let o=I.current;if("src"in o)e.src=o.src;else{let s=e.querySelectorAll("source");o.sources.forEach((r,d)=>{s[d].setAttribute("src",r.src)})}e.defaultMuted=!0,e.muted=!0;let i=()=>{p.current=!0};return e.addEventListener("error",i),e.load(),()=>{c.current=e.currentTime,e.removeEventListener("error",i),e.pause(),e.removeAttribute("src");for(let s of e.querySelectorAll("source"))s.removeAttribute("src");e.load()}},[n,a]),D(()=>{let e=m.current,o=_.current;if(e===null||o===null)throw Error("Video player is not mounted");if(o.style.opacity="0",y(0),v(!1),!R){if(c.current=0,a)e.pause(),e.currentTime=0;return}if(!a)return;e.currentTime=c.current;let i=!1,s=!1,r=!1,d=!1,E=null,T=null,b=null,V=()=>{if(s||!e.duration)return;if(e.duration-e.currentTime<z)s=!0,y(1)},x=()=>{if(r)return;T=setTimeout(()=>{v(!0),y(0),b=setTimeout(()=>{if(r)return;r=!0,N.current()},H)},G)},f=()=>{if(i||r)return;r=!0,v(!0),j.current()};if(E=e.requestVideoFrameCallback(()=>{if(i||r||d||e.dataset.sourceKey!==n)return;d=!0,o.style.opacity="1",S.current()}),e.addEventListener("timeupdate",V),e.addEventListener("ended",x),e.addEventListener("error",f),p.current)f();else e.play().catch(f);return()=>{if(i=!0,e.removeEventListener("timeupdate",V),e.removeEventListener("ended",x),e.removeEventListener("error",f),E!==null)e.cancelVideoFrameCallback(E);if(T)clearTimeout(T);if(b)clearTimeout(b)}},[n,R,a]),q("div",{ref:_,"data-video-presentation":!0,className:"pointer-events-none absolute inset-0 z-20",style:{opacity:0,background:k},children:[h("video",{ref:m,"data-source-key":n,preload:"auto",muted:!0,playsInline:!0,className:"absolute inset-0 z-20 h-full w-full object-cover",style:{visibility:O?"hidden":"visible"},children:l===void 0?null:l.map((e)=>h("source",{type:e.type},`${e.type}:${e.src}`))}),h("div",{className:"pointer-events-none absolute inset-0 z-20 bg-white transition-opacity duration-1000 ease-in",style:{opacity:C}})]})}export{P as VideoFader};
1
+ import{T}from"../../../chunk-q8ebj5e6.js";export{T as VideoFader};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as r}from"react";import{newTag as i,wishDefault as l,wishHover as m}from"../assets.js";import{cn as c}from"../lib/utils.js";import{Button as p}from"../ui/button.js";function w({onClick:o,className:s}){let[n,e]=r(!1);return a(p,{"aria-label":"Wish",variant:"ghost",className:c("relative size-[64px] p-0 hover:bg-transparent",s),onClick:o,onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[t("img",{src:n?m:l,alt:"",className:"absolute top-[5.439%] left-[4.863%] h-[89.122%] w-[90.27%] max-w-none object-contain select-none"}),t("img",{src:i,alt:"",className:"pointer-events-none absolute top-[4.422%] left-[50.578%] h-[26.03%] w-[49.428%] max-w-none select-none"})]})}export{w as WishButton};
1
+ import{je}from"../../../chunk-p1ywvmqa.js";import"../../../chunk-xrw9s1th.js";import"../../../chunk-5jz8vnk5.js";import"../../../chunk-2k8my1h9.js";export{je as WishButton};
@@ -1,5 +1,5 @@
1
- export { VibemonPage as PetCenter } from "./components/vibemon-page.js";
2
- export { PetWindow } from "./components/pet-window.js";
3
- export { PetQuickReply } from "./components/quick-reply.js";
4
- export { PetModeButton } from "./components/pet-mode-button.js";
5
- export { PetLounge } from "./components/pet-lounge.js";
1
+ export { VibemonPage as PetCenter } from "./components/vibemon-page";
2
+ export { PetWindow } from "./components/pet-window";
3
+ export { PetQuickReply } from "./components/quick-reply";
4
+ export { PetModeButton } from "./components/pet-mode-button";
5
+ export { PetLounge } from "./components/pet-lounge";
@@ -1 +1 @@
1
- import{VibemonPage as t}from"./components/vibemon-page.js";import{PetWindow as m}from"./components/pet-window.js";import{PetQuickReply as P}from"./components/quick-reply.js";import{PetModeButton as n}from"./components/pet-mode-button.js";import{PetLounge as i}from"./components/pet-lounge.js";export{t as PetCenter,i as PetLounge,n as PetModeButton,P as PetQuickReply,m as PetWindow};
1
+ import"../../chunk-htw56xtp.js";import"../../chunk-g47n16v3.js";import"../../chunk-9wqfns8y.js";import"../../chunk-1mq984ah.js";import"../../chunk-9h4j75af.js";import"../../chunk-w1z1g5c5.js";import"../../chunk-70nb6x0r.js";import"../../chunk-2k8my1h9.js";import"../../chunk-pbwt3qj9.js";import"../../chunk-rerywpwe.js";import"../../chunk-afy09ajr.js";import"../../chunk-9tramdds.js";import"../../chunk-4gegjx79.js";import"../../chunk-mmj02855.js";import"../../chunk-21abksd2.js";import"../../chunk-xs0abxzp.js";import"../../chunk-khnyadsg.js";import"../../chunk-yjdj2mf9.js";import"../../chunk-mnrtrr2j.js";import"../../chunk-2skzpxsk.js";import"../../chunk-4h2756zy.js";import"../../chunk-fkj53yw2.js";import"../../chunk-2x5tzfgv.js";import"../../chunk-xrw9s1th.js";import"../../chunk-5jz8vnk5.js";import"../../chunk-0x7ssxpn.js";import"../../chunk-14dfwbk0.js";import"../../chunk-0gf7vwzk.js";import"../../chunk-37ctfsy1.js";import"../../chunk-mandqn4e.js";import"../../chunk-p1ywvmqa.js";import"../../chunk-zhbj6cm5.js";import"../../chunk-w5yer870.js";import"../../chunk-wbvah1ty.js";import"../../chunk-v9czb1e6.js";import"../../chunk-44at74bw.js";import"../../chunk-j03we9jz.js";import"../../chunk-vr4ye1z4.js";import"../../chunk-my19acdk.js";import"../../chunk-m18rjmg2.js";import"../../chunk-2aq8zkwb.js";import"../../chunk-q8ebj5e6.js";import"../../chunk-hj17ea3j.js";import"../../chunk-b5zfgr86.js";import"../../chunk-8xd6kn1b.js";import"../../chunk-8kcmwm3k.js";import"../../chunk-0ze5xzg5.js";import"../../chunk-z5nmdjb9.js";import"../../chunk-wcenmfkf.js";import{Gt}from"../../chunk-5v4zm9s3.js";import"../../chunk-hk9j0kvg.js";import"../../chunk-jjb1befc.js";import"../../chunk-mdqxdcxh.js";import"../../chunk-3vpcfe38.js";import"../../chunk-9zhxpvxw.js";import"../../chunk-96emfz6b.js";import"../../chunk-kwq26qhs.js";import"../../chunk-nbzm95mz.js";import"../../chunk-j3ez3fz2.js";import{Ht}from"../../chunk-ms8jh9xz.js";import"../../chunk-pha0eyam.js";import"../../chunk-jf6z5rh7.js";import"../../chunk-sp65sdp3.js";import"../../chunk-38y9615y.js";import"../../chunk-npcgz51c.js";import"../../chunk-1hxexf7n.js";import"../../chunk-vz0m347h.js";import{Ft}from"../../chunk-vnnyvrrd.js";import{$t}from"../../chunk-4xk0z8t0.js";import"../../chunk-7xtvv8a7.js";import"../../chunk-5w675j2g.js";import{Ot}from"../../chunk-bgc7s9q5.js";export{Gt as PetCenter,Ot as PetLounge,$t as PetModeButton,Ft as PetQuickReply,Ht as PetWindow};
@@ -1,2 +1,2 @@
1
- export * from "../../core/lib/account-state.js";
1
+ export * from "../../core/lib/account-state";
2
2
  export declare const useVibemonState: () => import("../../core/lib/settings").PetAccountState;
@@ -1 +1 @@
1
- import{useSyncExternalStore as t}from"react";import{currentState as r}from"../../core/lib/account-state.js";import{subscribeSettings as e}from"../../core/lib/settings.js";export*from"../../core/lib/account-state.js";var n=()=>t(e,r);export{n as useVibemonState};
1
+ import{d}from"../../../chunk-mnrtrr2j.js";import{a,Q,X,h,de}from"../../../chunk-yjdj2mf9.js";import"../../../chunk-w1z1g5c5.js";import"../../../chunk-khnyadsg.js";import"../../../chunk-pbwt3qj9.js";import"../../../chunk-htw56xtp.js";import"../../../chunk-xs0abxzp.js";import"../../../chunk-afy09ajr.js";import"../../../chunk-21abksd2.js";import"../../../chunk-mmj02855.js";import"../../../chunk-9tramdds.js";import"../../../chunk-rerywpwe.js";import"../../../chunk-4gegjx79.js";export{Q as currentState,de as equipVibemonAfterDraw,a as getVibemonScopeSync,X as getVibemonState,h as updateVibemonState,d as useVibemonState};
@@ -1 +1 @@
1
- import{placeholderCard as e}from"../assets.js";var o=["https://static.alwith.ai/","https://static-alwith-ai-dev.tos-ap-southeast-1.bytepluses.com/"],i="x-tos-process=image/format,webp",a=e;function r(t){if(!t)return a;if(!o.some((s)=>t.startsWith(s)))return t;if(t.includes("x-tos-process="))return t;return`${t}${t.includes("?")?"&":"?"}${i}`}export{r as cardThumb};
1
+ import{i}from"../../../chunk-2skzpxsk.js";import"../../../chunk-2k8my1h9.js";export{i as cardThumb};
@@ -1,5 +1,5 @@
1
- import { type ResourceSyncStatus } from "../../core/lib/resource-sync.js";
1
+ import { type ResourceSyncStatus } from "../../core/lib/resource-sync";
2
2
  export declare const useVibemonSyncStore: <T>(selector: (state: {
3
3
  status: ResourceSyncStatus;
4
4
  }) => T) => T;
5
- export { syncVibemonResources } from "../../core/lib/resource-sync.js";
5
+ export { syncVibemonResources } from "../../core/lib/resource-sync";
@@ -1 +1 @@
1
- import{useStore as e}from"zustand";import{vibemonSyncStore as r}from"../../core/lib/resource-sync.js";import{syncVibemonResources as i}from"../../core/lib/resource-sync.js";var n=(o)=>e(r,o);export{i as syncVibemonResources,n as useVibemonSyncStore};
1
+ import{Me}from"../../../chunk-fkj53yw2.js";import{te}from"../../../chunk-4h2756zy.js";import"../../../chunk-khnyadsg.js";import"../../../chunk-pbwt3qj9.js";import"../../../chunk-htw56xtp.js";import"../../../chunk-xs0abxzp.js";import"../../../chunk-afy09ajr.js";import"../../../chunk-21abksd2.js";import"../../../chunk-mmj02855.js";import"../../../chunk-9tramdds.js";import"../../../chunk-rerywpwe.js";import"../../../chunk-4gegjx79.js";export{te as syncVibemonResources,Me as useVibemonSyncStore};
@@ -1 +1 @@
1
- import{SolarTime as u}from"tyme4ts";var s={立春:"spring",雨水:"spring",惊蛰:"spring",春分:"spring",清明:"spring",谷雨:"spring",立夏:"summer",小满:"summer",芒种:"summer",夏至:"summer",小暑:"summer",大暑:"summer",立秋:"autumn",处暑:"autumn",白露:"autumn",秋分:"autumn",寒露:"autumn",霜降:"autumn",立冬:"winter",小雪:"winter",大雪:"winter",冬至:"winter",小寒:"winter",大寒:"winter"},i={spring:"autumn",summer:"winter",autumn:"spring",winter:"summer"};function g(e=new Date,m="north"){let t=new Date(e.getTime()+28800000),r=u.fromYmdHms(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()).getTerm().getName(),n=s[r];if(!n)throw Error(`Unknown solar term: ${r}`);return m==="south"?i[n]:n}export{g as currentSeason};
1
+ import{Ee}from"../../../chunk-7xtvv8a7.js";export{Ee as currentSeason};
@@ -1,2 +1,2 @@
1
- import { type Season } from "./season.js";
1
+ import { type Season } from "./season";
2
2
  export declare function useSeason(): Season;
@@ -1 +1 @@
1
- import{currentSeason as r}from"./season.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 c(){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 t(){return r(new Date,c())}export{t as useSeason};
1
+ import{Ie}from"../../../chunk-5w675j2g.js";import"../../../chunk-7xtvv8a7.js";export{Ie as useSeason};
@@ -1 +1 @@
1
- import{cn as c}from"cn";export{c as cn};
1
+ import{o}from"../../../chunk-xrw9s1th.js";export{o as cn};
@@ -1,8 +1,8 @@
1
1
  import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
- size?: "icon" | "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
4
+ variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
5
+ size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
8
8
  export { Button, buttonVariants };
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{Button as n}from"@base-ui/react/button";import{cva as d}from"class-variance-authority";import{cn as o}from"cn";var s=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 g({className:e,variant:r="default",size:i="default",...t}){return a(n,{"data-slot":"button",className:o(s({variant:r,size:i,className:e})),...t})}export{g as Button,s as buttonVariants};
1
+ import{Jt,t}from"../../../chunk-5jz8vnk5.js";export{t as Button,Jt as buttonVariants};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{cn as d}from"cn";function c({className:a,size:r="default",...e}){return t("div",{"data-slot":"card","data-size":r,className:d("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),...e})}function n({className:a,...r}){return t("div",{"data-slot":"card-header",className:d("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),...r})}function i({className:a,...r}){return t("div",{"data-slot":"card-title",className:d("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...r})}function l({className:a,...r}){return t("div",{"data-slot":"card-description",className:d("text-muted-foreground text-sm",a),...r})}function u({className:a,...r}){return t("div",{"data-slot":"card-action",className:d("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...r})}function g({className:a,...r}){return t("div",{"data-slot":"card-content",className:d("flex flex-col gap-3 px-(--card-spacing)",a),...r})}function p({className:a,...r}){return t("div",{"data-slot":"card-footer",className:d("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...r})}export{c as Card,u as CardAction,g as CardContent,l as CardDescription,p as CardFooter,n as CardHeader,i as CardTitle};
1
+ import{We,hn,bn,wn,vn,yn,xn}from"../../../chunk-37ctfsy1.js";export{We as Card,vn as CardAction,yn as CardContent,wn as CardDescription,xn as CardFooter,hn as CardHeader,bn as CardTitle};
@@ -1,13 +1,13 @@
1
1
  import { type VariantProps } from "class-variance-authority";
2
2
  import * as React from "react";
3
- import { Button } from "./button.js";
3
+ import { Button } from "./button";
4
4
  declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
5
  declare const inputGroupAddonVariants: (props?: ({
6
- align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
6
+ align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
9
9
  declare const inputGroupButtonVariants: (props?: ({
10
- size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
10
+ size?: "icon-sm" | "icon-xs" | "sm" | "xs" | null | undefined;
11
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
12
  declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> & VariantProps<typeof inputGroupButtonVariants> & {
13
13
  type?: "button" | "submit" | "reset";
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{cn as o}from"cn";import{Button as u}from"./button.js";import{Textarea as l}from"./textarea.js";function m({className:a,...t}){return n("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",a),...t})}var d=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 x({className:a,align:t="inline-start",...i}){return n("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:o(d({align:t}),a),onClick:(r)=>{if(r.target.closest("button"))return;r.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}var p=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:a,type:t="button",variant:i="ghost",size:r="xs",...e}){return n(u,{type:t,"data-size":r,variant:i,className:o(p({size:r}),a),...e})}function k({className:a,...t}){return n(l,{"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",a),...t})}export{m as InputGroup,x as InputGroupAddon,v as InputGroupButton,k as InputGroupTextarea};
1
+ import{qe,De,V,Le}from"../../../chunk-sp65sdp3.js";import"../../../chunk-jf6z5rh7.js";import"../../../chunk-5jz8vnk5.js";export{qe as InputGroup,De as InputGroupAddon,V as InputGroupButton,Le as InputGroupTextarea};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{cn as a}from"cn";function n({className:r,...i}){return e("textarea",{"data-slot":"textarea",className:a("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",r),...i})}export{n as Textarea};
1
+ import{ze}from"../../../chunk-jf6z5rh7.js";export{ze as Textarea};
@@ -1,5 +1,5 @@
1
- import type { PetAssetsHost } from "./host.js";
2
- import { type SheetLayout } from "./sheet-layout.js";
1
+ import type { PetAssetsHost } from "./host";
2
+ import { type SheetLayout } from "./sheet-layout";
3
3
  export declare const IMAGE_ASSETS: readonly ["cover", "gacha", "multi_draw", "icon", "background", "pool_card", "sidebar_selected", "sidebar_hover", "sidebar_unselected"];
4
4
  export type ImageAsset = (typeof IMAGE_ASSETS)[number];
5
5
  export interface PackageAsset {
@@ -1 +1 @@
1
- import{Unzip as j,UnzipInflate as k}from"fflate";import{parseSheetLayout as A}from"./sheet-layout.js";var z=["cover","gacha","multi_draw","icon","background","pool_card","sidebar_selected","sidebar_hover","sidebar_unselected"],g=209715200,d=65536,E=new TextDecoder("utf-8",{fatal:!0});function P(e){return e.length>0&&!/[\\\u0000-\u001f:]/.test(e)&&e.split("/").every((n)=>n!==""&&n!=="."&&n!=="..")}async function Z(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 _(e){if(e.length>d)throw Error("Vibemon manifest exceeds 64 KiB");let n=JSON.parse(E.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 o=new Set;for(let[,t]of a){if(!t||typeof t.path!=="string"||!P(t.path)||t.path==="manifest.json"||typeof t.sha256!=="string"||!/^[a-f0-9]{64}$/.test(t.sha256)||o.has(t.path))throw Error("Invalid Vibemon asset reference");o.add(t.path)}if(Boolean(n.assets.sheet)!==Boolean(n.assets.layout))throw Error("Vibemon animation requires both sheet and layout");return n}function M(e){let n=new DataView(e.buffer,e.byteOffset,e.byteLength),a=(r,f)=>String.fromCharCode(...e.subarray(r,r+f)),o="",t=0,s=0;if(e.length>=24&&e[0]===137&&a(1,3)==="PNG")o="image/png",t=n.getUint32(16),s=n.getUint32(20);else if(e.length>=10&&/GIF8[79]a/.test(a(0,6)))o="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"){o="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){o="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:o,width:t,height:s}}async function O(e,n,a){let o=0,t=null,s=null;for(let[r,f]of Object.entries(e.assets)){let c=await n(f.path);if(c===null||await Z(c)!==f.sha256)throw Error(`Vibemon asset checksum mismatch: ${r}`);if(o+=c.length,o>g)throw Error("Vibemon resource expansion limit exceeded");if(r==="layout"){if(c.length>d)throw Error("Vibemon layout exceeds 64 KiB");t=A(E.decode(c))}else if(r==="sheet"||z.includes(r)){let h=M(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 L(e,n){if(e.length>g)throw Error("Vibemon ZIP exceeds 200 MiB");let a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=e.length-22;while(o>=Math.max(0,e.length-65557)&&a.getUint32(o,!0)!==101010256)o--;if(o<0||e.length<22||a.getUint32(o,!0)!==101010256||o+22+a.getUint16(o+20,!0)!==e.length||a.getUint16(o+4,!0)!==0||a.getUint16(o+6,!0)!==0||a.getUint32(o+16,!0)+a.getUint32(o+12,!0)!==o)throw Error("Incomplete or unsupported Vibemon ZIP");let t=new Map,s=new Set,r=0,f=0,c=new j((i)=>{let l=i.name.endsWith("/"),u=l?i.name.slice(0,-1):i.name;if(!P(u)||s.has(u)||s.size>=44)throw Error("Invalid or duplicate Vibemon ZIP path");if((i.originalSize??0)>g)throw Error("Vibemon ZIP expansion limit exceeded");s.add(u);let p=[],m=0;i.ondata=(x,w,S)=>{if(x)throw x;if(r+=w.length,m+=w.length,r>g||(i.name==="manifest.json"||i.name.endsWith(".json"))&&m>d)throw Error("Vibemon ZIP expansion limit exceeded");if(p.push(w),S){let I=new Uint8Array(m),U=0;for(let V of p)I.set(V,U),U+=V.length;if(l){if(m!==0)throw Error("Invalid Vibemon ZIP directory")}else{if(t.size>=12)throw Error("Too many Vibemon ZIP files");t.set(i.name,I)}f++}},i.start()});c.register(k);for(let i=0;i<e.length;i+=65536)if(c.push(e.subarray(i,i+65536),i+65536>=e.length),i>0&&i%1048576===0)await new Promise((l)=>setTimeout(l,0));if(f!==s.size||s.size!==a.getUint16(o+10,!0)||!t.has("manifest.json"))throw Error("Incomplete Vibemon ZIP");let h=_(t.get("manifest.json")),b=new Set(["manifest.json",...Object.values(h.assets).map((i)=>i.path)]);if([...t.keys()].some((i)=>!b.has(i)))throw Error("Unexpected Vibemon ZIP file");let v=await O(h,(i)=>Promise.resolve(t.get(i)??null),n);return{files:t,manifest:h,layout:v}}export{z as IMAGE_ASSETS,g as PACKAGE_LIMIT,M as imageInfo,_ as parseManifest,P as resourcePath,Z as sha256,L as unpackResourcePackage,O as validatePackageFiles};
1
+ import{y,_e,ie,se,Pe,E,Se,zt}from"../chunk-mmj02855.js";import"../chunk-4gegjx79.js";export{y as IMAGE_ASSETS,_e as PACKAGE_LIMIT,E as imageInfo,Pe as parseManifest,ie as resourcePath,se as sha256,zt as unpackResourcePackage,Se as validatePackageFiles};
@@ -1,8 +1,8 @@
1
- import { type PetAssetsHost } from "./host.js";
2
- import { type ImageAsset, type PackageManifest } from "./resource-package.js";
3
- import { type SheetLayout } from "./sheet-layout.js";
4
- import type { VibemonResourceDescriptor } from "./types.js";
5
- export { parseSheetLayout, type SheetLayout } from "./sheet-layout.js";
1
+ import { type PetAssetsHost } from "./host";
2
+ import { type ImageAsset, type PackageManifest } from "./resource-package";
3
+ import { type SheetLayout } from "./sheet-layout";
4
+ import type { VibemonResourceDescriptor } from "./types";
5
+ export { parseSheetLayout, type SheetLayout } from "./sheet-layout";
6
6
  export interface CachedPetMetadata {
7
7
  directory: string;
8
8
  sheetName: string | null;
@@ -1 +1 @@
1
- import{assertAccount as i}from"./host.js";import{IMAGE_ASSETS as W,imageInfo as q,parseManifest as B,resourcePath as D,sha256 as J,unpackResourcePackage as F,validatePackageFiles as Z}from"./resource-package.js";import{parseSheetLayout as I}from"./sheet-layout.js";import{parseSheetLayout as ne}from"./sheet-layout.js";var R=new TextEncoder,N=new TextDecoder;function G(r,w){let p=w.resource_package_format??0;return(r.format??0)===p&&r.version===(w.resource_version??null)&&(r.sourceUrl===void 0?p===0:r.sourceUrl===(p===1?w.resource_url:w.sheet_url))}function Y(r){let w=!1,p=new Map,_=new Map,V=new Map,S=new Map,k=new Set,O=Promise.resolve();function U(e){if(w)throw Error("Vibemon resources disposed");let o=r.account();if(o===null)throw Error("Sign in to load Vibemon resources");if(!/^[a-zA-Z0-9_-]+$/.test(e)||!/^[a-zA-Z0-9.-]+$/.test(o.apiHost))throw Error("Invalid resource identity");return`vibemon/catalog/${o.apiHost}/${e}`}function P(e){let o=r.account();if(o===null)return Promise.reject(Error("Sign in to load Vibemon resources"));let n=`${U(e)}/${o.userId}/${o.revision}`,a=_.get(n);if(a)return a;let s=H(e).finally(()=>{if(_.get(n)===s)_.delete(n)});return _.set(n,s),s}async function H(e){let o=r.account();if(o===null)throw Error("Sign in to load Vibemon resources");let n=U(e),a=await r.resources.read(`${n}/resource.json`);if(a===null){for(let l of[n,`vibemon/${o.apiHost}/${o.userId}/${e}`]){let f=await r.resources.read(`${l}/config.json`);if(f===null)continue;let t=JSON.parse(N.decode(f));if(!/^sprite-sheet\.(webp|png)$/.test(t.spritesheet))throw Error("Invalid legacy sprite filename");let v=I(JSON.stringify({frameWidth:t.frameSize,frameHeight:t.frameSize,states:t.states}));if(await r.resources.exists(`${l}/${t.spritesheet}`)){let y=await r.storage.get("vibemon.resourceVersion");return i(r,o),{directory:l,sheetName:t.spritesheet,layout:v,version:y?.[o.apiHost]?.[e]??0,config:t}}}return null}let s;try{s=JSON.parse(N.decode(a))}catch{return null}if(!s||s.format!==void 0&&s.format!==0&&s.format!==1)return null;if(s.format===1)try{let l=await r.resources.read(`${n}/manifest.json`),f=await r.resources.read(`${n}/resource.zip`);if(!l||!f||await J(f)!==s.archiveSha256)return null;let t=B(l),v=await Z(t,(y)=>r.resources.read(`${n}/${y}`));return i(r,o),{...s,directory:n,manifest:t,layout:v,sheetName:t.assets.sheet?.path??null}}catch{return i(r,o),null}let c=JSON.parse(N.decode(a));if(I(JSON.stringify(c.layout)),!/^sprite-sheet\.(webp|png)$/.test(c.sheet))throw Error("Invalid sprite filename");let u=await r.resources.exists(`${n}/${c.sheet}`);i(r,o);let g=await r.resources.read(`${n}/config.json`);return i(r,o),!u?null:{directory:n,sheetName:c.sheet,name:c.name,layout:c.layout,version:c.version,format:0,sourceUrl:s.sourceUrl,config:g===null?void 0:JSON.parse(N.decode(g))}}async function L(e){let o=r.account();if(o===null)throw Error("Sign in to load Vibemon resources");let n=await P(e);if(n===null)return null;if(n.sheetName===null)return{...n,sheet:null};let a=await r.resources.read(`${n.directory}/${n.sheetName}`);return i(r,o),a===null?null:{...n,sheet:a}}function M(e){let o=r.account();if(o===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 n=U(e.uuid),a=JSON.stringify([o.revision,e.resource_package_format??0,e.resource_version??null,e.resource_url,e.sheet_url,e.layout]),s=p.get(n);if(s?.key===a)return s.work;let c=(V.get(n)??0)+1;V.set(n,c);let u=()=>{if(i(r,o),w||V.get(n)!==c)throw Error("Vibemon resource request superseded")},l=(async()=>{await s?.work.catch(()=>{}),u();let f=await L(e.uuid);if(i(r,o),f!==null&&G(f,e))return{...f,name:e.name};let t=e.resource_package_format??0;if(t!==0&&t!==1)throw Error(`Unsupported Vibemon resource format: ${t}`);if(t===1&&!e.resource_url)throw Error("Vibemon package URL is missing");if(t===0&&(!e.sheet_url||!e.layout))throw Error("Vibemon animation is unavailable");let v=t===0?I(e.layout):null,y=new URL(t===1?e.resource_url:e.sheet_url);if(y.protocol!=="https:")throw Error("Vibemon sprites require HTTPS");let j=y.pathname.toLowerCase().endsWith(".png")?"sprite-sheet.png":"sprite-sheet.webp",h=new AbortController;k.add(h);let d=`${n}.${crypto.randomUUID()}.tmp`;try{let b=await r.download(y.href,h.signal);if(u(),t===1){let m=await F(b,r.validateImage);u();for(let[T,C]of m.files)await r.resources.write(`${d}/${T}`,C);await r.resources.write(`${d}/resource.zip`,b);let E={directory:n,format:1,sourceUrl:e.resource_url,version:e.resource_version??null,name:e.name,manifest:m.manifest,layout:m.layout,sheetName:m.manifest.assets.sheet?.path??null,archiveSha256:await J(b)};return await r.resources.write(`${d}/resource.json`,R.encode(JSON.stringify(E))),u(),h.signal.throwIfAborted(),await r.resources.replace(d,n),{...E,sheet:E.sheetName?m.files.get(E.sheetName):null}}if(b.byteLength===0)throw Error("Empty Vibemon spritesheet");await r.resources.write(`${d}/${j}`,b),await r.resources.write(`${d}/resource.json`,R.encode(JSON.stringify({layout:v,version:e.resource_version??null,sheet:j,name:e.name,sourceUrl:e.sheet_url}))),i(r,o),h.signal.throwIfAborted(),u(),await r.resources.replace(d,n),i(r,o);let A=O.catch(()=>{}).then(async()=>{i(r,o);let m=await r.storage.get("vibemon.resourceVersion")??{};i(r,o),await r.storage.set("vibemon.resourceVersion",{...m,[o.apiHost]:{...m[o.apiHost],[e.uuid]:e.resource_version??0}})});return O=A,await A,i(r,o),{directory:n,sheetName:j,sheet:b,name:e.name,layout:v,version:e.resource_version??null,format:0,sourceUrl:e.sheet_url}}finally{k.delete(h),await r.resources.remove(d)}})().finally(()=>{if(p.get(n)?.work===l)p.delete(n)});return p.set(n,{key:a,generation:c,work:l}),l}async function z(e){if(e.format!==1||!e.manifest)return{};let o=e.manifest,n={};return await Promise.all(W.map(async(a)=>{let s=o.assets[a];if(!s){n[a]=null;return}if(!D(s.path))throw Error("Invalid cached Vibemon path");if(r.resources.url)n[a]=`${await r.resources.url(`${e.directory}/${s.path}`)}?v=${s.sha256}`;else{let c=`${e.directory}/${s.sha256}`,u=S.get(c);if(!u){let g=await r.resources.read(`${e.directory}/${s.path}`);if(g===null)throw Error("Cached Vibemon image is missing");u=URL.createObjectURL(new Blob([new Uint8Array(g).buffer],{type:q(g).mime})),S.set(c,u)}n[a]=u}})),n}function x(){for(let e of k)e.abort();k.clear()}return{inspect:P,visuals:z,async preview(e){let o=e.manifest?.assets.cover??e.manifest?.assets.icon;return o?r.resources.read(`${e.directory}/${o.path}`):null},cached:L,ensure:M,cancel:x,dispose(){w=!0,x();for(let e of S.values())URL.revokeObjectURL(e);S.clear()}}}export{Y as createPetResources,G as matchesResource,ne as parseSheetLayout};
1
+ import{re,xe}from"../chunk-21abksd2.js";import"../chunk-mmj02855.js";import"../chunk-rerywpwe.js";import{m}from"../chunk-4gegjx79.js";export{xe as createPetResources,re as matchesResource,m as parseSheetLayout};
@@ -1,4 +1,4 @@
1
- import { type PetAssetsHost } from "./host.js";
1
+ import { type PetAssetsHost } from "./host";
2
2
  export declare function createPetSelection(host: PetAssetsHost, owned: (petId: string) => Promise<readonly {
3
3
  vibemon_uuid: string;
4
4
  }[]>): {
@@ -1 +1 @@
1
- import{accountKey as u,assertAccount as c}from"./host.js";function w(n,s){let a=Promise.resolve();return{get:async()=>{let e=n.account();if(e===null)return null;let t=await n.storage.get("vibemon.accounts");return c(n,e),t?.[u(e)]?.pet||null},async select(e){let t=n.account();if(t===null)throw Error("Sign in to select a Vibemon");if(e!==null&&!(await s(e)).some((o)=>o.vibemon_uuid===e))throw Error("This account does not own the selected Vibemon");c(n,t);let r=a.catch(()=>{}).then(async()=>{c(n,t);let o=await n.storage.get("vibemon.accounts")??{};c(n,t);let i=u(t);await n.storage.set("vibemon.accounts",{...o,[i]:{...o[i],pet:e??""}}),c(n,t)});a=r,await r}}}export{w as createPetSelection};
1
+ import{Ae}from"../chunk-9tramdds.js";import"../chunk-rerywpwe.js";export{Ae as createPetSelection};
@@ -1 +1 @@
1
- function i(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}export{i as parseSheetLayout};
1
+ import{m}from"../chunk-4gegjx79.js";export{m as parseSheetLayout};
@@ -0,0 +1 @@
1
+ import"../chunk-pbwt3qj9.js";
package/dist/state.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { createTokenStorage } from "./token-storage.js";
2
- import type { AuthUser, LoginResponse } from "./types.js";
1
+ import type { createTokenStorage } from "./token-storage";
2
+ import type { AuthUser, LoginResponse } from "./types";
3
3
  export interface AuthState {
4
4
  user: AuthUser | null;
5
5
  isAuthenticated: boolean;
package/dist/state.js CHANGED
@@ -1 +1 @@
1
- function w(e){let{tokenStorage:l,loadUser:d,saveUser:s,clearAllAuth:f}=e.storage,n=0;return(r,o)=>({user:null,isAuthenticated:!1,isLoading:!0,_initialized:!1,init:()=>{if(o()._initialized)return;r({_initialized:!0}),e.onInit();let a=n;(async()=>{try{let i=await l.getAccess(),t=await l.getRefresh();if(a!==n)return;if(!i||!t){await e.handleUnauthenticated(),r({isLoading:!1});return}let v=e.validateProfile(),c=await d();if(a!==n)return;if(!v){if(c)r({user:c,isAuthenticated:!0}),e.loadProviders();return}if(c)r({user:c,isAuthenticated:!0,isLoading:!1}),e.onSignedIn(c,"restore");e.loadProviders();try{let u=await e.getProfile();if(a!==n)return;let g={user_uuid:u.uuid,nickname:u.nickname,login_email:u.login_email,avatar:u.avatar};r({user:g,isAuthenticated:!0}),await s(g),e.onProfileRestored()}catch{let u=await d();if(a!==n)return;if(u)r({user:u,isAuthenticated:!0});else await f(),e.clearProviders(),r({user:null,isAuthenticated:!1})}if(!c)r({isLoading:!1})}catch(i){console.error("[auth] session restore failed unexpectedly",i)}finally{if(o().isLoading)r({isLoading:!1})}})(),e.subscribeExpired(()=>{n++,e.clearAccountConversation(o().user).then(e.handleUnauthenticated).then((i)=>{if(i)return;r({user:null,isAuthenticated:!1})})}),e.subscribeState((i)=>{if(i.action==="logout")n++,e.clearAccountConversation(o().user).then(e.handleUnauthenticated).then((t)=>{if(t)return;e.clearProviders(),r({user:null,isAuthenticated:!1})});else if(i.action==="login"&&i.user)n++,r({user:i.user,isAuthenticated:!0}),e.loadProviders();else if(i.action==="update"&&i.user)r({user:i.user})})},login:async(a)=>{n++,await l.save(a.access_token,a.refresh_token);let i={user_uuid:a.user_uuid,nickname:a.nickname,login_email:a.login_email};await s(i),r({user:i,isAuthenticated:!0}),e.loadProviders(),await e.broadcast({action:"login",user:i}),e.onSignedIn(i,"login")},logout:async()=>{if(n++,e.clearProviders(),await e.logoutApi(),await e.clearAccountConversation(o().user),await f(),await e.broadcast({action:"logout"}),await e.handleUnauthenticated())return;r({user:null,isAuthenticated:!1})},refreshUser:async()=>{try{let a=await e.getProfile(),i={user_uuid:a.uuid,nickname:a.nickname,login_email:a.login_email,avatar:a.avatar};r({user:i}),await s(i)}catch(a){console.warn("[auth] refreshUser failed",a)}},updateUser:(a)=>{let i=o().user;if(!i)return;let t={...i,...a};r({user:t}),s(t),e.broadcast({action:"update",user:t})}})}export{w as createAuthState};
1
+ import{nn}from"./chunk-d13j3xks.js";export{nn as createAuthState};
@@ -1,4 +1,4 @@
1
- import type { AuthUser } from "./types.js";
1
+ import type { AuthUser } from "./types";
2
2
  export interface AuthStore {
3
3
  get: <T>(key: string) => Promise<T | undefined>;
4
4
  set: (key: string, value: unknown) => Promise<void>;
@@ -1 +1 @@
1
- function r(a){return`auth.${new URL(a).host}`}function u(a){let e={ACCESS:"access_token",REFRESH:"refresh_token",DEVICE_ID:"device_id",USER:"user"},n={save:async(t,S)=>{await a.set(e.ACCESS,t),await a.set(e.REFRESH,S)},getAccess:async()=>await a.get(e.ACCESS)??"",getRefresh:async()=>await a.get(e.REFRESH)??"",updateAccess:async(t)=>{await a.set(e.ACCESS,t)},clear:async()=>{await a.delete(e.ACCESS),await a.delete(e.REFRESH)},getDeviceId:async()=>{let t=await a.get(e.DEVICE_ID);if(!t)t=crypto.randomUUID(),await a.set(e.DEVICE_ID,t);return t}};async function i(t){await a.set(e.USER,t)}async function E(){return await a.get(e.USER)??null}async function c(){await a.delete(e.USER)}async function s(){await n.clear(),await c()}return{tokenStorage:n,saveUser:i,loadUser:E,clearUser:c,clearAllAuth:s}}export{r as authStoreName,u as createTokenStorage};
1
+ import{pn,fn}from"./chunk-m96z2xh6.js";export{pn as authStoreName,fn as createTokenStorage};
package/dist/types.js CHANGED
@@ -0,0 +1 @@
1
+ import"./chunk-8w0zccsf.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-auth",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,7 +59,8 @@
59
59
  "import": "./dist/pets/react/locales.js",
60
60
  "default": "./dist/pets/react/locales.js"
61
61
  },
62
- "./pets/styles.css": "./dist/pets/react/styles.css"
62
+ "./pets/styles.css": "./dist/pets/react/styles.css",
63
+ "./assets/*": "./assets/*"
63
64
  },
64
65
  "files": [
65
66
  "dist",
@@ -71,13 +72,12 @@
71
72
  ],
72
73
  "devDependencies": {
73
74
  "typescript": "^7.0.2",
74
- "@types/bun": "^1.4.3",
75
+ "@types/bun": "^1.4.4",
75
76
  "@types/react": "^19.3.0",
76
77
  "@types/react-dom": "^19.3.0"
77
78
  },
78
79
  "scripts": {
79
80
  "test": "bun test src",
80
- "typecheck": "tsc --noEmit",
81
81
  "build": "bun ../../../scripts/build-npm.ts",
82
82
  "prepack": "bun run build"
83
83
  },
@@ -92,21 +92,21 @@
92
92
  "directory": "crates/auth/guest-js"
93
93
  },
94
94
  "dependencies": {
95
- "@base-ui/react": "^1.8.0",
95
+ "@base-ui/react": "^1.9.0",
96
96
  "class-variance-authority": "^0.7.1",
97
97
  "cn": "^0.5.0",
98
98
  "fflate": "0.8.3",
99
- "i18next": "^26.4.2",
100
- "lucide-react": "^1.49.0",
101
- "motion": "^13.4.6",
102
- "react-i18next": "^17.0.15",
99
+ "i18next": "^26.5.10",
100
+ "lucide-react": "^1.61.0",
101
+ "motion": "^14.6.0",
102
+ "react-i18next": "^17.1.8",
103
103
  "sonner": "^2.0.8",
104
104
  "tyme4ts": "^1.5.3",
105
- "zustand": "^5.0.15"
105
+ "zustand": "^5.0.16"
106
106
  },
107
107
  "peerDependencies": {
108
- "react": "^19.3.0",
109
- "react-dom": "^19.3.0"
108
+ "react": "^19.3.1",
109
+ "react-dom": "^19.3.1"
110
110
  },
111
111
  "peerDependenciesMeta": {
112
112
  "react": {