{"release_id":"01a1998d-9802-0000-b0f7-33a23307f4ed","chunk_id":"01a1998d-9814-7153-af07-e9824875ae56","file":"4-Ljm7Wg.mjs","mappings":"wVAyCO,MAAMA,EAAYC,EAAyB,CAAE,KAAM,GAAO,EAK1D,SAASC,EAAcC,EAAeC,EAAeC,EAA4B,CACvFL,EAAU,IAAI,CAAE,KAAM,GAAM,KAAAG,EAAM,KAAAC,EAAM,QAAAC,EAAS,CAClD,CAEO,SAASC,GAAiB,CAChCN,EAAU,OAAQO,IAAO,CAAE,GAAGA,EAAG,KAAM,IAAQ,CAChD","names":["authSheet","writable","openAuthSheet","next","flow","context","closeAuthSheet","s"],"sources":["../../../../../../src/lib/stores/authSheet.ts"],"sourcesContent":["import { writable } from 'svelte/store';\n\n/**\n * RAT-272 follow-up: global controller for the AuthSheet bottom sheet.\n *\n * Anonymous users hit the core chat / live-rating entry points (the\n * BottomNav messages slot, a live rater in LiveRatersRail, a floor room's\n * \"back to chat\" arrow) and used to get bounced by a full-page 303 to\n * `/auth/sign-in` — losing scroll position and eating a cold-function\n * spin-up on the auth route. That friction shows up as repeated\n * cross-session signup abandonment.\n *\n * Instead of each surface mounting its own AuthSheet (only BottomNav did,\n * and it's hidden on /floor), a single sheet is mounted once in the root\n * layout and driven from here. Any component can call `openAuthSheet(next)`\n * to raise the in-place sheet with the destination the user was reaching\n * for, so a successful sign-in lands them there instead of on a cold route.\n */\n\n/** RAT-519: what the visitor is signing in *for* — \"get rated by @x\", \"keep\n *  chatting with Mia\". Replaces the sheet's generic header, so the sheet reads\n *  as the next step of what they were doing rather than a wall in front of it. */\nexport interface AuthSheetContext {\n\ttitle: string;\n\tdetail?: string;\n\t/** A face to put on it: the person or character on the other side. */\n\timageUrl?: string | null;\n}\n\ninterface AuthSheetState {\n\topen: boolean;\n\t/** Where to send the user once auth completes (e.g. the chat thread they\n\t *  tapped). Undefined → stay on the current page after signing in. */\n\tnext?: string;\n\t/** Analytics label for the surface that raised the sheet (e.g. 'rate_reuse'\n\t *  for the upload-step signup hook). Undefined → AuthSheet's own default. */\n\tflow?: string;\n\t/** Undefined → the sheet's own generic header. */\n\tcontext?: AuthSheetContext;\n}\n\nexport const authSheet = writable<AuthSheetState>({ open: false });\n\n/** Raise the sign-in sheet. Pass `next` when the tap was headed somewhere\n *  gated so the user lands there after signing in, and `flow` to label which\n *  surface raised it (keeps the conversion measurable per entry point). */\nexport function openAuthSheet(next?: string, flow?: string, context?: AuthSheetContext) {\n\tauthSheet.set({ open: true, next, flow, context });\n}\n\nexport function closeAuthSheet() {\n\tauthSheet.update((s) => ({ ...s, open: false }));\n}\n"],"version":3}