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,EAAA,OAAQ,MAAA,CAAO,MAAA,CAAO,iBAAiB,CAAA,CAAe,SAAS,CAAC,CAAA;AAClE;AAOO,SAAS,YACd,MAAA,EAC4C;AAC5C,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA;AAC9B,EAAA,IAAI,OAAO,CAAA,IAAK,GAAA,KAAQ,MAAA,CAAO,MAAA,GAAS,GAAG,OAAO,IAAA;AAClD,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,MAAA,CAAO,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA;AAAA,IAC9B,IAAA,EAAM,MAAA,CAAO,KAAA,CAAM,GAAA,GAAM,CAAC;AAAA,GAC5B;AACF","file":"actions.cjs","sourcesContent":["/**\n * Canonical audit action names — Oshon's controlled vocabulary.\n *\n * Every primitive and data component draws from this catalog when\n * emitting audit events. Ad-hoc strings are a lint smell: consumers who\n * index on `action === 'click'` (without a component namespace) end up\n * with ambiguous event streams, and downstream governance (§5 ARCH\n * `@oshon-ai/governance`) can't classify what it's seeing.\n *\n * Naming convention (ADR-004):\n *   `<namespace>:<verb>`\n *   - `<namespace>` is a primitive name (`button`, `dialog`, `tooltip`)\n *     or a resource class (`data`, `row`, `settings`). Always lowercase.\n *   - `<verb>` is present-tense (`click`, `open`, `sort`) or a past\n *     participle when the event fires after-the-fact (`denied`).\n *\n * See ARCHITECTURE.md §10 for the built-in actions list and the rule\n * that governance reports group by namespace.\n */\n\n/** Primitive-emitted actions (Phase 3a + 3b scope). */\nexport const PRIMITIVE_ACTIONS = {\n  // Button\n  BUTTON_CLICK: 'button:click',\n\n  // Dialog\n  DIALOG_OPEN: 'dialog:open',\n  DIALOG_CLOSE: 'dialog:close',\n\n  // Tooltip — deliberately emits none (ADR-003). Reserved for future use.\n\n  // Phase 3b primitives. Exported now so Phase 4 data components can\n  // reference them without reshuffling this file on every primitive land.\n  INPUT_CHANGE: 'input:change',\n  INPUT_BLUR: 'input:blur',\n  SELECT_OPEN: 'select:open',\n  SELECT_CLOSE: 'select:close',\n  SELECT_CHANGE: 'select:change',\n  POPOVER_OPEN: 'popover:open',\n  POPOVER_CLOSE: 'popover:close',\n  TABS_CHANGE: 'tabs:change',\n  TOGGLE_CHANGE: 'toggle:change',\n} as const;\n\n/** Data-component actions (Phase 4+ scope per ARCHITECTURE §10). */\nexport const DATA_ACTIONS = {\n  DATA_READ: 'data:read',\n  DATA_SORT: 'data:sort',\n  DATA_FILTER: 'data:filter',\n  DATA_SELECT: 'data:select',\n  DATA_BULK: 'data:bulk',\n  DATA_EXPORT: 'data:export',\n  DATA_EDIT: 'data:edit',\n  /** Multi-level row grouping (Phase B). `details.grouping = string[]`. */\n  DATA_GROUP: 'data:group',\n  /** Row expansion — group collapse/expand or master-detail (Phase B/C). */\n  DATA_EXPAND: 'data:expand',\n  /** Column-order transition (Phase D drag-to-reorder). `details.order = string[]`. */\n  DATA_REORDER: 'data:reorder',\n  /** Column-visibility transition (Phase D show/hide). `details.visibility = Record<string, boolean>`. */\n  DATA_VISIBILITY: 'data:visibility',\n  /** Cell-range transition (Phase F spreadsheet-style selection). `details.range = { r1, c1, r2, c2 }`. */\n  DATA_RANGE: 'data:range',\n  /** Fill-handle commit (Phase F). `details.writes = Record<\"r:c\", value>`. */\n  DATA_FILL: 'data:fill',\n  /** Column pin / unpin (freeze). `details.pinning = { left: string[], right: string[] }`. */\n  DATA_PIN: 'data:pin',\n\n  ROW_VIEW: 'row:view',\n  ROW_EDIT: 'row:edit',\n  ROW_DELETE: 'row:delete',\n\n  SETTINGS_VIEW: 'settings:view',\n  SETTINGS_EDIT: 'settings:edit',\n\n  PERMISSION_DENIED: 'permission:denied',\n} as const;\n\n/**\n * The full canonical catalog. Governance / drift-detection (Phase 5)\n * walks this set to classify event streams.\n */\nexport const CANONICAL_ACTIONS = {\n  ...PRIMITIVE_ACTIONS,\n  ...DATA_ACTIONS,\n} as const;\n\n/** Type-level union of every canonical action. */\nexport type CanonicalAction =\n  (typeof CANONICAL_ACTIONS)[keyof typeof CANONICAL_ACTIONS];\n\n/** True if `s` is a recognised canonical action. */\nexport function isCanonicalAction(s: string): s is CanonicalAction {\n  return (Object.values(CANONICAL_ACTIONS) as string[]).includes(s);\n}\n\n/**\n * Parse a namespaced action into `{ namespace, verb }`. Returns `null`\n * for malformed strings (missing colon, empty halves). Governance reports\n * use this to group event streams by namespace.\n */\nexport function parseAction(\n  action: string,\n): { namespace: string; verb: string } | null {\n  const idx = action.indexOf(':');\n  if (idx <= 0 || idx === action.length - 1) return null;\n  return {\n    namespace: action.slice(0, idx),\n    verb: action.slice(idx + 1),\n  };\n}\n"]}