@alfadocs/ui-kit-debug 0.66.0 → 0.67.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/{agenda-card-Bl-SBiCh.js → agenda-card-BxSFkqgY.js} +2 -2
- package/dist/_chunks/{agenda-card-Bl-SBiCh.js.map → agenda-card-BxSFkqgY.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-Bh1KfEOG.js → agenda-tray-T-BumlGZ.js} +2 -2
- package/dist/_chunks/{agenda-tray-Bh1KfEOG.js.map → agenda-tray-T-BumlGZ.js.map} +1 -1
- package/dist/_chunks/{ai-consent-banner-Btzmk8OH.js → ai-consent-banner-Dxtx_WAh.js} +2 -2
- package/dist/_chunks/{ai-consent-banner-Btzmk8OH.js.map → ai-consent-banner-Dxtx_WAh.js.map} +1 -1
- package/dist/_chunks/{ai-tools-rail-DAfaW8eA.js → ai-tools-rail-DfmewPUN.js} +57 -50
- package/dist/_chunks/ai-tools-rail-DfmewPUN.js.map +1 -0
- package/dist/_chunks/{alia-sidebar-CN8pA6c-.js → alia-sidebar-Ckv0yCKi.js} +2 -2
- package/dist/_chunks/{alia-sidebar-CN8pA6c-.js.map → alia-sidebar-Ckv0yCKi.js.map} +1 -1
- package/dist/_chunks/{anamnesis-card-qeLYRG79.js → anamnesis-card-N8pIKWuS.js} +2 -2
- package/dist/_chunks/{anamnesis-card-qeLYRG79.js.map → anamnesis-card-N8pIKWuS.js.map} +1 -1
- package/dist/_chunks/{antenatal-schedule-timeline-BfzFjEyb.js → antenatal-schedule-timeline-35ebkcZT.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-BfzFjEyb.js.map → antenatal-schedule-timeline-35ebkcZT.js.map} +1 -1
- package/dist/_chunks/{appointment-tray-BQnJEora.js → appointment-tray-CQJ3Nbi5.js} +4 -4
- package/dist/_chunks/{appointment-tray-BQnJEora.js.map → appointment-tray-CQJ3Nbi5.js.map} +1 -1
- package/dist/_chunks/{badge-zsf5i5bH.js → badge-CqGsX32l.js} +46 -42
- package/dist/_chunks/badge-CqGsX32l.js.map +1 -0
- package/dist/_chunks/{bishop-score-DPN4Ched.js → bishop-score-CjsB9bM-.js} +2 -2
- package/dist/_chunks/{bishop-score-DPN4Ched.js.map → bishop-score-CjsB9bM-.js.map} +1 -1
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js → bmi-calculator-n-823_1V.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js.map → bmi-calculator-n-823_1V.js.map} +1 -1
- package/dist/_chunks/{care-plan-card-D42WD4-T.js → care-plan-card-CJei-nl9.js} +4 -4
- package/dist/_chunks/{care-plan-card-D42WD4-T.js.map → care-plan-card-CJei-nl9.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-BukNI7Uy.js → care-plan-entry-card-EmfrbHu8.js} +4 -4
- package/dist/_chunks/{care-plan-entry-card-BukNI7Uy.js.map → care-plan-entry-card-EmfrbHu8.js.map} +1 -1
- package/dist/_chunks/{clinical-note-card-BYo437dU.js → clinical-note-card-gtrxv6zn.js} +2 -2
- package/dist/_chunks/{clinical-note-card-BYo437dU.js.map → clinical-note-card-gtrxv6zn.js.map} +1 -1
- package/dist/_chunks/{color-picker-9tL7pz5y.js → color-picker-B7xsn6tX.js} +186 -167
- package/dist/_chunks/color-picker-B7xsn6tX.js.map +1 -0
- package/dist/_chunks/{contact-profile-card-CCeJmjbd.js → contact-profile-card-7BMB85T6.js} +2 -2
- package/dist/_chunks/{contact-profile-card-CCeJmjbd.js.map → contact-profile-card-7BMB85T6.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-D6LTmtQt.js → cycle-calculator-BF0ointe.js} +2 -2
- package/dist/_chunks/{cycle-calculator-D6LTmtQt.js.map → cycle-calculator-BF0ointe.js.map} +1 -1
- package/dist/_chunks/{dependent-selector-CRWgieHm.js → dependent-selector-DpzGtr_J.js} +2 -2
- package/dist/_chunks/{dependent-selector-CRWgieHm.js.map → dependent-selector-DpzGtr_J.js.map} +1 -1
- package/dist/_chunks/{document-scanner-biBS_f6c.js → document-scanner-D2qehl3-.js} +53 -53
- package/dist/_chunks/{document-scanner-biBS_f6c.js.map → document-scanner-D2qehl3-.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-CIG194vq.js → due-date-calculator-DU9AEWNy.js} +3 -3
- package/dist/_chunks/{due-date-calculator-CIG194vq.js.map → due-date-calculator-DU9AEWNy.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-f3d0Rhue.js → editable-currency-cell-renderer-BVJ04DkB.js} +956 -897
- package/dist/_chunks/editable-currency-cell-renderer-BVJ04DkB.js.map +1 -0
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js → fetal-weight-BVSzOhuR.js} +2 -2
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js.map → fetal-weight-BVSzOhuR.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-BGsZaWXW.js → gestational-age-calculator-DBlFdoiP.js} +3 -3
- package/dist/_chunks/{gestational-age-calculator-BGsZaWXW.js.map → gestational-age-calculator-DBlFdoiP.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-LH5i6oM7.js → hcg-doubling-if4Q8aSX.js} +2 -2
- package/dist/_chunks/{hcg-doubling-LH5i6oM7.js.map → hcg-doubling-if4Q8aSX.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-Cou6XnMJ.js → marketplace-app-shell-Bu-HD3fy.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-Cou6XnMJ.js.map → marketplace-app-shell-Bu-HD3fy.js.map} +1 -1
- package/dist/_chunks/{message-card-Bgcvfj6-.js → message-card-Bx4GmLvf.js} +9 -9
- package/dist/_chunks/{message-card-Bgcvfj6-.js.map → message-card-Bx4GmLvf.js.map} +1 -1
- package/dist/_chunks/{message-tray-saAVMeHP.js → message-tray-CVyJajVJ.js} +2 -2
- package/dist/_chunks/{message-tray-saAVMeHP.js.map → message-tray-CVyJajVJ.js.map} +1 -1
- package/dist/_chunks/{operator-hero-CM8949Hd.js → operator-hero-f_KaRhw5.js} +2 -2
- package/dist/_chunks/{operator-hero-CM8949Hd.js.map → operator-hero-f_KaRhw5.js.map} +1 -1
- package/dist/_chunks/{patient-search-Bw9ONucF.js → patient-search-DR9XUYRQ.js} +2 -2
- package/dist/_chunks/{patient-search-Bw9ONucF.js.map → patient-search-DR9XUYRQ.js.map} +1 -1
- package/dist/_chunks/{patient-shell-Tgpv0HND.js → patient-shell-DrV_iekt.js} +2 -2
- package/dist/_chunks/{patient-shell-Tgpv0HND.js.map → patient-shell-DrV_iekt.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-Bgso0p_l.js → patient-summary-card-ByfIU8N0.js} +4 -4
- package/dist/_chunks/{patient-summary-card-Bgso0p_l.js.map → patient-summary-card-ByfIU8N0.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-DBz3hVDz.js → payment-request-card-yTjzKQCU.js} +3 -3
- package/dist/_chunks/{payment-request-card-DBz3hVDz.js.map → payment-request-card-yTjzKQCU.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-card-AYyHtU9K.js → periodontal-chart-card-Dh3KgvYG.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-AYyHtU9K.js.map → periodontal-chart-card-Dh3KgvYG.js.map} +1 -1
- package/dist/_chunks/{practice-results-CVAgY2RZ.js → practice-results-DND2SAt7.js} +2 -2
- package/dist/_chunks/{practice-results-CVAgY2RZ.js.map → practice-results-DND2SAt7.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-f9aJbiAk.js → pregnancy-dating-QY-sqpvj.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-f9aJbiAk.js.map → pregnancy-dating-QY-sqpvj.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js → pregnancy-weight-gain-DOJXXNYP.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js.map → pregnancy-weight-gain-DOJXXNYP.js.map} +1 -1
- package/dist/_chunks/rich-text-editor-BOQr5lHx.js +1970 -0
- package/dist/_chunks/rich-text-editor-BOQr5lHx.js.map +1 -0
- package/dist/_chunks/{scroll-area-BWqCkEGz.js → scroll-area-eccd_Uf-.js} +38 -28
- package/dist/_chunks/scroll-area-eccd_Uf-.js.map +1 -0
- package/dist/_chunks/{sidebar-BFwbx74W.js → sidebar-CGjIk_FQ.js} +25 -22
- package/dist/_chunks/sidebar-CGjIk_FQ.js.map +1 -0
- package/dist/_chunks/{suggestion-chip-C4kxWUIs.js → suggestion-chip-Bk4PmYTg.js} +30 -30
- package/dist/_chunks/suggestion-chip-Bk4PmYTg.js.map +1 -0
- package/dist/_chunks/{tab-bar-Xetknddo.js → tab-bar-B1ovILzh.js} +2 -2
- package/dist/_chunks/{tab-bar-Xetknddo.js.map → tab-bar-B1ovILzh.js.map} +1 -1
- package/dist/_chunks/{tag-CdA0s_VV.js → tag-BQXwuJq1.js} +41 -38
- package/dist/_chunks/tag-BQXwuJq1.js.map +1 -0
- package/dist/_chunks/{transaction-chip-BZCa6XDn.js → transaction-chip-BrW8P50O.js} +19 -19
- package/dist/_chunks/transaction-chip-BrW8P50O.js.map +1 -0
- package/dist/_chunks/{workflow-map-Bt4Of5dT.js → workflow-map-JAZryZJr.js} +2 -2
- package/dist/_chunks/{workflow-map-Bt4Of5dT.js.map → workflow-map-JAZryZJr.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts.map +1 -1
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/appointment-card/index.js +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts +16 -0
- package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts.map +1 -1
- package/dist/components/data-table/cell-renderers/tooth-cell-renderer.d.ts +12 -0
- package/dist/components/data-table/cell-renderers/tooth-cell-renderer.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +1 -1
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +13 -12
- package/dist/components/data-table/toolbar.d.ts +5 -1
- package/dist/components/data-table/toolbar.d.ts.map +1 -1
- package/dist/components/dependent-selector/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +25 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +2 -0
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/suggestion-chip/index.js +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts.map +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +10 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +11 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +10 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +11 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +10 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +11 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +10 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +11 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +10 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +11 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +10 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +11 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +10 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +11 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +10 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +11 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +10 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +11 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +10 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +9 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +10 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +11 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +10 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +11 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +10 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +11 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +10 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +11 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +10 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +11 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +10 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +9 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +10 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +11 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +10 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +9 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +508 -507
- package/dist/locales/ar.json +11 -1
- package/dist/locales/de.json +11 -1
- package/dist/locales/el.json +11 -1
- package/dist/locales/en.json +11 -1
- package/dist/locales/es.json +11 -1
- package/dist/locales/fr.json +11 -1
- package/dist/locales/hi.json +11 -1
- package/dist/locales/it.json +11 -1
- package/dist/locales/ja.json +11 -1
- package/dist/locales/nl.json +11 -1
- package/dist/locales/pl.json +11 -1
- package/dist/locales/pt.json +11 -1
- package/dist/locales/ro.json +11 -1
- package/dist/locales/ru.json +11 -1
- package/dist/locales/sq.json +11 -1
- package/dist/locales/sv.json +11 -1
- package/dist/locales/tr.json +11 -1
- package/dist/locales/zh.json +11 -1
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +6 -3
- package/package.json +1 -1
- package/dist/_chunks/ai-tools-rail-DAfaW8eA.js.map +0 -1
- package/dist/_chunks/badge-zsf5i5bH.js.map +0 -1
- package/dist/_chunks/color-picker-9tL7pz5y.js.map +0 -1
- package/dist/_chunks/editable-currency-cell-renderer-f3d0Rhue.js.map +0 -1
- package/dist/_chunks/rich-text-editor-B5XQNxe8.js +0 -1586
- package/dist/_chunks/rich-text-editor-B5XQNxe8.js.map +0 -1
- package/dist/_chunks/scroll-area-BWqCkEGz.js.map +0 -1
- package/dist/_chunks/sidebar-BFwbx74W.js.map +0 -1
- package/dist/_chunks/suggestion-chip-C4kxWUIs.js.map +0 -1
- package/dist/_chunks/tag-CdA0s_VV.js.map +0 -1
- package/dist/_chunks/transaction-chip-BZCa6XDn.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfadocs/ui-kit-debug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe. (debug build — identical runtime to @alfadocs/ui-kit, ships source maps for symbolication).",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools-rail-DAfaW8eA.js","sources":["../../src/components/ai-tools-rail/ai-tools-rail.agent.ts","../../src/components/ai-tools-rail/ai-tools-rail.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AiToolsRail. */\n/* */\n/* Rail-level surface: open / close a tool's panel and read which tool */\n/* is active. State is strictly the active tool id — never any tool's */\n/* panel CONTENT (which may carry PHI). Tool ids + badge counts are */\n/* supplied by the host via props, not derived from panel bodies. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AiToolsRailHandle } from './ai-tools-rail';\n\nexport const aiToolsRailAgent: AgentAdapter<AiToolsRailHandle> = {\n id: 'ai-tools-rail',\n capabilities: ['open', 'close', 'select_single'],\n state: {\n activeToolId: {\n type: 'string | null',\n descriptionKey: 'ui.aiToolsRail.agent.state.activeToolId',\n description:\n 'Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.',\n read: (handle) => handle.getActiveToolId(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n argsType: '{ id: string }',\n descriptionKey: 'ui.aiToolsRail.agent.actions.open',\n description: \"Open the given tool's panel.\",\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n descriptionKey: 'ui.aiToolsRail.agent.actions.close',\n description: 'Collapse the rail to its strip (no active tool).',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_tool: {\n safety: 'read',\n argsType: '{ id: string | null }',\n descriptionKey: 'ui.aiToolsRail.agent.actions.selectTool',\n description:\n 'Set the active tool by id (opens its panel), or pass null to collapse.',\n invoke: (handle, args: { id: string | null }) => {\n handle.setActiveTool(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-tools-rail',\n description: 'Marks the AiToolsRail wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific rail from the agent.',\n },\n item: {\n attr: 'data-tool-id',\n description:\n 'Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { IconButton } from '../button/icon-button';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport { TooltipProvider } from '../tooltip/tooltip';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useEdgeResize } from '../../hooks/use-edge-resize';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { aiToolsRailAgent } from './ai-tools-rail.agent';\n\n/* ------------------------------------------------------------------ */\n/* Tokenised widths */\n/* */\n/* Fixed + tokenised so the rail stays constraint-compliant — no */\n/* prop-driven inline styles. Bare `[inline-size:…]` is NOT a */\n/* recognised utility under the `ds:` prefix; it must carry the */\n/* prefix or Tailwind emits no rule. Consumers needing a different */\n/* size wrap the rail and override via CSS. */\n/* ------------------------------------------------------------------ */\nconst RAIL_WIDTH = 'ds:[inline-size:3rem]';\n// Panel width rides a consumer-overridable custom property (set\n// `--ai-tools-rail-panel-inline-size` on the rail or a wrapper) so\n// content-heavy tools (e.g. an inbox feed) can widen their panel\n// without inline styles. Defaults to the 22rem tray-family width.\nconst PANEL_WIDTH =\n 'ds:[inline-size:var(--ai-tools-rail-panel-inline-size,22rem)]';\n// The custom property PANEL_WIDTH reads. The resize hook writes the\n// committed px width here (on the panel element, so it beats consumer\n// class overrides on the root) and removes it on reset.\nconst PANEL_SIZE_PROPERTY = '--ai-tools-rail-panel-inline-size';\n// Resize clamp + nominal default, px (352px = the 22rem token default).\nconst PANEL_MIN_SIZE = 288;\nconst PANEL_MAX_SIZE = 640;\nconst PANEL_DEFAULT_SIZE = 352;\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface AiToolsRailTool {\n /** Stable tool id — used in `data-active`, the imperative handle, and\n * to label the open panel region. */\n id: string;\n /** Accessible name for the strip icon + tooltip, and the open panel's\n * region label. Never rendered as visible body text. */\n label: string;\n /** lucide-react glyph (rendered `aria-hidden` inside the IconButton). */\n icon: ReactNode;\n /** Panel body for this tool. Rendered inline-start of the strip when\n * `side='end'` (mirrored for `'start'`). The consumer composes it. */\n panel: ReactNode;\n /** Optional unseen / notification count shown on the strip icon. */\n badgeCount?: number;\n /** When true the icon is non-interactive and skipped by roving focus. */\n disabled?: boolean;\n}\n\n/**\n * Curated imperative handle for AiToolsRail. Exposed as the forwardRef\n * target so a future agent / MCP UI bridge can drive the rail without\n * touching the DOM. See `ai-tools-rail.agent.ts`.\n *\n * State surfaced here is strictly identifiers + counts — never any\n * tool's panel content (which may carry PHI).\n */\nexport interface AiToolsRailHandle {\n /** Currently-active tool id, or null when collapsed to strip-only. */\n getActiveToolId: () => string | null;\n /** Activate a tool by id (opens its panel), or null to collapse. */\n setActiveTool: (id: string | null) => void;\n /** Activate a tool by id (opens its panel). */\n open: (id: string) => void;\n /** Collapse to strip-only (no active tool). */\n close: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA — `side` drives the dock edge + which shadow faces main content */\n/* ------------------------------------------------------------------ */\n\nconst railVariants = cva(\n ['ds:flex ds:shrink-0 ds:h-full', 'ds:bg-[var(--background)]'].join(' '),\n {\n variants: {\n side: {\n // Strip docks inline-end; the panel mounts inline-start of it\n // (flex-row, panel rendered first). Shadow faces the main area —\n // no border against main (the rail stays line-free; the only seam\n // is the strip↔panel divider on the open panel, see render).\n end: 'ds:flex-row ds:shadow-[var(--shadow-chrome-start)]',\n // Strip docks inline-start; the panel mounts inline-end of it.\n start: 'ds:flex-row-reverse ds:shadow-[var(--shadow-chrome-end)]',\n },\n },\n defaultVariants: { side: 'end' },\n },\n);\n\nconst stripVariants = cva(\n [\n 'ds:flex ds:shrink-0 ds:flex-col ds:items-center',\n 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]',\n 'ds:gap-[var(--spacing-xs)]',\n RAIL_WIDTH,\n ].join(' '),\n);\n\nconst panelVariants = cva(\n [\n 'ds:relative ds:flex ds:min-h-0 ds:flex-col ds:h-full',\n 'ds:bg-[var(--background)]',\n PANEL_WIDTH,\n // Defensive: the panel doesn't animate its width today, but if a\n // consumer adds a transition on the var, suppress it mid-drag.\n 'ds:data-[resizing]:transition-none',\n ].join(' '),\n);\n\n// Resize handle on the panel's inner edge — mirrors Resizable's Handle\n// (::before hit area to --min-target-size, hover/focus/drag accent, token\n// focus ring) but absolutely positioned over the panel edge. Like the\n// Sidebar's handle it stays TRANSPARENT at rest: the rail root's\n// `shadow-chrome-*` (which faces the main content) carries the resting seam,\n// exactly as the start-docked Sidebar leans on its own shadow — so the rail\n// never shows the constant coloured bar it used to. The strip only tints\n// accent on hover / focus / drag.\nconst panelResizeHandleVariants = cva(\n [\n 'ds:absolute ds:[inset-block:0] ds:z-[1] ds:select-none ds:touch-none',\n 'ds:[inline-size:var(--resizable-handle-size)] ds:cursor-col-resize',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--accent)] ds:focus-visible:bg-[var(--accent)] ds:data-[resizing]:bg-[var(--accent)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n \"ds:before:absolute ds:before:content-['']\",\n 'ds:before:[block-size:100%]',\n 'ds:before:[inline-size:var(--min-target-size)]',\n 'ds:before:[inset-block:0]',\n 'ds:before:[inset-inline:calc(0px_-_(var(--min-target-size)_-_var(--resizable-handle-size))_/_2)]',\n ],\n {\n variants: {\n edge: {\n 'inline-start': 'ds:start-0',\n 'inline-end': 'ds:end-0',\n },\n },\n defaultVariants: { edge: 'inline-start' },\n },\n);\n\n// Hand-rolled overlay count chip — mirrors the AliaSidebar / MessageTray\n// badge markup. A <Badge> would re-introduce its own landmark/role; the\n// strip icon already carries the count in its accessible name, so this\n// span is purely decorative (`aria-hidden`).\nconst badgeVariants = cva(\n [\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface AiToolsRailProps extends VariantProps<typeof railVariants> {\n /** Stable instance id, surfaced on the root as `data-component-id`. */\n id?: string;\n /** The tools shown as icons on the strip. */\n tools: AiToolsRailTool[];\n /** Controlled active tool id (null = collapsed / strip-only). */\n activeToolId?: string | null;\n /** Uncontrolled initial active tool id (default null). */\n defaultActiveToolId?: string | null;\n /** Fires whenever the active tool changes (incl. → null on collapse). */\n onActiveToolChange?: (id: string | null) => void;\n /** Which edge the rail docks to. Default `'end'` (inline-end). */\n side?: 'start' | 'end';\n /** Accessible label for the toolbar strip. */\n railLabel?: string;\n /**\n * Opt-in resize affordance for the open tool panel. Renders a\n * `role=\"separator\"` drag handle on the panel's inner edge (the edge\n * facing the main content). The committed width is written to\n * `--ai-tools-rail-panel-inline-size` on the panel element (288–640px);\n * Enter / double-click resets to the token-driven default. Default `false`.\n */\n resizablePanel?: boolean;\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const AiToolsRail = forwardRef<AiToolsRailHandle, AiToolsRailProps>(\n (\n {\n id,\n tools,\n activeToolId,\n defaultActiveToolId = null,\n onActiveToolChange,\n side = 'end',\n railLabel,\n resizablePanel = false,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n // Controlled / uncontrolled bridge — the same hook MessageTray uses.\n const [activeRaw, setActiveRaw] = useControllableState<string | null>({\n value: activeToolId,\n defaultValue: defaultActiveToolId,\n onChange: onActiveToolChange,\n });\n const activeId = activeRaw ?? null;\n\n // Roving-tabindex bookkeeping for the vertical toolbar strip.\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const panelRef = useRef<HTMLElement | null>(null);\n const [focusIndex, setFocusIndex] = useState(0);\n // Distinguishes keyboard activation (auto-focus into the panel) from\n // pointer activation (focus stays on the icon — less jarring).\n const activatedByKeyboardRef = useRef(false);\n // Set on Enter/Space keydown, read by the click handler that follows,\n // cleared on keyup — so a subsequent mouse click never inherits it.\n const keyboardActivateRef = useRef(false);\n\n const activeIndex = useMemo(\n () => tools.findIndex((tl) => tl.id === activeId),\n [tools, activeId],\n );\n const activeTool = activeIndex >= 0 ? tools[activeIndex] : null;\n\n // First non-disabled index — the resting roving stop when none active.\n const firstEnabledIndex = useMemo(\n () => tools.findIndex((tl) => !tl.disabled),\n [tools],\n );\n\n // The roving tab stop: the active icon when a tool is open, else the\n // index the user last focused, else the first enabled icon.\n const rovingIndex =\n activeIndex >= 0\n ? activeIndex\n : focusIndex >= 0 && !tools[focusIndex]?.disabled\n ? focusIndex\n : firstEnabledIndex;\n\n const selectTool = useCallback(\n (toolId: string, fromKeyboard: boolean) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = fromKeyboard;\n // Clicking / activating the active tool collapses to strip-only.\n setActiveRaw(activeId === toolId ? null : toolId);\n },\n [tools, activeId, setActiveRaw],\n );\n\n /* ---- Roving arrow-key navigation (vertical toolbar) ----------- */\n const handleStripKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n const count = tools.length;\n if (count === 0) return;\n\n let next: number | null = null;\n if (event.key === 'ArrowDown') next = (rovingIndex + 1) % count;\n else if (event.key === 'ArrowUp')\n next = (rovingIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n if (next === null) return;\n\n // Skip disabled icons in the travel direction.\n const goingBack = event.key === 'ArrowUp' || event.key === 'End';\n let candidate = next;\n let attempts = 0;\n while (attempts < count && tools[candidate]?.disabled) {\n candidate = goingBack\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n if (tools[candidate]?.disabled) return;\n\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n },\n [tools, rovingIndex],\n );\n\n /* ---- Esc collapses + returns focus to the active tool's icon -- */\n // Attached imperatively via the root ref (not a JSX onKeyDown on the\n // static container) so the Escape shortcut works from anywhere inside the\n // open panel without an interaction handler on a non-interactive element.\n const rootRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const node = rootRef.current;\n if (!node) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n if (activeIndex < 0) return;\n event.preventDefault();\n const returnIndex = activeIndex;\n setActiveRaw(null);\n setFocusIndex(returnIndex);\n // Defer until after the panel unmounts so focus lands cleanly.\n requestAnimationFrame(() => {\n buttonsRef.current[returnIndex]?.focus();\n });\n };\n node.addEventListener('keydown', onKeyDown);\n return () => node.removeEventListener('keydown', onKeyDown);\n }, [activeIndex, setActiveRaw]);\n\n /* ---- Move focus into the panel when opened by keyboard -------- */\n useIsomorphicLayoutEffect(() => {\n if (activeTool && activatedByKeyboardRef.current) {\n panelRef.current?.focus();\n }\n activatedByKeyboardRef.current = false;\n }, [activeTool]);\n\n /* ---- Opt-in panel resize (inner edge) -------------------------- */\n // The handle sits on the edge facing the main content: the panel's\n // inline-start edge for an end-docked rail, inline-end for start.\n const panelEdge = side === 'end' ? 'inline-start' : 'inline-end';\n const { separatorProps, isResizing, isResized } = useEdgeResize({\n edge: panelEdge,\n targetRef: panelRef,\n cssProperty: PANEL_SIZE_PROPERTY,\n minSize: PANEL_MIN_SIZE,\n maxSize: PANEL_MAX_SIZE,\n defaultSize: PANEL_DEFAULT_SIZE,\n disabled: !resizablePanel,\n });\n\n // The aside unmounts on collapse, dropping the hook's inline override.\n // Re-assert the committed width when a panel (re)mounts so a reopened\n // panel keeps the user's chosen size.\n const committedPanelWidth = separatorProps['aria-valuenow'];\n useIsomorphicLayoutEffect(() => {\n if (!resizablePanel || !isResized || !activeTool) return;\n panelRef.current?.style.setProperty(\n PANEL_SIZE_PROPERTY,\n `${committedPanelWidth}px`,\n );\n }, [activeTool, resizablePanel, isResized, committedPanelWidth]);\n\n /* ---- Curated imperative handle for agent integration ---------- */\n const activeIdRef = useRef<string | null>(activeId);\n activeIdRef.current = activeId;\n\n const handle = useMemo<AiToolsRailHandle>(\n () => ({\n getActiveToolId: () => activeIdRef.current,\n setActiveTool: (toolId) => {\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n open: (toolId) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n close: () => {\n activatedByKeyboardRef.current = false;\n setActiveRaw(null);\n },\n }),\n [tools, setActiveRaw],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(aiToolsRailAgent, handle, id);\n\n const overflowLabel = t('aiToolsRail.badgeCountOverflow', {\n defaultValue: '99+',\n });\n\n return (\n <div\n ref={rootRef}\n data-component=\"ai-tools-rail\"\n data-component-id={id}\n data-side={side}\n className={[railVariants({ side }), className]\n .filter(Boolean)\n .join(' ')}\n >\n {/* The OPEN panel is the single complementary landmark, named by\n the active tool. Rendered only while a tool is active so two\n unnamed regions never coexist. */}\n {activeTool ? (\n <aside\n ref={panelRef}\n tabIndex={-1}\n aria-label={t('aiToolsRail.panelLabel', {\n tool: activeTool.label,\n defaultValue: '{{tool}} panel',\n })}\n data-ai-tools-rail-state=\"expanded\"\n data-active-tool={activeTool.id}\n data-resizing={isResizing ? '' : undefined}\n className={[\n panelVariants(),\n // 1px divider between the panel and the icon strip (the tab\n // row). Lives on the panel's STRIP-facing edge, so it only\n // renders while the panel is open (the aside is unmounted when\n // collapsed) and never doubles as a rail↔main line. `border-e`\n // / `border-s` are the real logical border-width utilities —\n // bare `border-inline-*` emits no CSS in this build.\n side === 'end'\n ? 'ds:border-e ds:border-[var(--border)]'\n : 'ds:border-s ds:border-[var(--border)]',\n 'ds:focus-visible:outline-none',\n ].join(' ')}\n >\n <ScrollArea orientation=\"vertical\" className=\"ds:flex-1 ds:min-h-0\">\n {activeTool.panel}\n </ScrollArea>\n {/* Inside the aside (so it belongs to the complementary\n landmark) and outside the toolbar strip — the strip's\n roving handlers never see its key events, and Escape\n still bubbles to the root to collapse, as everywhere\n else in the panel. No stopPropagation needed. */}\n {resizablePanel ? (\n <div\n {...separatorProps}\n aria-label={t('aiToolsRail.resizePanel', {\n defaultValue: 'Resize tool panel',\n })}\n data-resizing={isResizing ? '' : undefined}\n className={panelResizeHandleVariants({ edge: panelEdge })}\n />\n ) : null}\n </aside>\n ) : null}\n\n {/* The 3rem icon strip — a vertical toolbar with roving tabindex.\n Self-contained TooltipProvider so consumers needn't mount one;\n Radix providers compose, so a host-level provider still works. */}\n <TooltipProvider>\n <div\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n aria-label={\n railLabel ??\n t('aiToolsRail.railLabel', { defaultValue: 'AI tools' })\n }\n className={stripVariants()}\n onKeyDown={handleStripKeyDown}\n >\n {tools.map((tool, index) => {\n const isActive = tool.id === activeId;\n const showBadge =\n typeof tool.badgeCount === 'number' && tool.badgeCount > 0;\n // Fold the count into the accessible name so SR users hear it\n // without relying on the decorative chip.\n const accessibleName = showBadge\n ? t('aiToolsRail.toolWithCount', {\n tool: tool.label,\n count: tool.badgeCount,\n defaultValue: '{{tool}}, {{count}} updates',\n })\n : tool.label;\n return (\n <div key={tool.id} className=\"ds:relative\">\n <IconButton\n ref={(el) => {\n buttonsRef.current[index] = el;\n }}\n icon={tool.icon}\n tooltip={tool.label}\n aria-label={accessibleName}\n intent=\"ghost\"\n size=\"sm\"\n disabled={tool.disabled}\n aria-pressed={isActive}\n aria-expanded={isActive}\n data-active={isActive ? tool.id : undefined}\n data-tool-id={tool.id}\n tabIndex={index === rovingIndex ? 0 : -1}\n onFocus={() => {\n if (!tool.disabled) setFocusIndex(index);\n }}\n onClick={() =>\n selectTool(tool.id, keyboardActivateRef.current)\n }\n onKeyDown={(event) => {\n // Enter/Space activate via the native button's click,\n // which fires AFTER this keydown. Flag the upcoming\n // click as keyboard-driven so focus moves into the\n // panel; reset on keyup so a later mouse click doesn't\n // inherit the flag.\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = true;\n }\n }}\n onKeyUp={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = false;\n }\n }}\n />\n {showBadge ? (\n <span aria-hidden=\"true\" className={badgeVariants()}>\n {formatBadgeCount(\n tool.badgeCount as number,\n overflowLabel,\n )}\n </span>\n ) : null}\n </div>\n );\n })}\n </div>\n </TooltipProvider>\n </div>\n );\n },\n);\n\nAiToolsRail.displayName = 'AiToolsRail';\n"],"names":["aiToolsRailAgent","handle","args","RAIL_WIDTH","PANEL_WIDTH","PANEL_SIZE_PROPERTY","PANEL_MIN_SIZE","PANEL_MAX_SIZE","PANEL_DEFAULT_SIZE","railVariants","cva","stripVariants","panelVariants","panelResizeHandleVariants","badgeVariants","formatBadgeCount","count","overflowLabel","AiToolsRail","forwardRef","id","tools","activeToolId","defaultActiveToolId","onActiveToolChange","side","railLabel","resizablePanel","className","ref","t","useTranslation","activeRaw","setActiveRaw","useControllableState","activeId","buttonsRef","useRef","panelRef","focusIndex","setFocusIndex","useState","activatedByKeyboardRef","keyboardActivateRef","activeIndex","useMemo","tl","activeTool","firstEnabledIndex","rovingIndex","_a","selectTool","useCallback","toolId","fromKeyboard","tool","handleStripKeyDown","event","next","goingBack","candidate","attempts","_b","_c","rootRef","useEffect","node","onKeyDown","returnIndex","useIsomorphicLayoutEffect","panelEdge","separatorProps","isResizing","isResized","useEdgeResize","committedPanelWidth","activeIdRef","useImperativeHandle","useAgentRegistration","jsxs","jsx","ScrollArea","TooltipProvider","index","isActive","showBadge","accessibleName","IconButton","el"],"mappings":";;;;;;;;;;;AAYO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,eAAe;AAAA,EAC/C,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,gBAAA;AAAA,IAAgB;AAAA,EAC3C;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,KAAKC,EAAK,E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js","sources":["../../src/components/badge/badge.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip } from '../tooltip';\n\n/* ------------------------------------------------------------------ */\n/* CVA — badge root */\n/* ------------------------------------------------------------------ */\n\nconst badgeVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-1',\n // Typography comes from the eyebrow role: Medium 500 + uppercase + expanded tracking.\n // CVA size variants below override just `--type-eyebrow-size` so weight/transform/\n // tracking/line-height stay role-owned — same chip-family pattern as Tag.\n 'type-eyebrow',\n 'ds:whitespace-nowrap',\n 'ds:focus-visible:outline-none',\n 'ds:focus-visible:ring-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:ring-[color:var(--ring)]',\n 'ds:focus-visible:ring-offset-[length:var(--focus-ring-offset)]',\n ].join(' '),\n {\n variants: {\n variant: {\n // `bg-muted` at full opacity (not /20) — `--muted` is already\n // a light grey (#eaeaee in light, similarly soft in dark). The\n // semantic variants below use /15 against saturated source\n // colours; applying the same reduction to `muted` made the\n // neutral chip nearly invisible against a white surface\n // (~5% grey wash with no perceptible edge). Full opacity\n // gives ~6:1 surface contrast and the chip reads as a chip.\n neutral: 'ds:bg-muted ds:text-muted-foreground',\n info: 'ds:bg-info/15 ds:text-[var(--info-foreground)]',\n success: 'ds:bg-success/15 ds:text-[var(--success-foreground)]',\n warning: 'ds:bg-warning/15 ds:text-[var(--warning-foreground)]',\n error: 'ds:bg-destructive/15 ds:text-[var(--error-foreground)]',\n // Solid-fill brand variants — no border, foreground paired with the\n // semantic token. Use for trust-signal chips in hero contexts where\n // a tonal `info` / `neutral` would blend into the brand backdrop.\n brand: 'ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]',\n accent: 'ds:bg-[var(--accent)] ds:text-[var(--accent-foreground)]',\n },\n size: {\n sm: 'ds:h-4 ds:ps-1 ds:pe-1 ds:[--type-eyebrow-size:var(--font-size-2xs)]',\n md: 'ds:h-5 ds:ps-1.5 ds:pe-1.5 ds:[--type-eyebrow-size:var(--font-size-2xs)]',\n lg: 'ds:h-6 ds:ps-2 ds:pe-2 ds:[--type-eyebrow-size:var(--font-size-xs)]',\n },\n shape: {\n pill: 'ds:rounded-[var(--radius-full)]',\n rectangular: 'ds:rounded-[var(--radius-sm)]',\n },\n },\n defaultVariants: {\n variant: 'neutral',\n size: 'md',\n shape: 'pill',\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* CVA — leading dot */\n/* ------------------------------------------------------------------ */\n\nconst dotVariants = cva(\n 'ds:text-[length:var(--font-size-dot)] ds:leading-none ds:shrink-0',\n {\n variants: {\n variant: {\n neutral: 'ds:text-muted-foreground',\n info: 'ds:text-info',\n success: 'ds:text-success',\n warning: 'ds:text-warning',\n error: 'ds:text-destructive',\n // Solid-fill variants: dot draws in the paired foreground tone so\n // it stays visible against the saturated primary/accent fill.\n brand: 'ds:text-[var(--primary-foreground)]',\n accent: 'ds:text-[var(--accent-foreground)]',\n },\n },\n defaultVariants: { variant: 'neutral' },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* CVA — leading icon wrapper */\n/* ------------------------------------------------------------------ */\n\nconst iconWrapperVariants = cva('ds:shrink-0 ds:[&>svg]:block', {\n variants: {\n size: {\n // Icons shrink with the compact Badge scale: sm badge is 16 px tall, so\n // a 10 px glyph leaves room for the 1 px internal padding.\n sm: 'ds:[&>svg]:size-2.5',\n md: 'ds:[&>svg]:size-3',\n lg: 'ds:[&>svg]:size-3.5',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\n/* ------------------------------------------------------------------ */\n/* BadgeProps */\n/* ------------------------------------------------------------------ */\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {\n /** Leading icon — renders before the label */\n leading?: ReactNode;\n /** Show a leading dot indicator (● shape) for colour-blind accessibility */\n withDot?: boolean;\n /** Truncate long text with ellipsis + tooltip showing full text */\n truncate?: boolean;\n /** For icon-only badges — provides the accessible name */\n 'aria-label'?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Badge */\n/* ------------------------------------------------------------------ */\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(\n (\n {\n variant = 'neutral',\n size = 'md',\n shape = 'pill',\n leading,\n withDot = false,\n truncate = false,\n className,\n children,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const isIconOnly = !children && !!ariaLabel;\n const isCount = typeof children === 'number';\n\n const badge = (\n <span\n ref={ref}\n className={badgeVariants({ variant, size, shape, className })}\n data-component=\"badge\"\n role={isIconOnly ? 'img' : undefined}\n aria-label={isIconOnly ? ariaLabel : undefined}\n {...props}\n >\n {withDot && (\n <span aria-hidden=\"true\" className={dotVariants({ variant })}>\n ●\n </span>\n )}\n {leading && (\n <span aria-hidden=\"true\" className={iconWrapperVariants({ size })}>\n {leading}\n </span>\n )}\n {!isIconOnly &&\n (isCount ? (\n <>\n <span aria-hidden=\"true\">{children}</span>\n <span className=\"ds:sr-only\">\n {t('badge.notifications', { count: children })}\n </span>\n </>\n ) : truncate ? (\n <span className=\"ds:max-w-[var(--badge-truncate-max-width)] ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap\">\n {children}\n </span>\n ) : (\n children\n ))}\n </span>\n );\n\n if (truncate && typeof children === 'string') {\n return <Tooltip label={children}>{badge}</Tooltip>;\n }\n\n return badge;\n },\n);\n\nBadge.displayName = 'Badge';\n"],"names":["badgeVariants","cva","dotVariants","iconWrapperVariants","Badge","forwardRef","variant","size","shape","leading","withDot","truncate","className","children","ariaLabel","props","ref","t","useTranslation","isIconOnly","isCount","badge","jsxs","jsx","Fragment","Tooltip"],"mappings":";;;;;AASA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,IACE;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,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js","sources":["../../src/components/color-picker/color-picker.agent.ts","../../src/components/color-picker/color-utils.ts","../../src/components/color-picker/palettes.ts","../../src/components/color-picker/color-picker.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ColorPicker. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ColorPickerHandle } from './color-picker';\n\nexport const colorPickerAgent: AgentAdapter<ColorPickerHandle> = {\n id: 'color-picker',\n capabilities: ['pick'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.colorPicker.state.value',\n description: 'Currently picked colour as a hex string (e.g. \"#3b82f6\").',\n read: (handle) => handle.getValue(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ hex: string }',\n descriptionKey: 'ui.agent.colorPicker.actions.setValue',\n description: 'Set the picked colour from a hex string.',\n invoke: (handle, args: { hex: string }) => {\n handle.setValue(args.hex);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'color-picker',\n description:\n 'Marks the ColorPicker wrapper (inline) or trigger (popover variant).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/**\n * Pure colour-conversion utilities for the ColorPicker component.\n *\n * This is the ONLY file where hex/rgb literals are permitted (for conversion\n * math). The component file (`color-picker.tsx`) must not contain hex/rgb\n * literals — it references `var(--…)` tokens for its own UI.\n */\n\nexport interface HSLA {\n h: number; // 0–360\n s: number; // 0–100\n l: number; // 0–100\n a: number; // 0–1\n}\n\n/* ------------------------------------------------------------------ */\n/* Hex ↔ HSL */\n/* ------------------------------------------------------------------ */\n\n/** Parse a hex string (#rgb, #rrggbb, #rrggbbaa) into HSLA. */\nexport function hexToHsl(hex: string): HSLA {\n let h = hex.startsWith('#') ? hex.slice(1) : hex;\n\n // Expand shorthand (#rgb → #rrggbb, #rgba → #rrggbbaa)\n if (h.length === 3 || h.length === 4) {\n h = h\n .split('')\n .map((c) => c + c)\n .join('');\n }\n\n const r = parseInt(h.slice(0, 2), 16) / 255;\n const g = parseInt(h.slice(2, 4), 16) / 255;\n const b = parseInt(h.slice(4, 6), 16) / 255;\n const a = h.length === 8 ? parseInt(h.slice(6, 8), 16) / 255 : 1;\n\n return rgbToHsl(r, g, b, a);\n}\n\n/** Convert normalised RGB (0–1) + alpha to HSLA. */\nfunction rgbToHsl(r: number, g: number, b: number, a: number): HSLA {\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let hue = 0;\n let sat = 0;\n\n if (max !== min) {\n const d = max - min;\n sat = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n if (max === r) {\n hue = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n } else if (max === g) {\n hue = ((b - r) / d + 2) / 6;\n } else {\n hue = ((r - g) / d + 4) / 6;\n }\n }\n\n return {\n h: Math.round(hue * 360),\n s: Math.round(sat * 100),\n l: Math.round(l * 100),\n a: Math.round(a * 100) / 100,\n };\n}\n\n/** Convert HSLA to a hex string (#rrggbb or #rrggbbaa when a < 1). */\nexport function hslToHex(hsl: HSLA): string {\n const { r, g, b } = hslToRgbComponents(hsl);\n const toHex = (n: number) =>\n Math.round(n * 255)\n .toString(16)\n .padStart(2, '0');\n\n const base = `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n if (hsl.a < 1) {\n return `${base}${toHex(hsl.a)}`;\n }\n return base;\n}\n\n/** Convert HSLA to an rgba() string. */\nexport function hslToRgba(hsl: HSLA): string {\n const { r, g, b } = hslToRgbComponents(hsl);\n const ri = Math.round(r * 255);\n const gi = Math.round(g * 255);\n const bi = Math.round(b * 255);\n\n if (hsl.a < 1) {\n return `rgba(${ri}, ${gi}, ${bi}, ${hsl.a})`;\n }\n return `rgba(${ri}, ${gi}, ${bi}, 1)`;\n}\n\n/** Internal: convert HSLA to normalised RGB components (0–1). */\nfunction hslToRgbComponents(hsl: HSLA): {\n r: number;\n g: number;\n b: number;\n} {\n const h = hsl.h / 360;\n const s = hsl.s / 100;\n const l = hsl.l / 100;\n\n if (s === 0) {\n return { r: l, g: l, b: l };\n }\n\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n\n return {\n r: hueToRgb(p, q, h + 1 / 3),\n g: hueToRgb(p, q, h),\n b: hueToRgb(p, q, h - 1 / 3),\n };\n}\n\nfunction hueToRgb(p: number, q: number, t: number): number {\n let tt = t;\n if (tt < 0) tt += 1;\n if (tt > 1) tt -= 1;\n if (tt < 1 / 6) return p + (q - p) * 6 * tt;\n if (tt < 1 / 2) return q;\n if (tt < 2 / 3) return p + (q - p) * (2 / 3 - tt) * 6;\n return p;\n}\n\n/* ------------------------------------------------------------------ */\n/* Format / Parse */\n/* ------------------------------------------------------------------ */\n\n/** Format an HSLA value to the specified output format. */\nexport function formatOutput(\n hsl: HSLA,\n format: 'hex' | 'hsl' | 'rgba',\n): string {\n switch (format) {\n case 'hex':\n return hslToHex(hsl);\n case 'hsl':\n if (hsl.a < 1) {\n return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${hsl.a})`;\n }\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n case 'rgba':\n return hslToRgba(hsl);\n }\n}\n\n/** Parse any supported colour string into HSLA. Returns null on failure. */\nexport function parseInput(value: string): HSLA | null {\n const trimmed = value.trim();\n if (!trimmed) return null;\n\n // Hex: #rgb, #rrggbb, #rrggbbaa\n if (trimmed.startsWith('#')) {\n const body = trimmed.slice(1);\n if (!/^[0-9a-fA-F]{3,8}$/.test(body)) return null;\n if (![3, 4, 6, 8].includes(body.length)) return null;\n return hexToHsl(trimmed);\n }\n\n // hsla(h, s%, l%, a) or hsl(h, s%, l%)\n const hslaMatch = trimmed.match(\n /^hsla?\\(\\s*([\\d.]+)\\s*[,/]\\s*([\\d.]+)%?\\s*[,/]\\s*([\\d.]+)%?\\s*(?:[,/]\\s*([\\d.]+))?\\s*\\)$/,\n );\n if (hslaMatch) {\n return {\n h: Math.round(parseFloat(hslaMatch[1])) % 360,\n s: Math.round(parseFloat(hslaMatch[2])),\n l: Math.round(parseFloat(hslaMatch[3])),\n a: hslaMatch[4] !== undefined ? parseFloat(hslaMatch[4]) : 1,\n };\n }\n\n // rgba(r, g, b, a) or rgb(r, g, b)\n const rgbaMatch = trimmed.match(\n /^rgba?\\(\\s*([\\d.]+)\\s*[,/]\\s*([\\d.]+)\\s*[,/]\\s*([\\d.]+)\\s*(?:[,/]\\s*([\\d.]+))?\\s*\\)$/,\n );\n if (rgbaMatch) {\n const r = parseFloat(rgbaMatch[1]) / 255;\n const g = parseFloat(rgbaMatch[2]) / 255;\n const b = parseFloat(rgbaMatch[3]) / 255;\n const a = rgbaMatch[4] !== undefined ? parseFloat(rgbaMatch[4]) : 1;\n return rgbToHsl(r, g, b, a);\n }\n\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* Contrast — WCAG 2.x relative luminance */\n/* ------------------------------------------------------------------ */\n\n/** Relative luminance per WCAG 2.x (0 = black, 1 = white). */\nexport function relativeLuminance(hsl: HSLA): number {\n const { r, g, b } = hslToRgbComponents(hsl);\n const linearise = (c: number) =>\n c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n return 0.2126 * linearise(r) + 0.7152 * linearise(g) + 0.0722 * linearise(b);\n}\n\n/** WCAG 2.x contrast ratio between two colours. */\nexport function contrastRatio(fg: HSLA, bg: HSLA): number {\n const lum1 = relativeLuminance(fg);\n const lum2 = relativeLuminance(bg);\n const lighter = Math.max(lum1, lum2);\n const darker = Math.min(lum1, lum2);\n return Math.round(((lighter + 0.05) / (darker + 0.05)) * 100) / 100;\n}\n\n/** Meets WCAG AA for normal text (≥ 4.5:1). */\nexport function meetsAA(ratio: number): boolean {\n return ratio >= 4.5;\n}\n\n/** Meets WCAG AAA for normal text (≥ 7:1). */\nexport function meetsAAA(ratio: number): boolean {\n return ratio >= 7;\n}\n","export interface PaletteSwatch {\n name: string;\n hex: string;\n /** Recommended text colour for contrast. */\n textColor?: '#000000' | '#ffffff';\n}\n\n/**\n * Material Design appointment colours — mirrors the platform's `DoctorColor`\n * entity. Pink 500 is first because it's the default appointment colour;\n * remaining dark (white-text) colours follow alphabetically, then light\n * (black-text) colours alphabetically.\n */\nexport const APPOINTMENT_PALETTE: PaletteSwatch[] = [\n { name: 'Pink 500', hex: '#e91e63', textColor: '#ffffff' },\n { name: 'Black', hex: '#000000', textColor: '#ffffff' },\n { name: 'Blue 500', hex: '#2196f3', textColor: '#ffffff' },\n { name: 'Blue 900', hex: '#0d47a1', textColor: '#ffffff' },\n { name: 'Blue Grey 500', hex: '#607d8b', textColor: '#ffffff' },\n { name: 'Blue Grey 800', hex: '#37474f', textColor: '#ffffff' },\n { name: 'Brown 500', hex: '#795548', textColor: '#ffffff' },\n { name: 'Deep Orange 500', hex: '#ff5722', textColor: '#ffffff' },\n { name: 'Deep Purple 500', hex: '#673ab7', textColor: '#ffffff' },\n { name: 'Green 500', hex: '#4caf50', textColor: '#ffffff' },\n { name: 'Green 900', hex: '#1b5e20', textColor: '#ffffff' },\n { name: 'Indigo 500', hex: '#3f51b5', textColor: '#ffffff' },\n { name: 'Indigo 900', hex: '#1a237e', textColor: '#ffffff' },\n { name: 'Pink 900', hex: '#880e4f', textColor: '#ffffff' },\n { name: 'Purple 500', hex: '#9c27b0', textColor: '#ffffff' },\n { name: 'Purple 900', hex: '#4a148c', textColor: '#ffffff' },\n { name: 'Red 500', hex: '#f44336', textColor: '#ffffff' },\n { name: 'Red 900', hex: '#b71c1c', textColor: '#ffffff' },\n { name: 'Teal 500', hex: '#009688', textColor: '#ffffff' },\n { name: 'Teal 900', hex: '#004d40', textColor: '#ffffff' },\n { name: 'Amber 500', hex: '#ffc107', textColor: '#000000' },\n { name: 'Cyan 500', hex: '#00bcd4', textColor: '#000000' },\n { name: 'Grey 500', hex: '#9e9e9e', textColor: '#000000' },\n { name: 'Light Blue 500', hex: '#03a9f4', textColor: '#000000' },\n { name: 'Light Green 500', hex: '#8bc34a', textColor: '#000000' },\n { name: 'Lime 500', hex: '#cddc39', textColor: '#000000' },\n { name: 'Orange 500', hex: '#ff9800', textColor: '#000000' },\n { name: 'Orange 900', hex: '#e65100', textColor: '#000000' },\n { name: 'White', hex: '#ffffff', textColor: '#000000' },\n { name: 'Yellow 500', hex: '#ffeb3b', textColor: '#000000' },\n];\n\n/** Alfadocs brand palette — the six brand families × 3 shades (300/500/700). */\nexport const BRAND_PALETTE: PaletteSwatch[] = [\n { name: 'Blue 300', hex: '#70738c' },\n { name: 'Blue 500', hex: '#292e53' },\n { name: 'Blue 700', hex: '#1d213b' },\n { name: 'Violet 300', hex: '#9995ee' },\n { name: 'Violet 500', hex: '#6761e5' },\n { name: 'Violet 700', hex: '#4945a3' },\n { name: 'Purple 300', hex: '#ccaafa' },\n { name: 'Purple 500', hex: '#b380f8' },\n { name: 'Purple 700', hex: '#7f5bb0' },\n { name: 'Magenta 300', hex: '#ea7ffc' },\n { name: 'Magenta 500', hex: '#e040fb' },\n { name: 'Magenta 700', hex: '#9f2db2' },\n { name: 'Fuchsia 300', hex: '#fa76fc' },\n { name: 'Fuchsia 500', hex: '#f732fb' },\n { name: 'Fuchsia 700', hex: '#af24b2' },\n { name: 'Grey 300', hex: '#f9f6f3' },\n { name: 'Grey 500', hex: '#f6f1ed' },\n { name: 'Grey 700', hex: '#afaba8' },\n];\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { cva } from 'class-variance-authority';\nimport { Check, X } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useFormField } from '../form-field/form-field-context';\nimport { Slider } from '../slider/slider';\nimport { useAgentRegistration } from '../../agent';\nimport { colorPickerAgent } from './color-picker.agent';\n\n/** Agent-readiness curated handle for ColorPicker. */\nexport interface ColorPickerHandle {\n getValue: () => string;\n setValue: (hex: string) => void;\n}\nimport {\n contrastRatio,\n formatOutput,\n hslToHex,\n meetsAA,\n meetsAAA,\n parseInput,\n type HSLA,\n} from './color-utils';\nimport { APPOINTMENT_PALETTE, type PaletteSwatch } from './palettes';\n\nconst COLS = 6;\n\nconst triggerVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[length:var(--font-size-sm)] ds:ps-3 ds:pe-3',\n md: 'ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)] ds:ps-3 ds:pe-3',\n lg: 'ds:h-12 ds:text-[length:var(--font-size-lg)] ds:ps-4 ds:pe-4',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst swatchVariants = cva(\n [\n 'ds:relative ds:rounded-[var(--radius-sm)] ds:border-2 ds:cursor-pointer',\n 'ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]',\n 'ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:hover:scale-110',\n // The swatch background is the user-picked colour — set as a CSS custom\n // property via inline `style` per 23-constraints §Runtime-computed\n // dimensions (CSS custom property setter; the bg rule lives on the class).\n 'ds:bg-[var(--swatch-bg)]',\n ].join(' '),\n {\n variants: {\n selected: {\n true: 'ds:border-[var(--primary)] ds:shadow-[var(--shadow-md)]',\n false: 'ds:border-transparent',\n },\n },\n defaultVariants: { selected: false },\n },\n);\n\nconst PANEL_CLASSES = [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:p-[var(--spacing-md)]',\n].join(' ');\n\n// Checkerboard under the opacity track — static geometry, so expressed as\n// Tailwind arbitrary values rather than inline `style`. `grey-700` comes\n// from the closed palette so the tile colour still tracks the token ramp.\nconst OPACITY_CHECKER_CLASSES = [\n 'ds:bg-[image:repeating-conic-gradient(var(--color-grey-700)_0%_25%,transparent_0%_50%)]',\n 'ds:bg-[size:8px_8px]',\n].join(' ');\n\nconst PANEL_COMPACT_CLASSES = [\n 'ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:p-[var(--spacing-sm)]',\n].join(' ');\n\nconst POPOVER_CONTENT_CLASSES = [\n 'ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]',\n 'ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:shadow-[var(--shadow-lg)]',\n 'ds:w-72',\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:data-[side=bottom]:slide-in-from-top-2 ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:data-[side=left]:slide-in-from-right-2 ds:data-[side=right]:slide-in-from-left-2',\n].join(' ');\n\nconst HEX_INPUT_CLASSES = [\n 'ds:w-full ds:rounded-[var(--radius-sm)] ds:border ds:bg-[var(--background)] ds:text-[var(--foreground)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[var(--font-size-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n].join(' ');\n\n// Makes the Slider track/range transparent so the gradient behind shows through\nconst TRANSPARENT_SLIDER =\n 'ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent';\n\nexport interface ColorPickerProps {\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n format?: 'hex' | 'hsl' | 'rgba';\n allowOpacity?: boolean;\n palette?: (string | PaletteSwatch)[];\n against?: string;\n size?: 'sm' | 'md' | 'lg';\n disabled?: boolean;\n variant?: 'inline' | 'popover';\n /** Show only the swatch grid without sliders, hex input, or contrast readout */\n compact?: boolean;\n className?: string;\n}\n\nexport const ColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(\n (props, ref) => {\n const {\n value,\n defaultValue,\n onChange,\n format = 'hex',\n allowOpacity = false,\n palette,\n against,\n size = 'md',\n disabled = false,\n variant = 'inline',\n compact = true,\n className,\n } = props;\n\n const { t } = useTranslation();\n const ctx = useFormField();\n const generatedId = useId();\n const pickerId = ctx.id || generatedId;\n const effectiveDisabled = ctx.disabled || disabled;\n\n const isControlled = value !== undefined;\n const [internalHsl, setInternalHsl] = useState<HSLA>(() => {\n const initial = value ?? defaultValue;\n if (initial) {\n const parsed = parseInput(initial);\n if (parsed) return parsed;\n }\n return { h: 0, s: 100, l: 50, a: 1 };\n });\n\n const currentHsl: HSLA = useMemo(() => {\n if (isControlled && value) {\n const parsed = parseInput(value);\n if (parsed) return parsed;\n }\n return internalHsl;\n }, [isControlled, value, internalHsl]);\n\n const emitChange = useCallback(\n (hsl: HSLA) => {\n const finalHsl = allowOpacity ? hsl : { ...hsl, a: 1 };\n if (!isControlled) setInternalHsl(finalHsl);\n onChange?.(formatOutput(finalHsl, format));\n },\n [allowOpacity, format, isControlled, onChange],\n );\n\n const [hexInput, setHexInput] = useState(() => hslToHex(currentHsl));\n const [hexError, setHexError] = useState(false);\n const revertTimerRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n const currentHslRef = useRef(currentHsl);\n currentHslRef.current = currentHsl;\n\n useEffect(() => {\n setHexInput(hslToHex(currentHsl));\n setHexError(false);\n if (revertTimerRef.current !== undefined) {\n clearTimeout(revertTimerRef.current);\n revertTimerRef.current = undefined;\n }\n }, [currentHsl]);\n\n useEffect(() => {\n return () => {\n if (revertTimerRef.current !== undefined) {\n clearTimeout(revertTimerRef.current);\n }\n };\n }, []);\n\n const handleHexBlur = () => {\n const parsed = parseInput(hexInput);\n if (parsed) {\n setHexError(false);\n emitChange(parsed);\n } else {\n setHexError(true);\n revertTimerRef.current = setTimeout(() => {\n revertTimerRef.current = undefined;\n setHexError(false);\n setHexInput(hslToHex(currentHslRef.current));\n }, 800);\n }\n };\n\n const swatches: PaletteSwatch[] = useMemo(() => {\n if (!palette) return APPOINTMENT_PALETTE;\n return palette.map((item) =>\n typeof item === 'string'\n ? { name: item.toUpperCase(), hex: item }\n : item,\n );\n }, [palette]);\n\n const currentHex = hslToHex(currentHsl);\n // Normalise palette entries through parseInput so swatches declared as\n // rgb()/hsl()/shorthand hex still match — raw `s.hex` comparison misses\n // any non-literal-hex representation.\n const swatchCanonicalHexes = useMemo(\n () =>\n swatches.map((s) => {\n const parsed = parseInput(s.hex);\n return parsed ? hslToHex(parsed).toLowerCase() : null;\n }),\n [swatches],\n );\n const selectedSwatchIndex = swatchCanonicalHexes.findIndex(\n (hex) => hex !== null && hex === currentHex.toLowerCase(),\n );\n\n const gridRef = useRef<HTMLDivElement>(null);\n const [focusedIndex, setFocusedIndex] = useState(\n selectedSwatchIndex >= 0 ? selectedSwatchIndex : 0,\n );\n\n const focusSwatch = (index: number) => {\n const cells =\n gridRef.current?.querySelectorAll<HTMLElement>('[role=\"gridcell\"]');\n if (cells?.[index]) {\n cells[index].focus();\n setFocusedIndex(index);\n }\n };\n\n const handleGridKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (effectiveDisabled) return;\n const total = swatches.length;\n let next = focusedIndex;\n\n switch (event.key) {\n case 'ArrowRight':\n next = (focusedIndex + 1) % total;\n break;\n case 'ArrowLeft':\n next = (focusedIndex - 1 + total) % total;\n break;\n case 'ArrowDown':\n next = Math.min(focusedIndex + COLS, total - 1);\n break;\n case 'ArrowUp':\n next = Math.max(focusedIndex - COLS, 0);\n break;\n case 'Home':\n next = Math.floor(focusedIndex / COLS) * COLS;\n break;\n case 'End':\n next = Math.min(\n Math.floor(focusedIndex / COLS) * COLS + COLS - 1,\n total - 1,\n );\n break;\n case 'PageUp':\n next = focusedIndex % COLS;\n break;\n case 'PageDown': {\n const lastRowStart = Math.floor((total - 1) / COLS) * COLS;\n next = Math.min(lastRowStart + (focusedIndex % COLS), total - 1);\n break;\n }\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const parsed = parseInput(swatches[focusedIndex].hex);\n if (parsed) emitChange(parsed);\n return;\n }\n default:\n return;\n }\n\n event.preventDefault();\n focusSwatch(next);\n };\n\n const [open, setOpen] = useState(false);\n\n const agentHandle = useMemo<ColorPickerHandle>(\n () => ({\n getValue: () => hslToHex(currentHslRef.current),\n setValue: (hex) => {\n const parsed = parseInput(hex);\n if (parsed) emitChange(parsed);\n },\n }),\n [emitChange],\n );\n useAgentRegistration(colorPickerAgent, agentHandle, pickerId);\n\n const contrastInfo = useMemo(() => {\n if (!against) return null;\n const bgHsl = parseInput(against);\n if (!bgHsl) return null;\n const ratio = contrastRatio(currentHsl, bgHsl);\n return { ratio, aa: meetsAA(ratio), aaa: meetsAAA(ratio) };\n }, [against, currentHsl]);\n\n const swatchGrid = (\n // eslint-disable-next-line jsx-a11y/interactive-supports-focus -- inner gridcells are individually focusable via roving tabindex\n <div\n ref={gridRef}\n role=\"grid\"\n aria-label={t('inputs.colorPicker.paletteLabel', 'Colour swatches')}\n onKeyDown={handleGridKeyDown}\n className=\"ds:grid ds:grid-cols-6 ds:gap-[var(--spacing-xs)]\"\n >\n {swatches.map((_swatch, i) => {\n const rowStart = Math.floor(i / COLS) * COLS;\n const isFirstInRow = i === rowStart;\n return isFirstInRow ? (\n <div key={i} role=\"row\" className=\"ds:contents\">\n {swatches.slice(rowStart, rowStart + COLS).map((s, j) => {\n const idx = rowStart + j;\n const sel = idx === selectedSwatchIndex;\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- parent grid handles keyboard navigation via onKeyDown\n <div\n key={s.hex}\n role=\"gridcell\"\n aria-selected={sel}\n aria-label={t('inputs.colorPicker.swatchLabel', {\n name: s.name,\n hex: s.hex,\n })}\n tabIndex={idx === focusedIndex ? 0 : -1}\n onClick={() => {\n if (effectiveDisabled) return;\n const parsed = parseInput(s.hex);\n if (parsed) emitChange(parsed);\n setFocusedIndex(idx);\n }}\n className={swatchVariants({ selected: sel })}\n // eslint-disable-next-line react/forbid-dom-props -- user-picked swatch hex injected via --swatch-bg CSS variable\n style={{ ['--swatch-bg' as string]: s.hex }}\n >\n {sel ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:absolute ds:inset-0 ds:m-auto ds:size-4 ds:text-[var(--background)] ds:mix-blend-difference\"\n />\n ) : null}\n </div>\n );\n })}\n </div>\n ) : null;\n })}\n </div>\n );\n\n const fullControls = compact ? null : (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <label\n htmlFor={`${pickerId}-hex`}\n className=\"ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]\"\n >\n {t('inputs.colorPicker.hex', 'Hex')}\n </label>\n <bdi dir=\"ltr\">\n <input\n id={`${pickerId}-hex`}\n type=\"text\"\n value={hexInput}\n disabled={effectiveDisabled}\n onChange={(e) => setHexInput(e.target.value)}\n onBlur={handleHexBlur}\n className={`${HEX_INPUT_CLASSES} ${hexError ? 'ds:border-[var(--destructive)]' : 'ds:border-[color:var(--border)]'}`}\n />\n </bdi>\n </div>\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <SliderWithGradient\n label={t('inputs.colorPicker.hue', 'Hue')}\n gradient=\"linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))\"\n min={0}\n max={360}\n value={currentHsl.h}\n onChange={(h) => emitChange({ ...currentHsl, h })}\n formatValue={(v) => `H ${v}°`}\n disabled={effectiveDisabled}\n />\n <SliderWithGradient\n label={t('inputs.colorPicker.saturation', 'Saturation')}\n gradient={`linear-gradient(to right, hsl(${currentHsl.h},0%,${currentHsl.l}%), hsl(${currentHsl.h},100%,${currentHsl.l}%))`}\n min={0}\n max={100}\n value={currentHsl.s}\n onChange={(s) => emitChange({ ...currentHsl, s })}\n formatValue={(v) => `S ${v}%`}\n disabled={effectiveDisabled}\n />\n <SliderWithGradient\n label={t('inputs.colorPicker.lightness', 'Lightness')}\n gradient={`linear-gradient(to right, hsl(${currentHsl.h},${currentHsl.s}%,0%), hsl(${currentHsl.h},${currentHsl.s}%,50%), hsl(${currentHsl.h},${currentHsl.s}%,100%))`}\n min={0}\n max={100}\n value={currentHsl.l}\n onChange={(l) => emitChange({ ...currentHsl, l })}\n formatValue={(v) => `L ${v}%`}\n disabled={effectiveDisabled}\n />\n {allowOpacity ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <label className=\"ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]\">\n {t('inputs.colorPicker.opacity', 'Opacity')}\n </label>\n <div className=\"ds:relative\">\n <div\n className={`ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${OPACITY_CHECKER_CLASSES}`}\n aria-hidden=\"true\"\n />\n <div\n className=\"ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--opacity-gradient)]\"\n // eslint-disable-next-line react/forbid-dom-props -- opacity-track gradient derived from live HSL, no token equivalent\n style={{\n ['--opacity-gradient' as string]: `linear-gradient(to right, hsla(${currentHsl.h},${currentHsl.s}%,${currentHsl.l}%,0), hsl(${currentHsl.h},${currentHsl.s}%,${currentHsl.l}%))`,\n }}\n aria-hidden=\"true\"\n />\n <Slider\n min={0}\n max={100}\n step={1}\n value={[Math.round(currentHsl.a * 100)]}\n onValueChange={([v]) =>\n emitChange({ ...currentHsl, a: v / 100 })\n }\n aria-label={t('inputs.colorPicker.opacity', 'Opacity')}\n formatValue={(v) => `${v}%`}\n disabled={effectiveDisabled}\n className={TRANSPARENT_SLIDER}\n />\n </div>\n </div>\n ) : null}\n </div>\n\n {contrastInfo ? (\n <div\n className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <span className=\"ds:tabular-nums\">\n {t('inputs.colorPicker.contrastRatio', {\n ratio: contrastInfo.ratio.toFixed(1),\n })}\n </span>\n <ContrastBadge level=\"AA\" passes={contrastInfo.aa} t={t} />\n <ContrastBadge level=\"AAA\" passes={contrastInfo.aaa} t={t} />\n </div>\n ) : null}\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <div\n className=\"ds:size-8 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--swatch-bg)]\"\n // eslint-disable-next-line react/forbid-dom-props -- live picked colour injected via --swatch-bg CSS variable\n style={{ ['--swatch-bg' as string]: hslToHex(currentHsl) }}\n aria-hidden=\"true\"\n />\n <span className=\"ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums\">\n {formatOutput(currentHsl, format)}\n </span>\n </div>\n </>\n );\n\n const panelContent = (\n <div className={compact ? PANEL_COMPACT_CLASSES : PANEL_CLASSES}>\n {swatchGrid}\n {fullControls}\n </div>\n );\n\n if (variant === 'inline') {\n return (\n <div\n ref={ref}\n id={pickerId}\n className={className}\n aria-describedby={ctx.describedBy || undefined}\n aria-invalid={ctx.invalid || undefined}\n aria-disabled={effectiveDisabled || undefined}\n data-component=\"color-picker\"\n data-component-id={pickerId}\n data-testid=\"color-picker\"\n >\n {panelContent}\n </div>\n );\n }\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild disabled={effectiveDisabled}>\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- FormField propagates invalid state to its trigger; users rely on this for validation announcements */}\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n id={pickerId}\n aria-describedby={ctx.describedBy || undefined}\n aria-invalid={ctx.invalid || undefined}\n // In compact mode the trigger only renders the swatch (which is\n // aria-hidden). Provide a fallback name so the button is named\n // for AT regardless of variant. The current value is announced\n // separately via the hex/HSL output inside the popover.\n aria-label={\n compact\n ? t('inputs.colorPicker.triggerLabel', 'Choose a colour')\n : undefined\n }\n className={triggerVariants({ size, className })}\n data-component=\"color-picker\"\n data-component-id={pickerId}\n data-testid=\"color-picker-trigger\"\n >\n <span\n className={`ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${compact ? '' : ' ds:me-[var(--spacing-sm)]'}`}\n aria-hidden=\"true\"\n // eslint-disable-next-line react/forbid-dom-props -- trigger preview swatch shows current picked colour via --swatch-bg\n style={{ ['--swatch-bg' as string]: hslToHex(currentHsl) }}\n />\n {compact ? null : (\n <span className=\"ds:text-start ds:truncate ds:tabular-nums\">\n {formatOutput(currentHsl, format)}\n </span>\n )}\n </button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n align=\"start\"\n className={POPOVER_CONTENT_CLASSES}\n >\n {panelContent}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n },\n);\n\nColorPicker.displayName = 'ColorPicker';\n\nfunction ContrastBadge({\n level,\n passes,\n t,\n}: {\n level: string;\n passes: boolean;\n t: (key: string, fallback: string) => string;\n}) {\n return (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <abbr\n title={`Web Content Accessibility Guidelines Level ${level}`}\n className=\"ds:no-underline ds:font-medium\"\n >\n {level}\n </abbr>\n {passes ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-[var(--success)]\"\n />\n ) : (\n <X\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-[var(--destructive)]\"\n />\n )}\n <span className=\"ds:sr-only\">\n {passes\n ? t('inputs.colorPicker.contrastPass', 'Pass')\n : t('inputs.colorPicker.contrastFail', 'Fail')}\n </span>\n </span>\n );\n}\n\nfunction SliderWithGradient({\n label,\n gradient,\n min,\n max,\n value,\n onChange,\n formatValue,\n disabled,\n}: {\n label: string;\n gradient: string;\n min: number;\n max: number;\n value: number;\n onChange: (v: number) => void;\n formatValue: (v: number) => string;\n disabled: boolean;\n}) {\n return (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <label className=\"ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]\">\n {label}\n </label>\n <div className=\"ds:relative\">\n <div\n className=\"ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--slider-gradient)]\"\n // eslint-disable-next-line react/forbid-dom-props -- hue/saturation/lightness gradient derived from live HSL, no token equivalent\n style={{ ['--slider-gradient' as string]: gradient }}\n aria-hidden=\"true\"\n />\n <Slider\n min={min}\n max={max}\n step={1}\n value={[value]}\n onValueChange={([v]) => onChange(v)}\n aria-label={label}\n formatValue={formatValue}\n disabled={disabled}\n className={TRANSPARENT_SLIDER}\n />\n </div>\n </div>\n );\n}\n"],"names":["colorPickerAgent","handle","args","hexToHsl","hex","h","g","b","a","rgbToHsl","r","max","min","l","hue","sat","d","hslToHex","hsl","hslToRgbComponents","toHex","n","base","hslToRgba","ri","gi","bi","s","q","p","hueToRgb","t","tt","formatOutput","format","parseInput","value","trimmed","body","hslaMatch","rgbaMatch","relativeLuminance","linearise","c","contrastRatio","fg","bg","lum1","lum2","lighter","darker","meetsAA","ratio","meetsAAA","APPOINTMENT_PALETTE","BRAND_PALETTE","COLS","triggerVariants","cva","swatchVariants","PANEL_CLASSES","OPACITY_CHECKER_CLASSES","PANEL_COMPACT_CLASSES","POPOVER_CONTENT_CLASSES","HEX_INPUT_CLASSES","TRANSPARENT_SLIDER","ColorPicker","forwardRef","props","ref","defaultValue","onChange","allowOpacity","palette","against","size","disabled","variant","compact","className","useTranslation","ctx","useFormField","generatedId","useId","pickerId","effectiveDisabled","isControlled","internalHsl","setInternalHsl","useState","initial","parsed","currentHsl","useMemo","emitChange","useCallback","finalHsl","hexInput","setHexInput","hexError","setHexError","revertTimerRef","useRef","currentHslRef","useEffect","handleHexBlur","swatches","item","currentHex","selectedSwatchIndex","gridRef","focusedIndex","setFocusedIndex","focusSwatch","index","cells","_a","handleGridKeyDown","event","total","next","lastRowStart","open","setOpen","agentHandle","useAgentRegistration","contrastInfo","bgHsl","swatchGrid","jsx","_swatch","i","rowStart","j","idx","sel","Check","fullControls","jsxs","Fragment","e","SliderWithGradient","v","Slider","ContrastBadge","panelContent","Popover","level","passes","X","label","gradient","formatValue"],"mappings":";;;;;;;;;;AASO,MAAMA,KAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAC,MAAM;AAAA,EACrB,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,a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