{"version":3,"file":"chunk-e8ac1e74.js","sources":["../../../../../app/src/editor/events.ts"],"sourcesContent":["export const enum EditorEvents {\n CLEAR_CHANGES = \"editor_clear_changes\",\n TOGGLE_EDITING = \"editor_toggle_editing\",\n HIGHLIGHT_TOGGLED = \"editor_highlight_toggled\",\n}\n\nexport type EditorClearChangesEvent = {\n type: EditorEvents.CLEAR_CHANGES;\n};\n\nexport type EditorToggleEditingEvent = {\n type: EditorEvents.TOGGLE_EDITING;\n};\n\nexport type EditorHighlightToggledEvent = {\n type: EditorEvents.HIGHLIGHT_TOGGLED;\n state: \"added\" | \"removed\";\n};\n\nexport type EditorEvent = EditorClearChangesEvent | EditorToggleEditingEvent;\n\nexport function clearEditorChanges() {\n fireEvent(EditorEvents.CLEAR_CHANGES, { type: EditorEvents.CLEAR_CHANGES });\n}\n\nexport function toggleEditorEditing() {\n fireEvent(EditorEvents.TOGGLE_EDITING, { type: EditorEvents.TOGGLE_EDITING });\n}\n\nexport function editorHighlightToggled(state: \"added\" | \"removed\") {\n fireEvent(EditorEvents.HIGHLIGHT_TOGGLED, { type: EditorEvents.HIGHLIGHT_TOGGLED, state });\n}\n\nfunction fireEvent(type: EditorEvents, data: Omit) {\n const event = new CustomEvent(type, { detail: data });\n dispatchEvent(event);\n}\n"],"names":["EditorEvents","clearEditorChanges","fireEvent","toggleEditorEditing","type","data","event"],"mappings":"AAAkB,IAAAA,GAAAA,IAChBA,EAAA,cAAgB,uBAChBA,EAAA,eAAiB,wBACjBA,EAAA,kBAAoB,2BAHJA,IAAAA,GAAA,CAAA,CAAA,EAqBX,SAASC,GAAqB,CACnCC,EAAU,uBAA4B,CAAE,KAAM,sBAA4B,CAAA,CAC5E,CAEO,SAASC,GAAsB,CACpCD,EAAU,wBAA6B,CAAE,KAAM,uBAA6B,CAAA,CAC9E,CAMA,SAASA,EAAUE,EAAoBC,EAAiC,CACtE,MAAMC,EAAQ,IAAI,YAAYF,EAAM,CAAE,OAAQC,EAAM,EACpD,cAAcC,CAAK,CACrB"}