@alfadocs/ui-kit-debug 0.43.0 → 0.44.0
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.
- package/dist/_chunks/{bmi-calculator-DuVSFDuw.js → bmi-calculator-DFPWL2OJ.js} +92 -78
- package/dist/_chunks/bmi-calculator-DFPWL2OJ.js.map +1 -0
- package/dist/_chunks/{calculator-dialog-DdexHrTP.js → calculator-dialog-D-nfvteH.js} +2 -2
- package/dist/_chunks/{calculator-dialog-DdexHrTP.js.map → calculator-dialog-D-nfvteH.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-Dln-y1k_.js → cycle-calculator-ChHBcjet.js} +58 -50
- package/dist/_chunks/cycle-calculator-ChHBcjet.js.map +1 -0
- package/dist/_chunks/dialog-BTpZV6It.js +223 -0
- package/dist/_chunks/dialog-BTpZV6It.js.map +1 -0
- package/dist/_chunks/{due-date-calculator-Cc4dRqTI.js → due-date-calculator-CYXKLoof.js} +50 -38
- package/dist/_chunks/due-date-calculator-CYXKLoof.js.map +1 -0
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
- package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js.map +1 -0
- package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
- package/dist/_chunks/insert-result-CoC1oo6R.js.map +1 -0
- package/dist/_chunks/{pregnancy-weight-gain-zZL5Ir2-.js → pregnancy-weight-gain-C5YhfYnL.js} +66 -57
- package/dist/_chunks/pregnancy-weight-gain-C5YhfYnL.js.map +1 -0
- package/dist/_chunks/{unit-converter-CuXCXJhK.js → unit-converter-Ds9jalbN.js} +78 -67
- package/dist/_chunks/unit-converter-Ds9jalbN.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/_shared/index.d.ts.map +1 -1
- package/dist/components/_shared/insert-result.d.ts +100 -10
- package/dist/components/_shared/insert-result.d.ts.map +1 -1
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
- package/dist/components/bmi-calculator/bmi-calculator.d.ts.map +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
- package/dist/components/cycle-calculator/cycle-calculator.d.ts.map +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +1 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
- package/dist/components/due-date-calculator/due-date-calculator.d.ts.map +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts.map +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts.map +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +6 -0
- package/dist/components/unit-converter/unit-converter.d.ts.map +1 -1
- package/dist/index.js +494 -493
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/bmi-calculator-DuVSFDuw.js.map +0 -1
- package/dist/_chunks/cycle-calculator-Dln-y1k_.js.map +0 -1
- package/dist/_chunks/dialog-DOYgd75U.js +0 -224
- package/dist/_chunks/dialog-DOYgd75U.js.map +0 -1
- package/dist/_chunks/due-date-calculator-Cc4dRqTI.js.map +0 -1
- package/dist/_chunks/gestational-age-calculator-ZMSrzkRW.js +0 -179
- package/dist/_chunks/gestational-age-calculator-ZMSrzkRW.js.map +0 -1
- package/dist/_chunks/insert-result-DisOY2G-.js +0 -243
- package/dist/_chunks/insert-result-DisOY2G-.js.map +0 -1
- package/dist/_chunks/pregnancy-weight-gain-zZL5Ir2-.js.map +0 -1
- package/dist/_chunks/unit-converter-CuXCXJhK.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cycle-calculator-ChHBcjet.js","sources":["../../node_modules/lucide-react/dist/esm/icons/droplet.js","../../src/components/cycle-calculator/cycle.ts","../../src/components/cycle-calculator/cycle-calculator.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z\",\n key: \"c7niix\"\n }\n ]\n];\nconst Droplet = createLucideIcon(\"droplet\", __iconNode);\n\nexport { __iconNode, Droplet as default };\n//# sourceMappingURL=droplet.js.map\n","/* ------------------------------------------------------------------ */\n/* Menstrual-cycle prediction — pure, framework-free, unit-testable. */\n/* */\n/* Uses the standard fixed-luteal-phase model: ovulation falls ~14 days */\n/* before the next period, so on a cycle of length L ovulation is day */\n/* (L − 14). The fertile window spans the 5 days before ovulation */\n/* (sperm survival) through 1 day after (oocyte viability). */\n/* ------------------------------------------------------------------ */\n\nimport { addDays } from 'date-fns';\n\n/** Standard menstrual-cycle length. */\nexport const DEFAULT_CYCLE_LENGTH = 28;\n/** Luteal phase is biologically near-constant at ~14 days. */\nexport const LUTEAL_PHASE_DAYS = 14;\n/** Sperm survive up to ~5 days before ovulation. */\nexport const FERTILE_DAYS_BEFORE = 5;\n/** The oocyte is viable ~1 day after ovulation. */\nexport const FERTILE_DAYS_AFTER = 1;\n\nexport interface CycleInput {\n /** First day of the most recent period. */\n lastPeriodStart: Date;\n /** Average cycle length in days. Defaults to 28. */\n cycleLength?: number;\n /** Period (bleed) length in days. Optional — used for the period range. */\n periodLength?: number;\n}\n\nexport interface DateRange {\n start: Date;\n end: Date;\n}\n\nexport interface CyclePrediction {\n /** Start date of the next period. */\n nextPeriod: Date;\n /** Estimated ovulation date. */\n ovulation: Date;\n /** Fertile window (5 days before ovulation → 1 day after). */\n fertileWindow: DateRange;\n /** Start dates of the next few periods (length = `occurrences`). */\n upcomingPeriods: Date[];\n}\n\n/**\n * Predict ovulation, the fertile window and upcoming periods from the last\n * period's start date. `occurrences` controls how many future periods to\n * list (default 3).\n */\nexport function predictCycle(\n input: CycleInput,\n occurrences = 3,\n): CyclePrediction {\n const cycle = input.cycleLength ?? DEFAULT_CYCLE_LENGTH;\n const { lastPeriodStart } = input;\n\n const ovulation = addDays(lastPeriodStart, cycle - LUTEAL_PHASE_DAYS);\n const fertileWindow: DateRange = {\n start: addDays(ovulation, -FERTILE_DAYS_BEFORE),\n end: addDays(ovulation, FERTILE_DAYS_AFTER),\n };\n const nextPeriod = addDays(lastPeriodStart, cycle);\n const upcomingPeriods = Array.from({ length: occurrences }, (_, i) =>\n addDays(lastPeriodStart, cycle * (i + 1)),\n );\n\n return { nextPeriod, ovulation, fertileWindow, upcomingPeriods };\n}\n","/* ------------------------------------------------------------------ */\n/* CycleCalculator — predict ovulation, fertile window and upcoming */\n/* periods from the last period's start date. */\n/* */\n/* Maths lives in `./cycle` (pure, separately tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Heart, Check, Droplet } from 'lucide-react';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { NumberInput } from '../number-input';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type CyclePrediction,\n predictCycle,\n DEFAULT_CYCLE_LENGTH,\n} from './cycle';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/**\n * DS token NAME backing the result-card chip — the fertile window is the\n * headline fertility datum, shown on screen with the `accent` Badge variant\n * (which fills `--accent`). The card chip reuses that token so the inserted\n * PNG chip matches the on-screen fertile-window badge.\n */\nconst HIGHLIGHT_TOKEN = '--accent';\n\nexport interface CycleCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Initial cycle length in days. Defaults to 28. */\n defaultCycleLength?: number;\n /** Fires whenever a prediction can be computed (and `null` when it can't). */\n onResultChange?: (result: CyclePrediction | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;\n * `false` removes the brand line.\n */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const CycleCalculator = forwardRef<HTMLDivElement, CycleCalculatorProps>(\n (\n {\n defaultCycleLength = DEFAULT_CYCLE_LENGTH,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [lastPeriod, setLastPeriod] = useState<Date | undefined>(undefined);\n const [cycleLength, setCycleLength] = useState<number | null>(\n defaultCycleLength,\n );\n\n const result = useMemo<CyclePrediction | null>(() => {\n if (!lastPeriod) return null;\n return predictCycle({\n lastPeriodStart: lastPeriod,\n cycleLength: cycleLength ?? DEFAULT_CYCLE_LENGTH,\n });\n }, [lastPeriod, cycleLength]);\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'medium' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n const today = useMemo(() => new Date(), []);\n\n const fmt = (d: Date): string => dateFormatter.format(d);\n\n return (\n <div\n ref={ref}\n data-component=\"cycle-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField label={t('cycleCalculator.lastPeriod')}>\n <DatePicker\n value={lastPeriod}\n onChange={setLastPeriod}\n maxDate={today}\n />\n </FormField>\n <FormField\n label={t('cycleCalculator.cycleLength')}\n description={t('cycleCalculator.cycleLengthHint')}\n >\n <NumberInput\n mode=\"integer\"\n min={20}\n max={45}\n value={cycleLength}\n onChange={setCycleLength}\n />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('cycleCalculator.ovulation')}: ${fmt(result.ovulation)}. ${t(\n 'cycleCalculator.nextPeriod',\n )}: ${fmt(result.nextPeriod)}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('cycleCalculator.ovulation')}\n </dt>\n <dd>\n <Badge\n variant=\"success\"\n size=\"lg\"\n leading={<Check aria-hidden />}\n >\n {fmt(result.ovulation)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('cycleCalculator.fertileWindow')}\n </dt>\n <dd>\n <Badge\n variant=\"accent\"\n size=\"lg\"\n leading={<Heart aria-hidden />}\n >\n {fmt(result.fertileWindow.start)} –{' '}\n {fmt(result.fertileWindow.end)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('cycleCalculator.nextPeriod')}\n </dt>\n <dd>\n <Badge\n variant=\"error\"\n size=\"lg\"\n leading={<Droplet aria-hidden />}\n >\n {fmt(result.nextPeriod)}\n </Badge>\n </dd>\n </div>\n </dl>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.cycle'),\n highlight: `${fmt(result.fertileWindow.start)} – ${fmt(\n result.fertileWindow.end,\n )}`,\n // Chip reuses the on-screen fertile-window badge's accent\n // token so the inserted PNG chip matches the screen.\n highlightToken: HIGHLIGHT_TOKEN,\n brand: insertBrand,\n fields: [\n {\n label: t('cycleCalculator.ovulation'),\n value: fmt(result.ovulation),\n },\n {\n label: t('cycleCalculator.fertileWindow'),\n value: `${fmt(result.fertileWindow.start)} – ${fmt(\n result.fertileWindow.end,\n )}`,\n },\n {\n label: t('cycleCalculator.nextPeriod'),\n value: fmt(result.nextPeriod),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('cycleCalculator.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nCycleCalculator.displayName = 'CycleCalculator';\n"],"names":["__iconNode","Droplet","createLucideIcon","DEFAULT_CYCLE_LENGTH","LUTEAL_PHASE_DAYS","FERTILE_DAYS_AFTER","predictCycle","input","occurrences","cycle","lastPeriodStart","ovulation","addDays","fertileWindow","nextPeriod","upcomingPeriods","_","i","rootVariants","cva","HIGHLIGHT_TOKEN","CycleCalculator","forwardRef","defaultCycleLength","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","t","i18n","useTranslation","lastPeriod","setLastPeriod","useState","cycleLength","setCycleLength","result","useMemo","dateFormatter","useEffect","today","fmt","d","jsxs","jsx","FormField","DatePicker","NumberInput","Card","Badge","Check","Heart","InsertButton"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,IAAUC,EAAiB,WAAWF,CAAU,GCNzCG,IAAuB,IAEvBC,IAAoB,IAIpBC,IAAqB;AAgC3B,SAASC,EACdC,GACAC,IAAc,GACG;AACjB,QAAMC,IAAQF,EAAM,eAAeJ,GAC7B,EAAE,iBAAAO,MAAoBH,GAEtBI,IAAYC,EAAQF,GAAiBD,IAAQL,CAAiB,GAC9DS,IAA2B;AAAA,IAC/B,OAAOD,EAAQD,GAAW,EAAoB;AAAA,IAC9C,KAAKC,EAAQD,GAAWN,CAAkB;AAAA,EAAA,GAEtCS,IAAaF,EAAQF,GAAiBD,CAAK,GAC3CM,IAAkB,MAAM;AAAA,IAAK,EAAE,QAAQP,EAAA;AAAA,IAAe,CAACQ,GAAGC,MAC9DL,EAAQF,GAAiBD,KAASQ,IAAI,EAAE;AAAA,EAAA;AAG1C,SAAO,EAAE,YAAAH,GAAY,WAAAH,GAAW,eAAAE,GAAe,iBAAAE,EAAA;AACjD;ACxCA,MAAMG,IAAeC,EAAI,kDAAkD;AAAA,EACzE,UAAU;AAAA,IACR,OAAO,EA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,GAAGa,EAAIL,EAAO,cAAc,KAAK,CAAC,MAAMK;AAAA,oBACjDL,EAAO,cAAc;AAAA,kBAAA,CACtB;AAAA;AAAA;AAAA,kBAGD,gBAAgBtB;AAAA,kBAChB,OAAOS;AAAA,kBACP,QAAQ;AAAA,oBACN;AAAA,sBACE,OAAOK,EAAE,2BAA2B;AAAA,sBACpC,OAAOa,EAAIL,EAAO,SAAS;AAAA,oBAAA;AAAA,oBAE7B;AAAA,sBACE,OAAOR,EAAE,+BAA+B;AAAA,sBACxC,OAAO,GAAGa,EAAIL,EAAO,cAAc,KAAK,CAAC,MAAMK;AAAA,wBAC7CL,EAAO,cAAc;AAAA,sBAAA,CACtB;AAAA,oBAAA;AAAA,oBAEH;AAAA,sBACE,OAAOR,EAAE,4BAA4B;AAAA,sBACrC,OAAOa,EAAIL,EAAO,UAAU;AAAA,oBAAA;AAAA,kBAC9B;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAQ,EAAC,KAAA,EAAE,WAAU,sCACV,UAAAhB,EAAE,uBAAuB,EAAA,CAC5B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAb,EAAgB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as j, useEffect as O, useMemo as T, forwardRef as i, useContext as x, createContext as B } from "react";
|
|
3
|
+
import * as s from "@radix-ui/react-dialog";
|
|
4
|
+
import { c as k } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { useTranslation as S } from "react-i18next";
|
|
6
|
+
import { u as w } from "./use-controllable-state-BiY4xTzM.js";
|
|
7
|
+
import { u as A } from "./registry-nPAVE19X.js";
|
|
8
|
+
import { X as E } from "./x-CCcI3eJp.js";
|
|
9
|
+
const H = {
|
|
10
|
+
id: "dialog",
|
|
11
|
+
capabilities: ["open", "close", "dismiss"],
|
|
12
|
+
state: {
|
|
13
|
+
isOpen: {
|
|
14
|
+
type: "boolean",
|
|
15
|
+
description: "True when the dialog is currently open.",
|
|
16
|
+
read: (e) => e.getIsOpen()
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
actions: {
|
|
20
|
+
open: {
|
|
21
|
+
safety: "read",
|
|
22
|
+
description: "Open the dialog.",
|
|
23
|
+
invoke: (e) => {
|
|
24
|
+
e.open();
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
close: {
|
|
28
|
+
safety: "write",
|
|
29
|
+
description: "Close the dialog. Reversible by reopening.",
|
|
30
|
+
invoke: (e) => {
|
|
31
|
+
e.close();
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
dismiss: {
|
|
35
|
+
safety: "destructive",
|
|
36
|
+
description: "Dismiss the dialog. Loses any in-progress input that has not been committed.",
|
|
37
|
+
invoke: (e) => {
|
|
38
|
+
e.close();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
domHooks: {
|
|
43
|
+
root: { attr: "data-component", value: "dialog" },
|
|
44
|
+
instanceId: {
|
|
45
|
+
attr: "data-component-id",
|
|
46
|
+
sourceProp: "id",
|
|
47
|
+
description: "Sourced from the id prop on Dialog.Root."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, I = [
|
|
51
|
+
"ds-dialog__backdrop",
|
|
52
|
+
"ds:backdrop-blur-sm",
|
|
53
|
+
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0",
|
|
54
|
+
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0",
|
|
55
|
+
"ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
56
|
+
].join(" "), z = [
|
|
57
|
+
"ds:focus-visible:outline-none",
|
|
58
|
+
"ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0 ds:data-[state=open]:zoom-in-95",
|
|
59
|
+
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95",
|
|
60
|
+
"ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
61
|
+
].join(" "), F = k(`ds-dialog ds-dialog__surface ${z}`, {
|
|
62
|
+
variants: {
|
|
63
|
+
size: {
|
|
64
|
+
sm: "ds-dialog__surface--sm",
|
|
65
|
+
md: "",
|
|
66
|
+
lg: "ds-dialog__surface--lg",
|
|
67
|
+
fullscreen: "ds-dialog__surface--fullscreen"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: { size: "md" }
|
|
71
|
+
}), f = B(void 0), g = ({
|
|
72
|
+
children: e,
|
|
73
|
+
id: o,
|
|
74
|
+
open: a,
|
|
75
|
+
defaultOpen: r,
|
|
76
|
+
onOpenChange: c,
|
|
77
|
+
...m
|
|
78
|
+
}) => {
|
|
79
|
+
const [p, n] = w({
|
|
80
|
+
value: a,
|
|
81
|
+
defaultValue: r ?? !1,
|
|
82
|
+
onChange: c
|
|
83
|
+
}), d = p ?? !1, l = j(d);
|
|
84
|
+
O(() => {
|
|
85
|
+
l.current = d;
|
|
86
|
+
}, [d]);
|
|
87
|
+
const R = T(
|
|
88
|
+
() => ({
|
|
89
|
+
getIsOpen: () => l.current,
|
|
90
|
+
open: () => n(!0),
|
|
91
|
+
close: () => n(!1)
|
|
92
|
+
}),
|
|
93
|
+
[n]
|
|
94
|
+
);
|
|
95
|
+
return A(H, R, o), /* @__PURE__ */ t(f.Provider, { value: o, children: /* @__PURE__ */ t(s.Root, { open: d, onOpenChange: n, ...m, children: e }) });
|
|
96
|
+
};
|
|
97
|
+
g.displayName = "Dialog.Root";
|
|
98
|
+
const D = i(({ children: e, ...o }, a) => /* @__PURE__ */ t(s.Trigger, { ref: a, ...o, children: e }));
|
|
99
|
+
D.displayName = "Dialog.Trigger";
|
|
100
|
+
const y = i(({ children: e, ...o }, a) => /* @__PURE__ */ t(s.Close, { ref: a, ...o, children: e }));
|
|
101
|
+
y.displayName = "Dialog.Close";
|
|
102
|
+
const v = i(
|
|
103
|
+
({
|
|
104
|
+
size: e = "md",
|
|
105
|
+
variant: o = "default",
|
|
106
|
+
hideCloseButton: a = !0,
|
|
107
|
+
className: r,
|
|
108
|
+
children: c,
|
|
109
|
+
...m
|
|
110
|
+
}, p) => {
|
|
111
|
+
const { t: n } = S(), d = x(f), l = o === "alert" ? { role: "alertdialog" } : {};
|
|
112
|
+
return /* @__PURE__ */ u(s.Portal, { children: [
|
|
113
|
+
/* @__PURE__ */ t(
|
|
114
|
+
s.Overlay,
|
|
115
|
+
{
|
|
116
|
+
"data-component": "dialog-overlay",
|
|
117
|
+
className: I
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ u(
|
|
121
|
+
s.Content,
|
|
122
|
+
{
|
|
123
|
+
ref: p,
|
|
124
|
+
...l,
|
|
125
|
+
"data-component": "dialog",
|
|
126
|
+
"data-component-id": d,
|
|
127
|
+
className: F({ size: e, className: r }),
|
|
128
|
+
...m,
|
|
129
|
+
children: [
|
|
130
|
+
c,
|
|
131
|
+
!a && // The close is a plain button carrying the `ds-dialog__close`
|
|
132
|
+
// contract class — the SAME class a vanilla host renders. The CSS
|
|
133
|
+
// (src/styles.css) owns its position, sizing, glyph size, hover
|
|
134
|
+
// wash, and focus ring from tokens, so the React and non-React
|
|
135
|
+
// close buttons are identical and can't drift.
|
|
136
|
+
/* @__PURE__ */ t(
|
|
137
|
+
s.Close,
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
className: "ds-dialog__close",
|
|
141
|
+
"aria-label": n("common.close", "Close"),
|
|
142
|
+
children: /* @__PURE__ */ t(E, { "aria-hidden": "true" })
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] });
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
v.displayName = "Dialog.Content";
|
|
152
|
+
const C = i(
|
|
153
|
+
({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
ref: a,
|
|
157
|
+
className: ["ds-dialog__header", e].filter(Boolean).join(" "),
|
|
158
|
+
...o
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
);
|
|
162
|
+
C.displayName = "Dialog.Header";
|
|
163
|
+
const _ = i(
|
|
164
|
+
({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
ref: a,
|
|
168
|
+
className: ["ds-dialog__body", e].filter(Boolean).join(" "),
|
|
169
|
+
...o
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
);
|
|
173
|
+
_.displayName = "Dialog.Body";
|
|
174
|
+
const b = i(({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
175
|
+
s.Title,
|
|
176
|
+
{
|
|
177
|
+
ref: a,
|
|
178
|
+
className: ["ds-dialog__title type-title-card ds:break-words", e].filter(Boolean).join(" "),
|
|
179
|
+
...o
|
|
180
|
+
}
|
|
181
|
+
));
|
|
182
|
+
b.displayName = "Dialog.Title";
|
|
183
|
+
const h = i(({ className: e, ...o }, a) => /* @__PURE__ */ t(
|
|
184
|
+
s.Description,
|
|
185
|
+
{
|
|
186
|
+
ref: a,
|
|
187
|
+
className: ["type-body-sm ds:text-[var(--muted-foreground)]", e].filter(Boolean).join(" "),
|
|
188
|
+
...o
|
|
189
|
+
}
|
|
190
|
+
));
|
|
191
|
+
h.displayName = "Dialog.Description";
|
|
192
|
+
const N = i(
|
|
193
|
+
({ className: e, divider: o = !1, ...a }, r) => /* @__PURE__ */ t(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
ref: r,
|
|
197
|
+
className: [
|
|
198
|
+
"ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]",
|
|
199
|
+
"ds:mt-[var(--spacing-md)]",
|
|
200
|
+
o && "ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-md)]",
|
|
201
|
+
e
|
|
202
|
+
].filter(Boolean).join(" "),
|
|
203
|
+
...a
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
N.displayName = "Dialog.Footer";
|
|
208
|
+
const $ = Object.assign(g, {
|
|
209
|
+
Root: g,
|
|
210
|
+
Trigger: D,
|
|
211
|
+
Content: v,
|
|
212
|
+
Header: C,
|
|
213
|
+
Title: b,
|
|
214
|
+
Description: h,
|
|
215
|
+
Body: _,
|
|
216
|
+
Footer: N,
|
|
217
|
+
Close: y
|
|
218
|
+
});
|
|
219
|
+
export {
|
|
220
|
+
$ as D,
|
|
221
|
+
H as d
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=dialog-BTpZV6It.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-BTpZV6It.js","sources":["../../src/components/dialog/dialog.agent.ts","../../src/components/dialog/dialog.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { DialogHandle } from './dialog';\n\n/**\n * Dialog wraps Radix Dialog. The curated handle (`DialogHandle`) bridges the\n * Radix controlled-or-uncontrolled `open` state so an agent can observe and\n * drive the dialog without owning the React state itself.\n */\nexport const dialogAgent: AgentAdapter<DialogHandle> = {\n id: 'dialog',\n capabilities: ['open', 'close', 'dismiss'],\n state: {\n isOpen: {\n type: 'boolean',\n description: 'True when the dialog is currently open.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n description: 'Open the dialog.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'write',\n description: 'Close the dialog. Reversible by reopening.',\n invoke: (handle) => {\n handle.close();\n },\n },\n dismiss: {\n safety: 'destructive',\n description:\n 'Dismiss the dialog. Loses any in-progress input that has not been committed.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'dialog' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop on Dialog.Root.',\n },\n },\n};\n","import {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useMemo,\n useRef,\n type ComponentPropsWithoutRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { X } from 'lucide-react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useAgentRegistration } from '../../agent';\nimport { dialogAgent } from './dialog.agent';\n\n// The `ds-dialog__*` class names below are the framework-agnostic contract\n// defined in src/styles.css (@layer ui-kit-components). The React component\n// renders the SAME classes a vanilla (non-React) host hand-authors — the\n// surface (`ds-dialog__surface` + its size modifiers), the close button\n// (`ds-dialog__close`), and the body slot (`ds-dialog__body`) — so there is\n// ONE visual skin (scrim, radius, elevation, bg, padding, centering, sizing,\n// close-button glyph + hover/focus) and the two surfaces can't drift. The few\n// Tailwind utilities that remain are NOT skin: they are the Radix animation\n// hooks (`data-[state=…]:animate-*`) and the surface focus-suppression chrome\n// — neither lives in the vanilla CSS contract. Layer order\n// (`…, utilities, ui-kit-tokens, ui-kit-components`) puts the `ds-dialog__*`\n// rules after Tailwind's utilities, so the contract owns every visual\n// property and the animation utilities only touch `animation` / `outline`.\nconst OVERLAY_CLASSES = [\n 'ds-dialog__backdrop',\n 'ds:backdrop-blur-sm',\n 'ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0',\n 'ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\n// Animation + focus chrome only — every visual property (position, centering,\n// bg, radius, elevation, padding, sizing) comes from `.ds-dialog__surface`.\nconst SURFACE_CHROME = [\n 'ds:focus-visible:outline-none',\n 'ds:data-[state=open]:animate-in ds:data-[state=open]:fade-in-0 ds:data-[state=open]:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95',\n 'ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\n// CVA drives only the contract class names per size. `ds-dialog` is the host\n// marker (cascade-reset boundary); `ds-dialog__surface` carries the panel skin;\n// the `--sm` / `--lg` / `--fullscreen` modifiers shift only `max-inline-size`\n// (or the fullscreen geometry) and are defined alongside the base rule in\n// src/styles.css — so size, like the skin, lives in one place.\nconst contentVariants = cva(`ds-dialog ds-dialog__surface ${SURFACE_CHROME}`, {\n variants: {\n size: {\n sm: 'ds-dialog__surface--sm',\n md: '',\n lg: 'ds-dialog__surface--lg',\n fullscreen: 'ds-dialog__surface--fullscreen',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\n// Curated agent-readiness handle — see dialog.agent.ts.\nexport interface DialogHandle {\n getIsOpen: () => boolean;\n open: () => void;\n close: () => void;\n}\n\nexport interface DialogRootProps extends ComponentPropsWithoutRef<\n typeof RadixDialog.Root\n> {\n /** Opaque instance id — forwarded to Dialog.Content as `data-component-id`. */\n id?: string;\n}\n\nconst DialogIdContext = createContext<string | undefined>(undefined);\n\nconst DialogRoot = ({\n children,\n id,\n open: openProp,\n defaultOpen,\n onOpenChange,\n ...props\n}: DialogRootProps) => {\n const [openRaw, setOpen] = useControllableState<boolean>({\n value: openProp,\n defaultValue: defaultOpen ?? false,\n onChange: onOpenChange,\n });\n const open = openRaw ?? false;\n\n const openRef = useRef(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const handle = useMemo<DialogHandle>(\n () => ({\n getIsOpen: () => openRef.current,\n open: () => setOpen(true),\n close: () => setOpen(false),\n }),\n [setOpen],\n );\n useAgentRegistration(dialogAgent, handle, id);\n\n return (\n <DialogIdContext.Provider value={id}>\n <RadixDialog.Root open={open} onOpenChange={setOpen} {...props}>\n {children}\n </RadixDialog.Root>\n </DialogIdContext.Provider>\n );\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nconst DialogTrigger = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof RadixDialog.Trigger>\n>(({ children, ...props }, ref) => (\n <RadixDialog.Trigger ref={ref} {...props}>\n {children}\n </RadixDialog.Trigger>\n));\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nconst DialogClose = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof RadixDialog.Close>\n>(({ children, ...props }, ref) => (\n <RadixDialog.Close ref={ref} {...props}>\n {children}\n </RadixDialog.Close>\n));\nDialogClose.displayName = 'Dialog.Close';\n\nexport interface DialogContentProps\n extends\n Omit<ComponentPropsWithoutRef<typeof RadixDialog.Content>, 'role'>,\n VariantProps<typeof contentVariants> {\n size?: 'sm' | 'md' | 'lg' | 'fullscreen';\n variant?: 'default' | 'alert' | 'confirmation';\n hideCloseButton?: boolean;\n className?: string;\n children: ReactNode;\n}\n\nconst DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(\n (\n {\n size = 'md',\n variant = 'default',\n hideCloseButton = true,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const instanceId = useContext(DialogIdContext);\n // Only forward `role` when we actually need to override Radix's default\n // (`role=\"dialog\"`). Passing `role={undefined}` explicitly wins over\n // Radix's internal assignment and strips the attribute entirely.\n const roleOverride =\n variant === 'alert' ? { role: 'alertdialog' as const } : {};\n\n return (\n <RadixDialog.Portal>\n <RadixDialog.Overlay\n data-component=\"dialog-overlay\"\n className={OVERLAY_CLASSES}\n />\n <RadixDialog.Content\n ref={ref}\n {...roleOverride}\n data-component=\"dialog\"\n data-component-id={instanceId}\n className={contentVariants({ size, className })}\n {...props}\n >\n {children}\n\n {!hideCloseButton && (\n // The close is a plain button carrying the `ds-dialog__close`\n // contract class — the SAME class a vanilla host renders. The CSS\n // (src/styles.css) owns its position, sizing, glyph size, hover\n // wash, and focus ring from tokens, so the React and non-React\n // close buttons are identical and can't drift.\n <RadixDialog.Close\n type=\"button\"\n className=\"ds-dialog__close\"\n aria-label={t('common.close', 'Close')}\n >\n <X aria-hidden=\"true\" />\n </RadixDialog.Close>\n )}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\nconst DialogHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={['ds-dialog__header', className].filter(Boolean).join(' ')}\n {...props}\n />\n ),\n);\nDialogHeader.displayName = 'Dialog.Header';\n\n// Optional body slot. Carries the `ds-dialog__body` contract class — the SAME\n// class a vanilla host renders — so content / iframe slots match between the\n// React and non-React surfaces and can't drift. Additive: content placed\n// directly in Dialog.Content (without this wrapper) still works as before.\nconst DialogBody = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={['ds-dialog__body', className].filter(Boolean).join(' ')}\n {...props}\n />\n ),\n);\nDialogBody.displayName = 'Dialog.Body';\n\nconst DialogTitle = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof RadixDialog.Title>\n>(({ className, ...props }, ref) => (\n <RadixDialog.Title\n ref={ref}\n className={['ds-dialog__title type-title-card ds:break-words', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nDialogTitle.displayName = 'Dialog.Title';\n\nconst DialogDescription = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof RadixDialog.Description>\n>(({ className, ...props }, ref) => (\n <RadixDialog.Description\n ref={ref}\n className={['type-body-sm ds:text-[var(--muted-foreground)]', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nDialogDescription.displayName = 'Dialog.Description';\n\ninterface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {\n divider?: boolean;\n}\n\nconst DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(\n ({ className, divider = false, ...props }, ref) => (\n <div\n ref={ref}\n className={[\n 'ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-sm)]',\n 'ds:mt-[var(--spacing-md)]',\n divider &&\n 'ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-md)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const Dialog = Object.assign(DialogRoot, {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Content: DialogContent,\n Header: DialogHeader,\n Title: DialogTitle,\n Description: DialogDescription,\n Body: DialogBody,\n Footer: DialogFooter,\n Close: DialogClose,\n});\n\nexport type { DialogFooterProps };\n"],"names":["dialogAgent","handle","OVERLAY_CLASSES","SURFACE_CHROME","contentVariants","cva","DialogIdContext","createContext","DialogRoot","children","id","openProp","defaultOpen","onOpenChange","props","openRaw","setOpen","useControllableState","open","openRef","useRef","useEffect","useMemo","useAgentRegistration","jsx","RadixDialog","DialogTrigger","forwardRef","ref","DialogClose","DialogContent","size","variant","hideCloseButton","className","t","useTranslation","instanceId","useContext","roleOverride","jsxs","X","DialogHeader","DialogBody","DialogTitle","DialogDescription","DialogFooter","divider","Dialog"],"mappings":";;;;;;;;AAQO,MAAMA,IAA0C;AAAA,EACrD,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,SAAS;AAAA,EACzC,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,KAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,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AY;AAAA,EAAZ;AAAA,IACC,KAAAG;AAAA,IACA,WAAW,CAAC,mDAAmDM,CAAS,EACrE,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,IACV,GAAGpB;AAAA,EAAA;AACN,CACD;AACD8B,EAAY,cAAc;AAE1B,MAAMC,IAAoBlB,EAGxB,CAAC,EAAE,WAAAO,GAAW,GAAGpB,EAAA,GAASc,MAC1B,gBAAAJ;AAAA,EAACC,EAAY;AAAA,EAAZ;AAAA,IACC,KAAAG;AAAA,IACA,WAAW,CAAC,kDAAkDM,CAAS,EACpE,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,IACV,GAAGpB;AAAA,EAAA;AACN,CACD;AACD+B,EAAkB,cAAc;AAMhC,MAAMC,IAAenB;AAAA,EACnB,CAAC,EAAE,WAAAO,GAAW,SAAAa,IAAU,IAAO,GAAGjC,EAAA,GAASc,MACzC,gBAAAJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAI;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACAmB,KACE;AAAA,QACFb;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGpB;AAAA,IAAA;AAAA,EAAA;AAGV;AACAgC,EAAa,cAAc;AAEpB,MAAME,IAAS,OAAO,OAAOxC,GAAY;AAAA,EAC9C,MAAMA;AAAA,EACN,SAASkB;AAAA,EACT,SAASI;AAAA,EACT,QAAQY;AAAA,EACR,OAAOE;AAAA,EACP,aAAaC;AAAA,EACb,MAAMF;AAAA,EACN,QAAQG;AAAA,EACR,OAAOjB;AACT,CAAC;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
2
|
+
import { forwardRef as F, useState as c, useMemo as g, useEffect as G } from "react";
|
|
3
|
+
import { c as H } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as R } from "react-i18next";
|
|
5
5
|
import { R as s } from "./radio-TWf9Q-mp.js";
|
|
6
6
|
import { R as h } from "./radio-group-CLjK-SlK.js";
|
|
7
7
|
import { F as v } from "./form-field-BOm9hK35.js";
|
|
8
|
-
import { D as
|
|
8
|
+
import { D as S } from "./date-picker-Bq7xhMA-.js";
|
|
9
9
|
import { N as M } from "./number-input-Dj5L3pXK.js";
|
|
10
|
-
import { C } from "./card-DPmk26CL.js";
|
|
11
|
-
import { B as
|
|
12
|
-
import { I as V } from "./insert-result-
|
|
13
|
-
import { D as
|
|
14
|
-
const
|
|
10
|
+
import { C as b } from "./card-DPmk26CL.js";
|
|
11
|
+
import { B as z } from "./badge-zsf5i5bH.js";
|
|
12
|
+
import { I as V } from "./insert-result-CoC1oo6R.js";
|
|
13
|
+
import { D as C, c as j } from "./gestation-mWF4AXea.js";
|
|
14
|
+
const K = H("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
15
15
|
variants: {
|
|
16
16
|
width: { full: "ds:w-full", auto: "ds:inline-flex" }
|
|
17
17
|
},
|
|
@@ -22,11 +22,17 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
22
22
|
second: "success",
|
|
23
23
|
third: "warning",
|
|
24
24
|
postterm: "error"
|
|
25
|
-
},
|
|
25
|
+
}, O = {
|
|
26
|
+
preconception: "--muted",
|
|
27
|
+
first: "--info",
|
|
28
|
+
second: "--success",
|
|
29
|
+
third: "--warning",
|
|
30
|
+
postterm: "--destructive"
|
|
31
|
+
}, P = {
|
|
26
32
|
lmp: "dueDateCalculator.lmpDate",
|
|
27
33
|
conception: "dueDateCalculator.conceptionDate",
|
|
28
34
|
ivf: "dueDateCalculator.transferDate"
|
|
29
|
-
},
|
|
35
|
+
}, U = F(
|
|
30
36
|
({
|
|
31
37
|
defaultMethod: y = "lmp",
|
|
32
38
|
onResultChange: d,
|
|
@@ -34,35 +40,36 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
34
40
|
insertVariant: D = "insert",
|
|
35
41
|
onCopy: x,
|
|
36
42
|
onError: N,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
insertBrand: L,
|
|
44
|
+
id: E,
|
|
45
|
+
width: w,
|
|
46
|
+
className: A
|
|
47
|
+
}, T) => {
|
|
48
|
+
const { t: e, i18n: f } = R(), [r, I] = c(y), [o, _] = c(void 0), [u, $] = c(
|
|
49
|
+
C
|
|
50
|
+
), [n, k] = c(5), t = g(() => o ? j(
|
|
44
51
|
{
|
|
45
52
|
method: r,
|
|
46
53
|
date: o,
|
|
47
|
-
cycleLength: u ??
|
|
54
|
+
cycleLength: u ?? C,
|
|
48
55
|
embryoAge: n
|
|
49
56
|
},
|
|
50
57
|
/* @__PURE__ */ new Date()
|
|
51
|
-
) : null, [r, o, u, n]),
|
|
58
|
+
) : null, [r, o, u, n]), i = g(
|
|
52
59
|
() => new Intl.DateTimeFormat(f.language, { dateStyle: "long" }),
|
|
53
60
|
[f.language]
|
|
54
61
|
);
|
|
55
|
-
|
|
62
|
+
G(() => {
|
|
56
63
|
d == null || d(t);
|
|
57
64
|
}, [t, d]);
|
|
58
|
-
const
|
|
65
|
+
const B = g(() => /* @__PURE__ */ new Date(), []);
|
|
59
66
|
return /* @__PURE__ */ l(
|
|
60
67
|
"div",
|
|
61
68
|
{
|
|
62
|
-
ref:
|
|
69
|
+
ref: T,
|
|
63
70
|
"data-component": "due-date-calculator",
|
|
64
|
-
"data-component-id":
|
|
65
|
-
className:
|
|
71
|
+
"data-component-id": E,
|
|
72
|
+
className: K({ width: w, className: A }),
|
|
66
73
|
children: [
|
|
67
74
|
/* @__PURE__ */ l(
|
|
68
75
|
h,
|
|
@@ -70,7 +77,7 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
70
77
|
label: e("dueDateCalculator.method.label"),
|
|
71
78
|
variant: "horizontal",
|
|
72
79
|
value: r,
|
|
73
|
-
onValueChange: (m) =>
|
|
80
|
+
onValueChange: (m) => I(m),
|
|
74
81
|
children: [
|
|
75
82
|
/* @__PURE__ */ a(s, { label: e("dueDateCalculator.method.lmp"), value: "lmp" }),
|
|
76
83
|
/* @__PURE__ */ a(
|
|
@@ -85,7 +92,7 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
85
92
|
}
|
|
86
93
|
),
|
|
87
94
|
/* @__PURE__ */ l("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
88
|
-
/* @__PURE__ */ a(v, { label: e(
|
|
95
|
+
/* @__PURE__ */ a(v, { label: e(P[r]), children: /* @__PURE__ */ a(S, { value: o, onChange: _, maxDate: B }) }),
|
|
89
96
|
r === "lmp" && /* @__PURE__ */ a(
|
|
90
97
|
v,
|
|
91
98
|
{
|
|
@@ -98,7 +105,7 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
98
105
|
min: 20,
|
|
99
106
|
max: 45,
|
|
100
107
|
value: u,
|
|
101
|
-
onChange:
|
|
108
|
+
onChange: $
|
|
102
109
|
}
|
|
103
110
|
)
|
|
104
111
|
}
|
|
@@ -109,7 +116,7 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
109
116
|
label: e("dueDateCalculator.embryoAge"),
|
|
110
117
|
variant: "horizontal",
|
|
111
118
|
value: String(n),
|
|
112
|
-
onValueChange: (m) =>
|
|
119
|
+
onValueChange: (m) => k(Number(m)),
|
|
113
120
|
children: [
|
|
114
121
|
/* @__PURE__ */ a(s, { label: e("dueDateCalculator.day3"), value: "3" }),
|
|
115
122
|
/* @__PURE__ */ a(s, { label: e("dueDateCalculator.day5"), value: "5" })
|
|
@@ -117,17 +124,17 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
117
124
|
}
|
|
118
125
|
)
|
|
119
126
|
] }),
|
|
120
|
-
/* @__PURE__ */ a("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${e("dueDateCalculator.result.dueDateLabel")}: ${
|
|
127
|
+
/* @__PURE__ */ a("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: t ? `${e("dueDateCalculator.result.dueDateLabel")}: ${i.format(
|
|
121
128
|
t.dueDate
|
|
122
129
|
)}. ${e("dueDateCalculator.result.trimesterLabel")}: ${e(
|
|
123
130
|
`dueDateCalculator.trimester.${t.trimester}`
|
|
124
131
|
)}.` : "" }),
|
|
125
|
-
t ? /* @__PURE__ */ a(
|
|
132
|
+
t ? /* @__PURE__ */ a(b, { variant: "elevated", children: /* @__PURE__ */ l(b.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
126
133
|
/* @__PURE__ */ l("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3", children: [
|
|
127
134
|
/* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
|
|
128
135
|
/* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.trimesterLabel") }),
|
|
129
136
|
/* @__PURE__ */ a("dd", { children: /* @__PURE__ */ a(
|
|
130
|
-
|
|
137
|
+
z,
|
|
131
138
|
{
|
|
132
139
|
variant: Y[t.trimester],
|
|
133
140
|
size: "lg",
|
|
@@ -144,7 +151,7 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
144
151
|
] }),
|
|
145
152
|
/* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
146
153
|
/* @__PURE__ */ a("dt", { className: "type-label ds:text-muted-foreground", children: e("dueDateCalculator.result.dueDateLabel") }),
|
|
147
|
-
/* @__PURE__ */ a("dd", { className: "type-metric ds:text-foreground", children:
|
|
154
|
+
/* @__PURE__ */ a("dd", { className: "type-metric ds:text-foreground", children: i.format(t.dueDate) })
|
|
148
155
|
] })
|
|
149
156
|
] }),
|
|
150
157
|
D === "copy" || p ? /* @__PURE__ */ a(
|
|
@@ -156,11 +163,16 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
156
163
|
onError: N,
|
|
157
164
|
card: {
|
|
158
165
|
title: e("insert.title.dueDate"),
|
|
159
|
-
highlight:
|
|
166
|
+
highlight: i.format(t.dueDate),
|
|
167
|
+
// Chip tinted with the trimester's semantic token so the
|
|
168
|
+
// inserted PNG carries the same clinical-stage colour as
|
|
169
|
+
// the on-screen trimester badge.
|
|
170
|
+
highlightToken: O[t.trimester],
|
|
171
|
+
brand: L,
|
|
160
172
|
fields: [
|
|
161
173
|
{
|
|
162
174
|
label: e("dueDateCalculator.result.dueDateLabel"),
|
|
163
|
-
value:
|
|
175
|
+
value: i.format(t.dueDate)
|
|
164
176
|
},
|
|
165
177
|
{
|
|
166
178
|
label: e("dueDateCalculator.result.gestationLabel"),
|
|
@@ -185,8 +197,8 @@ const H = S("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
185
197
|
);
|
|
186
198
|
}
|
|
187
199
|
);
|
|
188
|
-
|
|
200
|
+
U.displayName = "DueDateCalculator";
|
|
189
201
|
export {
|
|
190
|
-
|
|
202
|
+
U as D
|
|
191
203
|
};
|
|
192
|
-
//# sourceMappingURL=due-date-calculator-
|
|
204
|
+
//# sourceMappingURL=due-date-calculator-CYXKLoof.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"due-date-calculator-CYXKLoof.js","sources":["../../src/components/due-date-calculator/due-date-calculator.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* DueDateCalculator — estimate the date of delivery from one of three */\n/* dating methods, with current gestational age + trimester. */\n/* */\n/* - Maths lives in `./gestation` (pure, separately tested). */\n/* - Three methods: LMP (Naegele, cycle-length adjustable), conception, */\n/* and IVF transfer (Day-3 vs Day-5 embryo). */\n/* - The reference date can't be in the future, so the DatePicker caps */\n/* at today. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { NumberInput } from '../number-input';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type DueDateMethod,\n type EmbryoAge,\n type Trimester,\n type DueDateResult,\n computeDueDate,\n DEFAULT_CYCLE_LENGTH,\n} from './gestation';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\nconst TRIMESTER_BADGE: Record<\n Trimester,\n 'neutral' | 'info' | 'success' | 'warning' | 'error'\n> = {\n preconception: 'neutral',\n first: 'info',\n second: 'success',\n third: 'warning',\n postterm: 'error',\n};\n\n/**\n * DS token NAME backing each trimester's result-card chip — the solid-fill\n * companion of the on-screen `TRIMESTER_BADGE` variant (Badge `error` fills\n * `--destructive`; `neutral` fills `--muted`). Passed as the card's\n * `highlightToken` so the inserted PNG chip matches the on-screen trimester\n * badge; `InsertButton` resolves the name to a concrete colour at raster time.\n */\nconst TRIMESTER_HIGHLIGHT_TOKEN: Record<Trimester, string> = {\n preconception: '--muted',\n first: '--info',\n second: '--success',\n third: '--warning',\n postterm: '--destructive',\n};\n\n/** Reference-date i18n key per method. */\nconst DATE_LABEL_KEY: Record<DueDateMethod, string> = {\n lmp: 'dueDateCalculator.lmpDate',\n conception: 'dueDateCalculator.conceptionDate',\n ivf: 'dueDateCalculator.transferDate',\n};\n\nexport interface DueDateCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Initial dating method. Defaults to `'lmp'`. */\n defaultMethod?: DueDateMethod;\n /** Fires whenever a due date can be computed (and with `null` when it can't). */\n onResultChange?: (result: DueDateResult | null) => void;\n /** When provided, shows an \"Insert\" button that emits the result for an editor. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → the default `'AlfaDocs'` wordmark; a string overrides it;\n * `false` removes the brand line.\n */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const DueDateCalculator = forwardRef<\n HTMLDivElement,\n DueDateCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [method, setMethod] = useState<DueDateMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(undefined);\n const [cycleLength, setCycleLength] = useState<number | null>(\n DEFAULT_CYCLE_LENGTH,\n );\n const [embryoAge, setEmbryoAge] = useState<EmbryoAge>(5);\n\n // `today` is captured once per render; the result re-derives from it.\n const result = useMemo<DueDateResult | null>(() => {\n if (!refDate) return null;\n return computeDueDate(\n {\n method,\n date: refDate,\n cycleLength: cycleLength ?? DEFAULT_CYCLE_LENGTH,\n embryoAge,\n },\n new Date(),\n );\n }, [method, refDate, cycleLength, embryoAge]);\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n const today = useMemo(() => new Date(), []);\n\n return (\n <div\n ref={ref}\n data-component=\"due-date-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('dueDateCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as DueDateMethod)}\n >\n <Radio label={t('dueDateCalculator.method.lmp')} value=\"lmp\" />\n <Radio\n label={t('dueDateCalculator.method.conception')}\n value=\"conception\"\n />\n <Radio label={t('dueDateCalculator.method.ivf')} value=\"ivf\" />\n </RadioGroup>\n\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField label={t(DATE_LABEL_KEY[method])}>\n <DatePicker value={refDate} onChange={setRefDate} maxDate={today} />\n </FormField>\n\n {method === 'lmp' && (\n <FormField\n label={t('dueDateCalculator.cycleLength')}\n description={t('dueDateCalculator.cycleLengthHint')}\n >\n <NumberInput\n mode=\"integer\"\n min={20}\n max={45}\n value={cycleLength}\n onChange={setCycleLength}\n />\n </FormField>\n )}\n\n {method === 'ivf' && (\n <RadioGroup\n label={t('dueDateCalculator.embryoAge')}\n variant=\"horizontal\"\n value={String(embryoAge)}\n onValueChange={(next) => setEmbryoAge(Number(next) as EmbryoAge)}\n >\n <Radio label={t('dueDateCalculator.day3')} value=\"3\" />\n <Radio label={t('dueDateCalculator.day5')} value=\"5\" />\n </RadioGroup>\n )}\n </div>\n\n {/* Concise polite announcement when a due date resolves. */}\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('dueDateCalculator.result.dueDateLabel')}: ${dateFormatter.format(\n result.dueDate,\n )}. ${t('dueDateCalculator.result.trimesterLabel')}: ${t(\n `dueDateCalculator.trimester.${result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE[result.trimester]}\n size=\"lg\"\n >\n {t(`dueDateCalculator.trimester.${result.trimester}`)}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.gestationLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—'}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('dueDateCalculator.result.dueDateLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {dateFormatter.format(result.dueDate)}\n </dd>\n </div>\n </dl>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n variant={insertVariant}\n onInsert={onInsert}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.dueDate'),\n highlight: dateFormatter.format(result.dueDate),\n // Chip tinted with the trimester's semantic token so the\n // inserted PNG carries the same clinical-stage colour as\n // the on-screen trimester badge.\n highlightToken: TRIMESTER_HIGHLIGHT_TOKEN[result.trimester],\n brand: insertBrand,\n fields: [\n {\n label: t('dueDateCalculator.result.dueDateLabel'),\n value: dateFormatter.format(result.dueDate),\n },\n {\n label: t('dueDateCalculator.result.gestationLabel'),\n value: result.gestationalAge\n ? t('dueDateCalculator.result.gestation', {\n weeks: result.gestationalAge.weeks,\n days: result.gestationalAge.days,\n })\n : '—',\n },\n {\n label: t('dueDateCalculator.result.trimesterLabel'),\n value: t(\n `dueDateCalculator.trimester.${result.trimester}`,\n ),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('dueDateCalculator.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nDueDateCalculator.displayName = 'DueDateCalculator';\n"],"names":["rootVariants","cva","TRIMESTER_BADGE","TRIMESTER_HIGHLIGHT_TOKEN","DATE_LABEL_KEY","DueDateCalculator","forwardRef","defaultMethod","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","t","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","cycleLength","setCycleLength","DEFAULT_CYCLE_LENGTH","embryoAge","setEmbryoAge","result","useMemo","computeDueDate","dateFormatter","useEffect","today","jsxs","RadioGroup","next","jsx","Radio","FormField","DatePicker","NumberInput","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;;;;AAmCA,MAAMA,IAAeC,EAAI,kDAAkD;AAAA,EACzE,UAAU;AAAA,IACR,OAAO,EAAE,MAAM,aAAa,MAAM,iBAAA;AAAA,EAAiB;AAAA,EAErD,iBAAiB,EAAE,OAAO,OAAA;AAC5B,CAAC,GAEKC,IAGF;AAAA,EACF,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ,GASMC,IAAuD;AAAA,EAC3D,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ,GAGMC,IAAgD;AAAA,EACpD,KAAK;AAAA,EACL,YAAY;AAAA,EACZ,KAAK;AACP,GAiCaC,IAAoBC;AAAA,EAI/B,CACE;AAAA,IACE,eAAAC,IAAgB;AAAA,IAChB,gBAA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